plan-flow-skill 1.0.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/.claude/commands/create-contract.md +468 -0
- package/.claude/commands/create-plan.md +512 -0
- package/.claude/commands/discovery-plan.md +561 -0
- package/.claude/commands/execute-plan.md +682 -0
- package/.claude/commands/review-code.md +459 -0
- package/.claude/commands/review-pr.md +651 -0
- package/.claude/commands/setup.md +1609 -0
- package/.claude/commands/write-tests.md +543 -0
- package/.claude/rules/core/allowed-patterns.md +175 -0
- package/.claude/rules/core/complexity-scoring.md +225 -0
- package/.claude/rules/core/forbidden-patterns.md +253 -0
- package/.claude/rules/languages/python-patterns.md +6 -0
- package/.claude/rules/languages/typescript-patterns.md +7 -0
- package/.claude/rules/patterns/contract-patterns.md +332 -0
- package/.claude/rules/patterns/discovery-patterns.md +342 -0
- package/.claude/rules/patterns/discovery-templates.md +319 -0
- package/.claude/rules/patterns/jest-patterns.md +482 -0
- package/.claude/rules/patterns/plans-patterns.md +225 -0
- package/.claude/rules/patterns/plans-templates.md +227 -0
- package/.claude/rules/patterns/pytest-patterns.md +457 -0
- package/.claude/rules/patterns/review-code-templates.md +305 -0
- package/.claude/rules/patterns/review-pr-patterns.md +360 -0
- package/.claude/rules/tools/auth-pr-tool.md +30 -0
- package/.claude/rules/tools/interactive-questions-tool.md +235 -0
- package/.claude/rules/tools/jest-testing-tool.md +73 -0
- package/.claude/rules/tools/plan-mode-tool.md +164 -0
- package/.claude/rules/tools/pytest-testing-tool.md +121 -0
- package/.claude/rules/tools/reference-expansion-tool.md +326 -0
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +139 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/handlers/claude.d.ts +9 -0
- package/dist/cli/handlers/claude.d.ts.map +1 -0
- package/dist/cli/handlers/claude.js +119 -0
- package/dist/cli/handlers/claude.js.map +1 -0
- package/dist/cli/handlers/codex.d.ts +9 -0
- package/dist/cli/handlers/codex.d.ts.map +1 -0
- package/dist/cli/handlers/codex.js +100 -0
- package/dist/cli/handlers/codex.js.map +1 -0
- package/dist/cli/handlers/cursor.d.ts +8 -0
- package/dist/cli/handlers/cursor.d.ts.map +1 -0
- package/dist/cli/handlers/cursor.js +34 -0
- package/dist/cli/handlers/cursor.js.map +1 -0
- package/dist/cli/handlers/openclaw.d.ts +8 -0
- package/dist/cli/handlers/openclaw.d.ts.map +1 -0
- package/dist/cli/handlers/openclaw.js +34 -0
- package/dist/cli/handlers/openclaw.js.map +1 -0
- package/dist/cli/handlers/shared.d.ts +9 -0
- package/dist/cli/handlers/shared.d.ts.map +1 -0
- package/dist/cli/handlers/shared.js +44 -0
- package/dist/cli/handlers/shared.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +43 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/types.d.ts +26 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +5 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/utils/files.d.ts +37 -0
- package/dist/cli/utils/files.d.ts.map +1 -0
- package/dist/cli/utils/files.js +122 -0
- package/dist/cli/utils/files.js.map +1 -0
- package/dist/cli/utils/logger.d.ts +11 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +34 -0
- package/dist/cli/utils/logger.js.map +1 -0
- package/dist/cli/utils/prompts.d.ts +10 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -0
- package/dist/cli/utils/prompts.js +65 -0
- package/dist/cli/utils/prompts.js.map +1 -0
- package/dist/test/setup.d.ts +5 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +7 -0
- package/dist/test/setup.js.map +1 -0
- package/package.json +63 -0
- package/rules/core/_index.mdc +89 -0
- package/rules/core/allowed-patterns.mdc +185 -0
- package/rules/core/complexity-scoring.mdc +235 -0
- package/rules/core/forbidden-patterns.mdc +263 -0
- package/rules/languages/_index.mdc +80 -0
- package/rules/languages/python-patterns.mdc +188 -0
- package/rules/languages/typescript-patterns.mdc +128 -0
- package/rules/patterns/_index.mdc +185 -0
- package/rules/patterns/contract-patterns.mdc +344 -0
- package/rules/patterns/discovery-patterns.mdc +354 -0
- package/rules/patterns/discovery-templates.mdc +329 -0
- package/rules/patterns/jest-patterns.mdc +492 -0
- package/rules/patterns/plans-patterns.mdc +237 -0
- package/rules/patterns/plans-templates.mdc +237 -0
- package/rules/patterns/pytest-patterns.mdc +467 -0
- package/rules/patterns/review-code-templates.mdc +315 -0
- package/rules/patterns/review-pr-patterns.mdc +370 -0
- package/rules/skills/_index.mdc +174 -0
- package/rules/skills/create-contract-skill.mdc +239 -0
- package/rules/skills/create-plan-skill.mdc +271 -0
- package/rules/skills/discovery-skill.mdc +295 -0
- package/rules/skills/execute-plan-skill.mdc +388 -0
- package/rules/skills/review-code-skill.mdc +308 -0
- package/rules/skills/review-pr-skill.mdc +496 -0
- package/rules/skills/setup-skill.mdc +923 -0
- package/rules/skills/write-tests-skill.mdc +294 -0
- package/rules/templates/index-template.mdc +126 -0
- package/rules/tools/_index.mdc +114 -0
- package/rules/tools/auth-pr-tool.mdc +362 -0
- package/rules/tools/interactive-questions-tool.mdc +337 -0
- package/rules/tools/jest-testing-tool.mdc +96 -0
- package/rules/tools/plan-mode-tool.mdc +229 -0
- package/rules/tools/pytest-testing-tool.mdc +144 -0
- package/rules/tools/reference-expansion-tool.mdc +338 -0
- package/skills/plan-flow/SKILL.md +109 -0
- package/skills/plan-flow/create-contract/SKILL.md +139 -0
- package/skills/plan-flow/create-plan/SKILL.md +93 -0
- package/skills/plan-flow/discovery/SKILL.md +85 -0
- package/skills/plan-flow/execute-plan/SKILL.md +89 -0
- package/skills/plan-flow/review-code/SKILL.md +100 -0
- package/skills/plan-flow/review-pr/SKILL.md +122 -0
- package/skills/plan-flow/setup/SKILL.md +73 -0
- package/skills/plan-flow/write-tests/SKILL.md +115 -0
- package/templates/shared/AGENTS.md.template +60 -0
- package/templates/shared/CLAUDE.md.template +62 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
|
|
2
|
+
## Discovery Document Template
|
|
3
|
+
|
|
4
|
+
Use this template when creating discovery documents:
|
|
5
|
+
|
|
6
|
+
```markdown
|
|
7
|
+
# Discovery: [Feature/Topic Name]
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
[Why this discovery is needed. What triggered it? What problem are we solving?]
|
|
12
|
+
|
|
13
|
+
## Referenced Documents
|
|
14
|
+
|
|
15
|
+
[List documents reviewed - use @mentions or file paths]
|
|
16
|
+
|
|
17
|
+
| Document | Key Findings |
|
|
18
|
+
| -------------------------------------- | ----------------------------- |
|
|
19
|
+
| `flow/references/api-contracts.md` | [Summary of relevant content] |
|
|
20
|
+
| `flow/references/sse-events.md` | [Summary of relevant content] |
|
|
21
|
+
|
|
22
|
+
## Requirements Gathered
|
|
23
|
+
|
|
24
|
+
### Functional Requirements
|
|
25
|
+
|
|
26
|
+
- [FR-1]: [Description]
|
|
27
|
+
- [FR-2]: [Description]
|
|
28
|
+
|
|
29
|
+
### Non-Functional Requirements
|
|
30
|
+
|
|
31
|
+
- [NFR-1]: [Description]
|
|
32
|
+
|
|
33
|
+
### Constraints
|
|
34
|
+
|
|
35
|
+
- [C-1]: [Description]
|
|
36
|
+
|
|
37
|
+
## Open Questions
|
|
38
|
+
|
|
39
|
+
| # | Question | Status | Answer |
|
|
40
|
+
| --- | ---------- | ------ | ------ |
|
|
41
|
+
| 1 | [Question] | Open | - |
|
|
42
|
+
| 2 | [Question] | Open | - |
|
|
43
|
+
|
|
44
|
+
## Technical Considerations
|
|
45
|
+
|
|
46
|
+
### Architecture
|
|
47
|
+
|
|
48
|
+
[How this fits into existing system]
|
|
49
|
+
|
|
50
|
+
### Dependencies
|
|
51
|
+
|
|
52
|
+
[What this relies on]
|
|
53
|
+
|
|
54
|
+
### Patterns to Follow
|
|
55
|
+
|
|
56
|
+
[Relevant patterns from cursor rules]
|
|
57
|
+
|
|
58
|
+
### Potential Challenges
|
|
59
|
+
|
|
60
|
+
[Identified difficulties]
|
|
61
|
+
|
|
62
|
+
## Proposed Approach
|
|
63
|
+
|
|
64
|
+
[High-level approach recommendation based on findings]
|
|
65
|
+
|
|
66
|
+
## Risks and Unknowns
|
|
67
|
+
|
|
68
|
+
### Risks
|
|
69
|
+
|
|
70
|
+
| Risk | Impact | Mitigation |
|
|
71
|
+
| ------ | --------------- | ------------ |
|
|
72
|
+
| [Risk] | High/Medium/Low | [Mitigation] |
|
|
73
|
+
|
|
74
|
+
### Unknowns
|
|
75
|
+
|
|
76
|
+
- [ ] [Unknown that needs investigation]
|
|
77
|
+
|
|
78
|
+
## Next Steps
|
|
79
|
+
|
|
80
|
+
- [ ] Resolve open questions
|
|
81
|
+
- [ ] Create implementation plan: `flow/plans/plan_<feature>_v1.md`
|
|
82
|
+
- [ ] [Other follow-ups]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Spike Template
|
|
88
|
+
|
|
89
|
+
Use this template for technical investigation spikes:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Spike: [Technical Topic]
|
|
93
|
+
|
|
94
|
+
## Objective
|
|
95
|
+
|
|
96
|
+
[What we're trying to learn or prove]
|
|
97
|
+
|
|
98
|
+
## Time Box
|
|
99
|
+
|
|
100
|
+
[Maximum time allocated for this spike: e.g., 2 hours, 1 day]
|
|
101
|
+
|
|
102
|
+
## Hypothesis
|
|
103
|
+
|
|
104
|
+
[What we expect to find or prove]
|
|
105
|
+
|
|
106
|
+
## Investigation
|
|
107
|
+
|
|
108
|
+
### Approach 1: [Name]
|
|
109
|
+
|
|
110
|
+
**Description**: [What was tried]
|
|
111
|
+
|
|
112
|
+
**Results**: [What was found]
|
|
113
|
+
|
|
114
|
+
**Pros**:
|
|
115
|
+
|
|
116
|
+
- [Pro 1]
|
|
117
|
+
- [Pro 2]
|
|
118
|
+
|
|
119
|
+
**Cons**:
|
|
120
|
+
|
|
121
|
+
- [Con 1]
|
|
122
|
+
- [Con 2]
|
|
123
|
+
|
|
124
|
+
### Approach 2: [Name]
|
|
125
|
+
|
|
126
|
+
[Same structure as Approach 1]
|
|
127
|
+
|
|
128
|
+
## Findings
|
|
129
|
+
|
|
130
|
+
### Key Learnings
|
|
131
|
+
|
|
132
|
+
1. [Learning 1]
|
|
133
|
+
2. [Learning 2]
|
|
134
|
+
|
|
135
|
+
### Performance Results
|
|
136
|
+
|
|
137
|
+
[If applicable: benchmarks, metrics]
|
|
138
|
+
|
|
139
|
+
### Code Samples
|
|
140
|
+
|
|
141
|
+
[If applicable: minimal code examples that demonstrate findings]
|
|
142
|
+
|
|
143
|
+
## Recommendation
|
|
144
|
+
|
|
145
|
+
[Which approach to use and why]
|
|
146
|
+
|
|
147
|
+
## Next Steps
|
|
148
|
+
|
|
149
|
+
- [ ] Document findings in discovery or plan
|
|
150
|
+
- [ ] [Other follow-ups]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Question Format Examples
|
|
156
|
+
|
|
157
|
+
### Functional Requirements Questions
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
Questions
|
|
161
|
+
|
|
162
|
+
1. Should workflow steps be editable after creation?
|
|
163
|
+
A Yes, users can edit title and content at any time
|
|
164
|
+
B Yes, but only before the workflow is published
|
|
165
|
+
C No, steps are immutable once created
|
|
166
|
+
|
|
167
|
+
2. What is the maximum number of steps per workflow?
|
|
168
|
+
A 10 steps
|
|
169
|
+
B 20 steps
|
|
170
|
+
C Unlimited
|
|
171
|
+
D Other (please specify)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Technical Questions
|
|
175
|
+
|
|
176
|
+
```markdown
|
|
177
|
+
Questions
|
|
178
|
+
|
|
179
|
+
1. Which real-time update mechanism should we use?
|
|
180
|
+
A SSE (Server-Sent Events) - simpler, one-way
|
|
181
|
+
B WebSocket - full duplex, more complex
|
|
182
|
+
C Polling - simple but less efficient
|
|
183
|
+
|
|
184
|
+
2. Should we use optimistic updates for better UX?
|
|
185
|
+
A Yes, with rollback on failure
|
|
186
|
+
B No, wait for server confirmation
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### UI/UX Questions
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
Questions
|
|
193
|
+
|
|
194
|
+
1. Where should this feature live in the UI?
|
|
195
|
+
A New dedicated page
|
|
196
|
+
B Sidebar panel
|
|
197
|
+
C Modal dialog
|
|
198
|
+
D Inline in existing page
|
|
199
|
+
|
|
200
|
+
2. What loading state should we show?
|
|
201
|
+
A Skeleton loader
|
|
202
|
+
B Spinner
|
|
203
|
+
C Progress bar
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Referenced Documents Analysis Example
|
|
209
|
+
|
|
210
|
+
```markdown
|
|
211
|
+
## Referenced Documents Analysis
|
|
212
|
+
|
|
213
|
+
I've reviewed the following documents:
|
|
214
|
+
|
|
215
|
+
### API Contract (`flow/references/api-contracts.md`)
|
|
216
|
+
|
|
217
|
+
- Endpoint: POST /api/agents/{agentId}/workflow
|
|
218
|
+
- Request schema: WorkflowStepInput[]
|
|
219
|
+
- Response: WorkflowStep[]
|
|
220
|
+
- Authentication: Bearer token required
|
|
221
|
+
|
|
222
|
+
### SSE Events (`flow/references/sse-events.md`)
|
|
223
|
+
|
|
224
|
+
- Event types: plan_start, plan_step, plan_complete
|
|
225
|
+
- Payload structure: { stepId, status, content }
|
|
226
|
+
|
|
227
|
+
## Questions Based on Documents
|
|
228
|
+
|
|
229
|
+
1. The API contract shows `WorkflowStepInput` but doesn't define the `condition` field. Is this optional?
|
|
230
|
+
2. SSE events mention `plan_step` but not error handling. What happens on failure?
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Requirements Gathering Example
|
|
236
|
+
|
|
237
|
+
```markdown
|
|
238
|
+
## Requirements Gathered
|
|
239
|
+
|
|
240
|
+
### From API Contract (`flow/references/api-contracts.md`)
|
|
241
|
+
|
|
242
|
+
**Functional Requirements**:
|
|
243
|
+
|
|
244
|
+
- [FR-1]: Create workflow steps via POST /api/agents/{agentId}/workflow
|
|
245
|
+
- [FR-2]: Each step must have title, content, and sequence
|
|
246
|
+
- [FR-3]: Steps can have optional connectors and actions
|
|
247
|
+
|
|
248
|
+
**Non-Functional Requirements**:
|
|
249
|
+
|
|
250
|
+
- [NFR-1]: API response time < 500ms
|
|
251
|
+
- [NFR-2]: Support concurrent editing (optimistic updates)
|
|
252
|
+
|
|
253
|
+
**Constraints**:
|
|
254
|
+
|
|
255
|
+
- [C-1]: Maximum 20 steps per workflow
|
|
256
|
+
- [C-2]: Must use existing authentication flow
|
|
257
|
+
|
|
258
|
+
### From SSE Events (`flow/references/sse-events.md`)
|
|
259
|
+
|
|
260
|
+
**Functional Requirements**:
|
|
261
|
+
|
|
262
|
+
- [FR-4]: Real-time updates via SSE events
|
|
263
|
+
- [FR-5]: Events include: plan_start, plan_step, plan_complete
|
|
264
|
+
|
|
265
|
+
**Non-Functional Requirements**:
|
|
266
|
+
|
|
267
|
+
- [NFR-3]: SSE connection must auto-reconnect on failure
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Risks and Unknowns Example
|
|
273
|
+
|
|
274
|
+
```markdown
|
|
275
|
+
## Risks and Unknowns
|
|
276
|
+
|
|
277
|
+
### Technical Risks
|
|
278
|
+
|
|
279
|
+
| Risk | Impact | Mitigation |
|
|
280
|
+
| -------------------------- | ------ | ----------------------------------------------------- |
|
|
281
|
+
| SSE connection instability | High | Implement reconnection with exponential backoff |
|
|
282
|
+
| State sync issues | Medium | Use server as source of truth, reconcile on reconnect |
|
|
283
|
+
|
|
284
|
+
### Requirements Risks
|
|
285
|
+
|
|
286
|
+
| Risk | Impact | Mitigation |
|
|
287
|
+
| --------------------------- | ------ | --------------------------------- |
|
|
288
|
+
| Scope creep on step editing | Medium | Define MVP scope clearly in plan |
|
|
289
|
+
| Unclear error handling | High | Clarify with user before planning |
|
|
290
|
+
|
|
291
|
+
### Unknowns (Need Investigation)
|
|
292
|
+
|
|
293
|
+
- [ ] Backend pagination support for large workflows
|
|
294
|
+
- [ ] Mobile responsiveness requirements
|
|
295
|
+
- [ ] Accessibility requirements for drag-and-drop
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Proposed Approach Example
|
|
301
|
+
|
|
302
|
+
```markdown
|
|
303
|
+
## Proposed Approach
|
|
304
|
+
|
|
305
|
+
Based on the requirements gathered, the recommended approach is:
|
|
306
|
+
|
|
307
|
+
1. **Extend existing agent section**: Build on `AgentPlanSection` rather than creating new component
|
|
308
|
+
2. **Use SSE for real-time updates**: Leverage existing streaming infrastructure
|
|
309
|
+
3. **Implement optimistic updates**: Better UX with immediate feedback
|
|
310
|
+
4. **Follow view/logic separation**: As per codebase patterns
|
|
311
|
+
|
|
312
|
+
### Approach Alternatives Considered
|
|
313
|
+
|
|
314
|
+
| Approach | Pros | Cons | Recommendation |
|
|
315
|
+
| --------- | ---------------------- | -------------------------- | --------------- |
|
|
316
|
+
| WebSocket | Full duplex | Overkill for this use case | Not recommended |
|
|
317
|
+
| SSE | Simple, existing infra | One-way only | Recommended |
|
|
318
|
+
| Polling | Simple | Poor UX, wasteful | Not recommended |
|
|
319
|
+
```
|