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,174 @@
1
+ ---
2
+ description: "Summary index for skills - load this to see available references"
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Skills Index
7
+
8
+ ## Overview
9
+
10
+ Skills implement the workflow logic for commands. Each skill orchestrates a specific process like discovery, planning, execution, or code review.
11
+
12
+ **Total Files**: 8 files, ~2,506 lines
13
+ **Reference Codes**: SKL-CON-1 through SKL-TEST-5
14
+
15
+ ---
16
+
17
+ ## Reference Codes
18
+
19
+ ### Create Contract Skill (`create-contract-skill.mdc`)
20
+
21
+ | Code | Description | Source | Lines |
22
+ |------|-------------|--------|-------|
23
+ | SKL-CON-1 | Purpose and restrictions (allowed/forbidden actions) | create-contract-skill.mdc | 8-53 |
24
+ | SKL-CON-2 | Workflow (detect source, fetch, ask questions, generate) | create-contract-skill.mdc | 65-140 |
25
+ | SKL-CON-3 | Contract output template | create-contract-skill.mdc | 142-215 |
26
+ | SKL-CON-4 | Validation checklist | create-contract-skill.mdc | 217-240 |
27
+
28
+ ### Create Plan Skill (`create-plan-skill.mdc`)
29
+
30
+ | Code | Description | Source | Lines |
31
+ |------|-------------|--------|-------|
32
+ | SKL-PLN-1 | Purpose and restrictions | create-plan-skill.mdc | 8-53 |
33
+ | SKL-PLN-2 | Workflow (extract, analyze, structure phases) | create-plan-skill.mdc | 67-165 |
34
+ | SKL-PLN-3 | Plan output template | create-plan-skill.mdc | 179-244 |
35
+ | SKL-PLN-4 | Validation checklist | create-plan-skill.mdc | 246-272 |
36
+
37
+ ### Discovery Skill (`discovery-skill.mdc`)
38
+
39
+ | Code | Description | Source | Lines |
40
+ |------|-------------|--------|-------|
41
+ | SKL-DIS-1 | Purpose and restrictions | discovery-skill.mdc | 8-57 |
42
+ | SKL-DIS-2 | Workflow steps 1-4 (read docs, questions, tracking, requirements) | discovery-skill.mdc | 71-173 |
43
+ | SKL-DIS-3 | Workflow steps 5-8 (tech considerations, approach, risks, generate) | discovery-skill.mdc | 175-256 |
44
+ | SKL-DIS-4 | Validation checklist | discovery-skill.mdc | 270-296 |
45
+
46
+ ### Execute Plan Skill (`execute-plan-skill.mdc`)
47
+
48
+ | Code | Description | Source | Lines |
49
+ |------|-------------|--------|-------|
50
+ | SKL-EXEC-1 | Critical rules (build only at end, no DB commands) | execute-plan-skill.mdc | 22-95 |
51
+ | SKL-EXEC-2 | Workflow steps 1-3 (parse, analyze complexity, present summary) | execute-plan-skill.mdc | 105-182 |
52
+ | SKL-EXEC-3 | Workflow steps 4-5 (execute phases with Plan mode, update progress) | execute-plan-skill.mdc | 184-238 |
53
+ | SKL-EXEC-4 | Workflow steps 6-7 (tests phase, completion/verification) | execute-plan-skill.mdc | 240-281 |
54
+ | SKL-EXEC-5 | Complexity-based behavior (low, medium, high, very high) | execute-plan-skill.mdc | 303-332 |
55
+ | SKL-EXEC-6 | Error handling (build failures, test failures, cancellation) | execute-plan-skill.mdc | 334-366 |
56
+
57
+ ### Review Code Skill (`review-code-skill.mdc`)
58
+
59
+ | Code | Description | Source | Lines |
60
+ |------|-------------|--------|-------|
61
+ | SKL-REV-1 | Purpose and restrictions (read-only analysis) | review-code-skill.mdc | 8-58 |
62
+ | SKL-REV-2 | Workflow steps 1-3 (identify files, load patterns, find similar) | review-code-skill.mdc | 72-130 |
63
+ | SKL-REV-3 | Workflow steps 4-6 (analyze, pattern conflicts, generate doc) | review-code-skill.mdc | 131-180 |
64
+ | SKL-REV-4 | Severity levels and conflict resolution | review-code-skill.mdc | 182-231 |
65
+ | SKL-REV-5 | Finding similar implementations (search strategies) | review-code-skill.mdc | 233-259 |
66
+
67
+ ### Review PR Skill (`review-pr-skill.mdc`)
68
+
69
+ | Code | Description | Source | Lines |
70
+ |------|-------------|--------|-------|
71
+ | SKL-PR-1 | Purpose and restrictions (GitHub/Azure DevOps commands) | review-pr-skill.mdc | 8-122 |
72
+ | SKL-PR-2 | Workflow (authenticate, fetch, analyze, generate) | review-pr-skill.mdc | 132-217 |
73
+ | SKL-PR-3 | Output format template with review history | review-pr-skill.mdc | 219-318 |
74
+ | SKL-PR-4 | Severity levels and fix complexity scoring | review-pr-skill.mdc | 320-370 |
75
+ | SKL-PR-5 | Link format for GitHub and Azure DevOps | review-pr-skill.mdc | 372-420 |
76
+
77
+ ### Setup Skill (`setup-skill.mdc`)
78
+
79
+ | Code | Description | Source | Lines |
80
+ |------|-------------|--------|-------|
81
+ | SKL-SETUP-1 | Purpose and critical approach | setup-skill.mdc | 8-30 |
82
+ | SKL-SETUP-2 | Steps 1-2 (scan project structure, dependency analysis) | setup-skill.mdc | 34-106 |
83
+ | SKL-SETUP-3 | Step 3 (deep code analysis, sample files, extract patterns) | setup-skill.mdc | 108-200 |
84
+ | SKL-SETUP-4 | Steps 4-5 (research best practices, check existing rules) | setup-skill.mdc | 202-252 |
85
+ | SKL-SETUP-5 | Step 6 (confirming questions via Plan mode) | setup-skill.mdc | 254-334 |
86
+ | SKL-SETUP-6 | Step 7 (generate framework and library pattern files) | setup-skill.mdc | 336-493 |
87
+ | SKL-SETUP-7 | Steps 8-11 (update core, create analysis doc, create flow folder, summary) | setup-skill.mdc | 595-797 |
88
+
89
+ ### Write Tests Skill (`write-tests-skill.mdc`)
90
+
91
+ | Code | Description | Source | Lines |
92
+ |------|-------------|--------|-------|
93
+ | SKL-TEST-1 | Purpose and inputs | write-tests-skill.mdc | 8-24 |
94
+ | SKL-TEST-2 | Workflow steps 1-3 (detect framework, coverage analysis, work queue) | write-tests-skill.mdc | 26-78 |
95
+ | SKL-TEST-3 | Step 4 (analyze source, write/improve tests, verify coverage) | write-tests-skill.mdc | 80-150 |
96
+ | SKL-TEST-4 | Step 5 and test writing guidelines | write-tests-skill.mdc | 152-202 |
97
+ | SKL-TEST-5 | Output format and final report | write-tests-skill.mdc | 232-283 |
98
+
99
+ ---
100
+
101
+ ## When to Expand
102
+
103
+ ### Discovery and Planning
104
+
105
+ | Code | Expand When |
106
+ |------|-------------|
107
+ | SKL-DIS-1 | Need discovery restrictions/allowed actions |
108
+ | SKL-DIS-2 | Need question tracking and requirements gathering workflow |
109
+ | SKL-PLN-2 | Need phase structuring and complexity scoring workflow |
110
+ | SKL-PLN-3 | Need plan output template |
111
+
112
+ ### Execution
113
+
114
+ | Code | Expand When |
115
+ |------|-------------|
116
+ | SKL-EXEC-1 | Need critical rules (build timing, DB commands) |
117
+ | SKL-EXEC-2 | Need complexity analysis and grouping logic |
118
+ | SKL-EXEC-3 | Need phase execution workflow with Plan mode |
119
+ | SKL-EXEC-5 | Need complexity-based behavior details |
120
+
121
+ ### Code Review
122
+
123
+ | Code | Expand When |
124
+ |------|-------------|
125
+ | SKL-REV-2 | Need pattern loading and similar implementation search |
126
+ | SKL-REV-4 | Need severity levels and conflict resolution |
127
+ | SKL-PR-3 | Need PR review output template |
128
+ | SKL-PR-5 | Need link format for GitHub/Azure DevOps |
129
+
130
+ ### Setup and Testing
131
+
132
+ | Code | Expand When |
133
+ |------|-------------|
134
+ | SKL-SETUP-2 | Need dependency detection tables |
135
+ | SKL-SETUP-6 | Need pattern file generation templates |
136
+ | SKL-TEST-2 | Need coverage analysis workflow |
137
+ | SKL-TEST-4 | Need test writing guidelines |
138
+
139
+ ### Contracts
140
+
141
+ | Code | Expand When |
142
+ |------|-------------|
143
+ | SKL-CON-2 | Need contract creation workflow |
144
+ | SKL-CON-3 | Need contract output template |
145
+
146
+ ---
147
+
148
+ ## Quick Reference by Command
149
+
150
+ | Command | Skill | Key Codes |
151
+ |---------|-------|-----------|
152
+ | `/discovery-plan` | discovery-skill | SKL-DIS-1 through SKL-DIS-4 |
153
+ | `/create-plan` | create-plan-skill | SKL-PLN-1 through SKL-PLN-4 |
154
+ | `/execute-plan` | execute-plan-skill | SKL-EXEC-1 through SKL-EXEC-6 |
155
+ | `/review-code` | review-code-skill | SKL-REV-1 through SKL-REV-5 |
156
+ | `/review-pr` | review-pr-skill | SKL-PR-1 through SKL-PR-5 |
157
+ | `/setup` | setup-skill | SKL-SETUP-1 through SKL-SETUP-7 |
158
+ | `/write-tests` | write-tests-skill | SKL-TEST-1 through SKL-TEST-5 |
159
+ | `/create-contract` | create-contract-skill | SKL-CON-1 through SKL-CON-4 |
160
+
161
+ ---
162
+
163
+ ## Skill Complexity
164
+
165
+ | Skill | Lines | Sections | Complexity |
166
+ |-------|-------|----------|------------|
167
+ | setup-skill | 821 | 7 | Highest - deep project analysis |
168
+ | review-pr-skill | 496 | 5 | High - multi-platform support |
169
+ | execute-plan-skill | 388 | 6 | High - phase execution logic |
170
+ | review-code-skill | 308 | 5 | Medium - pattern matching |
171
+ | discovery-skill | 295 | 4 | Medium - requirements gathering |
172
+ | write-tests-skill | 294 | 5 | Medium - iterative testing |
173
+ | create-plan-skill | 271 | 4 | Low - plan structuring |
174
+ | create-contract-skill | 239 | 4 | Low - contract generation |
@@ -0,0 +1,239 @@
1
+ ---
2
+ description: "Include when /create-contract is invoked or integration contract creation from documentation URLs is needed"
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Create Contract Skill
7
+
8
+ ## Purpose
9
+
10
+ Create an **integration contract document** by fetching information from a documentation URL or analyzing a project repository. The contract captures all necessary details for frontend integration including endpoints, schemas, authentication, and usage patterns.
11
+
12
+ This skill **only produces a markdown file** in `flow/contracts/`. It does NOT:
13
+
14
+ - Write any code
15
+ - Implement any integrations
16
+ - Modify source files
17
+ - Execute any implementation
18
+
19
+ ---
20
+
21
+ ## Restrictions - CONTRACT CREATION ONLY
22
+
23
+ This skill is **strictly for creating contract documents**. The process:
24
+
25
+ 1. **Fetches** information from the source URL
26
+ 2. **Analyzes** the API structure and schemas
27
+ 3. **Asks** clarifying questions via Interactive Questions Tool
28
+ 4. **Generates** a contract markdown file
29
+
30
+ **No code, no implementation, no source file modifications.**
31
+
32
+ ### NEVER Do These Actions
33
+
34
+ | Forbidden Action | Reason |
35
+ | -------------------------------------- | ----------------------------------- |
36
+ | Create/edit source code files | Contract creation only |
37
+ | Write implementation code | Contracts describe, not implement |
38
+ | Modify configuration files | No codebase changes |
39
+ | Run build or test commands | No execution commands |
40
+ | Create files outside `flow/contracts/` | Only write contract documents |
41
+
42
+ ### Allowed Actions
43
+
44
+ | Allowed Action | Purpose |
45
+ | -------------------------------------- | ------------------------------------ |
46
+ | Use Web Search tool | Fetch documentation from URLs |
47
+ | Read repository files | Analyze API structure |
48
+ | Use Interactive Questions Tool | Gather requirements from user |
49
+ | Write to `flow/contracts/` | Save contract document |
50
+ | Read project rule files | Understand patterns to follow |
51
+
52
+ > **Important**: The ONLY writable location is `flow/contracts/`. No source code or other files should be modified.
53
+
54
+ ---
55
+
56
+ ## Inputs
57
+
58
+ | Input | Required | Description |
59
+ | ------------- | -------- | ---------------------------------------------------- |
60
+ | `source_url` | Yes | Documentation URL or repository URL |
61
+ | `description` | Yes | What the user wants to integrate on the frontend |
62
+
63
+ ---
64
+
65
+ ## Workflow
66
+
67
+ ### Step 1: Detect Source Type
68
+
69
+ Analyze the provided URL to determine the source type:
70
+
71
+ | Source Type | Detection |
72
+ | ---------------- | ---------------------------------------------- |
73
+ | Documentation | Contains `/docs`, `/api`, swagger, openapi |
74
+ | Repository | Contains github.com, gitlab.com, bitbucket.org |
75
+ | OpenAPI Spec | Ends with `.json`, `.yaml`, `/swagger` |
76
+
77
+ ---
78
+
79
+ ### Step 2A: Handle Documentation URL
80
+
81
+ If the source is a documentation URL:
82
+
83
+ 1. Use Web Search tool to fetch documentation content
84
+ 2. Extract key information:
85
+ - API endpoints
86
+ - Request/response schemas
87
+ - Authentication methods
88
+ - Error formats
89
+ - Rate limits
90
+
91
+ ---
92
+
93
+ ### Step 2B: Handle Repository URL
94
+
95
+ If the source is a repository URL:
96
+
97
+ 1. Analyze repository structure
98
+ 2. Identify relevant files:
99
+ - API route definitions
100
+ - Type definitions
101
+ - Schema files
102
+ - README/docs
103
+ 3. Read and extract key information
104
+
105
+ ---
106
+
107
+ ### Step 3: Ask Clarifying Questions
108
+
109
+ **Use Interactive Questions Tool** to gather requirements.
110
+
111
+ Follow `.cursor/rules/tools/interactive-questions-tool.mdc`:
112
+
113
+ 1. Call `SwitchMode` tool to enter Plan mode
114
+ 2. Call `AskQuestion` tool for each question about:
115
+ - **Scope**: Which specific endpoints/features are needed?
116
+ - **Authentication**: How will the FE authenticate?
117
+ - **Error Handling**: How should the FE handle errors?
118
+ - **Caching**: Any caching requirements?
119
+ 3. Wait for all responses
120
+ 4. Call `SwitchMode` tool to return to Agent mode
121
+ 5. Document answers for use in the contract document
122
+
123
+ ---
124
+
125
+ ### Step 4: Generate Contract Document
126
+
127
+ Create the contract with all gathered information:
128
+
129
+ **Location**: `flow/contracts/<service_name>_contract.md`
130
+
131
+ **Required Sections**:
132
+
133
+ 1. Overview
134
+ 2. Authentication
135
+ 3. Endpoints (with request/response schemas)
136
+ 4. Error Handling
137
+ 5. Integration Notes
138
+ 6. Usage Examples
139
+
140
+ ---
141
+
142
+ ## Output Format
143
+
144
+ ### Contract Template
145
+
146
+ ```markdown
147
+ # Integration Contract: [Service Name]
148
+
149
+ ## Overview
150
+
151
+ **Source**: [URL]
152
+ **Description**: [What this integration provides]
153
+ **Version**: [API version if applicable]
154
+
155
+ ## Authentication
156
+
157
+ **Method**: [Bearer token, API key, OAuth, etc.]
158
+ **Header**: [Authorization header format]
159
+ **Token Source**: [Where FE gets the token]
160
+
161
+ ## Endpoints
162
+
163
+ ### [Endpoint Name]
164
+
165
+ **Method**: [GET/POST/PUT/DELETE]
166
+ **URL**: [Endpoint URL]
167
+ **Description**: [What this endpoint does]
168
+
169
+ **Request**:
170
+ ```typescript
171
+ interface RequestBody {
172
+ // Request schema
173
+ }
174
+ ```
175
+
176
+ **Response**:
177
+ ```typescript
178
+ interface Response {
179
+ // Response schema
180
+ }
181
+ ```
182
+
183
+ **Example**:
184
+ ```bash
185
+ curl -X POST /api/endpoint \
186
+ -H "Authorization: Bearer token" \
187
+ -d '{"field": "value"}'
188
+ ```
189
+
190
+ ## Error Handling
191
+
192
+ | Status Code | Meaning | FE Action |
193
+ | ----------- | -------------------- | ------------------------- |
194
+ | 400 | Bad Request | Show validation error |
195
+ | 401 | Unauthorized | Redirect to login |
196
+ | 404 | Not Found | Show not found message |
197
+ | 500 | Server Error | Show generic error |
198
+
199
+ ## Integration Notes
200
+
201
+ ### Rate Limits
202
+ [Any rate limiting information]
203
+
204
+ ### Caching
205
+ [Caching recommendations]
206
+
207
+ ### Pagination
208
+ [Pagination format if applicable]
209
+
210
+ ## Usage Examples
211
+
212
+ ### [Use Case 1]
213
+ [Code example or description]
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Validation Checklist
219
+
220
+ Before completing the contract, verify:
221
+
222
+ - [ ] Contract is saved in `flow/contracts/` folder
223
+ - [ ] File uses naming: `<service_name>_contract.md`
224
+ - [ ] All requested endpoints are documented
225
+ - [ ] Authentication method is clear
226
+ - [ ] Request/response schemas are defined
227
+ - [ ] Error handling is documented
228
+ - [ ] **NO implementation code is included**
229
+ - [ ] **NO source files were created or modified**
230
+
231
+ ---
232
+
233
+ ## Related Files
234
+
235
+ | File | Purpose |
236
+ | -------------------------------------------------- | --------------------------------- |
237
+ | `.cursor/rules/patterns/contract-patterns.mdc` | Rules and patterns for contracts |
238
+ | `.cursor/rules/tools/interactive-questions-tool.mdc` | Interactive Questions workflow |
239
+ | `flow/contracts/` | Output folder for contracts |
@@ -0,0 +1,271 @@
1
+ ---
2
+ description: "Include when /create-plan is invoked or implementation planning from discovery documents is needed"
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Create Plan Skill
7
+
8
+ ## Purpose
9
+
10
+ Create a structured **implementation plan** with phases, complexity scores, and tasks based on a discovery document or user requirements.
11
+
12
+ This skill **only produces a markdown file** in `flow/plans/`. It does NOT:
13
+
14
+ - Write any code
15
+ - Execute any implementation
16
+ - Modify source files
17
+ - Run build or test commands
18
+
19
+ ---
20
+
21
+ ## Restrictions - PLANNING ONLY
22
+
23
+ This skill is **strictly for creating plan documents**. The process:
24
+
25
+ 1. **Reads** the discovery document or gathers requirements
26
+ 2. **Analyzes** complexity and scope
27
+ 3. **Structures** phases with complexity scores
28
+ 4. **Generates** a plan markdown file
29
+
30
+ **No code, no implementation, no source file modifications.**
31
+
32
+ ### NEVER Do These Actions
33
+
34
+ | Forbidden Action | Reason |
35
+ | ----------------------------------- | -------------------------------- |
36
+ | Create/edit source code files | Planning only, no implementation |
37
+ | Write implementation code | Plans describe what, not how |
38
+ | Execute any plan phases | Use /execute-plan for that |
39
+ | Run build or test commands | No execution commands |
40
+ | Create files outside `flow/plans/` | Only write plan documents |
41
+
42
+ ### Allowed Actions
43
+
44
+ | Allowed Action | Purpose |
45
+ | -------------------------------------- | --------------------------------- |
46
+ | Read discovery documents | Extract requirements |
47
+ | Read any project file | Understand existing codebase |
48
+ | Search codebase (grep, glob, semantic) | Find existing patterns |
49
+ | Write to `flow/plans/` | Save plan document |
50
+ | Read project rule files | Understand patterns to follow |
51
+
52
+ > **Important**: The ONLY writable location is `flow/plans/`. No source code or other files should be modified.
53
+
54
+ ---
55
+
56
+ ## Inputs
57
+
58
+ | Input | Required | Description |
59
+ | -------------------- | -------- | -------------------------------------------------- |
60
+ | `discovery_document` | Optional | Path to discovery document (recommended) |
61
+ | `feature_name` | Yes | Name of the feature to plan |
62
+ | `requirements` | Optional | Direct requirements if no discovery document |
63
+ | `version` | Optional | Version number (auto-incremented if not provided) |
64
+
65
+ ---
66
+
67
+ ## Workflow
68
+
69
+ ### Step 1: Extract Requirements
70
+
71
+ **If discovery document was provided**:
72
+
73
+ 1. Read the discovery document
74
+ 2. Extract feature name, description, goals from the document
75
+ 3. Extract FR, NFR, Constraints
76
+ 4. Note any risks identified
77
+
78
+ **If no discovery document**:
79
+
80
+ 1. Use requirements provided directly
81
+ 2. Note that discovery was skipped
82
+
83
+ ---
84
+
85
+ ### Step 2: Analyze Scope and Complexity
86
+
87
+ Based on extracted requirements:
88
+
89
+ 1. Identify the major components/areas of work
90
+ 2. Group related tasks into logical phases
91
+ 3. Estimate complexity for each phase using `.cursor/rules/core/complexity-scoring.mdc`
92
+
93
+ ---
94
+
95
+ ### Step 3: Structure Phases
96
+
97
+ Create phases following these guidelines:
98
+
99
+ **Phase Structure**:
100
+
101
+ ```markdown
102
+ ### Phase X: [Phase Name]
103
+
104
+ **Scope**: [What this phase covers]
105
+ **Complexity**: X/10
106
+
107
+ - [ ] Task 1
108
+ - [ ] Task 2
109
+
110
+ **Build Verification**: Run `npm run build`
111
+ ```
112
+
113
+ **Standard Phase Order**:
114
+
115
+ 1. Types and Schemas (usually low complexity)
116
+ 2. Backend/API Implementation
117
+ 3. Store/State Management
118
+ 4. UI Components
119
+ 5. Integration
120
+ 6. Tests (ALWAYS last)
121
+
122
+ **Complexity Scoring** (per `.cursor/rules/core/complexity-scoring.mdc`):
123
+
124
+ | Score | Level | Description |
125
+ | ----- | --------- | -------------------------------- |
126
+ | 0-2 | Trivial | Simple, mechanical changes |
127
+ | 3-4 | Low | Straightforward implementation |
128
+ | 5-6 | Medium | Moderate effort, some decisions |
129
+ | 7-8 | High | Complex, multiple considerations |
130
+ | 9-10 | Very High | Significant complexity/risk |
131
+
132
+ ---
133
+
134
+ ### Step 4: Add Key Changes Summary
135
+
136
+ Document the most important modifications:
137
+
138
+ ```markdown
139
+ ## Key Changes
140
+
141
+ 1. **[Category]**: [Description of change]
142
+ 2. **[Category]**: [Description of change]
143
+ ```
144
+
145
+ ---
146
+
147
+ ### Step 5: Generate Plan Document
148
+
149
+ Create the plan markdown file:
150
+
151
+ **Location**: `flow/plans/plan_<feature_name>_v<version>.md`
152
+
153
+ **Use Template**: See `.cursor/rules/patterns/plans-templates.mdc`
154
+
155
+ **Required Sections**:
156
+
157
+ 1. Overview (with discovery document reference)
158
+ 2. Goals
159
+ 3. Non-Goals
160
+ 4. Requirements Summary (FR, NFR, Constraints)
161
+ 5. Risks
162
+ 6. Phases (with complexity scores)
163
+ 7. Key Changes
164
+
165
+ ---
166
+
167
+ ## Output Format
168
+
169
+ The plan document should follow the template in `.cursor/rules/patterns/plans-templates.mdc`.
170
+
171
+ **Naming Convention**: `plan_<feature_name>_v<version>.md`
172
+
173
+ **Examples**:
174
+ - `plan_user_authentication_v1.md`
175
+ - `plan_dark_mode_v2.md`
176
+
177
+ ---
178
+
179
+ ## Plan Template
180
+
181
+ ```markdown
182
+ # Plan: [Feature Name]
183
+
184
+ ## Overview
185
+
186
+ [Brief description of the feature and its purpose]
187
+
188
+ **Based on Discovery**: `flow/discovery/discovery_<feature>_v1.md` (or "Discovery skipped")
189
+
190
+ ## Goals
191
+
192
+ - [Goal 1]
193
+ - [Goal 2]
194
+
195
+ ## Non-Goals
196
+
197
+ - [What this plan explicitly does NOT cover]
198
+
199
+ ## Requirements Summary
200
+
201
+ ### Functional Requirements
202
+
203
+ - [FR-1]: [Description]
204
+
205
+ ### Non-Functional Requirements
206
+
207
+ - [NFR-1]: [Description]
208
+
209
+ ### Constraints
210
+
211
+ - [C-1]: [Description]
212
+
213
+ ## Risks
214
+
215
+ | Risk | Impact | Mitigation |
216
+ | -------- | --------------- | --------------------- |
217
+ | [Risk 1] | High/Medium/Low | [Mitigation strategy] |
218
+
219
+ ## Phases
220
+
221
+ ### Phase 1: [Phase Name]
222
+
223
+ **Scope**: [What this phase covers]
224
+ **Complexity**: X/10
225
+
226
+ - [ ] Task 1
227
+ - [ ] Task 2
228
+
229
+ **Build Verification**: Run `npm run build`
230
+
231
+ ### Phase N: Tests (Final)
232
+
233
+ **Scope**: Write comprehensive tests
234
+ **Complexity**: X/10
235
+
236
+ - [ ] Unit tests
237
+ - [ ] Integration tests
238
+
239
+ **Build Verification**: Run `npm run build && npm run test`
240
+
241
+ ## Key Changes
242
+
243
+ 1. **[Category]**: [Description]
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Validation Checklist
249
+
250
+ Before completing the plan, verify:
251
+
252
+ - [ ] Plan is saved in `flow/plans/` folder
253
+ - [ ] File uses snake_case naming: `plan_<feature>_v<version>.md`
254
+ - [ ] All phases have complexity scores (X/10)
255
+ - [ ] Tests are the LAST phase
256
+ - [ ] Key Changes section is populated
257
+ - [ ] Discovery document is referenced (or noted as skipped)
258
+ - [ ] **NO implementation code is included**
259
+ - [ ] **NO source files were created or modified**
260
+
261
+ ---
262
+
263
+ ## Related Files
264
+
265
+ | File | Purpose |
266
+ | ---------------------------------------------- | -------------------------------- |
267
+ | `.cursor/rules/patterns/plans-patterns.mdc` | Rules and patterns for plans |
268
+ | `.cursor/rules/patterns/plans-templates.mdc` | Plan templates |
269
+ | `.cursor/rules/core/complexity-scoring.mdc` | Complexity scoring system |
270
+ | `flow/plans/` | Output folder for plan documents |
271
+ | `flow/discovery/` | Input discovery documents |