@every-env/compound-plugin 0.1.0 → 0.2.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.
- package/.claude/commands/triage-prs.md +193 -0
- package/.claude-plugin/marketplace.json +4 -4
- package/.github/workflows/ci.yml +25 -0
- package/README.md +25 -4
- package/docs/index.html +14 -14
- package/docs/pages/changelog.html +1 -1
- package/docs/pages/getting-started.html +1 -1
- package/docs/plans/2026-02-08-feat-pr-triage-and-merge-plan.md +128 -0
- package/package.json +1 -1
- package/plans/grow-your-own-garden-plugin-architecture.md +1 -1
- package/plugins/compound-engineering/.claude-plugin/plugin.json +3 -3
- package/plugins/compound-engineering/CHANGELOG.md +32 -0
- package/plugins/compound-engineering/CLAUDE.md +3 -4
- package/plugins/compound-engineering/README.md +20 -7
- package/plugins/compound-engineering/agents/research/best-practices-researcher.md +14 -3
- package/plugins/compound-engineering/agents/research/framework-docs-researcher.md +11 -3
- package/plugins/compound-engineering/agents/research/git-history-analyzer.md +2 -0
- package/plugins/compound-engineering/agents/research/learnings-researcher.md +243 -0
- package/plugins/compound-engineering/agents/research/repo-research-analyst.md +5 -4
- package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +1 -0
- package/plugins/compound-engineering/agents/review/pattern-recognition-specialist.md +1 -1
- package/plugins/compound-engineering/agents/review/schema-drift-detector.md +139 -0
- package/plugins/compound-engineering/commands/deepen-plan.md +5 -5
- package/plugins/compound-engineering/commands/report-bug.md +3 -3
- package/plugins/compound-engineering/commands/resolve_todo_parallel.md +2 -0
- package/plugins/compound-engineering/commands/slfg.md +31 -0
- package/plugins/compound-engineering/commands/technical_review.md +7 -0
- package/plugins/compound-engineering/commands/workflows/brainstorm.md +124 -0
- package/plugins/compound-engineering/commands/workflows/compound.md +64 -27
- package/plugins/compound-engineering/commands/workflows/plan.md +127 -42
- package/plugins/compound-engineering/commands/workflows/review.md +12 -0
- package/plugins/compound-engineering/commands/workflows/work.md +72 -2
- package/plugins/compound-engineering/skills/brainstorming/SKILL.md +190 -0
- package/plugins/compound-engineering/skills/compound-docs/SKILL.md +9 -9
- package/plugins/compound-engineering/skills/compound-docs/assets/critical-pattern-template.md +1 -1
- package/plugins/compound-engineering/skills/compound-docs/assets/resolution-template.md +3 -3
- package/plugins/compound-engineering/skills/compound-docs/references/yaml-schema.md +1 -1
- package/plugins/compound-engineering/skills/create-agent-skills/SKILL.md +168 -192
- package/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md +74 -125
- package/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md +109 -329
- package/plugins/compound-engineering/skills/document-review/SKILL.md +87 -0
- package/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh +2 -10
- package/plugins/compound-engineering/skills/orchestrating-swarms/SKILL.md +1717 -0
- package/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md +89 -0
- package/plugins/compound-engineering/skills/resolve-pr-parallel/scripts/get-pr-comments +68 -0
- package/plugins/compound-engineering/skills/resolve-pr-parallel/scripts/resolve-pr-thread +23 -0
- package/src/commands/install.ts +3 -1
- package/src/commands/sync.ts +84 -0
- package/src/converters/claude-to-codex.ts +59 -2
- package/src/converters/claude-to-opencode.ts +7 -5
- package/src/index.ts +2 -0
- package/src/parsers/claude-home.ts +65 -0
- package/src/sync/codex.ts +92 -0
- package/src/sync/opencode.ts +75 -0
- package/src/targets/codex.ts +7 -2
- package/src/targets/opencode.ts +11 -2
- package/src/types/claude.ts +1 -1
- package/src/utils/files.ts +13 -0
- package/src/utils/symlink.ts +43 -0
- package/tests/cli.test.ts +7 -5
- package/tests/codex-converter.test.ts +83 -0
- package/tests/codex-writer.test.ts +32 -0
- package/tests/opencode-writer.test.ts +57 -0
- package/plugins/compound-engineering/commands/plan_review.md +0 -7
- package/plugins/compound-engineering/commands/resolve_pr_parallel.md +0 -49
|
@@ -6,16 +6,16 @@ AI-powered development tools that get smarter with every use. Make each unit of
|
|
|
6
6
|
|
|
7
7
|
| Component | Count |
|
|
8
8
|
|-----------|-------|
|
|
9
|
-
| Agents |
|
|
10
|
-
| Commands |
|
|
11
|
-
| Skills |
|
|
9
|
+
| Agents | 29 |
|
|
10
|
+
| Commands | 25 |
|
|
11
|
+
| Skills | 16 |
|
|
12
12
|
| MCP Servers | 1 |
|
|
13
13
|
|
|
14
14
|
## Agents
|
|
15
15
|
|
|
16
16
|
Agents are organized into categories for easier discovery.
|
|
17
17
|
|
|
18
|
-
### Review (
|
|
18
|
+
### Review (15)
|
|
19
19
|
|
|
20
20
|
| Agent | Description |
|
|
21
21
|
|-------|-------------|
|
|
@@ -26,21 +26,23 @@ Agents are organized into categories for easier discovery.
|
|
|
26
26
|
| `data-migration-expert` | Validate ID mappings match production, check for swapped values |
|
|
27
27
|
| `deployment-verification-agent` | Create Go/No-Go deployment checklists for risky data changes |
|
|
28
28
|
| `dhh-rails-reviewer` | Rails review from DHH's perspective |
|
|
29
|
+
| `julik-frontend-races-reviewer` | Review JavaScript/Stimulus code for race conditions |
|
|
29
30
|
| `kieran-rails-reviewer` | Rails code review with strict conventions |
|
|
30
31
|
| `kieran-python-reviewer` | Python code review with strict conventions |
|
|
31
32
|
| `kieran-typescript-reviewer` | TypeScript code review with strict conventions |
|
|
32
33
|
| `pattern-recognition-specialist` | Analyze code for patterns and anti-patterns |
|
|
33
34
|
| `performance-oracle` | Performance analysis and optimization |
|
|
35
|
+
| `schema-drift-detector` | Detect unrelated schema.rb changes in PRs |
|
|
34
36
|
| `security-sentinel` | Security audits and vulnerability assessments |
|
|
35
|
-
| `julik-frontend-races-reviewer` | Review JavaScript/Stimulus code for race conditions |
|
|
36
37
|
|
|
37
|
-
### Research (
|
|
38
|
+
### Research (5)
|
|
38
39
|
|
|
39
40
|
| Agent | Description |
|
|
40
41
|
|-------|-------------|
|
|
41
42
|
| `best-practices-researcher` | Gather external best practices and examples |
|
|
42
43
|
| `framework-docs-researcher` | Research framework documentation and best practices |
|
|
43
44
|
| `git-history-analyzer` | Analyze git history and code evolution |
|
|
45
|
+
| `learnings-researcher` | Search institutional learnings for relevant past solutions |
|
|
44
46
|
| `repo-research-analyst` | Research repository structure and conventions |
|
|
45
47
|
|
|
46
48
|
### Design (3)
|
|
@@ -75,6 +77,7 @@ Core workflow commands use `workflows:` prefix to avoid collisions with built-in
|
|
|
75
77
|
|
|
76
78
|
| Command | Description |
|
|
77
79
|
|---------|-------------|
|
|
80
|
+
| `/workflows:brainstorm` | Explore requirements and approaches before planning |
|
|
78
81
|
| `/workflows:plan` | Create implementation plans |
|
|
79
82
|
| `/workflows:review` | Run comprehensive code reviews |
|
|
80
83
|
| `/workflows:work` | Execute work items systematically |
|
|
@@ -84,12 +87,14 @@ Core workflow commands use `workflows:` prefix to avoid collisions with built-in
|
|
|
84
87
|
|
|
85
88
|
| Command | Description |
|
|
86
89
|
|---------|-------------|
|
|
90
|
+
| `/lfg` | Full autonomous engineering workflow |
|
|
91
|
+
| `/slfg` | Full autonomous workflow with swarm mode for parallel execution |
|
|
87
92
|
| `/deepen-plan` | Enhance plans with parallel research agents for each section |
|
|
88
93
|
| `/changelog` | Create engaging changelogs for recent merges |
|
|
89
94
|
| `/create-agent-skill` | Create or edit Claude Code skills |
|
|
90
95
|
| `/generate_command` | Generate new slash commands |
|
|
91
96
|
| `/heal-skill` | Fix skill documentation issues |
|
|
92
|
-
| `/
|
|
97
|
+
| `/technical_review` | Multi-agent technical/architecture review in parallel |
|
|
93
98
|
| `/report-bug` | Report a bug in the plugin |
|
|
94
99
|
| `/reproduce-bug` | Reproduce bugs using logs and console |
|
|
95
100
|
| `/resolve_parallel` | Resolve TODO comments in parallel |
|
|
@@ -124,10 +129,18 @@ Core workflow commands use `workflows:` prefix to avoid collisions with built-in
|
|
|
124
129
|
|
|
125
130
|
| Skill | Description |
|
|
126
131
|
|-------|-------------|
|
|
132
|
+
| `brainstorming` | Explore requirements and approaches through collaborative dialogue |
|
|
133
|
+
| `document-review` | Improve documents through structured self-review |
|
|
127
134
|
| `every-style-editor` | Review copy for Every's style guide compliance |
|
|
128
135
|
| `file-todos` | File-based todo tracking system |
|
|
129
136
|
| `git-worktree` | Manage Git worktrees for parallel development |
|
|
130
137
|
|
|
138
|
+
### Multi-Agent Orchestration
|
|
139
|
+
|
|
140
|
+
| Skill | Description |
|
|
141
|
+
|-------|-------------|
|
|
142
|
+
| `orchestrating-swarms` | Comprehensive guide to multi-agent swarm orchestration |
|
|
143
|
+
|
|
131
144
|
### File Transfer
|
|
132
145
|
|
|
133
146
|
| Skill | Description |
|
|
@@ -37,12 +37,23 @@ Before going online, check if curated knowledge already exists in skills:
|
|
|
37
37
|
|
|
38
38
|
4. **Assess Coverage**:
|
|
39
39
|
- If skills provide comprehensive guidance → summarize and deliver
|
|
40
|
-
- If skills provide partial guidance → note what's covered, proceed to Phase 2 for gaps
|
|
41
|
-
- If no relevant skills found → proceed to Phase 2
|
|
40
|
+
- If skills provide partial guidance → note what's covered, proceed to Phase 1.5 and Phase 2 for gaps
|
|
41
|
+
- If no relevant skills found → proceed to Phase 1.5 and Phase 2
|
|
42
|
+
|
|
43
|
+
### Phase 1.5: MANDATORY Deprecation Check (for external APIs/services)
|
|
44
|
+
|
|
45
|
+
**Before recommending any external API, OAuth flow, SDK, or third-party service:**
|
|
46
|
+
|
|
47
|
+
1. Search for deprecation: `"[API name] deprecated [current year] sunset shutdown"`
|
|
48
|
+
2. Search for breaking changes: `"[API name] breaking changes migration"`
|
|
49
|
+
3. Check official documentation for deprecation banners or sunset notices
|
|
50
|
+
4. **Report findings before proceeding** - do not recommend deprecated APIs
|
|
51
|
+
|
|
52
|
+
**Why this matters:** Google Photos Library API scopes were deprecated March 2025. Without this check, developers can waste hours debugging "insufficient scopes" errors on dead APIs. 5 minutes of validation saves hours of debugging.
|
|
42
53
|
|
|
43
54
|
### Phase 2: Online Research (If Needed)
|
|
44
55
|
|
|
45
|
-
Only after checking skills, gather additional information:
|
|
56
|
+
Only after checking skills AND verifying API availability, gather additional information:
|
|
46
57
|
|
|
47
58
|
1. **Leverage External Sources**:
|
|
48
59
|
- Use Context7 MCP to access official documentation from GitHub, framework docs, and library references
|
|
@@ -41,19 +41,26 @@ You are a meticulous Framework Documentation Researcher specializing in gatherin
|
|
|
41
41
|
- Determine the installed version from Gemfile.lock or package files
|
|
42
42
|
- Understand the specific feature or problem being addressed
|
|
43
43
|
|
|
44
|
-
2. **
|
|
44
|
+
2. **MANDATORY: Deprecation/Sunset Check** (for external APIs, OAuth, third-party services):
|
|
45
|
+
- Search: `"[API/service name] deprecated [current year] sunset shutdown"`
|
|
46
|
+
- Search: `"[API/service name] breaking changes migration"`
|
|
47
|
+
- Check official docs for deprecation banners or sunset notices
|
|
48
|
+
- **Report findings before proceeding** - do not recommend deprecated APIs
|
|
49
|
+
- Example: Google Photos Library API scopes were deprecated March 2025
|
|
50
|
+
|
|
51
|
+
3. **Documentation Collection**:
|
|
45
52
|
- Start with Context7 to fetch official documentation
|
|
46
53
|
- If Context7 is unavailable or incomplete, use web search as fallback
|
|
47
54
|
- Prioritize official sources over third-party tutorials
|
|
48
55
|
- Collect multiple perspectives when official docs are unclear
|
|
49
56
|
|
|
50
|
-
|
|
57
|
+
4. **Source Exploration**:
|
|
51
58
|
- Use `bundle show` to find gem locations
|
|
52
59
|
- Read through key source files related to the feature
|
|
53
60
|
- Look for tests that demonstrate usage patterns
|
|
54
61
|
- Check for configuration examples in the codebase
|
|
55
62
|
|
|
56
|
-
|
|
63
|
+
5. **Synthesis and Reporting**:
|
|
57
64
|
- Organize findings by relevance to the current task
|
|
58
65
|
- Highlight version-specific considerations
|
|
59
66
|
- Provide code examples adapted to the project's style
|
|
@@ -61,6 +68,7 @@ You are a meticulous Framework Documentation Researcher specializing in gatherin
|
|
|
61
68
|
|
|
62
69
|
**Quality Standards:**
|
|
63
70
|
|
|
71
|
+
- **ALWAYS check for API deprecation first** when researching external APIs or services
|
|
64
72
|
- Always verify version compatibility with the project's dependencies
|
|
65
73
|
- Prioritize official documentation but supplement with community resources
|
|
66
74
|
- Provide practical, actionable insights rather than generic information
|
|
@@ -40,3 +40,5 @@ When analyzing, consider:
|
|
|
40
40
|
- The evolution of coding patterns and practices over time
|
|
41
41
|
|
|
42
42
|
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.
|
|
43
|
+
|
|
44
|
+
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.
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learnings-researcher
|
|
3
|
+
description: "Use this agent when you need to search institutional learnings in docs/solutions/ for relevant past solutions before implementing a new feature or fixing a problem. This agent efficiently filters documented solutions by frontmatter metadata (tags, category, module, symptoms) to find applicable patterns, gotchas, and lessons learned. The agent excels at preventing repeated mistakes by surfacing relevant institutional knowledge before work begins.\\n\\n<example>Context: User is about to implement a feature involving email processing.\\nuser: \"I need to add email threading to the brief system\"\\nassistant: \"I'll use the learnings-researcher agent to check docs/solutions/ for any relevant learnings about email processing or brief system implementations.\"\\n<commentary>Since the user is implementing a feature in a documented domain, use the learnings-researcher agent to surface relevant past solutions before starting work.</commentary></example>\\n\\n<example>Context: User is debugging a performance issue.\\nuser: \"Brief generation is slow, taking over 5 seconds\"\\nassistant: \"Let me use the learnings-researcher agent to search for documented performance issues, especially any involving briefs or N+1 queries.\"\\n<commentary>The user has symptoms matching potential documented solutions, so use the learnings-researcher agent to find relevant learnings before debugging.</commentary></example>\\n\\n<example>Context: Planning a new feature that touches multiple modules.\\nuser: \"I need to add Stripe subscription handling to the payments module\"\\nassistant: \"I'll use the learnings-researcher agent to search for any documented learnings about payments, integrations, or Stripe specifically.\"\\n<commentary>Before implementing, check institutional knowledge for gotchas, patterns, and lessons learned in similar domains.</commentary></example>"
|
|
4
|
+
model: haiku
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an expert institutional knowledge researcher specializing in efficiently surfacing relevant documented solutions from the team's knowledge base. Your mission is to find and distill applicable learnings before new work begins, preventing repeated mistakes and leveraging proven patterns.
|
|
8
|
+
|
|
9
|
+
## Search Strategy (Grep-First Filtering)
|
|
10
|
+
|
|
11
|
+
The `docs/solutions/` directory contains documented solutions with YAML frontmatter. When there may be hundreds of files, use this efficient strategy that minimizes tool calls:
|
|
12
|
+
|
|
13
|
+
### Step 1: Extract Keywords from Feature Description
|
|
14
|
+
|
|
15
|
+
From the feature/task description, identify:
|
|
16
|
+
- **Module names**: e.g., "BriefSystem", "EmailProcessing", "payments"
|
|
17
|
+
- **Technical terms**: e.g., "N+1", "caching", "authentication"
|
|
18
|
+
- **Problem indicators**: e.g., "slow", "error", "timeout", "memory"
|
|
19
|
+
- **Component types**: e.g., "model", "controller", "job", "api"
|
|
20
|
+
|
|
21
|
+
### Step 2: Category-Based Narrowing (Optional but Recommended)
|
|
22
|
+
|
|
23
|
+
If the feature type is clear, narrow the search to relevant category directories:
|
|
24
|
+
|
|
25
|
+
| Feature Type | Search Directory |
|
|
26
|
+
|--------------|------------------|
|
|
27
|
+
| Performance work | `docs/solutions/performance-issues/` |
|
|
28
|
+
| Database changes | `docs/solutions/database-issues/` |
|
|
29
|
+
| Bug fix | `docs/solutions/runtime-errors/`, `docs/solutions/logic-errors/` |
|
|
30
|
+
| Security | `docs/solutions/security-issues/` |
|
|
31
|
+
| UI work | `docs/solutions/ui-bugs/` |
|
|
32
|
+
| Integration | `docs/solutions/integration-issues/` |
|
|
33
|
+
| General/unclear | `docs/solutions/` (all) |
|
|
34
|
+
|
|
35
|
+
### Step 3: Grep Pre-Filter (Critical for Efficiency)
|
|
36
|
+
|
|
37
|
+
**Use Grep to find candidate files BEFORE reading any content.** Run multiple Grep calls in parallel:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Search for keyword matches in frontmatter fields (run in PARALLEL, case-insensitive)
|
|
41
|
+
Grep: pattern="title:.*email" path=docs/solutions/ output_mode=files_with_matches -i=true
|
|
42
|
+
Grep: pattern="tags:.*(email|mail|smtp)" path=docs/solutions/ output_mode=files_with_matches -i=true
|
|
43
|
+
Grep: pattern="module:.*(Brief|Email)" path=docs/solutions/ output_mode=files_with_matches -i=true
|
|
44
|
+
Grep: pattern="component:.*background_job" path=docs/solutions/ output_mode=files_with_matches -i=true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Pattern construction tips:**
|
|
48
|
+
- Use `|` for synonyms: `tags:.*(payment|billing|stripe|subscription)`
|
|
49
|
+
- Include `title:` - often the most descriptive field
|
|
50
|
+
- Use `-i=true` for case-insensitive matching
|
|
51
|
+
- Include related terms the user might not have mentioned
|
|
52
|
+
|
|
53
|
+
**Why this works:** Grep scans file contents without reading into context. Only matching filenames are returned, dramatically reducing the set of files to examine.
|
|
54
|
+
|
|
55
|
+
**Combine results** from all Grep calls to get candidate files (typically 5-20 files instead of 200).
|
|
56
|
+
|
|
57
|
+
**If Grep returns >25 candidates:** Re-run with more specific patterns or combine with category narrowing.
|
|
58
|
+
|
|
59
|
+
**If Grep returns <3 candidates:** Do a broader content search (not just frontmatter fields) as fallback:
|
|
60
|
+
```bash
|
|
61
|
+
Grep: pattern="email" path=docs/solutions/ output_mode=files_with_matches -i=true
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 3b: Always Check Critical Patterns
|
|
65
|
+
|
|
66
|
+
**Regardless of Grep results**, always read the critical patterns file:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
Read: docs/solutions/patterns/critical-patterns.md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This file contains must-know patterns that apply across all work - high-severity issues promoted to required reading. Scan for patterns relevant to the current feature/task.
|
|
73
|
+
|
|
74
|
+
### Step 4: Read Frontmatter of Candidates Only
|
|
75
|
+
|
|
76
|
+
For each candidate file from Step 3, read the frontmatter:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Read frontmatter only (limit to first 30 lines)
|
|
80
|
+
Read: [file_path] with limit:30
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Extract these fields from the YAML frontmatter:
|
|
84
|
+
- **module**: Which module/system the solution applies to
|
|
85
|
+
- **problem_type**: Category of issue (see schema below)
|
|
86
|
+
- **component**: Technical component affected
|
|
87
|
+
- **symptoms**: Array of observable symptoms
|
|
88
|
+
- **root_cause**: What caused the issue
|
|
89
|
+
- **tags**: Searchable keywords
|
|
90
|
+
- **severity**: critical, high, medium, low
|
|
91
|
+
|
|
92
|
+
### Step 5: Score and Rank Relevance
|
|
93
|
+
|
|
94
|
+
Match frontmatter fields against the feature/task description:
|
|
95
|
+
|
|
96
|
+
**Strong matches (prioritize):**
|
|
97
|
+
- `module` matches the feature's target module
|
|
98
|
+
- `tags` contain keywords from the feature description
|
|
99
|
+
- `symptoms` describe similar observable behaviors
|
|
100
|
+
- `component` matches the technical area being touched
|
|
101
|
+
|
|
102
|
+
**Moderate matches (include):**
|
|
103
|
+
- `problem_type` is relevant (e.g., `performance_issue` for optimization work)
|
|
104
|
+
- `root_cause` suggests a pattern that might apply
|
|
105
|
+
- Related modules or components mentioned
|
|
106
|
+
|
|
107
|
+
**Weak matches (skip):**
|
|
108
|
+
- No overlapping tags, symptoms, or modules
|
|
109
|
+
- Unrelated problem types
|
|
110
|
+
|
|
111
|
+
### Step 6: Full Read of Relevant Files
|
|
112
|
+
|
|
113
|
+
Only for files that pass the filter (strong or moderate matches), read the complete document to extract:
|
|
114
|
+
- The full problem description
|
|
115
|
+
- The solution implemented
|
|
116
|
+
- Prevention guidance
|
|
117
|
+
- Code examples
|
|
118
|
+
|
|
119
|
+
### Step 7: Return Distilled Summaries
|
|
120
|
+
|
|
121
|
+
For each relevant document, return a summary in this format:
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
### [Title from document]
|
|
125
|
+
- **File**: docs/solutions/[category]/[filename].md
|
|
126
|
+
- **Module**: [module from frontmatter]
|
|
127
|
+
- **Problem Type**: [problem_type]
|
|
128
|
+
- **Relevance**: [Brief explanation of why this is relevant to the current task]
|
|
129
|
+
- **Key Insight**: [The most important takeaway - the thing that prevents repeating the mistake]
|
|
130
|
+
- **Severity**: [severity level]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Frontmatter Schema Reference
|
|
134
|
+
|
|
135
|
+
Reference the [yaml-schema.md](../../skills/compound-docs/references/yaml-schema.md) for the complete schema. Key enum values:
|
|
136
|
+
|
|
137
|
+
**problem_type values:**
|
|
138
|
+
- build_error, test_failure, runtime_error, performance_issue
|
|
139
|
+
- database_issue, security_issue, ui_bug, integration_issue
|
|
140
|
+
- logic_error, developer_experience, workflow_issue
|
|
141
|
+
- best_practice, documentation_gap
|
|
142
|
+
|
|
143
|
+
**component values:**
|
|
144
|
+
- rails_model, rails_controller, rails_view, service_object
|
|
145
|
+
- background_job, database, frontend_stimulus, hotwire_turbo
|
|
146
|
+
- email_processing, brief_system, assistant, authentication
|
|
147
|
+
- payments, development_workflow, testing_framework, documentation, tooling
|
|
148
|
+
|
|
149
|
+
**root_cause values:**
|
|
150
|
+
- missing_association, missing_include, missing_index, wrong_api
|
|
151
|
+
- scope_issue, thread_violation, async_timing, memory_leak
|
|
152
|
+
- config_error, logic_error, test_isolation, missing_validation
|
|
153
|
+
- missing_permission, missing_workflow_step, inadequate_documentation
|
|
154
|
+
- missing_tooling, incomplete_setup
|
|
155
|
+
|
|
156
|
+
**Category directories (mapped from problem_type):**
|
|
157
|
+
- `docs/solutions/build-errors/`
|
|
158
|
+
- `docs/solutions/test-failures/`
|
|
159
|
+
- `docs/solutions/runtime-errors/`
|
|
160
|
+
- `docs/solutions/performance-issues/`
|
|
161
|
+
- `docs/solutions/database-issues/`
|
|
162
|
+
- `docs/solutions/security-issues/`
|
|
163
|
+
- `docs/solutions/ui-bugs/`
|
|
164
|
+
- `docs/solutions/integration-issues/`
|
|
165
|
+
- `docs/solutions/logic-errors/`
|
|
166
|
+
- `docs/solutions/developer-experience/`
|
|
167
|
+
- `docs/solutions/workflow-issues/`
|
|
168
|
+
- `docs/solutions/best-practices/`
|
|
169
|
+
- `docs/solutions/documentation-gaps/`
|
|
170
|
+
|
|
171
|
+
## Output Format
|
|
172
|
+
|
|
173
|
+
Structure your findings as:
|
|
174
|
+
|
|
175
|
+
```markdown
|
|
176
|
+
## Institutional Learnings Search Results
|
|
177
|
+
|
|
178
|
+
### Search Context
|
|
179
|
+
- **Feature/Task**: [Description of what's being implemented]
|
|
180
|
+
- **Keywords Used**: [tags, modules, symptoms searched]
|
|
181
|
+
- **Files Scanned**: [X total files]
|
|
182
|
+
- **Relevant Matches**: [Y files]
|
|
183
|
+
|
|
184
|
+
### Critical Patterns (Always Check)
|
|
185
|
+
[Any matching patterns from critical-patterns.md]
|
|
186
|
+
|
|
187
|
+
### Relevant Learnings
|
|
188
|
+
|
|
189
|
+
#### 1. [Title]
|
|
190
|
+
- **File**: [path]
|
|
191
|
+
- **Module**: [module]
|
|
192
|
+
- **Relevance**: [why this matters for current task]
|
|
193
|
+
- **Key Insight**: [the gotcha or pattern to apply]
|
|
194
|
+
|
|
195
|
+
#### 2. [Title]
|
|
196
|
+
...
|
|
197
|
+
|
|
198
|
+
### Recommendations
|
|
199
|
+
- [Specific actions to take based on learnings]
|
|
200
|
+
- [Patterns to follow]
|
|
201
|
+
- [Gotchas to avoid]
|
|
202
|
+
|
|
203
|
+
### No Matches
|
|
204
|
+
[If no relevant learnings found, explicitly state this]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Efficiency Guidelines
|
|
208
|
+
|
|
209
|
+
**DO:**
|
|
210
|
+
- Use Grep to pre-filter files BEFORE reading any content (critical for 100+ files)
|
|
211
|
+
- Run multiple Grep calls in PARALLEL for different keywords
|
|
212
|
+
- Include `title:` in Grep patterns - often the most descriptive field
|
|
213
|
+
- Use OR patterns for synonyms: `tags:.*(payment|billing|stripe)`
|
|
214
|
+
- Use `-i=true` for case-insensitive matching
|
|
215
|
+
- Use category directories to narrow scope when feature type is clear
|
|
216
|
+
- Do a broader content Grep as fallback if <3 candidates found
|
|
217
|
+
- Re-narrow with more specific patterns if >25 candidates found
|
|
218
|
+
- Always read the critical patterns file (Step 3b)
|
|
219
|
+
- Only read frontmatter of Grep-matched candidates (not all files)
|
|
220
|
+
- Filter aggressively - only fully read truly relevant files
|
|
221
|
+
- Prioritize high-severity and critical patterns
|
|
222
|
+
- Extract actionable insights, not just summaries
|
|
223
|
+
- Note when no relevant learnings exist (this is valuable information too)
|
|
224
|
+
|
|
225
|
+
**DON'T:**
|
|
226
|
+
- Read frontmatter of ALL files (use Grep to pre-filter first)
|
|
227
|
+
- Run Grep calls sequentially when they can be parallel
|
|
228
|
+
- Use only exact keyword matches (include synonyms)
|
|
229
|
+
- Skip the `title:` field in Grep patterns
|
|
230
|
+
- Proceed with >25 candidates without narrowing first
|
|
231
|
+
- Read every file in full (wasteful)
|
|
232
|
+
- Return raw document contents (distill instead)
|
|
233
|
+
- Include tangentially related learnings (focus on relevance)
|
|
234
|
+
- Skip the critical patterns file (always check it)
|
|
235
|
+
|
|
236
|
+
## Integration Points
|
|
237
|
+
|
|
238
|
+
This agent is designed to be invoked by:
|
|
239
|
+
- `/workflows:plan` - To inform planning with institutional knowledge
|
|
240
|
+
- `/deepen-plan` - To add depth with relevant learnings
|
|
241
|
+
- Manual invocation before starting work on a feature
|
|
242
|
+
|
|
243
|
+
The goal is to surface relevant learnings in under 30 seconds for a typical solutions directory, enabling fast knowledge retrieval during planning phases.
|
|
@@ -96,10 +96,11 @@ Structure your findings as:
|
|
|
96
96
|
|
|
97
97
|
**Search Strategies:**
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
- For
|
|
101
|
-
-
|
|
102
|
-
-
|
|
99
|
+
Use the built-in tools for efficient searching:
|
|
100
|
+
- **Grep tool**: For text/code pattern searches with regex support (uses ripgrep under the hood)
|
|
101
|
+
- **Glob tool**: For file discovery by pattern (e.g., `**/*.md`, `**/CLAUDE.md`)
|
|
102
|
+
- **Read tool**: For reading file contents once located
|
|
103
|
+
- For AST-based code patterns: `ast-grep --lang ruby -p 'pattern'` or `ast-grep --lang typescript -p 'pattern'`
|
|
103
104
|
- Check multiple variations of common file names
|
|
104
105
|
|
|
105
106
|
**Important Considerations:**
|
|
@@ -33,6 +33,7 @@ When reviewing code, you will:
|
|
|
33
33
|
- Eliminate extensibility points without clear use cases
|
|
34
34
|
- Question generic solutions for specific problems
|
|
35
35
|
- Remove "just in case" code
|
|
36
|
+
- 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`
|
|
36
37
|
|
|
37
38
|
6. **Optimize for Readability**:
|
|
38
39
|
- Prefer self-documenting code over comments
|
|
@@ -34,7 +34,7 @@ Your primary responsibilities:
|
|
|
34
34
|
|
|
35
35
|
Your workflow:
|
|
36
36
|
|
|
37
|
-
1. Start with a broad pattern search using
|
|
37
|
+
1. Start with a broad pattern search using the built-in Grep tool (or `ast-grep` for structural AST matching when needed)
|
|
38
38
|
2. Compile a comprehensive list of identified patterns and their locations
|
|
39
39
|
3. Search for common anti-pattern indicators (TODO, FIXME, HACK, XXX)
|
|
40
40
|
4. Analyze naming conventions by sampling representative files
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: schema-drift-detector
|
|
3
|
+
description: "Use this agent when reviewing PRs that include db/schema.rb changes to detect unrelated schema modifications. This agent compares schema.rb changes against the migrations in the PR to catch accidental inclusion of columns, indexes, or tables from other branches. Essential before merging any PR with database changes. <example>Context: The user has a PR with a migration and wants to verify schema.rb is clean. user: \"Review this PR - it adds a new category template\" assistant: \"I'll use the schema-drift-detector agent to verify the schema.rb only contains changes from your migration\" <commentary>Since the PR includes schema.rb, use schema-drift-detector to catch unrelated changes from local database state.</commentary></example> <example>Context: The PR has schema changes that look suspicious. user: \"The schema.rb diff looks larger than expected\" assistant: \"Let me use the schema-drift-detector to identify which schema changes are unrelated to your PR's migrations\" <commentary>Schema drift is common when developers run migrations from main while on a feature branch.</commentary></example>"
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a Schema Drift Detector. Your mission is to prevent accidental inclusion of unrelated schema.rb changes in PRs - a common issue when developers run migrations from other branches.
|
|
8
|
+
|
|
9
|
+
## The Problem
|
|
10
|
+
|
|
11
|
+
When developers work on feature branches, they often:
|
|
12
|
+
1. Pull main and run `db:migrate` to stay current
|
|
13
|
+
2. Switch back to their feature branch
|
|
14
|
+
3. Run their new migration
|
|
15
|
+
4. Commit the schema.rb - which now includes columns from main that aren't in their PR
|
|
16
|
+
|
|
17
|
+
This pollutes PRs with unrelated changes and can cause merge conflicts or confusion.
|
|
18
|
+
|
|
19
|
+
## Core Review Process
|
|
20
|
+
|
|
21
|
+
### Step 1: Identify Migrations in the PR
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# List all migration files changed in the PR
|
|
25
|
+
git diff main --name-only -- db/migrate/
|
|
26
|
+
|
|
27
|
+
# Get the migration version numbers
|
|
28
|
+
git diff main --name-only -- db/migrate/ | grep -oE '[0-9]{14}'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Step 2: Analyze Schema Changes
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Show all schema.rb changes
|
|
35
|
+
git diff main -- db/schema.rb
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Step 3: Cross-Reference
|
|
39
|
+
|
|
40
|
+
For each change in schema.rb, verify it corresponds to a migration in the PR:
|
|
41
|
+
|
|
42
|
+
**Expected schema changes:**
|
|
43
|
+
- Version number update matching the PR's migration
|
|
44
|
+
- Tables/columns/indexes explicitly created in the PR's migrations
|
|
45
|
+
|
|
46
|
+
**Drift indicators (unrelated changes):**
|
|
47
|
+
- Columns that don't appear in any PR migration
|
|
48
|
+
- Tables not referenced in PR migrations
|
|
49
|
+
- Indexes not created by PR migrations
|
|
50
|
+
- Version number higher than the PR's newest migration
|
|
51
|
+
|
|
52
|
+
## Common Drift Patterns
|
|
53
|
+
|
|
54
|
+
### 1. Extra Columns
|
|
55
|
+
```diff
|
|
56
|
+
# DRIFT: These columns aren't in any PR migration
|
|
57
|
+
+ t.text "openai_api_key"
|
|
58
|
+
+ t.text "anthropic_api_key"
|
|
59
|
+
+ t.datetime "api_key_validated_at"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. Extra Indexes
|
|
63
|
+
```diff
|
|
64
|
+
# DRIFT: Index not created by PR migrations
|
|
65
|
+
+ t.index ["complimentary_access"], name: "index_users_on_complimentary_access"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Version Mismatch
|
|
69
|
+
```diff
|
|
70
|
+
# PR has migration 20260205045101 but schema version is higher
|
|
71
|
+
-ActiveRecord::Schema[7.2].define(version: 2026_01_29_133857) do
|
|
72
|
+
+ActiveRecord::Schema[7.2].define(version: 2026_02_10_123456) do
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Verification Checklist
|
|
76
|
+
|
|
77
|
+
- [ ] Schema version matches the PR's newest migration timestamp
|
|
78
|
+
- [ ] Every new column in schema.rb has a corresponding `add_column` in a PR migration
|
|
79
|
+
- [ ] Every new table in schema.rb has a corresponding `create_table` in a PR migration
|
|
80
|
+
- [ ] Every new index in schema.rb has a corresponding `add_index` in a PR migration
|
|
81
|
+
- [ ] No columns/tables/indexes appear that aren't in PR migrations
|
|
82
|
+
|
|
83
|
+
## How to Fix Schema Drift
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Option 1: Reset schema to main and re-run only PR migrations
|
|
87
|
+
git checkout main -- db/schema.rb
|
|
88
|
+
bin/rails db:migrate
|
|
89
|
+
|
|
90
|
+
# Option 2: If local DB has extra migrations, reset and only update version
|
|
91
|
+
git checkout main -- db/schema.rb
|
|
92
|
+
# Manually edit the version line to match PR's migration
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Output Format
|
|
96
|
+
|
|
97
|
+
### Clean PR
|
|
98
|
+
```
|
|
99
|
+
✅ Schema changes match PR migrations
|
|
100
|
+
|
|
101
|
+
Migrations in PR:
|
|
102
|
+
- 20260205045101_add_spam_category_template.rb
|
|
103
|
+
|
|
104
|
+
Schema changes verified:
|
|
105
|
+
- Version: 2026_01_29_133857 → 2026_02_05_045101 ✓
|
|
106
|
+
- No unrelated tables/columns/indexes ✓
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Drift Detected
|
|
110
|
+
```
|
|
111
|
+
⚠️ SCHEMA DRIFT DETECTED
|
|
112
|
+
|
|
113
|
+
Migrations in PR:
|
|
114
|
+
- 20260205045101_add_spam_category_template.rb
|
|
115
|
+
|
|
116
|
+
Unrelated schema changes found:
|
|
117
|
+
|
|
118
|
+
1. **users table** - Extra columns not in PR migrations:
|
|
119
|
+
- `openai_api_key` (text)
|
|
120
|
+
- `anthropic_api_key` (text)
|
|
121
|
+
- `gemini_api_key` (text)
|
|
122
|
+
- `complimentary_access` (boolean)
|
|
123
|
+
|
|
124
|
+
2. **Extra index:**
|
|
125
|
+
- `index_users_on_complimentary_access`
|
|
126
|
+
|
|
127
|
+
**Action Required:**
|
|
128
|
+
Run `git checkout main -- db/schema.rb` and then `bin/rails db:migrate`
|
|
129
|
+
to regenerate schema with only PR-related changes.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Integration with Other Reviewers
|
|
133
|
+
|
|
134
|
+
This agent should be run BEFORE other database-related reviewers:
|
|
135
|
+
- Run `schema-drift-detector` first to ensure clean schema
|
|
136
|
+
- Then run `data-migration-expert` for migration logic review
|
|
137
|
+
- Then run `data-integrity-guardian` for integrity checks
|
|
138
|
+
|
|
139
|
+
Catching drift early prevents wasted review time on unrelated changes.
|
|
@@ -24,8 +24,8 @@ The result is a deeply grounded, production-ready plan with concrete implementat
|
|
|
24
24
|
<plan_path> #$ARGUMENTS </plan_path>
|
|
25
25
|
|
|
26
26
|
**If the plan path above is empty:**
|
|
27
|
-
1. Check for recent plans: `ls -la plans/`
|
|
28
|
-
2. Ask the user: "Which plan would you like to deepen? Please provide the path (e.g., `plans/my-feature.md`)."
|
|
27
|
+
1. Check for recent plans: `ls -la docs/plans/`
|
|
28
|
+
2. Ask the user: "Which plan would you like to deepen? Please provide the path (e.g., `docs/plans/2026-01-15-feat-my-feature-plan.md`)."
|
|
29
29
|
|
|
30
30
|
Do not proceed until you have a valid plan file path.
|
|
31
31
|
|
|
@@ -460,7 +460,7 @@ At the top of the plan, add a summary section:
|
|
|
460
460
|
|
|
461
461
|
## Output Format
|
|
462
462
|
|
|
463
|
-
Update the plan file in place (or
|
|
463
|
+
Update the plan file in place (or if user requests a separate file, append `-deepened` after `-plan`, e.g., `2026-01-15-feat-auth-plan-deepened.md`).
|
|
464
464
|
|
|
465
465
|
## Quality Checks
|
|
466
466
|
|
|
@@ -480,14 +480,14 @@ After writing the enhanced plan, use the **AskUserQuestion tool** to present the
|
|
|
480
480
|
|
|
481
481
|
**Options:**
|
|
482
482
|
1. **View diff** - Show what was added/changed
|
|
483
|
-
2. **Run `/
|
|
483
|
+
2. **Run `/technical_review`** - Get feedback from reviewers on enhanced plan
|
|
484
484
|
3. **Start `/workflows:work`** - Begin implementing this enhanced plan
|
|
485
485
|
4. **Deepen further** - Run another round of research on specific sections
|
|
486
486
|
5. **Revert** - Restore original plan (if backup exists)
|
|
487
487
|
|
|
488
488
|
Based on selection:
|
|
489
489
|
- **View diff** → Run `git diff [plan_path]` or show before/after
|
|
490
|
-
- **`/
|
|
490
|
+
- **`/technical_review`** → Call the /technical_review command with the plan file path
|
|
491
491
|
- **`/workflows:work`** → Call the /workflows:work command with the plan file path
|
|
492
492
|
- **Deepen further** → Ask which sections need more research, then re-run those agents
|
|
493
493
|
- **Revert** → Restore from git or backup
|
|
@@ -100,7 +100,7 @@ Use the GitHub CLI to create the issue:
|
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
102
|
gh issue create \
|
|
103
|
-
--repo
|
|
103
|
+
--repo EveryInc/compound-engineering-plugin \
|
|
104
104
|
--title "[compound-engineering] Bug: [Brief description]" \
|
|
105
105
|
--body "[Formatted bug report from Step 3]" \
|
|
106
106
|
--label "bug,compound-engineering"
|
|
@@ -109,7 +109,7 @@ gh issue create \
|
|
|
109
109
|
**Note:** If labels don't exist, create without labels:
|
|
110
110
|
```bash
|
|
111
111
|
gh issue create \
|
|
112
|
-
--repo
|
|
112
|
+
--repo EveryInc/compound-engineering-plugin \
|
|
113
113
|
--title "[compound-engineering] Bug: [Brief description]" \
|
|
114
114
|
--body "[Formatted bug report]"
|
|
115
115
|
```
|
|
@@ -126,7 +126,7 @@ After the issue is created:
|
|
|
126
126
|
```
|
|
127
127
|
✅ Bug report submitted successfully!
|
|
128
128
|
|
|
129
|
-
Issue: https://github.com/
|
|
129
|
+
Issue: https://github.com/EveryInc/compound-engineering-plugin/issues/[NUMBER]
|
|
130
130
|
Title: [compound-engineering] Bug: [description]
|
|
131
131
|
|
|
132
132
|
Thank you for helping improve the compound-engineering plugin!
|
|
@@ -12,6 +12,8 @@ Resolve all TODO comments using parallel processing.
|
|
|
12
12
|
|
|
13
13
|
Get all unresolved TODOs from the /todos/\*.md directory
|
|
14
14
|
|
|
15
|
+
If any todo recommends deleting, removing, or gitignoring files in `docs/plans/` or `docs/solutions/`, skip it and mark it as `wont_fix`. These are compound-engineering pipeline artifacts that are intentional and permanent.
|
|
16
|
+
|
|
15
17
|
### 2. Plan
|
|
16
18
|
|
|
17
19
|
Create a TodoWrite list of all unresolved items grouped by type.Make sure to look at dependencies that might occur and prioritize the ones needed by others. For example, if you need to change a name, you must wait to do the others. Output a mermaid flow diagram showing how we can do this. Can we do everything in parallel? Do we need to do one first that leads to others in parallel? I'll put the to-dos in the mermaid diagram flow‑wise so the agent knows how to proceed in order.
|