@every-env/compound-plugin 0.1.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 (226) hide show
  1. package/.claude-plugin/marketplace.json +37 -0
  2. package/.github/workflows/deploy-docs.yml +39 -0
  3. package/AGENTS.md +48 -0
  4. package/CLAUDE.md +380 -0
  5. package/LICENSE +21 -0
  6. package/README.md +65 -0
  7. package/bun.lock +30 -0
  8. package/docs/css/docs.css +675 -0
  9. package/docs/css/style.css +2886 -0
  10. package/docs/index.html +1046 -0
  11. package/docs/js/main.js +225 -0
  12. package/docs/pages/agents.html +649 -0
  13. package/docs/pages/changelog.html +495 -0
  14. package/docs/pages/commands.html +523 -0
  15. package/docs/pages/getting-started.html +582 -0
  16. package/docs/pages/mcp-servers.html +409 -0
  17. package/docs/pages/skills.html +611 -0
  18. package/docs/solutions/plugin-versioning-requirements.md +77 -0
  19. package/docs/specs/claude-code.md +67 -0
  20. package/docs/specs/codex.md +59 -0
  21. package/docs/specs/opencode.md +57 -0
  22. package/package.json +26 -0
  23. package/plans/grow-your-own-garden-plugin-architecture.md +102 -0
  24. package/plans/landing-page-launchkit-refresh.md +279 -0
  25. package/plugins/coding-tutor/.claude-plugin/plugin.json +9 -0
  26. package/plugins/coding-tutor/README.md +37 -0
  27. package/plugins/coding-tutor/commands/quiz-me.md +1 -0
  28. package/plugins/coding-tutor/commands/sync-tutorials.md +25 -0
  29. package/plugins/coding-tutor/commands/teach-me.md +1 -0
  30. package/plugins/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
  31. package/plugins/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +207 -0
  32. package/plugins/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +193 -0
  33. package/plugins/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
  34. package/plugins/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +118 -0
  35. package/plugins/compound-engineering/.claude-plugin/plugin.json +33 -0
  36. package/plugins/compound-engineering/CHANGELOG.md +393 -0
  37. package/plugins/compound-engineering/CLAUDE.md +90 -0
  38. package/plugins/compound-engineering/LICENSE +21 -0
  39. package/plugins/compound-engineering/README.md +219 -0
  40. package/plugins/compound-engineering/agents/design/design-implementation-reviewer.md +94 -0
  41. package/plugins/compound-engineering/agents/design/design-iterator.md +197 -0
  42. package/plugins/compound-engineering/agents/design/figma-design-sync.md +172 -0
  43. package/plugins/compound-engineering/agents/docs/ankane-readme-writer.md +50 -0
  44. package/plugins/compound-engineering/agents/research/best-practices-researcher.md +100 -0
  45. package/plugins/compound-engineering/agents/research/framework-docs-researcher.md +83 -0
  46. package/plugins/compound-engineering/agents/research/git-history-analyzer.md +42 -0
  47. package/plugins/compound-engineering/agents/research/repo-research-analyst.md +113 -0
  48. package/plugins/compound-engineering/agents/review/agent-native-reviewer.md +246 -0
  49. package/plugins/compound-engineering/agents/review/architecture-strategist.md +52 -0
  50. package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +85 -0
  51. package/plugins/compound-engineering/agents/review/data-integrity-guardian.md +70 -0
  52. package/plugins/compound-engineering/agents/review/data-migration-expert.md +97 -0
  53. package/plugins/compound-engineering/agents/review/deployment-verification-agent.md +159 -0
  54. package/plugins/compound-engineering/agents/review/dhh-rails-reviewer.md +45 -0
  55. package/plugins/compound-engineering/agents/review/julik-frontend-races-reviewer.md +222 -0
  56. package/plugins/compound-engineering/agents/review/kieran-python-reviewer.md +104 -0
  57. package/plugins/compound-engineering/agents/review/kieran-rails-reviewer.md +86 -0
  58. package/plugins/compound-engineering/agents/review/kieran-typescript-reviewer.md +95 -0
  59. package/plugins/compound-engineering/agents/review/pattern-recognition-specialist.md +57 -0
  60. package/plugins/compound-engineering/agents/review/performance-oracle.md +110 -0
  61. package/plugins/compound-engineering/agents/review/security-sentinel.md +93 -0
  62. package/plugins/compound-engineering/agents/workflow/bug-reproduction-validator.md +67 -0
  63. package/plugins/compound-engineering/agents/workflow/every-style-editor.md +64 -0
  64. package/plugins/compound-engineering/agents/workflow/lint.md +16 -0
  65. package/plugins/compound-engineering/agents/workflow/pr-comment-resolver.md +69 -0
  66. package/plugins/compound-engineering/agents/workflow/spec-flow-analyzer.md +113 -0
  67. package/plugins/compound-engineering/commands/agent-native-audit.md +277 -0
  68. package/plugins/compound-engineering/commands/changelog.md +137 -0
  69. package/plugins/compound-engineering/commands/create-agent-skill.md +8 -0
  70. package/plugins/compound-engineering/commands/deepen-plan.md +546 -0
  71. package/plugins/compound-engineering/commands/deploy-docs.md +112 -0
  72. package/plugins/compound-engineering/commands/feature-video.md +342 -0
  73. package/plugins/compound-engineering/commands/generate_command.md +162 -0
  74. package/plugins/compound-engineering/commands/heal-skill.md +142 -0
  75. package/plugins/compound-engineering/commands/lfg.md +19 -0
  76. package/plugins/compound-engineering/commands/plan_review.md +7 -0
  77. package/plugins/compound-engineering/commands/release-docs.md +211 -0
  78. package/plugins/compound-engineering/commands/report-bug.md +150 -0
  79. package/plugins/compound-engineering/commands/reproduce-bug.md +99 -0
  80. package/plugins/compound-engineering/commands/resolve_parallel.md +34 -0
  81. package/plugins/compound-engineering/commands/resolve_pr_parallel.md +49 -0
  82. package/plugins/compound-engineering/commands/resolve_todo_parallel.md +35 -0
  83. package/plugins/compound-engineering/commands/test-browser.md +339 -0
  84. package/plugins/compound-engineering/commands/triage.md +310 -0
  85. package/plugins/compound-engineering/commands/workflows/compound.md +202 -0
  86. package/plugins/compound-engineering/commands/workflows/plan.md +466 -0
  87. package/plugins/compound-engineering/commands/workflows/review.md +514 -0
  88. package/plugins/compound-engineering/commands/workflows/work.md +363 -0
  89. package/plugins/compound-engineering/commands/xcode-test.md +331 -0
  90. package/plugins/compound-engineering/skills/agent-browser/SKILL.md +223 -0
  91. package/plugins/compound-engineering/skills/agent-native-architecture/SKILL.md +435 -0
  92. package/plugins/compound-engineering/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  93. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  94. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  95. package/plugins/compound-engineering/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  96. package/plugins/compound-engineering/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  97. package/plugins/compound-engineering/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  98. package/plugins/compound-engineering/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  99. package/plugins/compound-engineering/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  100. package/plugins/compound-engineering/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  101. package/plugins/compound-engineering/skills/agent-native-architecture/references/product-implications.md +443 -0
  102. package/plugins/compound-engineering/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  103. package/plugins/compound-engineering/skills/agent-native-architecture/references/self-modification.md +269 -0
  104. package/plugins/compound-engineering/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  105. package/plugins/compound-engineering/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  106. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  107. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  108. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  109. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  110. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  111. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  112. package/plugins/compound-engineering/skills/compound-docs/SKILL.md +510 -0
  113. package/plugins/compound-engineering/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  114. package/plugins/compound-engineering/skills/compound-docs/assets/resolution-template.md +93 -0
  115. package/plugins/compound-engineering/skills/compound-docs/references/yaml-schema.md +65 -0
  116. package/plugins/compound-engineering/skills/compound-docs/schema.yaml +176 -0
  117. package/plugins/compound-engineering/skills/create-agent-skills/SKILL.md +299 -0
  118. package/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md +226 -0
  119. package/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  120. package/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md +404 -0
  121. package/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md +595 -0
  122. package/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md +437 -0
  123. package/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md +175 -0
  124. package/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  125. package/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md +185 -0
  126. package/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md +168 -0
  127. package/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md +372 -0
  128. package/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md +113 -0
  129. package/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md +112 -0
  130. package/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  131. package/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md +73 -0
  132. package/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md +33 -0
  133. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md +96 -0
  134. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md +93 -0
  135. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md +74 -0
  136. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  137. package/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  138. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  139. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  140. package/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  141. package/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  142. package/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  143. package/plugins/compound-engineering/skills/dhh-rails-style/SKILL.md +185 -0
  144. package/plugins/compound-engineering/skills/dhh-rails-style/references/architecture.md +653 -0
  145. package/plugins/compound-engineering/skills/dhh-rails-style/references/controllers.md +303 -0
  146. package/plugins/compound-engineering/skills/dhh-rails-style/references/frontend.md +510 -0
  147. package/plugins/compound-engineering/skills/dhh-rails-style/references/gems.md +266 -0
  148. package/plugins/compound-engineering/skills/dhh-rails-style/references/models.md +359 -0
  149. package/plugins/compound-engineering/skills/dhh-rails-style/references/testing.md +338 -0
  150. package/plugins/compound-engineering/skills/dspy-ruby/SKILL.md +594 -0
  151. package/plugins/compound-engineering/skills/dspy-ruby/assets/config-template.rb +359 -0
  152. package/plugins/compound-engineering/skills/dspy-ruby/assets/module-template.rb +326 -0
  153. package/plugins/compound-engineering/skills/dspy-ruby/assets/signature-template.rb +143 -0
  154. package/plugins/compound-engineering/skills/dspy-ruby/references/core-concepts.md +265 -0
  155. package/plugins/compound-engineering/skills/dspy-ruby/references/optimization.md +623 -0
  156. package/plugins/compound-engineering/skills/dspy-ruby/references/providers.md +338 -0
  157. package/plugins/compound-engineering/skills/every-style-editor/SKILL.md +134 -0
  158. package/plugins/compound-engineering/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  159. package/plugins/compound-engineering/skills/file-todos/SKILL.md +251 -0
  160. package/plugins/compound-engineering/skills/file-todos/assets/todo-template.md +155 -0
  161. package/plugins/compound-engineering/skills/frontend-design/SKILL.md +42 -0
  162. package/plugins/compound-engineering/skills/gemini-imagegen/SKILL.md +237 -0
  163. package/plugins/compound-engineering/skills/gemini-imagegen/requirements.txt +2 -0
  164. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/compose_images.py +157 -0
  165. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/edit_image.py +144 -0
  166. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/gemini_images.py +263 -0
  167. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/generate_image.py +133 -0
  168. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/multi_turn_chat.py +216 -0
  169. package/plugins/compound-engineering/skills/git-worktree/SKILL.md +302 -0
  170. package/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh +345 -0
  171. package/plugins/compound-engineering/skills/rclone/SKILL.md +150 -0
  172. package/plugins/compound-engineering/skills/rclone/scripts/check_setup.sh +60 -0
  173. package/plugins/compound-engineering/skills/skill-creator/SKILL.md +209 -0
  174. package/plugins/compound-engineering/skills/skill-creator/scripts/init_skill.py +303 -0
  175. package/plugins/compound-engineering/skills/skill-creator/scripts/package_skill.py +110 -0
  176. package/plugins/compound-engineering/skills/skill-creator/scripts/quick_validate.py +65 -0
  177. package/src/commands/convert.ts +156 -0
  178. package/src/commands/install.ts +221 -0
  179. package/src/commands/list.ts +37 -0
  180. package/src/converters/claude-to-codex.ts +124 -0
  181. package/src/converters/claude-to-opencode.ts +392 -0
  182. package/src/index.ts +20 -0
  183. package/src/parsers/claude.ts +248 -0
  184. package/src/targets/codex.ts +91 -0
  185. package/src/targets/index.ts +29 -0
  186. package/src/targets/opencode.ts +48 -0
  187. package/src/types/claude.ts +88 -0
  188. package/src/types/codex.ts +23 -0
  189. package/src/types/opencode.ts +54 -0
  190. package/src/utils/codex-agents.ts +64 -0
  191. package/src/utils/files.ts +64 -0
  192. package/src/utils/frontmatter.ts +65 -0
  193. package/tests/claude-parser.test.ts +89 -0
  194. package/tests/cli.test.ts +289 -0
  195. package/tests/codex-agents.test.ts +62 -0
  196. package/tests/codex-converter.test.ts +121 -0
  197. package/tests/codex-writer.test.ts +76 -0
  198. package/tests/converter.test.ts +171 -0
  199. package/tests/fixtures/custom-paths/.claude-plugin/plugin.json +8 -0
  200. package/tests/fixtures/custom-paths/agents/default-agent.md +5 -0
  201. package/tests/fixtures/custom-paths/commands/default-command.md +5 -0
  202. package/tests/fixtures/custom-paths/custom-agents/custom-agent.md +5 -0
  203. package/tests/fixtures/custom-paths/custom-commands/custom-command.md +5 -0
  204. package/tests/fixtures/custom-paths/custom-hooks/hooks.json +7 -0
  205. package/tests/fixtures/custom-paths/custom-skills/custom-skill/SKILL.md +5 -0
  206. package/tests/fixtures/custom-paths/hooks/hooks.json +7 -0
  207. package/tests/fixtures/custom-paths/skills/default-skill/SKILL.md +5 -0
  208. package/tests/fixtures/invalid-command-path/.claude-plugin/plugin.json +5 -0
  209. package/tests/fixtures/invalid-hooks-path/.claude-plugin/plugin.json +5 -0
  210. package/tests/fixtures/invalid-mcp-path/.claude-plugin/plugin.json +5 -0
  211. package/tests/fixtures/mcp-file/.claude-plugin/plugin.json +5 -0
  212. package/tests/fixtures/mcp-file/.mcp.json +6 -0
  213. package/tests/fixtures/sample-plugin/.claude-plugin/plugin.json +30 -0
  214. package/tests/fixtures/sample-plugin/agents/agent-one.md +10 -0
  215. package/tests/fixtures/sample-plugin/agents/security-reviewer.md +7 -0
  216. package/tests/fixtures/sample-plugin/commands/command-one.md +7 -0
  217. package/tests/fixtures/sample-plugin/commands/model-command.md +8 -0
  218. package/tests/fixtures/sample-plugin/commands/nested/command-two.md +9 -0
  219. package/tests/fixtures/sample-plugin/commands/pattern-command.md +7 -0
  220. package/tests/fixtures/sample-plugin/commands/skill-command.md +7 -0
  221. package/tests/fixtures/sample-plugin/commands/todo-command.md +7 -0
  222. package/tests/fixtures/sample-plugin/hooks/hooks.json +156 -0
  223. package/tests/fixtures/sample-plugin/skills/skill-one/SKILL.md +6 -0
  224. package/tests/frontmatter.test.ts +20 -0
  225. package/tests/opencode-writer.test.ts +62 -0
  226. package/tsconfig.json +14 -0
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: workflows:compound
3
+ description: Document a recently solved problem to compound your team's knowledge
4
+ argument-hint: "[optional: brief context about the fix]"
5
+ ---
6
+
7
+ # /compound
8
+
9
+ Coordinate multiple subagents working in parallel to document a recently solved problem.
10
+
11
+ ## Purpose
12
+
13
+ Captures problem solutions while context is fresh, creating structured documentation in `docs/solutions/` with YAML frontmatter for searchability and future reference. Uses parallel subagents for maximum efficiency.
14
+
15
+ **Why "compound"?** Each documented solution compounds your team's knowledge. The first time you solve a problem takes research. Document it, and the next occurrence takes minutes. Knowledge compounds.
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ /workflows:compound # Document the most recent fix
21
+ /workflows:compound [brief context] # Provide additional context hint
22
+ ```
23
+
24
+ ## Execution Strategy: Parallel Subagents
25
+
26
+ This command launches multiple specialized subagents IN PARALLEL to maximize efficiency:
27
+
28
+ ### 1. **Context Analyzer** (Parallel)
29
+ - Extracts conversation history
30
+ - Identifies problem type, component, symptoms
31
+ - Validates against CORA schema
32
+ - Returns: YAML frontmatter skeleton
33
+
34
+ ### 2. **Solution Extractor** (Parallel)
35
+ - Analyzes all investigation steps
36
+ - Identifies root cause
37
+ - Extracts working solution with code examples
38
+ - Returns: Solution content block
39
+
40
+ ### 3. **Related Docs Finder** (Parallel)
41
+ - Searches `docs/solutions/` for related documentation
42
+ - Identifies cross-references and links
43
+ - Finds related GitHub issues
44
+ - Returns: Links and relationships
45
+
46
+ ### 4. **Prevention Strategist** (Parallel)
47
+ - Develops prevention strategies
48
+ - Creates best practices guidance
49
+ - Generates test cases if applicable
50
+ - Returns: Prevention/testing content
51
+
52
+ ### 5. **Category Classifier** (Parallel)
53
+ - Determines optimal `docs/solutions/` category
54
+ - Validates category against schema
55
+ - Suggests filename based on slug
56
+ - Returns: Final path and filename
57
+
58
+ ### 6. **Documentation Writer** (Parallel)
59
+ - Assembles complete markdown file
60
+ - Validates YAML frontmatter
61
+ - Formats content for readability
62
+ - Creates the file in correct location
63
+
64
+ ### 7. **Optional: Specialized Agent Invocation** (Post-Documentation)
65
+ Based on problem type detected, automatically invoke applicable agents:
66
+ - **performance_issue** → `performance-oracle`
67
+ - **security_issue** → `security-sentinel`
68
+ - **database_issue** → `data-integrity-guardian`
69
+ - **test_failure** → `cora-test-reviewer`
70
+ - Any code-heavy issue → `kieran-rails-reviewer` + `code-simplicity-reviewer`
71
+
72
+ ## What It Captures
73
+
74
+ - **Problem symptom**: Exact error messages, observable behavior
75
+ - **Investigation steps tried**: What didn't work and why
76
+ - **Root cause analysis**: Technical explanation
77
+ - **Working solution**: Step-by-step fix with code examples
78
+ - **Prevention strategies**: How to avoid in future
79
+ - **Cross-references**: Links to related issues and docs
80
+
81
+ ## Preconditions
82
+
83
+ <preconditions enforcement="advisory">
84
+ <check condition="problem_solved">
85
+ Problem has been solved (not in-progress)
86
+ </check>
87
+ <check condition="solution_verified">
88
+ Solution has been verified working
89
+ </check>
90
+ <check condition="non_trivial">
91
+ Non-trivial problem (not simple typo or obvious error)
92
+ </check>
93
+ </preconditions>
94
+
95
+ ## What It Creates
96
+
97
+ **Organized documentation:**
98
+
99
+ - File: `docs/solutions/[category]/[filename].md`
100
+
101
+ **Categories auto-detected from problem:**
102
+
103
+ - build-errors/
104
+ - test-failures/
105
+ - runtime-errors/
106
+ - performance-issues/
107
+ - database-issues/
108
+ - security-issues/
109
+ - ui-bugs/
110
+ - integration-issues/
111
+ - logic-errors/
112
+
113
+ ## Success Output
114
+
115
+ ```
116
+ ✓ Parallel documentation generation complete
117
+
118
+ Primary Subagent Results:
119
+ ✓ Context Analyzer: Identified performance_issue in brief_system
120
+ ✓ Solution Extractor: Extracted 3 code fixes
121
+ ✓ Related Docs Finder: Found 2 related issues
122
+ ✓ Prevention Strategist: Generated test cases
123
+ ✓ Category Classifier: docs/solutions/performance-issues/
124
+ ✓ Documentation Writer: Created complete markdown
125
+
126
+ Specialized Agent Reviews (Auto-Triggered):
127
+ ✓ performance-oracle: Validated query optimization approach
128
+ ✓ kieran-rails-reviewer: Code examples meet Rails standards
129
+ ✓ code-simplicity-reviewer: Solution is appropriately minimal
130
+ ✓ every-style-editor: Documentation style verified
131
+
132
+ File created:
133
+ - docs/solutions/performance-issues/n-plus-one-brief-generation.md
134
+
135
+ This documentation will be searchable for future reference when similar
136
+ issues occur in the Email Processing or Brief System modules.
137
+
138
+ What's next?
139
+ 1. Continue workflow (recommended)
140
+ 2. Link related documentation
141
+ 3. Update other references
142
+ 4. View documentation
143
+ 5. Other
144
+ ```
145
+
146
+ ## The Compounding Philosophy
147
+
148
+ This creates a compounding knowledge system:
149
+
150
+ 1. First time you solve "N+1 query in brief generation" → Research (30 min)
151
+ 2. Document the solution → docs/solutions/performance-issues/n-plus-one-briefs.md (5 min)
152
+ 3. Next time similar issue occurs → Quick lookup (2 min)
153
+ 4. Knowledge compounds → Team gets smarter
154
+
155
+ The feedback loop:
156
+
157
+ ```
158
+ Build → Test → Find Issue → Research → Improve → Document → Validate → Deploy
159
+ ↑ ↓
160
+ └──────────────────────────────────────────────────────────────────────┘
161
+ ```
162
+
163
+ **Each unit of engineering work should make subsequent units of work easier—not harder.**
164
+
165
+ ## Auto-Invoke
166
+
167
+ <auto_invoke> <trigger_phrases> - "that worked" - "it's fixed" - "working now" - "problem solved" </trigger_phrases>
168
+
169
+ <manual_override> Use /workflows:compound [context] to document immediately without waiting for auto-detection. </manual_override> </auto_invoke>
170
+
171
+ ## Routes To
172
+
173
+ `compound-docs` skill
174
+
175
+ ## Applicable Specialized Agents
176
+
177
+ Based on problem type, these agents can enhance documentation:
178
+
179
+ ### Code Quality & Review
180
+ - **kieran-rails-reviewer**: Reviews code examples for Rails best practices
181
+ - **code-simplicity-reviewer**: Ensures solution code is minimal and clear
182
+ - **pattern-recognition-specialist**: Identifies anti-patterns or repeating issues
183
+
184
+ ### Specific Domain Experts
185
+ - **performance-oracle**: Analyzes performance_issue category solutions
186
+ - **security-sentinel**: Reviews security_issue solutions for vulnerabilities
187
+ - **cora-test-reviewer**: Creates test cases for prevention strategies
188
+ - **data-integrity-guardian**: Reviews database_issue migrations and queries
189
+
190
+ ### Enhancement & Documentation
191
+ - **best-practices-researcher**: Enriches solution with industry best practices
192
+ - **every-style-editor**: Reviews documentation style and clarity
193
+ - **framework-docs-researcher**: Links to Rails/gem documentation references
194
+
195
+ ### When to Invoke
196
+ - **Auto-triggered** (optional): Agents can run post-documentation for enhancement
197
+ - **Manual trigger**: User can invoke agents after /workflows:compound completes for deeper review
198
+
199
+ ## Related Commands
200
+
201
+ - `/research [topic]` - Deep investigation (searches docs/solutions/ for patterns)
202
+ - `/workflows:plan` - Planning workflow (references documented solutions)
@@ -0,0 +1,466 @@
1
+ ---
2
+ name: workflows:plan
3
+ description: Transform feature descriptions into well-structured project plans following conventions
4
+ argument-hint: "[feature description, bug report, or improvement idea]"
5
+ ---
6
+
7
+ # Create a plan for a new feature or bug fix
8
+
9
+ ## Introduction
10
+
11
+ **Note: The current year is 2026.** Use this when dating plans and searching for recent documentation.
12
+
13
+ Transform feature descriptions, bug reports, or improvement ideas into well-structured markdown files issues that follow project conventions and best practices. This command provides flexible detail levels to match your needs.
14
+
15
+ ## Feature Description
16
+
17
+ <feature_description> #$ARGUMENTS </feature_description>
18
+
19
+ **If the feature description above is empty, ask the user:** "What would you like to plan? Please describe the feature, bug fix, or improvement you have in mind."
20
+
21
+ Do not proceed until you have a clear feature description from the user.
22
+
23
+ ### 0. Idea Refinement
24
+
25
+ Before running research, refine the idea through collaborative dialogue using the **AskUserQuestion tool**:
26
+
27
+ - Ask questions one at a time to understand the idea fully
28
+ - Prefer multiple choice questions when natural options exist
29
+ - Focus on understanding: purpose, constraints and success criteria
30
+ - Continue until the idea is clear OR user says "proceed"
31
+
32
+ **Skip option:** If the feature description is already detailed, offer:
33
+ "Your description is clear. Should I proceed with research, or would you like to refine it further?"
34
+
35
+ ## Main Tasks
36
+
37
+ ### 1. Repository Research & Context Gathering
38
+
39
+ <thinking>
40
+ First, I need to understand the project's conventions and existing patterns, leveraging all available resources and use paralel subagents to do this.
41
+ </thinking>
42
+
43
+ Runn these three agents in paralel at the same time:
44
+
45
+ - Task repo-research-analyst(feature_description)
46
+ - Task best-practices-researcher(feature_description)
47
+ - Task framework-docs-researcher(feature_description)
48
+
49
+ **Reference Collection:**
50
+
51
+ - [ ] Document all research findings with specific file paths (e.g., `app/services/example_service.rb:42`)
52
+ - [ ] Include URLs to external documentation and best practices guides
53
+ - [ ] Create a reference list of similar issues or PRs (e.g., `#123`, `#456`)
54
+ - [ ] Note any team conventions discovered in `CLAUDE.md` or team documentation
55
+
56
+ ### Research Validation (Optional)
57
+
58
+ After research agents complete, briefly validate alignment:
59
+
60
+ - Summarize key findings from research
61
+ - Ask if anything looks off or is missing
62
+ - User can confirm or request additional research on specific topics
63
+
64
+ ### 2. Issue Planning & Structure
65
+
66
+ <thinking>
67
+ Think like a product manager - what would make this issue clear and actionable? Consider multiple perspectives
68
+ </thinking>
69
+
70
+ **Title & Categorization:**
71
+
72
+ - [ ] Draft clear, searchable issue title using conventional format (e.g., `feat: Add user authentication`, `fix: Cart total calculation`)
73
+ - [ ] Determine issue type: enhancement, bug, refactor
74
+ - [ ] Convert title to kebab-case filename: strip prefix colon, lowercase, hyphens for spaces
75
+ - Example: `feat: Add User Authentication` → `feat-add-user-authentication.md`
76
+ - Keep it descriptive (3-5 words after prefix) so plans are findable by context
77
+
78
+ **Stakeholder Analysis:**
79
+
80
+ - [ ] Identify who will be affected by this issue (end users, developers, operations)
81
+ - [ ] Consider implementation complexity and required expertise
82
+
83
+ **Content Planning:**
84
+
85
+ - [ ] Choose appropriate detail level based on issue complexity and audience
86
+ - [ ] List all necessary sections for the chosen template
87
+ - [ ] Gather supporting materials (error logs, screenshots, design mockups)
88
+ - [ ] Prepare code examples or reproduction steps if applicable, name the mock filenames in the lists
89
+
90
+ ### 3. SpecFlow Analysis
91
+
92
+ After planning the issue structure, run SpecFlow Analyzer to validate and refine the feature specification:
93
+
94
+ - Task spec-flow-analyzer(feature_description, research_findings)
95
+
96
+ **SpecFlow Analyzer Output:**
97
+
98
+ - [ ] Review SpecFlow analysis results
99
+ - [ ] Incorporate any identified gaps or edge cases into the issue
100
+ - [ ] Update acceptance criteria based on SpecFlow findings
101
+
102
+ ### 4. Choose Implementation Detail Level
103
+
104
+ Select how comprehensive you want the issue to be, simpler is mostly better.
105
+
106
+ #### 📄 MINIMAL (Quick Issue)
107
+
108
+ **Best for:** Simple bugs, small improvements, clear features
109
+
110
+ **Includes:**
111
+
112
+ - Problem statement or feature description
113
+ - Basic acceptance criteria
114
+ - Essential context only
115
+
116
+ **Structure:**
117
+
118
+ ````markdown
119
+ [Brief problem/feature description]
120
+
121
+ ## Acceptance Criteria
122
+
123
+ - [ ] Core requirement 1
124
+ - [ ] Core requirement 2
125
+
126
+ ## Context
127
+
128
+ [Any critical information]
129
+
130
+ ## MVP
131
+
132
+ ### test.rb
133
+
134
+ ```ruby
135
+ class Test
136
+ def initialize
137
+ @name = "test"
138
+ end
139
+ end
140
+ ```
141
+
142
+ ## References
143
+
144
+ - Related issue: #[issue_number]
145
+ - Documentation: [relevant_docs_url]
146
+ ````
147
+
148
+ #### 📋 MORE (Standard Issue)
149
+
150
+ **Best for:** Most features, complex bugs, team collaboration
151
+
152
+ **Includes everything from MINIMAL plus:**
153
+
154
+ - Detailed background and motivation
155
+ - Technical considerations
156
+ - Success metrics
157
+ - Dependencies and risks
158
+ - Basic implementation suggestions
159
+
160
+ **Structure:**
161
+
162
+ ```markdown
163
+ ## Overview
164
+
165
+ [Comprehensive description]
166
+
167
+ ## Problem Statement / Motivation
168
+
169
+ [Why this matters]
170
+
171
+ ## Proposed Solution
172
+
173
+ [High-level approach]
174
+
175
+ ## Technical Considerations
176
+
177
+ - Architecture impacts
178
+ - Performance implications
179
+ - Security considerations
180
+
181
+ ## Acceptance Criteria
182
+
183
+ - [ ] Detailed requirement 1
184
+ - [ ] Detailed requirement 2
185
+ - [ ] Testing requirements
186
+
187
+ ## Success Metrics
188
+
189
+ [How we measure success]
190
+
191
+ ## Dependencies & Risks
192
+
193
+ [What could block or complicate this]
194
+
195
+ ## References & Research
196
+
197
+ - Similar implementations: [file_path:line_number]
198
+ - Best practices: [documentation_url]
199
+ - Related PRs: #[pr_number]
200
+ ```
201
+
202
+ #### 📚 A LOT (Comprehensive Issue)
203
+
204
+ **Best for:** Major features, architectural changes, complex integrations
205
+
206
+ **Includes everything from MORE plus:**
207
+
208
+ - Detailed implementation plan with phases
209
+ - Alternative approaches considered
210
+ - Extensive technical specifications
211
+ - Resource requirements and timeline
212
+ - Future considerations and extensibility
213
+ - Risk mitigation strategies
214
+ - Documentation requirements
215
+
216
+ **Structure:**
217
+
218
+ ```markdown
219
+ ## Overview
220
+
221
+ [Executive summary]
222
+
223
+ ## Problem Statement
224
+
225
+ [Detailed problem analysis]
226
+
227
+ ## Proposed Solution
228
+
229
+ [Comprehensive solution design]
230
+
231
+ ## Technical Approach
232
+
233
+ ### Architecture
234
+
235
+ [Detailed technical design]
236
+
237
+ ### Implementation Phases
238
+
239
+ #### Phase 1: [Foundation]
240
+
241
+ - Tasks and deliverables
242
+ - Success criteria
243
+ - Estimated effort
244
+
245
+ #### Phase 2: [Core Implementation]
246
+
247
+ - Tasks and deliverables
248
+ - Success criteria
249
+ - Estimated effort
250
+
251
+ #### Phase 3: [Polish & Optimization]
252
+
253
+ - Tasks and deliverables
254
+ - Success criteria
255
+ - Estimated effort
256
+
257
+ ## Alternative Approaches Considered
258
+
259
+ [Other solutions evaluated and why rejected]
260
+
261
+ ## Acceptance Criteria
262
+
263
+ ### Functional Requirements
264
+
265
+ - [ ] Detailed functional criteria
266
+
267
+ ### Non-Functional Requirements
268
+
269
+ - [ ] Performance targets
270
+ - [ ] Security requirements
271
+ - [ ] Accessibility standards
272
+
273
+ ### Quality Gates
274
+
275
+ - [ ] Test coverage requirements
276
+ - [ ] Documentation completeness
277
+ - [ ] Code review approval
278
+
279
+ ## Success Metrics
280
+
281
+ [Detailed KPIs and measurement methods]
282
+
283
+ ## Dependencies & Prerequisites
284
+
285
+ [Detailed dependency analysis]
286
+
287
+ ## Risk Analysis & Mitigation
288
+
289
+ [Comprehensive risk assessment]
290
+
291
+ ## Resource Requirements
292
+
293
+ [Team, time, infrastructure needs]
294
+
295
+ ## Future Considerations
296
+
297
+ [Extensibility and long-term vision]
298
+
299
+ ## Documentation Plan
300
+
301
+ [What docs need updating]
302
+
303
+ ## References & Research
304
+
305
+ ### Internal References
306
+
307
+ - Architecture decisions: [file_path:line_number]
308
+ - Similar features: [file_path:line_number]
309
+ - Configuration: [file_path:line_number]
310
+
311
+ ### External References
312
+
313
+ - Framework documentation: [url]
314
+ - Best practices guide: [url]
315
+ - Industry standards: [url]
316
+
317
+ ### Related Work
318
+
319
+ - Previous PRs: #[pr_numbers]
320
+ - Related issues: #[issue_numbers]
321
+ - Design documents: [links]
322
+ ```
323
+
324
+ ### 5. Issue Creation & Formatting
325
+
326
+ <thinking>
327
+ Apply best practices for clarity and actionability, making the issue easy to scan and understand
328
+ </thinking>
329
+
330
+ **Content Formatting:**
331
+
332
+ - [ ] Use clear, descriptive headings with proper hierarchy (##, ###)
333
+ - [ ] Include code examples in triple backticks with language syntax highlighting
334
+ - [ ] Add screenshots/mockups if UI-related (drag & drop or use image hosting)
335
+ - [ ] Use task lists (- [ ]) for trackable items that can be checked off
336
+ - [ ] Add collapsible sections for lengthy logs or optional details using `<details>` tags
337
+ - [ ] Apply appropriate emoji for visual scanning (🐛 bug, ✨ feature, 📚 docs, ♻️ refactor)
338
+
339
+ **Cross-Referencing:**
340
+
341
+ - [ ] Link to related issues/PRs using #number format
342
+ - [ ] Reference specific commits with SHA hashes when relevant
343
+ - [ ] Link to code using GitHub's permalink feature (press 'y' for permanent link)
344
+ - [ ] Mention relevant team members with @username if needed
345
+ - [ ] Add links to external resources with descriptive text
346
+
347
+ **Code & Examples:**
348
+
349
+ ````markdown
350
+ # Good example with syntax highlighting and line references
351
+
352
+
353
+ ```ruby
354
+ # app/services/user_service.rb:42
355
+ def process_user(user)
356
+
357
+ # Implementation here
358
+
359
+ end
360
+ ```
361
+
362
+ # Collapsible error logs
363
+
364
+ <details>
365
+ <summary>Full error stacktrace</summary>
366
+
367
+ `Error details here...`
368
+
369
+ </details>
370
+ ````
371
+
372
+ **AI-Era Considerations:**
373
+
374
+ - [ ] Account for accelerated development with AI pair programming
375
+ - [ ] Include prompts or instructions that worked well during research
376
+ - [ ] Note which AI tools were used for initial exploration (Claude, Copilot, etc.)
377
+ - [ ] Emphasize comprehensive testing given rapid implementation
378
+ - [ ] Document any AI-generated code that needs human review
379
+
380
+ ### 6. Final Review & Submission
381
+
382
+ **Pre-submission Checklist:**
383
+
384
+ - [ ] Title is searchable and descriptive
385
+ - [ ] Labels accurately categorize the issue
386
+ - [ ] All template sections are complete
387
+ - [ ] Links and references are working
388
+ - [ ] Acceptance criteria are measurable
389
+ - [ ] Add names of files in pseudo code examples and todo lists
390
+ - [ ] Add an ERD mermaid diagram if applicable for new model changes
391
+
392
+ ## Output Format
393
+
394
+ **Filename:** Use the kebab-case filename from Step 2 Title & Categorization.
395
+
396
+ ```
397
+ plans/<type>-<descriptive-name>.md
398
+ ```
399
+
400
+ Examples:
401
+ - ✅ `plans/feat-user-authentication-flow.md`
402
+ - ✅ `plans/fix-checkout-race-condition.md`
403
+ - ✅ `plans/refactor-api-client-extraction.md`
404
+ - ❌ `plans/plan-1.md` (not descriptive)
405
+ - ❌ `plans/new-feature.md` (too vague)
406
+ - ❌ `plans/feat: user auth.md` (invalid characters)
407
+
408
+ ## Post-Generation Options
409
+
410
+ After writing the plan file, use the **AskUserQuestion tool** to present these options:
411
+
412
+ **Question:** "Plan ready at `plans/<issue_title>.md`. What would you like to do next?"
413
+
414
+ **Options:**
415
+ 1. **Open plan in editor** - Open the plan file for review
416
+ 2. **Run `/deepen-plan`** - Enhance each section with parallel research agents (best practices, performance, UI)
417
+ 3. **Run `/plan_review`** - Get feedback from reviewers (DHH, Kieran, Simplicity)
418
+ 4. **Start `/workflows:work`** - Begin implementing this plan locally
419
+ 5. **Start `/workflows:work` on remote** - Begin implementing in Claude Code on the web (use `&` to run in background)
420
+ 6. **Create Issue** - Create issue in project tracker (GitHub/Linear)
421
+ 7. **Simplify** - Reduce detail level
422
+
423
+ Based on selection:
424
+ - **Open plan in editor** → Run `open plans/<issue_title>.md` to open the file in the user's default editor
425
+ - **`/deepen-plan`** → Call the /deepen-plan command with the plan file path to enhance with research
426
+ - **`/plan_review`** → Call the /plan_review command with the plan file path
427
+ - **`/workflows:work`** → Call the /workflows:work command with the plan file path
428
+ - **`/workflows:work` on remote** → Run `/workflows:work plans/<issue_title>.md &` to start work in background for Claude Code web
429
+ - **Create Issue** → See "Issue Creation" section below
430
+ - **Simplify** → Ask "What should I simplify?" then regenerate simpler version
431
+ - **Other** (automatically provided) → Accept free text for rework or specific changes
432
+
433
+ **Note:** If running `/workflows:plan` with ultrathink enabled, automatically run `/deepen-plan` after plan creation for maximum depth and grounding.
434
+
435
+ Loop back to options after Simplify or Other changes until user selects `/workflows:work` or `/plan_review`.
436
+
437
+ ## Issue Creation
438
+
439
+ When user selects "Create Issue", detect their project tracker from CLAUDE.md:
440
+
441
+ 1. **Check for tracker preference** in user's CLAUDE.md (global or project):
442
+ - Look for `project_tracker: github` or `project_tracker: linear`
443
+ - Or look for mentions of "GitHub Issues" or "Linear" in their workflow section
444
+
445
+ 2. **If GitHub:**
446
+ ```bash
447
+ # Extract title from plan filename (kebab-case to Title Case)
448
+ # Read plan content for body
449
+ gh issue create --title "feat: [Plan Title]" --body-file plans/<issue_title>.md
450
+ ```
451
+
452
+ 3. **If Linear:**
453
+ ```bash
454
+ # Use linear CLI if available, or provide instructions
455
+ # linear issue create --title "[Plan Title]" --description "$(cat plans/<issue_title>.md)"
456
+ ```
457
+
458
+ 4. **If no tracker configured:**
459
+ Ask user: "Which project tracker do you use? (GitHub/Linear/Other)"
460
+ - Suggest adding `project_tracker: github` or `project_tracker: linear` to their CLAUDE.md
461
+
462
+ 5. **After creation:**
463
+ - Display the issue URL
464
+ - Ask if they want to proceed to `/workflows:work` or `/plan_review`
465
+
466
+ NEVER CODE! Just research and write the plan.