@laxture/vibe-pm 0.1.0
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/LICENSE +190 -0
- package/README.md +120 -0
- package/README.zh-CN.md +119 -0
- package/dist/core/commands.d.ts +17 -0
- package/dist/core/config.d.ts +12 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/logger.d.ts +23 -0
- package/dist/core/plugin.d.ts +2 -0
- package/dist/core/types.d.ts +42 -0
- package/dist/docs/template/_coding_style/general.md +114 -0
- package/dist/docs/template/_coding_style/go.md +158 -0
- package/dist/docs/template/_coding_style/java.md +154 -0
- package/dist/docs/template/_coding_style/python.md +195 -0
- package/dist/docs/template/_coding_style/rust.md +161 -0
- package/dist/docs/template/_coding_style/sql.md +321 -0
- package/dist/docs/template/_coding_style/typescript.md +237 -0
- package/dist/docs/template/agents-template.md +38 -0
- package/dist/docs/template/bug-fix/flow.md +189 -0
- package/dist/docs/template/constitution-template.md +119 -0
- package/dist/docs/template/design-spec/flow.md +194 -0
- package/dist/docs/template/dictionary-template.md +40 -0
- package/dist/docs/template/large-refactor/flow.md +242 -0
- package/dist/docs/template/large-refactor/regulations/migration-checklist.md +28 -0
- package/dist/docs/template/research/flow.md +161 -0
- package/dist/docs/template/side-job/flow.md +147 -0
- package/dist/docs/template/spec-driven-dev/flow.md +420 -0
- package/dist/docs/template/spec-template.md +190 -0
- package/dist/engine/errors.d.ts +28 -0
- package/dist/engine/flow-engine.d.ts +32 -0
- package/dist/engine/index.d.ts +3 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/loader.d.ts +23 -0
- package/dist/i18n/prompts-en-US.d.ts +47 -0
- package/dist/i18n/prompts-zh-CN.d.ts +50 -0
- package/dist/i18n/types.d.ts +51 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4886 -0
- package/dist/integration/dcp.d.ts +7 -0
- package/dist/integration/index.d.ts +1 -0
- package/dist/memory/errors.d.ts +11 -0
- package/dist/memory/index.d.ts +3 -0
- package/dist/memory/memory-system.d.ts +80 -0
- package/dist/memory/types.d.ts +157 -0
- package/dist/template/index.d.ts +3 -0
- package/dist/template/template-manager.d.ts +26 -0
- package/dist/template/types.d.ts +16 -0
- package/dist/token/backends/anthropic.d.ts +5 -0
- package/dist/token/backends/llama.d.ts +7 -0
- package/dist/token/backends/tiktoken.d.ts +7 -0
- package/dist/token/index.d.ts +3 -0
- package/dist/token/model-registry.d.ts +9 -0
- package/dist/token/token-counter.d.ts +17 -0
- package/dist/token/types.d.ts +39 -0
- package/dist/tui/components/collapsible.d.ts +9 -0
- package/dist/tui/components/empty-state.d.ts +7 -0
- package/dist/tui/data/task-status.d.ts +16 -0
- package/dist/tui/data/token-data.d.ts +16 -0
- package/dist/tui/index.d.ts +13 -0
- package/dist/tui/index.js +3293 -0
- package/dist/tui/slots/sidebar-content.d.ts +10 -0
- package/dist/tui/tui-plugin.d.ts +9 -0
- package/dist/tui/types.d.ts +63 -0
- package/package.json +63 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Bug Fix
|
|
2
|
+
|
|
3
|
+
**Template ID**: `bug-fix`
|
|
4
|
+
**Category**: maintenance
|
|
5
|
+
**Description**: Standardized bug fix workflow (root cause analysis → fix → regression → acceptance)
|
|
6
|
+
**Command**: `/pm-bug-fix`
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Applicable Scenarios
|
|
12
|
+
|
|
13
|
+
- Bug fixes in production or development environments
|
|
14
|
+
- Non-trivial fixes requiring root cause analysis
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Input Requirements
|
|
19
|
+
|
|
20
|
+
| Input | Required | Description |
|
|
21
|
+
|--------|------|------|
|
|
22
|
+
| Bug Description | Yes | Symptoms, reproduction steps, impact scope |
|
|
23
|
+
| Related Code/Logs | No | Information to help locate the issue |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Default Deliverables
|
|
28
|
+
|
|
29
|
+
- Root cause analysis report
|
|
30
|
+
- Fix code + regression tests
|
|
31
|
+
- Delivery report
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## State Machine
|
|
36
|
+
|
|
37
|
+
```mermaid
|
|
38
|
+
stateDiagram-v2
|
|
39
|
+
[*] --> S1_UnderstandingBug: Trigger
|
|
40
|
+
S1_UnderstandingBug --> S2_RootCauseAnalysis
|
|
41
|
+
S2_RootCauseAnalysis --> S3_ReviewPlan
|
|
42
|
+
S3_ReviewPlan --> S2_RootCauseAnalysis: Needs revision
|
|
43
|
+
S3_ReviewPlan --> S4_WriteFix: Approved
|
|
44
|
+
S4_WriteFix --> S5_WriteTests
|
|
45
|
+
S5_WriteTests --> S6_RegressionVerification
|
|
46
|
+
S6_RegressionVerification --> S7_SelfCheck
|
|
47
|
+
S7_SelfCheck --> S8_UserAcceptance: Pass
|
|
48
|
+
S7_SelfCheck --> S4_WriteFix: Needs fix
|
|
49
|
+
S8_UserAcceptance --> S9_Merge: Pass
|
|
50
|
+
S8_UserAcceptance --> S4_WriteFix: Needs fix
|
|
51
|
+
S9_Merge --> [*]
|
|
52
|
+
|
|
53
|
+
note right of S3_ReviewPlan: ⚠️ Human-in-loop
|
|
54
|
+
note right of S8_UserAcceptance: ⚠️ Human-in-loop
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Task Steps
|
|
60
|
+
|
|
61
|
+
### S1: Understand the Bug
|
|
62
|
+
|
|
63
|
+
**Goal**: Accurately understand the bug symptoms, reproduction conditions, and impact scope.
|
|
64
|
+
|
|
65
|
+
1. Read the bug description, logs, and screenshots
|
|
66
|
+
2. Confirm reproduction steps
|
|
67
|
+
3. If the description is unclear, use the `question` tool to ask for clarification
|
|
68
|
+
4. Assess impact scope (functionality, data, security)
|
|
69
|
+
|
|
70
|
+
**On completion**: Automatically advance to S2
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### S2: Root Cause Analysis
|
|
75
|
+
|
|
76
|
+
**Goal**: Identify the root cause and propose a fix plan.
|
|
77
|
+
|
|
78
|
+
1. Read relevant source code
|
|
79
|
+
2. Trace the call chain
|
|
80
|
+
3. Analyze and identify the root cause
|
|
81
|
+
4. Analyze test case coverage:
|
|
82
|
+
- Search for existing test cases related to the affected code (`{affected_module}_test.go`)
|
|
83
|
+
- Determine whether existing tests cover this abnormal path:
|
|
84
|
+
- If **covered**, explain why the existing tests did not catch this bug (assertions not precise enough? mock data too ideal? tests skipped?)
|
|
85
|
+
- If **not covered**, describe which test scenario is missing
|
|
86
|
+
- Determine whether new or modified test cases are needed after the fix
|
|
87
|
+
5. Propose a fix plan: follow the project constitution's "Code Quality First" principle — strive for elegance, directness, and readable, maintainable code
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
## Root Cause Analysis
|
|
91
|
+
|
|
92
|
+
- **Symptom**: {what the user observed}
|
|
93
|
+
- **Trigger Condition**: {under what conditions it triggers}
|
|
94
|
+
- **Root Cause**: {code-level reason for the failure, citing specific file and line numbers}
|
|
95
|
+
- **Impact Scope**: {which features / which users are affected}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**On completion**: Automatically advance to S3
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### S3: [Human-in-loop] Review Fix Plan ⚠️
|
|
105
|
+
|
|
106
|
+
**Goal**: User reviews the fix plan.
|
|
107
|
+
|
|
108
|
+
1. Present: root cause, fix plan, alternatives, risk assessment
|
|
109
|
+
2. Use the `confirm` tool to wait for confirmation
|
|
110
|
+
|
|
111
|
+
**On completion**: Approved → S4, Needs revision → S2
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### S4: Write the Fix
|
|
116
|
+
|
|
117
|
+
**Goal**: Write the fix according to the approved plan.
|
|
118
|
+
**Referenced Regulation**: coding_style.md
|
|
119
|
+
|
|
120
|
+
1. Minimal fix — only change the root cause code
|
|
121
|
+
2. Do not introduce unrelated refactoring
|
|
122
|
+
3. Run project build / type check to verify
|
|
123
|
+
|
|
124
|
+
**On completion**: Automatically advance to S5
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### S5: Write Tests
|
|
129
|
+
|
|
130
|
+
**Goal**: Write regression tests to prevent recurrence.
|
|
131
|
+
**Referenced Regulation**: coding_style.md
|
|
132
|
+
|
|
133
|
+
1. Cover the reproduction scenario
|
|
134
|
+
2. Cover edge cases
|
|
135
|
+
3. Cover related functionality (prevent side effects)
|
|
136
|
+
|
|
137
|
+
**On completion**: Automatically advance to S6
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### S6: Regression Verification
|
|
142
|
+
|
|
143
|
+
**Goal**: Confirm the fix is effective and there is no regression.
|
|
144
|
+
|
|
145
|
+
1. Run all tests
|
|
146
|
+
2. Verify the original bug scenario no longer reproduces
|
|
147
|
+
3. Check that related functionality works correctly
|
|
148
|
+
|
|
149
|
+
**On completion**: Automatically advance to S7
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### S7: Self-Check
|
|
154
|
+
|
|
155
|
+
**Goal**: Thoroughly self-review fix quality.
|
|
156
|
+
**Referenced Regulation**: checklist.md
|
|
157
|
+
|
|
158
|
+
1. Does the fix comply with the code quality first principle?
|
|
159
|
+
2. Do all tests pass?
|
|
160
|
+
3. Have any new issues been introduced?
|
|
161
|
+
4. Does documentation need updating?
|
|
162
|
+
|
|
163
|
+
**On completion**: Pass → S8, Needs fix → S4
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### S8: [Human-in-loop] User Acceptance ⚠️
|
|
168
|
+
|
|
169
|
+
**Goal**: User confirms the fix result.
|
|
170
|
+
|
|
171
|
+
1. Present the fix report (root cause, changes, test results)
|
|
172
|
+
2. Use the `confirm` tool to wait for confirmation
|
|
173
|
+
|
|
174
|
+
**On completion**: Approved → S9, Needs fix → S4
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### S9: Merge
|
|
179
|
+
|
|
180
|
+
**Goal**: Final verification, wrap-up documentation, ask whether to commit.
|
|
181
|
+
|
|
182
|
+
1. Run final build check and tests
|
|
183
|
+
2. Update Spec and Plan documents (if needed)
|
|
184
|
+
3. Use the `question` tool to ask the user: "Execute `git commit`?"
|
|
185
|
+
- If the user selects "Yes": run `git add -A && git commit`, using the fix summary as the commit message
|
|
186
|
+
- If the user selects "No": skip commit
|
|
187
|
+
- ⚠️ User selection does not affect task completion
|
|
188
|
+
|
|
189
|
+
**On completion**: Task ends
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# {PROJECT_NAME} Project Constitution
|
|
2
|
+
|
|
3
|
+
**Version**: 1.0.0 | **Ratified**: {DATE} | **Last Amended**: {DATE}
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Core Principles
|
|
8
|
+
|
|
9
|
+
### I. Flow + Spec + Test-Driven Development
|
|
10
|
+
|
|
11
|
+
All three are indispensable:
|
|
12
|
+
|
|
13
|
+
- **Flow** — Ensures team alignment. Structured step transitions eliminate ambiguity, giving every participant a shared understanding of "what to do and where we are."
|
|
14
|
+
- **Spec** — Captures technical decisions. Solidifies architecture choices, interface contracts, and boundary conditions into documents, preventing information loss from word-of-mouth.
|
|
15
|
+
- **Test** — Guarantees delivery quality. Defines "done" in verifiable terms, so regressions are caught immediately.
|
|
16
|
+
|
|
17
|
+
Execution:
|
|
18
|
+
|
|
19
|
+
- All changes require a written plan and my confirmation before implementation.
|
|
20
|
+
- Use `/pm-{flow}` commands to start tasks (e.g., `/pm-bug-fix`, `/pm-research`); the plugin manages step transitions.
|
|
21
|
+
- After each code change, ensure the corresponding Spec document is updated.
|
|
22
|
+
|
|
23
|
+
### II. Type Safety (NON-NEGOTIABLE)
|
|
24
|
+
|
|
25
|
+
- When using strongly-typed languages, type escape mechanisms are forbidden.
|
|
26
|
+
- Interfaces defined at the consumer side; accept interfaces, return concrete types.
|
|
27
|
+
- All errors must be handled explicitly (propagate / wrap / handle / terminate).
|
|
28
|
+
|
|
29
|
+
### III. Verification Mandatory
|
|
30
|
+
|
|
31
|
+
All code changes must pass three layers of verification:
|
|
32
|
+
|
|
33
|
+
1. **LSP Diagnostics**: `lsp_diagnostics` on changed files must have zero errors.
|
|
34
|
+
2. **Build**: Project build command must exit with code 0.
|
|
35
|
+
3. **Tests**: Test suite must pass fully (or pre-existing failures explicitly noted).
|
|
36
|
+
|
|
37
|
+
**Forbidden**: Skipping tests, deleting failing tests to "pass", or claiming "it should work" without verification.
|
|
38
|
+
|
|
39
|
+
### IV. Mermaid Diagrams Preferred
|
|
40
|
+
|
|
41
|
+
All architecture, flow, state, and sequence diagrams **must use Mermaid**.
|
|
42
|
+
|
|
43
|
+
- **Forbidden**: ASCII art diagrams.
|
|
44
|
+
- Supported: `graph`, `sequenceDiagram`, `stateDiagram`, `classDiagram`, `flowchart`, etc.
|
|
45
|
+
- If Mermaid cannot express something (e.g., complex UI layouts), text descriptions are allowed as an exception.
|
|
46
|
+
|
|
47
|
+
### V. Code Quality First
|
|
48
|
+
|
|
49
|
+
Every code change should strive for elegance and go straight to the heart of the problem. Code must be readable and maintainable.
|
|
50
|
+
|
|
51
|
+
- Readers matter more than writers — write once, read a hundred times.
|
|
52
|
+
- Clean up code smells as you go — if you see room for improvement nearby, improve it.
|
|
53
|
+
- Abstraction must have clear benefit — abstract for readability, testability, reusability.
|
|
54
|
+
- Naming is documentation — express intent through clear naming.
|
|
55
|
+
- Don't add error handling for "impossible" scenarios — only validate at system boundaries (user input, external APIs).
|
|
56
|
+
|
|
57
|
+
### VI. Language Principle
|
|
58
|
+
|
|
59
|
+
- Code comments and identifiers use the interactive language.
|
|
60
|
+
- Logs use English (for tool compatibility).
|
|
61
|
+
|
|
62
|
+
### VII. Respect External Changes
|
|
63
|
+
|
|
64
|
+
1. If you detect code modified externally (by tools or user), ask the user how to handle it (keep or revert) before overwriting.
|
|
65
|
+
2. If the user explicitly states "I manually modified the code", you must first read and understand the purpose. Without explicit consent, never modify or revert refactored code.
|
|
66
|
+
3. If external changes introduce verifiable issues (test failures, type errors), ask for consent before adjusting.
|
|
67
|
+
|
|
68
|
+
### VIII. Rational Pushback
|
|
69
|
+
|
|
70
|
+
If the user's request is unreasonable or technically infeasible, you must firmly explain:
|
|
71
|
+
|
|
72
|
+
- What is unreasonable.
|
|
73
|
+
- Why it cannot be done.
|
|
74
|
+
- Suggested alternatives.
|
|
75
|
+
|
|
76
|
+
Never flatter or forcefully execute unreasonable demands.
|
|
77
|
+
|
|
78
|
+
### IX. Failure Transparency
|
|
79
|
+
|
|
80
|
+
If you attempt a solution and it fails, or roll back after multiple attempts, you must clearly state:
|
|
81
|
+
|
|
82
|
+
- What approach was attempted.
|
|
83
|
+
- Why it failed.
|
|
84
|
+
- Current code state (whether rolled back to safe state).
|
|
85
|
+
|
|
86
|
+
Never pretend a problem is solved or obscure failure with vague language.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Additional Constraints
|
|
91
|
+
|
|
92
|
+
### Directory Constraints
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
/docs/flow/ — Flow definitions (do not modify casually; changes follow process)
|
|
96
|
+
/docs/regulation/ — Constitution, coding style, checklists, dictionary
|
|
97
|
+
/docs/spec/ — Program specifications
|
|
98
|
+
/docs/plan/ — Task plans
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Zero Tolerance
|
|
102
|
+
|
|
103
|
+
| Violation | Handling |
|
|
104
|
+
|-----------|----------|
|
|
105
|
+
| Type escape (`any` / `@ts-ignore`) | Must rewrite |
|
|
106
|
+
| Skipping requirement clarification and implementing directly | Revert all changes |
|
|
107
|
+
| Deleting failing tests to "pass" | Restore tests + fix root cause |
|
|
108
|
+
| Mixing refactoring into bug fixes | Split into separate tasks |
|
|
109
|
+
| Overwriting user refactored code without consent | Revert + understand intent first |
|
|
110
|
+
| Forcefully executing known-infeasible requests | Revert + explain why infeasible |
|
|
111
|
+
| Pretending problems are solved after failure | Clearly state real status + roll back |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Rule Change Management
|
|
116
|
+
|
|
117
|
+
### Conflict Resolution
|
|
118
|
+
|
|
119
|
+
Constitution overrides specific rules; specific rules override verbal conventions.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Spec Design
|
|
2
|
+
|
|
3
|
+
**Template ID**: `design-spec`
|
|
4
|
+
**Category**: design
|
|
5
|
+
**Description**: Progressive design workflow from requirements to Spec documents (understand / explore / interview / design / review, 6 steps)
|
|
6
|
+
**Command**: `/pm-design-spec`
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Applicable Scenarios
|
|
12
|
+
|
|
13
|
+
- Designing a Spec document for a new feature from scratch
|
|
14
|
+
- Translating vague requirements into structured design specifications
|
|
15
|
+
- Complex design tasks requiring multiple rounds of user interviews to clarify
|
|
16
|
+
|
|
17
|
+
**Not applicable**: Incremental modifications to an existing Spec (use spec-driven-dev); pure code research (use research).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Input Requirements
|
|
22
|
+
|
|
23
|
+
| Input Item | Required | Description |
|
|
24
|
+
|------------|----------|-------------|
|
|
25
|
+
| Requirement Description | Yes | Feature concept, problem statement, goal summary |
|
|
26
|
+
| Constraints | No | Known technical/business constraints |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Default Deliverables Checklist
|
|
31
|
+
|
|
32
|
+
- Spec document (format reference: `docs/template/spec-template.md`)
|
|
33
|
+
- Research notes or decision records if necessary
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## State Machine
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
stateDiagram-v2
|
|
41
|
+
[*] --> S1_Understand_Requirements
|
|
42
|
+
S1_Understand_Requirements --> S2_Explore_Known_Facts
|
|
43
|
+
S2_Explore_Known_Facts --> S3_Identify_Gaps_and_Contradictions
|
|
44
|
+
S3_Identify_Gaps_and_Contradictions --> S4_Progressive_Interview
|
|
45
|
+
S4_Progressive_Interview --> S4_Progressive_Interview: Continue follow-up
|
|
46
|
+
S4_Progressive_Interview --> S3_Identify_Gaps_and_Contradictions: Re-analyze based on clarified answers
|
|
47
|
+
S3_Identify_Gaps_and_Contradictions --> S4_Progressive_Interview: New questions discovered
|
|
48
|
+
S3_Identify_Gaps_and_Contradictions --> S5_Design_Phase: No further questions
|
|
49
|
+
S5_Design_Phase --> S6_User_Review_Output
|
|
50
|
+
S6_User_Review_Output --> S5_Design_Phase: Revisions needed
|
|
51
|
+
S6_User_Review_Output --> [*]: Approved
|
|
52
|
+
|
|
53
|
+
note right of S4_Progressive_Interview
|
|
54
|
+
⚠️ Requires user intervention
|
|
55
|
+
end note
|
|
56
|
+
|
|
57
|
+
note right of S6_User_Review_Output
|
|
58
|
+
⚠️ Requires user intervention
|
|
59
|
+
end note
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Task Steps
|
|
65
|
+
|
|
66
|
+
### S1: Understand Requirements
|
|
67
|
+
|
|
68
|
+
**Goal**: Accurately understand the core intent and expected output of the user's input.
|
|
69
|
+
|
|
70
|
+
1. Read the user-provided requirement description section by section
|
|
71
|
+
2. Extract the core intent — what problem to solve? What goal to achieve?
|
|
72
|
+
3. Preliminarily identify what is already clear in the requirements and what remains vague
|
|
73
|
+
4. Confirm the output scope — is it a complete Feature Spec, system design, or a design for a specific module?
|
|
74
|
+
|
|
75
|
+
**Upon completion**: Automatically proceed to S2
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### S2: Explore Known Facts
|
|
80
|
+
|
|
81
|
+
**Goal**: Search for internal and external project-related information to establish the knowledge baseline needed for design.
|
|
82
|
+
|
|
83
|
+
1. Search for existing relevant documents, code, and specs within the project (using explore agent in parallel)
|
|
84
|
+
2. Search for external references — best practices, open-source implementations, technical documentation (using librarian agent)
|
|
85
|
+
3. Record key findings:
|
|
86
|
+
- Constraints and capability boundaries of the existing system
|
|
87
|
+
- Reusable modules or interfaces
|
|
88
|
+
- Known technical limitations or dependencies
|
|
89
|
+
4. Summarize findings and establish a knowledge baseline — serving as the foundation of "known facts" for subsequent design
|
|
90
|
+
|
|
91
|
+
**Reference tools**: explore / librarian Agent (in parallel as needed)
|
|
92
|
+
|
|
93
|
+
**Upon completion**: Automatically proceed to S3
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### S3: Identify Gaps and Contradictions
|
|
98
|
+
|
|
99
|
+
**Goal**: Systematically identify all vague, missing, or conflicting design points.
|
|
100
|
+
|
|
101
|
+
1. Cross-reference the input requirements with the S2 knowledge baseline to flag three categories of issues:
|
|
102
|
+
- **Missing items**: Core parts that are completely absent from the design
|
|
103
|
+
- **Ambiguous items**: Content with insufficient specificity or inherent ambiguity
|
|
104
|
+
- **Contradictory items**: Areas where the requirement intent conflicts with known facts
|
|
105
|
+
2. Sort by impact — prioritize blocking issues (gaps that will affect subsequent design decisions first)
|
|
106
|
+
3. Prepare a per-question interview list for S4 — each question should be focused and answerable
|
|
107
|
+
4. **Post-interview re-analysis**: After returning from S4, re-examine the original S3 flagged list based on the clarified answers:
|
|
108
|
+
- Do the clarified answers introduce new ambiguities?
|
|
109
|
+
- Do the clarified conclusions conflict with the existing knowledge baseline?
|
|
110
|
+
- Are there newly discovered missing items that were previously unnoticed?
|
|
111
|
+
5. If new questions are discovered → organize a new question list and return to S4 to continue interviewing; if no new questions → proceed to S5
|
|
112
|
+
|
|
113
|
+
**Upon completion**: No new questions → automatically proceed to S5; new questions exist → return to S4
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### S4: [Human-in-loop] Progressive Interview ⚠️
|
|
118
|
+
|
|
119
|
+
> **⚠️ This step requires user intervention.** Use `question` / `confirm` blocking tools to ask the user — only 1 question at a time.
|
|
120
|
+
|
|
121
|
+
**Goal**: Clarify all ambiguous and contradictory points through per-question interviewing.
|
|
122
|
+
|
|
123
|
+
1. Use `question` / `confirm` blocking tools to issue questions — only 1 question at a time
|
|
124
|
+
2. Wait for the user's reply before asking the next question
|
|
125
|
+
3. If the user's answer leads to a new direction, follow up deeply before returning to the original route
|
|
126
|
+
4. Loop until the user confirms "there are no other questions that need clarification"
|
|
127
|
+
5. Before concluding the interview, estimate the Spec coverage scope based on the clarified requirements:
|
|
128
|
+
- If the scope is clearly too large (involving 3 or more independent modules/subsystems), suggest adopting a decomposed design
|
|
129
|
+
- Use the `question` tool to ask the user: "This Spec has a relatively large scope (involving {N} modules). Would you like to adopt a decomposed design — producing one overview Spec + multiple detailed design Specs for independent features?"
|
|
130
|
+
- If the user agrees → mark "S5 will use decomposed design"; if they disagree → proceed with the conventional single-document design
|
|
131
|
+
6. **Never** batch multiple questions in plain text
|
|
132
|
+
|
|
133
|
+
**Upon completion**: User confirms "no further follow-up" → return to S3 for re-analysis
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### S5: Design Phase
|
|
138
|
+
|
|
139
|
+
**Goal**: Based on the clarified requirements, produce a structured Spec document.
|
|
140
|
+
|
|
141
|
+
1. Consolidate all information from S1–S4:
|
|
142
|
+
- Clear requirement background and goals
|
|
143
|
+
- Key decisions and clarification results from user interviews
|
|
144
|
+
- Technical constraints and known facts collected in S2
|
|
145
|
+
2. Populate each section following the organizational structure of `docs/template/spec-template.md`:
|
|
146
|
+
- Requirement background
|
|
147
|
+
- Use cases and user stories (annotated with priority P1/P2/P3)
|
|
148
|
+
- Design points (domain model, critical paths, conditional branches, interface design, configurable items)
|
|
149
|
+
- Edge cases and error scenarios
|
|
150
|
+
- Constraints and limitations (technical constraints, business constraints, known risks, scope of impact)
|
|
151
|
+
3. If the user chose decomposed design in S4:
|
|
152
|
+
- Produce an overview Spec (master Spec), where "Design Points" only describes the module layering architecture and inter-module interfaces
|
|
153
|
+
- Produce independent detailed design Specs (full sections) for each independent feature
|
|
154
|
+
- Save sub-Specs to the `/docs/spec/{parent-feature}/` directory, with file naming `spec-{feature-name}.md`
|
|
155
|
+
- Use a "Decomposition Index" table in the master Spec to reference each detailed design Spec
|
|
156
|
+
4. Output the Spec document(s):
|
|
157
|
+
- Conventional design → `/docs/spec/{feature-name}.md`
|
|
158
|
+
- Decomposed design → master Spec saved as `/docs/spec/{feature-name}/spec-{feature-name}.md`, sub-Specs saved to the same directory
|
|
159
|
+
5. For sections not applicable to the current design, mark "Not Applicable" while retaining the skeleton
|
|
160
|
+
6. Note any open items still pending decision in the design (if any)
|
|
161
|
+
|
|
162
|
+
**Reference document**: `docs/template/spec-template.md`
|
|
163
|
+
|
|
164
|
+
**Upon completion**: Automatically proceed to S6
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### S6: [Human-in-loop] User Review Output ⚠️
|
|
169
|
+
|
|
170
|
+
> **⚠️ This step requires user intervention.** The user reviews the Spec document and confirms it to complete.
|
|
171
|
+
|
|
172
|
+
**Goal**: The user reviews the Spec document and confirms that the design meets the requirements.
|
|
173
|
+
|
|
174
|
+
1. Present a Spec document summary — core design decisions, key user stories, major constraints and risks
|
|
175
|
+
2. Use the `confirm` tool to wait for the user's overall review approval of the Spec
|
|
176
|
+
3. After approval, use the `question` tool to ask the user: "Run `git commit`?"
|
|
177
|
+
- If the user selects "Yes": execute `git add -A && git commit`, using the summary of this Spec design as the commit message
|
|
178
|
+
- If the user selects "No": skip the commit
|
|
179
|
+
- ⚠️ The user's choice does not affect task completion
|
|
180
|
+
|
|
181
|
+
> ⚠️ **Important**: Spec design ends at S6. The deliverable of this workflow is the Spec document — it does **not** enter code implementation. For subsequent implementation, start an independent task via `/pm-spec-driven-dev` or `/pm-new-feature`. To decompose the Spec into a step-by-step plan, use `/pm-plan`.
|
|
182
|
+
|
|
183
|
+
**State transitions**:
|
|
184
|
+
- User approves → merge and end
|
|
185
|
+
- User requests modifications → return to S5
|
|
186
|
+
|
|
187
|
+
**Upon completion**: Task ends
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
> **Design Principles**:
|
|
192
|
+
> - **Precision over quantity**: The Spec only contains confirmed information; uncertain items are marked as "Pending Decision"
|
|
193
|
+
> - **LLM-driven transitions**: The model decides state transitions based on user feedback
|
|
194
|
+
> - **Human-machine collaboration at key nodes**: S4 Progressive Interview + S6 Review Output, two user checkpoints
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 术语字典
|
|
2
|
+
|
|
3
|
+
本项目使用以下术语。代码中的标识符使用英文,文档和沟通中可混用。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 核心概念
|
|
8
|
+
|
|
9
|
+
| 中文 | 英文 | 说明 |
|
|
10
|
+
|------|------|------|
|
|
11
|
+
| 流程 | Flow | 一个完整的任务执行流程,定义在 /docs/flow/ 中 |
|
|
12
|
+
| 步骤 | Step | 流程中的一个阶段,如 S1, S2, ... |
|
|
13
|
+
| 任务 | Task | 在某流程下启动的一次具体执行 |
|
|
14
|
+
| 行为准则 | Regulation | 项目中的规则文档,包括宪法、编码风格等 |
|
|
15
|
+
| 宪法 | Constitution | 始终加载的最高原则 |
|
|
16
|
+
| 字典 | Dictionary | 术语对照表(即本文件) |
|
|
17
|
+
|
|
18
|
+
## 任务模型
|
|
19
|
+
|
|
20
|
+
| 中文 | 英文 | 说明 |
|
|
21
|
+
|------|------|------|
|
|
22
|
+
| 规格说明 | Spec | 定义"做什么"(WHAT)的文档 |
|
|
23
|
+
| 任务计划 | Plan | 定义"怎么做"(HOW)的文档 |
|
|
24
|
+
| 任务状态 | Task State | 当前"做到哪了"(WHERE)的状态记录 |
|
|
25
|
+
|
|
26
|
+
## 流程相关
|
|
27
|
+
|
|
28
|
+
| 中文 | 英文 | 说明 |
|
|
29
|
+
|------|------|------|
|
|
30
|
+
| 状态机 | FSM / State Machine | 用 Mermaid 定义步骤流转逻辑 |
|
|
31
|
+
| 人机协作 | Human-in-loop | 需要用户介入的步骤 |
|
|
32
|
+
| 步骤流转 | Step Transition | 从一个步骤推进到下一个步骤 |
|
|
33
|
+
| 上下文注入 | Context Injection | 通过文件引用标签向对话注入内容 |
|
|
34
|
+
|
|
35
|
+
## 通用术语
|
|
36
|
+
|
|
37
|
+
| 中文 | 英文 | 说明 |
|
|
38
|
+
|------|------|------|
|
|
39
|
+
| 会话 | Session | 一次对话 |
|
|
40
|
+
| 插件 | Plugin | 扩展模块 |
|