agentleFS
aneja5aneja5/forge-skills/skills/spec-driven-development/SKILL.md

spec-driven-development

Skill3 starsChanged 7 months agoMITView on GitHub

Use when user wants to write a spec, create a PRD, or plan a new feature before implementation begins, when .forge/idea-brief.md exists and is ready to formalize, when requirements need to be captured before architecture or planning, or when a feature's scope and acceptance criteria need to be documented.

68 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

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

  • +5 more from LLl0k0laD

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 65 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:

    No non-functional requirements recorded

    line 44
  2. Very specific:

    Check for .forge/idea-brief.md.

    line 52
  3. Distinctive:

    If no brief: ask the user for a detailed description of the problem and solutions they've considered.

    line 56
  4. Distinctive:

    Conditional: Before dispatching the Explore agent, check whether a codebase exists:

    line 60
  5. Very specific:

    If the repo has source files (any src/, lib/, app/, language-specific entry points, or >5 source files at root), dispatch the Agent tool …

    line 61
  6. Very specific:

    Create .forge/ if it doesn't exist.

    line 74
  7. Distinctive:

    Before marking complete, confirm:

    line 125
  8. Distinctive:

    Before declaring done, emit one of:

    line 140

“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

Overview

Turn a feature idea into a structured PRD at .forge/prd.md through interview, codebase exploration, and module design. Reads .forge/idea-brief.md if it exists to skip already-answered questions. Output feeds architecture-and-contracts and planning-and-task-breakdown.

When to Use

  • User wants to write a spec, PRD, or product requirements document
  • User wants to plan a new feature before touching code
  • .forge/idea-brief.md exists and is ready to formalize

When NOT to Use

  • .forge/prd.md already exists and is current — skip ahead to architecture-and-contracts
  • Idea hasn't been pressure-tested — run idea-griller first
  • Change is trivial (config tweak, single function) — just implement with tdd

Context-Loaded Mode

If a comprehensive context document exists (e.g., context/CONTEXT.md or similar file with >500 lines of structured research, interviews, or domain analysis), skip the interview steps (Steps 1-3). The context document replaces the user interview — read it in full, extract requirements, and proceed directly to Step 4 (module design). Note in the PRD's Open Assumptions which sections were derived from context document vs. user confirmation.

Common Rationalizations

ThoughtReality
"The feature is simple, skip the spec"Simple features grow. Write the scope down.
"I already know what to build"The interview surfaces what you don't know you don't know
"Codebase exploration is optional"PRDs written without it have wrong module assumptions
"User stories take too long"Thin story list = thin acceptance criteria = broken scope
"We can define NFRs later"NFRs defined late become hard constraints you can't meet
"Out of Scope can be empty"Empty = everything is in scope = infinite scope

Red Flags

  • Problem statement written from engineer's perspective, not user's
  • User stories use passive voice ("system shall") instead of Given/When/Then or actor/want/benefit
  • Out of Scope section is empty
  • No non-functional requirements recorded
  • Module list names files/functions instead of behavioral units
  • Release phases not defined — everything is "phase 1"

Core Process

Step 0: Read the brief

Check for .forge/idea-brief.md. If it exists, read it. Skip questions already answered. Focus on gaps and open assumptions listed in the brief.

Step 1: Understand the problem

If no brief: ask the user for a detailed description of the problem and solutions they've considered. Let them speak fully before asking follow-up questions.

Step 2: Explore the codebase (greenfield-aware)

Conditional. Before dispatching the Explore agent, check whether a codebase exists:

  • If the repo has source files (any src/, lib/, app/, language-specific entry points, or >5 source files at root), dispatch the Agent tool with subagent_type=Explore. Understand current architecture, patterns, and where new modules would attach. Verify the user's assertions against the actual code.
  • If the repo is empty or near-empty (only README.md, package.json-shaped manifest, .gitignore, or no source files at all), skip the Explore step. Note in the PRD under "Codebase context": "Greenfield — no existing code explored." Do not dispatch Explore against an empty tree; the agent has nothing to find and the wasted turn obscures the actual state.

Step 3: Interview to shared understanding

Walk down each branch of the design tree, resolving dependencies one at a time. Do not proceed while ambiguities exist. Ask about: edge cases, error paths, personas, NFRs, data lifecycle.

Step 4: Design the modules

Identify major modules to build or modify. Prefer deep modules — small interface, large implementation, independently testable. Confirm with user. Ask which modules need tests.

Step 5: Write .forge/prd.md

Create .forge/ if it doesn't exist. Prepend a forge:meta dependency header (generated_by: spec-driven-development, generated_at: <ISO 8601 UTC with Z>, depends_on: [.forge/idea-brief.md] if it exists else [] — paths only, never hashes, generated_from: {.forge/idea-brief.md: <upstream content_hash AT generation time>} if idea-brief exists else {}, content_hash: <sha256 first 8 of THIS file's body>) — see forge-dependency-graph. Then write using the template below.

PRD Template

<!-- forge:meta
generated_by: spec-driven-development
generated_at: 2026-05-13T12:00:00Z
depends_on: [.forge/idea-brief.md]
generated_from:
  .forge/idea-brief.md: <idea-brief.md's content_hash at this moment>
content_hash: <first 8 chars of sha256 over this PRD's body>
-->

# PRD: [Feature Name]

## Problem Statement
[From the user's perspective — not the engineer's]

## Personas
[Named actor types with goals and context]

## Functional Requirements

### [Requirement group]
- Given [context], When [action], Then [outcome]

## Non-Functional Requirements
- Performance: [specific target]
- Security: [specific requirement]
- Reliability: [uptime / error rate target]

## Data Model
[Key entities, relationships, constraints — no file paths or code]

## Module Design
[Behavioral units to build or modify. Each: name, responsibility, interface shape]

## Release Phases
- **Phase 1 (MVP):** [scope]
- **Phase 2:** [scope]

## Out of Scope
[Explicit list. Non-empty required.]

## Open Assumptions
[Unresolved questions. Empty = suspicious.]

Verification

Before marking complete, confirm:

  • .forge/idea-brief.md read if it existed; gaps identified
  • Codebase explored — user's assertions verified against real code
  • All open assumptions from brief addressed or re-noted
  • Problem statement from user's perspective
  • Given/When/Then covers happy path AND error paths
  • Out of Scope non-empty
  • NFRs specific (no "fast" — give numbers)
  • Module list confirmed with user
  • Release phases defined
  • .forge/prd.md written and readable

Fit-Check

Before declaring done, emit one of:

  • A short list of specific fit issues observed during this invocation (e.g., "Feature turned out to be a single config tweak — PRD is overscoped for the work; recommend incremental-implementation directly next time" / "PRD section on multi-tenancy doesn't apply — this is a single-tenant tool, see #40").
  • The explicit line: "No fit issues observed for this use case."

Silence is not allowed. See docs/skill-anatomy.md#fit-check.

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.