lean-spec 0.2.2 → 0.2.4

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.
Files changed (37) hide show
  1. package/dist/{chunk-7MCDTSVE.js → chunk-UHMYFCXJ.js} +4083 -2886
  2. package/dist/chunk-UHMYFCXJ.js.map +1 -0
  3. package/dist/cli.js +67 -238
  4. package/dist/cli.js.map +1 -1
  5. package/dist/mcp-server.d.ts +1 -1
  6. package/dist/mcp-server.js +1 -1
  7. package/package.json +4 -4
  8. package/templates/_shared/agents-components/{core-rules-base.md → core-rules-base-additions.md} +0 -1
  9. package/templates/_shared/agents-components/{core-rules-enterprise.md → core-rules-enterprise-additions.md} +0 -1
  10. package/templates/_shared/agents-components/core-rules-shared.md +1 -0
  11. package/templates/_shared/agents-components/discovery-commands-enterprise-additions.md +6 -0
  12. package/templates/_shared/agents-components/discovery-commands-minimal-additions.md +0 -0
  13. package/templates/_shared/agents-components/discovery-commands-standard-additions.md +3 -0
  14. package/templates/_shared/agents-components/essential-commands-enterprise-additions.md +29 -0
  15. package/templates/_shared/agents-components/essential-commands-minimal-additions.md +1 -0
  16. package/templates/_shared/agents-components/essential-commands-shared.md +15 -0
  17. package/templates/_shared/agents-components/essential-commands-standard-additions.md +18 -0
  18. package/templates/_shared/agents-components/{quality-standards-enterprise.md → quality-standards-enterprise-additions.md} +0 -2
  19. package/templates/_shared/agents-components/{quality-standards-base.md → quality-standards-minimal-additions.md} +0 -2
  20. package/templates/_shared/agents-components/quality-standards-shared.md +6 -0
  21. package/templates/_shared/agents-components/status-update-triggers.md +14 -0
  22. package/templates/_shared/agents-components/workflow-enterprise.md +7 -4
  23. package/templates/_shared/agents-components/workflow-standard-detailed.md +7 -4
  24. package/templates/_shared/agents-components/workflow-standard.md +7 -4
  25. package/templates/_shared/agents-template.hbs +4 -0
  26. package/templates/enterprise/agents-config.json +5 -4
  27. package/templates/enterprise/files/AGENTS.md +79 -9
  28. package/templates/minimal/agents-config.json +5 -4
  29. package/templates/minimal/files/AGENTS.md +44 -5
  30. package/templates/standard/agents-config.json +5 -4
  31. package/templates/standard/files/AGENTS.md +66 -9
  32. package/dist/chunk-7MCDTSVE.js.map +0 -1
  33. package/dist/commands-GRG5UUOF.js +0 -4
  34. package/dist/commands-GRG5UUOF.js.map +0 -1
  35. package/templates/_shared/agents-components/discovery-commands-enterprise.md +0 -10
  36. package/templates/_shared/agents-components/discovery-commands-standard.md +0 -9
  37. /package/templates/_shared/agents-components/{discovery-commands-minimal.md → discovery-commands-shared.md} +0 -0
@@ -0,0 +1,6 @@
1
+ - Code is clear and maintainable
2
+ - Specs stay in sync with implementation
3
+ - **Status tracking is mandatory:**
4
+ - Mark spec as `in-progress` BEFORE starting work
5
+ - Mark spec as `complete` IMMEDIATELY after finishing
6
+ - Never leave specs with stale status
@@ -0,0 +1,14 @@
1
+ **CRITICAL - What "Work" Means:**
2
+ - ❌ **NOT**: Creating/writing the spec document itself
3
+ - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
4
+ - **Example**: Creating a spec for "API redesign" ≠ work complete
5
+ - Work = Actually redesigning the API as described in the spec
6
+ - Status `planned` until someone starts the redesign
7
+ - Status `in-progress` while redesigning
8
+ - Status `complete` after redesign is done
9
+
10
+ **Status Update Triggers:**
11
+ - ✅ **Before starting implementation** → `lean-spec update <spec> --status in-progress`
12
+ - ✅ **After completing implementation** → `lean-spec update <spec> --status complete`
13
+ - ✅ **If blocked or paused** → Update status and document why in spec
14
+ - ❌ **NEVER mark spec complete just because you finished writing it**
@@ -1,8 +1,11 @@
1
1
  1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, or `lean-spec gantt`
2
2
  2. **Search existing specs** - Use `lean-spec search` or `lean-spec list --tag=<relevant>`
3
3
  3. **Check dependencies** - Run `lean-spec deps <spec>` to understand dependencies
4
- 4. **Create or update spec** - Add complete frontmatter with compliance tags
4
+ 4. **Create or update spec** - Add complete frontmatter with compliance tags (status: `planned`)
5
5
  5. **Get reviews** - Assign reviewer, tag for security review if needed
6
- 6. **Implement changes** - Keep spec in sync, update status appropriately
7
- 7. **Update status** - Mark progress through workflow states
8
- 8. **Archive when done** - `lean-spec archive <spec>` after completion
6
+ 6. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
7
+ 7. **Implement changes** - Keep spec in sync, update status appropriately
8
+ 8. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
9
+ 9. **Archive when done** - `lean-spec archive <spec>` after completion
10
+
11
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
@@ -1,7 +1,10 @@
1
1
  1. **Discover context** - Run `lean-spec stats` or `lean-spec board` to see current state
2
2
  2. **Search existing specs** - Use `lean-spec search` or `lean-spec list` to find relevant work
3
3
  3. **Check dependencies** - Run `lean-spec deps <spec>` if working on existing spec
4
- 4. **Create or update spec** - Add frontmatter with required fields and helpful metadata
5
- 5. **Implement changes** - Keep spec in sync as you learn
6
- 6. **Update status** - Mark progress: `draft` `in-progress` `complete`
7
- 7. **Archive when done** - `lean-spec archive <spec>` moves to archive
4
+ 4. **Create or update spec** - Add frontmatter with required fields (status: `planned`)
5
+ 5. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
6
+ 6. **Implement changes** - Keep spec in sync as you learn
7
+ 7. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
8
+ 8. **Archive when done** - `lean-spec archive <spec>` moves to archive
9
+
10
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
@@ -1,5 +1,8 @@
1
1
  1. **Check existing work** - Run `lean-spec board` or `lean-spec search`
2
- 2. **Create or update spec** - Add frontmatter with `status` and `created`
3
- 3. **Implement changes** - Keep spec in sync as you learn
4
- 4. **Update status** - Mark progress: `draft` `in-progress` `complete`
5
- 5. **Archive when done** - `lean-spec archive <spec>` moves to archive
2
+ 2. **Create or update spec** - Add frontmatter with `status` and `created` (status: `planned`)
3
+ 3. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
4
+ 4. **Implement changes** - Keep spec in sync as you learn
5
+ 5. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
6
+ 6. **Archive when done** - `lean-spec archive <spec>` moves to archive
7
+
8
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
@@ -17,6 +17,10 @@
17
17
  ## Discovery Commands
18
18
 
19
19
  {{{discoveryCommands}}}
20
+ {{#if essentialCommands}}
21
+
22
+ {{{essentialCommands}}}
23
+ {{/if}}
20
24
 
21
25
  ## Spec Frontmatter
22
26
 
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "description": "Enterprise-grade development with security and compliance requirements.",
3
- "coreRules": "core-rules-enterprise.md",
3
+ "coreRules": ["core-rules-enterprise-additions.md", "core-rules-shared.md"],
4
4
  "whenToUseEarly": false,
5
- "discoveryCommands": "discovery-commands-enterprise.md",
5
+ "discoveryCommands": ["discovery-commands-shared.md", "discovery-commands-enterprise-additions.md"],
6
+ "essentialCommands": ["essential-commands-shared.md", "essential-commands-enterprise-additions.md"],
6
7
  "frontmatter": "frontmatter-enterprise.md",
7
- "workflow": "workflow-enterprise.md",
8
- "qualityStandards": "quality-standards-enterprise.md",
8
+ "workflow": ["workflow-enterprise.md", "status-update-triggers.md"],
9
+ "qualityStandards": ["quality-standards-enterprise-additions.md", "quality-standards-shared.md"],
9
10
  "closingNote": "**Remember**: Enterprise doesn't mean heavy. Keep specs lean while meeting governance needs.",
10
11
  "additionalSections": [
11
12
  "enterprise-compliance.md",
@@ -14,16 +14,65 @@ Enterprise-grade development with security and compliance requirements.
14
14
 
15
15
  ## Discovery Commands
16
16
 
17
- Before starting work, understand project context and dependencies:
17
+ Before starting work, understand project context:
18
18
 
19
- - `lean-spec stats` - See work distribution across specs
20
- - `lean-spec board` - View specs organized by status
19
+ - `lean-spec stats` - See work distribution
20
+ - `lean-spec board` - View specs by status
21
+ - `lean-spec search "<query>"` - Find relevant work
22
+ - `lean-spec list` - List all specs
23
+
24
+ These help you understand what exists and what's in progress.
25
+ **Additional commands:**
21
26
  - `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=security`)
22
- - `lean-spec search "<query>"` - Full-text search across specs
23
27
  - `lean-spec deps <spec>` - Check dependencies before starting work
24
28
  - `lean-spec gantt` - View project timeline and milestones
25
29
 
26
- These commands help you understand what exists, what's in progress, and what depends on what.
30
+ **Note:** For enterprise, also consider dependencies and project timelines when planning work.
31
+
32
+ ## Essential Commands
33
+
34
+ **Discovery:**
35
+ - `lean-spec list` - See all specs
36
+ - `lean-spec search "<query>"` - Find relevant specs
37
+
38
+ **Viewing specs:**
39
+ - `lean-spec view <spec>` - View a spec (formatted)
40
+ - `lean-spec open <spec>` - Open spec in editor
41
+
42
+ **Working with specs:**
43
+ - `lean-spec create <name>` - Create a new spec
44
+ - `lean-spec update <spec> --status <status>` - Update spec status
45
+
46
+ **When in doubt:** Run `lean-spec --help` to see all available commands.
47
+ **Viewing specs (additional):**
48
+ - `lean-spec view <spec>/DESIGN.md` - View sub-spec file (DESIGN.md, TESTING.md, etc.)
49
+ - `lean-spec view <spec> --raw` - Get raw markdown (for parsing)
50
+ - `lean-spec view <spec> --json` - Get structured JSON
51
+ - `lean-spec files <spec>` - List all files in a spec (including sub-specs)
52
+
53
+ **Project Overview:**
54
+ - `lean-spec board` - Kanban view with project health summary
55
+ - `lean-spec stats` - Quick project metrics and insights
56
+ - `lean-spec stats --full` - Detailed analytics (all sections)
57
+
58
+ **Working with specs (additional):**
59
+ - `lean-spec update <spec> --status <status>` - Update spec status (REQUIRED - never edit frontmatter manually)
60
+ - `lean-spec update <spec> --priority <priority>` - Update spec priority (REQUIRED - never edit frontmatter manually)
61
+ - `lean-spec update <spec> --tags <tag1,tag2>` - Update spec tags (REQUIRED - never edit frontmatter manually)
62
+ - `lean-spec update <spec> --assignee <name>` - Update spec assignee (REQUIRED - never edit frontmatter manually)
63
+ - `lean-spec deps <spec>` - Show dependencies and relationships
64
+
65
+ **Token Management:**
66
+ - `lean-spec tokens <spec>` - Count tokens in a spec for LLM context management
67
+ - `lean-spec tokens` - Show token counts for all specs (sorted by token count)
68
+ - `lean-spec tokens <spec> --detailed` - Show content breakdown (prose vs code vs tables)
69
+
70
+ **Advanced Editing (AI Agent Orchestration):**
71
+ - `lean-spec analyze <spec>` - Analyze spec complexity and structure (returns JSON with --json flag)
72
+ - `lean-spec split <spec> --output FILE:LINES` - Split spec into multiple files by line ranges (spec 059)
73
+ - `lean-spec compact <spec> --remove LINES` - Remove specified line ranges from spec (spec 059)
74
+
75
+ **When in doubt (extended):** Run `lean-spec <command> --help` to discover available commands and options.
27
76
 
28
77
  ## Spec Frontmatter
29
78
 
@@ -104,11 +153,28 @@ Optional for:
104
153
  1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, or `lean-spec gantt`
105
154
  2. **Search existing specs** - Use `lean-spec search` or `lean-spec list --tag=<relevant>`
106
155
  3. **Check dependencies** - Run `lean-spec deps <spec>` to understand dependencies
107
- 4. **Create or update spec** - Add complete frontmatter with compliance tags
156
+ 4. **Create or update spec** - Add complete frontmatter with compliance tags (status: `planned`)
108
157
  5. **Get reviews** - Assign reviewer, tag for security review if needed
109
- 6. **Implement changes** - Keep spec in sync, update status appropriately
110
- 7. **Update status** - Mark progress through workflow states
111
- 8. **Archive when done** - `lean-spec archive <spec>` after completion
158
+ 6. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
159
+ 7. **Implement changes** - Keep spec in sync, update status appropriately
160
+ 8. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
161
+ 9. **Archive when done** - `lean-spec archive <spec>` after completion
162
+
163
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
164
+ **CRITICAL - What "Work" Means:**
165
+ - ❌ **NOT**: Creating/writing the spec document itself
166
+ - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
167
+ - **Example**: Creating a spec for "API redesign" ≠ work complete
168
+ - Work = Actually redesigning the API as described in the spec
169
+ - Status `planned` until someone starts the redesign
170
+ - Status `in-progress` while redesigning
171
+ - Status `complete` after redesign is done
172
+
173
+ **Status Update Triggers:**
174
+ - ✅ **Before starting implementation** → `lean-spec update <spec> --status in-progress`
175
+ - ✅ **After completing implementation** → `lean-spec update <spec> --status complete`
176
+ - ✅ **If blocked or paused** → Update status and document why in spec
177
+ - ❌ **NEVER mark spec complete just because you finished writing it**
112
178
 
113
179
  ## Quality Standards
114
180
 
@@ -118,6 +184,10 @@ Optional for:
118
184
  - Compliance checklist completed
119
185
  - Code is clear and maintainable
120
186
  - Specs stay in sync with implementation
187
+ - **Status tracking is mandatory:**
188
+ - Mark spec as `in-progress` BEFORE starting work
189
+ - Mark spec as `complete` IMMEDIATELY after finishing
190
+ - Never leave specs with stale status
121
191
 
122
192
  ---
123
193
 
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "description": "Lightweight spec methodology for AI-powered development.",
3
- "coreRules": "core-rules-base.md",
3
+ "coreRules": ["core-rules-base-additions.md", "core-rules-shared.md"],
4
4
  "whenToUse": "when-to-use-minimal.md",
5
5
  "whenToUseEarly": true,
6
- "discoveryCommands": "discovery-commands-minimal.md",
6
+ "discoveryCommands": ["discovery-commands-shared.md", "discovery-commands-minimal-additions.md"],
7
+ "essentialCommands": ["essential-commands-shared.md", "essential-commands-minimal-additions.md"],
7
8
  "frontmatter": "frontmatter-minimal.md",
8
- "workflow": "workflow-standard.md",
9
- "qualityStandards": "quality-standards-base.md",
9
+ "workflow": ["workflow-standard.md", "status-update-triggers.md"],
10
+ "qualityStandards": ["quality-standards-minimal-additions.md", "quality-standards-shared.md"],
10
11
  "closingNote": "**Remember**: LeanSpec is a mindset. Adapt these guidelines to what actually helps.",
11
12
  "additionalSections": []
12
13
  }
@@ -35,6 +35,24 @@ Before starting work, understand project context:
35
35
 
36
36
  These help you understand what exists and what's in progress.
37
37
 
38
+
39
+ ## Essential Commands
40
+
41
+ **Discovery:**
42
+ - `lean-spec list` - See all specs
43
+ - `lean-spec search "<query>"` - Find relevant specs
44
+
45
+ **Viewing specs:**
46
+ - `lean-spec view <spec>` - View a spec (formatted)
47
+ - `lean-spec open <spec>` - Open spec in editor
48
+
49
+ **Working with specs:**
50
+ - `lean-spec create <name>` - Create a new spec
51
+ - `lean-spec update <spec> --status <status>` - Update spec status
52
+
53
+ **When in doubt:** Run `lean-spec --help` to see all available commands.
54
+
55
+
38
56
  ## Spec Frontmatter
39
57
 
40
58
  When creating or updating specs, add YAML frontmatter at the top:
@@ -59,18 +77,39 @@ lean-spec update <spec> --status in-progress
59
77
  ## Workflow
60
78
 
61
79
  1. **Check existing work** - Run `lean-spec board` or `lean-spec search`
62
- 2. **Create or update spec** - Add frontmatter with `status` and `created`
63
- 3. **Implement changes** - Keep spec in sync as you learn
64
- 4. **Update status** - Mark progress: `draft` `in-progress` `complete`
65
- 5. **Archive when done** - `lean-spec archive <spec>` moves to archive
80
+ 2. **Create or update spec** - Add frontmatter with `status` and `created` (status: `planned`)
81
+ 3. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
82
+ 4. **Implement changes** - Keep spec in sync as you learn
83
+ 5. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
84
+ 6. **Archive when done** - `lean-spec archive <spec>` moves to archive
85
+
86
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
87
+ **CRITICAL - What "Work" Means:**
88
+ - ❌ **NOT**: Creating/writing the spec document itself
89
+ - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
90
+ - **Example**: Creating a spec for "API redesign" ≠ work complete
91
+ - Work = Actually redesigning the API as described in the spec
92
+ - Status `planned` until someone starts the redesign
93
+ - Status `in-progress` while redesigning
94
+ - Status `complete` after redesign is done
95
+
96
+ **Status Update Triggers:**
97
+ - ✅ **Before starting implementation** → `lean-spec update <spec> --status in-progress`
98
+ - ✅ **After completing implementation** → `lean-spec update <spec> --status complete`
99
+ - ✅ **If blocked or paused** → Update status and document why in spec
100
+ - ❌ **NEVER mark spec complete just because you finished writing it**
66
101
 
67
102
  ## Quality Standards
68
103
 
69
- - Code is clear and maintainable
70
104
  - Tests cover critical paths
71
105
  - No unnecessary complexity
72
106
  - Documentation where needed (not everywhere)
107
+ - Code is clear and maintainable
73
108
  - Specs stay in sync with implementation
109
+ - **Status tracking is mandatory:**
110
+ - Mark spec as `in-progress` BEFORE starting work
111
+ - Mark spec as `complete` IMMEDIATELY after finishing
112
+ - Never leave specs with stale status
74
113
 
75
114
  ---
76
115
 
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "description": "Lightweight spec methodology for AI-powered development.",
3
- "coreRules": "core-rules-base.md",
3
+ "coreRules": ["core-rules-base-additions.md", "core-rules-shared.md"],
4
4
  "whenToUse": "when-to-use-standard.md",
5
5
  "whenToUseEarly": true,
6
- "discoveryCommands": "discovery-commands-standard.md",
6
+ "discoveryCommands": ["discovery-commands-shared.md", "discovery-commands-standard-additions.md"],
7
+ "essentialCommands": ["essential-commands-shared.md", "essential-commands-standard-additions.md"],
7
8
  "frontmatter": "frontmatter-standard.md",
8
- "workflow": "workflow-standard-detailed.md",
9
- "qualityStandards": "quality-standards-base.md",
9
+ "workflow": ["workflow-standard-detailed.md", "status-update-triggers.md"],
10
+ "qualityStandards": ["quality-standards-minimal-additions.md", "quality-standards-shared.md"],
10
11
  "closingNote": "**Remember**: LeanSpec is a mindset. Adapt these guidelines to what actually helps.",
11
12
  "additionalSections": []
12
13
  }
@@ -28,13 +28,49 @@ Skip specs for:
28
28
 
29
29
  Before starting work, understand project context:
30
30
 
31
- - `lean-spec stats` - See work distribution across specs
32
- - `lean-spec board` - View specs organized by status
31
+ - `lean-spec stats` - See work distribution
32
+ - `lean-spec board` - View specs by status
33
+ - `lean-spec search "<query>"` - Find relevant work
34
+ - `lean-spec list` - List all specs
35
+
36
+ These help you understand what exists and what's in progress.
37
+ **Additional commands:**
33
38
  - `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=api`)
34
- - `lean-spec search "<query>"` - Full-text search across specs
35
39
  - `lean-spec deps <spec>` - Check dependencies before starting work
36
40
 
37
- These commands help you understand what exists, what's in progress, and what depends on what.
41
+ ## Essential Commands
42
+
43
+ **Discovery:**
44
+ - `lean-spec list` - See all specs
45
+ - `lean-spec search "<query>"` - Find relevant specs
46
+
47
+ **Viewing specs:**
48
+ - `lean-spec view <spec>` - View a spec (formatted)
49
+ - `lean-spec open <spec>` - Open spec in editor
50
+
51
+ **Working with specs:**
52
+ - `lean-spec create <name>` - Create a new spec
53
+ - `lean-spec update <spec> --status <status>` - Update spec status
54
+
55
+ **When in doubt:** Run `lean-spec --help` to see all available commands.
56
+ **Viewing specs (additional):**
57
+ - `lean-spec view <spec> --raw` - Get raw markdown
58
+ - `lean-spec files <spec>` - List all files in a spec
59
+
60
+ **Project Overview:**
61
+ - `lean-spec board` - Kanban view with project health summary
62
+ - `lean-spec stats` - Quick project metrics
63
+
64
+ **Working with specs (additional):**
65
+ - `lean-spec update <spec> --priority <priority>` - Update spec priority
66
+ - `lean-spec update <spec> --tags <tag1,tag2>` - Update spec tags
67
+ - `lean-spec deps <spec>` - Show dependencies and relationships
68
+
69
+ **Token Management:**
70
+ - `lean-spec tokens <spec>` - Count tokens in a spec
71
+ - `lean-spec tokens` - Show token counts for all specs
72
+
73
+ **When in doubt (extended):** Run `lean-spec <command> --help` to discover available commands.
38
74
 
39
75
  ## Spec Frontmatter
40
76
 
@@ -67,18 +103,39 @@ lean-spec update <spec> --status in-progress --assignee yourname
67
103
  1. **Discover context** - Run `lean-spec stats` or `lean-spec board` to see current state
68
104
  2. **Search existing specs** - Use `lean-spec search` or `lean-spec list` to find relevant work
69
105
  3. **Check dependencies** - Run `lean-spec deps <spec>` if working on existing spec
70
- 4. **Create or update spec** - Add frontmatter with required fields and helpful metadata
71
- 5. **Implement changes** - Keep spec in sync as you learn
72
- 6. **Update status** - Mark progress: `draft` `in-progress` `complete`
73
- 7. **Archive when done** - `lean-spec archive <spec>` moves to archive
106
+ 4. **Create or update spec** - Add frontmatter with required fields (status: `planned`)
107
+ 5. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
108
+ 6. **Implement changes** - Keep spec in sync as you learn
109
+ 7. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
110
+ 8. **Archive when done** - `lean-spec archive <spec>` moves to archive
111
+
112
+ **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
113
+ **CRITICAL - What "Work" Means:**
114
+ - ❌ **NOT**: Creating/writing the spec document itself
115
+ - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
116
+ - **Example**: Creating a spec for "API redesign" ≠ work complete
117
+ - Work = Actually redesigning the API as described in the spec
118
+ - Status `planned` until someone starts the redesign
119
+ - Status `in-progress` while redesigning
120
+ - Status `complete` after redesign is done
121
+
122
+ **Status Update Triggers:**
123
+ - ✅ **Before starting implementation** → `lean-spec update <spec> --status in-progress`
124
+ - ✅ **After completing implementation** → `lean-spec update <spec> --status complete`
125
+ - ✅ **If blocked or paused** → Update status and document why in spec
126
+ - ❌ **NEVER mark spec complete just because you finished writing it**
74
127
 
75
128
  ## Quality Standards
76
129
 
77
- - Code is clear and maintainable
78
130
  - Tests cover critical paths
79
131
  - No unnecessary complexity
80
132
  - Documentation where needed (not everywhere)
133
+ - Code is clear and maintainable
81
134
  - Specs stay in sync with implementation
135
+ - **Status tracking is mandatory:**
136
+ - Mark spec as `in-progress` BEFORE starting work
137
+ - Mark spec as `complete` IMMEDIATELY after finishing
138
+ - Never leave specs with stale status
82
139
 
83
140
  ---
84
141