lean-spec 0.2.5-dev.20251124073254 → 0.2.5-dev.20251125010225

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 (55) hide show
  1. package/dist/{chunk-LV7XEQ4D.js → chunk-RTEGSMVL.js} +272 -46
  2. package/dist/chunk-RTEGSMVL.js.map +1 -0
  3. package/dist/cli.js +1 -1
  4. package/dist/mcp-server.js +1 -1
  5. package/package.json +1 -2
  6. package/templates/detailed/AGENTS.md +113 -0
  7. package/templates/detailed/README.md +28 -0
  8. package/templates/detailed/files/DESIGN.md +43 -0
  9. package/templates/detailed/files/PLAN.md +59 -0
  10. package/templates/detailed/files/README.md +30 -0
  11. package/templates/detailed/files/TEST.md +71 -0
  12. package/templates/standard/AGENTS.md +113 -0
  13. package/templates/standard/README.md +4 -2
  14. package/dist/chunk-LV7XEQ4D.js.map +0 -1
  15. package/templates/_shared/agents-components/core-rules-base-additions.md +0 -4
  16. package/templates/_shared/agents-components/core-rules-enterprise-additions.md +0 -4
  17. package/templates/_shared/agents-components/core-rules-shared.md +0 -1
  18. package/templates/_shared/agents-components/discovery-commands-enterprise-additions.md +0 -6
  19. package/templates/_shared/agents-components/discovery-commands-minimal-additions.md +0 -0
  20. package/templates/_shared/agents-components/discovery-commands-shared.md +0 -8
  21. package/templates/_shared/agents-components/discovery-commands-standard-additions.md +0 -3
  22. package/templates/_shared/agents-components/enterprise-approval.md +0 -12
  23. package/templates/_shared/agents-components/enterprise-compliance.md +0 -12
  24. package/templates/_shared/agents-components/enterprise-when-required.md +0 -13
  25. package/templates/_shared/agents-components/essential-commands-enterprise-additions.md +0 -29
  26. package/templates/_shared/agents-components/essential-commands-minimal-additions.md +0 -1
  27. package/templates/_shared/agents-components/essential-commands-shared.md +0 -15
  28. package/templates/_shared/agents-components/essential-commands-standard-additions.md +0 -18
  29. package/templates/_shared/agents-components/frontmatter-enterprise.md +0 -33
  30. package/templates/_shared/agents-components/frontmatter-minimal.md +0 -18
  31. package/templates/_shared/agents-components/frontmatter-standard.md +0 -23
  32. package/templates/_shared/agents-components/quality-standards-enterprise-additions.md +0 -4
  33. package/templates/_shared/agents-components/quality-standards-minimal-additions.md +0 -3
  34. package/templates/_shared/agents-components/quality-standards-shared.md +0 -6
  35. package/templates/_shared/agents-components/status-update-triggers.md +0 -14
  36. package/templates/_shared/agents-components/when-to-use-enterprise.md +0 -11
  37. package/templates/_shared/agents-components/when-to-use-minimal.md +0 -9
  38. package/templates/_shared/agents-components/when-to-use-standard.md +0 -9
  39. package/templates/_shared/agents-components/workflow-enterprise.md +0 -13
  40. package/templates/_shared/agents-components/workflow-standard-detailed.md +0 -12
  41. package/templates/_shared/agents-components/workflow-standard.md +0 -10
  42. package/templates/_shared/agents-template.hbs +0 -43
  43. package/templates/enterprise/README.md +0 -25
  44. package/templates/enterprise/agents-config.json +0 -16
  45. package/templates/enterprise/files/AGENTS.md +0 -198
  46. package/templates/enterprise/spec-template.md +0 -80
  47. package/templates/minimal/README.md +0 -18
  48. package/templates/minimal/agents-config.json +0 -13
  49. package/templates/minimal/config.json +0 -15
  50. package/templates/minimal/files/AGENTS.md +0 -118
  51. package/templates/minimal/spec-template.md +0 -25
  52. package/templates/standard/agents-config.json +0 -13
  53. package/templates/standard/files/AGENTS.md +0 -144
  54. /package/templates/{enterprise → detailed}/config.json +0 -0
  55. /package/templates/standard/{spec-template.md → files/README.md} +0 -0
@@ -1,4 +0,0 @@
1
- 1. **Read README.md first** - Understand project context
2
- 2. **Check specs/** - Review existing specs before starting
3
- 3. **Follow LeanSpec principles** - Clarity over documentation
4
- 4. **Keep it minimal** - If it doesn't add clarity, cut it
@@ -1,4 +0,0 @@
1
- 1. **Security first** - Follow security standards, no shortcuts
2
- 2. **Read specs/** - Check for compliance requirements
3
- 3. **Follow LeanSpec** - Lean doesn't mean skipping governance
4
- 4. **Document decisions** - Especially security and compliance choices
@@ -1 +0,0 @@
1
- 5. **Never use nested code blocks** - Markdown doesn't support code blocks within code blocks. Use indentation or describe the structure instead
@@ -1,6 +0,0 @@
1
- **Additional commands:**
2
- - `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=security`)
3
- - `lean-spec deps <spec>` - Check dependencies before starting work
4
- - `lean-spec gantt` - View project timeline and milestones
5
-
6
- **Note:** For enterprise, also consider dependencies and project timelines when planning work.
@@ -1,8 +0,0 @@
1
- Before starting work, understand project context:
2
-
3
- - `lean-spec stats` - See work distribution
4
- - `lean-spec board` - View specs by status
5
- - `lean-spec search "<query>"` - Find relevant work
6
- - `lean-spec list` - List all specs
7
-
8
- These help you understand what exists and what's in progress.
@@ -1,3 +0,0 @@
1
- **Additional commands:**
2
- - `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=api`)
3
- - `lean-spec deps <spec>` - Check dependencies before starting work
@@ -1,12 +0,0 @@
1
- ## Approval Workflow
2
-
3
- 1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, `lean-spec deps`
4
- 2. **Create spec** - Include all required frontmatter fields
5
- 3. **Technical review** - Assign reviewer in frontmatter
6
- 4. **Security team review** - For security/compliance-tagged specs
7
- 5. **Stakeholder sign-off** - Update status to `planned`
8
- 6. **Implementation** - Update status to `in-progress`, keep spec in sync
9
- 7. **Final review** - Before deployment
10
- 8. **Complete** - Mark `complete` after successful deployment
11
-
12
- **Note**: Archive specs only when they're no longer actively referenced (weeks/months later), not immediately after completion.
@@ -1,12 +0,0 @@
1
- ## Security & Compliance in Frontmatter
2
-
3
- Tag specs with relevant compliance standards:
4
- ```yaml
5
- tags: [security, api, pii]
6
- compliance: [SOC2, GDPR]
7
- ```
8
-
9
- This helps with:
10
- - Compliance audits and reporting
11
- - Security review prioritization
12
- - Regulatory requirement tracking
@@ -1,13 +0,0 @@
1
- ## When Specs Are Required
2
-
3
- Required for:
4
- - Features touching PII or sensitive data
5
- - Changes to authentication/authorization
6
- - New external integrations
7
- - Breaking changes to APIs
8
- - Infrastructure changes
9
-
10
- Optional for:
11
- - Internal refactors
12
- - Bug fixes (unless security-related)
13
- - Minor UI changes
@@ -1,29 +0,0 @@
1
- **Viewing specs (additional):**
2
- - `lean-spec view <spec>/DESIGN.md` - View sub-spec file (DESIGN.md, TESTING.md, etc.)
3
- - `lean-spec view <spec> --raw` - Get raw markdown (for parsing)
4
- - `lean-spec view <spec> --json` - Get structured JSON
5
- - `lean-spec files <spec>` - List all files in a spec (including sub-specs)
6
-
7
- **Project Overview:**
8
- - `lean-spec board` - Kanban view with project health summary
9
- - `lean-spec stats` - Quick project metrics and insights
10
- - `lean-spec stats --full` - Detailed analytics (all sections)
11
-
12
- **Working with specs (additional):**
13
- - `lean-spec update <spec> --status <status>` - Update spec status (REQUIRED - never edit frontmatter manually)
14
- - `lean-spec update <spec> --priority <priority>` - Update spec priority (REQUIRED - never edit frontmatter manually)
15
- - `lean-spec update <spec> --tags <tag1,tag2>` - Update spec tags (REQUIRED - never edit frontmatter manually)
16
- - `lean-spec update <spec> --assignee <name>` - Update spec assignee (REQUIRED - never edit frontmatter manually)
17
- - `lean-spec deps <spec>` - Show dependencies and relationships
18
-
19
- **Token Management:**
20
- - `lean-spec tokens <spec>` - Count tokens in a spec for LLM context management
21
- - `lean-spec tokens` - Show token counts for all specs (sorted by token count)
22
- - `lean-spec tokens <spec> --detailed` - Show content breakdown (prose vs code vs tables)
23
-
24
- **Advanced Editing (AI Agent Orchestration):**
25
- - `lean-spec analyze <spec>` - Analyze spec complexity and structure (returns JSON with --json flag)
26
- - `lean-spec split <spec> --output FILE:LINES` - Split spec into multiple files by line ranges (spec 059)
27
- - `lean-spec compact <spec> --remove LINES` - Remove specified line ranges from spec (spec 059)
28
-
29
- **When in doubt (extended):** Run `lean-spec <command> --help` to discover available commands and options.
@@ -1,15 +0,0 @@
1
- ## Essential Commands
2
-
3
- **Discovery:**
4
- - `lean-spec list` - See all specs
5
- - `lean-spec search "<query>"` - Find relevant specs
6
-
7
- **Viewing specs:**
8
- - `lean-spec view <spec>` - View a spec (formatted)
9
- - `lean-spec open <spec>` - Open spec in editor
10
-
11
- **Working with specs:**
12
- - `lean-spec create <name>` - Create a new spec
13
- - `lean-spec update <spec> --status <status>` - Update spec status
14
-
15
- **When in doubt:** Run `lean-spec --help` to see all available commands.
@@ -1,18 +0,0 @@
1
- **Viewing specs (additional):**
2
- - `lean-spec view <spec> --raw` - Get raw markdown
3
- - `lean-spec files <spec>` - List all files in a spec
4
-
5
- **Project Overview:**
6
- - `lean-spec board` - Kanban view with project health summary
7
- - `lean-spec stats` - Quick project metrics
8
-
9
- **Working with specs (additional):**
10
- - `lean-spec update <spec> --priority <priority>` - Update spec priority
11
- - `lean-spec update <spec> --tags <tag1,tag2>` - Update spec tags
12
- - `lean-spec deps <spec>` - Show dependencies and relationships
13
-
14
- **Token Management:**
15
- - `lean-spec tokens <spec>` - Count tokens in a spec
16
- - `lean-spec tokens` - Show token counts for all specs
17
-
18
- **When in doubt (extended):** Run `lean-spec <command> --help` to discover available commands.
@@ -1,33 +0,0 @@
1
- When creating or updating specs, include YAML frontmatter with all relevant fields:
2
-
3
- ```yaml
4
- ---
5
- status: draft|planned|in-progress|complete|blocked|cancelled
6
- created: YYYY-MM-DD
7
- tags: [security, api, compliance] # for discovery
8
- priority: low|medium|high|critical
9
- assignee: username
10
- reviewer: reviewer-username # required for review
11
- issue: JIRA-123 # link to issue tracker
12
- epic: EPIC-456 # link to epic
13
- compliance: [SOC2, GDPR, HIPAA] # applicable standards
14
- depends_on:
15
- - path/to/other/spec
16
- ---
17
- ```
18
-
19
- **Required fields:**
20
- - `status`, `created` - basic tracking
21
- - `tags`, `priority` - planning and discovery
22
- - `assignee`, `reviewer` - accountability
23
- - `compliance` - regulatory requirements (if applicable)
24
-
25
- **Integration fields:**
26
- - `issue`, `epic` - link to external systems
27
- - `depends_on` - explicit dependencies
28
-
29
- **Update with:**
30
- ```bash
31
- lean-spec update <spec> --status in-progress --assignee yourname
32
- # or edit frontmatter directly
33
- ```
@@ -1,18 +0,0 @@
1
- When creating or updating specs, add YAML frontmatter at the top:
2
-
3
- ```yaml
4
- ---
5
- status: draft|planned|in-progress|complete|blocked|cancelled
6
- created: YYYY-MM-DD
7
- ---
8
- ```
9
-
10
- **Keep it simple:**
11
- - Just `status` and `created` fields
12
- - Other fields are optional - only add if helpful
13
- - Update `status` as work progresses
14
-
15
- **Update status with:**
16
- ```bash
17
- lean-spec update <spec> --status in-progress
18
- ```
@@ -1,23 +0,0 @@
1
- When creating or updating specs, include YAML frontmatter at the top:
2
-
3
- ```yaml
4
- ---
5
- status: draft|planned|in-progress|complete|blocked|cancelled
6
- created: YYYY-MM-DD
7
- tags: [tag1, tag2] # helps with discovery
8
- priority: low|medium|high # helps with planning
9
- assignee: username # for team coordination
10
- ---
11
- ```
12
-
13
- **Core fields:**
14
- - `status` and `created` are required
15
- - `tags` help with discovery and organization
16
- - `priority` helps teams plan work
17
- - `assignee` shows who's working on what
18
-
19
- **Update status with:**
20
- ```bash
21
- lean-spec update <spec> --status in-progress --assignee yourname
22
- # or edit frontmatter directly
23
- ```
@@ -1,4 +0,0 @@
1
- - Security requirements verified
2
- - Tests include security scenarios
3
- - Documentation complete
4
- - Compliance checklist completed
@@ -1,3 +0,0 @@
1
- - Tests cover critical paths
2
- - No unnecessary complexity
3
- - Documentation where needed (not everywhere)
@@ -1,6 +0,0 @@
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
@@ -1,14 +0,0 @@
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,11 +0,0 @@
1
- Required for:
2
- - Features touching PII or sensitive data
3
- - Changes to authentication/authorization
4
- - New external integrations
5
- - Breaking changes to APIs
6
- - Infrastructure changes
7
-
8
- Optional for:
9
- - Internal refactors
10
- - Bug fixes (unless security-related)
11
- - Minor UI changes
@@ -1,9 +0,0 @@
1
- - Features that affect multiple parts of the system
2
- - Breaking changes or significant refactors
3
- - Design decisions that need thinking through
4
- - Complex features that benefit from upfront planning
5
-
6
- Skip specs for:
7
- - Bug fixes
8
- - Trivial changes
9
- - Self-explanatory refactors
@@ -1,9 +0,0 @@
1
- - Features that affect multiple parts of the system
2
- - Breaking changes or significant refactors
3
- - Design decisions that need team alignment
4
- - Complex features that benefit from upfront thinking
5
-
6
- Skip specs for:
7
- - Bug fixes
8
- - Trivial changes
9
- - Self-explanatory refactors
@@ -1,13 +0,0 @@
1
- 1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, or `lean-spec gantt`
2
- 2. **Search existing specs** - Use `lean-spec search` or `lean-spec list --tag=<relevant>`
3
- 3. **Check dependencies** - Run `lean-spec deps <spec>` to understand dependencies
4
- 4. **Create or update spec** - Add complete frontmatter with compliance tags (status: `planned`)
5
- 5. **Get reviews** - Assign reviewer, tag for security review if needed
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. **Document** - Report progress and document changes into the spec
10
-
11
- **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
12
-
13
- **Note on Archiving**: Archive specs when they're no longer actively referenced (weeks/months after completion), not immediately. Used for historical specs, not recent work. Use `lean-spec archive <spec>` to move old specs to `archived/` directory.
@@ -1,12 +0,0 @@
1
- 1. **Discover context** - Run `lean-spec stats` or `lean-spec board` to see current state
2
- 2. **Search existing specs** - Use `lean-spec search` or `lean-spec list` to find relevant work
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 (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. **Document** - Report progress and document changes into the spec
9
-
10
- **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
11
-
12
- **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 specs to `archived/` directory.
@@ -1,10 +0,0 @@
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` (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. **Document** - Report progress and document changes into the spec
7
-
8
- **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
9
-
10
- **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 specs to `archived/` directory.
@@ -1,43 +0,0 @@
1
- # AI Agent Instructions
2
-
3
- ## Project: {{{project_name}}}
4
-
5
- {{{description}}}
6
-
7
- ## Core Rules
8
-
9
- {{{coreRules}}}
10
- {{#if whenToUseEarly}}
11
-
12
- ## When to Use Specs
13
-
14
- {{{whenToUse}}}
15
- {{/if}}
16
-
17
- ## Discovery Commands
18
-
19
- {{{discoveryCommands}}}
20
- {{#if essentialCommands}}
21
-
22
- {{{essentialCommands}}}
23
- {{/if}}
24
-
25
- ## Spec Frontmatter
26
-
27
- {{{frontmatter}}}
28
- {{#each additionalSections}}
29
-
30
- {{{this}}}
31
- {{/each}}
32
-
33
- ## Workflow
34
-
35
- {{{workflow}}}
36
-
37
- ## Quality Standards
38
-
39
- {{{qualityStandards}}}
40
-
41
- ---
42
-
43
- {{{closingNote}}}
@@ -1,25 +0,0 @@
1
- # Enterprise Template
2
-
3
- Governance-ready setup with compliance, security reviews, and approval workflows.
4
-
5
- ## What's Included
6
-
7
- - **AGENTS.md** - AI agent instructions with security standards
8
- - Spec structure with approvals and compliance sections
9
- - Enterprise-grade defaults
10
-
11
- ## When to Use
12
-
13
- - Regulated industries (finance, healthcare, etc.)
14
- - Large organizations with compliance requirements
15
- - Projects requiring security reviews and sign-offs
16
-
17
- ## Philosophy
18
-
19
- Balance governance with agility. Required checks without bureaucracy. Lean principles still apply - just with guardrails.
20
-
21
- ## Next Steps
22
-
23
- 1. Customize AGENTS.md with your security requirements
24
- 2. Update approval workflows for your org
25
- 3. Create first spec: `lean-spec create my-feature`
@@ -1,16 +0,0 @@
1
- {
2
- "description": "Enterprise-grade development with security and compliance requirements.",
3
- "coreRules": ["core-rules-enterprise-additions.md", "core-rules-shared.md"],
4
- "whenToUseEarly": false,
5
- "discoveryCommands": ["discovery-commands-shared.md", "discovery-commands-enterprise-additions.md"],
6
- "essentialCommands": ["essential-commands-shared.md", "essential-commands-enterprise-additions.md"],
7
- "frontmatter": "frontmatter-enterprise.md",
8
- "workflow": ["workflow-enterprise.md", "status-update-triggers.md"],
9
- "qualityStandards": ["quality-standards-enterprise-additions.md", "quality-standards-shared.md"],
10
- "closingNote": "**Remember**: Enterprise doesn't mean heavy. Keep specs lean while meeting governance needs.",
11
- "additionalSections": [
12
- "enterprise-compliance.md",
13
- "enterprise-when-required.md",
14
- "enterprise-approval.md"
15
- ]
16
- }
@@ -1,198 +0,0 @@
1
- # AI Agent Instructions
2
-
3
- ## Project: {project_name}
4
-
5
- Enterprise-grade development with security and compliance requirements.
6
-
7
- ## Core Rules
8
-
9
- 1. **Security first** - Follow security standards, no shortcuts
10
- 2. **Read specs/** - Check for compliance requirements
11
- 3. **Follow LeanSpec** - Lean doesn't mean skipping governance
12
- 4. **Document decisions** - Especially security and compliance choices
13
- 5. **Never use nested code blocks** - Markdown doesn't support code blocks within code blocks. Use indentation or describe the structure instead
14
-
15
- ## Discovery Commands
16
-
17
- Before starting work, understand project context:
18
-
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:**
26
- - `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=security`)
27
- - `lean-spec deps <spec>` - Check dependencies before starting work
28
- - `lean-spec gantt` - View project timeline and milestones
29
-
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.
76
-
77
- ## Spec Frontmatter
78
-
79
- When creating or updating specs, include YAML frontmatter with all relevant fields:
80
-
81
- ```yaml
82
- ---
83
- status: draft|planned|in-progress|complete|blocked|cancelled
84
- created: YYYY-MM-DD
85
- tags: [security, api, compliance] # for discovery
86
- priority: low|medium|high|critical
87
- assignee: username
88
- reviewer: reviewer-username # required for review
89
- issue: JIRA-123 # link to issue tracker
90
- epic: EPIC-456 # link to epic
91
- compliance: [SOC2, GDPR, HIPAA] # applicable standards
92
- depends_on:
93
- - path/to/other/spec
94
- ---
95
- ```
96
-
97
- **Required fields:**
98
- - `status`, `created` - basic tracking
99
- - `tags`, `priority` - planning and discovery
100
- - `assignee`, `reviewer` - accountability
101
- - `compliance` - regulatory requirements (if applicable)
102
-
103
- **Integration fields:**
104
- - `issue`, `epic` - link to external systems
105
- - `depends_on` - explicit dependencies
106
-
107
- **Update with:**
108
- ```bash
109
- lean-spec update <spec> --status in-progress --assignee yourname
110
- # or edit frontmatter directly
111
- ```
112
-
113
- ## Security & Compliance in Frontmatter
114
-
115
- Tag specs with relevant compliance standards:
116
- ```yaml
117
- tags: [security, api, pii]
118
- compliance: [SOC2, GDPR]
119
- ```
120
-
121
- This helps with:
122
- - Compliance audits and reporting
123
- - Security review prioritization
124
- - Regulatory requirement tracking
125
-
126
- ## When Specs Are Required
127
-
128
- Required for:
129
- - Features touching PII or sensitive data
130
- - Changes to authentication/authorization
131
- - New external integrations
132
- - Breaking changes to APIs
133
- - Infrastructure changes
134
-
135
- Optional for:
136
- - Internal refactors
137
- - Bug fixes (unless security-related)
138
- - Minor UI changes
139
-
140
- ## Approval Workflow
141
-
142
- 1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, `lean-spec deps`
143
- 2. **Create spec** - Include all required frontmatter fields
144
- 3. **Technical review** - Assign reviewer in frontmatter
145
- 4. **Security team review** - For security/compliance-tagged specs
146
- 5. **Stakeholder sign-off** - Update status to `planned`
147
- 6. **Implementation** - Update status to `in-progress`, keep spec in sync
148
- 7. **Final review** - Before deployment
149
- 8. **Complete** - Mark `complete` after successful deployment
150
-
151
- **Note**: Archive specs only when they're no longer actively referenced (weeks/months later), not immediately after completion.
152
-
153
- ## Workflow
154
-
155
- 1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, or `lean-spec gantt`
156
- 2. **Search existing specs** - Use `lean-spec search` or `lean-spec list --tag=<relevant>`
157
- 3. **Check dependencies** - Run `lean-spec deps <spec>` to understand dependencies
158
- 4. **Create or update spec** - Add complete frontmatter with compliance tags (status: `planned`)
159
- 5. **Get reviews** - Assign reviewer, tag for security review if needed
160
- 6. **Start implementation** - Mark `in-progress` BEFORE implementing what the spec describes
161
- 7. **Implement changes** - Keep spec in sync, update status appropriately
162
- 8. **Complete implementation** - Mark `complete` AFTER implementing what the spec describes
163
- 9. **Document** - Report progress and document changes into the spec
164
-
165
- **Remember**: Status tracks implementation work, not spec document creation. Creating a spec = planning (stays `planned` until implementation starts).
166
-
167
- **Note on Archiving**: Archive specs when they're no longer actively referenced (weeks/months after completion), not immediately. Used for historical specs, not recent work. Use `lean-spec archive <spec>` to move old specs to `archived/` directory.
168
- **CRITICAL - What "Work" Means:**
169
- - ❌ **NOT**: Creating/writing the spec document itself
170
- - ✅ **YES**: Implementing what the spec describes (code, docs, features, etc.)
171
- - **Example**: Creating a spec for "API redesign" ≠ work complete
172
- - Work = Actually redesigning the API as described in the spec
173
- - Status `planned` until someone starts the redesign
174
- - Status `in-progress` while redesigning
175
- - Status `complete` after redesign is done
176
-
177
- **Status Update Triggers:**
178
- - ✅ **Before starting implementation** → `lean-spec update <spec> --status in-progress`
179
- - ✅ **After completing implementation** → `lean-spec update <spec> --status complete`
180
- - ✅ **If blocked or paused** → Update status and document why in spec
181
- - ❌ **NEVER mark spec complete just because you finished writing it**
182
-
183
- ## Quality Standards
184
-
185
- - Security requirements verified
186
- - Tests include security scenarios
187
- - Documentation complete
188
- - Compliance checklist completed
189
- - Code is clear and maintainable
190
- - Specs stay in sync with implementation
191
- - **Status tracking is mandatory:**
192
- - Mark spec as `in-progress` BEFORE starting work
193
- - Mark spec as `complete` IMMEDIATELY after finishing
194
- - Never leave specs with stale status
195
-
196
- ---
197
-
198
- **Remember**: Enterprise doesn't mean heavy. Keep specs lean while meeting governance needs.