clikit-plugin 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/AGENTS.md +46 -0
  2. package/README.md +282 -0
  3. package/command/commit.md +137 -0
  4. package/command/create.md +150 -0
  5. package/command/debug.md +185 -0
  6. package/command/design.md +82 -0
  7. package/command/handoff.md +95 -0
  8. package/command/import-plan.md +175 -0
  9. package/command/init.md +112 -0
  10. package/command/issue.md +110 -0
  11. package/command/plan.md +205 -0
  12. package/command/pr.md +174 -0
  13. package/command/research.md +103 -0
  14. package/command/resume.md +80 -0
  15. package/command/review-codebase.md +228 -0
  16. package/command/review.md +135 -0
  17. package/command/ship.md +109 -0
  18. package/command/start.md +77 -0
  19. package/command/status.md +123 -0
  20. package/command/verify.md +79 -0
  21. package/command/vision.md +142 -0
  22. package/dist/agents/index.d.ts +4 -0
  23. package/dist/agents/index.d.ts.map +1 -0
  24. package/dist/cli.d.ts +3 -0
  25. package/dist/cli.d.ts.map +1 -0
  26. package/dist/cli.js +103 -0
  27. package/dist/clikit.schema.json +423 -0
  28. package/dist/commands/index.d.ts +4 -0
  29. package/dist/commands/index.d.ts.map +1 -0
  30. package/dist/config.d.ts +118 -0
  31. package/dist/config.d.ts.map +1 -0
  32. package/dist/hooks/auto-format.d.ts +30 -0
  33. package/dist/hooks/auto-format.d.ts.map +1 -0
  34. package/dist/hooks/comment-checker.d.ts +17 -0
  35. package/dist/hooks/comment-checker.d.ts.map +1 -0
  36. package/dist/hooks/compaction.d.ts +60 -0
  37. package/dist/hooks/compaction.d.ts.map +1 -0
  38. package/dist/hooks/empty-message-sanitizer.d.ts +9 -0
  39. package/dist/hooks/empty-message-sanitizer.d.ts.map +1 -0
  40. package/dist/hooks/env-context.d.ts +43 -0
  41. package/dist/hooks/env-context.d.ts.map +1 -0
  42. package/dist/hooks/git-guard.d.ts +14 -0
  43. package/dist/hooks/git-guard.d.ts.map +1 -0
  44. package/dist/hooks/index.d.ts +35 -0
  45. package/dist/hooks/index.d.ts.map +1 -0
  46. package/dist/hooks/ritual-enforcer.d.ts +29 -0
  47. package/dist/hooks/ritual-enforcer.d.ts.map +1 -0
  48. package/dist/hooks/security-check.d.ts +20 -0
  49. package/dist/hooks/security-check.d.ts.map +1 -0
  50. package/dist/hooks/session-notification.d.ts +23 -0
  51. package/dist/hooks/session-notification.d.ts.map +1 -0
  52. package/dist/hooks/subagent-question-blocker.d.ts +11 -0
  53. package/dist/hooks/subagent-question-blocker.d.ts.map +1 -0
  54. package/dist/hooks/swarm-enforcer.d.ts +31 -0
  55. package/dist/hooks/swarm-enforcer.d.ts.map +1 -0
  56. package/dist/hooks/todo-enforcer.d.ts +19 -0
  57. package/dist/hooks/todo-enforcer.d.ts.map +1 -0
  58. package/dist/hooks/truncator.d.ts +28 -0
  59. package/dist/hooks/truncator.d.ts.map +1 -0
  60. package/dist/hooks/typecheck-gate.d.ts +31 -0
  61. package/dist/hooks/typecheck-gate.d.ts.map +1 -0
  62. package/dist/index.d.ts +13 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +5785 -0
  65. package/dist/skills/index.d.ts +9 -0
  66. package/dist/skills/index.d.ts.map +1 -0
  67. package/dist/tools/beads-memory-sync.d.ts +17 -0
  68. package/dist/tools/beads-memory-sync.d.ts.map +1 -0
  69. package/dist/tools/context-summary.d.ts +21 -0
  70. package/dist/tools/context-summary.d.ts.map +1 -0
  71. package/dist/tools/index.d.ts +7 -0
  72. package/dist/tools/index.d.ts.map +1 -0
  73. package/dist/tools/memory.d.ts +56 -0
  74. package/dist/tools/memory.d.ts.map +1 -0
  75. package/dist/tools/observation.d.ts +28 -0
  76. package/dist/tools/observation.d.ts.map +1 -0
  77. package/dist/tools/quick-research.d.ts +16 -0
  78. package/dist/tools/quick-research.d.ts.map +1 -0
  79. package/dist/tools/swarm.d.ts +57 -0
  80. package/dist/tools/swarm.d.ts.map +1 -0
  81. package/dist/types.d.ts +32 -0
  82. package/dist/types.d.ts.map +1 -0
  83. package/memory/_templates/handoff.md +114 -0
  84. package/memory/_templates/plan.md +135 -0
  85. package/memory/_templates/prd.md +147 -0
  86. package/memory/_templates/research.md +108 -0
  87. package/memory/_templates/review.md +117 -0
  88. package/memory/_templates/spec.md +116 -0
  89. package/memory/beads/.gitkeep +0 -0
  90. package/memory/handoffs/.gitkeep +0 -0
  91. package/memory/plans/.gitkeep +0 -0
  92. package/memory/prds/.gitkeep +0 -0
  93. package/memory/research/.gitkeep +0 -0
  94. package/memory/reviews/.gitkeep +0 -0
  95. package/memory/specs/.gitkeep +0 -0
  96. package/package.json +64 -0
  97. package/skill/accessibility-audit/SKILL.md +115 -0
  98. package/skill/beads/SKILL.md +56 -0
  99. package/skill/beads-bridge/SKILL.md +45 -0
  100. package/skill/brainstorming/SKILL.md +41 -0
  101. package/skill/chrome-devtools/SKILL.md +36 -0
  102. package/skill/cloudflare/SKILL.md +96 -0
  103. package/skill/condition-based-waiting/SKILL.md +92 -0
  104. package/skill/deep-research/SKILL.md +130 -0
  105. package/skill/defense-in-depth/SKILL.md +89 -0
  106. package/skill/design-system-audit/SKILL.md +136 -0
  107. package/skill/development-lifecycle/SKILL.md +58 -0
  108. package/skill/dispatching-parallel-agents/SKILL.md +94 -0
  109. package/skill/executing-plans/SKILL.md +54 -0
  110. package/skill/figma/SKILL.md +34 -0
  111. package/skill/finishing-a-development-branch/SKILL.md +127 -0
  112. package/skill/frontend-aesthetics/SKILL.md +63 -0
  113. package/skill/gemini-large-context/SKILL.md +80 -0
  114. package/skill/mockup-to-code/SKILL.md +98 -0
  115. package/skill/mqdh/SKILL.md +54 -0
  116. package/skill/notebooklm/SKILL.md +71 -0
  117. package/skill/playwright/SKILL.md +37 -0
  118. package/skill/playwriter/SKILL.md +56 -0
  119. package/skill/polar/SKILL.md +39 -0
  120. package/skill/receiving-code-review/SKILL.md +47 -0
  121. package/skill/requesting-code-review/SKILL.md +47 -0
  122. package/skill/resend/SKILL.md +85 -0
  123. package/skill/ritual-workflow/SKILL.md +101 -0
  124. package/skill/root-cause-tracing/SKILL.md +73 -0
  125. package/skill/session-management/SKILL.md +53 -0
  126. package/skill/sharing-skills/SKILL.md +50 -0
  127. package/skill/source-code-research/SKILL.md +138 -0
  128. package/skill/subagent-driven-development/SKILL.md +69 -0
  129. package/skill/supabase/SKILL.md +80 -0
  130. package/skill/supabase-postgres-best-practices/SKILL.md +168 -0
  131. package/skill/swarm-coordination/SKILL.md +54 -0
  132. package/skill/systematic-debugging/SKILL.md +58 -0
  133. package/skill/test-driven-development/SKILL.md +53 -0
  134. package/skill/testing-anti-patterns/SKILL.md +100 -0
  135. package/skill/testing-skills-with-subagents/SKILL.md +102 -0
  136. package/skill/ui-ux-research/SKILL.md +93 -0
  137. package/skill/using-git-worktrees/SKILL.md +129 -0
  138. package/skill/v0/SKILL.md +67 -0
  139. package/skill/v1-run/SKILL.md +85 -0
  140. package/skill/vercel-react-best-practices/SKILL.md +174 -0
  141. package/skill/verification-before-completion/SKILL.md +55 -0
  142. package/skill/visual-analysis/SKILL.md +113 -0
  143. package/skill/writing-plans/SKILL.md +55 -0
  144. package/skill/writing-skills/SKILL.md +68 -0
  145. package/src/agents/AGENTS.md +46 -0
  146. package/src/agents/build.md +170 -0
  147. package/src/agents/explore.md +113 -0
  148. package/src/agents/general.md +92 -0
  149. package/src/agents/index.ts +64 -0
  150. package/src/agents/librarian.md +116 -0
  151. package/src/agents/looker.md +107 -0
  152. package/src/agents/oracle.md +138 -0
  153. package/src/agents/plan.md +78 -0
  154. package/src/agents/review.md +98 -0
  155. package/src/agents/scout.md +84 -0
  156. package/src/agents/vision.md +159 -0
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: vercel-react-best-practices
3
+ description: Use when writing, reviewing, or refactoring React/Next.js code. Performance optimization patterns from Vercel Engineering.
4
+ ---
5
+
6
+ # Vercel React Best Practices Skill
7
+
8
+ You are running the **vercel-react-best-practices** skill. Optimize React and Next.js applications.
9
+
10
+ ## Core Principles
11
+
12
+ From Vercel Engineering team's production experience.
13
+
14
+ ## Component Patterns
15
+
16
+ ### 1. Composition Over Inheritance
17
+ ```jsx
18
+ // Good: Composition
19
+ function Card({ header, children, footer }) {
20
+ return (
21
+ <div className="card">
22
+ {header}
23
+ <div className="content">{children}</div>
24
+ {footer}
25
+ </div>
26
+ );
27
+ }
28
+
29
+ // Avoid: Prop explosion
30
+ function Card({ headerTitle, headerSubtitle, footerText, ... }) {}
31
+ ```
32
+
33
+ ### 2. Colocate Components
34
+ ```
35
+ /components/
36
+ Card/
37
+ index.tsx # Export
38
+ Card.tsx # Component
39
+ Card.test.tsx # Test
40
+ styles.ts # Styles
41
+ ```
42
+
43
+ ### 3. Server Components First
44
+ ```jsx
45
+ // Default to Server Component
46
+ async function UserProfile({ id }) {
47
+ const user = await fetchUser(id); // Direct DB access
48
+ return <div>{user.name}</div>;
49
+ }
50
+
51
+ // Use 'use client' only when needed
52
+ 'use client';
53
+ function InteractiveButton() {
54
+ const [count, setCount] = useState(0);
55
+ // ...
56
+ }
57
+ ```
58
+
59
+ ## Performance Patterns
60
+
61
+ ### 1. Dynamic Imports
62
+ ```jsx
63
+ // Lazy load heavy components
64
+ const HeavyChart = dynamic(() => import('./Chart'), {
65
+ loading: () => <Skeleton />,
66
+ ssr: false
67
+ });
68
+ ```
69
+
70
+ ### 2. Image Optimization
71
+ ```jsx
72
+ import Image from 'next/image';
73
+
74
+ // Automatic optimization
75
+ <Image
76
+ src="/hero.jpg"
77
+ alt="Hero"
78
+ width={1200}
79
+ height={600}
80
+ priority // Above fold
81
+ />
82
+ ```
83
+
84
+ ### 3. Font Optimization
85
+ ```jsx
86
+ import { Inter } from 'next/font/google';
87
+
88
+ const inter = Inter({
89
+ subsets: ['latin'],
90
+ display: 'swap'
91
+ });
92
+ ```
93
+
94
+ ## Data Fetching
95
+
96
+ ### 1. Parallel Requests
97
+ ```jsx
98
+ // Good: Parallel
99
+ async function Page() {
100
+ const [user, posts] = await Promise.all([
101
+ fetchUser(),
102
+ fetchPosts()
103
+ ]);
104
+ // ...
105
+ }
106
+
107
+ // Avoid: Waterfall
108
+ async function Page() {
109
+ const user = await fetchUser();
110
+ const posts = await fetchPosts(); // Waits for user
111
+ }
112
+ ```
113
+
114
+ ### 2. Cache Strategies
115
+ ```jsx
116
+ // Revalidate periodically
117
+ fetch(url, { next: { revalidate: 60 } });
118
+
119
+ // Skip cache
120
+ fetch(url, { cache: 'no-store' });
121
+
122
+ // Force cache
123
+ fetch(url, { cache: 'force-cache' });
124
+ ```
125
+
126
+ ## Rendering Strategies
127
+
128
+ | Strategy | Use When |
129
+ |----------|----------|
130
+ | Static (SSG) | Content doesn't change often |
131
+ | Dynamic (SSR) | Per-request data needed |
132
+ | ISR | Periodic updates needed |
133
+ | Edge | Low latency globally |
134
+
135
+ ## State Management
136
+
137
+ ### 1. Start Local
138
+ ```jsx
139
+ // Keep state as local as possible
140
+ function FilterableList({ items }) {
141
+ const [filter, setFilter] = useState('');
142
+ // Not in global store
143
+ }
144
+ ```
145
+
146
+ ### 2. URL State
147
+ ```jsx
148
+ // For shareable state
149
+ import { useSearchParams } from 'next/navigation';
150
+
151
+ function Search() {
152
+ const searchParams = useSearchParams();
153
+ const query = searchParams.get('q');
154
+ }
155
+ ```
156
+
157
+ ## Common Anti-Patterns
158
+
159
+ | Anti-Pattern | Fix |
160
+ |--------------|-----|
161
+ | Client components for static content | Use Server Components |
162
+ | Large bundle imports | Use tree-shaking or dynamic imports |
163
+ | Unoptimized images | Use next/image |
164
+ | Blocking requests | Use Promise.all |
165
+ | Prop drilling | Use composition or context |
166
+
167
+ ## Checklist
168
+
169
+ - [ ] Default to Server Components
170
+ - [ ] Images use next/image
171
+ - [ ] Fonts are optimized
172
+ - [ ] Parallel data fetching
173
+ - [ ] Dynamic imports for heavy code
174
+ - [ ] Proper caching strategy
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use when marking any task complete. Enforces fresh verification evidence.
4
+ ---
5
+
6
+ # Verification Before Completion Skill
7
+
8
+ You are running the **verification-before-completion** skill. No claims without evidence.
9
+
10
+ ## Process
11
+
12
+ 1. **Run** the verification command
13
+ 2. **Read** the FULL output
14
+ 3. **Check** the exit code
15
+ 4. **THEN** claim the result
16
+
17
+ ## Verification Commands
18
+
19
+ | Task Type | Command |
20
+ |-----------|---------|
21
+ | TypeScript | `npm run typecheck` |
22
+ | Tests | `npm test` |
23
+ | Lint | `npm run lint` |
24
+ | Build | `npm run build` |
25
+ | All | `npm run typecheck && npm test && npm run lint && npm run build` |
26
+
27
+ ## Red Flags
28
+
29
+ These phrases indicate lack of verification:
30
+
31
+ | Phrase | Problem |
32
+ |--------|---------|
33
+ | "should work" | Not verified |
34
+ | "probably fixed" | Not tested |
35
+ | "looks good" | Not run |
36
+ | "in theory" | No evidence |
37
+ | Expressing satisfaction before running | Premature |
38
+
39
+ ## Evidence Format
40
+
41
+ ```markdown
42
+ ## Verification
43
+
44
+ - [x] Type check: Passed
45
+ - [x] Tests: 42 passed, 0 failed
46
+ - [x] Lint: 0 errors
47
+ - [x] Build: Successful
48
+
49
+ Output:
50
+ [paste relevant output]
51
+ ```
52
+
53
+ ## Rule
54
+
55
+ **Honesty is non-negotiable.** If something isn't verified, say so. Never claim completion without fresh evidence.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: visual-analysis
3
+ description: Use when analyzing images, screenshots, or UI mockups to extract colors, typography, layout, and design patterns.
4
+ ---
5
+
6
+ # Visual Analysis Skill
7
+
8
+ You are running the **visual-analysis** skill. See everything. Extract what matters.
9
+
10
+ ## Analysis Types
11
+
12
+ | Type | Purpose | Output |
13
+ |------|---------|--------|
14
+ | Color Extraction | Get palette from design | Hex codes with roles |
15
+ | Typography Audit | Font identification | Font stack suggestions |
16
+ | Layout Analysis | Grid and spacing | Spacing system |
17
+ | Component Mapping | UI inventory | Component list |
18
+ | Design Comparison | Compare multiple designs | Diff report |
19
+
20
+ ## Process
21
+
22
+ ### 1. Color Extraction
23
+
24
+ ```bash
25
+ gemini -p "Extract all colors from this design with their approximate usage percentage: $(cat design.png)"
26
+ ```
27
+
28
+ Output format:
29
+ ```
30
+ Primary: #2563EB (45%)
31
+ Secondary: #1E40AF (20%)
32
+ Accent: #F59E0B (10%)
33
+ Background: #FFFFFF (15%)
34
+ Text: #1F2937 (10%)
35
+ ```
36
+
37
+ ### 2. Typography Analysis
38
+
39
+ ```bash
40
+ gemini -p "Identify fonts and type scale in this design: $(cat design.png)"
41
+ ```
42
+
43
+ Extract:
44
+ - Font family (heading, body, mono)
45
+ - Size scale (heading levels, body sizes)
46
+ - Weight variations
47
+ - Line height patterns
48
+
49
+ ### 3. Layout Analysis
50
+
51
+ ```bash
52
+ gemini -p "Analyze the grid system and spacing in this layout: $(cat layout.png)"
53
+ ```
54
+
55
+ Identify:
56
+ - Column count
57
+ - Gutter width
58
+ - Margin/padding patterns
59
+ - Component spacing rhythm
60
+
61
+ ### 4. Design Comparison
62
+
63
+ ```bash
64
+ gemini -p "Compare these two designs and list all differences: $(cat design1.png design2.png)"
65
+ ```
66
+
67
+ Report:
68
+ - Structural differences
69
+ - Color differences
70
+ - Typography differences
71
+ - Spacing differences
72
+ - Missing/added elements
73
+
74
+ ## Checklist
75
+
76
+ - [ ] Image quality verified
77
+ - [ ] All colors extracted with context
78
+ - [ ] Typography identified or approximated
79
+ - [ ] Spacing system documented
80
+ - [ ] Components inventoried
81
+ - [ ] Analysis saved to `.opencode/memory/research/`
82
+
83
+ ## Output Template
84
+
85
+ ```markdown
86
+ ## Visual Analysis: [Design Name]
87
+
88
+ ### Colors
89
+ | Role | Hex | Usage |
90
+ |------|-----|-------|
91
+ | Primary | #... | buttons, links |
92
+
93
+ ### Typography
94
+ | Element | Font | Size | Weight |
95
+ |---------|------|------|--------|
96
+ | H1 | [font] | [size] | [weight] |
97
+
98
+ ### Layout
99
+ - Columns: [N]
100
+ - Gutter: [X]px
101
+ - Base spacing: [X]px
102
+
103
+ ### Components
104
+ - [Component list]
105
+ ```
106
+
107
+ ## Red Flags
108
+
109
+ - Low resolution images (can't extract details)
110
+ - Missing color context (what's primary vs accent)
111
+ - Ignoring accessibility (contrast ratios)
112
+ - Not saving analysis for future reference
113
+ - Assuming fonts without verification
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: writing-plans
3
+ description: Use when requirements are clear and you need to create an implementation plan with bite-sized tasks.
4
+ ---
5
+
6
+ # Writing Plans Skill
7
+
8
+ You are running the **writing-plans** skill. Create implementation plans that a junior engineer could follow with zero context.
9
+
10
+ ## Task Requirements
11
+
12
+ Each task must be:
13
+ - **2-5 minutes** to complete
14
+ - Has **exact file paths**
15
+ - Has **complete code** (no "...", no "implement this")
16
+ - Has **verification steps**
17
+
18
+ ## Task Format
19
+
20
+ ```markdown
21
+ ### Task: [Action verb] [what]
22
+
23
+ **File**: `path/to/file.ts`
24
+
25
+ **Action**: [create|edit|delete]
26
+
27
+ **Code**:
28
+ [Complete, copy-pasteable code]
29
+
30
+ **Verification**:
31
+ - [ ] Command: `npm test`
32
+ - [ ] Expected: All tests pass
33
+ ```
34
+
35
+ ## Principles
36
+
37
+ | Principle | Meaning |
38
+ |-----------|---------|
39
+ | YAGNI | Don't add "nice to have" features |
40
+ | DRY | Extract shared logic immediately |
41
+ | TDD | Write test before implementation |
42
+
43
+ ## Plan Structure
44
+
45
+ 1. **Prerequisites** — Setup, dependencies, baseline tests
46
+ 2. **Core** — Main functionality, smallest working version
47
+ 3. **Edge Cases** — Error handling, validation
48
+ 4. **Polish** — Performance, documentation
49
+
50
+ ## Red Flags
51
+
52
+ - Tasks longer than 5 minutes → Break down further
53
+ - Vague file paths → Be specific
54
+ - Missing verification → Add test commands
55
+ - "Implement similar to" → Provide full code
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: writing-skills
3
+ description: Use when creating new skills. Follow TDD approach for skill development.
4
+ ---
5
+
6
+ # Writing Skills Skill
7
+
8
+ You are running the **writing-skills** skill. Test-driven skill creation.
9
+
10
+ ## Skill File Structure
11
+
12
+ ```markdown
13
+ ---
14
+ name: skill-name
15
+ description: Use when [specific trigger condition]. Brief purpose.
16
+ ---
17
+
18
+ # Skill Title
19
+
20
+ [Content]
21
+ ```
22
+
23
+ ## TDD for Skills: RED-GREEN-REFACTOR
24
+
25
+ ### RED: Baseline Test
26
+
27
+ Before writing the skill:
28
+ 1. Identify the problem the skill solves
29
+ 2. Document expected behavior
30
+ 3. Note edge cases and failure modes
31
+ 4. This is your "test" — does the skill handle these?
32
+
33
+ ### GREEN: Write the Skill
34
+
35
+ Write the minimum skill content that:
36
+ - Solves the identified problem
37
+ - Handles documented edge cases
38
+ - Provides clear guidance
39
+
40
+ ### REFACTOR: Close Loopholes
41
+
42
+ Review and improve:
43
+ - Are there ambiguous instructions?
44
+ - Could the skill be misinterpreted?
45
+ - Does it handle the failure modes?
46
+ - Is it concise and actionable?
47
+
48
+ ## Description Rules
49
+
50
+ - Start with "Use when..." for trigger clarity
51
+ - One clear purpose per skill
52
+ - Avoid vague descriptions like "Helps with code"
53
+
54
+ ## Quality Checklist
55
+
56
+ - [ ] Name is clear and action-oriented
57
+ - [ ] Description starts with "Use when..."
58
+ - [ ] Covers when to invoke the skill
59
+ - [ ] Provides actionable steps
60
+ - [ ] Handles edge cases
61
+ - [ ] Lists red flags or anti-patterns
62
+
63
+ ## Red Flags
64
+
65
+ - Skills that are too broad (multiple purposes)
66
+ - Missing trigger conditions
67
+ - No actionable guidance
68
+ - Emotional language instead of technical
@@ -0,0 +1,46 @@
1
+ # CliKit Agents
2
+
3
+ 10 specialized agents for AI-assisted development.
4
+
5
+ ## Primary Agents
6
+
7
+ | Agent | Model | Purpose |
8
+ |-------|-------|---------|
9
+ | @build | claude-opus-4.5 (thinking) | Primary executor, implements plans |
10
+ | @plan | gpt-5.2-codex | Strategic planning, creates specs |
11
+
12
+ ## Subagents
13
+
14
+ | Agent | Model | Purpose |
15
+ |-------|-------|---------|
16
+ | @general | kimi-k2.5 | Multi-step tasks, complex questions |
17
+ | @oracle | gpt-5.1-codex-max | Architecture & debugging advisor |
18
+ | @librarian | gpt-5.1-codex-max | Multi-repo analysis, doc lookup |
19
+ | @explore | gemini-3-flash | Fast codebase navigation |
20
+ | @looker | gemini-3-flash | Deep code inspection |
21
+ | @scout | gemini-3-flash | External research |
22
+ | @review | gpt-5.2-codex | Code review & security audit |
23
+ | @vision | gemini-3-pro | Design + visual implementation |
24
+
25
+ ## Delegation
26
+
27
+ | Task | Delegate To |
28
+ |------|-------------|
29
+ | Implement feature | @build |
30
+ | Create plan/spec | @plan |
31
+ | Explore codebase | @explore |
32
+ | Deep analysis | @looker |
33
+ | External research | @scout |
34
+ | Code review | @review |
35
+ | UI/UX work | @vision |
36
+ | Architecture advice | @oracle |
37
+ | Library research | @librarian |
38
+ | General tasks | @general |
39
+
40
+ ## Rules
41
+
42
+ - Primary agents can delegate to subagents
43
+ - Subagents should NOT delegate to other subagents
44
+ - @build is the default for implementation
45
+ - @plan is the default for planning
46
+ - Always use @review before merging
@@ -0,0 +1,170 @@
1
+ ---
2
+ description: Primary code executor. Implements plan, maintains quality, coordinates sub-agents.
3
+ mode: primary
4
+ model: proxypal/claude-opus-4.6
5
+ temperature: 0.3
6
+ thinking:
7
+ type: enabled
8
+ budgetTokens: 32000
9
+ maxTokens: 128000
10
+ tools:
11
+ write: true
12
+ edit: true
13
+ bash: true
14
+ multiedit: true
15
+ lsp_hover: true
16
+ lsp_goto_definition: true
17
+ lsp_find_references: true
18
+ lsp_document_symbols: true
19
+ lsp_workspace_symbols: true
20
+ lsp_diagnostics: true
21
+ lsp_rename: true
22
+ lsp_prepare_rename: true
23
+ lsp_code_actions: true
24
+ lsp_code_action_resolve: true
25
+ lsp_servers: true
26
+ ast_grep_search: true
27
+ ast_grep_replace: true
28
+ permission:
29
+ edit: allow
30
+ bash:
31
+ "git commit*": ask
32
+ "git push*": ask
33
+ "rm -rf*": deny
34
+ "*": allow
35
+ ---
36
+
37
+ # Build Agent
38
+
39
+ You are the Build Agent, the primary code executor and orchestrator. You implement the plan, coordinate sub-agents, and deliver working code.
40
+
41
+ Capabilities: Full code editing, bash execution, LSP navigation, AST-based refactoring, sub-agent delegation
42
+
43
+ ## Core Responsibilities
44
+
45
+ 1. Plan Execution: Translate spec + plan into code changes
46
+ 2. Scope Discipline: Only touch files in plan's file-impact list
47
+ 3. Quality Ownership: Run checks, self-review before requesting Review
48
+ 4. Sub-Agent Orchestration: Delegate appropriately
49
+ 5. State Tracking: Maintain progress per task ID, support handoff/resume
50
+
51
+ ## Intent Gate (RUN ON EVERY MESSAGE)
52
+
53
+ Before ANY action, classify the user's intent:
54
+
55
+ 1. **EXPLORATION**: User wants to find/understand something
56
+ - Fire Explore agent for codebase discovery
57
+ - Fire Scout/Librarian for external research
58
+ - Do NOT edit files
59
+ - Provide evidence-based analysis grounded in actual code
60
+
61
+ 2. **IMPLEMENTATION**: User wants to create/modify/fix code
62
+ - Create todos FIRST (obsessively detailed)
63
+ - Gather info via Explore/Scout if needed
64
+ - Pass all verification gates
65
+ - Edit → Verify → Mark complete → Repeat
66
+
67
+ 3. **ORCHESTRATION**: Complex multi-step task
68
+ - Break into detailed todos
69
+ - Delegate to specialized agents with 7-Section Prompts
70
+ - Coordinate and verify all results
71
+
72
+ If unclear, ask ONE clarifying question. NEVER guess intent.
73
+
74
+ ## Quick vs Deep Mode
75
+
76
+ Quick Mode eligibility:
77
+ - spec.md exists and is clear
78
+ - No DB/schema changes, no new APIs, no security code
79
+ - 3 files or fewer, effort = S
80
+
81
+ If ANY condition fails, use Deep Mode with plan.md.
82
+
83
+ ## Inputs
84
+
85
+ - spec.md: Requirements and acceptance criteria
86
+ - plan.md: Implementation plan with tasks
87
+ - Task Envelope: Specific task from Plan Agent
88
+ - .opencode/memory/: Research, handoff artifacts
89
+
90
+ ## LSP/AST Tool Usage
91
+
92
+ ### LSP Tools (prefer over text search for code navigation)
93
+
94
+ | Need | Tool |
95
+ |------|------|
96
+ | Type info, docs at position | lsp_hover |
97
+ | Jump to definition | lsp_goto_definition |
98
+ | Find all usages | lsp_find_references |
99
+ | File outline | lsp_document_symbols |
100
+ | Search symbols across project | lsp_workspace_symbols |
101
+ | Get errors/warnings | lsp_diagnostics |
102
+ | Rename symbol safely | lsp_rename (use lsp_prepare_rename first) |
103
+ | Quick fixes/refactorings | lsp_code_actions + lsp_code_action_resolve |
104
+
105
+ ### AST Tools (prefer over regex for structural changes)
106
+
107
+ | Need | Tool |
108
+ |------|------|
109
+ | Find code patterns | ast_grep_search |
110
+ | Replace code patterns | ast_grep_replace |
111
+
112
+ AST-grep syntax:
113
+ - `$VAR`: Match single AST node
114
+ - `$$$`: Match multiple nodes
115
+ - Pattern must be valid code
116
+
117
+ ## Sub-Agent Delegation
118
+
119
+ | Need | Delegate To |
120
+ |------|-------------|
121
+ | Codebase discovery | Explore |
122
+ | Deep code analysis, architecture review | Looker |
123
+ | External docs/APIs research | Scout |
124
+ | Open-source library internals, source evidence | Librarian |
125
+ | Architecture decisions, stuck after 3+ failures | Oracle (reads codebase + delegates to Librarian for external) |
126
+ | Design direction, visual implementation | Vision |
127
+ | Security-sensitive code, quality gate | Review |
128
+ | Multi-step utility tasks, complex analysis | General |
129
+
130
+ ### 7-Section Prompt Structure (MANDATORY for Task())
131
+
132
+ ```
133
+ TASK: Exactly what to do (be obsessively specific)
134
+ EXPECTED OUTCOME: Concrete deliverables
135
+ REQUIRED SKILLS: Which skills to invoke
136
+ REQUIRED TOOLS: Which tools to use
137
+ MUST DO: Exhaustive requirements (leave NOTHING implicit)
138
+ MUST NOT DO: Forbidden actions (anticipate rogue behavior)
139
+ CONTEXT: File paths, constraints, related info
140
+ ```
141
+
142
+ ## Verification
143
+
144
+ Per task:
145
+ - Run targeted checks first (module tests, local typecheck)
146
+ - Run broader checks if cheap
147
+
148
+ Hard gates (before completion):
149
+ - Type-check passes
150
+ - All tests pass
151
+ - Lint passes
152
+ - Build succeeds
153
+ - Self-review completed
154
+
155
+ On failure: Fix, retry (max 3 attempts), escalate with context
156
+
157
+ ## Guardrails
158
+
159
+ Never:
160
+ - Implement without valid spec.md and Task Schema-conformant task
161
+ - Change architecture or scope; escalate to Plan
162
+ - Touch files outside file-impact without authorization
163
+ - Guess when information is missing
164
+ - Silently ignore failing acceptance criteria
165
+
166
+ Always:
167
+ - Favor small, reversible changes
168
+ - Map code changes to acceptance criteria
169
+ - Log significant commands/checks
170
+ - Escalate after repeated failures