ag-cortex 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 (162) hide show
  1. package/.agent/commands/test-browser.md +339 -0
  2. package/.agent/rules/00-constitution.md +46 -0
  3. package/.agent/rules/project-rules.md +49 -0
  4. package/.agent/skills/agent-browser/SKILL.md +223 -0
  5. package/.agent/skills/agent-native-architecture/SKILL.md +435 -0
  6. package/.agent/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  7. package/.agent/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  8. package/.agent/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  9. package/.agent/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  10. package/.agent/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  11. package/.agent/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  12. package/.agent/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  13. package/.agent/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  14. package/.agent/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  15. package/.agent/skills/agent-native-architecture/references/product-implications.md +443 -0
  16. package/.agent/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  17. package/.agent/skills/agent-native-architecture/references/self-modification.md +269 -0
  18. package/.agent/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  19. package/.agent/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  20. package/.agent/skills/agent-native-reviewer/SKILL.md +246 -0
  21. package/.agent/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  22. package/.agent/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  23. package/.agent/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  24. package/.agent/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  25. package/.agent/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  26. package/.agent/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  27. package/.agent/skills/ankane-readme-writer/SKILL.md +50 -0
  28. package/.agent/skills/architecture-strategist/SKILL.md +52 -0
  29. package/.agent/skills/best-practices-researcher/SKILL.md +100 -0
  30. package/.agent/skills/bug-reproduction-validator/SKILL.md +67 -0
  31. package/.agent/skills/code-simplicity-reviewer/SKILL.md +85 -0
  32. package/.agent/skills/coding-tutor/.claude-plugin/plugin.json +9 -0
  33. package/.agent/skills/coding-tutor/README.md +37 -0
  34. package/.agent/skills/coding-tutor/commands/quiz-me.md +1 -0
  35. package/.agent/skills/coding-tutor/commands/sync-tutorials.md +25 -0
  36. package/.agent/skills/coding-tutor/commands/teach-me.md +1 -0
  37. package/.agent/skills/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
  38. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +202 -0
  39. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +203 -0
  40. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
  41. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +132 -0
  42. package/.agent/skills/compound-docs/SKILL.md +510 -0
  43. package/.agent/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  44. package/.agent/skills/compound-docs/assets/resolution-template.md +93 -0
  45. package/.agent/skills/compound-docs/references/yaml-schema.md +65 -0
  46. package/.agent/skills/compound-docs/schema.yaml +176 -0
  47. package/.agent/skills/create-agent-skills/SKILL.md +299 -0
  48. package/.agent/skills/create-agent-skills/references/api-security.md +226 -0
  49. package/.agent/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  50. package/.agent/skills/create-agent-skills/references/best-practices.md +404 -0
  51. package/.agent/skills/create-agent-skills/references/common-patterns.md +595 -0
  52. package/.agent/skills/create-agent-skills/references/core-principles.md +437 -0
  53. package/.agent/skills/create-agent-skills/references/executable-code.md +175 -0
  54. package/.agent/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  55. package/.agent/skills/create-agent-skills/references/official-spec.md +185 -0
  56. package/.agent/skills/create-agent-skills/references/recommended-structure.md +168 -0
  57. package/.agent/skills/create-agent-skills/references/skill-structure.md +372 -0
  58. package/.agent/skills/create-agent-skills/references/using-scripts.md +113 -0
  59. package/.agent/skills/create-agent-skills/references/using-templates.md +112 -0
  60. package/.agent/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  61. package/.agent/skills/create-agent-skills/templates/router-skill.md +73 -0
  62. package/.agent/skills/create-agent-skills/templates/simple-skill.md +33 -0
  63. package/.agent/skills/create-agent-skills/workflows/add-reference.md +96 -0
  64. package/.agent/skills/create-agent-skills/workflows/add-script.md +93 -0
  65. package/.agent/skills/create-agent-skills/workflows/add-template.md +74 -0
  66. package/.agent/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  67. package/.agent/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  68. package/.agent/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  69. package/.agent/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  70. package/.agent/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  71. package/.agent/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  72. package/.agent/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  73. package/.agent/skills/data-integrity-guardian/SKILL.md +70 -0
  74. package/.agent/skills/data-migration-expert/SKILL.md +97 -0
  75. package/.agent/skills/deployment-verification-agent/SKILL.md +159 -0
  76. package/.agent/skills/design-implementation-reviewer/SKILL.md +85 -0
  77. package/.agent/skills/design-iterator/SKILL.md +197 -0
  78. package/.agent/skills/dhh-rails-reviewer/SKILL.md +45 -0
  79. package/.agent/skills/dhh-rails-style/SKILL.md +184 -0
  80. package/.agent/skills/dhh-rails-style/references/architecture.md +653 -0
  81. package/.agent/skills/dhh-rails-style/references/controllers.md +303 -0
  82. package/.agent/skills/dhh-rails-style/references/frontend.md +510 -0
  83. package/.agent/skills/dhh-rails-style/references/gems.md +266 -0
  84. package/.agent/skills/dhh-rails-style/references/models.md +359 -0
  85. package/.agent/skills/dhh-rails-style/references/testing.md +338 -0
  86. package/.agent/skills/dspy-ruby/SKILL.md +594 -0
  87. package/.agent/skills/dspy-ruby/assets/config-template.rb +359 -0
  88. package/.agent/skills/dspy-ruby/assets/module-template.rb +326 -0
  89. package/.agent/skills/dspy-ruby/assets/signature-template.rb +143 -0
  90. package/.agent/skills/dspy-ruby/references/core-concepts.md +265 -0
  91. package/.agent/skills/dspy-ruby/references/optimization.md +623 -0
  92. package/.agent/skills/dspy-ruby/references/providers.md +305 -0
  93. package/.agent/skills/every-style-editor/SKILL.md +134 -0
  94. package/.agent/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  95. package/.agent/skills/figma-design-sync/SKILL.md +166 -0
  96. package/.agent/skills/file-todos/SKILL.md +251 -0
  97. package/.agent/skills/file-todos/assets/todo-template.md +155 -0
  98. package/.agent/skills/framework-docs-researcher/SKILL.md +83 -0
  99. package/.agent/skills/frontend-design/SKILL.md +42 -0
  100. package/.agent/skills/gemini-imagegen/SKILL.md +237 -0
  101. package/.agent/skills/gemini-imagegen/requirements.txt +2 -0
  102. package/.agent/skills/gemini-imagegen/scripts/compose_images.py +168 -0
  103. package/.agent/skills/gemini-imagegen/scripts/edit_image.py +157 -0
  104. package/.agent/skills/gemini-imagegen/scripts/gemini_images.py +265 -0
  105. package/.agent/skills/gemini-imagegen/scripts/generate_image.py +147 -0
  106. package/.agent/skills/gemini-imagegen/scripts/multi_turn_chat.py +215 -0
  107. package/.agent/skills/git-history-analyzer/SKILL.md +42 -0
  108. package/.agent/skills/git-worktree/SKILL.md +302 -0
  109. package/.agent/skills/git-worktree/scripts/worktree-manager.sh +345 -0
  110. package/.agent/skills/julik-frontend-races-reviewer/SKILL.md +222 -0
  111. package/.agent/skills/kieran-python-reviewer/SKILL.md +104 -0
  112. package/.agent/skills/kieran-rails-reviewer/SKILL.md +86 -0
  113. package/.agent/skills/kieran-typescript-reviewer/SKILL.md +95 -0
  114. package/.agent/skills/lint/SKILL.md +16 -0
  115. package/.agent/skills/pattern-recognition-specialist/SKILL.md +57 -0
  116. package/.agent/skills/performance-oracle/SKILL.md +110 -0
  117. package/.agent/skills/pr-comment-resolver/SKILL.md +69 -0
  118. package/.agent/skills/rclone/SKILL.md +150 -0
  119. package/.agent/skills/rclone/scripts/check_setup.sh +60 -0
  120. package/.agent/skills/repo-research-analyst/SKILL.md +113 -0
  121. package/.agent/skills/security-sentinel/SKILL.md +93 -0
  122. package/.agent/skills/skill-creator/SKILL.md +209 -0
  123. package/.agent/skills/skill-creator/scripts/init_skill.py +304 -0
  124. package/.agent/skills/skill-creator/scripts/package_skill.py +112 -0
  125. package/.agent/skills/skill-creator/scripts/quick_validate.py +72 -0
  126. package/.agent/skills/spec-flow-analyzer/SKILL.md +113 -0
  127. package/.agent/skills/test-agent/SKILL.md +4 -0
  128. package/.agent/workflows/agent-native-audit.md +277 -0
  129. package/.agent/workflows/ask-user-question.md +21 -0
  130. package/.agent/workflows/changelog.md +137 -0
  131. package/.agent/workflows/compound.md +202 -0
  132. package/.agent/workflows/create-agent-skill.md +8 -0
  133. package/.agent/workflows/deepen-plan-research.md +334 -0
  134. package/.agent/workflows/deepen-plan-synthesis.md +182 -0
  135. package/.agent/workflows/deepen-plan.md +79 -0
  136. package/.agent/workflows/feature-video.md +342 -0
  137. package/.agent/workflows/generate-command.md +162 -0
  138. package/.agent/workflows/heal-skill.md +142 -0
  139. package/.agent/workflows/lfg.md +20 -0
  140. package/.agent/workflows/plan-analysis.md +67 -0
  141. package/.agent/workflows/plan-next-steps.md +63 -0
  142. package/.agent/workflows/plan-review.md +33 -0
  143. package/.agent/workflows/plan-synthesis.md +106 -0
  144. package/.agent/workflows/plan.md +49 -0
  145. package/.agent/workflows/report-bug.md +150 -0
  146. package/.agent/workflows/reproduce-bug.md +99 -0
  147. package/.agent/workflows/resolve-parallel.md +34 -0
  148. package/.agent/workflows/resolve-pr-parallel.md +49 -0
  149. package/.agent/workflows/resolve-todo-parallel.md +35 -0
  150. package/.agent/workflows/review-analysis.md +145 -0
  151. package/.agent/workflows/review-synthesis.md +262 -0
  152. package/.agent/workflows/review.md +64 -0
  153. package/.agent/workflows/ship.md +90 -0
  154. package/.agent/workflows/test-command.md +3 -0
  155. package/.agent/workflows/triage.md +310 -0
  156. package/.agent/workflows/work.md +157 -0
  157. package/.agent/workflows/xcode-test.md +332 -0
  158. package/LICENSE +22 -0
  159. package/README.md +49 -0
  160. package/bin/ag-cortex.js +54 -0
  161. package/lib/core.js +165 -0
  162. package/package.json +31 -0
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: 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
+ /compound # Document the most recent fix
21
+ /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 /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 /compound completes for deeper review
198
+
199
+ ## Related Commands
200
+
201
+ - `/research [topic]` - Deep investigation (searches docs/solutions/ for patterns)
202
+ - `/plan` - Planning workflow (references documented solutions)
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: create-agent-skill
3
+ description: Create or edit Antigravity skills with expert guidance on structure and best practices
4
+ allowed-tools: Skill(create-agent-skills)
5
+ argument-hint: [skill description or requirements]
6
+ ---
7
+
8
+ Invoke the create-agent-skills skill for: $ARGUMENTS
@@ -0,0 +1,334 @@
1
+ ---
2
+ Description: Internal sub-workflow for the Deepen Plan research phase. Launches parallel agents for Skills, Learnings, and Reviews.
3
+ ---
4
+
5
+ # Deepen Plan - Phase 2: Research Execution
6
+
7
+ ## Context
8
+ Target Plan: <plan_path> #$ARGUMENTS </plan_path>
9
+
10
+ ## Main Tasks
11
+
12
+ ### 1. Parse and Analyze Plan Structure
13
+
14
+ <thinking>
15
+ First, read and parse the plan to identify each major section that can be enhanced with research.
16
+ </thinking>
17
+
18
+ **Read the plan file and extract:**
19
+ - [ ] Overview/Problem Statement
20
+ - [ ] Proposed Solution sections
21
+ - [ ] Technical Approach/Architecture
22
+ - [ ] Implementation phases/steps
23
+ - [ ] Code examples and file references
24
+ - [ ] Acceptance criteria
25
+ - [ ] Any UI/UX components mentioned
26
+ - [ ] Technologies/frameworks mentioned (Rails, React, Python, TypeScript, etc.)
27
+ - [ ] Domain areas (data models, APIs, UI, security, performance, etc.)
28
+
29
+ **Create a section manifest:**
30
+ ```
31
+ Section 1: [Title] - [Brief description of what to research]
32
+ Section 2: [Title] - [Brief description of what to research]
33
+ ...
34
+ ```
35
+
36
+ ### 2. Discover and Apply Available Skills
37
+
38
+ <thinking>
39
+ Dynamically discover all available skills and match them to plan sections. Don't assume what skills exist - discover them at runtime.
40
+ </thinking>
41
+
42
+ **Step 1: Discover ALL available skills from ALL sources**
43
+
44
+ ```bash
45
+ # 1. Project-local skills (highest priority - project-specific)
46
+ ls .agent/skills/
47
+
48
+ # 2. User's global skills (~/.agent/)
49
+ ls ~/.agent/skills/
50
+
51
+ # 3. ALL other installed plugins - check every plugin for skills
52
+ find ~/.agent -type d -name "skills" 2>/dev/null
53
+ ```
54
+
55
+ **Important:** Check EVERY source. Don't assume Cortex is the only plugin. Use skills from ANY installed plugin that's relevant.
56
+
57
+ **Step 2: For each discovered skill, read its SKILL.md to understand what it does**
58
+
59
+ ```bash
60
+ # For each skill directory found, read its documentation
61
+ cat [skill-path]/SKILL.md
62
+ ```
63
+
64
+ **Step 3: Match skills to plan content**
65
+
66
+ For each skill discovered:
67
+ - Read its SKILL.md description
68
+ - Check if any plan sections match the skill's domain
69
+ - If there's a match, spawn a sub-agent to apply that skill's knowledge
70
+
71
+ **Step 4: Spawn a sub-agent for EVERY matched skill**
72
+
73
+ **CRITICAL: For EACH skill that matches, spawn a separate sub-agent and instruct it to USE that skill.**
74
+
75
+ For each matched skill:
76
+ ```
77
+ Task general-purpose: "You have the [skill-name] skill available at [skill-path].
78
+
79
+ YOUR JOB: Use this skill on the plan.
80
+
81
+ 1. Read the skill: cat [skill-path]/SKILL.md
82
+ 2. Follow the skill's instructions exactly
83
+ 3. Apply the skill to this content:
84
+
85
+ [relevant plan section or full plan]
86
+
87
+ 4. Return the skill's full output
88
+
89
+ The skill tells you what to do - follow it. Execute the skill completely."
90
+ ```
91
+
92
+ **Spawn ALL skill sub-agents in PARALLEL:**
93
+ - 1 sub-agent per matched skill
94
+ - Each sub-agent reads and uses its assigned skill
95
+ - All run simultaneously
96
+ - 10, 20, 30 skill sub-agents is fine
97
+
98
+ **Each sub-agent:**
99
+ 1. Reads its skill's SKILL.md
100
+ 2. Follows the skill's workflow/instructions
101
+ 3. Applies the skill to the plan
102
+ 4. Returns whatever the skill produces (code, recommendations, patterns, reviews, etc.)
103
+
104
+ **Example spawns:**
105
+ ```
106
+ Task general-purpose: "Use the dhh-rails-style skill at ~/.agent/plugins/.../dhh-rails-style. Read SKILL.md and apply it to: [Rails sections of plan]"
107
+
108
+ Task general-purpose: "Use the frontend-design skill at ~/.agent/plugins/.../frontend-design. Read SKILL.md and apply it to: [UI sections of plan]"
109
+
110
+ Task general-purpose: "Use the agent-native-architecture skill at ~/.agent/plugins/.../agent-native-architecture. Read SKILL.md and apply it to: [agent/tool sections of plan]"
111
+
112
+ Task general-purpose: "Use the security-patterns skill at ~/.agent/skills/security-patterns. Read SKILL.md and apply it to: [full plan]"
113
+ ```
114
+
115
+ **No limit on skill sub-agents. Spawn one for every skill that could possibly be relevant.**
116
+
117
+ ### 3. Discover and Apply Learnings/Solutions
118
+
119
+ <thinking>
120
+ Check for documented learnings from /compound. These are solved problems stored as markdown files. Spawn a sub-agent for each learning to check if it's relevant.
121
+ </thinking>
122
+
123
+ **LEARNINGS LOCATION - Check these exact folders:**
124
+
125
+ ```
126
+ docs/solutions/ <-- PRIMARY: Project-level learnings (created by /compound)
127
+ ├── performance-issues/
128
+ │ └── *.md
129
+ ├── debugging-patterns/
130
+ │ └── *.md
131
+ ├── configuration-fixes/
132
+ │ └── *.md
133
+ ├── integration-issues/
134
+ │ └── *.md
135
+ ├── deployment-issues/
136
+ │ └── *.md
137
+ └── [other-categories]/
138
+ └── *.md
139
+ ```
140
+
141
+ **Step 1: Find ALL learning markdown files**
142
+
143
+ Run these commands to get every learning file:
144
+
145
+ ```bash
146
+ # PRIMARY LOCATION - Project learnings
147
+ find docs/solutions -name "*.md" -type f 2>/dev/null
148
+
149
+ # If docs/solutions doesn't exist, check alternate locations:
150
+ find .agent/docs -name "*.md" -type f 2>/dev/null
151
+ find ~/.agent/docs -name "*.md" -type f 2>/dev/null
152
+ ```
153
+
154
+ **Step 2: Read frontmatter of each learning to filter**
155
+
156
+ Each learning file has YAML frontmatter with metadata. Read the first ~20 lines of each file to get:
157
+
158
+ ```yaml
159
+ ---
160
+ title: "N+1 Query Fix for Briefs"
161
+ category: performance-issues
162
+ tags: [activerecord, n-plus-one, includes, eager-loading]
163
+ module: Briefs
164
+ symptom: "Slow page load, multiple queries in logs"
165
+ root_cause: "Missing includes on association"
166
+ ---
167
+ ```
168
+
169
+ **For each .md file, quickly scan its frontmatter:**
170
+
171
+ ```bash
172
+ # Read first 20 lines of each learning (frontmatter + summary)
173
+ head -20 docs/solutions/**/*.md
174
+ ```
175
+
176
+ **Step 3: Filter - only spawn sub-agents for LIKELY relevant learnings**
177
+
178
+ Compare each learning's frontmatter against the plan:
179
+ - `tags:` - Do any tags match technologies/patterns in the plan?
180
+ - `category:` - Is this category relevant? (e.g., skip deployment-issues if plan is UI-only)
181
+ - `module:` - Does the plan touch this module?
182
+ - `symptom:` / `root_cause:` - Could this problem occur with the plan?
183
+
184
+ **SKIP learnings that are clearly not applicable:**
185
+ - Plan is frontend-only → skip `database-migrations/` learnings
186
+ - Plan is Python → skip `rails-specific/` learnings
187
+ - Plan has no auth → skip `authentication-issues/` learnings
188
+
189
+ **SPAWN sub-agents for learnings that MIGHT apply:**
190
+ - Any tag overlap with plan technologies
191
+ - Same category as plan domain
192
+ - Similar patterns or concerns
193
+
194
+ **Step 4: Spawn sub-agents for filtered learnings**
195
+
196
+ For each learning that passes the filter:
197
+
198
+ ```
199
+ Task general-purpose: "
200
+ LEARNING FILE: [full path to .md file]
201
+
202
+ 1. Read this learning file completely
203
+ 2. This learning documents a previously solved problem
204
+
205
+ Check if this learning applies to this plan:
206
+
207
+ ---
208
+ [full plan content]
209
+ ---
210
+
211
+ If relevant:
212
+ - Explain specifically how it applies
213
+ - Quote the key insight or solution
214
+ - Suggest where/how to incorporate it
215
+
216
+ If NOT relevant after deeper analysis:
217
+ - Say 'Not applicable: [reason]'
218
+ "
219
+ ```
220
+
221
+ **Example filtering:**
222
+ ```
223
+ # Found 15 learning files, plan is about "Rails API caching"
224
+
225
+ # SPAWN (likely relevant):
226
+ docs/solutions/performance-issues/n-plus-one-queries.md # tags: [activerecord] ✓
227
+ docs/solutions/performance-issues/redis-cache-stampede.md # tags: [caching, redis] ✓
228
+ docs/solutions/configuration-fixes/redis-connection-pool.md # tags: [redis] ✓
229
+
230
+ # SKIP (clearly not applicable):
231
+ docs/solutions/deployment-issues/heroku-memory-quota.md # not about caching
232
+ docs/solutions/frontend-issues/stimulus-race-condition.md # plan is API, not frontend
233
+ docs/solutions/authentication-issues/jwt-expiry.md # plan has no auth
234
+ ```
235
+
236
+ **Spawn sub-agents in PARALLEL for all filtered learnings.**
237
+
238
+ **These learnings are institutional knowledge - applying them prevents repeating past mistakes.**
239
+
240
+ ### 4. Launch Per-Section Research Agents
241
+
242
+ <thinking>
243
+ For each major section in the plan, spawn dedicated sub-agents to research improvements. Use the Explore agent type for open-ended research.
244
+ </thinking>
245
+
246
+ **For each identified section, launch parallel research:**
247
+
248
+ ```
249
+ Task Explore: "Research best practices, patterns, and real-world examples for: [section topic].
250
+ Find:
251
+ - Industry standards and conventions
252
+ - Performance considerations
253
+ - Common pitfalls and how to avoid them
254
+ - Documentation and tutorials
255
+ Return concrete, actionable recommendations."
256
+ ```
257
+
258
+ **Also use Context7 MCP for framework documentation:**
259
+
260
+ For any technologies/frameworks mentioned in the plan, query Context7:
261
+ ```
262
+ mcp_context7_resolve-library-id: Find library ID for [framework]
263
+ mcp_context7_query-docs: Query documentation for specific patterns
264
+ ```
265
+
266
+ **Use WebSearch for current best practices:**
267
+
268
+ Search for recent (2024-2025) articles, blog posts, and documentation on topics in the plan.
269
+
270
+ ### 5. Discover and Run ALL Review Agents
271
+
272
+ <thinking>
273
+ Dynamically discover every available agent and run them ALL against the plan. Don't filter, don't skip, don't assume relevance. 40+ parallel agents is fine. Use everything available.
274
+ </thinking>
275
+
276
+ **Step 1: Discover ALL available agents from ALL sources**
277
+
278
+ ```bash
279
+ # 1. Project-local agents (highest priority - project-specific)
280
+ find .agent/agents -name "*.md" 2>/dev/null
281
+
282
+ # 2. User's global agents (~/.agent/)
283
+ find ~/.agent/agents -name "*.md" 2>/dev/null
284
+
285
+ # 3. compound-engineering plugin agents (all subdirectories)
286
+ find ~/.agent/plugins/cache/*/compound-engineering/*/agents -name "*.md" 2>/dev/null
287
+
288
+ # 4. ALL other installed plugins - check every plugin for agents
289
+ find ~/.agent/plugins/cache -path "*/agents/*.md" 2>/dev/null
290
+
291
+ # 5. Check installed_plugins.json to find all plugin locations
292
+ cat ~/.agent/plugins/installed_plugins.json
293
+
294
+ # 6. For local plugins (isLocal: true), check their source directories
295
+ # Parse installed_plugins.json and find local plugin paths
296
+ ```
297
+
298
+ **Important:** Check EVERY source. Include agents from:
299
+ - Project `.agent/agents/`
300
+ - User's `~/.agent/agents/`
301
+ - compound-engineering plugin (but SKIP workflow/ agents - only use review/, research/, design/, docs/)
302
+ - ALL other installed plugins (agent-sdk-dev, frontend-design, etc.)
303
+ - Any local plugins
304
+
305
+ **For compound-engineering plugin specifically:**
306
+ - USE: `agents/review/*` (all reviewers)
307
+ - USE: `agents/research/*` (all researchers)
308
+ - USE: `agents/design/*` (design agents)
309
+ - USE: `agents/docs/*` (documentation agents)
310
+ - SKIP: `agents/workflow/*` (these are workflow orchestrators, not reviewers)
311
+
312
+ **Step 2: For each discovered agent, read its description**
313
+
314
+ Read the first few lines of each agent file to understand what it reviews/analyzes.
315
+
316
+ **Step 3: Launch ALL agents in parallel**
317
+
318
+ For EVERY agent discovered, launch a Task in parallel:
319
+
320
+ ```
321
+ Task [agent-name]: "Review this plan using your expertise. Apply all your checks and patterns. Plan content: [full plan content]"
322
+ ```
323
+
324
+ **CRITICAL RULES:**
325
+ - Do NOT filter agents by "relevance" - run them ALL
326
+ - Do NOT skip agents because they "might not apply" - let them decide
327
+ - Launch ALL agents in a SINGLE message with multiple Task tool calls
328
+ - 20, 30, 40 parallel agents is fine - use everything
329
+ - Each agent may catch something others miss
330
+ - The goal is MAXIMUM coverage, not efficiency
331
+
332
+ **Step 4: Also discover and run research agents**
333
+
334
+ Research agents (like `best-practices-researcher`, `framework-docs-researcher`, `git-history-analyzer`, `repo-research-analyst`) should also be run for relevant plan sections.