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
Patterns
| Pattern | Trigger | Flow |
|---|---|---|
| A (Implementation) | fix, add, create, implement, update | plan → approve → build → review → acknowledge → improve |
| B (Question) | how, what, why, explain | question-agent → answer |
| C (Simple) | format, lint, validate, check | build-agent → result |
Error Handling
- Plan fails — report error, exit
- User declines plan — save spec, exit gracefully
- Build fails — preserve spec, report error, skip review
- Review fails — log, skip improve, workflow succeeds
- 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-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 |
Team Lifecycle
- TeamCreate — establish team
- TaskCreate — break into tasks with file ownership
- Spawn teammates (all in one message for parallelism)
- Monitor and coordinate
- Shut down specialists
- Spawn reviewer for cross-validation
- Acknowledge expertise suggestions
- TeamDelete + report
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)
Purpose: Instructs Claude to review fetched web content for prompt injection. Suspicious domains 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, 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 + Task spawning | Produces quality assessment, expertise improvement suggestions, new agent suggestions. |
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