specpro-cli 0.1.0__py3-none-any.whl

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 (76) hide show
  1. specpro_cli/__init__.py +16 -0
  2. specpro_cli/assets/commands/specpro.analyze.md +1102 -0
  3. specpro_cli/assets/commands/specpro.checklist.md +335 -0
  4. specpro_cli/assets/commands/specpro.clarify.md +581 -0
  5. specpro_cli/assets/commands/specpro.constitution.md +488 -0
  6. specpro_cli/assets/commands/specpro.feature.md +115 -0
  7. specpro_cli/assets/commands/specpro.implement.md +1881 -0
  8. specpro_cli/assets/commands/specpro.manual-test.md +206 -0
  9. specpro_cli/assets/commands/specpro.plan.md +3284 -0
  10. specpro_cli/assets/commands/specpro.qc.md +1489 -0
  11. specpro_cli/assets/commands/specpro.scenarios.md +154 -0
  12. specpro_cli/assets/commands/specpro.specify.md +1449 -0
  13. specpro_cli/assets/commands/specpro.status.md +863 -0
  14. specpro_cli/assets/commands/specpro.tasks.md +1207 -0
  15. specpro_cli/assets/commands/specpro.test-implement.md +462 -0
  16. specpro_cli/assets/commands/specpro.test-plan.md +383 -0
  17. specpro_cli/assets/commands/specpro.user-manual.md +178 -0
  18. specpro_cli/assets/scripts/bash/check-anti-coupling.sh +293 -0
  19. specpro_cli/assets/scripts/bash/check-prerequisites.sh +176 -0
  20. specpro_cli/assets/scripts/bash/common.sh +88 -0
  21. specpro_cli/assets/scripts/bash/create-new-feature.sh +336 -0
  22. specpro_cli/assets/scripts/bash/qc-auto-fix.sh +121 -0
  23. specpro_cli/assets/scripts/bash/setup-plan.sh +60 -0
  24. specpro_cli/assets/scripts/bash/verify-cumulative-records.sh +203 -0
  25. specpro_cli/assets/scripts/bash/verify-deliverables-tracked.sh +147 -0
  26. specpro_cli/assets/scripts/bash/verify-deployment.sh +239 -0
  27. specpro_cli/assets/scripts/bash/verify-frontmatter-yaml.sh +63 -0
  28. specpro_cli/assets/scripts/bash/verify-ledger.sh +376 -0
  29. specpro_cli/assets/scripts/bash/verify-shapes.sh +1082 -0
  30. specpro_cli/assets/scripts/git-hooks/pre-commit +243 -0
  31. specpro_cli/assets/scripts/install-git-hooks.sh +67 -0
  32. specpro_cli/assets/scripts/powershell/check-anti-coupling.ps1 +249 -0
  33. specpro_cli/assets/scripts/powershell/check-prerequisites.ps1 +148 -0
  34. specpro_cli/assets/scripts/powershell/common.ps1 +95 -0
  35. specpro_cli/assets/scripts/powershell/create-new-feature.ps1 +229 -0
  36. specpro_cli/assets/scripts/powershell/qc-auto-fix.ps1 +110 -0
  37. specpro_cli/assets/scripts/powershell/setup-plan.ps1 +61 -0
  38. specpro_cli/assets/scripts/powershell/verify-cumulative-records.ps1 +133 -0
  39. specpro_cli/assets/scripts/powershell/verify-deliverables-tracked.ps1 +112 -0
  40. specpro_cli/assets/scripts/powershell/verify-deployment.ps1 +278 -0
  41. specpro_cli/assets/scripts/powershell/verify-frontmatter-yaml.ps1 +56 -0
  42. specpro_cli/assets/scripts/powershell/verify-ledger.ps1 +383 -0
  43. specpro_cli/assets/scripts/powershell/verify-shapes.ps1 +978 -0
  44. specpro_cli/assets/templates/agent-context-template.md +49 -0
  45. specpro_cli/assets/templates/assumptions-template.md +248 -0
  46. specpro_cli/assets/templates/checklist-template.md +40 -0
  47. specpro_cli/assets/templates/clarifications-template.md +155 -0
  48. specpro_cli/assets/templates/constitution-template.md +50 -0
  49. specpro_cli/assets/templates/feature-spec-template.md +66 -0
  50. specpro_cli/assets/templates/plan-overview-template.md +150 -0
  51. specpro_cli/assets/templates/plan-template.md +387 -0
  52. specpro_cli/assets/templates/protocol-golden-bytes-guide.md +195 -0
  53. specpro_cli/assets/templates/requirements-template.md +356 -0
  54. specpro_cli/assets/templates/spec-template.md +267 -0
  55. specpro_cli/assets/templates/tasks-template.md +252 -0
  56. specpro_cli/assets/templates/test-tasks-template.md +174 -0
  57. specpro_cli/cli/__init__.py +5 -0
  58. specpro_cli/cli/cmd_init.py +416 -0
  59. specpro_cli/cli/cmd_remove.py +122 -0
  60. specpro_cli/cli/entry.py +181 -0
  61. specpro_cli/integrations/__init__.py +36 -0
  62. specpro_cli/integrations/base.py +601 -0
  63. specpro_cli/integrations/claude/__init__.py +101 -0
  64. specpro_cli/integrations/copilot/__init__.py +153 -0
  65. specpro_cli/integrations/cursor_agent/__init__.py +51 -0
  66. specpro_cli/integrations/gemini/__init__.py +44 -0
  67. specpro_cli/integrations/opencode/__init__.py +48 -0
  68. specpro_cli/integrations/qodercli/__init__.py +54 -0
  69. specpro_cli/integrations/registry.py +88 -0
  70. specpro_cli/packaged/__init__.py +5 -0
  71. specpro_cli/packaged/sync.py +106 -0
  72. specpro_cli-0.1.0.dist-info/METADATA +117 -0
  73. specpro_cli-0.1.0.dist-info/RECORD +76 -0
  74. specpro_cli-0.1.0.dist-info/WHEEL +4 -0
  75. specpro_cli-0.1.0.dist-info/entry_points.txt +2 -0
  76. specpro_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,49 @@
1
+ # Agent Context Template
2
+
3
+ SpecPro template for AI-agent context files (`CLAUDE.md` for Claude Code; `AGENTS.md` / `.cursorrules` / equivalent for other terminals).
4
+
5
+ **Used by**: `/specpro-plan` Step 4.4 (Agent context check)
6
+
7
+ - File missing or empty → generate from the template below
8
+ - File exists → check equivalence against this template; equivalent → leave untouched; entries missing/contradictory → add/fix ONLY those entries
9
+
10
+ **Rendering rules**:
11
+ - Structural anchors (headings, command names, file paths) stay in English as written
12
+ - Prose rendered in the project's Artifact Language
13
+ - The ONLY project-specific content is the Project Overview sentence — fill the two placeholders; everything else is generic specpro guidance
14
+
15
+ ---
16
+
17
+ ## Template
18
+
19
+ ```markdown
20
+ # Project Guide
21
+
22
+ ## Project Overview
23
+ <Project> is a <one-line application domain> application built with SDD (Specification-Driven Development).
24
+
25
+ ## Project Navigation
26
+ [docs/implement/PROJECT_NAVIGATION.md](docs/implement/PROJECT_NAVIGATION.md)
27
+ <!-- may not exist: this file is created by /specpro-implement (up-front or with the first
28
+ technical document in docs/implement/). Omit this section when absent. -->
29
+
30
+ ## Coding Iron Rules ⚠️
31
+ - **Never code directly on user instruction** — e.g. when the user says "add feature X to module Y", do NOT modify code directly.
32
+ - All coding work MUST happen inside the specpro command context (`/specpro-constitution` → `/specpro-specify` → `/specpro-plan` → `/specpro-tasks` → `/specpro-implement`, ...).
33
+ - Test planning & execution: `/specpro-test-plan` → `/specpro-test-implement`.
34
+ - Manual acceptance testing: `/specpro-manual-test` drives `specs/manual-test-tasks.md`; after all pass, `specs/acceptance.md` is generated at the acceptance gate.
35
+ - End-user manual: `/specpro-user-manual` generates `docs/user_manual/user-guide.md` from implemented features only.
36
+
37
+ ## Working Method
38
+ - ⚠️ **Where a finding goes — one pointer, no copy.** The criterion for *which ledger section a finding belongs to* has **one authority**: `commands/specpro.analyze.md` → its **Routing** table (together with that step's pre-exclusion and shape gate). **Never restate its branches**, here or in any other artifact: two copies of one criterion diverge silently, and a reader who follows the stale copy files the finding where its consumer never looks. `specs/contracts/ledger.md` and the specification's routing requirement **point at** that table rather than repeating it — follow the same shape. ⚠️ **This pointer deliberately carries no branch of its own**: a pointer that helpfully lists the branches *has become* a copy of the thing it points at. The pointer is exactly this: *"which section? → that table."*
39
+ - AI development starts from invoking specpro commands; the files to read (spec.md, plan.md, tasks.md, test-tasks.md, ...) are indicated step by step by specpro commands.
40
+ - This file keeps only required-reading pointers and NEVER repeats technical details. Tech stack, architecture, and test standards live in specs/ (constitution.md, plan.md).
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Content Discipline ⚠️
46
+
47
+ - The ONLY project-specific line is the Project Overview sentence (application scope + "built with SDD"). **NO module lists, NO directory trees, NO tech-stack detail** — they rot into misinformation, and AI agents can explore the repo / read plan.md themselves. Technology architecture single source: plan.md.
48
+ - The Project Navigation section links `docs/implement/PROJECT_NAVIGATION.md`, which **may not exist** (created by `/specpro-implement` up-front or with the first technical document). Include the section only when the file is present.
49
+ - **NEVER append machine-maintained sections** — "Active Technologies" / "Recent Changes" style incremental logs are forbidden. The agent context file stays a thin, human-owned pointer.
@@ -0,0 +1,248 @@
1
+ # Critical Assumptions
2
+
3
+ **Feature**: [FEATURE_NAME]
4
+ **Created**: [DATE]
5
+ **Status**: [In Progress | Resolved]
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ These are **CRITICAL assumptions** that MUST be clarified **BEFORE** the specification can be generated.
12
+
13
+ Unlike clarifications (which improve spec quality), these assumptions affect the **fundamental architecture and direction** of the feature. The spec generation **CANNOT proceed** until these are resolved.
14
+
15
+ **Key Characteristics**:
16
+ - 🔑 **Critical**: Without these answers, we cannot generate a reasonable specification
17
+ - 🚧 **Blocking**: Spec generation is blocked until all assumptions are resolved
18
+ - 🌳 **Dynamic**: New assumptions may emerge based on previous answers
19
+ - 📊 **Decision Path**: Answers guide the architectural direction
20
+
21
+ ---
22
+
23
+ ## Format
24
+
25
+ Each assumption entry follows this format:
26
+
27
+ ```markdown
28
+ ### [ID] - [Critical Decision]
29
+
30
+ **Status**: [ ] Pending | [x] Resolved
31
+
32
+ **Context**: [What led to this question - previous decisions or user input]
33
+
34
+ **Impact**: [What this affects - architecture, scope, user experience, platform]
35
+
36
+ **Question**:
37
+ [Clear, specific question that must be answered to continue spec generation]
38
+
39
+ **Options** (if applicable):
40
+ | Option | Description | Implications |
41
+ |--------|-------------|--------------|
42
+ | A | [First option] | [What this means for the feature] |
43
+ | B | [Second option] | [What this means for the feature] |
44
+ | C | [Third option] | [What this means for the feature] |
45
+
46
+ **Recommended**: [Option X] - [Brief reasoning based on context]
47
+
48
+ **Answer**:
49
+ [User's answer that resolves the assumption]
50
+
51
+ **Resolution**:
52
+ - How this answer guides spec generation
53
+ - Related architectural decisions
54
+ - Follow-up assumptions that may emerge
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Quality Gate
60
+
61
+ **CRITICAL**: Spec generation **CANNOT proceed** until ALL assumptions have status `[x]` (Resolved).
62
+
63
+ ---
64
+
65
+ ## Decision Path
66
+
67
+ *This section will be dynamically populated as assumptions are resolved*
68
+
69
+ ### Decision History
70
+
71
+ *Resolved assumptions will appear here, showing the complete decision path*
72
+
73
+ ---
74
+
75
+ ## Current Assumptions
76
+
77
+ *Pending assumptions will appear here*
78
+
79
+ ---
80
+
81
+ ## Skipped Decisions (Optional)
82
+
83
+ *Assumptions that were considered but deemed not applicable based on previous answers*
84
+
85
+ Format:
86
+ ```markdown
87
+ ### ~~[ID] - [Skipped Decision]~~
88
+
89
+ **Status**: [⊘] Skipped (not applicable)
90
+
91
+ **Reason**: [Explanation of why this is not applicable based on previous answers]
92
+
93
+ **Dependency**: [Which assumption made this irrelevant]
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Summary
99
+
100
+ **Total Assumptions**: N
101
+ - Resolved: X/N
102
+ - Pending: Y/N
103
+ - Skipped: Z
104
+
105
+ **Completion Criteria**:
106
+ - ALL current assumptions MUST be resolved (status `[x]`)
107
+ - No pending assumptions remain
108
+ - Ready for spec generation ✓
109
+
110
+ ---
111
+
112
+ ## Examples
113
+
114
+ ### Example 1: Initial Critical Decision
115
+
116
+ ### A001 - Application Type
117
+
118
+ **Status**: [x] Resolved
119
+
120
+ **Context**: User input: "Build me a notepad app"
121
+
122
+ **Impact**: Architecture, Data Model, Deployment, Platform
123
+
124
+ **Question**: Should this be a local application or web-based application?
125
+
126
+ **Options**:
127
+ | Option | Description | Implications |
128
+ |--------|-------------|--------------|
129
+ | A | Local application | Offline-first, local storage, desktop/mobile apps |
130
+ | B | Web-based | Online-first, cloud sync, backend API required |
131
+
132
+ **Recommended**: Option A - Local application aligns with typical "notepad" use cases for offline note-taking
133
+
134
+ **Answer**: Option A (Local application)
135
+
136
+ **Resolution**:
137
+ - Spec will focus on offline-first architecture
138
+ - Local data storage required
139
+ - Desktop and/or mobile platforms
140
+ - No backend/infrastructure needed
141
+
142
+ ---
143
+
144
+ ### Example 2: Emergent Assumption (Depends on A001)
145
+
146
+ ### A002 - Target Platform
147
+
148
+ **Status**: [x] Resolved
149
+
150
+ **Context**: Previous decision: A001=Local application
151
+
152
+ **Impact**: Framework choice, UI architecture, deployment strategy
153
+
154
+ **Question**: Which platform(s) should be supported?
155
+
156
+ **Options**:
157
+ | Option | Description | Implications |
158
+ |--------|-------------|--------------|
159
+ | A | Desktop only | Windows, macOS, Linux native apps |
160
+ | B | Mobile only | iOS, Android native apps |
161
+ | C | Cross-platform | Shared codebase with platform-specific UIs |
162
+
163
+ **Recommended**: Option C - Cross-platform maximizes reach with a shared-codebase toolkit
164
+
165
+ **Answer**: Option C (Cross-platform)
166
+
167
+ **Resolution**:
168
+ - Use a cross-platform shared-logic framework
169
+ - A cross-platform UI toolkit on top of it
170
+ - Maximum code reuse across platforms
171
+ - Native performance on each platform
172
+
173
+ ---
174
+
175
+ ### Example 3: Further Granularity
176
+
177
+ ### A003 - Local Storage Format
178
+
179
+ **Status**: [x] Resolved
180
+
181
+ **Context**: Previous decisions: A001=Local, A002=Cross-platform
182
+
183
+ **Impact**: Data schema, query capabilities, migration strategy
184
+
185
+ **Question**: What local storage format should be used?
186
+
187
+ **Options**:
188
+ | Option | Description | Implications |
189
+ |--------|-------------|--------------|
190
+ | A | SQLite | Structured queries, relational data, type-safe |
191
+ | B | File-based (JSON/Text) | Simple format, human-readable, limited querying |
192
+ | C | Platform-specific (Core Data/Room) | Native performance, less code sharing |
193
+
194
+ **Recommended**: Option A - SQLite with a type-safe query layer enables cross-platform schema sharing
195
+
196
+ **Answer**: Option A (SQLite)
197
+
198
+ **Resolution**:
199
+ - A type-safe query layer over SQLite
200
+ - Shared schema across all platforms
201
+ - Migration strategy needed for schema changes
202
+
203
+ ---
204
+
205
+ ### Example 4: Skipped Decision
206
+
207
+ ### ~~A004 - Backend Technology~~
208
+
209
+ **Status**: [⊘] Skipped (not applicable)
210
+
211
+ **Reason**: Backend technology is only needed for web-based applications
212
+
213
+ **Dependency**: A001=Local application (not web-based)
214
+
215
+ **Original Options** (if it were applicable):
216
+ | Option | Description | Implications |
217
+ |--------|-------------|--------------|
218
+ | A | REST API | Standard HTTP API, stateless |
219
+ | B | GraphQL | Flexible queries, single endpoint |
220
+ | C | gRPC | High-performance, protocol buffers |
221
+
222
+ ---
223
+
224
+ ## Final Decision Path Example
225
+
226
+ **Feature**: Notepad
227
+ **Status**: ✅ All Resolved (3 assumptions)
228
+
229
+ ### Decision Path:
230
+ 1. ✅ A001: Local application
231
+ 2. ✅ A002: Cross-platform
232
+ 3. ✅ A003: SQLite storage
233
+
234
+ ### Architectural Direction:
235
+ - **Architecture**: Offline-first, local SQLite database
236
+ - **Platform**: Cross-platform shared codebase (Desktop + Mobile)
237
+ - **Storage**: Type-safe query layer over SQLite, shared schema
238
+ - **Key FRs**: Local storage, cross-platform UI, data export
239
+
240
+ ### Skipped Decisions:
241
+ - ~~A004~~: Backend technology (not needed - local app)
242
+ - ~~A005~~: Real-time sync (not needed - local app)
243
+ - ~~A006~~: Web framework (not needed - not web)
244
+
245
+ ---
246
+
247
+ **Last Updated**: [TIMESTAMP]
248
+ **Ready for Spec Generation**: [YES | NO]
@@ -0,0 +1,40 @@
1
+ # [CHECKLIST TYPE] Checklist: [FEATURE NAME]
2
+
3
+ **Purpose**: [Brief description of what this checklist covers]
4
+ **Created**: [DATE]
5
+ **Feature**: [Link to spec.md or relevant documentation]
6
+
7
+ **Note**: This checklist is generated by the `/specpro-checklist` command based on feature context and requirements.
8
+
9
+ <!--
10
+ ============================================================================
11
+ IMPORTANT: The checklist items below are SAMPLE ITEMS for illustration only.
12
+
13
+ The /specpro-checklist command MUST replace these with actual items based on:
14
+ - User's specific checklist request
15
+ - Feature requirements from spec.md
16
+ - Technical context from plan.md
17
+ - Implementation details from tasks.md
18
+
19
+ DO NOT keep these sample items in the generated checklist file.
20
+ ============================================================================
21
+ -->
22
+
23
+ ## [Category 1]
24
+
25
+ - [ ] CHK001 First checklist item with clear action
26
+ - [ ] CHK002 Second checklist item
27
+ - [ ] CHK003 Third checklist item
28
+
29
+ ## [Category 2]
30
+
31
+ - [ ] CHK004 Another category item
32
+ - [ ] CHK005 Item with specific criteria
33
+ - [ ] CHK006 Final item in this category
34
+
35
+ ## Notes
36
+
37
+ - Check items off as completed: `[x]`
38
+ - Add comments or findings inline
39
+ - Link to relevant resources or documentation
40
+ - Items are numbered sequentially for easy reference
@@ -0,0 +1,155 @@
1
+ # Clarifications
2
+
3
+ **Feature**: [FEATURE_NAME]
4
+ **Created**: [DATE]
5
+ **Status**: [In Progress | Completed]
6
+ **Spec Version**: [VERSION]
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ This file tracks all questions identified during specification that require clarification, inference, or user confirmation. It ensures quality gates before proceeding to planning and implementation.
13
+
14
+ **Purpose**:
15
+ - **Quality Gate**: Plan stage cannot proceed until all [Must Clarify] items are resolved
16
+ - **Traceability**: Each question links to specific sections in spec.md
17
+ - **Automation**: AI can auto-infer [Can Infer] and some [Suggested Clarify] items
18
+
19
+ ---
20
+
21
+ ## Clarification Categories
22
+
23
+ - **[Must Clarify]**: Critical questions that MUST be answered by the user before implementation. Plan stage is BLOCKED until these are resolved.
24
+ - **[Suggested Clarify]**: Important questions with reasonable defaults. User can choose to answer manually OR request AI auto-inference.
25
+ - **[Can Infer]**: Questions that AI can answer using context, industry standards, or logical inference. AI will auto-resolve these.
26
+
27
+ ---
28
+
29
+ ## Format
30
+
31
+ Each clarification entry follows this format:
32
+
33
+ ```markdown
34
+ ### [Tag] - [ID] - [Question Summary]
35
+
36
+ **Status**: [ ] Unanswered | [x] Answered | [inferred] Auto-inferred
37
+
38
+ **Related Section**: [spec.md section reference, e.g., "FR-xxx", "US2"]
39
+
40
+ **Question**:
41
+ [Clear, specific question about requirements]
42
+
43
+ **Options** (if applicable):
44
+ | Option | Description | Implications |
45
+ |--------|-------------|--------------|
46
+ | A | [First option] | [What this means] |
47
+ | B | [Second option] | [What this means] |
48
+ | Auto | Let AI infer from context | [What AI will do] |
49
+
50
+ **Answer** (when answered or inferred):
51
+ [Concise answer that resolves the question]
52
+
53
+ **Resolution** (when answered or inferred):
54
+ - Updated spec.md section: [section name]
55
+ - New/updated FR: [FR-XXX] (if applicable)
56
+ - Details: [how the answer was integrated]
57
+
58
+ ---
59
+
60
+ ## Clarification Items
61
+
62
+ ### [Must Clarify] Items
63
+
64
+ *Status: All items in this category must be resolved before Plan stage*
65
+
66
+ - **[Must Clarify] - Q001** - [Example: Target deployment network bandwidth]
67
+ **Status**: [ ]
68
+ **Related Section**: FR-xxx, Performance Constraints
69
+ **Question**: What is the expected network bandwidth (Mbps) for typical classroom deployment? This affects performance targets and encoding strategy.
70
+ **Options**:
71
+ | Option | Bandwidth | Implications |
72
+ |--------|-----------|--------------|
73
+ | A | <100 Mbps | Requires aggressive compression, may affect video quality |
74
+ | B | 100-1000 Mbps | Standard classroom network, supports HD video |
75
+ | C | >1 Gbps | High-performance network, supports 4K video |
76
+ **Answer**: (waiting for user input)
77
+
78
+ ---
79
+
80
+ ### [Suggested Clarify] Items
81
+
82
+ *Status: User can choose to answer manually OR request AI auto-inference. Plan stage NOT blocked by these.*
83
+
84
+ - **[Suggested Clarify] - Q002** - [Example: Plugin hot-reload frequency]
85
+ **Status**: [ ]
86
+ **Related Section**: FR-xxx, Plugin Framework
87
+ **Question**: How frequently should plugins be checked for hot-reload (every 5s, 10s, 30s)?
88
+ **Options**:
89
+ | Option | Frequency | Implications |
90
+ |--------|-----------|--------------|
91
+ | A | 5 seconds | Fast detection but higher CPU usage |
92
+ | B | 10 seconds | Balanced approach |
93
+ | C | 30 seconds | Lower CPU usage but slower detection |
94
+ | Auto | Let AI infer based on performance targets | AI will analyze FR-xxx (500ms update latency) to determine appropriate frequency |
95
+ **Answer**: (waiting for user input or auto-inference)
96
+
97
+ ---
98
+
99
+ ### [Can Infer] Items
100
+
101
+ *Status: AI will auto-resolve these using context, industry standards, or logical inference*
102
+
103
+ - **[Can Infer] - Q003** - [Example: Error logging format]
104
+ **Status**: [ ] → will become [inferred]
105
+ **Related Section**: FR-XXX, Error Handling
106
+ **Question**: What format should error logs use?
107
+ **Auto-Inference**: JSON with structured fields (timestamp, level, message, context), following industry-standard logging practices.
108
+ **Resolution**: (when inferred)
109
+ - New FR: System MUST log errors in JSON format with timestamp, level, message, and context fields
110
+ - Details: AI will add this FR to Error Handling section
111
+
112
+ ---
113
+
114
+ ## Quality Gates
115
+
116
+ ### Plan Stage Requirements
117
+
118
+ **CRITICAL**: Plan stage CANNOT proceed if ANY [Must Clarify] item has status `[ ]` (Unanswered).
119
+
120
+ **WARNING**: Plan stage can proceed if [Suggested Clarify] or [Can Infer] items are unresolved, but user will be prompted to resolve them.
121
+
122
+ ### Resolution Workflow
123
+
124
+ 1. **User answers manually**:
125
+ - User runs `/specpro-clarify` (interactive mode)
126
+ - AI presents questions one by one
127
+ - User provides answers
128
+ - AI integrates answers into spec.md
129
+ - Marks items as [x]
130
+
131
+ 2. **User requests auto-inference**:
132
+ - After completing all [Must Clarify] items
133
+ - AI prompts: "All [Must Clarify] items resolved. Process [Suggested Clarify] and [Can Infer] items?"
134
+ - User chooses: "Auto-infer" → AI processes all remaining items
135
+ - AI infers answers and integrates into spec.md
136
+ - Marks items as [inferred]
137
+
138
+ 3. **AI auto-inference** (Plan stage optional):
139
+ - Plan stage can optionally run auto-inference for [Suggested Clarify] and [Can Infer] items
140
+ - User can review and reject auto-inferred results
141
+
142
+ ---
143
+
144
+ ## Progress Tracking
145
+
146
+ **Total Items**: N
147
+ - [Must Clarify]: M (X unresolved, M-X resolved)
148
+ - Suggested-clarify items: S (Y unresolved, S-Y resolved)
149
+ - [Can Infer]: C (Z unresolved, C-Z resolved)
150
+
151
+ **Completion Criteria**:
152
+ - All [Must Clarify] items MUST be resolved (status [x] or [inferred])
153
+ - Plan stage CANNOT proceed if M-X > 0
154
+
155
+ **Last Updated**: [TIMESTAMP]
@@ -0,0 +1,50 @@
1
+ # [PROJECT_NAME] Constitution
2
+ <!-- Example: Spec Constitution, TaskFlow Constitution, etc. -->
3
+
4
+ ## Core Principles
5
+
6
+ ### [PRINCIPLE_1_NAME]
7
+ <!-- Example: I. Library-First -->
8
+ [PRINCIPLE_1_DESCRIPTION]
9
+ <!-- Example: Every feature starts as a standalone library; Libraries must be self-contained, independently testable, documented; Clear purpose required - no organizational-only libraries -->
10
+
11
+ ### [PRINCIPLE_2_NAME]
12
+ <!-- Example: II. CLI Interface -->
13
+ [PRINCIPLE_2_DESCRIPTION]
14
+ <!-- Example: Every library exposes functionality via CLI; Text in/out protocol: stdin/args → stdout, errors → stderr; Support JSON + human-readable formats -->
15
+
16
+ ### [PRINCIPLE_3_NAME]
17
+ <!-- Example: III. Test-First (NON-NEGOTIABLE) -->
18
+ [PRINCIPLE_3_DESCRIPTION]
19
+ <!-- Example: TDD mandatory: Tests written → User approved → Tests fail → Then implement; Red-Green-Refactor cycle strictly enforced -->
20
+
21
+ ### [PRINCIPLE_4_NAME]
22
+ <!-- Example: IV. Integration Testing -->
23
+ [PRINCIPLE_4_DESCRIPTION]
24
+ <!-- Example: Focus areas requiring integration tests: New library contract tests, Contract changes, Inter-service communication, Shared schemas -->
25
+
26
+ ### [PRINCIPLE_5_NAME]
27
+ <!-- Example: V. Observability, VI. Versioning & Breaking Changes, VII. Simplicity -->
28
+ [PRINCIPLE_5_DESCRIPTION]
29
+ <!-- Example: Text I/O ensures debuggability; Structured logging required; Or: MAJOR.MINOR.BUILD format; Or: Start simple, YAGNI principles -->
30
+
31
+ ## [SECTION_2_NAME]
32
+ <!-- Example: Additional Constraints, Security Requirements, Performance Standards, etc. -->
33
+
34
+ [SECTION_2_CONTENT]
35
+ <!-- Example: Technology stack requirements, compliance standards, deployment policies, etc. -->
36
+
37
+ ## [SECTION_3_NAME]
38
+ <!-- Example: Development Workflow, Review Process, Quality Gates, etc. -->
39
+
40
+ [SECTION_3_CONTENT]
41
+ <!-- Example: Code review requirements, testing gates, deployment approval process, etc. -->
42
+
43
+ ## Governance
44
+ <!-- Example: Constitution supersedes all other practices; Amendments require documentation, approval, migration plan -->
45
+
46
+ [GOVERNANCE_RULES]
47
+ <!-- Example: All PRs/reviews must verify compliance; Complexity must be justified; Use [GUIDANCE_FILE] for runtime development guidance -->
48
+
49
+ **Version**: [CONSTITUTION_VERSION] | **Ratified**: [RATIFICATION_DATE] | **Last Amended**: [LAST_AMENDED_DATE]
50
+ <!-- Example: Version: 2.1.1 | Ratified: 2025-06-13 | Last Amended: 2025-07-16 -->
@@ -0,0 +1,66 @@
1
+ # Module Specification: [MODULE NAME]
2
+
3
+ **Feature id**: fNNN-简称
4
+ **Registry row**: `specs/features.md`(创建时由 `/specpro-feature` 写入一行元信息——母规格零写入)
5
+ **Created**: [YYYY-MM-DD]
6
+
7
+ ---
8
+
9
+ ## Feature Inheritance *(mandatory — 填写前先读)*
10
+
11
+ *Purpose · Consumers*: 声明本 feature**从母规格继承**什么。`/specpro-plan`(feature 目录内运行时)读它定位母产物;继承冲突的裁定依据也在这里。
12
+
13
+ feature 是**与母规格并列的第二级规格**(FR-009)——「并列」指需求住址独立,**不指**与母项目脱钩;且 feature 与母规格的 US/FR **零关联**(它是新增的独立功能,不继承、不增补、不修改母需求——FR-014 v0.23)。以下三项以**活引用**继承——每次 feature 作用域内命令执行时读取**当前版**,MUST NOT 复制成快照(快照即第二来源,必然漂移):
14
+
15
+ | 继承项 | 来源(真源,不在本 feature) | 对本 feature 的语义 |
16
+ |--------|------------------------|----------------|
17
+ | **项目宪章** | `specs/constitution.md` | 全部原则与 MUST 条款**同等生效**;本 feature 的宪法约束写在下节,只写**feature 特有**的 |
18
+ | **技术栈基线** | 母 `specs/plan.md` → Technical Context | 默认栈;引入母栈**未覆盖**的选型 MUST 声明为「增量非替代」(FR-014) |
19
+ | **共享基础设施** | 母 `plan.md` 的共享层/目录布局 | feature **消费**,不复制、不改写、不重新声明边界 |
20
+
21
+ **冲突规则**(FR-014):本 feature 的设计与基线约束冲突 ⇒ **报错阻止推进**,不是覆盖、不是例外。**母 plan 更新 ⇒ 本 feature 的 Lifecycle 标 `update`**(同构传播,不跟踪母 spec)。feature 作用域内发现的母侧缺口 ⇒ **登记台账路由**(`[specify]`/`[plan]`),MUST NOT 在 feature 内直接修改母产物。feature 间依赖**声明可、实现耦合不可**。
22
+
23
+ **本 feature 引入的新技术选型**(无则删去本行):
24
+ - [选型]: 增量非替代——母栈未覆盖 [能力],本选型补充之;不替代母栈的任何既有选型
25
+
26
+ ---
27
+
28
+ ## Change Summary *(auto-generated on update)*
29
+
30
+ | 版本 | 日期 | 变更 |
31
+ |------|------|------|
32
+ | 0.1 | [YYYY-MM-DD] | 初始 feature 规格 |
33
+
34
+ ---
35
+
36
+ ## User Scenarios & Testing *(mandatory)*
37
+
38
+ ### US1 - [feature 内首个用户故事] (Priority: P1)
39
+
40
+ **Why this priority**: [一句话]
41
+
42
+ **Independent Test**: [feature 内可独立验收的判据——feature 自己的验收,不依赖其他 feature 的产物]
43
+
44
+ **Acceptance Scenarios**:
45
+
46
+ 1. **Given** [初始状态] **When** [动作] **Then** [可观察结果]
47
+
48
+ ---
49
+
50
+ ## Requirements *(mandatory)*
51
+
52
+ ### Functional Requirements
53
+
54
+ > feature 的 FR 编号是**feature 内独立命名空间**(从 FR-001 起)——feature 与母规格并列(FR-009),跨 feature 引用写「`fNNN-简称` 的 FR-x」,不与母规格的 FR 编号混用。
55
+
56
+ - **FR-001**: [feature 功能需求]
57
+ **Lifecycle**: [specify:create][plan: ][tasks: ]
58
+ System MUST [需求正文]
59
+
60
+ ---
61
+
62
+ ## Constitution Constraints *(if applicable)*
63
+
64
+ feature **特有**的宪法约束写这里(全部继承项见顶部 `## Feature Inheritance`,不在此重复)。
65
+
66
+ - [feature 特有的约束或「无」]