agentleFS
Gzyms69Gzyms69/agent-setup-bundle/skills/spec-driven-development/SKILL.md

spec-driven-development

Skill0 starsChanged 3 months agoMITView on GitHub

MANDATORY PLANNING GATE for complex features, multi-file refactors, and architectural changes. Creates technical specifications, implementation plans, and verification matrices before coding. MUST ACTIVATE when invoked with /plan, when a task is estimated >15 minutes, touches >3 files, or introduces new APIs/schemas.

68 other projects use a version of this, 31 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use using-agent-skills, git-workflow-and-versioning and 10 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.
  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 28 projects that use this

  • LLl0k0laDSkill

    git-workflow-and-versioning

    Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

    Also in 27 projects that use this

  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • az9713Skill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 31 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 20 projects that use this

  • +7 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 65 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write a structured specification before writing any code.

    line 10
  2. Distinctive:

    Start with a high-level vision.

    line 42
  3. Distinctive:

    Surface assumptions immediately: Before writing spec content, list what you're assuming:

    line 44
  4. Very specific:

    When generating and updating implementation plans in Antigravity (<Artifact Directory>/<plan_name>.md) or workspace roots (tasks/plan.md), …

    line 57
  5. Distinctive:

    Discovered Facts Lock: Never delete discovered file paths, line ranges, or test commands across turns.

    line 112
  6. Distinctive:

    Top-Level Iteration Delta: Always summarize what changed in the current version at the very top.

    line 114
  7. Distinctive:

    No Duplicate Questioning: Never re-ask questions that were resolved in previous turns.

    line 115
  8. Distinctive:

    Before submitting a plan or proceeding to implementation:

    line 150

“Common” is measured: kept by at least 6 in 10 of the 65 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

Spec-Driven Development (SDD) & Interactive Planning Protocol

Overview

Write a structured specification before writing any code. The spec is the shared source of truth between you and the human engineer — it defines what we're building, why, and how we'll know it's done. Code without a spec is guessing.

In interactive planning sessions (/plan, /grill-me, task refinement turns), SDD enforces strict statefulness: never perform destructive rewrites that drop discovered facts, and never leave zombie code in active specs.


When to Use

  • Starting a new project or feature
  • Requirements are ambiguous or incomplete
  • The change touches multiple files or modules
  • You're about to make an architectural decision
  • The task is estimated >15 minutes or explicitly invoked with /plan

When NOT to use: Single-line fixes, typo corrections, or self-contained single-function changes.


The Gated Workflow

SPECIFY ──→ PLAN (Multi-Turn Refinement) ──→ TASKS ──→ IMPLEMENT
   │                       │                    │          │
   ▼                       ▼                    ▼          ▼
 Human                   Human                Human      Human
reviews                 reviews              reviews    reviews

Phase 1: Specify

Start with a high-level vision. Ask the human clarifying questions until requirements are concrete.

Surface assumptions immediately. Before writing spec content, list what you're assuming:

ASSUMPTIONS I'M MAKING:
1. This is a web application (not native mobile)
2. Authentication uses session-based cookies (not JWT)
3. The database is PostgreSQL (based on existing schema)
→ Correct me now or I'll proceed with these.

Phase 2: Plan & Multi-Turn Interactive Refinement (/plan)

When generating and updating implementation plans in Antigravity (<Artifact Directory>/<plan_name>.md) or workspace roots (tasks/plan.md), execute the Planning Lifecycle State Machine:

Draft v1 (Discovery & Baseline Facts Lock) ──► Refinement vN (Iteration Delta & Active SSOT) ──► Execution Lock ("GO")

Mandatory Plan Artifact Template:

# Implementation Plan: [Feature / Task Name]

> [!NOTE]
> **Plan Version:** v[N] (Updated after Turn [N] User Feedback)
> **Iteration Delta:**
> - [ADDED]: [Specific additions in this turn]
> - [MODIFIED]: [Specific changes to previous sections]
> - [PRUNED]: [Specific components removed, logged below]
> - [PRESERVED]: 100% of discovered codebase facts and verification commands from v[N-1].

## 1. User Alignment & Decision Log (Cumulative)
- **[v1 Init - Timestamp]:** Initial baseline plan.
- **[v2 User Decision - Timestamp]:** [User decision / choice] (LOCKED).
- **[v2 Pruned - Timestamp]:** `[PRUNED]`: [Deprecated approach removed per user constraint].

## 2. Discovered Baseline & Codebase Facts (LOCKED)
- **Target Files:** `[Exact absolute paths verified via tools]`
- **Environment:** `[Language, runtime, package manager, OS]`
- **Required Commands:** `[pnpm test, npx tsc --noEmit, etc.]`

## 3. Active Technical Specification (SSOT - 100% Clean)
*Contains ONLY current, approved architecture. Deprecated code is completely excised!*
[Clean architecture diagrams, data models, interfaces, API signatures]

### 3.1 Task Delegation & Execution Routing Matrix
| Task / Component | Execution Vector (Inline / Worker / Subagent) | Model Tier / Profile | Sandbox / Worktree |
| :--- | :--- | :--- | :--- |
| `[Core Domain / Complex Logic]` | `Gemini Inline` (Tier-1 Brain) | `inherit` / `pro` | Main Tree |
| `[Scaffolding / Boilerplate >100 LOC]` | `chinese-worker` (`worker_run_task`) | `minimax-m3` | Git Worktree |
| `[TDD Unit Tests]` | `chinese-worker` (`worker_generate_tests`) | `nemotron-lightning` | Git Worktree |
| `[Mass Refactoring >2 files]` | `chinese-worker` (`worker_batch_refactor`) | `glm-5.2` | Git Worktree |
| `[Parallel Directory Audit]` | `invoke_subagent` (`research` / `self`) | `flash_lite` / `flash` | Ephemeral Subagent |

## 4. Proposed Changes (File by File)
### [MODIFY] path/to/file.ts
### [NEW] path/to/new_file.ts

## 5. Verification Plan (Automated & Manual)
- Automated: Exact commands to run (`pnpm test`, `npx tsc --noEmit`)
- Manual: Browser/API verification steps

## 6. Open Questions / Next Steps
[Only genuinely unanswered questions]

The 4 Invariants of Plan Iteration:

  1. Discovered Facts Lock: Never delete discovered file paths, line ranges, or test commands across turns.
  2. Active SSOT Cleanliness: Completely remove deprecated code from Section 3. Keep 1-line tombstones in Section 1.
  3. Top-Level Iteration Delta: Always summarize what changed in the current version at the very top.
  4. No Duplicate Questioning: Never re-ask questions that were resolved in previous turns.

Phase 3: Tasks

Break the plan into discrete, implementable tasks in tasks/todo.md:

- [ ] Task: [Description]
  - Acceptance: [What must be true when done]
  - Verify: [How to confirm — test command, build, manual check]
  - Files: [Which files will be touched]

Phase 4: Implement

Execute tasks one at a time. Run tests and linters after each task. Update progress continuously.


Anti-Rationalization Table

Agent ExcuseBLOCKED Rebuttal
"The user gave me 1 feedback sentence so I rewrote the whole plan and forgot the test commands."BLOCKED: Violates the Discovered Facts Lock. Test commands and file paths must be preserved.
"I left the old PostgreSQL code and the new SQLite code together in Section 3 so nothing is lost."BLOCKED: Violates Active SSOT. Competing code causes context clash and hallucinations. Clean active spec, record 1-line tombstone in Section 1.
"I'll ask the user again about the database choice."BLOCKED: The user already answered in Turn 2. Re-asking resolved questions wastes tokens and breaks user trust.

Verification Gates

Before submitting a plan or proceeding to implementation:

  • Does the plan follow the 6-section template with an Iteration Delta box?
  • Are all Discovered Baseline Facts from prior turns preserved?
  • Is Section 3 (Active Technical Spec) 100% clean and free of deprecated zombie code?
  • Are all user decisions logged in the cumulative User Alignment & Decision Log?
  • Have all verification commands (test, tsc, lint) been validated against project reality?

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.