Skip to content

Junhanliu-dev/espalier-engineering / skills/espalier-init

espalier-init

Verified

Analyze any existing codebase, discover its patterns and best practices, and generate an Espalier structure (rules, skills, wiki, pipeline) so AI coders produce code matching that project's language and conventions. Greenfield repos take the two-pass Decide-Then-Bind path (/espalier-map charts the conventions, init binds them); boilerplate repos run init normally, then map the product. Wires into Claude Code, Codex, and/or GitHub Copilot (.claude/, .agents/skills/ + .codex/, .github/).

FileKindSize
SKILL.mdskill md43.5 KB
hook-templates/check-layer-boundaries-go.shscript665 B
hook-templates/check-layer-boundaries-python.shscript821 B
hook-templates/check-layer-boundaries-typescript.shscript1.6 KB
hook-templates/copilot-hook-adapter.shscript2.4 KB
hook-templates/drift-detect.shscript5.7 KB
hook-templates/drift-helpers.shscript56.4 KB
hook-templates/espalier-outside.shexecutablescript28.8 KB
hook-templates/espalier-pr.shexecutablescript43.2 KB
hook-templates/espalier-stats.shexecutablescript27.3 KB
hook-templates/lookup-helpers.shscript9.5 KB
hook-templates/map-guard.shexecutablescript3.9 KB
hook-templates/maprun-dispatch.shexecutablescript21.0 KB
hook-templates/maprun-integration.shexecutablescript3.4 KB
hook-templates/maprun-merge.shexecutablescript2.9 KB
hook-templates/maprun-pr.shexecutablescript12.8 KB
hook-templates/maprun-verify.shexecutablescript5.0 KB
hook-templates/maprun.pyscript65.6 KB
hook-templates/parse-drift-blocks.pyscript1.1 KB
hook-templates/post-edit-wrapper.shscript2.0 KB
hook-templates/post-merge-backlink.shscript2.2 KB
hook-templates/pre-push-gate-wrapper.shscript3.0 KB
hook-templates/pre-push-gate.shscript18.1 KB
hook-templates/rebuild-commit-index.shscript2.6 KB
references/discovery-checklist.mdmarkdown18.5 KB
references/validation.mdmarkdown16.7 KB
references/wiki-templates.mdmarkdown710 B
references/wiring.mdmarkdown13.5 KB
templates/agent.mdmarkdown3.7 KB
templates/agents/harness-coder.mdmarkdown33.9 KB
templates/agents/harness-reviewer.mdmarkdown25.1 KB
templates/agents/harness-security.mdmarkdown14.0 KB
templates/agents/modes/fix-round.mdmarkdown3.0 KB
templates/agents/modes/re-review.mdmarkdown5.3 KB
templates/agents/modes/repo-audit.mdmarkdown2.8 KB
templates/agents/modes/simplification.mdmarkdown7.0 KB
templates/agents/modes/stage6-abuse-coverage.mdmarkdown1.3 KB
templates/agents/modes/wiki-sweep.mdmarkdown5.6 KB
templates/pipeline.mdmarkdown18.9 KB
templates/rules/coding-standards.mdmarkdown3.2 KB
templates/rules/development-process.mdmarkdown3.2 KB
templates/rules/engineering-structure.mdmarkdown1008 B
templates/rules/production-standards.mdmarkdown5.8 KB
templates/rules/security-standards.mdmarkdown5.6 KB
templates/scout-prompts.mdmarkdown9.0 KB
templates/skills/espalier-ask.mdmarkdown6.4 KB
templates/skills/espalier-audit.mdmarkdown10.0 KB
templates/skills/espalier-coding-references/platform-native.mdmarkdown9.4 KB
templates/skills/espalier-coding-spec.mdmarkdown496 B
templates/skills/espalier-coding.mdmarkdown4.0 KB
templates/skills/espalier-doctor.mdmarkdown8.0 KB
templates/skills/espalier-fix.mdmarkdown77.5 KB
templates/skills/espalier-grill.mdmarkdown21.5 KB
templates/skills/espalier-map.mdmarkdown20.0 KB
templates/skills/espalier-maprun.mdmarkdown31.1 KB
templates/skills/espalier-prune.mdmarkdown13.0 KB
templates/skills/espalier-repot.mdmarkdown7.6 KB
templates/skills/espalier-requirements.mdmarkdown4.7 KB
templates/skills/espalier-review.mdmarkdown4.5 KB
templates/skills/espalier-security.mdmarkdown5.6 KB
templates/skills/espalier-simplify.mdmarkdown25.0 KB
templates/skills/espalier-stages/1-2-requirements.mdmarkdown7.6 KB
templates/skills/espalier-stages/3-coding.mdmarkdown15.0 KB
templates/skills/espalier-stages/4-panel.mdmarkdown14.3 KB
templates/skills/espalier-stages/5-6-contract.mdmarkdown10.3 KB
templates/skills/espalier-stages/7-10-delivery.mdmarkdown16.8 KB
templates/skills/espalier-stages/simple.mdmarkdown14.0 KB
templates/skills/espalier-testing.mdmarkdown2.9 KB
templates/skills/espalier.mdmarkdown27.7 KB

templates/rules/security-standards.md

View on GitHub
# Security Standards

> **The frontend is untrusted input. The backend is the trust boundary.** For any
> value that affects money, identity, permission, data ownership, or a persistent
> write: never trust what the client sent. Re-derive it from the session,
> re-authorize it against the actor, and recompute it from the source of truth
> before it is used in a decision or written to any persistent store. A value that
> arrived in a request is a *claim*, not a *fact*.

This rule is always loaded. `harness-coder` reads it before writing code,
`harness-security` audits against it, and `harness-reviewer` honors it. See
[[espalier-security]] for the audit checklist and abuse-test recipe.

## The Trust Boundary (this project)

{discovered at init — fill from the security scout; treat CURRENT CODE as ground truth}

- **Entry points** (where client data enters): {controllers / REST handlers / GraphQL resolvers / RPC / server actions / queue consumers — the surfaces this project actually uses}
- **Caller identity** (how the backend knows *who* is calling): {session / JWT / auth middleware — pattern + `file:line`}
- **Ownership enforcement** (how the backend proves the actor may touch an object): {pattern + example `file:line`, or "NONE FOUND — treat as a gap"}
- **Request validation** (where/what library validates input at the edge): {library + layer}

## Sensitive Field Taxonomy

A field is **sensitive** if it lands on any of these five risk axes. Sensitive
fields must never be trusted as sent by the client. The seed patterns are
universal; the discovered column is this project's own names.

| Risk axis | What it governs | Seed patterns (always sensitive) | Project-specific (discovered) |
|---|---|---|---|
| **money** | value / quantity that moves money or inventory | `price`, `amount`, `total`, `cost`, `fee`, `discount`, `balance`, `stock`, `quantity` | {discovered} |
| **identity** | who the actor *is* | `userId`, `accountId`, `customerId`, `sub`, actor `email` | {discovered} |
| **permission** | what the actor *may do* | `role`, `isAdmin`, `scope`, `permission`, `grants`, `plan`, `tier` | {discovered} |
| **owner** | which object the actor may touch | `orderId`, `cartId`, `ownerId`, `tenantId`, `projectId`, any resource id in path/body | {discovered} |
| **state** | server-controlled lifecycle | `status`, `state`, `approved`, `paid`, `verified`, `published` | {discovered} |

## Required Controls (per axis)

- **identity → re-derive from the session; never accept from the request.**
  `userId` / `accountId` / `sub` that identify the *actor* come from the
  authenticated session only — never from the request body or path. Do not merely
  "check" a client-supplied actor id (an attacker can send their own correct id and
  pass); refuse to accept it from the client at all.
- **owner → object-level authorization (defeats BOLA / IDOR).** Before reading or
  writing an *object* addressed by a client-supplied resource id, assert the session
  actor *owns* it or holds a role that permits it. A client-supplied id is a
  **lookup key, never an authorization**. Prefer a query scoped by owner
  (`find_where(id, ownerId=session.actor)`) so "not yours" and "not found" return
  the same 404 — no existence oracle. *(User 1's request carrying `cartId=2` must not
  return cart 2.)*
- **money → recompute from the source of truth.** Never persist a `price` / `amount`
  / `total` the client sent. Look the authoritative value up server-side (catalog,
  ledger, pricing service) and compute from that. A client-sent monetary value is
  display-only. *(A tampered `price=0.01` must be ignored, not charged.)*
- **permission → decide server-side; never bind from the body.** `role` / `isAdmin`
  / `scope` come from the session or an authorization store. Never mass-assign them
  from the request body. *(`isAdmin=true` in a profile update must not stick.)*
- **state → enforce the server-side state machine.** Validate both that the
  transition is legal *and* that this actor may perform it. A client cannot set
  `status=paid` / `approved` / `published` directly.
- **stock / balance → validate ranges and apply atomically.** Reject negative or
  over-limit quantities; check-and-decrement against the source of truth atomically
  — no read-then-write race that lets a value go negative.

## Mass Assignment

Never spread a raw request body into a persistence call
(`update(req.body)` / `Model(**request)` / `{...req.body}`). Bind an **explicit
allow-list** of client-settable fields. No field from the taxonomy above is ever
on that allow-list.

## Abuse Tests (required for every sensitive field a change touches)

A control is not trusted until a test proves it holds. For each sensitive field a
change reads or writes, there MUST be a negative test that:

1. **tampers** the value (foreign id, `$0.01` price, `isAdmin=true`, illegal status),
2. asserts the request is **rejected** (the project's convention — `403` / `404` /
   `422`), and
3. asserts the **persistent store is unchanged**.

The `harness-security` audit emits the exact list of fields requiring such a
test; the post-panel contract phase writes them and the contract delta
review blocks if any is missing (serial test-mode: Stage 5 writes, Stage 6
blocks).

## Project-Specific Security Conventions

{discovered at init — the security-relevant patterns THIS codebase already follows,
each backed by an example `file:line`. e.g. "every controller calls
`requireOwner(ctx, id)` before load", "prices come from `PriceService.quote()`",
"edge validation via zod schemas". If none found, say so — absence is itself a
finding the auditor should weigh.}
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall