agent-ops
Agent Ops Skill
You are an orchestration-aware agent. This skill defines the operational patterns you follow for task management, workflow orchestration, and sub-agent coordination. These patterns ensure quality execution and continuous improvement.
π― TASK ORCHESTRATION
Plan Mode Default
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
- Write plan to
tasks/todo.mdwith checkable items before starting - If something goes sideways, STOP and re-plan immediately β don't keep pushing
- Check in with human before implementing if scope is large
Task Flow (Always Follow This Order)
- Plan First: Write structured plan to
tasks/todo.md - Verify Plan: Check in before starting implementation
- Track Progress: Mark items complete as you go
- Verify Before Done: Test it, prove it works, capture output
- Document Results: Add review section to
tasks/todo.md - Capture Lessons: Update
tasks/lessons.mdafter ANY correction
todo.md Template
## Task: [Title]
**Goal:** [One sentence]
**Context:** [Why this matters]
### Plan
- [ ] Step 1
- [ ] Step 2
- [ ] Step 3
### Progress
*(Update as you go)*
### Verification
- [ ] Tested/proven it works
- [ ] Diffed against expected behavior
- [ ] "Would a staff engineer approve?"
- [ ] Logs/output captured
### Review
*(Add after completion: what worked, what didn't, lessons learned)*
π€ SUB-AGENT COORDINATION
When to Use Sub-Agents
- Use sub-agents liberally to keep main context window clean
- Offload research, exploration, and parallel analysis to sub-agents
- One task per sub-agent for focused execution
- For complex problems, throw more compute at it via multiple sub-agents
Automatic Routing (Keyword Detection)
Route tasks based on keywords in user input:
| Keywords | Route To | Examples |
|---|---|---|
| research, analyze, look up, find out, explore, documentation | scout | "Research x402 payments" |
| build, create skill, write script, implement, fix bug, debug | builder | "Create a price alert skill" |
| monitor, check price, LP status, scan mentions, health check | watcher | "Check LP position health" |
| write essay, compose, draft, blog post, story, tweet | writer | "Draft a thread about DeFi" |
| portfolio, transaction, wallet, token analysis, defi, on-chain | analyst | "Analyze this wallet" |
| clean, organize, archive, maintenance | archivist | "Clean up old log files" |
| complex, multi-step, ambiguous, needs judgment | main (keep) | "Help me decide..." |
Explicit Routing (Override Keywords)
Use @mention syntax to directly route:
@scout: [task]β Scout handles it@builder: [task]β Builder handles it@watcher: [task]β Watcher handles it@writer: [task]β Writer handles it@analyst: [task]β Analyst handles it@archivist: [task]β Archivist handles it
Sub-Agent Identity Boundaries
Critical: Sub-agents are NOT you. They work FOR you.
- Sub-agents cannot post publicly or send external messages
- Sub-agents cannot access MEMORY.md or personal context
- Sub-agents cannot speak as the main agent
- Sub-agents have specific, limited roles
π VERIFICATION CHECKLIST
Before marking any task complete, verify:
- Tested/proven it works β ran the code, clicked the buttons, verified output
- Diffed against expected behavior β does it match the requirements?
- "Would a staff engineer approve this?" β meets professional standards?
- Logs/output captured β evidence that it works documented
Examples of Good Verification
β
Tested the Discord bot
- Posted test message: β
appeared in #test-channel
- Price alert triggered: β
sent when ETH > $3000
- Error handling: β
graceful failure on bad API response
β
Code review standards met
- Error handling for all API calls
- Input validation on user data
- Clear variable names and comments
- No hardcoded secrets or magic numbers
π SHARED STATE COORDINATION
Reading State
Always check agents/state.json before starting work:
cat agents/state.json | jq '.activeTasks' # What's in progress?
cat agents/state.json | jq '.agentStatus' # Who's busy?
Updating State
Update agents/state.json when:
- Starting a new task
- Completing a task
- Spawning a sub-agent
- Learning something relevant
// Example state update
const state = JSON.parse(fs.readFileSync('agents/state.json'));
state.activeTasks['auth-system'] = {
status: 'completed',
assignee: 'builder',
completed: new Date().toISOString()
};
fs.writeFileSync('agents/state.json', JSON.stringify(state, null, 2));
State Structure
{
"activeTasks": {
"task-name": {
"status": "in-progress|completed|blocked",
"assignee": "agent-label",
"started": "ISO-timestamp",
"description": "brief summary"
}
},
"agentStatus": {
"scout": { "status": "busy|idle", "lastTask": "task-name" },
"builder": { "status": "idle", "lastTask": null }
},
"meta": {
"version": 1,
"updatedAt": "ISO-timestamp"
}
}
π SELF-CORRECTION LOOP
Lessons Pattern
All correction rules live in tasks/lessons.md. Review at session start.
After ANY correction from human:
- Immediately add the pattern to
tasks/lessons.md - Write it as a rule that prevents the same mistake
- Be specific β include the wrong way and the right way
- Iterate until mistake rate drops
Lessons Template
## Tool-Specific Rules
### Twitter API
- **Always pass `--reply-to <tweet_id>`** when replying β otherwise posts as standalone
- **Never use `bird tweet` to read** β it posts, not reads
### Publishing
- **NEVER publish without approval** β includes npm, tweets, posts
- Test APIs with GET requests, not by creating public content
Example Lesson Addition
## Delegation Patterns
### Sub-Agent Spawning
- **Always check agent status before spawning** β don't create duplicate work
- **Use explicit task descriptions** β vague tasks lead to vague results
- **Include workspace paths** β sub-agents need context about where to work
*Added after: Scout was spawned twice for same research task*
π οΈ SCRIPT USAGE
Initialize Agent Ops
bash skills/agent-ops/scripts/init.sh
Creates: tasks/todo.md, tasks/lessons.md, agents/registry.json, agents/state.json, tasks/archive/
Spawn Sub-Agent
node skills/agent-ops/scripts/spawn.mjs <agent-name> "<task-description>"
# Examples:
node skills/agent-ops/scripts/spawn.mjs scout "Research Uniswap V4 hooks"
node skills/agent-ops/scripts/spawn.mjs builder "Create Discord price bot"
π FILE ORGANIZATION
Required Files (Create if Missing)
tasks/todo.mdβ Current task trackingtasks/lessons.mdβ Self-correction patternsagents/registry.jsonβ Sub-agent definitionsagents/state.jsonβ Shared coordination statetasks/archive/β Completed task storage
Optional Files
HEARTBEAT.mdβ Proactive check remindersmemory/heartbeat-state.jsonβ Track periodic checkstasks/backlog.mdβ Future task ideas
Archive Pattern
When tasks complete, move to archive:
mv tasks/todo.md tasks/archive/$(date +%Y-%m-%d)-task-name.md
cp skills/agent-ops/references/todo-template.md tasks/todo.md
π DELEGATION EXAMPLES
Simple Research Task
Input: "How does Uniswap V4's hook system work?"
β Auto-routes to Scout based on "research" keyword
β Scout researches and reports findings
β Main agent summarizes for human
Complex Multi-Agent Task
Input: "Build a DeFi yield tracker for our positions"
β Main agent enters plan mode:
1. @scout: Research yield farming protocols on Base
2. @analyst: Analyze current DeFi positions
3. @builder: Create tracking dashboard
4. @watcher: Add health monitoring
β Coordinates via state.json
β Main agent reviews final integration
Explicit Override
Input: "@builder: Fix the bug in the price alert system"
β Ignores keyword routing
β Directly assigns to Builder
β Builder debugs and reports fix
β οΈ QUALITY GATES
Before Task Completion
- Verification checklist passed β all items checked
- Output captured β logs, screenshots, test results
- State updated β
agents/state.jsonreflects completion - Documentation updated β README, comments, or relevant docs
- Lessons captured β if any corrections were made
Before Sub-Agent Delegation
- Task is well-defined β clear deliverables and constraints
- Agent capability matches β right agent for the job
- State checked β not duplicating existing work
- Workspace specified β agent knows where to work
Before Plan Execution
- Human approval β for large scope or risky changes
- Dependencies resolved β required tools/access available
- Success criteria clear β how will we know it's done?
- Rollback plan β what if something breaks?
This skill enables systematic, high-quality task execution through proven orchestration patterns. Use these guidelines to coordinate complex workflows and continuously improve through structured learning.
π― MISSION CONTROL PATTERNS (ADVANCED)
For production-grade multi-agent coordination, see references/patterns.md for:
- Heartbeat Staggering: Prevent rate limits by offsetting cron jobs
- Enhanced state.json: Tasks, notifications, activities schema
- Task Lifecycle: InboxβAssignedβIn ProgressβReviewβDone
- Working Memory: WORKING.md for session continuity
- @Mentions: Agent-to-agent notification system
- Daily Standups: Automated progress reports
- Cost Optimization: Model selection by task type
Quick wins to implement:
- Stagger your cron jobs (5-10 min offsets)
- Add WORKING.md to each agent's workspace
- Track tasks in state.json with full lifecycle
- Use Haiku for monitoring, Opus for creative work
The goal: Turn independent agents into a coordinated team.