@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,242 @@
|
|
|
1
|
+
# Large-Scale Refactoring
|
|
2
|
+
|
|
3
|
+
**Template ID**: `large-refactor`
|
|
4
|
+
**Category**: development
|
|
5
|
+
**Description**: Large-scale code refactoring workflow (Impact assessment → Migration path → Compatibility verification → Integration)
|
|
6
|
+
**Command**: `/pm-large-refactor`
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Applicable Scenarios
|
|
12
|
+
|
|
13
|
+
- Cross-module architecture adjustments
|
|
14
|
+
- API signature changes
|
|
15
|
+
- Data model migration
|
|
16
|
+
- Refactoring affecting more than 5 files
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Input Requirements
|
|
21
|
+
|
|
22
|
+
| Input Item | Required | Description |
|
|
23
|
+
|--------|------|------|
|
|
24
|
+
| Refactoring goal | Yes | Refactoring motivation, expected outcome |
|
|
25
|
+
| Impact scope estimate | No | Rough estimate of affected files and modules |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Default Deliverables
|
|
30
|
+
|
|
31
|
+
- Impact scope assessment report
|
|
32
|
+
- Migration path design document
|
|
33
|
+
- Refactored code (with backward compatibility layer)
|
|
34
|
+
- Migration tests
|
|
35
|
+
- Compatibility verification report
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## State Machine
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
stateDiagram-v2
|
|
43
|
+
[*] --> S1_理解意图: 触发
|
|
44
|
+
S1_理解意图 --> S2_探索代码
|
|
45
|
+
S2_探索代码 --> S3_标记影响与风险
|
|
46
|
+
S3_标记影响与风险 --> S4_渐进式访谈
|
|
47
|
+
S4_渐进式访谈 --> S4_渐进式访谈: 继续追问
|
|
48
|
+
S4_渐进式访谈 --> S3_标记影响与风险: 基于澄清答案重新分析
|
|
49
|
+
S3_标记影响与风险 --> S4_渐进式访谈: 发现新疑问
|
|
50
|
+
S3_标记影响与风险 --> S5_设计方案与迁移路径: 无更多疑问
|
|
51
|
+
S5_设计方案与迁移路径 --> S6_审查计划
|
|
52
|
+
S6_审查计划 --> S5_设计方案与迁移路径: 需修改
|
|
53
|
+
S6_审查计划 --> S7_编写代码: 通过
|
|
54
|
+
S7_编写代码 --> S8_编写迁移测试
|
|
55
|
+
S8_编写迁移测试 --> S9_运行测试修复
|
|
56
|
+
S9_运行测试修复 --> S9_运行测试修复: 测试失败
|
|
57
|
+
S9_运行测试修复 --> S10_兼容性验证: 全部通过
|
|
58
|
+
S10_兼容性验证 --> S11_自查
|
|
59
|
+
S11_自查 --> S12_用户验收: 通过
|
|
60
|
+
S11_自查 --> S7_编写代码: 需修复
|
|
61
|
+
S12_用户验收 --> S13_合流: 通过
|
|
62
|
+
S12_用户验收 --> S7_编写代码: 需修复
|
|
63
|
+
S13_合流 --> [*]
|
|
64
|
+
|
|
65
|
+
note right of S4_渐进式访谈: ⚠️ 需要用户介入
|
|
66
|
+
note right of S6_审查计划: ⚠️ 需要用户介入
|
|
67
|
+
note right of S12_用户验收: ⚠️ 需要用户介入
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Task Steps
|
|
73
|
+
|
|
74
|
+
### S1: Understand Refactoring Intent
|
|
75
|
+
|
|
76
|
+
**Goal**: Accurately understand the refactoring objective, motivation, and expected outcome.
|
|
77
|
+
|
|
78
|
+
1. Read the refactoring requirement description
|
|
79
|
+
2. Extract core objectives — What to change? Why change? Expected outcome?
|
|
80
|
+
3. Preliminary scope assessment
|
|
81
|
+
|
|
82
|
+
**On completion**: Automatically proceed to S2
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### S2: Explore Existing Code
|
|
87
|
+
|
|
88
|
+
**Goal**: Gain a thorough understanding of the current state of the affected code.
|
|
89
|
+
|
|
90
|
+
1. Search all reference points (functions, types, interfaces)
|
|
91
|
+
2. Analyze call chains and dependency relationships
|
|
92
|
+
3. Mark external interfaces that are depended upon
|
|
93
|
+
|
|
94
|
+
**On completion**: Automatically proceed to S3
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### S3: Mark Impact Scope and Risks
|
|
99
|
+
|
|
100
|
+
**Goal**: Systematically assess the blast radius and risks of the refactoring.
|
|
101
|
+
|
|
102
|
+
1. List all affected files and modules
|
|
103
|
+
2. Assess the impact of breaking changes
|
|
104
|
+
3. Mark high-risk areas (data migration, API compatibility)
|
|
105
|
+
4. Sort by risk level
|
|
106
|
+
5. **Re-analysis after interview**: After returning from S4, re-examine the S3 original marker list based on clarified answers:
|
|
107
|
+
- Do the clarified answers introduce new impact scopes or risk points?
|
|
108
|
+
- Are there new conflicts between the clarified conclusions and the existing architecture?
|
|
109
|
+
- Are there high-risk areas that were not previously marked?
|
|
110
|
+
6. If new questions arise → compile a new question list and return to S4 to continue the interview; if no new questions → proceed to S5
|
|
111
|
+
|
|
112
|
+
**On completion**: No new questions → automatically proceed to S5; new questions → return to S4
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### S4: [Human-in-loop] Progressive Interview ⚠️
|
|
117
|
+
|
|
118
|
+
> **⚠️ This step requires user intervention.** Ask only 1 question at a time.
|
|
119
|
+
|
|
120
|
+
**Goal**: Clarify ambiguities in refactoring decisions.
|
|
121
|
+
|
|
122
|
+
1. Use question / confirm to ask questions one at a time
|
|
123
|
+
2. Cover: compatibility strategy, migration window, rollback plan
|
|
124
|
+
|
|
125
|
+
**On completion**: User confirms "no more questions" → return to S3 for re-analysis
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### S5: Design Solution and Migration Path
|
|
130
|
+
|
|
131
|
+
**Goal**: Design a complete refactoring solution and migration plan.
|
|
132
|
+
**Reference Regulation**: coding_style.md, constitution.md
|
|
133
|
+
|
|
134
|
+
1. Design the new architecture / interfaces / data model
|
|
135
|
+
2. Design the backward compatibility layer (e.g., Adapter / Facade)
|
|
136
|
+
3. Design the migration path (incremental vs big bang)
|
|
137
|
+
4. Mark the deprecation timeline
|
|
138
|
+
|
|
139
|
+
**On completion**: Automatically proceed to S6
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### S6: [Human-in-loop] Review Plan ⚠️
|
|
144
|
+
|
|
145
|
+
**Goal**: User reviews the refactoring plan.
|
|
146
|
+
|
|
147
|
+
1. Present: impact scope, migration path, compatibility strategy, risks
|
|
148
|
+
2. Use the confirm tool to wait for review
|
|
149
|
+
|
|
150
|
+
**On completion**: Approved → S7, needs revision → S5
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### S7: Write Code (Maintaining Backward Compatibility)
|
|
155
|
+
|
|
156
|
+
**Goal**: Implement the refactoring incrementally following the migration path.
|
|
157
|
+
**Reference Regulation**: coding_style.md, constitution.md
|
|
158
|
+
|
|
159
|
+
1. Build the compatibility layer first, then modify internal implementation
|
|
160
|
+
2. Run build / type check after each change
|
|
161
|
+
3. Mark deprecated APIs (@deprecated)
|
|
162
|
+
|
|
163
|
+
**On completion**: Automatically proceed to S8
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### S8: Write Migration Tests
|
|
168
|
+
|
|
169
|
+
**Goal**: Write tests covering both old and new behavior.
|
|
170
|
+
**Reference Regulation**: coding_style.md
|
|
171
|
+
|
|
172
|
+
1. Retain regression tests for old APIs
|
|
173
|
+
2. Add behavioral tests for new APIs
|
|
174
|
+
3. Add compatibility layer tests
|
|
175
|
+
|
|
176
|
+
**On completion**: Automatically proceed to S9
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### S9: Run Tests and Fix
|
|
181
|
+
|
|
182
|
+
**Goal**: All tests pass.
|
|
183
|
+
|
|
184
|
+
1. Run all tests
|
|
185
|
+
2. Fix failures
|
|
186
|
+
3. Confirm no regressions
|
|
187
|
+
|
|
188
|
+
**On completion**: All pass → S10
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### S10: Compatibility Verification
|
|
193
|
+
|
|
194
|
+
**Goal**: Verify backward compatibility.
|
|
195
|
+
**Reference Regulation**: migration-checklist.md
|
|
196
|
+
|
|
197
|
+
1. Run tests for callers of old APIs
|
|
198
|
+
2. Verify data format compatibility
|
|
199
|
+
3. Verify configuration file compatibility
|
|
200
|
+
4. Check Deprecation Warning output
|
|
201
|
+
|
|
202
|
+
**On completion**: Automatically proceed to S11
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### S11: Self-Check
|
|
207
|
+
|
|
208
|
+
**Goal**: Comprehensive self-check.
|
|
209
|
+
**Reference Regulation**: checklist.md
|
|
210
|
+
|
|
211
|
+
1. Is the migration path complete
|
|
212
|
+
2. Does the compatibility layer cover all old APIs
|
|
213
|
+
3. Do tests cover both old and new behavior
|
|
214
|
+
4. Is documentation updated
|
|
215
|
+
|
|
216
|
+
**On completion**: Pass → S12, needs fixes → S7
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
### S12: [Human-in-loop] User Acceptance ⚠️
|
|
221
|
+
|
|
222
|
+
**Goal**: User confirms the refactoring results.
|
|
223
|
+
|
|
224
|
+
1. Present the refactoring report (impact scope, migration path, compatibility)
|
|
225
|
+
2. Use the confirm tool to wait for confirmation
|
|
226
|
+
|
|
227
|
+
**On completion**: Approved → S13, needs fixes → S7
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### S13: Integration
|
|
232
|
+
|
|
233
|
+
**Goal**: Final verification, wrap up documentation, ask whether to commit.
|
|
234
|
+
|
|
235
|
+
1. Run final build validation and tests
|
|
236
|
+
2. Update Spec and Migration documentation
|
|
237
|
+
3. Use the `question` tool to ask the user: "Execute `git commit`?"
|
|
238
|
+
- If user selects "Yes": execute `git add -A && git commit`, using the refactoring summary as the commit message
|
|
239
|
+
- If user selects "No": skip the commit
|
|
240
|
+
- ⚠️ User choice does not affect task completion
|
|
241
|
+
|
|
242
|
+
**On completion**: Task ends
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Large-Scale Refactoring Compatibility Checklist
|
|
2
|
+
|
|
3
|
+
## Interface Compatibility
|
|
4
|
+
|
|
5
|
+
- [ ] All legacy APIs remain available (via Adapter / Facade / @deprecated marks)
|
|
6
|
+
- [ ] No data loss or format errors when legacy APIs call new APIs
|
|
7
|
+
- [ ] Deprecation warnings output correctly (if enabled)
|
|
8
|
+
- [ ] New API behavior matches legacy API documentation (or docs have been updated)
|
|
9
|
+
|
|
10
|
+
## Data Compatibility
|
|
11
|
+
|
|
12
|
+
- [ ] Legacy data formats can be read normally
|
|
13
|
+
- [ ] New and old data formats can be converted bidirectionally
|
|
14
|
+
- [ ] Database migration scripts are reversible
|
|
15
|
+
- [ ] Config file format is compatible (or migration tool provided)
|
|
16
|
+
|
|
17
|
+
## Test Coverage
|
|
18
|
+
|
|
19
|
+
- [ ] All legacy API regression tests pass
|
|
20
|
+
- [ ] New API behavior tests pass
|
|
21
|
+
- [ ] Compatibility layer tests pass (legacy→new call path)
|
|
22
|
+
- [ ] Edge case tests pass (empty data, extreme values, concurrency)
|
|
23
|
+
|
|
24
|
+
## Migration Path
|
|
25
|
+
|
|
26
|
+
- [ ] Migration docs updated (steps, timeline, rollback plan)
|
|
27
|
+
- [ ] Callers notified (if external modules or teams are involved)
|
|
28
|
+
- [ ] Deprecation milestones marked (version number + estimated removal date)
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Research Task
|
|
2
|
+
|
|
3
|
+
**Template ID**: `research`
|
|
4
|
+
**Category**: research
|
|
5
|
+
**Description**: Research workflow for organizing requirements, design documents, and analysis
|
|
6
|
+
**Command**: `/pm-research`
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Applicable Scenarios
|
|
12
|
+
|
|
13
|
+
- Organizing requirements, maintaining documentation
|
|
14
|
+
- Research analysis, investigating open-ended questions
|
|
15
|
+
- Designing and writing Spec documents, technical proposals
|
|
16
|
+
|
|
17
|
+
**Not applicable**: Code implementation, bug fixes.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Input Requirements
|
|
22
|
+
|
|
23
|
+
| Input Item | Required | Description |
|
|
24
|
+
|------------|----------|-------------|
|
|
25
|
+
| Requirement description / draft / initial idea | Yes | Describe the problem to solve or the goal to achieve |
|
|
26
|
+
|
|
27
|
+
If the input does not meet requirements, guide the user to supplement before continuing.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Default Deliverables
|
|
32
|
+
|
|
33
|
+
- Research report / Spec document / Technical proposal
|
|
34
|
+
- If a planning phase is involved, output the plan document to `/docs/plan/[plan]_*.md`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## State Machine
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
stateDiagram-v2
|
|
42
|
+
[*] --> S1_Understand_Intent
|
|
43
|
+
S1_Understand_Intent --> S2_Explore_Known_Facts
|
|
44
|
+
S2_Explore_Known_Facts --> S3_Mark_Gaps_and_Conflicts
|
|
45
|
+
S3_Mark_Gaps_and_Conflicts --> S4_Progressive_Interview
|
|
46
|
+
S4_Progressive_Interview --> S4_Progressive_Interview: Continue probing
|
|
47
|
+
S4_Progressive_Interview --> S3_Mark_Gaps_and_Conflicts: Re-analyze based on clarified answers
|
|
48
|
+
S3_Mark_Gaps_and_Conflicts --> S4_Progressive_Interview: New questions found
|
|
49
|
+
S3_Mark_Gaps_and_Conflicts --> S5_Execution_Phase: No more questions
|
|
50
|
+
S5_Execution_Phase --> S6_User_Review
|
|
51
|
+
S6_User_Review --> S5_Execution_Phase: Revisions needed
|
|
52
|
+
S6_User_Review --> [*]: Approved
|
|
53
|
+
|
|
54
|
+
note right of S4_Progressive_Interview
|
|
55
|
+
⚠️ Requires user intervention
|
|
56
|
+
end note
|
|
57
|
+
|
|
58
|
+
note right of S6_User_Review
|
|
59
|
+
⚠️ Requires user intervention
|
|
60
|
+
end note
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Task Steps
|
|
66
|
+
|
|
67
|
+
### S1: Understand Input Intent
|
|
68
|
+
|
|
69
|
+
**Goal**: Accurately understand the core intent of the user's input.
|
|
70
|
+
|
|
71
|
+
1. Read the user-provided description paragraph by paragraph
|
|
72
|
+
2. Extract the core intent — what problem to solve? What goal to achieve?
|
|
73
|
+
3. Identify covered information and preliminary gaps
|
|
74
|
+
|
|
75
|
+
**After completion**: Automatically proceed to S2
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### S2: Explore Related Known Facts
|
|
80
|
+
|
|
81
|
+
**Goal**: Search for relevant internal and external information to establish a knowledge baseline.
|
|
82
|
+
|
|
83
|
+
1. Search for existing relevant documents and code within the project
|
|
84
|
+
2. Search for external reference materials (documentation, best practices, open-source implementations)
|
|
85
|
+
3. Document key findings and constraints
|
|
86
|
+
4. Summarize findings to establish a knowledge baseline
|
|
87
|
+
|
|
88
|
+
**Referenced tools**: explore / librarian Agent (parallel on demand)
|
|
89
|
+
|
|
90
|
+
**After completion**: Automatically proceed to S3
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### S3: Mark Information Gaps and Contradictions
|
|
95
|
+
|
|
96
|
+
**Goal**: Systematically identify all vague, missing, and conflicting areas.
|
|
97
|
+
|
|
98
|
+
1. Compare input intent with known facts, and mark:
|
|
99
|
+
- **Missing items**: Key parts of the design that are completely blank
|
|
100
|
+
- **Vague items**: Descriptions that are not specific enough or contain ambiguity
|
|
101
|
+
- **Conflicting items**: Places where design intent conflicts with known facts
|
|
102
|
+
2. Prioritize by impact — blocking issues first
|
|
103
|
+
3. Prepare a question-by-question interview list for S4
|
|
104
|
+
4. **Post-interview re-analysis**: After returning from S4, based on clarified answers, re-examine the original S3 marker list:
|
|
105
|
+
- Do the clarified answers introduce new ambiguities?
|
|
106
|
+
- Do the clarified conclusions conflict with the existing knowledge baseline?
|
|
107
|
+
- Are there previously undiscovered missing items?
|
|
108
|
+
5. If new questions found → organize new question list, return to S4 for further interview; if no new questions → proceed to S5
|
|
109
|
+
|
|
110
|
+
**After completion**: No new questions → automatically proceed to S5; new questions → return to S4
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### S4: [Human-in-loop] Progressive Interview ⚠️
|
|
115
|
+
|
|
116
|
+
> **⚠️ This step requires user intervention.** Use `question` / `confirm` blocking tools to ask the user — only one question at a time.
|
|
117
|
+
|
|
118
|
+
**Goal**: Clarify all vague points and contradictions through sequential questioning.
|
|
119
|
+
|
|
120
|
+
1. Use `question` / `confirm` blocking tools to ask questions — only one question at a time
|
|
121
|
+
2. Wait for the user's response before asking the next one
|
|
122
|
+
3. If the user's answer leads to a new direction, follow up deeply before returning to the original path
|
|
123
|
+
4. Loop until the user confirms "no further questions need clarification"
|
|
124
|
+
5. **Never** batch multiple questions in plain text
|
|
125
|
+
|
|
126
|
+
**After completion**: User confirms "no further questions" → return to S3 for re-analysis
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### S5: Execution Phase
|
|
131
|
+
|
|
132
|
+
**Goal**: Design the solution based on clarified requirements, execute according to plan, and produce final deliverables.
|
|
133
|
+
|
|
134
|
+
1. Outline the complete design — modules, interfaces, data flow, edge-case handling
|
|
135
|
+
2. Break down tasks into independently executable and verifiable subtasks, noting dependencies and parallelization opportunities
|
|
136
|
+
3. Execute subtasks in the planned order to produce the final deliverable (research report / Spec document / technical proposal)
|
|
137
|
+
4. Mark tasks with `[P]` for parallel processing; update progress after completing each subtask
|
|
138
|
+
5. Consolidate all outputs and prepare for user review
|
|
139
|
+
|
|
140
|
+
**After completion**: Automatically proceed to S6
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### S6: [Human-in-loop] User Review Output ⚠️
|
|
145
|
+
|
|
146
|
+
> **⚠️ This step requires user intervention.** The user reviews the final output and confirms before merging.
|
|
147
|
+
|
|
148
|
+
**Goal**: User reviews the final research output and confirms that deliverables meet requirements.
|
|
149
|
+
|
|
150
|
+
1. Present a summary of the final output (key content and conclusions of the report / Spec / proposal)
|
|
151
|
+
2. Use the `confirm` tool to wait for user review and approval
|
|
152
|
+
3. After approval, use the `question` tool to ask the user: "Execute `git commit`?"
|
|
153
|
+
- If the user selects "Yes": run `git add -A && git commit`, using the research summary as the commit message
|
|
154
|
+
- If the user selects "No": skip the commit
|
|
155
|
+
- ⚠️ The user's choice does not affect task completion
|
|
156
|
+
|
|
157
|
+
**State transitions**:
|
|
158
|
+
- User approves → merge and end
|
|
159
|
+
- User requests revisions → return to S5
|
|
160
|
+
|
|
161
|
+
**After completion**: Task ends
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Quick Turnaround Tasks
|
|
2
|
+
|
|
3
|
+
**Template ID**: `side-job`
|
|
4
|
+
**Category**: side-job
|
|
5
|
+
**Description**: Quick turnaround task flow — LLM must confirm the plan with the user before execution
|
|
6
|
+
**Command**: `/pm-side-job`
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Applicable Scenarios
|
|
12
|
+
|
|
13
|
+
- Independent small tasks with clear intent that don't require deep research
|
|
14
|
+
- One-off modifications, config adjustments, small-scale refactoring, script writing, etc.
|
|
15
|
+
- Users expect the LLM to think through a plan and get confirmation before taking action
|
|
16
|
+
|
|
17
|
+
**Not applicable**: Complex architecture design, bug fixes requiring root cause analysis, large-scale refactoring.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Input Requirements
|
|
22
|
+
|
|
23
|
+
| Input Item | Required | Description |
|
|
24
|
+
|------------|----------|-------------|
|
|
25
|
+
| Task Description | Yes | What to do, and the expected outcome |
|
|
26
|
+
|
|
27
|
+
If the input does not meet requirements, guide the user to supplement before continuing.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Default Deliverables
|
|
32
|
+
|
|
33
|
+
- Complete the task described by the user
|
|
34
|
+
- If code changes are involved, pass LSP diagnostics and build verification
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## State Machine
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
stateDiagram-v2
|
|
42
|
+
[*] --> S1_UnderstandIntent: Trigger
|
|
43
|
+
S1_UnderstandIntent --> S2_ConfirmPlan
|
|
44
|
+
S2_ConfirmPlan --> S1_UnderstandIntent: User requests revision
|
|
45
|
+
S2_ConfirmPlan --> S1_UnderstandIntent: Plan is infeasible, needs re-analysis
|
|
46
|
+
S2_ConfirmPlan --> S3_Execute: User confirms approval
|
|
47
|
+
S3_Execute --> S4_AcceptanceIntegration
|
|
48
|
+
S4_AcceptanceIntegration --> S3_Execute: Modifications needed
|
|
49
|
+
S4_AcceptanceIntegration --> [*]: Passed
|
|
50
|
+
|
|
51
|
+
note right of S2_ConfirmPlan
|
|
52
|
+
⚠️ Requires user intervention
|
|
53
|
+
end note
|
|
54
|
+
|
|
55
|
+
note right of S4_AcceptanceIntegration
|
|
56
|
+
⚠️ Requires user intervention
|
|
57
|
+
end note
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Task Steps
|
|
63
|
+
|
|
64
|
+
### S1: Understand Intent
|
|
65
|
+
|
|
66
|
+
**Goal**: Accurately understand what the user wants to do, and analyze feasible approaches.
|
|
67
|
+
|
|
68
|
+
1. Read the user's description, extract the core task and constraints
|
|
69
|
+
2. Read relevant source code and documentation as needed (using the read tool directly)
|
|
70
|
+
3. Search for related files within the project to understand existing patterns (using explore agent for parallel searches)
|
|
71
|
+
4. If the description is unclear or information is insufficient, use the `question` / `confirm` tools to follow up
|
|
72
|
+
5. Consider 2-3 feasible approaches, evaluate each in terms of scope of changes, risk, and impact
|
|
73
|
+
6. Select the recommended approach, ready to present in S2
|
|
74
|
+
|
|
75
|
+
**Note**: **Do not** edit, create, or delete any files during this step.
|
|
76
|
+
|
|
77
|
+
**On completion**: Automatically proceed to S2
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### S2: [Human-in-loop] Confirm Execution Plan ⚠️
|
|
82
|
+
|
|
83
|
+
> **⚠️ This step requires user intervention.** The LLM presents the execution plan and uses the `confirm` / `question` tools to wait for the user's **explicit confirmation** before proceeding.
|
|
84
|
+
|
|
85
|
+
**Goal**: Present the execution plan to the user and obtain explicit confirmation.
|
|
86
|
+
|
|
87
|
+
1. Call `pm_task_set_step(step="S2")` to declare entry into this step
|
|
88
|
+
2. Present the execution plan, including at minimum:
|
|
89
|
+
- **Task Understanding**: A one-sentence summary of what to do
|
|
90
|
+
- **Execution Steps**: Which specific files to modify, what changes to make (order and dependencies)
|
|
91
|
+
- **Scope of Impact**: Modules or features that may be affected
|
|
92
|
+
- **Risk Points**: Areas to watch out for (if any)
|
|
93
|
+
3. ⚠️ Use the `confirm` / `question` tools to wait for the user's explicit confirmation:
|
|
94
|
+
- **Must** receive a **strongly affirmative** instruction such as "confirmed / agree / approved / no problem / OK / go ahead / LGTM" before proceeding
|
|
95
|
+
- Vague or weakly affirmative language ("looks doable", "give it a try", "mm", "should be fine") is treated as **unconfirmed** — must follow up with the user for a clear stance
|
|
96
|
+
- User silence is treated as **unconfirmed** — do not proceed on your own
|
|
97
|
+
4. **Strictly prohibited** from performing any code modifications, file edits, or todo creation before receiving explicit confirmation
|
|
98
|
+
5. If the user requests plan adjustments → return to S1 for re-analysis (or revise in place at this step and re-confirm)
|
|
99
|
+
|
|
100
|
+
**State transitions**:
|
|
101
|
+
- User explicitly confirms → S3
|
|
102
|
+
- User requests revisions → return to S1 (re-analyze the plan)
|
|
103
|
+
- Plan adjusted with simple changes and re-confirmed → stay at S2 to continue confirmation
|
|
104
|
+
|
|
105
|
+
**On completion**: User explicitly confirms → proceed to S3
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### S3: Execute
|
|
110
|
+
|
|
111
|
+
**Goal**: Execute the task according to the confirmed plan.
|
|
112
|
+
|
|
113
|
+
1. Call `pm_task_set_step(step="S3")` to declare entry into this step
|
|
114
|
+
2. Create a todo list (if the task involves multiple sub-steps)
|
|
115
|
+
3. Strictly follow the plan confirmed in S2:
|
|
116
|
+
- Only modify files listed in the plan
|
|
117
|
+
- Do not introduce changes outside the plan
|
|
118
|
+
- Follow the project constitution's "Code Quality First" principle
|
|
119
|
+
4. Update todo status upon completing each sub-step
|
|
120
|
+
5. After completion, run project build / type check / LSP diagnostics for verification
|
|
121
|
+
|
|
122
|
+
**On completion**: Automatically proceed to S4
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### S4: [Human-in-loop] Acceptance & Integration ⚠️
|
|
127
|
+
|
|
128
|
+
> **⚠️ This step requires user intervention.** The user reviews the execution results and confirms integration.
|
|
129
|
+
|
|
130
|
+
**Goal**: User accepts the final deliverable and confirms completion.
|
|
131
|
+
|
|
132
|
+
1. Call `pm_task_set_step(step="S4")` to declare entry into this step
|
|
133
|
+
2. Present an execution summary:
|
|
134
|
+
- Which files were modified
|
|
135
|
+
- What changes were made (diff summary)
|
|
136
|
+
- Verification results (build / type check / LSP diagnostics passed or not)
|
|
137
|
+
3. Use the `confirm` / `question` tools to wait for the user's acceptance confirmation
|
|
138
|
+
4. After acceptance, use the `question` tool to ask the user: "Proceed with `git commit`?"
|
|
139
|
+
- If the user chooses "Yes": run `git add -A && git commit`, using the task summary as the commit message
|
|
140
|
+
- If the user chooses "No": skip the commit
|
|
141
|
+
- ⚠️ The user's choice does not affect task completion
|
|
142
|
+
|
|
143
|
+
**State transitions**:
|
|
144
|
+
- User approves → integration complete
|
|
145
|
+
- User requests modifications → return to S3
|
|
146
|
+
|
|
147
|
+
**On completion**: Call `pm_task_close()` to end the task and trigger analysis
|