lean-spec 0.2.6 → 0.2.7-dev.20251126090633

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { analyzeCommand, archiveCommand, backfillCommand, boardCommand, checkCommand, compactCommand, createCommand, depsCommand, examplesCommand, filesCommand, ganttCommand, initCommand, linkCommand, listCommand, mcpCommand, migrateCommand, openCommand, searchCommand, splitCommand, statsCommand, templatesCommand, timelineCommand, tokensCommand, uiCommand, unlinkCommand, updateCommand, validateCommand, viewCommand } from './chunk-RTEGSMVL.js';
1
+ import { agentCommand, analyzeCommand, archiveCommand, backfillCommand, boardCommand, checkCommand, compactCommand, createCommand, depsCommand, examplesCommand, filesCommand, ganttCommand, initCommand, linkCommand, listCommand, mcpCommand, migrateCommand, openCommand, searchCommand, splitCommand, statsCommand, templatesCommand, timelineCommand, tokensCommand, uiCommand, unlinkCommand, updateCommand, validateCommand, viewCommand } from './chunk-GSBLCPXH.js';
2
2
  import './chunk-LVD7ZAVZ.js';
3
3
  import { Command } from 'commander';
4
4
  import { readFileSync } from 'fs';
@@ -7,6 +7,7 @@ import { dirname, join } from 'path';
7
7
 
8
8
  // src/commands/registry.ts
9
9
  function registerCommands(program2) {
10
+ program2.addCommand(agentCommand());
10
11
  program2.addCommand(analyzeCommand());
11
12
  program2.addCommand(archiveCommand());
12
13
  program2.addCommand(backfillCommand());
@@ -87,6 +88,7 @@ Command Groups:
87
88
  templates Manage spec templates
88
89
 
89
90
  Integration:
91
+ agent Dispatch specs to AI coding agents
90
92
  mcp Start MCP server for AI assistants
91
93
  ui Start local web UI for spec management
92
94
 
@@ -112,6 +114,9 @@ Examples:
112
114
  $ lean-spec tokens 059
113
115
  $ lean-spec analyze 045 --json
114
116
  $ lean-spec split 045 --output README.md:1-150 --output DESIGN.md:151-end
117
+ $ lean-spec agent list
118
+ $ lean-spec agent run 045 --agent claude
119
+ $ lean-spec agent run 045 047 048 --parallel
115
120
  $ lean-spec ui
116
121
  $ lean-spec ui --port 3001 --no-open
117
122
  $ lean-spec ui --specs ./docs/specs --dry-run
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/registry.ts","../src/cli.ts"],"names":["program"],"mappings":";;;;;;;;AAmCO,SAAS,iBAAiBA,QAAAA,EAAwB;AAEvD,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,eAAA,EAAiB,CAAA;AACpC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,aAAA,EAAe,CAAA;AAClC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,eAAA,EAAiB,CAAA;AACpC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,UAAA,EAAY,CAAA;AAC/B,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AACh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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAsE5B,CAAA;AAGD,gBAAA,CAAiB,OAAO,CAAA;AAGxB,OAAA,CAAQ,KAAA,EAAM","file":"cli.js","sourcesContent":["import { Command } from 'commander';\nimport {\n analyzeCommand,\n archiveCommand,\n backfillCommand,\n boardCommand,\n checkCommand,\n compactCommand,\n createCommand,\n depsCommand,\n examplesCommand,\n filesCommand,\n ganttCommand,\n initCommand,\n linkCommand,\n listCommand,\n mcpCommand,\n migrateCommand,\n openCommand,\n searchCommand,\n splitCommand,\n statsCommand,\n templatesCommand,\n timelineCommand,\n tokensCommand,\n uiCommand,\n unlinkCommand,\n updateCommand,\n validateCommand,\n viewCommand,\n} from './index.js';\n\n/**\n * Register all commands in alphabetical order\n */\nexport function registerCommands(program: Command): void {\n // Alphabetically sorted command registration\n program.addCommand(analyzeCommand());\n program.addCommand(archiveCommand());\n program.addCommand(backfillCommand());\n program.addCommand(boardCommand());\n program.addCommand(checkCommand());\n program.addCommand(compactCommand());\n program.addCommand(createCommand());\n program.addCommand(depsCommand());\n program.addCommand(examplesCommand());\n program.addCommand(filesCommand());\n program.addCommand(ganttCommand());\n program.addCommand(initCommand());\n program.addCommand(linkCommand());\n program.addCommand(listCommand());\n program.addCommand(mcpCommand());\n program.addCommand(migrateCommand());\n program.addCommand(openCommand());\n program.addCommand(searchCommand());\n program.addCommand(splitCommand());\n program.addCommand(statsCommand());\n program.addCommand(templatesCommand());\n program.addCommand(timelineCommand());\n program.addCommand(tokensCommand());\n program.addCommand(uiCommand());\n program.addCommand(unlinkCommand());\n program.addCommand(updateCommand());\n program.addCommand(validateCommand());\n program.addCommand(viewCommand());\n}\n","import { Command } from 'commander';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { registerCommands } from './commands/registry.js';\n\n// Get version from package.json\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('lean-spec')\n .description('Manage LeanSpec documents')\n .version(packageJson.version);\n\n// Add custom help text with grouped commands\nprogram.addHelpText('after', `\nCommand Groups:\n\n Core Workflow:\n archive <spec> Move spec to archived/\n backfill [specs...] Backfill timestamps from git history\n create <name> Create new spec\n examples List example projects for tutorials\n init Initialize LeanSpec in current directory\n link <spec> Add relationships between specs\n migrate <input-path> Migrate specs from other SDD tools\n unlink <spec> Remove relationships between specs\n update <spec> Update spec metadata\n \n Discovery & Search:\n files <spec> List files in a spec\n list List all specs\n open <spec> Open spec in editor\n search <query> Full-text search with metadata filters\n view <spec> View spec content\n \n Project Analytics:\n board Show Kanban-style board view\n deps <spec> Show dependency graph for a spec\n gantt Show timeline with dependencies\n stats Show aggregate statistics\n timeline Show creation/completion over time\n \n Quality & Optimization:\n analyze <spec> Analyze spec complexity and structure\n check Check for sequence conflicts\n tokens [spec] Count tokens for LLM context management\n validate [specs...] Validate specs for quality issues\n \n Advanced Editing:\n compact <spec> Remove specified line ranges from spec\n split <spec> Split spec into multiple files\n \n Configuration:\n templates Manage spec templates\n \n Integration:\n mcp Start MCP server for AI assistants\n ui Start local web UI for spec management\n\nExamples:\n $ lean-spec init\n $ lean-spec init -y\n $ lean-spec init --example dark-theme\n $ lean-spec init --example dashboard-widgets --name my-demo\n $ lean-spec examples\n $ lean-spec create my-feature --priority high\n $ lean-spec list --status in-progress\n $ lean-spec view 042\n $ lean-spec link 085 --depends-on 042,035\n $ lean-spec link 085 --related 082\n $ lean-spec unlink 085 --depends-on 042\n $ lean-spec deps 085\n $ lean-spec backfill --dry-run\n $ lean-spec migrate ./docs/adr\n $ lean-spec migrate ./docs/rfcs --with copilot\n $ lean-spec board --tag backend\n $ lean-spec search \"authentication\"\n $ lean-spec validate\n $ lean-spec tokens 059\n $ lean-spec analyze 045 --json\n $ lean-spec split 045 --output README.md:1-150 --output DESIGN.md:151-end\n $ lean-spec ui\n $ lean-spec ui --port 3001 --no-open\n $ lean-spec ui --specs ./docs/specs --dry-run\n`);\n\n// Register all commands (alphabetically ordered)\nregisterCommands(program);\n\n// Parse and execute\nprogram.parse();\n"]}
1
+ {"version":3,"sources":["../src/commands/registry.ts","../src/cli.ts"],"names":["program"],"mappings":";;;;;;;;AAoCO,SAAS,iBAAiBA,QAAAA,EAAwB;AAEvD,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,eAAA,EAAiB,CAAA;AACpC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,cAAA,EAAgB,CAAA;AACnC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,aAAA,EAAe,CAAA;AAClC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,eAAA,EAAiB,CAAA;AACpC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,YAAA,EAAc,CAAA;AACjC,EAAAA,QAAAA,CAAQ,UAAA,CAAW,WAAA,EAAa,CAAA;AAChC,EAAAA,QAAAA,CAAQ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A,CAChB,WAAA,CAAY,2BAA2B,CAAA,CACvC,OAAA,CAAQ,YAAY,OAAO,CAAA;AAG9B,OAAA,CAAQ,YAAY,OAAA,EAAS;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CA0E5B,CAAA;AAGD,gBAAA,CAAiB,OAAO,CAAA;AAGxB,OAAA,CAAQ,KAAA,EAAM","file":"cli.js","sourcesContent":["import { Command } from 'commander';\nimport {\n agentCommand,\n analyzeCommand,\n archiveCommand,\n backfillCommand,\n boardCommand,\n checkCommand,\n compactCommand,\n createCommand,\n depsCommand,\n examplesCommand,\n filesCommand,\n ganttCommand,\n initCommand,\n linkCommand,\n listCommand,\n mcpCommand,\n migrateCommand,\n openCommand,\n searchCommand,\n splitCommand,\n statsCommand,\n templatesCommand,\n timelineCommand,\n tokensCommand,\n uiCommand,\n unlinkCommand,\n updateCommand,\n validateCommand,\n viewCommand,\n} from './index.js';\n\n/**\n * Register all commands in alphabetical order\n */\nexport function registerCommands(program: Command): void {\n // Alphabetically sorted command registration\n program.addCommand(agentCommand());\n program.addCommand(analyzeCommand());\n program.addCommand(archiveCommand());\n program.addCommand(backfillCommand());\n program.addCommand(boardCommand());\n program.addCommand(checkCommand());\n program.addCommand(compactCommand());\n program.addCommand(createCommand());\n program.addCommand(depsCommand());\n program.addCommand(examplesCommand());\n program.addCommand(filesCommand());\n program.addCommand(ganttCommand());\n program.addCommand(initCommand());\n program.addCommand(linkCommand());\n program.addCommand(listCommand());\n program.addCommand(mcpCommand());\n program.addCommand(migrateCommand());\n program.addCommand(openCommand());\n program.addCommand(searchCommand());\n program.addCommand(splitCommand());\n program.addCommand(statsCommand());\n program.addCommand(templatesCommand());\n program.addCommand(timelineCommand());\n program.addCommand(tokensCommand());\n program.addCommand(uiCommand());\n program.addCommand(unlinkCommand());\n program.addCommand(updateCommand());\n program.addCommand(validateCommand());\n program.addCommand(viewCommand());\n}\n","import { Command } from 'commander';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { registerCommands } from './commands/registry.js';\n\n// Get version from package.json\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('lean-spec')\n .description('Manage LeanSpec documents')\n .version(packageJson.version);\n\n// Add custom help text with grouped commands\nprogram.addHelpText('after', `\nCommand Groups:\n\n Core Workflow:\n archive <spec> Move spec to archived/\n backfill [specs...] Backfill timestamps from git history\n create <name> Create new spec\n examples List example projects for tutorials\n init Initialize LeanSpec in current directory\n link <spec> Add relationships between specs\n migrate <input-path> Migrate specs from other SDD tools\n unlink <spec> Remove relationships between specs\n update <spec> Update spec metadata\n \n Discovery & Search:\n files <spec> List files in a spec\n list List all specs\n open <spec> Open spec in editor\n search <query> Full-text search with metadata filters\n view <spec> View spec content\n \n Project Analytics:\n board Show Kanban-style board view\n deps <spec> Show dependency graph for a spec\n gantt Show timeline with dependencies\n stats Show aggregate statistics\n timeline Show creation/completion over time\n \n Quality & Optimization:\n analyze <spec> Analyze spec complexity and structure\n check Check for sequence conflicts\n tokens [spec] Count tokens for LLM context management\n validate [specs...] Validate specs for quality issues\n \n Advanced Editing:\n compact <spec> Remove specified line ranges from spec\n split <spec> Split spec into multiple files\n \n Configuration:\n templates Manage spec templates\n \n Integration:\n agent Dispatch specs to AI coding agents\n mcp Start MCP server for AI assistants\n ui Start local web UI for spec management\n\nExamples:\n $ lean-spec init\n $ lean-spec init -y\n $ lean-spec init --example dark-theme\n $ lean-spec init --example dashboard-widgets --name my-demo\n $ lean-spec examples\n $ lean-spec create my-feature --priority high\n $ lean-spec list --status in-progress\n $ lean-spec view 042\n $ lean-spec link 085 --depends-on 042,035\n $ lean-spec link 085 --related 082\n $ lean-spec unlink 085 --depends-on 042\n $ lean-spec deps 085\n $ lean-spec backfill --dry-run\n $ lean-spec migrate ./docs/adr\n $ lean-spec migrate ./docs/rfcs --with copilot\n $ lean-spec board --tag backend\n $ lean-spec search \"authentication\"\n $ lean-spec validate\n $ lean-spec tokens 059\n $ lean-spec analyze 045 --json\n $ lean-spec split 045 --output README.md:1-150 --output DESIGN.md:151-end\n $ lean-spec agent list\n $ lean-spec agent run 045 --agent claude\n $ lean-spec agent run 045 047 048 --parallel\n $ lean-spec ui\n $ lean-spec ui --port 3001 --no-open\n $ lean-spec ui --specs ./docs/specs --dry-run\n`);\n\n// Register all commands (alphabetically ordered)\nregisterCommands(program);\n\n// Parse and execute\nprogram.parse();\n"]}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export { createMcpServer } from './chunk-RTEGSMVL.js';
2
+ export { createMcpServer } from './chunk-GSBLCPXH.js';
3
3
  import './chunk-LVD7ZAVZ.js';
4
4
  //# sourceMappingURL=mcp-server.js.map
5
5
  //# sourceMappingURL=mcp-server.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lean-spec",
3
- "version": "0.2.6",
3
+ "version": "0.2.7-dev.20251126090633",
4
4
  "description": "Specification-driven development made simple",
5
5
  "type": "module",
6
6
  "bin": {
@@ -67,7 +67,7 @@
67
67
  "zod": "^3.25.76"
68
68
  },
69
69
  "devDependencies": {
70
- "@leanspec/core": "^0.2.6",
70
+ "@leanspec/core": "workspace:*",
71
71
  "@types/js-yaml": "^4.0.9",
72
72
  "@types/marked-terminal": "^6.1.1",
73
73
  "@types/node": "^20.10.0",
@@ -2,112 +2,157 @@
2
2
 
3
3
  ## Project: {project_name}
4
4
 
5
- Lightweight spec methodology for AI-powered development.
5
+ <!-- ═══════════════════════════════════════════════════════════════════════════
6
+ 👇 TODO: Fill in your project context below (then delete these comments)
7
+ ═══════════════════════════════════════════════════════════════════════════ -->
8
+
9
+ ### 📋 Project Context
10
+
11
+ **What this project does:**
12
+ _TODO: Describe your project in 1-2 sentences_
13
+
14
+ **Tech stack:**
15
+ _TODO: List main technologies (e.g., Node.js, React, PostgreSQL)_
16
+
17
+ **Key objectives:**
18
+ _TODO: What are you building toward? (e.g., Launch MVP by Q1)_
19
+
20
+ <!-- ═══════════════════════════════════════════════════════════════════════════
21
+ 👆 End of TODO section - Delete these comment markers when done
22
+ ═══════════════════════════════════════════════════════════════════════════ -->
23
+
24
+ ## 🚨 CRITICAL: Before ANY Task
25
+
26
+ **STOP and check these first:**
27
+
28
+ 1. **Discover context** → Use `board` tool to see project state
29
+ 2. **Search for related work** → Use `search` tool before creating new specs
30
+ 3. **Never create files manually** → Always use `create` tool for new specs
31
+
32
+ > **Why?** Skipping discovery creates duplicate work. Manual file creation breaks LeanSpec tooling.
33
+
34
+ ## 🔧 How to Manage Specs
35
+
36
+ ### Primary Method: MCP Tools (Recommended)
37
+
38
+ If you have LeanSpec MCP tools available, **ALWAYS use them**:
39
+
40
+ | Action | MCP Tool | Description |
41
+ |--------|----------|-------------|
42
+ | See project status | `board` | Kanban view + project health metrics |
43
+ | List all specs | `list` | Filterable list with metadata |
44
+ | Search specs | `search` | Semantic search across all content |
45
+ | View a spec | `view` | Full content with formatting |
46
+ | Create new spec | `create` | Auto-sequences, proper structure |
47
+ | Update spec | `update` | Validates transitions, timestamps |
48
+ | Check dependencies | `deps` | Visual dependency graph |
49
+
50
+ **Why MCP over CLI?**
51
+ - ✅ Direct tool integration (no shell execution needed)
52
+ - ✅ Structured responses (better for AI reasoning)
53
+ - ✅ Real-time validation (immediate feedback)
54
+ - ✅ Context-aware (understands project state)
55
+
56
+ ### Fallback: CLI Commands
57
+
58
+ If MCP tools are not available, use CLI commands:
59
+
60
+ ```bash
61
+ lean-spec board # Project overview
62
+ lean-spec list # See all specs
63
+ lean-spec search "query" # Find relevant specs
64
+ lean-spec create <name> # Create new spec
65
+ lean-spec update <spec> --status <status> # Update status
66
+ lean-spec deps <spec> # Show dependencies
67
+ ```
68
+
69
+ **Tip:** Check if you have LeanSpec MCP tools available before using CLI.
70
+
71
+ ## ⚠️ SDD Workflow Checkpoints
72
+
73
+ ### Before Starting ANY Task
74
+
75
+ 1. 📋 **Run `board`** - What's the current project state?
76
+ 2. 🔍 **Run `search`** - Are there related specs already?
77
+ 3. 📝 **Check existing specs** - Is there one for this work?
78
+
79
+ ### During Implementation
80
+
81
+ 4. 📊 **Update status to `in-progress`** BEFORE coding
82
+ 5. 📝 **Document decisions** in the spec as you work
83
+ 6. 🔗 **Link related specs** if you discover connections
84
+
85
+ ### After Completing Work
86
+
87
+ 7. ✅ **Update status to `complete`** when done
88
+ 8. 📄 **Document what you learned** in the spec
89
+ 9. 🤔 **Create follow-up specs** if needed
90
+
91
+ ### 🚫 Common Mistakes to Avoid
92
+
93
+ | ❌ Don't | ✅ Do Instead |
94
+ |----------|---------------|
95
+ | Create spec files manually | Use `create` tool |
96
+ | Skip discovery before new work | Run `board` and `search` first |
97
+ | Leave status as "planned" after starting | Update to `in-progress` immediately |
98
+ | Finish work without updating spec | Document decisions, update status |
99
+ | Edit frontmatter manually | Use `update` tool |
100
+ | Forget about specs mid-conversation | Check spec status periodically |
6
101
 
7
102
  ## Core Rules
8
103
 
9
104
  1. **Read README.md first** - Understand project context
10
105
  2. **Check specs/** - Review existing specs before starting
11
- 3. **Use `lean-spec --help`** - When unsure about commands, check the built-in help
106
+ 3. **Use MCP tools** - Prefer MCP over CLI when available
12
107
  4. **Follow LeanSpec principles** - Clarity over documentation
13
108
  5. **Keep it minimal** - If it doesn't add clarity, cut it
14
- 6. **NEVER manually edit system-managed frontmatter** - Fields like `status`, `priority`, `tags`, `assignee`, `transitions`, `created_at`, `updated_at`, `completed_at`, `depends_on`, `related` are system-managed. Always use `lean-spec update`, `lean-spec link`, `lean-spec unlink`, or `lean-spec create` commands. Manual edits will cause metadata corruption and tracking issues.
15
- 7. **Never use nested code blocks** - Markdown doesn't support code blocks within code blocks. If you need to show code examples in documentation, use indentation or describe the structure instead of nesting backticks.
109
+ 6. **NEVER manually edit frontmatter** - Use `update`, `link`, `unlink` tools
110
+ 7. **Track progress in specs** - Update status and document decisions
16
111
 
17
112
  ## When to Use Specs
18
113
 
19
- Write a spec for:
114
+ **Write a spec for:**
20
115
  - Features affecting multiple parts of the system
21
116
  - Breaking changes or significant refactors
22
117
  - Design decisions needing team alignment
23
118
 
24
- Skip specs for:
119
+ **Skip specs for:**
25
120
  - Bug fixes
26
121
  - Trivial changes
27
122
  - Self-explanatory refactors
28
123
 
29
- ## Essential Commands
30
-
31
- **Quick Reference** (for full details, see `lean-spec --help`):
32
-
33
- **Discovery:**
34
- - `lean-spec list` - See all specs
35
- - `lean-spec search "<query>"` - Find relevant specs
36
-
37
- **Working with specs:**
38
- - `lean-spec create <name>` - Create new spec
39
- - `lean-spec update <spec> --status <status>` - Update status (REQUIRED - never edit frontmatter manually)
40
- - `lean-spec update <spec> --priority <priority>` - Update priority
41
- - `lean-spec deps <spec>` - Show dependency graph
42
- - `lean-spec tokens <spec>` - Count tokens for context management
43
-
44
- **Project overview:**
45
- - `lean-spec board` - Kanban view with project health
46
- - `lean-spec stats` - Quick project metrics
47
-
48
- **When in doubt:** Run `lean-spec --help` or `lean-spec <command> --help` to discover commands.
49
-
50
124
  ## Spec Relationships
51
125
 
52
- LeanSpec has two types of relationships:
53
-
54
126
  ### `related` - Bidirectional Soft Reference
55
- Informational relationship between specs. Automatically shown from both sides.
56
-
57
- **Use when:** Specs cover related topics, work is coordinated but not blocking.
127
+ Informational relationship between specs. Shown from both sides.
128
+ **Use when:** Related topics, coordinated but not blocking work.
58
129
 
59
130
  ### `depends_on` - Directional Blocking Dependency
60
131
  Hard dependency - spec cannot start until dependencies complete.
132
+ **Use when:** True blocking dependency, work order matters.
61
133
 
62
- **Use when:** Spec truly cannot start until another completes, work order matters.
63
-
64
- **Best Practice:** Use `related` by default. Reserve `depends_on` for true blocking dependencies.
65
-
66
- ## SDD Workflow
67
-
68
- 1. **Discover** - Check existing specs with `lean-spec list`
69
- 2. **Plan** - Create spec with `lean-spec create <name>` (status: `planned`)
70
- 3. **Start Work** - Run `lean-spec update <spec> --status in-progress` before implementing
71
- 4. **Implement** - Write code/docs, keep spec in sync as you learn
72
- 5. **Complete** - Run `lean-spec update <spec> --status complete` after implementation done
73
- 6. **Document** - Report progress and document changes into the spec
74
-
75
- **CRITICAL - What "Work" Means:**
76
- - ❌ **NOT**: Creating/writing the spec document itself
77
- - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
78
-
79
- **Frontmatter Editing Rules:**
80
- - **NEVER manually edit**: `status`, `priority`, `tags`, `assignee`, `transitions`, timestamps, `depends_on`, `related`
81
- - **Use CLI commands**: `lean-spec update`, `lean-spec link`, `lean-spec unlink`
82
-
83
- **Note on Archiving**: Archive specs when they're no longer actively referenced (weeks/months after completion), not immediately. Use `lean-spec archive <spec>` to move old/stale specs to `archived/` directory.
134
+ **Default:** Use `related`. Reserve `depends_on` for true blockers.
84
135
 
85
136
  ## Quality Standards
86
137
 
87
- - Code is clear and maintainable
88
- - Tests cover critical paths
89
- - Specs stay in sync with implementation
90
138
  - **Status tracking is mandatory:**
91
- - Specs start as `planned` after creation
92
- - Mark `in-progress` BEFORE starting implementation work
93
- - Mark `complete` AFTER implementation is finished
94
- - **Remember**: Status tracks implementation, not spec document completion
95
- - Never leave specs with stale status
139
+ - `planned` after creation
140
+ - `in-progress` BEFORE starting implementation
141
+ - `complete` AFTER finishing implementation
142
+ - Specs stay in sync with implementation
143
+ - Never leave specs with stale status
96
144
 
97
145
  ## Spec Complexity Guidelines
98
146
 
99
- **Token Thresholds:**
100
- - **<2,000 tokens**: ✅ Optimal
101
- - **2,000-3,500 tokens**:Good
102
- - **3,500-5,000 tokens**: ⚠️ Warning - Consider splitting
103
- - **>5,000 tokens**: 🔴 Should split
104
-
105
- **Check with:** `lean-spec tokens <spec>`
106
-
107
- **When to split:** >3,500 tokens, multiple concerns, takes >10 min to read
147
+ | Tokens | Status |
148
+ |--------|--------|
149
+ | <2,000 |Optimal |
150
+ | 2,000-3,500 | Good |
151
+ | 3,500-5,000 | ⚠️ Consider splitting |
152
+ | >5,000 | 🔴 Should split |
108
153
 
109
- **How to split:** Use sub-specs or split into related specs with `lean-spec link --related`
154
+ Use `tokens` tool to check spec size.
110
155
 
111
156
  ---
112
157
 
113
- **Remember**: LeanSpec is a mindset, not a rulebook. When in doubt, keep it simple and use `lean-spec --help` to discover features as needed.
158
+ **Remember:** LeanSpec tracks what you're building. Keep specs in sync with your work!
@@ -2,112 +2,157 @@
2
2
 
3
3
  ## Project: {project_name}
4
4
 
5
- Lightweight spec methodology for AI-powered development.
5
+ <!-- ═══════════════════════════════════════════════════════════════════════════
6
+ 👇 TODO: Fill in your project context below (then delete these comments)
7
+ ═══════════════════════════════════════════════════════════════════════════ -->
8
+
9
+ ### 📋 Project Context
10
+
11
+ **What this project does:**
12
+ _TODO: Describe your project in 1-2 sentences_
13
+
14
+ **Tech stack:**
15
+ _TODO: List main technologies (e.g., Node.js, React, PostgreSQL)_
16
+
17
+ **Key objectives:**
18
+ _TODO: What are you building toward? (e.g., Launch MVP by Q1)_
19
+
20
+ <!-- ═══════════════════════════════════════════════════════════════════════════
21
+ 👆 End of TODO section - Delete these comment markers when done
22
+ ═══════════════════════════════════════════════════════════════════════════ -->
23
+
24
+ ## 🚨 CRITICAL: Before ANY Task
25
+
26
+ **STOP and check these first:**
27
+
28
+ 1. **Discover context** → Use `board` tool to see project state
29
+ 2. **Search for related work** → Use `search` tool before creating new specs
30
+ 3. **Never create files manually** → Always use `create` tool for new specs
31
+
32
+ > **Why?** Skipping discovery creates duplicate work. Manual file creation breaks LeanSpec tooling.
33
+
34
+ ## 🔧 How to Manage Specs
35
+
36
+ ### Primary Method: MCP Tools (Recommended)
37
+
38
+ If you have LeanSpec MCP tools available, **ALWAYS use them**:
39
+
40
+ | Action | MCP Tool | Description |
41
+ |--------|----------|-------------|
42
+ | See project status | `board` | Kanban view + project health metrics |
43
+ | List all specs | `list` | Filterable list with metadata |
44
+ | Search specs | `search` | Semantic search across all content |
45
+ | View a spec | `view` | Full content with formatting |
46
+ | Create new spec | `create` | Auto-sequences, proper structure |
47
+ | Update spec | `update` | Validates transitions, timestamps |
48
+ | Check dependencies | `deps` | Visual dependency graph |
49
+
50
+ **Why MCP over CLI?**
51
+ - ✅ Direct tool integration (no shell execution needed)
52
+ - ✅ Structured responses (better for AI reasoning)
53
+ - ✅ Real-time validation (immediate feedback)
54
+ - ✅ Context-aware (understands project state)
55
+
56
+ ### Fallback: CLI Commands
57
+
58
+ If MCP tools are not available, use CLI commands:
59
+
60
+ ```bash
61
+ lean-spec board # Project overview
62
+ lean-spec list # See all specs
63
+ lean-spec search "query" # Find relevant specs
64
+ lean-spec create <name> # Create new spec
65
+ lean-spec update <spec> --status <status> # Update status
66
+ lean-spec deps <spec> # Show dependencies
67
+ ```
68
+
69
+ **Tip:** Check if you have LeanSpec MCP tools available before using CLI.
70
+
71
+ ## ⚠️ SDD Workflow Checkpoints
72
+
73
+ ### Before Starting ANY Task
74
+
75
+ 1. 📋 **Run `board`** - What's the current project state?
76
+ 2. 🔍 **Run `search`** - Are there related specs already?
77
+ 3. 📝 **Check existing specs** - Is there one for this work?
78
+
79
+ ### During Implementation
80
+
81
+ 4. 📊 **Update status to `in-progress`** BEFORE coding
82
+ 5. 📝 **Document decisions** in the spec as you work
83
+ 6. 🔗 **Link related specs** if you discover connections
84
+
85
+ ### After Completing Work
86
+
87
+ 7. ✅ **Update status to `complete`** when done
88
+ 8. 📄 **Document what you learned** in the spec
89
+ 9. 🤔 **Create follow-up specs** if needed
90
+
91
+ ### 🚫 Common Mistakes to Avoid
92
+
93
+ | ❌ Don't | ✅ Do Instead |
94
+ |----------|---------------|
95
+ | Create spec files manually | Use `create` tool |
96
+ | Skip discovery before new work | Run `board` and `search` first |
97
+ | Leave status as "planned" after starting | Update to `in-progress` immediately |
98
+ | Finish work without updating spec | Document decisions, update status |
99
+ | Edit frontmatter manually | Use `update` tool |
100
+ | Forget about specs mid-conversation | Check spec status periodically |
6
101
 
7
102
  ## Core Rules
8
103
 
9
104
  1. **Read README.md first** - Understand project context
10
105
  2. **Check specs/** - Review existing specs before starting
11
- 3. **Use `lean-spec --help`** - When unsure about commands, check the built-in help
106
+ 3. **Use MCP tools** - Prefer MCP over CLI when available
12
107
  4. **Follow LeanSpec principles** - Clarity over documentation
13
108
  5. **Keep it minimal** - If it doesn't add clarity, cut it
14
- 6. **NEVER manually edit system-managed frontmatter** - Fields like `status`, `priority`, `tags`, `assignee`, `transitions`, `created_at`, `updated_at`, `completed_at`, `depends_on`, `related` are system-managed. Always use `lean-spec update`, `lean-spec link`, `lean-spec unlink`, or `lean-spec create` commands. Manual edits will cause metadata corruption and tracking issues.
15
- 7. **Never use nested code blocks** - Markdown doesn't support code blocks within code blocks. If you need to show code examples in documentation, use indentation or describe the structure instead of nesting backticks.
109
+ 6. **NEVER manually edit frontmatter** - Use `update`, `link`, `unlink` tools
110
+ 7. **Track progress in specs** - Update status and document decisions
16
111
 
17
112
  ## When to Use Specs
18
113
 
19
- Write a spec for:
114
+ **Write a spec for:**
20
115
  - Features affecting multiple parts of the system
21
116
  - Breaking changes or significant refactors
22
117
  - Design decisions needing team alignment
23
118
 
24
- Skip specs for:
119
+ **Skip specs for:**
25
120
  - Bug fixes
26
121
  - Trivial changes
27
122
  - Self-explanatory refactors
28
123
 
29
- ## Essential Commands
30
-
31
- **Quick Reference** (for full details, see `lean-spec --help`):
32
-
33
- **Discovery:**
34
- - `lean-spec list` - See all specs
35
- - `lean-spec search "<query>"` - Find relevant specs
36
-
37
- **Working with specs:**
38
- - `lean-spec create <name>` - Create new spec
39
- - `lean-spec update <spec> --status <status>` - Update status (REQUIRED - never edit frontmatter manually)
40
- - `lean-spec update <spec> --priority <priority>` - Update priority
41
- - `lean-spec deps <spec>` - Show dependency graph
42
- - `lean-spec tokens <spec>` - Count tokens for context management
43
-
44
- **Project overview:**
45
- - `lean-spec board` - Kanban view with project health
46
- - `lean-spec stats` - Quick project metrics
47
-
48
- **When in doubt:** Run `lean-spec --help` or `lean-spec <command> --help` to discover commands.
49
-
50
124
  ## Spec Relationships
51
125
 
52
- LeanSpec has two types of relationships:
53
-
54
126
  ### `related` - Bidirectional Soft Reference
55
- Informational relationship between specs. Automatically shown from both sides.
56
-
57
- **Use when:** Specs cover related topics, work is coordinated but not blocking.
127
+ Informational relationship between specs. Shown from both sides.
128
+ **Use when:** Related topics, coordinated but not blocking work.
58
129
 
59
130
  ### `depends_on` - Directional Blocking Dependency
60
131
  Hard dependency - spec cannot start until dependencies complete.
132
+ **Use when:** True blocking dependency, work order matters.
61
133
 
62
- **Use when:** Spec truly cannot start until another completes, work order matters.
63
-
64
- **Best Practice:** Use `related` by default. Reserve `depends_on` for true blocking dependencies.
65
-
66
- ## SDD Workflow
67
-
68
- 1. **Discover** - Check existing specs with `lean-spec list`
69
- 2. **Plan** - Create spec with `lean-spec create <name>` (status: `planned`)
70
- 3. **Start Work** - Run `lean-spec update <spec> --status in-progress` before implementing
71
- 4. **Implement** - Write code/docs, keep spec in sync as you learn
72
- 5. **Complete** - Run `lean-spec update <spec> --status complete` after implementation done
73
- 6. **Document** - Report progress and document changes into the spec
74
-
75
- **CRITICAL - What "Work" Means:**
76
- - ❌ **NOT**: Creating/writing the spec document itself
77
- - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
78
-
79
- **Frontmatter Editing Rules:**
80
- - **NEVER manually edit**: `status`, `priority`, `tags`, `assignee`, `transitions`, timestamps, `depends_on`, `related`
81
- - **Use CLI commands**: `lean-spec update`, `lean-spec link`, `lean-spec unlink`
82
-
83
- **Note on Archiving**: Archive specs when they're no longer actively referenced (weeks/months after completion), not immediately. Use `lean-spec archive <spec>` to move old/stale specs to `archived/` directory.
134
+ **Default:** Use `related`. Reserve `depends_on` for true blockers.
84
135
 
85
136
  ## Quality Standards
86
137
 
87
- - Code is clear and maintainable
88
- - Tests cover critical paths
89
- - Specs stay in sync with implementation
90
138
  - **Status tracking is mandatory:**
91
- - Specs start as `planned` after creation
92
- - Mark `in-progress` BEFORE starting implementation work
93
- - Mark `complete` AFTER implementation is finished
94
- - **Remember**: Status tracks implementation, not spec document completion
95
- - Never leave specs with stale status
139
+ - `planned` after creation
140
+ - `in-progress` BEFORE starting implementation
141
+ - `complete` AFTER finishing implementation
142
+ - Specs stay in sync with implementation
143
+ - Never leave specs with stale status
96
144
 
97
145
  ## Spec Complexity Guidelines
98
146
 
99
- **Token Thresholds:**
100
- - **<2,000 tokens**: ✅ Optimal
101
- - **2,000-3,500 tokens**:Good
102
- - **3,500-5,000 tokens**: ⚠️ Warning - Consider splitting
103
- - **>5,000 tokens**: 🔴 Should split
104
-
105
- **Check with:** `lean-spec tokens <spec>`
106
-
107
- **When to split:** >3,500 tokens, multiple concerns, takes >10 min to read
147
+ | Tokens | Status |
148
+ |--------|--------|
149
+ | <2,000 |Optimal |
150
+ | 2,000-3,500 | Good |
151
+ | 3,500-5,000 | ⚠️ Consider splitting |
152
+ | >5,000 | 🔴 Should split |
108
153
 
109
- **How to split:** Use sub-specs or split into related specs with `lean-spec link --related`
154
+ Use `tokens` tool to check spec size.
110
155
 
111
156
  ---
112
157
 
113
- **Remember**: LeanSpec is a mindset, not a rulebook. When in doubt, keep it simple and use `lean-spec --help` to discover features as needed.
158
+ **Remember:** LeanSpec tracks what you're building. Keep specs in sync with your work!