ai-eng-system 0.0.1

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 (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +115 -0
  3. package/dist/.claude-plugin/agents/agent-creator.md +206 -0
  4. package/dist/.claude-plugin/agents/ai_engineer.md +187 -0
  5. package/dist/.claude-plugin/agents/api_builder_enhanced.md +82 -0
  6. package/dist/.claude-plugin/agents/architect-advisor.md +88 -0
  7. package/dist/.claude-plugin/agents/backend_architect.md +88 -0
  8. package/dist/.claude-plugin/agents/code_reviewer.md +208 -0
  9. package/dist/.claude-plugin/agents/command-creator.md +331 -0
  10. package/dist/.claude-plugin/agents/cost_optimizer.md +284 -0
  11. package/dist/.claude-plugin/agents/database_optimizer.md +175 -0
  12. package/dist/.claude-plugin/agents/deployment_engineer.md +186 -0
  13. package/dist/.claude-plugin/agents/docs-writer.md +99 -0
  14. package/dist/.claude-plugin/agents/documentation_specialist.md +212 -0
  15. package/dist/.claude-plugin/agents/frontend-reviewer.md +51 -0
  16. package/dist/.claude-plugin/agents/full_stack_developer.md +391 -0
  17. package/dist/.claude-plugin/agents/infrastructure_builder.md +77 -0
  18. package/dist/.claude-plugin/agents/java-pro.md +182 -0
  19. package/dist/.claude-plugin/agents/ml_engineer.md +176 -0
  20. package/dist/.claude-plugin/agents/monitoring_expert.md +79 -0
  21. package/dist/.claude-plugin/agents/performance_engineer.md +193 -0
  22. package/dist/.claude-plugin/agents/plugin-validator.md +378 -0
  23. package/dist/.claude-plugin/agents/prompt-optimizer.md +63 -0
  24. package/dist/.claude-plugin/agents/security_scanner.md +332 -0
  25. package/dist/.claude-plugin/agents/seo-specialist.md +73 -0
  26. package/dist/.claude-plugin/agents/skill-creator.md +311 -0
  27. package/dist/.claude-plugin/agents/test-docs-writer-2.md +46 -0
  28. package/dist/.claude-plugin/agents/test-docs-writer-usage.md +40 -0
  29. package/dist/.claude-plugin/agents/test-docs-writer.md +98 -0
  30. package/dist/.claude-plugin/agents/test_generator.md +260 -0
  31. package/dist/.claude-plugin/agents/tool-creator.md +474 -0
  32. package/dist/.claude-plugin/commands/compound.md +26 -0
  33. package/dist/.claude-plugin/commands/context.md +318 -0
  34. package/dist/.claude-plugin/commands/create-agent.md +48 -0
  35. package/dist/.claude-plugin/commands/create-command.md +48 -0
  36. package/dist/.claude-plugin/commands/create-plugin.md +400 -0
  37. package/dist/.claude-plugin/commands/create-skill.md +48 -0
  38. package/dist/.claude-plugin/commands/create-tool.md +53 -0
  39. package/dist/.claude-plugin/commands/deploy.md +35 -0
  40. package/dist/.claude-plugin/commands/optimize.md +79 -0
  41. package/dist/.claude-plugin/commands/plan.md +215 -0
  42. package/dist/.claude-plugin/commands/recursive-init.md +217 -0
  43. package/dist/.claude-plugin/commands/research.md +199 -0
  44. package/dist/.claude-plugin/commands/review.md +73 -0
  45. package/dist/.claude-plugin/commands/seo.md +40 -0
  46. package/dist/.claude-plugin/commands/work.md +460 -0
  47. package/dist/.claude-plugin/hooks.json +15 -0
  48. package/dist/.claude-plugin/marketplace.json +54 -0
  49. package/dist/.claude-plugin/plugin.json +24 -0
  50. package/dist/.claude-plugin/skills/AGENTS.md +37 -0
  51. package/dist/.claude-plugin/skills/devops/coolify-deploy/SKILL.md +8 -0
  52. package/dist/.claude-plugin/skills/devops/git-worktree/SKILL.md +11 -0
  53. package/dist/.claude-plugin/skills/plugin-dev/SKILL.md +322 -0
  54. package/dist/.claude-plugin/skills/plugin-dev/references/agent-format.md +248 -0
  55. package/dist/.claude-plugin/skills/plugin-dev/references/claude-code-plugins.md +372 -0
  56. package/dist/.claude-plugin/skills/plugin-dev/references/command-format.md +312 -0
  57. package/dist/.claude-plugin/skills/plugin-dev/references/opencode-plugins.md +406 -0
  58. package/dist/.claude-plugin/skills/plugin-dev/references/opencode-tools.md +470 -0
  59. package/dist/.claude-plugin/skills/plugin-dev/references/skill-format.md +328 -0
  60. package/dist/.claude-plugin/skills/prompting/incentive-prompting/SKILL.md +162 -0
  61. package/dist/.claude-plugin/skills/research/comprehensive-research/SKILL.md +343 -0
  62. package/dist/.opencode/agent/ai-eng/ai-innovation/ai_engineer.md +186 -0
  63. package/dist/.opencode/agent/ai-eng/ai-innovation/ml_engineer.md +175 -0
  64. package/dist/.opencode/agent/ai-eng/ai-innovation/prompt-optimizer.md +62 -0
  65. package/dist/.opencode/agent/ai-eng/business-analytics/seo-specialist.md +72 -0
  66. package/dist/.opencode/agent/ai-eng/development/api_builder_enhanced.md +81 -0
  67. package/dist/.opencode/agent/ai-eng/development/architect-advisor.md +87 -0
  68. package/dist/.opencode/agent/ai-eng/development/backend_architect.md +87 -0
  69. package/dist/.opencode/agent/ai-eng/development/database_optimizer.md +174 -0
  70. package/dist/.opencode/agent/ai-eng/development/docs-writer.md +98 -0
  71. package/dist/.opencode/agent/ai-eng/development/documentation_specialist.md +211 -0
  72. package/dist/.opencode/agent/ai-eng/development/frontend-reviewer.md +50 -0
  73. package/dist/.opencode/agent/ai-eng/development/full_stack_developer.md +390 -0
  74. package/dist/.opencode/agent/ai-eng/development/java-pro.md +181 -0
  75. package/dist/.opencode/agent/ai-eng/development/test-docs-writer-2.md +45 -0
  76. package/dist/.opencode/agent/ai-eng/development/test-docs-writer-usage.md +39 -0
  77. package/dist/.opencode/agent/ai-eng/development/test-docs-writer.md +97 -0
  78. package/dist/.opencode/agent/ai-eng/meta/agent-creator.md +208 -0
  79. package/dist/.opencode/agent/ai-eng/meta/command-creator.md +333 -0
  80. package/dist/.opencode/agent/ai-eng/meta/skill-creator.md +313 -0
  81. package/dist/.opencode/agent/ai-eng/meta/tool-creator.md +476 -0
  82. package/dist/.opencode/agent/ai-eng/operations/cost_optimizer.md +283 -0
  83. package/dist/.opencode/agent/ai-eng/operations/deployment_engineer.md +185 -0
  84. package/dist/.opencode/agent/ai-eng/operations/infrastructure_builder.md +76 -0
  85. package/dist/.opencode/agent/ai-eng/operations/monitoring_expert.md +78 -0
  86. package/dist/.opencode/agent/ai-eng/quality-testing/code_reviewer.md +207 -0
  87. package/dist/.opencode/agent/ai-eng/quality-testing/performance_engineer.md +192 -0
  88. package/dist/.opencode/agent/ai-eng/quality-testing/plugin-validator.md +380 -0
  89. package/dist/.opencode/agent/ai-eng/quality-testing/security_scanner.md +331 -0
  90. package/dist/.opencode/agent/ai-eng/quality-testing/test_generator.md +259 -0
  91. package/dist/.opencode/command/ai-eng/compound.md +26 -0
  92. package/dist/.opencode/command/ai-eng/context.md +318 -0
  93. package/dist/.opencode/command/ai-eng/create-agent.md +48 -0
  94. package/dist/.opencode/command/ai-eng/create-command.md +48 -0
  95. package/dist/.opencode/command/ai-eng/create-plugin.md +400 -0
  96. package/dist/.opencode/command/ai-eng/create-skill.md +48 -0
  97. package/dist/.opencode/command/ai-eng/create-tool.md +53 -0
  98. package/dist/.opencode/command/ai-eng/deploy.md +35 -0
  99. package/dist/.opencode/command/ai-eng/optimize.md +79 -0
  100. package/dist/.opencode/command/ai-eng/plan.md +215 -0
  101. package/dist/.opencode/command/ai-eng/recursive-init.md +217 -0
  102. package/dist/.opencode/command/ai-eng/research.md +199 -0
  103. package/dist/.opencode/command/ai-eng/review.md +73 -0
  104. package/dist/.opencode/command/ai-eng/seo.md +40 -0
  105. package/dist/.opencode/command/ai-eng/work.md +460 -0
  106. package/dist/.opencode/opencode.jsonc +8 -0
  107. package/dist/.opencode/plugin/ai-eng-system.ts +10 -0
  108. package/dist/index.d.ts +3 -0
  109. package/dist/index.js +13 -0
  110. package/dist/skills/AGENTS.md +37 -0
  111. package/dist/skills/devops/coolify-deploy/SKILL.md +8 -0
  112. package/dist/skills/devops/git-worktree/SKILL.md +11 -0
  113. package/dist/skills/plugin-dev/SKILL.md +322 -0
  114. package/dist/skills/plugin-dev/references/agent-format.md +248 -0
  115. package/dist/skills/plugin-dev/references/claude-code-plugins.md +372 -0
  116. package/dist/skills/plugin-dev/references/command-format.md +312 -0
  117. package/dist/skills/plugin-dev/references/opencode-plugins.md +406 -0
  118. package/dist/skills/plugin-dev/references/opencode-tools.md +470 -0
  119. package/dist/skills/plugin-dev/references/skill-format.md +328 -0
  120. package/dist/skills/prompting/incentive-prompting/SKILL.md +162 -0
  121. package/dist/skills/research/comprehensive-research/SKILL.md +343 -0
  122. package/package.json +73 -0
@@ -0,0 +1,322 @@
1
+ ---
2
+ name: plugin-dev
3
+ description: This skill should be used when creating extensions for Claude Code or OpenCode, including plugins, commands, agents, skills, and custom tools. Covers both platforms with format specifications, best practices, and the ai-eng-system build system.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Plugin Development for Claude Code & OpenCode
8
+
9
+ ## Overview
10
+
11
+ The ai-eng-system supports extension development for both Claude Code and OpenCode through a unified content system with automated transformation. Understanding this system enables creating well-organized, maintainable extensions that integrate seamlessly with both platforms.
12
+
13
+ ## Extension Types
14
+
15
+ | Type | Claude Code | OpenCode | Shared Format |
16
+ |------|-------------|----------|---------------|
17
+ | Commands | ✅ YAML frontmatter | ✅ Table format | YAML frontmatter |
18
+ | Agents | ✅ YAML frontmatter | ✅ Table format | YAML frontmatter |
19
+ | Skills | ✅ Same format | ✅ Same format | SKILL.md |
20
+ | Hooks | ✅ hooks.json | ✅ Plugin events | Platform-specific |
21
+ | Custom Tools | ❌ (use MCP) | ✅ tool() helper | OpenCode only |
22
+ | MCP Servers | ✅ .mcp.json | ✅ Same format | Same format |
23
+
24
+ ## Development Approaches
25
+
26
+ ### 1. Canonical Development (Recommended)
27
+
28
+ Create content in `content/` directory, let build.ts transform to platform formats:
29
+
30
+ ```
31
+ content/
32
+ ├── commands/my-command.md → dist/.claude-plugin/commands/
33
+ │ → dist/.opencode/command/ai-eng/
34
+ └── agents/my-agent.md → dist/.claude-plugin/agents/
35
+ → dist/.opencode/agent/ai-eng/
36
+ ```
37
+
38
+ ### 2. Platform-Specific Development
39
+
40
+ Create directly in platform directories:
41
+
42
+ - Claude Code: `.claude/commands/`, `.claude-plugin/`
43
+ - OpenCode: `.opencode/command/`, `.opencode/agent/`
44
+
45
+ ### 3. Global vs Project-Local
46
+
47
+ | Location | Claude Code | OpenCode |
48
+ |----------|-------------|----------|
49
+ | **Project** | `.claude/` | `.opencode/` |
50
+ | **Global** | `~/.claude/` | `~/.config/opencode/` |
51
+
52
+ ## Quick Reference
53
+
54
+ ### Command Frontmatter
55
+
56
+ **Canonical (content/):**
57
+ ```yaml
58
+ ---
59
+ name: my-command
60
+ description: What this command does
61
+ agent: build # Optional: which agent handles this
62
+ subtask: true # Optional: run as subtask
63
+ model: sonnet # Optional: override model
64
+ temperature: 0.3 # Optional: temperature
65
+ tools: # Optional: tool restrictions
66
+ read: true
67
+ write: true
68
+ ---
69
+ ```
70
+
71
+ **Claude Code Output:** Same format (YAML frontmatter)
72
+
73
+ **OpenCode Output:** Table format
74
+ ```markdown
75
+ | description | agent |
76
+ |---|---|
77
+ | Description here | build |
78
+ ```
79
+
80
+ ### Agent Frontmatter
81
+
82
+ **Canonical (content/):**
83
+ ```yaml
84
+ ---
85
+ name: my-agent
86
+ description: Use this agent when... <example>...</example>
87
+ mode: subagent
88
+ model: sonnet
89
+ color: cyan
90
+ temperature: 0.3
91
+ tools:
92
+ read: true
93
+ write: true
94
+ ---
95
+ ```
96
+
97
+ **Claude Code Output:** Same format (YAML frontmatter)
98
+
99
+ **OpenCode Output:** Table format
100
+ ```markdown
101
+ | description | mode |
102
+ |---|---|
103
+ | Description here | subagent |
104
+ ```
105
+
106
+ ### Skill Structure
107
+
108
+ Both platforms use identical format:
109
+
110
+ ```
111
+ skill-name/
112
+ ├── SKILL.md (required)
113
+ │ ├── YAML frontmatter (name, description)
114
+ │ └── Markdown body (1,000-3,000 words)
115
+ └── Bundled Resources (optional)
116
+ ├── references/ # Detailed documentation
117
+ ├── examples/ # Working code
118
+ └── scripts/ # Utility scripts
119
+ ```
120
+
121
+ ### OpenCode Custom Tools
122
+
123
+ Use TypeScript with `tool()` helper:
124
+
125
+ ```typescript
126
+ import { tool } from "@opencode-ai/plugin"
127
+
128
+ export default tool({
129
+ description: "Tool description",
130
+ args: {
131
+ param: tool.schema.string().describe("Parameter description"),
132
+ },
133
+ async execute(args, context) {
134
+ // Tool implementation
135
+ return result
136
+ },
137
+ })
138
+ ```
139
+
140
+ ## Directory Locations
141
+
142
+ ### For Development in ai-eng-system
143
+
144
+ ```
145
+ ai-eng-system/
146
+ ├── content/
147
+ │ ├── commands/ # Add new commands here
148
+ │ └── agents/ # Add new agents here
149
+ ├── skills/
150
+ │ └── plugin-dev/ # This skill
151
+ └── build.ts # Transforms to both platforms
152
+ ```
153
+
154
+ ### For User Projects
155
+
156
+ **Project-local:**
157
+ - Claude Code: `.claude/commands/`, `.claude-plugin/`
158
+ - OpenCode: `.opencode/command/`, `.opencode/agent/`
159
+
160
+ **Global:**
161
+ - Claude Code: `~/.claude/commands/`, `~/.claude-plugin/`
162
+ - OpenCode: `~/.config/opencode/command/`, `~/.config/opencode/agent/`
163
+
164
+ ## Platform-Specific Features
165
+
166
+ ### Claude Code
167
+
168
+ **Components:**
169
+ - Commands with YAML frontmatter
170
+ - Agents with YAML frontmatter
171
+ - Skills with SKILL.md format
172
+ - Hooks via `hooks/hooks.json`
173
+ - MCP servers via `.mcp.json`
174
+
175
+ **Manifest:** `.claude-plugin/plugin.json`
176
+ ```json
177
+ {
178
+ "name": "plugin-name",
179
+ "version": "1.0.0",
180
+ "description": "Brief description",
181
+ "commands": ["./commands/*"],
182
+ "mcpServers": "./.mcp.json"
183
+ }
184
+ ```
185
+
186
+ ### OpenCode
187
+
188
+ **Components:**
189
+ - Commands with table format
190
+ - Agents with table format
191
+ - Skills via opencode-skills plugin
192
+ - Custom tools with TypeScript
193
+ - Plugin events via TypeScript
194
+
195
+ **Plugin:** `.opencode/plugin/plugin.ts`
196
+ ```typescript
197
+ import { Plugin } from "@opencode-ai/plugin"
198
+
199
+ export default (async ({ client, project, directory, worktree, $ }) => {
200
+ return {
201
+ // Plugin hooks here
202
+ }
203
+ }) satisfies Plugin
204
+ ```
205
+
206
+ ## Development Workflow
207
+
208
+ ### 1. Create Component
209
+
210
+ Use plugin-dev commands:
211
+ - `/ai-eng/create-agent` - Create new agent
212
+ - `/ai-eng/create-command` - Create new command
213
+ - `/ai-eng/create-skill` - Create new skill
214
+ - `/ai-eng/create-tool` - Create new custom tool
215
+
216
+ ### 2. Build
217
+
218
+ ```bash
219
+ cd ai-eng-system
220
+ bun run build # Build all platforms
221
+ bun run build --watch # Watch mode
222
+ bun run build --validate # Validate content
223
+ ```
224
+
225
+ ### 3. Test
226
+
227
+ **Claude Code:**
228
+ ```bash
229
+ claude plugin add https://github.com/v1truv1us/ai-eng-system
230
+ ```
231
+
232
+ **OpenCode:**
233
+ ```bash
234
+ # Project-local
235
+ ./setup.sh
236
+
237
+ # Global
238
+ ./setup-global.sh
239
+ ```
240
+
241
+ ## Best Practices
242
+
243
+ ### Content Quality
244
+ - Use third-person in skill descriptions
245
+ - Write commands/agents FOR Claude, not to user
246
+ - Include specific trigger phrases
247
+ - Follow progressive disclosure for skills
248
+
249
+ ### File Organization
250
+ - One component per file
251
+ - Clear naming conventions (kebab-case)
252
+ - Proper frontmatter validation
253
+
254
+ ### Cross-Platform Compatibility
255
+ - Use canonical format in `content/`
256
+ - Test build output for both platforms
257
+ - Document platform differences
258
+
259
+ ### Security
260
+ - No hardcoded credentials
261
+ - Use HTTPS/WSS for external connections
262
+ - Validate user inputs
263
+ - Follow principle of least privilege
264
+
265
+ ## Additional Resources
266
+
267
+ ### References
268
+
269
+ - `references/claude-code-plugins.md` - Claude Code specifics
270
+ - `references/opencode-plugins.md` - OpenCode specifics
271
+ - `references/command-format.md` - Command syntax guide
272
+ - `references/agent-format.md` - Agent configuration guide
273
+ - `references/skill-format.md` - Skills specification
274
+ - `references/opencode-tools.md` - Custom tool development
275
+
276
+ ### Examples
277
+
278
+ Study existing components in ai-eng-system:
279
+ - `content/commands/plan.md` - Command structure
280
+ - `content/agents/architect-advisor.md` - Agent structure
281
+ - `skills/prompting/incentive-prompting/SKILL.md` - Skill structure
282
+
283
+ ## Troubleshooting
284
+
285
+ ### Build Issues
286
+ - Run `bun run build --validate` to check content
287
+ - Check file permissions in output directories
288
+ - Verify YAML frontmatter syntax
289
+
290
+ ### Platform Testing
291
+ - Test commands in both Claude Code and OpenCode
292
+ - Verify agents trigger correctly
293
+ - Check skills load via opencode-skills plugin
294
+
295
+ ### Common Errors
296
+ - Missing required frontmatter fields
297
+ - Incorrect directory structure
298
+ - Invalid YAML syntax
299
+ - Wrong file permissions
300
+
301
+ ## Integration with Ferg Engineering
302
+
303
+ The plugin-dev system integrates seamlessly with existing ai-eng-system components:
304
+
305
+ ### Existing Commands
306
+ - `/ai-eng/plan` - Implementation planning
307
+ - `/ai-eng/review` - Code review
308
+ - `/ai-eng/work` - Task execution
309
+
310
+ ### Existing Agents
311
+ - `ai-eng/architect-advisor` - Architecture guidance
312
+ - `ai-eng/frontend-reviewer` - Frontend review
313
+ - `ai-eng/seo-specialist` - SEO optimization
314
+
315
+ ### Plugin-Dev Commands
316
+ - `/ai-eng/create-plugin` - Full plugin development workflow
317
+ - `/ai-eng/create-agent` - Quick agent creation
318
+ - `/ai-eng/create-command` - Quick command creation
319
+ - `/ai-eng/create-skill` - Quick skill creation
320
+ - `/ai-eng/create-tool` - Quick tool creation
321
+
322
+ All use the same quality standards and research-backed prompting techniques.
@@ -0,0 +1,248 @@
1
+ # Agent Format Guide
2
+
3
+ ## Overview
4
+
5
+ Agents are specialized AI assistants that provide focused expertise for specific domains. Both Claude Code and OpenCode support agents, but with different frontmatter formats while sharing the same core concepts.
6
+
7
+ ## Platform Comparison
8
+
9
+ | Aspect | Claude Code | OpenCode | Canonical (content/) |
10
+ |---------|-------------|----------|------------------|
11
+ | **Frontmatter** | YAML block | YAML table | YAML block |
12
+ | **File Extension** | `.md` | `.md` | `.md` |
13
+ | **Mode Specification** | `mode: subagent` | `mode: subagent` | `mode: subagent` |
14
+ | **Model Override** | `model: sonnet` | `model: sonnet` | `model: sonnet` |
15
+ | **Tool Control** | `tools: [...]` | `tools: { read: true }` | `tools: { read: true } |
16
+ | **Color Coding** | `color: cyan` | `color: cyan` | `color: cyan` |
17
+ | **Temperature** | `temperature: 0.3` | `temperature: 0.3` | `temperature: 0.3` |
18
+ | **Permissions** | N/A | `permission: { bash: deny }` | `permission: { bash: deny }` |
19
+
20
+ ## Canonical Format (content/)
21
+
22
+ Use this format in `content/agents/` for maximum compatibility:
23
+
24
+ ```yaml
25
+ ---
26
+ name: my-agent
27
+ description: Use this agent when user asks to "specific trigger phrases" or describes agent functionality. Examples: <example>...</example>
28
+ mode: subagent
29
+ model: sonnet
30
+ color: cyan
31
+ temperature: 0.3
32
+ tools:
33
+ read: true
34
+ write: true
35
+ permission:
36
+ bash: deny
37
+ ---
38
+ ```
39
+
40
+ ## Claude Code Output
41
+
42
+ Build.ts transforms canonical to Claude Code format (YAML frontmatter):
43
+
44
+ ```markdown
45
+ ---
46
+ name: my-agent
47
+ description: Use this agent when user asks to "specific trigger phrases" or describes agent functionality. Examples: <example>...</example>
48
+ mode: subagent
49
+ model: sonnet
50
+ color: cyan
51
+ temperature: 0.3
52
+ tools:
53
+ - Read
54
+ - Write
55
+ permission:
56
+ bash: deny
57
+ ---
58
+
59
+ # System Prompt
60
+
61
+ Agent system prompt here...
62
+ ```
63
+
64
+ ## OpenCode Output
65
+
66
+ Build.ts transforms canonical to OpenCode format (table frontmatter):
67
+
68
+ ```markdown
69
+ | description | mode |
70
+ |---|---|
71
+ | Use this agent when user asks to "specific trigger phrases" or describes agent functionality. Examples: <example>...</example> | subagent |
72
+
73
+ # System Prompt
74
+
75
+ Agent system prompt here...
76
+ ```
77
+
78
+ ## Agent Modes
79
+
80
+ ### Primary Agents
81
+
82
+ - Handle main conversation flow
83
+ - Have access to full tool set
84
+ - Can invoke other agents
85
+ - Used for general-purpose tasks
86
+
87
+ ### Subagents
88
+
89
+ - Specialized for specific domains
90
+ - Limited tool access (for safety/focus)
91
+ - Invoked by primary agents or directly
92
+ - Used for focused expertise
93
+
94
+ ## Agent Design
95
+
96
+ ### Expert Persona
97
+
98
+ Create a compelling expert identity:
99
+
100
+ ```markdown
101
+ You are a senior [domain] expert with 12+ years of experience, having led major initiatives at [notable companies]. You've [key achievements] and your expertise is highly sought after in the industry.
102
+ ```
103
+
104
+ ### Core Components
105
+
106
+ 1. **Role Definition**: Clear expertise domain
107
+ 2. **Responsibilities**: Numbered list of capabilities
108
+ 3. **Process**: Step-by-step methodology
109
+ 4. **Quality Standards**: Output expectations
110
+ 5. **Edge Cases**: Handling unusual situations
111
+
112
+ ## Triggering Examples
113
+
114
+ Include 2-4 `<example>` blocks in description:
115
+
116
+ ```yaml
117
+ description: Use this agent when user asks to "create an agent", "generate an agent", or describes agent functionality. Examples:
118
+
119
+ <example>
120
+ Context: User wants to create a code review agent
121
+ user: "Create an agent that reviews code for quality issues"
122
+ assistant: "I'll use the agent-creator to generate a code review agent."
123
+ <commentary>
124
+ User requesting new agent creation, trigger agent-creator.
125
+ </commentary>
126
+ </example>
127
+
128
+ <example>
129
+ Context: User describes needed functionality
130
+ user: "I need an agent that generates unit tests for my code"
131
+ assistant: "I'll use the agent-creator to create a test generation agent."
132
+ <commentary>
133
+ User describes agent need, trigger agent-creator.
134
+ </commentary>
135
+ </example>
136
+ </example>
137
+ ```
138
+
139
+ ## Tool Access Control
140
+
141
+ ### Claude Code
142
+
143
+ ```yaml
144
+ tools:
145
+ - Read
146
+ - Write
147
+ - Grep
148
+ - Glob
149
+ - Bash
150
+ ```
151
+
152
+ ### OpenCode
153
+
154
+ ```yaml
155
+ tools:
156
+ read: true
157
+ write: true
158
+ bash: true
159
+ grep: true
160
+ glob: true
161
+ ```
162
+
163
+ ### Permission Overrides
164
+
165
+ OpenCode supports granular permissions:
166
+
167
+ ```yaml
168
+ permission:
169
+ bash: deny
170
+ edit: deny
171
+ write: deny
172
+ read: allow
173
+ ```
174
+
175
+ ## Best Practices
176
+
177
+ ### Agent Creation
178
+
179
+ 1. **Clear Purpose**: Specific domain expertise
180
+ 2. **Strong Triggers**: Concrete user phrases
181
+ 3. **Focused Scope**: Not too broad or too narrow
182
+ 4. **Quality Prompt**: Detailed instructions, examples
183
+ 5. **Proper Mode**: Choose primary vs subagent appropriately
184
+
185
+ ### System Prompt Writing
186
+
187
+ 1. **Expert Persona**: Establish credibility
188
+ 2. **Structured Approach**: Clear methodology
189
+ 3. **Output Format**: Defined expectations
190
+ 4. **Self-Correction**: Error handling
191
+ 5. **Context Awareness**: Use project information
192
+
193
+ ### Security
194
+
195
+ 1. **Input Validation**: Check user inputs
196
+ 2. **Safe Operations**: Avoid dangerous actions
197
+ 3. **Data Protection**: No sensitive data exposure
198
+ 4. **Permission Respect**: Honor tool restrictions
199
+
200
+ ## Examples
201
+
202
+ ### Code Review Agent
203
+
204
+ ```yaml
205
+ ---
206
+ name: code-reviewer
207
+ description: Use this agent when user asks to "review code", "check quality", "analyze for issues", or needs code quality assessment. Examples:
208
+
209
+ <example>
210
+ Context: User just wrote new code
211
+ user: "Review this function for security issues"
212
+ assistant: "I'll use the code-reviewer agent to analyze the code."
213
+ <commentary>
214
+ Code review request triggers code-reviewer agent.
215
+ </commentary>
216
+ </example>
217
+ </example>
218
+ mode: subagent
219
+ color: yellow
220
+ temperature: 0.1
221
+ tools:
222
+ read: true
223
+ grep: true
224
+ glob: true
225
+ permission:
226
+ bash: deny
227
+ edit: deny
228
+ write: deny
229
+ ---
230
+
231
+ You are a senior code reviewer with 10+ years of experience...
232
+
233
+ ## Integration with Ferg System
234
+
235
+ ### Existing Agents
236
+
237
+ - `ai-eng/architect-advisor` - System architecture guidance
238
+ - `ai-eng/frontend-reviewer` - Frontend code review
239
+ - `ai-eng/seo-specialist` - SEO optimization
240
+ - `ai-eng/prompt-optimizer` - Prompt enhancement
241
+
242
+ ### Plugin-Dev Agents
243
+
244
+ - `ai-eng/agent-creator` - AI-assisted agent generation
245
+ - `ai-eng/skill-creator` - Skill development guidance
246
+ - `ai-eng/plugin-validator` - Plugin structure validation
247
+
248
+ All agents follow the same quality standards and use the build.ts transformation system.