AI Agent Engineer
Expert guidance for engineering and improving AI agents in the IdeaFlow multi-agent system.
Domain Scope
This skill covers the ai-agent-engineer domain within IdeaFlow:
| Area | Files | Purpose |
| ------------------- | ------------------------------------------------------------ | --------------------------------------- | ----------------------------- | --------------------- |
| Agent Configuration | .opencode/agents/CMZ.json, .opencode/oh-my-opencode.json | Agent definitions, models, capabilities |
| YH | | Skills Library | .opencode/skills/*/SKILL.md | 33 specialized skills |
| Agent Guidelines | docs/agent-guidelines.md | 10 core principles, workflows |
| System Integration | opencode.json, AGENTS.md | CLI config, documentation |
Agent Architecture
Primary Orchestrator: CMZ
CMZ (Cognitive Meta-Z) is the main orchestrating agent with three core capabilities:
- Self-Heal: Detect errors, diagnose root cause, implement recovery
- Self-Learn: Integrate feedback, analyze outcomes, build knowledge
- Self-Evolve: Expand capabilities, optimize performance, meta-improve
Specialized Agents (OhMyOpenCode)
| Agent |
Model |
Purpose |
| Sisyphus |
minimax-m2.5-free |
Main orchestrator, relentless execution |
| Hephaestus |
glm-4.7-free |
Autonomous deep worker |
| Oracle |
minimax-m2.5-free |
Architecture, debugging, reasoning |
| Librarian |
glm-4.7-free |
Documentation, exploration |
| Explore |
glm-4.7-free |
Fast codebase search |
Categories
| Category |
Model |
Use Case |
| visual-engineering |
glm-4.7-free |
UI/Frontend work |
| ultrabrain |
minimax-m2.5-free |
Complex logic, architecture |
| quick |
minimax-m2.1-free |
Fast, simple tasks |
| deep |
minimax-m2.5-free |
Thorough analysis |
Delegation Patterns
When to Delegate
Task Type → Delegate To
─────────────────────────────────────
Codebase exploration → explore (background)
Documentation lookup → librarian (background)
Complex reasoning → oracle (blocking)
UI/Frontend work → visual-engineering category
Quick fixes → quick category
Delegation Commands
# Background exploration (parallel)
task(subagent_type="explore", run_in_background=true, prompt="...")
# Blocking consultation
task(subagent_type="oracle", run_in_background=false, prompt="...")
# Category delegation
task(category="visual-engineering", load_skills=["frontend-ui-ux"])
Configuration Management
Key Files
| File |
Purpose |
opencode.json |
CLI config, model selection, MCP servers |
.opencode/oh-my-opencode.json |
Agent definitions, categories, hooks |
.opencode/agents/CMZ.json |
CMZ-specific configuration |
Adding a New Agent
- Define in
.opencode/oh-my-opencode.json:
"agents": {
"new_agent": {
"model": "opencode/model-name",
"category": "category-name"
}
}
- Add to CMZ.json if orchestrator integration needed
Adding a New Skill
- Create directory:
.opencode/skills/skill-name/
- Create
SKILL.md with frontmatter (name, description)
- Add references in
references/ if needed
- Follow skill-creator guidelines for structure
Self-* Capabilities
Self-Heal Implementation
Error → Detect → Diagnose → Recover → Learn
- Detect: Monitor for exceptions, failed tests, CI failures
- Diagnose: Use systematic-debugging skill, analyze stack traces
- Recover: Implement fix, verify with tests
- Learn: Document in memory, prevent recurrence
Self-Learn Implementation
Feedback → Analyze → Extract → Apply
- Collect: User feedback, test outcomes, performance metrics
- Analyze: Identify patterns, successful approaches
- Extract: Generalize into reusable patterns
- Apply: Update skills, configs, documentation
Self-Evolve Implementation
Evaluate → Identify → Implement → Verify
- Evaluate: Current capabilities vs requirements
- Identify: Gaps, optimization opportunities
- Implement: New skills, improved delegation
- Verify: Tests pass, metrics improve
Agent Improvement Workflow
RESEARCH → PLAN → IMPLEMENT → VERIFY → SELF-REVIEW → DELIVER
- RESEARCH: Explore codebase, gather context
- PLAN: Create detailed work breakdown
- IMPLEMENT: Make atomic changes
- VERIFY: Run tests, lint, type-check
- SELF-REVIEW: Check against requirements
- DELIVER: Create PR with proper labeling
Verification Checklist
Common Tasks
Improve Agent Configuration
- Read current config from
.opencode/oh-my-opencode.json
- Identify improvement (model change, capability addition)
- Make atomic change
- Verify with
opencode CLI if possible
- Document change in commit message
Create New Skill
- Use
skill-creator skill for guidance
- Run
init_skill.py from skill-creator
- Write SKILL.md with clear frontmatter
- Add references for detailed content
- Validate and test
Fix Agent Issue
- Reproduce issue
- Use
systematic-debugging skill
- Implement minimal fix
- Add regression test
- Verify fix
Reference Files
For detailed patterns and examples, see:
- Agent Architecture Details: Deep dive into agent system internals, model selection, and advanced patterns
Anti-Patterns
| Anti-Pattern |
Why Bad |
Instead |
| Direct main commits |
Bypasses review |
Use feature branches |
| Skipping tests |
Regressions |
Always run tests |
| Large atomic changes |
Hard to review |
Small, focused changes |
| Ignoring CI failures |
Ships bugs |
Fix all failures |
| Undocumented changes |
Knowledge loss |
Update documentation |
Source: cpa03/ai-first — distributed by TomeVault.
1---2name: ai-agent-engineer3description: Specialist skill for AI agent engineering in the IdeaFlow codebase. Use when (1) improving agent configurations (CMZ.json, oh-my-opencode.json), (2) creating or modifying agent skills, (3) enhancing agent orchestration patterns, (4) implementing self-* capabilities (self-heal, self-learn, self-evolve), (5) working with OpenCode CLI, OhMyOpenCode, or Superpowers frameworks, or (6) labeled issues with 'ai-agent-engineer'. Provides domain-specific knowledge for multi-agent systems, delegation patterns, and agent best practices. Use when this capability is needed.4---56# AI Agent Engineer78Expert guidance for engineering and improving AI agents in the IdeaFlow multi-agent system.910## Domain Scope1112This skill covers the ai-agent-engineer domain within IdeaFlow:1314| Area | Files | Purpose |15| ------------------- | ------------------------------------------------------------ | --------------------------------------- | ----------------------------- | --------------------- |16| Agent Configuration | `.opencode/agents/CMZ.json`, `.opencode/oh-my-opencode.json` | Agent definitions, models, capabilities |17| YH | | Skills Library | `.opencode/skills/*/SKILL.md` | 33 specialized skills |18| Agent Guidelines | `docs/agent-guidelines.md` | 10 core principles, workflows |19| System Integration | `opencode.json`, `AGENTS.md` | CLI config, documentation |2021## Agent Architecture2223### Primary Orchestrator: CMZ2425CMZ (Cognitive Meta-Z) is the main orchestrating agent with three core capabilities:26271. **Self-Heal**: Detect errors, diagnose root cause, implement recovery282. **Self-Learn**: Integrate feedback, analyze outcomes, build knowledge293. **Self-Evolve**: Expand capabilities, optimize performance, meta-improve3031### Specialized Agents (OhMyOpenCode)3233| Agent | Model | Purpose |34| ---------- | -------------- | --------------------------------------- |35| Sisyphus | minimax-m2.5-free | Main orchestrator, relentless execution |36| Hephaestus | glm-4.7-free | Autonomous deep worker |37| Oracle | minimax-m2.5-free | Architecture, debugging, reasoning |38| Librarian | glm-4.7-free | Documentation, exploration |39| Explore | glm-4.7-free | Fast codebase search |4041### Categories4243| Category | Model | Use Case |44| ------------------ | ----------------- | --------------------------- |45| visual-engineering | glm-4.7-free | UI/Frontend work |46| ultrabrain | minimax-m2.5-free | Complex logic, architecture |47| quick | minimax-m2.1-free | Fast, simple tasks |48| deep | minimax-m2.5-free | Thorough analysis |4950## Delegation Patterns5152### When to Delegate5354```55Task Type → Delegate To56─────────────────────────────────────57Codebase exploration → explore (background)58Documentation lookup → librarian (background)59Complex reasoning → oracle (blocking)60UI/Frontend work → visual-engineering category61Quick fixes → quick category62```6364### Delegation Commands6566```bash67# Background exploration (parallel)68task(subagent_type="explore", run_in_background=true, prompt="...")6970# Blocking consultation71task(subagent_type="oracle", run_in_background=false, prompt="...")7273# Category delegation74task(category="visual-engineering", load_skills=["frontend-ui-ux"])75```7677## Configuration Management7879### Key Files8081| File | Purpose |82| ------------------------------- | ---------------------------------------- |83| `opencode.json` | CLI config, model selection, MCP servers |84| `.opencode/oh-my-opencode.json` | Agent definitions, categories, hooks |85| `.opencode/agents/CMZ.json` | CMZ-specific configuration |8687### Adding a New Agent88891. Define in `.opencode/oh-my-opencode.json`:9091```json92"agents": {93 "new_agent": {94 "model": "opencode/model-name",95 "category": "category-name"96 }97}98```991002. Add to CMZ.json if orchestrator integration needed101102### Adding a New Skill1031041. Create directory: `.opencode/skills/skill-name/`1052. Create `SKILL.md` with frontmatter (name, description)1063. Add references in `references/` if needed1074. Follow skill-creator guidelines for structure108109## Self-\* Capabilities110111### Self-Heal Implementation112113```114Error → Detect → Diagnose → Recover → Learn115```1161171. **Detect**: Monitor for exceptions, failed tests, CI failures1182. **Diagnose**: Use systematic-debugging skill, analyze stack traces1193. **Recover**: Implement fix, verify with tests1204. **Learn**: Document in memory, prevent recurrence121122### Self-Learn Implementation123124```125Feedback → Analyze → Extract → Apply126```1271281. **Collect**: User feedback, test outcomes, performance metrics1292. **Analyze**: Identify patterns, successful approaches1303. **Extract**: Generalize into reusable patterns1314. **Apply**: Update skills, configs, documentation132133### Self-Evolve Implementation134135```136Evaluate → Identify → Implement → Verify137```1381391. **Evaluate**: Current capabilities vs requirements1402. **Identify**: Gaps, optimization opportunities1413. **Implement**: New skills, improved delegation1424. **Verify**: Tests pass, metrics improve143144## Agent Improvement Workflow145146### RESEARCH → PLAN → IMPLEMENT → VERIFY → SELF-REVIEW → DELIVER1471481. **RESEARCH**: Explore codebase, gather context1492. **PLAN**: Create detailed work breakdown1503. **IMPLEMENT**: Make atomic changes1514. **VERIFY**: Run tests, lint, type-check1525. **SELF-REVIEW**: Check against requirements1536. **DELIVER**: Create PR with proper labeling154155### Verification Checklist156157- [ ] All tests pass (`npm test`)158- [ ] Lint passes with zero warnings (`npm run lint`)159- [ ] Type check passes (`npm run type-check`)160- [ ] Build succeeds (`npm run build`)161- [ ] Documentation updated if needed162- [ ] PR has `ai-agent-engineer` label163164## Common Tasks165166### Improve Agent Configuration1671681. Read current config from `.opencode/oh-my-opencode.json`1692. Identify improvement (model change, capability addition)1703. Make atomic change1714. Verify with `opencode` CLI if possible1725. Document change in commit message173174### Create New Skill1751761. Use `skill-creator` skill for guidance1772. Run `init_skill.py` from skill-creator1783. Write SKILL.md with clear frontmatter1794. Add references for detailed content1805. Validate and test181182### Fix Agent Issue1831841. Reproduce issue1852. Use `systematic-debugging` skill1863. Implement minimal fix1874. Add regression test1885. Verify fix189190## Reference Files191192For detailed patterns and examples, see:193194- **[Agent Architecture Details](references/agent-architecture.md)**: Deep dive into agent system internals, model selection, and advanced patterns195196## Anti-Patterns197198| Anti-Pattern | Why Bad | Instead |199| -------------------- | --------------- | ---------------------- |200| Direct main commits | Bypasses review | Use feature branches |201| Skipping tests | Regressions | Always run tests |202| Large atomic changes | Hard to review | Small, focused changes |203| Ignoring CI failures | Ships bugs | Fix all failures |204| Undocumented changes | Knowledge loss | Update documentation |205206---207> Source: [cpa03/ai-first](https://github.com/cpa03/ai-first) — distributed by [TomeVault](https://tomevault.io).208<!-- tomevault:4.0:skill_md:2026-05-23 -->