API Reference
Complete reference for all commands, hooks, and agent definitions.
/do — Universal Workflow Entry Point
Single command interface for all workflows. Analyzes requirements and orchestrates expert agents through plan-build-improve cycles.
description: Universal entry point - delegates to appropriate workflow
argument-hint: <requirement>
allowed-tools: Read, Glob, Grep, Task, AskUserQuestion, TodoWrite
Domain Discovery
- Read
domains.md— match keywords and paths - Read
domain-map.conf— match file path globs - Scan
experts/directory — check expertise.yaml - Fallback: generic
build-agentor ask user
Pattern A: Implementation
Triggers: fix, add, create, implement, update, configure, refactor
Pattern B: Question
question-agent → answer
Triggers: how, what, why, explain
Pattern C: Simple
build-agent → result
Triggers: format, lint, validate, check
Error Handling
- Plan fails — report error, exit
- User declines plan — save spec, exit gracefully
- Build fails — preserve spec, report error, skip security/review/improve
- Security review fails — log, proceed to general review
- Security fix loop exhausted (3x) — ask user to proceed or abort
- Review fails — log, skip improve, workflow succeeds
- Review fix loop exhausted (3x) — ask user to accept or abort
- Improve fails — log, workflow succeeds
Examples
/do "Add user auth endpoint" # Pattern A
/do "How does caching work?" # Pattern B
/do "Lint all files" # Pattern C
/do-quick — Fast Single-Domain Workflow
Same as /do Pattern A but without security review or fix loops. Use when you trust the domain and want speed over thoroughness.
description: Fast workflow without security/review fix loops
argument-hint: <requirement>
allowed-tools: Read, Glob, Grep, Task, AskUserQuestion, TodoWrite
Flow
Review issues are reported as recommendations, not blocking. No security gate, no fix loops.
Error Handling
- Plan fails — report error, exit
- Build fails — preserve spec, report error, skip review
- Review fails — log, skip improve, workflow succeeds
- Improve fails — log, workflow succeeds
Examples
/do-quick "Add user auth endpoint"
/do-quick "Refactor the sidebar component"
/do-teams — Team-Based Parallel Execution
Spawns a team of specialist agents that work in parallel on multi-domain tasks.
description: Team-based parallel execution with agent teams coordination
argument-hint: <requirement>
allowed-tools: Read, Glob, Grep, Task, SendMessage, TeamCreate, TeamDelete, TaskCreate, TaskUpdate, TaskList, AskUserQuestion, TodoWrite
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
Patterns
| Pattern | Trigger | Approach |
|---|---|---|
| Implementation | implement, add, create, build, fix | Spawns domain specialists with file ownership |
| Council | analyze, research, review, assess | Spawns domain analysts for independent analysis |
Implementation Flow
Council Flow
File Ownership Rule
Examples
/do-teams "Add auth with API and frontend" # Implementation
/do-teams "Review security of auth flow" # Council
/do-teams "Fix all failing tests" # Parallel testing
/improve — Expertise Improvement Loop
Reviews recent git changes, extracts learnings, updates expertise.yaml files.
description: Review recent work and update domain expertise
argument-hint: [domain|all]
allowed-tools: Read, Glob, Grep, Edit, Bash, Task, TodoWrite
Usage
/improve # Auto-detect from recent changes
/improve backend # Only backend domain
/improve all # All domains
Steps
- Run
git log --oneline -20 --name-only - Map changed files to domains via
domains.md→domain-map.conf→session-domains.txt→experts/scan - Spawn
{domain}-improve-agentper affected domain (parallel) - Report updates
/cuite-init — Domain Bootstrapper
Scans your project, detects domains, and generates all configuration files.
description: Scan project and bootstrap domain structure
argument-hint: [--force]
allowed-tools: Read, Glob, Grep, Write, Edit, Bash, AskUserQuestion, TodoWrite
Steps
- Detect existing setup (
domains.md,experts/,domain-map.conf) - Scan project — language markers, directory structure, README
- Propose 3-7 domains with name, description, keywords, paths, language, build/test
- Generate:
domains.md,domain-map.conf,experts/{domain}/withtips.md+expertise.yaml - Update
CLAUDE.mdproject structure table
Detection Patterns
**/Cargo.toml # Rust
**/package.json # JavaScript/TypeScript
**/go.mod # Go
**/requirements.txt # Python
**/Dockerfile* # DevOps
**/.github/workflows/ # CI/CD
**/helm/ # Kubernetes
/cuite-sync — Framework Sync Checker
Detects drift between the cuite subtree and project configuration.
description: Check and sync cuite framework with project configuration
argument-hint: [--apply]
allowed-tools: Read, Glob, Grep, Bash, Edit, Write, AskUserQuestion, TodoWrite
Checks
| Check | What |
|---|---|
| Symlink integrity | All expected symlinks exist and point correctly |
| Settings hooks | Project hooks match framework template |
| Upstream changes | Commits behind cuite/main |
| Domain consistency | Cross-reference domains.md vs experts/ vs domain-map.conf |
Issues Detected
| Issue | Condition | Severity |
|---|---|---|
| Ghost domain | In domains.md but no experts/ dir | HIGH |
| Undocumented domain | In experts/ but not in domains.md | MEDIUM |
| Unmapped domain | In domains.md but no domain-map.conf entries | MEDIUM |
| Incomplete domain | Missing tips.md or expertise.yaml | HIGH |
| Orphan mapping | domain-map.conf references unknown domain | LOW |
scope-enforcement.sh
When: PreToolUse
Purpose: Enforces project boundaries, gates network egress against whitelist, blocks unsafe remote code execution, triggers supply chain verification for package installs.
Key behaviors:
- Blocks out-of-scope file edits
- Requires download-first for remote code
- Prints
SUPPLY_CHAIN_CHECKfor new packages
validate-intent.sh
When: PostToolUse
Purpose: Runs syntax checks on edited shell scripts. Logs edits by domain.
detect-injection.sh
When: PostToolUse (after WebFetch and WebSearch)
Purpose: Two-tier content security gate. Tier 1 (regex): scans tool_output for prompt injection patterns (hard red flags auto-blacklist the domain, medium flags warn). Extracts embedded install commands (npx, pip install, cargo add, curl|bash, etc.) and emits SUPPLY_CHAIN_CHECK markers. Tier 2 (LLM): instructs Claude to perform semantic review of content the regex cannot classify. Suspicious domains are added to blocked-domains.txt.
track-learnings.sh
When: PostToolUse
Purpose: Tracks which domains are touched during a session. Writes to .claude/.cache/session-domains.txt. Used by /improve for auto-detection.
inject-expertise.sh
When: SubagentStart
Purpose: Injects domain expertise into spawned agents. Matches agent name to domain keyword, injects tips.md first (compact), then expertise.yaml (deep knowledge).
session-context.sh
When: SessionStart
Purpose: Reports available domains, recent activity, active project tuning (tuning.conf), and pending blacklist entries for user review.
Core Agents
| Agent | Access | Description |
|---|---|---|
| build-agent.md | Full write access | General implementation across all domains. Uses expertise from injected domain context. |
| scout-agent.md | Read-only | Codebase exploration, research, code search. WebSearch auto-allowed. |
| review-agent.md | Read-only + Bash + AskUserQuestion | Quality assessment with objective validation. Runs tests/coverage/benchmarks to verify measurable goals were met. Re-delegates unmet objectives to specialists via team lead (max 3 iterations). Can ask the user about unresolvable requirements. Produces expertise improvement and new agent suggestions. |
| security-agent.md | Read-only + Bash + AskUserQuestion | Security review with user escalation. OWASP top 10, supply chain verification, dependency auditing. Delegates fixes to specialists; loops until clean (max 3 iterations). |
Template Agents
5 templates at .claude/agents/templates/:
| Template | Access | Description |
|---|---|---|
| base-agent.md | — | Base configuration shared by all domain agents |
| plan-agent.md | Read-only | Creates implementation specs at .cache/specs/{domain}/ |
| build-agent.md | Full access | Builds from specs, runs tests |
| improve-agent.md | Read + Edit expertise files | Updates tips.md and expertise.yaml |
| question-agent.md | Read-only | Uses haiku model for fast answers |
To create domain agents: copy templates to experts/{domain}/, replace {domain} placeholder.
Agent Registry
Format at .claude/agents/agent-registry.json:
- Lists all available agents
- Contains
_domainAgentTemplatewith{domain}placeholders - Hooks use this for agent discovery
- Auto-populated by
/cuite-init