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