@onion-ai/cli 1.0.0-beta.1

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 (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +529 -0
  3. package/bin/onion.js +6 -0
  4. package/framework/CLAUDE.md +45 -0
  5. package/framework/VERSION +1 -0
  6. package/framework/agents/compliance/iso-22301-specialist.md +985 -0
  7. package/framework/agents/compliance/iso-27001-specialist.md +713 -0
  8. package/framework/agents/compliance/pmbok-specialist.md +739 -0
  9. package/framework/agents/compliance/security-information-master.md +907 -0
  10. package/framework/agents/compliance/soc2-specialist.md +889 -0
  11. package/framework/agents/deployment/docker-specialist.md +1192 -0
  12. package/framework/agents/development/c4-architecture-specialist.md +745 -0
  13. package/framework/agents/development/c4-documentation-specialist.md +695 -0
  14. package/framework/agents/development/clickup-specialist.md +396 -0
  15. package/framework/agents/development/cursor-specialist.md +277 -0
  16. package/framework/agents/development/docs-reverse-engineer.md +417 -0
  17. package/framework/agents/development/gamma-api-specialist.md +1168 -0
  18. package/framework/agents/development/gitflow-specialist.md +1206 -0
  19. package/framework/agents/development/linux-security-specialist.md +675 -0
  20. package/framework/agents/development/mermaid-specialist.md +515 -0
  21. package/framework/agents/development/nodejs-specialist.md +672 -0
  22. package/framework/agents/development/nx-migration-specialist.md +866 -0
  23. package/framework/agents/development/nx-monorepo-specialist.md +618 -0
  24. package/framework/agents/development/postgres-specialist.md +1123 -0
  25. package/framework/agents/development/react-developer.md +131 -0
  26. package/framework/agents/development/runflow-specialist.md +277 -0
  27. package/framework/agents/development/system-documentation-orchestrator.md +1387 -0
  28. package/framework/agents/development/task-specialist.md +677 -0
  29. package/framework/agents/git/branch-code-reviewer.md +225 -0
  30. package/framework/agents/git/branch-documentation-writer.md +161 -0
  31. package/framework/agents/git/branch-metaspec-checker.md +67 -0
  32. package/framework/agents/git/branch-test-planner.md +176 -0
  33. package/framework/agents/meta/agent-creator-specialist.md +1266 -0
  34. package/framework/agents/meta/command-creator-specialist.md +1676 -0
  35. package/framework/agents/meta/metaspec-gate-keeper.md +240 -0
  36. package/framework/agents/meta/onion.md +824 -0
  37. package/framework/agents/product/branding-positioning-specialist.md +1029 -0
  38. package/framework/agents/product/extract-meeting-specialist.md +394 -0
  39. package/framework/agents/product/meeting-consolidator.md +482 -0
  40. package/framework/agents/product/pain-price-specialist.md +508 -0
  41. package/framework/agents/product/presentation-orchestrator.md +1190 -0
  42. package/framework/agents/product/product-agent.md +201 -0
  43. package/framework/agents/product/story-points-framework-specialist.md +538 -0
  44. package/framework/agents/product/storytelling-business-specialist.md +890 -0
  45. package/framework/agents/research/research-agent.md +292 -0
  46. package/framework/agents/review/code-reviewer.md +154 -0
  47. package/framework/agents/review/corporate-compliance-specialist.md +370 -0
  48. package/framework/agents/testing/test-agent.md +424 -0
  49. package/framework/agents/testing/test-engineer.md +294 -0
  50. package/framework/agents/testing/test-planner.md +117 -0
  51. package/framework/commands/common/prompts/README.md +208 -0
  52. package/framework/commands/common/prompts/clickup-patterns.md +144 -0
  53. package/framework/commands/common/prompts/code-review-checklist.md +168 -0
  54. package/framework/commands/common/prompts/git-workflow-patterns.md +235 -0
  55. package/framework/commands/common/prompts/output-formats.md +240 -0
  56. package/framework/commands/common/prompts/technical.md +194 -0
  57. package/framework/commands/common/templates/abstraction-template.md +399 -0
  58. package/framework/commands/common/templates/agent-template.md +353 -0
  59. package/framework/commands/common/templates/business_context_template.md +748 -0
  60. package/framework/commands/common/templates/command-template.md +273 -0
  61. package/framework/commands/common/templates/technical_context_template.md +526 -0
  62. package/framework/commands/design/screen-spec.md +505 -0
  63. package/framework/commands/development/runflow-dev.md +465 -0
  64. package/framework/commands/docs/build-business-docs.md +299 -0
  65. package/framework/commands/docs/build-compliance-docs.md +143 -0
  66. package/framework/commands/docs/build-index.md +119 -0
  67. package/framework/commands/docs/build-tech-docs.md +221 -0
  68. package/framework/commands/docs/docs-health.md +141 -0
  69. package/framework/commands/docs/help.md +278 -0
  70. package/framework/commands/docs/refine-vision.md +25 -0
  71. package/framework/commands/docs/reverse-consolidate.md +158 -0
  72. package/framework/commands/docs/sync-sessions.md +354 -0
  73. package/framework/commands/docs/validate-docs.md +157 -0
  74. package/framework/commands/engineer/bump.md +29 -0
  75. package/framework/commands/engineer/docs.md +11 -0
  76. package/framework/commands/engineer/hotfix.md +183 -0
  77. package/framework/commands/engineer/plan.md +85 -0
  78. package/framework/commands/engineer/pr-update.md +219 -0
  79. package/framework/commands/engineer/pr.md +117 -0
  80. package/framework/commands/engineer/pre-pr.md +81 -0
  81. package/framework/commands/engineer/start.md +254 -0
  82. package/framework/commands/engineer/validate-phase-sync.md +134 -0
  83. package/framework/commands/engineer/warm-up.md +20 -0
  84. package/framework/commands/engineer/work.md +155 -0
  85. package/framework/commands/f/company-context-extractor.md +93 -0
  86. package/framework/commands/f/process-meetings.md +103 -0
  87. package/framework/commands/git/README.md +682 -0
  88. package/framework/commands/git/code-review.md +213 -0
  89. package/framework/commands/git/fast-commit.md +43 -0
  90. package/framework/commands/git/feature/finish.md +88 -0
  91. package/framework/commands/git/feature/publish.md +89 -0
  92. package/framework/commands/git/feature/start.md +172 -0
  93. package/framework/commands/git/help.md +100 -0
  94. package/framework/commands/git/hotfix/finish.md +96 -0
  95. package/framework/commands/git/hotfix/start.md +92 -0
  96. package/framework/commands/git/init.md +111 -0
  97. package/framework/commands/git/release/finish.md +96 -0
  98. package/framework/commands/git/release/start.md +93 -0
  99. package/framework/commands/git/sync.md +199 -0
  100. package/framework/commands/meta/all-tools.md +58 -0
  101. package/framework/commands/meta/analyze-complex-problem.md +186 -0
  102. package/framework/commands/meta/create-abstraction.md +882 -0
  103. package/framework/commands/meta/create-agent-express.md +98 -0
  104. package/framework/commands/meta/create-agent.md +210 -0
  105. package/framework/commands/meta/create-command.md +203 -0
  106. package/framework/commands/meta/create-knowledge-base.md +143 -0
  107. package/framework/commands/meta/create-task-structure.md +150 -0
  108. package/framework/commands/meta/setup-integration.md +274 -0
  109. package/framework/commands/onion.md +169 -0
  110. package/framework/commands/product/README.md +249 -0
  111. package/framework/commands/product/analyze-pain-price.md +694 -0
  112. package/framework/commands/product/branding.md +458 -0
  113. package/framework/commands/product/check.md +46 -0
  114. package/framework/commands/product/checklist-sync.md +239 -0
  115. package/framework/commands/product/collect.md +95 -0
  116. package/framework/commands/product/consolidate-meetings.md +291 -0
  117. package/framework/commands/product/estimate.md +511 -0
  118. package/framework/commands/product/extract-meeting.md +226 -0
  119. package/framework/commands/product/feature.md +416 -0
  120. package/framework/commands/product/light-arch.md +82 -0
  121. package/framework/commands/product/presentation.md +174 -0
  122. package/framework/commands/product/refine.md +161 -0
  123. package/framework/commands/product/spec.md +79 -0
  124. package/framework/commands/product/task-check.md +378 -0
  125. package/framework/commands/product/task.md +603 -0
  126. package/framework/commands/product/validate-task.md +325 -0
  127. package/framework/commands/product/warm-up.md +24 -0
  128. package/framework/commands/quick/analisys.md +17 -0
  129. package/framework/commands/test/e2e.md +377 -0
  130. package/framework/commands/test/integration.md +508 -0
  131. package/framework/commands/test/unit.md +381 -0
  132. package/framework/commands/validate/collab/pair-testing.md +657 -0
  133. package/framework/commands/validate/collab/three-amigos.md +534 -0
  134. package/framework/commands/validate/qa-points/estimate.md +660 -0
  135. package/framework/commands/validate/test-strategy/analyze.md +1201 -0
  136. package/framework/commands/validate/test-strategy/create.md +411 -0
  137. package/framework/commands/validate/workflow.md +370 -0
  138. package/framework/commands/warm-up.md +20 -0
  139. package/framework/docs/architecture/acoplamento-clickup-problema-analise.md +468 -0
  140. package/framework/docs/architecture/desacoplamento-roadmap.md +364 -0
  141. package/framework/docs/architecture/validacao-fase-1.md +235 -0
  142. package/framework/docs/c4/c4-detection-rules.md +395 -0
  143. package/framework/docs/c4/c4-documentation-templates.md +579 -0
  144. package/framework/docs/c4/c4-mermaid-patterns.md +331 -0
  145. package/framework/docs/c4/c4-templates.md +256 -0
  146. package/framework/docs/clickup/clickup-acceptance-criteria-strategy.md +329 -0
  147. package/framework/docs/clickup/clickup-auto-update-strategy.md +340 -0
  148. package/framework/docs/clickup/clickup-comment-formatter.md +239 -0
  149. package/framework/docs/clickup/clickup-description-fix.md +384 -0
  150. package/framework/docs/clickup/clickup-dual-comment-strategy.md +528 -0
  151. package/framework/docs/clickup/clickup-formatting.md +302 -0
  152. package/framework/docs/clickup/separador-tamanho-otimizado.md +258 -0
  153. package/framework/docs/engineer/pre-pr-acceptance-validation.md +256 -0
  154. package/framework/docs/onion/ESPERANTO.md +293 -0
  155. package/framework/docs/onion/agents-reference.md +832 -0
  156. package/framework/docs/onion/clickup-integration.md +780 -0
  157. package/framework/docs/onion/commands-guide.md +924 -0
  158. package/framework/docs/onion/engineering-flows.md +900 -0
  159. package/framework/docs/onion/getting-started.md +803 -0
  160. package/framework/docs/onion/maintenance-checklist.md +421 -0
  161. package/framework/docs/onion/naming-conventions.md +286 -0
  162. package/framework/docs/onion/practical-examples.md +854 -0
  163. package/framework/docs/product/story-points-integration.md +269 -0
  164. package/framework/docs/product/story-points-validation.md +237 -0
  165. package/framework/docs/reviews/task-manager-docs-review-2025-11-24.md +184 -0
  166. package/framework/docs/strategies/clickup-comment-patterns.md +766 -0
  167. package/framework/docs/strategies/clickup-integration-tests.md +602 -0
  168. package/framework/docs/strategies/clickup-mcp-wrappers-tests.md +888 -0
  169. package/framework/docs/strategies/clickup-regression-tests.md +587 -0
  170. package/framework/docs/strategies/visual-patterns.md +315 -0
  171. package/framework/docs/templates/README.md +649 -0
  172. package/framework/docs/templates/adr-template.md +226 -0
  173. package/framework/docs/templates/analysis-template.md +280 -0
  174. package/framework/docs/templates/execution-plan-template.md +430 -0
  175. package/framework/docs/templates/guide-template.md +367 -0
  176. package/framework/docs/templates/phase-execution-prompt-template.md +504 -0
  177. package/framework/docs/templates/reference-template.md +522 -0
  178. package/framework/docs/templates/solution-template.md +390 -0
  179. package/framework/docs/tools/README.md +356 -0
  180. package/framework/docs/tools/agents.md +365 -0
  181. package/framework/docs/tools/commands.md +669 -0
  182. package/framework/docs/tools/cursor.md +539 -0
  183. package/framework/docs/tools/mcps.md +937 -0
  184. package/framework/docs/tools/rules.md +461 -0
  185. package/framework/rules/language-and-documentation.mdc +371 -0
  186. package/framework/rules/nestjs-controllers.md +83 -0
  187. package/framework/rules/nestjs-dtos.md +255 -0
  188. package/framework/rules/nestjs-modules.md +141 -0
  189. package/framework/rules/nestjs-services.md +230 -0
  190. package/framework/rules/nx-rules.mdc +41 -0
  191. package/framework/rules/onion-patterns.mdc +197 -0
  192. package/framework/skills/codebase-visualizer/SKILL.md +26 -0
  193. package/framework/skills/codebase-visualizer/scripts/visualize.py +131 -0
  194. package/framework/skills/collect/SKILL.md +84 -0
  195. package/framework/skills/create-rule/SKILL.md +152 -0
  196. package/framework/skills/db-schema-visualizer/SKILL.md +49 -0
  197. package/framework/skills/db-schema-visualizer/scripts/visualize.py +1191 -0
  198. package/framework/skills/sync-meetings/SKILL.md +239 -0
  199. package/framework/utils/clickup-mcp-wrappers.md +744 -0
  200. package/framework/utils/date-time-standards.md +200 -0
  201. package/framework/utils/task-manager/README.md +94 -0
  202. package/framework/utils/task-manager/adapters/asana.md +377 -0
  203. package/framework/utils/task-manager/adapters/clickup.md +467 -0
  204. package/framework/utils/task-manager/adapters/linear.md +421 -0
  205. package/framework/utils/task-manager/detector.md +299 -0
  206. package/framework/utils/task-manager/factory.md +363 -0
  207. package/framework/utils/task-manager/interface.md +248 -0
  208. package/framework/utils/task-manager/types.md +409 -0
  209. package/package.json +41 -0
  210. package/src/cli.js +73 -0
  211. package/src/commands/doctor.js +191 -0
  212. package/src/commands/init.js +287 -0
  213. package/src/commands/install.js +261 -0
  214. package/src/commands/list.js +152 -0
  215. package/src/commands/uninstall.js +90 -0
  216. package/src/commands/update.js +26 -0
  217. package/src/utils/fs.js +89 -0
  218. package/src/utils/log.js +35 -0
  219. package/src/utils/paths.js +32 -0
  220. package/src/utils/prompt.js +76 -0
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: start
3
+ description: |
4
+ Start feature development. Creates session and analyzes tasks.
5
+ Supports multiple task managers via TASK_MANAGER_PROVIDER.
6
+ model: sonnet
7
+ category: engineer
8
+ tags: [development, workflow, session]
9
+ version: '3.0.0'
10
+ updated: '2025-11-24'
11
+ ---
12
+
13
+ # Engineer Start
14
+
15
+ This is the command to start developing a feature.
16
+
17
+ ## 🔧 Prerequisite: Detect Provider
18
+
19
+ ```typescript
20
+ // Consult .claude/utils/task-manager/detector.md
21
+ const config = detectProvider();
22
+ const taskManager = getTaskManager();
23
+
24
+ // If there's a task-id in the input, validate compatibility
25
+ if (taskId) {
26
+ const validation = validateProviderMatch(taskId, config.provider);
27
+ if (!validation.valid) {
28
+ console.warn(validation.warning);
29
+ // Ask the user how to proceed
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## Configuration
35
+
36
+ - If we're not on a feature branch, ask permission to create one
37
+ - If we're on a feature branch that matches the feature name, we're ready
38
+ - Make sure a folder exists at .claude/sessions/<feature-slug>
39
+ - Ask the user for input for this session (you will receive one or more tasks to work on)
40
+
41
+ ## Analysis
42
+
43
+ Analyze the tasks, parents and children if necessary, and build an initial understanding of what needs to be developed.
44
+
45
+ ### **📋 Analysis via Task Manager:**
46
+
47
+ **IMPORTANT**: Use the abstraction to read tasks regardless of the provider:
48
+
49
+ ```typescript
50
+ // Via abstraction - works for any provider (ClickUp, Asana, Linear)
51
+ const task = await taskManager.getTask(taskId);
52
+ const subtasks = await taskManager.getSubtasks(taskId);
53
+
54
+ // Document in context.md
55
+ console.log(`Provider: ${task.provider}`);
56
+ console.log(`Task: ${task.name}`);
57
+ console.log(`URL: ${task.url}`);
58
+ ```
59
+
60
+ ### **🎲 Story Points Validation (Optional but Recommended):**
61
+
62
+ **CRITICAL:** Before starting development, validate if task has story points estimate:
63
+
64
+ ```typescript
65
+ // Check if task has estimated story points
66
+ const storyPoints = task.customFields?.find(
67
+ (f) => f.name === 'Story Points',
68
+ )?.value;
69
+
70
+ if (!storyPoints || storyPoints === 0) {
71
+ console.warn(`
72
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
+ ⚠️ WARNING: TASK WITHOUT STORY POINTS ESTIMATE
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+
76
+ 📋 Task: ${task.name}
77
+ 🎲 Story Points: Not estimated
78
+
79
+ 💡 RECOMMENDATIONS:
80
+ ∟ Estimate before starting development
81
+ ∟ Use: /product/estimate "${task.name}"
82
+ ∟ Or: @story-points-framework-specialist
83
+
84
+ ⚠️ Continuing without estimate may affect:
85
+ - Sprint planning
86
+ - Velocity tracking
87
+ - Delivery predictability
88
+
89
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
90
+ `);
91
+
92
+ // Ask the user if they want to estimate now
93
+ const shouldEstimate = await askUser(
94
+ 'Do you want to estimate story points now? (y/n)',
95
+ );
96
+
97
+ if (shouldEstimate) {
98
+ // Invoke estimation agent
99
+ await invokeStoryPointsEstimation(task);
100
+ }
101
+ } else if (storyPoints > 13) {
102
+ console.warn(`
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ ⚠️ ALERT: TASK IDENTIFIED AS EPIC
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+
107
+ 📋 Task: ${task.name}
108
+ 🎲 Story Points: ${storyPoints} points
109
+
110
+ 💡 RECOMMENDATIONS:
111
+ ∟ Consider breaking into multiple smaller tasks
112
+ ∟ Use: /product/refine to detail requirements
113
+ ∟ Verify if it really needs to be a single task
114
+
115
+ ⚠️ Tasks > 13 points have:
116
+ - Higher margin of error in estimate
117
+ - Risk of not fitting in sprint
118
+ - Difficulty tracking progress
119
+
120
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
121
+ `);
122
+
123
+ // Ask the user if they want to continue
124
+ const shouldContinue = await askUser('Do you want to continue anyway? (y/n)');
125
+ if (!shouldContinue) {
126
+ console.log(
127
+ '💡 Suggestion: Use /product/refine to detail and break down the task',
128
+ );
129
+ return;
130
+ }
131
+ } else {
132
+ console.log(`
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+ ✅ ESTIMATE VALIDATION
135
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+
137
+ 📋 Task: ${task.name}
138
+ 🎲 Story Points: ${storyPoints} points
139
+
140
+ ✅ Valid estimate for development
141
+
142
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ `);
144
+ }
145
+ ```
146
+
147
+ ### **🔍 Incompatible ID Validation:**
148
+
149
+ If the saved task-id is from a different provider than the configured one:
150
+
151
+ ```
152
+ ⚠️ INCOMPATIBILITY DETECTED
153
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
154
+ Task ID: "86adfe9eb"
155
+ Detected provider: clickup
156
+ Configured provider: asana
157
+
158
+ 💡 Suggested actions:
159
+ 1. Change TASK_MANAGER_PROVIDER to 'clickup' in .env
160
+ 2. Or clear the current session and create a new task
161
+ 3. Run /meta/setup-integration to reconfigure
162
+ ```
163
+
164
+ ### **🔍 Analysis Questions:**
165
+
166
+ Think carefully about what is being requested, make sure you understand exactly: - Why this is being built (context) - What is the expected outcome for this task? (objective) - How it should be built, only directionally, not in detail (approach) - If it requires the use of new APIs/tools, do you understand them? - How should it be tested? - What are the dependencies? - What are the constraints?
167
+
168
+ After reflecting on these questions, formulate the 3-5 most important clarifications needed to complete the task. Ask these questions to the human, while also providing your understanding and suggestions.
169
+
170
+ After getting the human's answers, consider whether you need to ask more questions. If so, ask more questions to the human.
171
+
172
+ Once you have a good understanding of what is being built, save it to the file .claude/sessions/<feature-slug>/context.md and ask the human to review.
173
+
174
+ If the human agrees with your understanding, you can proceed to the next step. Otherwise, continue iterating together until you get explicit approval to move forward.
175
+
176
+ If something you discussed here affects what was written in the requirements, ask the human for permission to edit those requirements and make adjustments.
177
+
178
+ ## Architecture
179
+
180
+ Given your understanding of what will be built, you will now proceed to develop the feature architecture.
181
+
182
+ This is where you will put on your ultra-thinking hat and consider the best path to build the feature, also considering the patterns and best practices of this project.
183
+
184
+ Your architecture document should include: - A high-level overview of the system (before and after the change) - Affected components and their relationships, dependencies - Patterns and best practices that will be maintained or introduced - External dependencies - Constraints and assumptions - Trade-offs and alternatives - List of main files to be edited/created
185
+
186
+ Once you have a good understanding of what is being built, save it to the file .claude/sessions/<feature-slug>/architecture.md and ask the human to review.
187
+
188
+ ## 🔄 **Auto-Update Task Manager**
189
+
190
+ This command **automatically updates** the task when it starts:
191
+
192
+ ### **✅ Automatic Updates ALWAYS:**
193
+
194
+ ```typescript
195
+ // Via abstraction - works for any provider
196
+ if (taskManager.isConfigured && taskId) {
197
+ // Update status
198
+ await taskManager.updateStatus(taskId, 'in_progress');
199
+
200
+ // Add start comment
201
+ await taskManager.addComment(
202
+ taskId,
203
+ `
204
+ 🚀 DEVELOPMENT STARTED
205
+
206
+ ━━━━━━━━━━━━━━━━━━━━━━━━
207
+
208
+ 🏗️ SESSION ACTIVATED:
209
+ ▶ Branch: feature/[slug]
210
+ ▶ Session: .claude/sessions/[slug]/
211
+ ▶ Provider: ${taskManager.provider}
212
+
213
+ 📋 IMPLEMENTATION PLAN:
214
+ ∟ Phase 1: [Description]
215
+ ∟ Phase N: [Description]
216
+
217
+ ━━━━━━━━━━━━━━━━━━━━━━━━
218
+
219
+ ⏰ Started: ${new Date().toISOString()}
220
+ `,
221
+ );
222
+ }
223
+ ```
224
+
225
+ ### **📋 Task Identification:**
226
+
227
+ 1. **Context.md**: Reads task-id from the `.claude/sessions/[slug]/context.md` file
228
+ 2. **Task Manager**: Uses `taskManager.getTask(taskId)` for complete structure
229
+ 3. **🆕 PHASE-SUBTASK MAPPING**: Creates automatic phase→subtask mapping in context.md
230
+ 4. **ID Validation**: Verifies ID compatibility with configured provider
231
+ 5. **Not found**: Asks the user if they should link to a specific task
232
+
233
+ ### **🗺️ REQUIRED: Create Phase-Subtask Mapping**
234
+
235
+ When subtasks exist, the system must **automatically**:
236
+
237
+ 1. **Detect subtasks** via `taskManager.getSubtasks(taskId)`
238
+ 2. **Correlate with phases** from plan.md (by order or name)
239
+ 3. **Save mapping** in context.md for use by `/engineer/work`
240
+ 4. **Validate correlation** and alert if there's a mismatch
241
+
242
+ ## Research
243
+
244
+ If you're not sure how a specific library works, you can use Context7 and Perplexity to search for information about it. So, don't try to guess.
245
+
246
+ ## 🔗 References
247
+
248
+ - Abstraction: `.claude/utils/task-manager/`
249
+ - Detector: `.claude/utils/task-manager/detector.md`
250
+ - Factory: `.claude/utils/task-manager/factory.md`
251
+
252
+ <feature-slug>
253
+ #$ARGUMENTS
254
+ </feature-slug>
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: validate-phase-sync
3
+ description: Validar sincronização entre fases do plan.md e subtasks ClickUp.
4
+ model: sonnet
5
+ category: engineer
6
+ tags: [validation, sync, clickup]
7
+ version: '3.0.0'
8
+ updated: '2025-11-24'
9
+ ---
10
+
11
+ # 🔄 Validate Phase-Subtask Sync
12
+
13
+ Validar e corrigir sincronização automática entre fases do plan.md e status das subtasks no ClickUp. Este comando identifica discrepâncias e corrige status desatualizados.
14
+
15
+ ## 🎯 Funcionalidades
16
+
17
+ ### Validação Automática de Status
18
+
19
+ - Lê todas as fases do plan.md e identifica status atual (Completada ✅, Em Progresso ⏰, Não Iniciada ⏳)
20
+ - Verifica status das subtasks correspondentes no ClickUp via Phase-Subtask Mapping
21
+ - Identifica discrepâncias entre plan.md e ClickUp
22
+ - Gera relatório de inconsistências encontradas
23
+
24
+ ### Correção Automática de Status
25
+
26
+ - Atualiza automaticamente status das subtasks para refletir estado real das fases
27
+ - Adiciona comentários retroativos nas subtasks com timestamp de correção
28
+ - Documenta ações de correção realizadas
29
+ - Valida integridade do mapeamento Phase→Subtask
30
+
31
+ ### Sistema de Alertas Proativo
32
+
33
+ - Alerta quando mapeamento Phase-Subtask está ausente ou incompleto
34
+ - Sugere criação de mapeamento quando detecta subtasks sem correlação
35
+ - Identifica fases órfãs (sem subtask correspondente)
36
+ - Reporta subtasks órfãs (sem fase correspondente)
37
+
38
+ ## 🚀 Como Usar
39
+
40
+ ```bash
41
+ /engineer/validate-phase-sync
42
+ ```
43
+
44
+ ### Exemplos de Casos de Uso
45
+
46
+ ```bash
47
+ /engineer/validate-phase-sync # Validação geral da sessão ativa
48
+ /engineer/validate-phase-sync --fix-all # Corrige todas inconsistências encontradas
49
+ /engineer/validate-phase-sync --report-only # Apenas relatório, não aplica correções
50
+ ```
51
+
52
+ ## 🤝 Integração ClickUp MCP
53
+
54
+ ### Operações Automáticas
55
+
56
+ - **Leitura de Task**: Usa `get_task` com `subtasks=true` para estrutura completa
57
+ - **Update de Status**: Aplica `update_task` nos subtasks com status correto
58
+ - **Comentários de Correção**: Usa `create_task_comment` para documentar ajustes
59
+ - **Validação de Integridade**: Verifica se mapeamento está correto e completo
60
+
61
+ ### Mapeamento Phase-Subtask
62
+
63
+ Lê o mapeamento do arquivo `.claude/sessions/[slug]/context.md`:
64
+
65
+ ```markdown
66
+ ## 📋 Phase-Subtask Mapping
67
+
68
+ - **Phase 1**: "Template Consolidation" → Subtask ID: [id-1]
69
+ - **Phase 2**: "Feature Commands" → Subtask ID: [id-2]
70
+ - **Phase 3**: "Release Commands" → Subtask ID: [id-3]
71
+ ```
72
+
73
+ ### Correções Aplicadas
74
+
75
+ - Fases "Completada ✅" → Subtask status "done"
76
+ - Fases "Em Progresso ⏰" → Subtask status "in progress"
77
+ - Fases "Não Iniciada ⏳" → Subtask status "to do"
78
+
79
+ ## ⚙️ Processo de Validação
80
+
81
+ 1. **Detecta Sessão Ativa**: Identifica sessão em `.claude/sessions/`
82
+ 2. **Lê Context.md**: Carrega mapeamento Phase-Subtask e task ID principal
83
+ 3. **Analisa Plan.md**: Extrai status atual de todas as fases
84
+ 4. **Consulta ClickUp**: Obtém status atual das subtasks via ClickUp MCP
85
+ 5. **Identifica Discrepâncias**: Compara status plan.md vs ClickUp
86
+ 6. **Aplica Correções**: Atualiza status das subtasks conforme necessário
87
+ 7. **Documenta Ações**: Registra todas correções aplicadas
88
+
89
+ ## ⚠️ Resolução de Problemas
90
+
91
+ ### Problema: "Mapeamento Phase-Subtask não encontrado"
92
+
93
+ **Solução**: Verificar se context.md contém seção "Phase-Subtask Mapping"
94
+
95
+ ```bash
96
+ # Execute se necessário:
97
+ /engineer/create-phase-mapping
98
+ ```
99
+
100
+ ### Problema: "Subtask não encontrada no ClickUp"
101
+
102
+ **Solução**: IDs do mapeamento podem estar incorretos
103
+
104
+ - Verificar IDs das subtasks no ClickUp
105
+ - Atualizar mapeamento no context.md
106
+ - Executar validação novamente
107
+
108
+ ### Problema: "Múltiplas fases para mesma subtask"
109
+
110
+ **Solução**: Revisar estrutura do projeto
111
+
112
+ - Uma subtask deve corresponder a uma fase específica
113
+ - Considerar quebrar fase complexa em múltiplas fases
114
+
115
+ ## 💡 Integração com Workflow
116
+
117
+ ### Uso Recomendado
118
+
119
+ - **Durante desenvolvimento**: Executar ao final de cada sessão de trabalho
120
+ - **Antes de PRs**: Validar sincronização completa antes de `/engineer/pr`
121
+ - **Após interrupções**: Garantir consistência após retomar trabalho
122
+ - **Debugging**: Identificar problemas de tracking de progresso
123
+
124
+ ### Prevenção Automática
125
+
126
+ Este comando corrige o problema identificado onde `/engineer/work` não atualizava automaticamente os status das subtasks. Para projetos futuros:
127
+
128
+ 1. `/engineer/start` deve criar o mapeamento automaticamente
129
+ 2. `/engineer/work` deve usar este mapeamento para updates automáticos
130
+ 3. Este comando serve como backup/validação do processo automático
131
+
132
+ ---
133
+
134
+ **🎯 CRITICAL FIX: Este comando resolve a falha arquitetural onde fases completadas não atualizavam automaticamente o status das subtasks correspondentes, garantindo sincronização perfeita entre plan.md e ClickUp.**
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: warm-up
3
+ description: Prepare project context. Review README and docs.
4
+ model: sonnet
5
+ category: engineer
6
+ tags: [warmup, context, preparation]
7
+ version: '3.0.0'
8
+ updated: '2025-11-24'
9
+ ---
10
+
11
+ # Project Warm-up
12
+
13
+ To prepare for this session, please:
14
+
15
+ 1 - Review the README.md at the root of this project. Also, keep a list of files in the docs/ folder in your context so you can refer to them later when needed.
16
+
17
+ 2 - Meta Specs
18
+
19
+ - Review the index.md in the META SPECS of this project and memorize it so you know which files you can read later when needed.
20
+ - Meta specs are located in the docs/meta-specs/ folder of the project
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: work
3
+ description: |
4
+ Continue work on active feature. Read session and identify next phase.
5
+ Update progress via Task Manager abstraction.
6
+ model: sonnet
7
+ category: engineer
8
+ tags: [development, workflow, session]
9
+ version: '3.0.0'
10
+ updated: '2025-11-24'
11
+ ---
12
+
13
+ # Engineer Work
14
+
15
+ We are currently working on a feature that is specified in the following folder:
16
+
17
+ <folder>
18
+ #$ARGUMENTS
19
+ </folder>
20
+
21
+ To work on this, you should:
22
+
23
+ - Read all markdown files in the folder
24
+ - Review the plan.md file and identify which Phase is currently in progress
25
+ - Present the user with a plan to approach the next phase
26
+
27
+ ## 🔄 **Auto-Update Task Manager**
28
+
29
+ This command **automatically updates** the task during development using the abstraction:
30
+
31
+ ```typescript
32
+ // Detect provider and get adapter
33
+ const config = detectProvider();
34
+ const taskManager = getTaskManager();
35
+
36
+ if (!taskManager.isConfigured) {
37
+ console.warn('⚠️ Offline mode - progress will not be synced');
38
+ }
39
+ ```
40
+
41
+ ### **✅ Automatic Updates FOR EACH PHASE:**
42
+
43
+ - **Progress comment** when phase is completed
44
+ - **SUBTASK STATUS UPDATE** - Updates corresponding subtask status to "done"
45
+ - **plan.md update** with status and decisions
46
+ - **Estimated % progress** based on completed phases
47
+ - **Activity timestamp** for temporal tracking
48
+
49
+ ### **🔗 CRITICAL: Phase→Subtask Mapping**
50
+
51
+ **MANDATORY**: When a phase is completed, the system must:
52
+
53
+ 1. **Identify corresponding subtask** via mapping established in context.md
54
+ 2. **Update subtask status** to "done" automatically
55
+ 3. **Document completion** with timestamp and phase metrics
56
+
57
+ ### **💬 DUAL Comment Strategy:**
58
+
59
+ When completing a phase, the system automatically:
60
+
61
+ 1. **Creates DETAILED comment on SUBTASK**
62
+ 2. **Creates SUMMARY comment on MAIN TASK**
63
+
64
+ ### **📋 Task Identification:**
65
+
66
+ 1. **Context.md**: Read task-id from session context file
67
+ 2. **Active session**: Automatically detect session in `.claude/sessions/`
68
+ 3. **🆕 PHASE-SUBTASK MAPPING**: Read mapping from context.md to correlate phases→subtasks
69
+
70
+ ### **🗺️ SUBTASK MAPPING STRUCTURE (context.md):**
71
+
72
+ ```markdown
73
+ ## 📋 Phase-Subtask Mapping
74
+
75
+ - **Phase 1**: "Phase Name" → Subtask ID: [subtask-id-1]
76
+ - **Phase 2**: "Phase Name" → Subtask ID: [subtask-id-2]
77
+ ```
78
+
79
+ ### **⚡ AUTOMATIC EXECUTION (Via Abstraction):**
80
+
81
+ When a phase is marked as "Completed ✅" in plan.md, the system must **EXECUTE IN THIS ORDER**:
82
+
83
+ ```typescript
84
+ // 1. Get task manager
85
+ const taskManager = getTaskManager();
86
+
87
+ if (taskManager.isConfigured) {
88
+ // 2. DETAILED comment on SUBTASK
89
+ await taskManager.addComment(
90
+ subtaskId,
91
+ `
92
+ 🔧 PHASE COMPLETED: ${phaseName}
93
+
94
+ ━━━━━━━━━━━━━━
95
+
96
+ 📁 FILES MODIFIED:
97
+ ${filesModified.map((f) => ` ∟ ${f}`).join('\n')}
98
+
99
+ 🔧 IMPLEMENTATIONS:
100
+ ${implementations.map((impl) => ` ▶ ${impl}`).join('\n')}
101
+
102
+ 💡 TECHNICAL DECISIONS:
103
+ ${decisions.map((d) => ` ∟ ${d}`).join('\n')}
104
+
105
+ 🚀 NEXT STEPS:
106
+ ∟ ${nextPhase}
107
+
108
+ ━━━━━━━━━━━━━━
109
+
110
+ ⏰ Completed: ${timestamp} | 🎯 Status: Done
111
+ `,
112
+ );
113
+
114
+ // 3. Update SUBTASK STATUS
115
+ await taskManager.updateStatus(subtaskId, 'done');
116
+
117
+ // 4. SUMMARY comment on MAIN TASK
118
+ await taskManager.addComment(
119
+ mainTaskId,
120
+ `
121
+ 📝 PROGRESS: Phase ${phaseNum}/${totalPhases} Completed
122
+
123
+ ✅ ${phaseName} - Completed
124
+ ∟ Subtask: #${subtaskId}
125
+ ∟ Details: See comment on subtask
126
+
127
+ 🎯 Next: Phase ${phaseNum + 1}/${totalPhases} - ${nextPhaseName}
128
+
129
+ ⏰ ${timestamp}
130
+ `,
131
+ );
132
+ }
133
+ ```
134
+
135
+ ## Important:
136
+
137
+ When you develop the code for the current phase, use the development, code-review, and test sub-agents when appropriate to preserve as much of your context as possible.
138
+
139
+ Every time you complete a phase of the plan:
140
+
141
+ - **AUTO-UPDATE**: Add progress comment via abstraction
142
+ - **TRACKING**: Check checkboxes in the description corresponding to completed criteria
143
+ - Pause and ask the user to validate your code.
144
+ - Make necessary changes until approved
145
+ - Update the corresponding phase in the plan.md file marking what was done and adding helpful comments for the developer who will approach the next phases, especially about questions, decisions, etc.
146
+ - Only start the next phase after the user agrees that you should begin.
147
+
148
+ ## 🔗 References
149
+
150
+ - Abstraction: `.claude/utils/task-manager/`
151
+ - Detector: `.claude/utils/task-manager/detector.md`
152
+ - Factory: `.claude/utils/task-manager/factory.md`
153
+ - Comment patterns: `common/prompts/clickup-patterns.md`
154
+
155
+ Now, review the current development phase and provide the user with a plan on how to approach it.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: company-context-extractor
3
+ description: Extract structured company context from transcripts
4
+ model: opus
5
+ category: general
6
+ tags: [company-context-extractor, context, preparation]
7
+ version: "1.0.0"
8
+ updated: "2025-12-30"
9
+ ---
10
+
11
+ # Company Context Extractor
12
+
13
+ You are processing transcripts to extract a structured company context document. This document serves as the foundation for all downstream agents and workflows.
14
+
15
+ ## Input
16
+ The user will provide one or more transcripts, documents and/or other resources. These may be:
17
+ - Sales/discovery call recordings
18
+ - Meeting notes
19
+ - Email threads
20
+ - Any other business communication or document
21
+
22
+ ## Your Task
23
+ Extract information from the provided documents and output a structured context document following the EXACT schema below. Do not deviate from this structure.
24
+
25
+ ## Rules
26
+ 1. **Stick to the schema** — Do not add sections, remove sections, or rename fields
27
+ 2. **Use "Unknown" or "Not mentioned"** — If information is not present in the transcripts, explicitly state this. Never invent or assume.
28
+ 3. **Preserve uncertainty** — If something is ambiguous, note it in Open Questions
29
+ 4. **Extract verbatim quotes** — The Raw Quotes section must contain actual quotes from the transcript, not paraphrases
30
+ 5. **Be concise** — Each field should be 1-3 sentences max unless it's a list
31
+
32
+ ---
33
+
34
+ ## Output Schema (use exactly this format)
35
+
36
+ ```
37
+ ## Company Identity
38
+ - **Name:** [company name]
39
+ - **Website:** [URL if mentioned, otherwise "Not mentioned"]
40
+ - **Industry/Vertical:** [their market/sector]
41
+ - **Stage:** [Seed / Series A / Series B / Growth / Enterprise / Unknown]
42
+ - **Team Size:** [number or range if mentioned, otherwise "Not mentioned"]
43
+ - **Geography:** [HQ location or primary markets]
44
+
45
+ ## Core Business
46
+ - **One-liner:** [what they do in one sentence]
47
+ - **Problem Statement:** [what pain point or challenge they address]
48
+ - **Solution:** [how they solve it — their product/service]
49
+ - **Target Customer:** [who they sell to — be specific]
50
+ - **Business Model:** [SaaS / Services / Marketplace / Hardware / Other — how they monetize]
51
+
52
+ ## Key People
53
+ [For each person mentioned:]
54
+ - **[Name]** — [Role/Title] — [Any notable context: decision maker, champion, technical lead, etc.]
55
+
56
+ ## Current Situation
57
+ - **Why they're engaging:** [the trigger, need, or initiative driving this conversation]
58
+ - **Timeline:** [any deadlines, urgency, or timing mentioned]
59
+ - **Decision Process:** [who decides, approval process, stakeholders involved]
60
+ - **Budget Signals:** [any budget mentions, constraints, or purchasing context]
61
+
62
+ ## Product/Technical Context
63
+ - **Current Tools:** [what they currently use for this problem]
64
+ - **Integrations Needed:** [systems they need to connect with]
65
+ - **Technical Constraints:** [any limitations, requirements, or blockers mentioned]
66
+
67
+ ## Open Questions
68
+ [List 3-7 questions that remain unanswered or unclear from the transcripts. These flag gaps for follow-up.]
69
+ - [Question 1]
70
+ - [Question 2]
71
+ - [Question 3]
72
+
73
+ ## Raw Quotes
74
+ [Extract 3-5 verbatim quotes that capture their intent, pain points, or priorities. Include speaker attribution if known.]
75
+ > "[Exact quote]" — [Speaker if known]
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Processing Instructions
81
+
82
+ Output the filled schema directly to `docs/company-context.md`. No preamble, no commentary, no "here's what I found" — just write the structured document to the file.
83
+
84
+
85
+ ## Processing Multiple Documents
86
+
87
+ If multiple documents are provided:
88
+ 1. Synthesize information across all transcripts
89
+ 2. Note conflicts or evolution (e.g., "Initially mentioned X, later clarified as Y")
90
+ 3. Use the most recent information as primary, note earlier context if relevant
91
+ 4. In Open Questions, flag any contradictions that need resolution
92
+
93
+ $ARGUMENTS