agentleFS
emiliosheinzemiliosheinz/agent-skills/forge/SKILL.md

forge

Skill18 starsChanged 8 months agoMITView on GitHub

Spec-driven development workflow that takes a change from problem to shipped, verified code in four phases: specify, design, plan, execute — plus a `fix` command to correct course mid-stream. Auto-sizes from one-line fixes to multi-repo refactors. Invoke with `/forge specify|design|plan|execute|fix`. TRIGGER when: the user asks to ship/build/implement a feature, write a PRD or spec or requirements, design architecture, write a technical design, break work into tasks or an implementation plan, run TDD or write acceptance criteria, or correct/adjust an in-flight change — a misstated requirement, a design or implementation detail that's wrong, or a bug found while testing. SKIP for: trivial one-off edits the user already has fully specified, pure code review, or questions about how forge itself works.

54 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use forge-docs, forge-review and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • weselbenSkill

    forge-docs

    Load before code changes, before writing docs or an ADR, when a user question exposes a missing how-to, and when closing a chunk of work; also loaded by forge after each squash-merge and by deep-research after a report.

    Also in 3 projects that use this

  • tonmoy007Skill

    forge-review

    Run a multi-dimensional parallel code review over the current change.

    Also in 3 projects that use this

  • yike-gunshiSkill

    forge-ship

    发布上线:PR only(建 PR 即停)或 Full ship(合并 PR + 同步本地基础分支);测试失败不发布、不 force push,状态汇报严格区分提交/推送/合并/部署。 触发方式:用户说"ship"、"发布"、"合并上线"、"发 PR"。

    Also in 3 projects that use this

  • WordPressSkill

    blueprint

    Use when the deliverable is WordPress Playground Blueprint JSON or a Blueprint bundle, including creating, editing, reviewing, validating schema keys, choosing steps/resources, and debugging Blueprint files. For only running or sharing a Playground environment, use wp-playground.

    Also in 3 projects that use this

  • AnthropicSkill

    brief

    Generate contextual briefings for legal work — daily summary, topic research, or incident response. Use when starting your day and need a scan of legal-relevant items across email, calendar, and contracts, when researching a specific legal question across internal sources, or when a developing situation (data breach, litigation threat, regulatory inquiry) needs rapid context.

    Also in 3 projects that use this

  • OpenAISkill

    audit

    Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the first argument as the phase verb.

    line 33
  2. Distinctive:

    If no verb is given, infer the phase from the request and confirm it.

    line 44
  3. Very specific:

    Every change is one of three sizes.

    line 63
  4. Very specific:

    If the resolved root points inside another repo's .specs/ (e.g.

    line 94
  5. Very specific:

    All work for a change lives under ./.specs/<slug>/ (create it if missing):

    line 98
  6. Distinctive:

    Subagents are stateless: Put everything they need in the prompt (file paths, section refs, constraints).

    line 134
  7. Distinctive:

    Every subagent dispatch picks two dials.

    line 142
  8. Distinctive:

    Never claim a task or gate passed without running it.

    line 200

“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Forge

Forge runs spec-driven development as four phases. You invoke one phase at a time. Each phase does its work, updates shared state, and recommends (but does not run) the next phase. A fifth command, fix, re-enters the flow to correct course at any layer. Every phase's depth auto-sizes to the change — see Sizing.

/forge specify <name>   Understand the problem + capture requirements   → spec.md
/forge design           Architecture, contracts, verification gates     → design.md
/forge plan             Atomic tasks, dependencies, AC traces            → plan.md
/forge execute          Implement, then run independent verifiers        → working code
/forge fix <change>     Correct course mid-stream, keep the chain aligned → aligned artifacts + code

Dispatch

Read the first argument as the phase verb. Read the matching reference file fully before acting — it is the step-by-step playbook for that phase.

VerbReadProduces
specifyreferences/specify.md (+ references/review.md)./.specs/<slug>/spec.md
designreferences/design.md (+ references/review.md)./.specs/<slug>/design.md
planreferences/plan.md./.specs/<slug>/plan.md
executereferences/execute.md (+ references/verification.md)code + commits
fixreferences/fix.mdre-aligned artifacts + code

If no verb is given, infer the phase from the request and confirm it. Never fail because a verb is missing or unknown. Common mappings:

Request patternPhase
"write a PRD", "what should this do", problem with no proposed solutionspecify
"design this", "how should we build X", architecture questiondesign
"break this into tasks", "plan the work"plan
"implement X", "build this", spec + plan already existexecute
"this detail is wrong", "correct course", "I don't like this design", "found a bug while testing", change to an in-flight spec/design/plan/codefix

specify takes a feature name. If absent, ask for one and derive a kebab-case slug.

Forge does not orchestrate phase transitions — you do. Start at any phase. A phase that finds no earlier artifacts gathers the minimum context it needs; each reference describes its own fallback.

Sizing

Every change is one of three sizes. The size controls how deep each phase goes and which phases are needed at all. See references/sizing.md for the full rubric.

SizeRoughlyPipeline
quickone file/function, no new interface/schema/depinline spec → execute (skip design + plan)
standardone component/module, a few filesfull spec → light design → phased plan → execute
complexcrosses components/repos, new subsystem, ambiguousfull pipeline, all gates

The first phase to run picks the size and writes it to state.md. Size can only go up. Any later phase may promote it with a logged reason. A downgrade requires the user's confirmation — ratcheting prevents work from quietly skipping rigor a later phase already showed it needed. Each phase ends by listing which downstream phases the current size needs or lets you skip.

Artifacts and state

Artifact root (session CWD)

All ./.specs/* paths in this skill resolve against the session CWD — the directory the agent was invoked in — not the shell's current directory at the moment of the write. Subsequent cds do not move the artifact root.

At the start of every phase, resolve the artifact root once and reuse it. Capture the session CWD as an absolute path (pwd at the very first Bash call of the session, or the harness-provided starting directory) and set SPECS_ROOT="<abs>/.specs". Every read, write, mkdir, and ls inside this skill must go through $SPECS_ROOT/.... Never use a bare .specs/... after that resolution — a bare path would be interpreted against the current shell CWD and drift into a subfolder.

If the resolved root points inside another repo's .specs/ (e.g. the user invoked the skill from a nested package), stop and confirm with the user before writing.

All work for a change lives under ./.specs/<slug>/ (create it if missing):

./.specs/<slug>/spec.md       what & why (requirements, acceptance criteria, scope)
./.specs/<slug>/design.md     how (architecture, contracts, verification gates)
./.specs/<slug>/plan.md       tasks grouped into phases (parallel within a phase, AC-traced)
./.specs/<slug>/state.md      size, decisions log, task status, handoff — the source of truth
./.specs/<slug>/lessons.md    what went wrong here and the rule going forward

Templates for each are in templates/. state.md is the single source of truth. Re-read it at the start of every phase. Do not assume the runtime preserves its own internal state across phases — if it is not in state.md, it did not happen.

Acceptance criteria are written once, in spec.md, with stable IDs (PREFIX-NN). Design, plan, and execute reference those IDs; they never restate the criterion text.

Lessons

Each change keeps its own ./.specs/<slug>/lessons.md with ## Standing Rules (short imperatives, always loaded) and ## Log (tagged, append-only). Load it at the start of every phase. Append only when something non-obvious was learned: a hack, a gotcha, a corrected wrong assumption, a skipped gate. Routine success writes nothing. See references/lessons.md.

Orchestration (canonical — references should cite, not restate)

  • Use subagents for parallel or heavy work. They run in Claude Code and OpenCode. They keep the main agent's context small and give independent perspectives (execute's verifiers depend on this).
  • Workflow is an optional speed-up for dispatching many subagents at once, where the runtime supports it. Plain sequential subagent calls always work as a backup. Never require Workflow.
  • Match model tier and reasoning effort to the task — don't pay frontier rates for mechanical work. See Model & effort selection below. This is the primary cost lever.
  • One level of delegation. Subagents do not spawn subagents.
  • Subagents are stateless. Put everything they need in the prompt (file paths, section refs, constraints). Outputs over ~100 lines go to a file; return the path, not the content.
  • Prefer AskUserQuestion when available, with a recommended default per question. Fall back to a single plain-text question otherwise. Never bundle unrelated questions.

Model & effort selection (canonical — references cite, not restate)

Every subagent dispatch picks two dials. Set them explicitly per task; never let the whole fan-out default to the most expensive model. This is agent-agnostic — map the tiers to whatever your runtime exposes.

Tier — the model's capability class:

TierUse forClaude CodeOpenCode
economymechanical, well-scoped, low-ambiguity work with a clear pass/fail or a precedent to mirrorhaikucheapest capable model configured
standardordinary implementation and verification needing moderate reasoningsonnetthe default agent model
frontierambiguous synthesis, cross-cutting design, adversarial judgment, hard trade-offsopusstrongest model configured

Pass the tier via the runtime's per-subagent model control (model on the Agent tool or Workflow agent(), model in a subagent definition's frontmatter, or the OpenCode agent's model field). If a runtime exposes no per-subagent model control, skip this dial and rely on effort alone — never block on it.

Effort — reasoning/thinking budget, where the runtime supports a reasoning-effort or thinking-budget setting: low for mechanical tasks, medium for ordinary work, high only for genuinely hard reasoning (adversarial refutation, ambiguous design). Where the runtime has no effort dial, fold the intent into tier choice.

Defaults by work type (start here, adjust for the specific task):

WorkTierEffort
Read-only codebase scouting (specify), mirror-a-precedent implementer with a reuses pointereconomylow
Mechanical [P] implementer task with a clear task gateeconomylow–medium
Ordinary implementer task, most single-verifier runsstandardmedium
Design/architecture synthesis, plan decomposition for a complex changefrontierhigh
Adversarial or cross-cutting verification (the AC-trace / integration verifier)standard→frontierhigh

Size interacts with tier. A quick change should almost never dispatch a frontier subagent; a complex change earns frontier for its design and adversarial gates but still routes mechanical tasks to economy. When unsure between two tiers, pick the lower and let a failed gate promote it — the same ratchet as sizing.

Universal rules (apply to every phase)

State hygiene

  1. Re-read state.md at the start of every phase. Write size, decisions, and status changes there as they happen, not at the end.
  2. Write surgically. Edit only the target section — replace the content between its ## header and the next ## or end-of-file. Never regenerate the whole file or reorder sections; that silently clobbers append-only or update-in-place sections you did not mean to touch. Section write modes:

    SectionWrite mode
    ## Decisionsappend-only (never edit existing rows)
    ## Tasksupdate-in-place (status, evidence)
    ## Validation deltaclear-on-resolve
    ## Verification evidenceappend-on-PASS
    ## Handoffoverwrite

Honesty

  1. Never claim a task or gate passed without running it. Done means you saw it pass, not that you believe it would.
  2. Record honestly. Open questions, skipped gates, and assumptions stay visible. Never cover a gap with an invented answer.

Hand-off

  1. Each phase finishes, reports, and recommends the next verb — it never runs the next phase. The one documented exception is fix: for a contained correction it re-aligns the artifacts and runs the code delta end-to-end in the same invocation (see references/fix.md); a larger correction still only recommends the phase chain.
  2. /create-rfc and /create-adr are separate skills. Use /create-rfc when a significant decision needs stakeholder alignment; use /create-adr when an architectural choice deserves a standalone record. Reach for either at any point in the flow.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.