agentleFS
shanewwarrenshanewwarren/claude-skills/skills/specify/SKILL.md

specify

Skill0 starsChanged 36 days agoMITView on GitHub

Specification-driven development skill. Guides users through Jobs-to-Be-Done (JTBD) decomposition to generate comprehensive specs. Use when user wants to create specifications, define features, plan a new project, or says /specify.

  • Deletes or force-pushes

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use discovery, discover 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.
  • robzolkosSkill

    discovery

    Quick user-centric interview to capture requirements from a time-poor stakeholder.

    Also in 3 projects that use this

  • anombyte93Skill

    discover

    Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.

    Also in 4 projects that use this

  • MicrosoftSkill

    spec-review

    Independent, multi-model review of a design or spec **before** any code is written, for the microsoft/winappcli repo. Activate when a contributor asks to "review this spec", "review my design", "review this design doc", "validate this approach", "should we build this", "spec review", "design review", or "feature review". Fans out parallel sub-agents — each doing its OWN research against the real codebase and ecosystem rather than trusting the spec — covering necessity & scope, approach & alternatives, feasibility vs reality, risks & unknowns, DX & user impact, and a different-model-family cross-check. Emits a decision-oriented recommendation (proceed / proceed-with-changes / reconsider) to stdout. This is the PRE-CODE companion to the pr-review skill (which reviews code already written); use spec-review at the design/spec stage, not on an implemented diff. Does NOT write code or edit the spec.

    Also in 3 projects that use this

  • MicrosoftSkill

    init

    Also in 5 projects that use this

  • MetaSkill

    roadmap

    Build, continue, inspect, or visualize a source-grounded mathematical roadmap and theorem DAG in an existing Autoform Markdown blueprint. Use for source research, repository-wide inventories of existing and planned mathematics, scope, coverage, milestones, and roadmap articles; do not create repository infrastructure or prove Lean declarations.

    Also in 3 projects that use this

  • sahinSkill

    execute

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

32 rules. 0 are common, 23 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 23

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No clutter in the project directory

    line 56
  2. Distinctive:

    Auto-cleanup: After successful spec generation (Phase 4-5 complete), delete the state file automatically.

    line 85
  3. Very specific:

    Check for existing specs/ directory

    line 92
  4. Distinctive:

    If specs exist, offer to extend or start fresh

    line 94
  5. Distinctive:

    Ask: "What job are your users trying to accomplish?"

    line 97
  6. Distinctive:

    No semantic overlap between topics

    line 107
  7. Distinctive:

    Ask clarifying questions about ambiguous areas

    line 113
  8. Distinctive:

    Use Context7 for library documentation

    line 141
  9. Distinctive:

    Update state with per-topic research:

    line 150
  10. Very specific:

    When significant design decisions exist, generate motif.md exploration document.

    line 173
  11. Very specific:

    Create motif.md in project root

    line 185
  12. Distinctive:

    Ask user to review and choose

    line 187
  13. Distinctive:

    Update CLAUDE.md: - Add Specifications section if missing

    line 200
  14. Distinctive:

    If CLAUDE.md exists but lacks a Specifications section, inject:

    line 216
  15. Distinctive:

    Check if CLAUDE.md exists

    line 231
  16. Very specific:

    Check if ## Specifications section exists

    line 232
  17. Distinctive:

    If missing, insert after first heading or at document start

    line 233
  18. Very specific:

    When $ARGUMENTS is init:

    line 378
  19. Very specific:

    Create specs/ directory if not exists

    line 380
  20. Very specific:

    Create specs/README.md with basic structure

    line 381
  21. Distinctive:

    Update CLAUDE.md with Specifications section

    line 382
  22. Distinctive:

    Do NOT run full workflow

    line 383
  23. Distinctive:

    Do NOT proceed to research or generation

    line 391
  24. Very specific:

    When $ARGUMENTS starts with research:

    line 395
  25. Distinctive:

    Update state with research results

    line 399
  26. Distinctive:

    Do NOT generate specs

    line 400
  27. Distinctive:

    Run Phase 4 and 5 only

    line 408
  28. Distinctive:

    Delete state file after successful generation

    line 410
  29. Distinctive:

    MANDATORY: Before generating specs, read the template files:

    line 414
  30. Distinctive:

    Follow these templates exactly for consistent output.

    line 419
  31. Distinctive:

    After running /specify, verify success by checking:

    line 423
  32. Very specific:

    README links work: All links in specs/README.md resolve

    line 426

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

Specification Generator

Transform Jobs to Be Done (JTBD) into structured specification documents.

Sub-commands

Parse $ARGUMENTS to determine which sub-command to run:

CommandDescription
(empty)Full interactive workflow
initInitialize specs/ structure only
decomposeJTBD decomposition only
research <topic>Research specific topic
generateGenerate specs from existing decomposition

When to Use Each Sub-command

Starting Fresh?

→ Use /specify (full workflow)

Already Have specs/ Directory?

→ Use /specify init (structure only)

Just Need to Break Down a Feature?

→ Use /specify decompose

Need to Research a Specific Area?

→ Use /specify research <topic>

Have Decomposition, Ready to Write Specs?

→ Use /specify generate

Dependencies

This skill works best when the following are available:

  • Context7 MCP - For external library documentation research
  • Task tool with Explore agent - For codebase pattern discovery
  • Write/Edit tools - For generating spec files

State Management

Track workflow state in a cache directory to avoid polluting the project:

State file location: ~/.cache/claude/specify/{project-hash}.json

The {project-hash} is derived from the absolute path of the project directory (e.g., MD5 or similar hash). This allows:

  • Multiple projects to have independent state
  • No clutter in the project directory
  • Easy cleanup with rm -rf ~/.cache/claude/specify/

To compute the state file path:

# Get project hash from current working directory
project_hash=$(echo -n "$(pwd)" | md5 | cut -c1-16)
state_file="$HOME/.cache/claude/specify/${project_hash}.json"

State structure:

{
  "projectPath": "/absolute/path/to/project",
  "jtbd": "string - the job to be done statement",
  "topics": [
    {
      "id": "topic-slug",
      "name": "Topic Name",
      "description": "One sentence description",
      "status": "pending|researched|specified",
      "designDecisions": []
    }
  ],
  "phase": "decompose|research|design|generate",
  "projectType": "detected project type"
}

Auto-cleanup: After successful spec generation (Phase 4-5 complete), delete the state file automatically. State is only needed for resuming incomplete workflows.

Phase 1: JTBD Decomposition

Workflow

  1. Detect project context
    • Check for existing specs/ directory
    • Detect project type from package.json, Cargo.toml, go.mod, etc.
    • If specs exist, offer to extend or start fresh
  2. Capture JTBD
    • Ask: "What job are your users trying to accomplish?"
    • Focus on outcome, not solution
    • Example: "Users need to track personal finances to understand spending"
  3. Decompose into topics
    • Break JTBD into 3-7 distinct topics
    • Each topic must pass the "One Sentence Without 'And'" test
    • Topics should be 5-15 words describing a single concern
  4. Validate topics
    • No semantic overlap between topics
    • Each topic is actionable (uses verbs like: track, display, manage, validate, sync)
    • Topics are bounded and testable
  5. Present for refinement
    • Show topics in a table with status
    • Ask clarifying questions about ambiguous areas
    • Allow user to accept, modify, split, or merge topics

Example Decomposition

JTBD: "Users need to track personal finances to understand spending"

Topics:
1. transaction-tracking - Recording income and expense transactions
2. category-management - Organizing transactions into categories
3. budget-system - Setting and tracking spending limits
4. reporting-analytics - Generating insights and visualizations
5. data-import - Importing data from bank statements

Phase 2: Research

For each topic, spawn an Explore subagent to gather:

  1. Codebase patterns
    • Existing similar features
    • Relevant types, traits, modules
    • Architectural patterns in use
  2. External research
    • Best practices for the domain
    • API patterns if applicable
    • Use Context7 for library documentation
  3. Design decisions
    • Identify architectural choices needed
    • Prepare options with trade-offs
    • Flag decisions requiring user input

Research Output

Update state with per-topic research:

{
  "id": "topic-slug",
  "research": {
    "existingPatterns": ["pattern descriptions"],
    "externalReferences": ["urls or summaries"],
    "designDecisions": [
      {
        "question": "How should X be implemented?",
        "options": ["Option A", "Option B"],
        "tradeoffs": "A is simpler, B is more flexible"
      }
    ],
    "dependencies": ["other-topic-id"],
    "complexity": "low|medium|high"
  }
}

Phase 3: Design Decisions (motif.md)

When significant design decisions exist, generate motif.md exploration document.

See motif.md for the template.

When to Generate motif.md

  • Multiple valid architectural approaches exist
  • User preferences matter for the outcome
  • Trade-offs are significant and not obvious

Workflow

  1. Create motif.md in project root
  2. Present options with pros/cons and references
  3. Ask user to review and choose
  4. Record decisions in state

Phase 4: Spec Generation

Generate specification files using templates.

See spec.md for the full template.

Files to Create

  1. specs/README.md - Index of all specifications
  2. specs/{topic}.md - One file per topic
  3. Update CLAUDE.md - Add Specifications section if missing

Spec File Sections

Each spec should include (as applicable):

  • Overview (purpose, goals, non-goals)
  • Architecture (component structure, diagrams)
  • Core Types (with field tables)
  • API / Behaviors
  • Database Schema (if applicable)
  • Configuration
  • Security Considerations
  • Implementation Phases

Phase 5: CLAUDE.md Update

If CLAUDE.md exists but lacks a Specifications section, inject:

## Specifications

**IMPORTANT:** Before implementing any feature, consult `specs/README.md`.

- **Assume NOT implemented.** Specs describe intent; code describes reality.
- **Check the codebase first.** Search actual code before concluding.
- **Use specs as guidance.** Follow design patterns in relevant spec.
- **Spec index:** `specs/README.md` lists all specs by category.

Merge Logic

  1. Check if CLAUDE.md exists
  2. Check if ## Specifications section exists
  3. If missing, insert after first heading or at document start
  4. Preserve all existing content

User Interaction Pattern

Full Workflow Example

User: /specify

Claude: I'll help create specifications for your project.

**Project Detection:**
- Type: TypeScript/Node.js
- Existing specs: No

**Step 1: Define Your Job to Be Done**
What problem are you solving for your users? (Focus on outcome, not solution)

---

User: Users need to manage their reading list and track books they've read

Claude: **Topics Identified:**

| # | Topic | Description | Status |
|---|-------|-------------|--------|
| 1 | book-catalog | Storing and retrieving book information | Ready |
| 2 | reading-status | Tracking read/unread/in-progress state | Ready |
| 3 | list-management | Creating and organizing reading lists | Ready |
| 4 | reading-progress | Recording pages read and notes | Ready |

**Questions:**
1. Should users be able to share lists with others?
2. Do you need integration with book databases (OpenLibrary, Google Books)?

---

User: Yes to sharing, no external integrations for now

Claude: [Updates topics, spawns research subagents]

**Research Complete. Design Decision Required:**

Created `motif.md` for sharing architecture. Please review and let me know which approach you prefer.

---

User: I like Option B - simple link sharing

Claude: Generating specifications...

**Created:**
- specs/README.md
- specs/book-catalog.md
- specs/reading-status.md
- specs/list-management.md
- specs/reading-progress.md
- specs/sharing.md
- Updated CLAUDE.md

Ready for implementation planning.

Example Output

Generated specs/README.md

# Reading Tracker Specifications

Design documentation for a personal reading list management application.

## Overview

This directory contains specifications for the project's features and systems.

**Status Legend:**
- **Planned** - Design complete, not yet implemented
- **In Progress** - Currently being implemented
- **Implemented** - Feature complete and in production

---

## Core Features

| Spec | Status | Purpose |
|------|--------|---------|
| [book-catalog.md](./book-catalog.md) | Planned | Storing and retrieving book information |
| [reading-status.md](./reading-status.md) | Planned | Tracking read/unread/in-progress state |
| [list-management.md](./list-management.md) | Planned | Creating and organizing reading lists |
| [reading-progress.md](./reading-progress.md) | Planned | Recording pages read and notes |

## Social Features

| Spec | Status | Purpose |
|------|--------|---------|
| [sharing.md](./sharing.md) | Planned | Link-based list sharing with others |

Generated specs/book-catalog.md (excerpt)

# Book Catalog Specification

**Status:** Planned
**Version:** 1.0
**Last Updated:** 2025-01-15

---

## 1. Overview

### Purpose

The book catalog provides the core data model for storing and retrieving book information. It serves as the foundation for all other features in the reading tracker.

### Goals

- **Complete book metadata** - Store title, author, ISBN, cover image, and page count
- **Fast lookup** - Support search by title, author, or ISBN
- **Extensible schema** - Allow custom fields for user-defined metadata

### Non-Goals

- **External sync** - No integration with Goodreads or other services (deferred)
- **Social features** - Book recommendations handled in separate spec

---

## 2. Architecture

### Component Structure

src/
├── models/
│   └── book.ts          # Book entity and types
├── repositories/
│   └── book-repo.ts     # Data access layer
└── services/
    └── book-service.ts  # Business logic

Init Sub-command

When $ARGUMENTS is init:

  1. Create specs/ directory if not exists
  2. Create specs/README.md with basic structure
  3. Update CLAUDE.md with Specifications section
  4. Do NOT run full workflow

Decompose Sub-command

When $ARGUMENTS is decompose:

  1. Run Phase 1 only
  2. Save state to cache file (see State Management)
  3. Do NOT proceed to research or generation

Research Sub-command

When $ARGUMENTS starts with research:

  1. Load state from cache file (see State Management)
  2. Research the specified topic (or all if none specified)
  3. Update state with research results
  4. Do NOT generate specs

Generate Sub-command

When $ARGUMENTS is generate:

  1. Load state from cache file (see State Management)
  2. Require completed decomposition
  3. Run Phase 4 and 5 only
  4. Generate all spec files
  5. Delete state file after successful generation

Template Usage

MANDATORY: Before generating specs, read the template files:

  • motif.md - For design exploration documents
  • spec.md - For specification files
  • readme.md - For the specs index

Follow these templates exactly for consistent output.

Verification

After running /specify, verify success by checking:

  1. Spec files exist: ls specs/*.md
  2. README links work: All links in specs/README.md resolve
  3. CLAUDE.md updated: Specifications section present
  4. State auto-cleaned: Cache file deleted after successful generation

Quick Reference

PhaseOutputKey Files
DecomposeTopics list~/.cache/claude/specify/{hash}.json
ResearchDesign decisionscache state updated
DesignArchitecture choicesmotif.md (if needed)
GenerateSpecificationsspecs/*.md, specs/README.md
FinalizeCLAUDE.md update, state cleanupCLAUDE.md

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.