agentleFS
holgerleichsenringholgerleichsenring/specification-first-agentic-development/skills/spec-first-workflow/SKILL.md

spec-first-workflow

Skill9 starsChanged 56 days agoMITView on GitHub

Specification-First Agentic Development methodology guide. Triggers when a project has a .yourproject/ directory structure (contexts/, phases/, decisions/) or when the user mentions spec-first development.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before starting any work, read these files in order:

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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

Specification-First Agentic Development

You are working in a project that follows the Specification-First Agentic Development methodology. This means documentation is a first-class development artifact — every feature starts as a specification, every decision gets logged, and you read context files in a defined order before writing code.

Core Loop

Discuss → Write Spec → worktree + commit → review-spec → active/ → build → done/ → deliver-spec (verify, commit, PR)

Directory Layout (v2.1)

.yourproject/
  contexts/<name>/
    context.yaml              # per-stack: stack, arch, quality, state, workdir
    coding-principles.md      # per-stack: language rules (AI reads every session)
  decisions/
    <phase-id>-<slug>.yaml    # one decision per file; phase ID prefix groups them
    <run-id>-<slug>.yaml      # run-attached decisions
  memory/
    MEMORY.md                 # experiential-memory index (one line per memory)
    <name>.md                 # one typed Markdown fact per file
  phases/
    planned/  active/  done/
      {id}-feature-slug.yaml

Single-stack projects have one context: contexts/default/. Monorepos add siblings — contexts/server/, contexts/client/, contexts/docs/ — each with its own workdir: pointing at that stack's sub-tree of the repo.

Context Read Order

Before starting any work, read these files in order:

  1. Every .yourproject/contexts/<name>/context.yaml (glob contexts/*/context.yaml) — architecture, stack, integrations, phase status PER stack.
  2. Every .yourproject/contexts/<name>/coding-principles.md — code quality rules per stack (ALWAYS follow). Different contexts can have different conventions.
  3. .yourproject/phases/active/ — spec for the current phase. Note its applies_to: field — it tells you which context's principles dominate when conflicts arise.
  4. Relevant .yourproject/decisions/<phase-id>-*.yaml files — past decisions for the active phase and its requires: chain. Glob broader if you need historical context.
  5. .yourproject/memory/MEMORY.md — the experiential-memory index, one line per recorded fact. Recall detail from memory/<name>.md on demand when an index line touches your task.

Replace .yourproject/ with the actual project directory name (e.g., .agentsmith/, .myapp/).

Decisions vs memory — the boundary: a decision records a CHOICE made at a point in time (chose/over/reason — it lives in decisions/, written via /spec-first:log-decision); a memory records a transferable FACT or RULE that future work consults (it lives in memory/: feedback = ratified operator preference, project = goal/constraint/state not derivable from code or git, reference = external pointer). log-decision never writes memory/, and memory writes never land in decisions/ — distil a decision's durable lesson into a memory entry when one exists, never copy the decision itself.

Available Skills

This plugin provides specialized skills for each part of the workflow:

SkillWhen to use
/spec-first:bootstrap-projectSetting up the methodology in a new or existing project
/spec-first:create-phasePlanning a new feature, refactor, or task; commits the spec on a phase branch in its own worktree
/spec-first:review-specChecking a spec's evidence and getting a fresh reviewer's verdict before any code
/spec-first:apply-specImplementing the active phase, up to its done criteria
/spec-first:deliver-specRunning the verify stages, committing, pushing and opening the pull request
/spec-first:log-decisionRecording an architectural or design decision
/spec-first:update-projectSyncing methodology files with a newer plugin version (and migrating v1 → v2)

The 12-Step Implementation Workflow

For every phase, follow this order:

  1. Write phase spec first — create phases/planned/{id}-slug.yaml with goal, applies_to:, steps, done criteria. No code until the spec exists. The id is minted from the clock — today's UTC date plus four random hex digits, e.g. 2026-08-24-8a3f — never from a count of what already exists, so it can be minted offline and in parallel. Counter ids (p0042) from older projects stay valid forever and are never renamed.
  2. A worktree per phase — commit the spec and its planned entry on branch phase/{id} in a new worktree cut from the default branch (create-phase does this). All work on the phase happens there.
  3. Review the spec — /spec-first:review-spec: the evidence script resolves every cited file and line, then a fresh reviewer answers BUILD, BUILD WITH CUTS or REFUSE. No code before BUILD, or BUILD WITH CUTS with the cuts applied.
  4. Move to active — move the phase file from planned/ to active/.
  5. Plan first — explore the codebase(s) the phase touches (filtered by applies_to:), design the approach, get human approval before coding.
  6. Implement step by step — contracts/models first, then implementation, then wiring, then tests. Follow the relevant context's coding-principles.
  7. Build after each step — fix errors immediately, don't accumulate them.
  8. Run ALL tests — the contexts' verify: stages and every other check; zero failures before moving on.
  9. Log decisions — one YAML per phase at decisions/<phase-id>.yaml, every non-obvious choice an entry in its decisions: list.
  10. Update state — move phase from active to done in the relevant context's context.yaml.
  11. Move phase file — move from active/ to done/.
  12. Deliver — /spec-first:deliver-spec: runs the verify: stages, commits once as feat: {short description} ({id}), pushes and opens the pull request.

Key Rules

  • English only — all code, comments, docs, exceptions, logs, commit messages, decisions.
  • No over-engineering — only build what the phase requires, nothing more.
  • Tests — every new public method gets at least one test.
  • Follow the relevant context's coding-principles.md — these are constraints, not suggestions.
  • Specification is the contract — the spec defines what gets built. No scope creep.
  • Respect context boundaries — a phase with applies_to: server doesn't drift into client/.

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.