@every-env/compound-plugin 0.9.0 → 2.34.2

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 (121) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.github/workflows/publish.yml +20 -10
  3. package/.releaserc.json +31 -0
  4. package/AGENTS.md +6 -1
  5. package/CHANGELOG.md +76 -0
  6. package/CLAUDE.md +16 -3
  7. package/README.md +83 -16
  8. package/bun.lock +977 -0
  9. package/docs/plans/2026-02-14-feat-auto-detect-install-and-gemini-sync-plan.md +360 -0
  10. package/docs/plans/2026-02-25-feat-windsurf-global-scope-support-plan.md +627 -0
  11. package/docs/plans/2026-03-01-feat-ce-command-aliases-backwards-compatible-deprecation-plan.md +261 -0
  12. package/docs/plans/2026-03-01-fix-setup-skill-non-claude-llm-fallback-plan.md +140 -0
  13. package/docs/plans/2026-03-03-feat-sync-claude-mcp-all-supported-providers-plan.md +639 -0
  14. package/docs/plans/feature_opencode-commands-as-md-and-config-merge.md +574 -0
  15. package/docs/solutions/adding-converter-target-providers.md +693 -0
  16. package/docs/solutions/plugin-versioning-requirements.md +7 -3
  17. package/docs/specs/windsurf.md +477 -0
  18. package/package.json +10 -4
  19. package/plans/landing-page-launchkit-refresh.md +2 -2
  20. package/plugins/compound-engineering/.claude-plugin/plugin.json +2 -2
  21. package/plugins/compound-engineering/CHANGELOG.md +82 -1
  22. package/plugins/compound-engineering/CLAUDE.md +14 -7
  23. package/plugins/compound-engineering/README.md +10 -7
  24. package/plugins/compound-engineering/agents/research/git-history-analyzer.md +1 -1
  25. package/plugins/compound-engineering/agents/research/learnings-researcher.md +1 -1
  26. package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +1 -1
  27. package/plugins/compound-engineering/commands/ce/brainstorm.md +145 -0
  28. package/plugins/compound-engineering/commands/ce/compound.md +240 -0
  29. package/plugins/compound-engineering/commands/ce/plan.md +636 -0
  30. package/plugins/compound-engineering/commands/ce/review.md +525 -0
  31. package/plugins/compound-engineering/commands/ce/work.md +470 -0
  32. package/plugins/compound-engineering/commands/create-agent-skill.md +1 -1
  33. package/plugins/compound-engineering/commands/deepen-plan.md +6 -6
  34. package/plugins/compound-engineering/commands/deploy-docs.md +1 -1
  35. package/plugins/compound-engineering/commands/feature-video.md +15 -6
  36. package/plugins/compound-engineering/commands/heal-skill.md +1 -1
  37. package/plugins/compound-engineering/commands/lfg.md +3 -3
  38. package/plugins/compound-engineering/commands/slfg.md +3 -3
  39. package/plugins/compound-engineering/commands/test-xcode.md +2 -2
  40. package/plugins/compound-engineering/commands/workflows/brainstorm.md +4 -123
  41. package/plugins/compound-engineering/commands/workflows/compound.md +4 -234
  42. package/plugins/compound-engineering/commands/workflows/plan.md +4 -562
  43. package/plugins/compound-engineering/commands/workflows/review.md +4 -522
  44. package/plugins/compound-engineering/commands/workflows/work.md +4 -448
  45. package/plugins/compound-engineering/skills/brainstorming/SKILL.md +3 -3
  46. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md +6 -0
  47. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md +6 -0
  48. package/plugins/compound-engineering/skills/document-review/SKILL.md +1 -1
  49. package/plugins/compound-engineering/skills/file-todos/SKILL.md +1 -1
  50. package/plugins/compound-engineering/skills/git-worktree/SKILL.md +5 -5
  51. package/plugins/compound-engineering/skills/proof/SKILL.md +185 -0
  52. package/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md +1 -1
  53. package/plugins/compound-engineering/skills/setup/SKILL.md +8 -2
  54. package/src/commands/convert.ts +101 -24
  55. package/src/commands/install.ts +102 -45
  56. package/src/commands/sync.ts +43 -62
  57. package/src/converters/claude-to-openclaw.ts +240 -0
  58. package/src/converters/claude-to-opencode.ts +12 -10
  59. package/src/converters/claude-to-qwen.ts +238 -0
  60. package/src/converters/claude-to-windsurf.ts +205 -0
  61. package/src/index.ts +2 -1
  62. package/src/parsers/claude-home.ts +55 -3
  63. package/src/sync/codex.ts +38 -62
  64. package/src/sync/commands.ts +198 -0
  65. package/src/sync/copilot.ts +14 -36
  66. package/src/sync/droid.ts +50 -9
  67. package/src/sync/gemini.ts +135 -0
  68. package/src/sync/json-config.ts +47 -0
  69. package/src/sync/kiro.ts +49 -0
  70. package/src/sync/mcp-transports.ts +19 -0
  71. package/src/sync/openclaw.ts +18 -0
  72. package/src/sync/opencode.ts +10 -30
  73. package/src/sync/pi.ts +12 -36
  74. package/src/sync/qwen.ts +66 -0
  75. package/src/sync/registry.ts +141 -0
  76. package/src/sync/skills.ts +21 -0
  77. package/src/sync/windsurf.ts +59 -0
  78. package/src/targets/index.ts +60 -1
  79. package/src/targets/openclaw.ts +96 -0
  80. package/src/targets/opencode.ts +76 -10
  81. package/src/targets/qwen.ts +64 -0
  82. package/src/targets/windsurf.ts +104 -0
  83. package/src/types/kiro.ts +3 -1
  84. package/src/types/openclaw.ts +52 -0
  85. package/src/types/opencode.ts +7 -8
  86. package/src/types/qwen.ts +51 -0
  87. package/src/types/windsurf.ts +35 -0
  88. package/src/utils/codex-agents.ts +1 -1
  89. package/src/utils/detect-tools.ts +37 -0
  90. package/src/utils/files.ts +14 -0
  91. package/src/utils/resolve-output.ts +50 -0
  92. package/src/utils/secrets.ts +24 -0
  93. package/src/utils/symlink.ts +4 -6
  94. package/tests/claude-home.test.ts +46 -0
  95. package/tests/cli.test.ts +180 -0
  96. package/tests/converter.test.ts +43 -10
  97. package/tests/detect-tools.test.ts +119 -0
  98. package/tests/openclaw-converter.test.ts +200 -0
  99. package/tests/opencode-writer.test.ts +142 -5
  100. package/tests/qwen-converter.test.ts +238 -0
  101. package/tests/resolve-output.test.ts +131 -0
  102. package/tests/sync-codex.test.ts +64 -0
  103. package/tests/sync-copilot.test.ts +60 -4
  104. package/tests/sync-droid.test.ts +44 -4
  105. package/tests/sync-gemini.test.ts +160 -0
  106. package/tests/sync-kiro.test.ts +83 -0
  107. package/tests/sync-openclaw.test.ts +51 -0
  108. package/tests/sync-qwen.test.ts +75 -0
  109. package/tests/sync-windsurf.test.ts +89 -0
  110. package/tests/windsurf-converter.test.ts +573 -0
  111. package/tests/windsurf-writer.test.ts +359 -0
  112. package/docs/css/docs.css +0 -675
  113. package/docs/css/style.css +0 -2886
  114. package/docs/index.html +0 -1046
  115. package/docs/js/main.js +0 -225
  116. package/docs/pages/agents.html +0 -649
  117. package/docs/pages/changelog.html +0 -534
  118. package/docs/pages/commands.html +0 -523
  119. package/docs/pages/getting-started.html +0 -582
  120. package/docs/pages/mcp-servers.html +0 -409
  121. package/docs/pages/skills.html +0 -611
@@ -35,7 +35,8 @@ agents/
35
35
  └── docs/ # Documentation agents
36
36
 
37
37
  commands/
38
- ├── workflows/ # Core workflow commands (workflows:plan, workflows:review, etc.)
38
+ ├── ce/ # Core workflow commands (ce:plan, ce:review, etc.)
39
+ ├── workflows/ # Deprecated aliases for ce:* commands
39
40
  └── *.md # Utility commands
40
41
 
41
42
  skills/
@@ -44,13 +45,14 @@ skills/
44
45
 
45
46
  ## Command Naming Convention
46
47
 
47
- **Workflow commands** use `workflows:` prefix to avoid collisions with built-in commands:
48
- - `/workflows:plan` - Create implementation plans
49
- - `/workflows:review` - Run comprehensive code reviews
50
- - `/workflows:work` - Execute work items systematically
51
- - `/workflows:compound` - Document solved problems
48
+ **Workflow commands** use `ce:` prefix to unambiguously identify them as compound-engineering commands:
49
+ - `/ce:plan` - Create implementation plans
50
+ - `/ce:review` - Run comprehensive code reviews
51
+ - `/ce:work` - Execute work items systematically
52
+ - `/ce:compound` - Document solved problems
53
+ - `/ce:brainstorm` - Explore requirements and approaches before planning
52
54
 
53
- **Why `workflows:`?** Claude Code has built-in `/plan` and `/review` commands. Using `name: workflows:plan` in frontmatter creates a unique `/workflows:plan` command with no collision.
55
+ **Why `ce:`?** Claude Code has built-in `/plan` and `/review` commands. The `ce:` namespace (short for compound-engineering) makes it immediately clear these commands belong to this plugin. The legacy `workflows:` prefix is still supported as deprecated aliases that forward to the `ce:*` equivalents.
54
56
 
55
57
  ## Skill Compliance Checklist
56
58
 
@@ -73,6 +75,11 @@ When adding or modifying skills, verify compliance with skill-creator spec:
73
75
  - [ ] Use imperative/infinitive form (verb-first instructions)
74
76
  - [ ] Avoid second person ("you should") - use objective language ("To accomplish X, do Y")
75
77
 
78
+ ### AskUserQuestion Usage
79
+
80
+ - [ ] If the skill uses `AskUserQuestion`, it must include an "Interaction Method" preamble explaining the numbered-list fallback for non-Claude environments
81
+ - [ ] Prefer avoiding `AskUserQuestion` entirely (see `brainstorming/SKILL.md` pattern) for skills intended to run cross-platform
82
+
76
83
  ### Quick Validation Command
77
84
 
78
85
  ```bash
@@ -8,7 +8,7 @@ AI-powered development tools that get smarter with every use. Make each unit of
8
8
  |-----------|-------|
9
9
  | Agents | 29 |
10
10
  | Commands | 22 |
11
- | Skills | 19 |
11
+ | Skills | 20 |
12
12
  | MCP Servers | 1 |
13
13
 
14
14
  ## Agents
@@ -73,15 +73,17 @@ Agents are organized into categories for easier discovery.
73
73
 
74
74
  ### Workflow Commands
75
75
 
76
- Core workflow commands use `workflows:` prefix to avoid collisions with built-in commands:
76
+ Core workflow commands use `ce:` prefix to unambiguously identify them as compound-engineering commands:
77
77
 
78
78
  | Command | Description |
79
79
  |---------|-------------|
80
- | `/workflows:brainstorm` | Explore requirements and approaches before planning |
81
- | `/workflows:plan` | Create implementation plans |
82
- | `/workflows:review` | Run comprehensive code reviews |
83
- | `/workflows:work` | Execute work items systematically |
84
- | `/workflows:compound` | Document solved problems to compound team knowledge |
80
+ | `/ce:brainstorm` | Explore requirements and approaches before planning |
81
+ | `/ce:plan` | Create implementation plans |
82
+ | `/ce:review` | Run comprehensive code reviews |
83
+ | `/ce:work` | Execute work items systematically |
84
+ | `/ce:compound` | Document solved problems to compound team knowledge |
85
+
86
+ > **Deprecated aliases:** `/workflows:plan`, `/workflows:work`, `/workflows:review`, `/workflows:brainstorm`, `/workflows:compound` still work but show a deprecation warning. Use `ce:*` equivalents.
85
87
 
86
88
  ### Utility Commands
87
89
 
@@ -134,6 +136,7 @@ Core workflow commands use `workflows:` prefix to avoid collisions with built-in
134
136
  | `every-style-editor` | Review copy for Every's style guide compliance |
135
137
  | `file-todos` | File-based todo tracking system |
136
138
  | `git-worktree` | Manage Git worktrees for parallel development |
139
+ | `proof` | Create, edit, and share documents via Proof collaborative editor |
137
140
  | `resolve-pr-parallel` | Resolve PR review comments in parallel |
138
141
  | `setup` | Configure which review agents run for your project |
139
142
 
@@ -56,4 +56,4 @@ When analyzing, consider:
56
56
 
57
57
  Your insights should help developers understand not just what the code does, but why it evolved to its current state, informing better decisions for future changes.
58
58
 
59
- Note that files in `docs/plans/` and `docs/solutions/` are compound-engineering pipeline artifacts created by `/workflows:plan`. They are intentional, permanent living documents — do not recommend their removal or characterize them as unnecessary.
59
+ Note that files in `docs/plans/` and `docs/solutions/` are compound-engineering pipeline artifacts created by `/ce:plan`. They are intentional, permanent living documents — do not recommend their removal or characterize them as unnecessary.
@@ -257,7 +257,7 @@ Structure your findings as:
257
257
  ## Integration Points
258
258
 
259
259
  This agent is designed to be invoked by:
260
- - `/workflows:plan` - To inform planning with institutional knowledge
260
+ - `/ce:plan` - To inform planning with institutional knowledge
261
261
  - `/deepen-plan` - To add depth with relevant learnings
262
262
  - Manual invocation before starting work on a feature
263
263
 
@@ -48,7 +48,7 @@ When reviewing code, you will:
48
48
  - Eliminate extensibility points without clear use cases
49
49
  - Question generic solutions for specific problems
50
50
  - Remove "just in case" code
51
- - Never flag `docs/plans/*.md` or `docs/solutions/*.md` for removal — these are compound-engineering pipeline artifacts created by `/workflows:plan` and used as living documents by `/workflows:work`
51
+ - Never flag `docs/plans/*.md` or `docs/solutions/*.md` for removal — these are compound-engineering pipeline artifacts created by `/ce:plan` and used as living documents by `/ce:work`
52
52
 
53
53
  6. **Optimize for Readability**:
54
54
  - Prefer self-documenting code over comments
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: ce:brainstorm
3
+ description: Explore requirements and approaches through collaborative dialogue before planning implementation
4
+ argument-hint: "[feature idea or problem to explore]"
5
+ ---
6
+
7
+ # Brainstorm a Feature or Improvement
8
+
9
+ **Note: The current year is 2026.** Use this when dating brainstorm documents.
10
+
11
+ Brainstorming helps answer **WHAT** to build through collaborative dialogue. It precedes `/ce:plan`, which answers **HOW** to build it.
12
+
13
+ **Process knowledge:** Load the `brainstorming` skill for detailed question techniques, approach exploration patterns, and YAGNI principles.
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 explore? Please describe the feature, problem, or improvement you're thinking about."
20
+
21
+ Do not proceed until you have a feature description from the user.
22
+
23
+ ## Execution Flow
24
+
25
+ ### Phase 0: Assess Requirements Clarity
26
+
27
+ Evaluate whether brainstorming is needed based on the feature description.
28
+
29
+ **Clear requirements indicators:**
30
+ - Specific acceptance criteria provided
31
+ - Referenced existing patterns to follow
32
+ - Described exact expected behavior
33
+ - Constrained, well-defined scope
34
+
35
+ **If requirements are already clear:**
36
+ Use **AskUserQuestion tool** to suggest: "Your requirements seem detailed enough to proceed directly to planning. Should I run `/ce:plan` instead, or would you like to explore the idea further?"
37
+
38
+ ### Phase 1: Understand the Idea
39
+
40
+ #### 1.1 Repository Research (Lightweight)
41
+
42
+ Run a quick repo scan to understand existing patterns:
43
+
44
+ - Task repo-research-analyst("Understand existing patterns related to: <feature_description>")
45
+
46
+ Focus on: similar features, established patterns, CLAUDE.md guidance.
47
+
48
+ #### 1.2 Collaborative Dialogue
49
+
50
+ Use the **AskUserQuestion tool** to ask questions **one at a time**.
51
+
52
+ **Guidelines (see `brainstorming` skill for detailed techniques):**
53
+ - Prefer multiple choice when natural options exist
54
+ - Start broad (purpose, users) then narrow (constraints, edge cases)
55
+ - Validate assumptions explicitly
56
+ - Ask about success criteria
57
+
58
+ **Exit condition:** Continue until the idea is clear OR user says "proceed"
59
+
60
+ ### Phase 2: Explore Approaches
61
+
62
+ Propose **2-3 concrete approaches** based on research and conversation.
63
+
64
+ For each approach, provide:
65
+ - Brief description (2-3 sentences)
66
+ - Pros and cons
67
+ - When it's best suited
68
+
69
+ Lead with your recommendation and explain why. Apply YAGNI—prefer simpler solutions.
70
+
71
+ Use **AskUserQuestion tool** to ask which approach the user prefers.
72
+
73
+ ### Phase 3: Capture the Design
74
+
75
+ Write a brainstorm document to `docs/brainstorms/YYYY-MM-DD-<topic>-brainstorm.md`.
76
+
77
+ **Document structure:** See the `brainstorming` skill for the template format. Key sections: What We're Building, Why This Approach, Key Decisions, Open Questions.
78
+
79
+ Ensure `docs/brainstorms/` directory exists before writing.
80
+
81
+ **IMPORTANT:** Before proceeding to Phase 4, check if there are any Open Questions listed in the brainstorm document. If there are open questions, YOU MUST ask the user about each one using AskUserQuestion before offering to proceed to planning. Move resolved questions to a "Resolved Questions" section.
82
+
83
+ ### Phase 4: Handoff
84
+
85
+ Use **AskUserQuestion tool** to present next steps:
86
+
87
+ **Question:** "Brainstorm captured. What would you like to do next?"
88
+
89
+ **Options:**
90
+ 1. **Review and refine** - Improve the document through structured self-review
91
+ 2. **Proceed to planning** - Run `/ce:plan` (will auto-detect this brainstorm)
92
+ 3. **Share to Proof** - Upload to Proof for collaborative review and sharing
93
+ 4. **Ask more questions** - I have more questions to clarify before moving on
94
+ 5. **Done for now** - Return later
95
+
96
+ **If user selects "Share to Proof":**
97
+
98
+ ```bash
99
+ CONTENT=$(cat docs/brainstorms/YYYY-MM-DD-<topic>-brainstorm.md)
100
+ TITLE="Brainstorm: <topic title>"
101
+ RESPONSE=$(curl -s -X POST https://www.proofeditor.ai/share/markdown \
102
+ -H "Content-Type: application/json" \
103
+ -d "$(jq -n --arg title "$TITLE" --arg markdown "$CONTENT" --arg by "ai:compound" '{title: $title, markdown: $markdown, by: $by}')")
104
+ PROOF_URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
105
+ ```
106
+
107
+ Display the URL prominently: `View & collaborate in Proof: <PROOF_URL>`
108
+
109
+ If the curl fails, skip silently. Then return to the Phase 4 options.
110
+
111
+ **If user selects "Ask more questions":** YOU (Claude) return to Phase 1.2 (Collaborative Dialogue) and continue asking the USER questions one at a time to further refine the design. The user wants YOU to probe deeper - ask about edge cases, constraints, preferences, or areas not yet explored. Continue until the user is satisfied, then return to Phase 4.
112
+
113
+ **If user selects "Review and refine":**
114
+
115
+ Load the `document-review` skill and apply it to the brainstorm document.
116
+
117
+ When document-review returns "Review complete", present next steps:
118
+
119
+ 1. **Move to planning** - Continue to `/ce:plan` with this document
120
+ 2. **Done for now** - Brainstorming complete. To start planning later: `/ce:plan [document-path]`
121
+
122
+ ## Output Summary
123
+
124
+ When complete, display:
125
+
126
+ ```
127
+ Brainstorm complete!
128
+
129
+ Document: docs/brainstorms/YYYY-MM-DD-<topic>-brainstorm.md
130
+
131
+ Key decisions:
132
+ - [Decision 1]
133
+ - [Decision 2]
134
+
135
+ Next: Run `/ce:plan` when ready to implement.
136
+ ```
137
+
138
+ ## Important Guidelines
139
+
140
+ - **Stay focused on WHAT, not HOW** - Implementation details belong in the plan
141
+ - **Ask one question at a time** - Don't overwhelm
142
+ - **Apply YAGNI** - Prefer simpler approaches
143
+ - **Keep outputs concise** - 200-300 words per section max
144
+
145
+ NEVER CODE! Just explore and document decisions.
@@ -0,0 +1,240 @@
1
+ ---
2
+ name: ce: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
+ /ce:compound # Document the most recent fix
21
+ /ce:compound [brief context] # Provide additional context hint
22
+ ```
23
+
24
+ ## Execution Strategy: Two-Phase Orchestration
25
+
26
+ <critical_requirement>
27
+ **Only ONE file gets written - the final documentation.**
28
+
29
+ Phase 1 subagents return TEXT DATA to the orchestrator. They must NOT use Write, Edit, or create any files. Only the orchestrator (Phase 2) writes the final documentation file.
30
+ </critical_requirement>
31
+
32
+ ### Phase 1: Parallel Research
33
+
34
+ <parallel_tasks>
35
+
36
+ Launch these subagents IN PARALLEL. Each returns text data to the orchestrator.
37
+
38
+ #### 1. **Context Analyzer**
39
+ - Extracts conversation history
40
+ - Identifies problem type, component, symptoms
41
+ - Validates against schema
42
+ - Returns: YAML frontmatter skeleton
43
+
44
+ #### 2. **Solution Extractor**
45
+ - Analyzes all investigation steps
46
+ - Identifies root cause
47
+ - Extracts working solution with code examples
48
+ - Returns: Solution content block
49
+
50
+ #### 3. **Related Docs Finder**
51
+ - Searches `docs/solutions/` for related documentation
52
+ - Identifies cross-references and links
53
+ - Finds related GitHub issues
54
+ - Returns: Links and relationships
55
+
56
+ #### 4. **Prevention Strategist**
57
+ - Develops prevention strategies
58
+ - Creates best practices guidance
59
+ - Generates test cases if applicable
60
+ - Returns: Prevention/testing content
61
+
62
+ #### 5. **Category Classifier**
63
+ - Determines optimal `docs/solutions/` category
64
+ - Validates category against schema
65
+ - Suggests filename based on slug
66
+ - Returns: Final path and filename
67
+
68
+ </parallel_tasks>
69
+
70
+ ### Phase 2: Assembly & Write
71
+
72
+ <sequential_tasks>
73
+
74
+ **WAIT for all Phase 1 subagents to complete before proceeding.**
75
+
76
+ The orchestrating agent (main conversation) performs these steps:
77
+
78
+ 1. Collect all text results from Phase 1 subagents
79
+ 2. Assemble complete markdown file from the collected pieces
80
+ 3. Validate YAML frontmatter against schema
81
+ 4. Create directory if needed: `mkdir -p docs/solutions/[category]/`
82
+ 5. Write the SINGLE final file: `docs/solutions/[category]/[filename].md`
83
+
84
+ </sequential_tasks>
85
+
86
+ ### Phase 3: Optional Enhancement
87
+
88
+ **WAIT for Phase 2 to complete before proceeding.**
89
+
90
+ <parallel_tasks>
91
+
92
+ Based on problem type, optionally invoke specialized agents to review the documentation:
93
+
94
+ - **performance_issue** → `performance-oracle`
95
+ - **security_issue** → `security-sentinel`
96
+ - **database_issue** → `data-integrity-guardian`
97
+ - **test_failure** → `cora-test-reviewer`
98
+ - Any code-heavy issue → `kieran-rails-reviewer` + `code-simplicity-reviewer`
99
+
100
+ </parallel_tasks>
101
+
102
+ ## What It Captures
103
+
104
+ - **Problem symptom**: Exact error messages, observable behavior
105
+ - **Investigation steps tried**: What didn't work and why
106
+ - **Root cause analysis**: Technical explanation
107
+ - **Working solution**: Step-by-step fix with code examples
108
+ - **Prevention strategies**: How to avoid in future
109
+ - **Cross-references**: Links to related issues and docs
110
+
111
+ ## Preconditions
112
+
113
+ <preconditions enforcement="advisory">
114
+ <check condition="problem_solved">
115
+ Problem has been solved (not in-progress)
116
+ </check>
117
+ <check condition="solution_verified">
118
+ Solution has been verified working
119
+ </check>
120
+ <check condition="non_trivial">
121
+ Non-trivial problem (not simple typo or obvious error)
122
+ </check>
123
+ </preconditions>
124
+
125
+ ## What It Creates
126
+
127
+ **Organized documentation:**
128
+
129
+ - File: `docs/solutions/[category]/[filename].md`
130
+
131
+ **Categories auto-detected from problem:**
132
+
133
+ - build-errors/
134
+ - test-failures/
135
+ - runtime-errors/
136
+ - performance-issues/
137
+ - database-issues/
138
+ - security-issues/
139
+ - ui-bugs/
140
+ - integration-issues/
141
+ - logic-errors/
142
+
143
+ ## Common Mistakes to Avoid
144
+
145
+ | ❌ Wrong | ✅ Correct |
146
+ |----------|-----------|
147
+ | Subagents write files like `context-analysis.md`, `solution-draft.md` | Subagents return text data; orchestrator writes one final file |
148
+ | Research and assembly run in parallel | Research completes → then assembly runs |
149
+ | Multiple files created during workflow | Single file: `docs/solutions/[category]/[filename].md` |
150
+
151
+ ## Success Output
152
+
153
+ ```
154
+ ✓ Documentation complete
155
+
156
+ Subagent Results:
157
+ ✓ Context Analyzer: Identified performance_issue in brief_system
158
+ ✓ Solution Extractor: 3 code fixes
159
+ ✓ Related Docs Finder: 2 related issues
160
+ ✓ Prevention Strategist: Prevention strategies, test suggestions
161
+ ✓ Category Classifier: `performance-issues`
162
+
163
+ Specialized Agent Reviews (Auto-Triggered):
164
+ ✓ performance-oracle: Validated query optimization approach
165
+ ✓ kieran-rails-reviewer: Code examples meet Rails standards
166
+ ✓ code-simplicity-reviewer: Solution is appropriately minimal
167
+ ✓ every-style-editor: Documentation style verified
168
+
169
+ File created:
170
+ - docs/solutions/performance-issues/n-plus-one-brief-generation.md
171
+
172
+ This documentation will be searchable for future reference when similar
173
+ issues occur in the Email Processing or Brief System modules.
174
+
175
+ What's next?
176
+ 1. Continue workflow (recommended)
177
+ 2. Link related documentation
178
+ 3. Update other references
179
+ 4. View documentation
180
+ 5. Other
181
+ ```
182
+
183
+ ## The Compounding Philosophy
184
+
185
+ This creates a compounding knowledge system:
186
+
187
+ 1. First time you solve "N+1 query in brief generation" → Research (30 min)
188
+ 2. Document the solution → docs/solutions/performance-issues/n-plus-one-briefs.md (5 min)
189
+ 3. Next time similar issue occurs → Quick lookup (2 min)
190
+ 4. Knowledge compounds → Team gets smarter
191
+
192
+ The feedback loop:
193
+
194
+ ```
195
+ Build → Test → Find Issue → Research → Improve → Document → Validate → Deploy
196
+ ↑ ↓
197
+ └──────────────────────────────────────────────────────────────────────┘
198
+ ```
199
+
200
+ **Each unit of engineering work should make subsequent units of work easier—not harder.**
201
+
202
+ ## Auto-Invoke
203
+
204
+ <auto_invoke> <trigger_phrases> - "that worked" - "it's fixed" - "working now" - "problem solved" </trigger_phrases>
205
+
206
+ <manual_override> Use /ce:compound [context] to document immediately without waiting for auto-detection. </manual_override> </auto_invoke>
207
+
208
+ ## Routes To
209
+
210
+ `compound-docs` skill
211
+
212
+ ## Applicable Specialized Agents
213
+
214
+ Based on problem type, these agents can enhance documentation:
215
+
216
+ ### Code Quality & Review
217
+ - **kieran-rails-reviewer**: Reviews code examples for Rails best practices
218
+ - **code-simplicity-reviewer**: Ensures solution code is minimal and clear
219
+ - **pattern-recognition-specialist**: Identifies anti-patterns or repeating issues
220
+
221
+ ### Specific Domain Experts
222
+ - **performance-oracle**: Analyzes performance_issue category solutions
223
+ - **security-sentinel**: Reviews security_issue solutions for vulnerabilities
224
+ - **cora-test-reviewer**: Creates test cases for prevention strategies
225
+ - **data-integrity-guardian**: Reviews database_issue migrations and queries
226
+
227
+ ### Enhancement & Documentation
228
+ - **best-practices-researcher**: Enriches solution with industry best practices
229
+ - **every-style-editor**: Reviews documentation style and clarity
230
+ - **framework-docs-researcher**: Links to Rails/gem documentation references
231
+
232
+ ### When to Invoke
233
+ - **Auto-triggered** (optional): Agents can run post-documentation for enhancement
234
+ - **Manual trigger**: User can invoke agents after /ce:compound completes for deeper review
235
+ - **Customize agents**: Edit `compound-engineering.local.md` or invoke the `setup` skill to configure which review agents are used across all workflows
236
+
237
+ ## Related Commands
238
+
239
+ - `/research [topic]` - Deep investigation (searches docs/solutions/ for patterns)
240
+ - `/ce:plan` - Planning workflow (references documented solutions)