@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,131 @@
1
+ #!/usr/bin/env python3
2
+ """Generate an interactive collapsible tree visualization of a codebase."""
3
+
4
+ import json
5
+ import sys
6
+ import webbrowser
7
+ from pathlib import Path
8
+ from collections import Counter
9
+
10
+ IGNORE = {'.git', 'node_modules', '__pycache__', '.venv', 'venv', 'dist', 'build'}
11
+
12
+ def scan(path: Path, stats: dict) -> dict:
13
+ result = {"name": path.name, "children": [], "size": 0}
14
+ try:
15
+ for item in sorted(path.iterdir()):
16
+ if item.name in IGNORE or item.name.startswith('.'):
17
+ continue
18
+ if item.is_file():
19
+ size = item.stat().st_size
20
+ ext = item.suffix.lower() or '(no ext)'
21
+ result["children"].append({"name": item.name, "size": size, "ext": ext})
22
+ result["size"] += size
23
+ stats["files"] += 1
24
+ stats["extensions"][ext] += 1
25
+ stats["ext_sizes"][ext] += size
26
+ elif item.is_dir():
27
+ stats["dirs"] += 1
28
+ child = scan(item, stats)
29
+ if child["children"]:
30
+ result["children"].append(child)
31
+ result["size"] += child["size"]
32
+ except PermissionError:
33
+ pass
34
+ return result
35
+
36
+ def generate_html(data: dict, stats: dict, output: Path) -> None:
37
+ ext_sizes = stats["ext_sizes"]
38
+ total_size = sum(ext_sizes.values()) or 1
39
+ sorted_exts = sorted(ext_sizes.items(), key=lambda x: -x[1])[:8]
40
+ colors = {
41
+ '.js': '#f7df1e', '.ts': '#3178c6', '.py': '#3776ab', '.go': '#00add8',
42
+ '.rs': '#dea584', '.rb': '#cc342d', '.css': '#264de4', '.html': '#e34c26',
43
+ '.json': '#6b7280', '.md': '#083fa1', '.yaml': '#cb171e', '.yml': '#cb171e',
44
+ '.mdx': '#083fa1', '.tsx': '#3178c6', '.jsx': '#61dafb', '.sh': '#4eaa25',
45
+ }
46
+ lang_bars = "".join(
47
+ f'<div class="bar-row"><span class="bar-label">{ext}</span>'
48
+ f'<div class="bar" style="width:{(size/total_size)*100}%;background:{colors.get(ext,"#6b7280")}"></div>'
49
+ f'<span class="bar-pct">{(size/total_size)*100:.1f}%</span></div>'
50
+ for ext, size in sorted_exts
51
+ )
52
+ def fmt(b):
53
+ if b < 1024: return f"{b} B"
54
+ if b < 1048576: return f"{b/1024:.1f} KB"
55
+ return f"{b/1048576:.1f} MB"
56
+
57
+ html = f'''<!DOCTYPE html>
58
+ <html><head>
59
+ <meta charset="utf-8"><title>Codebase Explorer</title>
60
+ <style>
61
+ body {{ font: 14px/1.5 system-ui, sans-serif; margin: 0; background: #1a1a2e; color: #eee; }}
62
+ .container {{ display: flex; height: 100vh; }}
63
+ .sidebar {{ width: 280px; background: #252542; padding: 20px; border-right: 1px solid #3d3d5c; overflow-y: auto; flex-shrink: 0; }}
64
+ .main {{ flex: 1; padding: 20px; overflow-y: auto; }}
65
+ h1 {{ margin: 0 0 10px 0; font-size: 18px; }}
66
+ h2 {{ margin: 20px 0 10px 0; font-size: 14px; color: #888; text-transform: uppercase; }}
67
+ .stat {{ display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #3d3d5c; }}
68
+ .stat-value {{ font-weight: bold; }}
69
+ .bar-row {{ display: flex; align-items: center; margin: 6px 0; }}
70
+ .bar-label {{ width: 55px; font-size: 12px; color: #aaa; }}
71
+ .bar {{ height: 18px; border-radius: 3px; }}
72
+ .bar-pct {{ margin-left: 8px; font-size: 12px; color: #666; }}
73
+ .tree {{ list-style: none; padding-left: 20px; }}
74
+ details {{ cursor: pointer; }}
75
+ summary {{ padding: 4px 8px; border-radius: 4px; }}
76
+ summary:hover {{ background: #2d2d44; }}
77
+ .folder {{ color: #ffd700; }}
78
+ .file {{ display: flex; align-items: center; padding: 4px 8px; border-radius: 4px; }}
79
+ .file:hover {{ background: #2d2d44; }}
80
+ .size {{ color: #888; margin-left: auto; font-size: 12px; }}
81
+ .dot {{ width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }}
82
+ </style>
83
+ </head><body>
84
+ <div class="container">
85
+ <div class="sidebar">
86
+ <h1>📊 Summary</h1>
87
+ <div class="stat"><span>Files</span><span class="stat-value">{stats["files"]:,}</span></div>
88
+ <div class="stat"><span>Directories</span><span class="stat-value">{stats["dirs"]:,}</span></div>
89
+ <div class="stat"><span>Total size</span><span class="stat-value">{fmt(data["size"])}</span></div>
90
+ <div class="stat"><span>File types</span><span class="stat-value">{len(stats["extensions"])}</span></div>
91
+ <h2>By file type</h2>
92
+ {lang_bars}
93
+ </div>
94
+ <div class="main">
95
+ <h1>📁 {data["name"]}</h1>
96
+ <ul class="tree" id="root"></ul>
97
+ </div>
98
+ </div>
99
+ <script>
100
+ const data = {json.dumps(data)};
101
+ const colors = {json.dumps(colors)};
102
+ function fmt(b) {{ if (b < 1024) return b + ' B'; if (b < 1048576) return (b/1024).toFixed(1) + ' KB'; return (b/1048576).toFixed(1) + ' MB'; }}
103
+ function render(node, parent) {{
104
+ if (node.children) {{
105
+ const det = document.createElement('details');
106
+ det.open = parent === document.getElementById('root');
107
+ det.innerHTML = `<summary><span class="folder">📁 ${{node.name}}</span><span class="size">${{fmt(node.size)}}</span></summary>`;
108
+ const ul = document.createElement('ul'); ul.className = 'tree';
109
+ node.children.sort((a,b) => (b.children?1:0)-(a.children?1:0) || a.name.localeCompare(b.name));
110
+ node.children.forEach(c => render(c, ul));
111
+ det.appendChild(ul);
112
+ const li = document.createElement('li'); li.appendChild(det); parent.appendChild(li);
113
+ }} else {{
114
+ const li = document.createElement('li'); li.className = 'file';
115
+ li.innerHTML = `<span class="dot" style="background:${{colors[node.ext]||'#6b7280'}}"></span>${{node.name}}<span class="size">${{fmt(node.size)}}</span>`;
116
+ parent.appendChild(li);
117
+ }}
118
+ }}
119
+ data.children.forEach(c => render(c, document.getElementById('root')));
120
+ </script>
121
+ </body></html>'''
122
+ output.write_text(html)
123
+
124
+ if __name__ == '__main__':
125
+ target = Path(sys.argv[1] if len(sys.argv) > 1 else '.').resolve()
126
+ stats = {"files": 0, "dirs": 0, "extensions": Counter(), "ext_sizes": Counter()}
127
+ data = scan(target, stats)
128
+ out = Path('codebase-map.html')
129
+ generate_html(data, stats, out)
130
+ print(f'Generated {out.absolute()}')
131
+ webbrowser.open(f'file://{out.absolute()}')
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: collect
3
+ description: Collect new feature ideas or bugs for the project. Use when the user wants to log a new idea, report a bug, capture a feature request, or add something to the backlog.
4
+ argument-hint: 'description of feature or bug'
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ You are a product expert tasked with helping a human collect new feature/bug ideas for this project.
9
+
10
+ The user provided the following arguments:
11
+
12
+ <arguments>
13
+ $ARGUMENTS
14
+ </arguments>
15
+
16
+ Your goal is to understand the request. Ask questions to clarify the request. Then save it to the project management software.
17
+
18
+ At this point, you don't need to write a complete specification for the request, just make sure it is adequately understood.
19
+
20
+ The perfect task will have:
21
+
22
+ - A title
23
+ - A good description so we can remember it later in the refinement phase
24
+ - If it's a bug, an indication of where the bug is happening
25
+
26
+ ## The Process
27
+
28
+ When the user presents a new task to collect, you will:
29
+
30
+ - Make sure you understand the task clearly and ask for clarifications if you don't understand
31
+ - Draft a quick title and description and present it to the user for approval. Make any necessary changes.
32
+
33
+ Save the task to the configured task manager (via Task Manager abstraction).
34
+
35
+ ## Automatic Story Points Estimation
36
+
37
+ **CRITICAL:** After creating the task, ALWAYS estimate story points automatically.
38
+
39
+ ### Step: Estimate Story Points
40
+
41
+ ```markdown
42
+ @story-points-framework-specialist
43
+
44
+ Please analyze and estimate the following collected task:
45
+
46
+ **Task:** [approved title]
47
+ **Description:** [approved description]
48
+ **Type:** [feature/bug]
49
+
50
+ Provide complete story points estimation following the framework.
51
+ ```
52
+
53
+ ### Update Task with Estimate
54
+
55
+ ```typescript
56
+ // After creating task via Task Manager abstraction
57
+ const taskManager = getTaskManager();
58
+ const estimate = await getStoryPointsEstimate(taskDescription);
59
+
60
+ // Update task with Story Points custom field
61
+ await taskManager.updateTask(taskId, {
62
+ customFields: {
63
+ 'Story Points': estimate.points,
64
+ },
65
+ });
66
+
67
+ // Add comment with analysis
68
+ await taskManager.addComment(
69
+ taskId,
70
+ '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
71
+ '📊 STORY POINTS ESTIMATION\n' +
72
+ '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n' +
73
+ `🎲 Story Points: ${estimate.points} points\n\n` +
74
+ `⚡ ANALYSIS:\n` +
75
+ `∟ Complexity: ${estimate.complexity}\n` +
76
+ `∟ Risk: ${estimate.risk}\n` +
77
+ `∟ Uncertainty: ${estimate.uncertainty}\n\n` +
78
+ `💡 RECOMMENDATIONS:\n` +
79
+ `${estimate.recommendations}\n` +
80
+ '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━',
81
+ );
82
+ ```
83
+
84
+ **Note:** If estimate > 13 points, alert that the task may need to be broken down during refinement.
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: create-rule
3
+ description: Create a path-specific Claude Code rule (.claude/rules/*.md) with guided scope validation, overlap detection, and best-practice guardrails.
4
+ ---
5
+
6
+ # Create Rule
7
+
8
+ Create a new `.claude/rules/*.md` file through a guided workflow that validates scope, prevents bad rules, and ensures the right mechanism is used.
9
+
10
+ ## Step 1: Understand Intent
11
+
12
+ The user provides a topic or area they want a rule for (e.g., "invitations feature", "API DTOs", "Prisma schema").
13
+
14
+ Parse the input to identify:
15
+
16
+ - **Domain**: Which feature, technology, or concern?
17
+ - **Goal**: What should Claude know or do differently when working in this area?
18
+
19
+ If the input is vague (e.g., just "auth"), ask ONE clarifying question about what specifically the rule should cover.
20
+
21
+ ## Step 2: Validate — Should This Be a Rule?
22
+
23
+ Before proceeding, evaluate whether a rule is the right mechanism. Check these conditions and **advise the user** if a different mechanism is better:
24
+
25
+ **Redirect to CLAUDE.md if:**
26
+
27
+ - The guidance applies universally to ALL files in the project (e.g., "always use pnpm", "port 3000")
28
+ - It's about project setup, build commands, or universal conventions
29
+ - Say: "This applies to the entire project. It belongs in CLAUDE.md, not a path-specific rule. Want me to add it there instead?"
30
+
31
+ **Redirect to CLAUDE.local.md if:**
32
+
33
+ - It's a personal preference not shared with the team (e.g., "I prefer verbose output")
34
+ - Say: "This is a personal preference. It belongs in CLAUDE.local.md. Want me to add it there instead?"
35
+
36
+ **Redirect to auto memory if:**
37
+
38
+ - It's a discovered insight or debugging finding (e.g., "the audit_logs table needs an index")
39
+ - It's temporary or session-specific context
40
+ - Say: "This is learned knowledge, not a permanent convention. It's better stored in auto memory. Want me to save it there instead?"
41
+
42
+ **Redirect to a skill if:**
43
+
44
+ - The user wants to execute an action or workflow, not provide passive context
45
+ - Say: "This sounds like an action, not context. A skill (/skill-name) would be more appropriate. Want me to create a skill instead?"
46
+
47
+ If the rule IS appropriate, proceed to Step 3.
48
+
49
+ ## Step 3: Explore the Codebase
50
+
51
+ Based on the identified domain, explore the relevant code to understand:
52
+
53
+ 1. **File patterns**: Which directories and file types are involved? Use Glob to discover the actual file structure.
54
+ 2. **Key conventions**: Read 2-3 representative files to understand existing patterns.
55
+ 3. **Design specs**: Check if `docs/architecture` and `docs/ARCHITECTURE.md` has a relevant spec file for this feature.
56
+ 4. **Related docs**: Check `CLAUDE.md` for existing guidance on this area.
57
+
58
+ Build a mental model of what paths the rule should cover and what content would be most valuable.
59
+
60
+ ## Step 4: Check for Overlap
61
+
62
+ Read all existing rule files in `.claude/rules/` and check:
63
+
64
+ 1. **Direct overlap**: Does an existing rule already cover these paths or this topic?
65
+ 2. **Partial overlap**: Would this rule's paths intersect with an existing rule's paths?
66
+ 3. **CLAUDE.md duplication**: Is this guidance already in the project's CLAUDE.md?
67
+
68
+ If overlap is found:
69
+
70
+ - If minor: suggest extending the existing rule instead of creating a new one
71
+ - If the existing rule is stale or wrong: suggest updating it
72
+ - If no overlap: proceed
73
+
74
+ Report findings to the user before continuing.
75
+
76
+ ## Step 5: Propose the Rule
77
+
78
+ Present the proposed rule to the user for approval. Show:
79
+
80
+ 1. **Filename**: `{topic}.md` in kebab-case
81
+ 2. **Path patterns**: The glob patterns that will trigger this rule
82
+ 3. **Content preview**: The full markdown content
83
+
84
+ ### Content Guidelines
85
+
86
+ The rule content MUST follow these principles:
87
+
88
+ **DO include:**
89
+
90
+ - Pointers to design spec files (e.g., "Read `docs/design/X-spec.md` before making changes")
91
+ - Key architectural constraints (2-3 bullet points)
92
+ - Common mistakes to avoid in this area (learned patterns)
93
+ - Import conventions specific to this area
94
+ - Brief context on why things are done this way
95
+
96
+ **DO NOT include:**
97
+
98
+ - Full design spec content (just reference the file path)
99
+ - Content already in CLAUDE.md (don't duplicate)
100
+ - Generic coding advice (keep it specific to this area)
101
+ - Marketing language, motivational text, or emojis in headers
102
+ - More than 100 lines (if longer, suggest splitting into multiple rules)
103
+
104
+ ### File Format
105
+
106
+ ```markdown
107
+ ---
108
+ paths:
109
+ - 'pattern/one/**'
110
+ - 'pattern/two/**/*.ts'
111
+ ---
112
+
113
+ # [Rule Title]
114
+
115
+ [Brief context: what this area is about, 1-2 sentences]
116
+
117
+ ## Key Decisions
118
+
119
+ - [Architectural decision 1]
120
+ - [Architectural decision 2]
121
+
122
+ ## Conventions
123
+
124
+ - [Pattern or convention specific to these files]
125
+ - [Import rule or naming convention]
126
+
127
+ ## Common Mistakes
128
+
129
+ - [Thing that's easy to get wrong]
130
+ - [Another pitfall]
131
+
132
+ ## Reference
133
+
134
+ - Design spec: `docs/design/relevant-spec.md`
135
+ - Related: `other-relevant-file.md`
136
+ ```
137
+
138
+ ## Step 6: Confirm and Create
139
+
140
+ Ask the user: "Does this look right? Want me to adjust the paths, content, or filename?"
141
+
142
+ Wait for explicit confirmation before creating the file.
143
+
144
+ Once confirmed, create the file at `.claude/rules/{filename}.md`.
145
+
146
+ After creation, remind the user: "The rule will take effect in your next Claude Code session (rules load at session startup)."
147
+
148
+ ## Error Handling
149
+
150
+ - **No matching files for proposed paths**: Warn the user that the glob patterns don't match any existing files. Ask if this is intentional (e.g., for files that will be created soon).
151
+ - **Too many matching files (>500)**: Warn that the rule might be too broad. Suggest narrowing the paths.
152
+ - **Rule file already exists with same name**: Ask if they want to update the existing rule or choose a different name.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: db-schema-visualizer
3
+ description: Generate an interactive ERD (Entity Relationship Diagram) from your Prisma schema, TypeORM entities, or raw SQL migrations. Use when onboarding to a project, reviewing database architecture, or documenting your data model.
4
+ allowed-tools: Bash(python *)
5
+ ---
6
+
7
+ # Database Schema Visualizer
8
+
9
+ Generate an interactive HTML ERD that shows your database tables, columns, types, and relationships.
10
+
11
+ ## Usage
12
+
13
+ Run the visualization script pointing to your schema source:
14
+
15
+ ### Prisma
16
+
17
+ ```bash
18
+ python3 .claude/skills/db-schema-visualizer/scripts/visualize.py --prisma prisma/schema.prisma
19
+ ```
20
+
21
+ ### Multiple Prisma files
22
+
23
+ ```bash
24
+ python3 .claude/skills/db-schema-visualizer/scripts/visualize.py --prisma prisma/schema.prisma prisma/schema2.prisma
25
+ ```
26
+
27
+ ### SQL migrations folder
28
+
29
+ ```bash
30
+ python3 .claude/skills/db-schema-visualizer/scripts/visualize.py --sql migrations/
31
+ ```
32
+
33
+ ### TypeORM entities folder
34
+
35
+ ```bash
36
+ python3 .claude/skills/db-schema-visualizer/scripts/visualize.py --typeorm src/entities/
37
+ ```
38
+
39
+ This creates `db-schema.html` in the current directory and opens it in your default browser.
40
+
41
+ ## What the visualization shows
42
+
43
+ - **Interactive ERD**: Draggable table nodes with pan & zoom
44
+ - **Columns & types**: All fields with their data types, nullability, defaults
45
+ - **Primary keys**: Highlighted with a key icon
46
+ - **Relationships**: Arrows showing foreign keys, one-to-many, many-to-many
47
+ - **Search**: Filter tables by name
48
+ - **Click to highlight**: Click a table to highlight all its relationships
49
+ - **Color coding**: Different colors for different relationship types