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

  1. Read domains.md — match keywords and paths
  2. Read domain-map.conf — match file path globs
  3. Scan experts/ directory — check expertise.yaml
  4. Fallback: generic build-agent or ask user

Pattern A: Implementation

plan-agent → spec ↓ User: "Proceed?" → [Yes] / [No] ↓ build-agent → implementation ↓ security-agent → security review (can ask user) ↓ ↑ ↓ fix loop (max 3x) ↓ review-agent → quality check + objective validation ↓ ↑ ↓ fix loop (max 3x) ↓ User: "Apply suggestions?" → [Yes] / [Skip] ↓ improve-agent → updates expertise

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

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

plan-agent → spec ↓ User: "Proceed?" → [Yes] / [No] ↓ build-agent → implementation ↓ review-agent → quality report + suggestions ↓ User: "Apply suggestions?" → [Yes] / [Skip] ↓ improve-agent → updates expertise

Review issues are reported as recommendations, not blocking. No security gate, no fix loops.

Error Handling

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
Experimental Requires: 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

TeamCreate → initialize team workspace ↓ TaskCreate → break work into domain-scoped tasks ↓ Spawn specialists → one per domain ↓ [domain-a-build] [domain-b-build] [domain-c-build] ↓ ↓ ↓ ↓↓↓ work in parallel ↓↓↓ ↓ security-agent → security review (can ask user) ↓ ↑ ↓ fix loop (max 3x) ↓ Shut down specialistsreview-agent → quality check + objective validation ↓ ↑ ↓ fix loop (max 3x, re-spawns specialists) ↓ improve-agent → updates expertise per domain ↓ TeamDelete → clean up team workspace

Council Flow

Spawn analysts → one per domain (read-only) ↓ [domain-a-analyst] [domain-b-analyst] [domain-c-analyst] ↓ ↓ ↓ ↓↓↓ analyze in parallel ↓↓↓ ↓ Team lead → synthesize findings into unified report

File Ownership Rule

CRITICAL No two teammates may modify the same file. Assign paths explicitly in task descriptions.

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

  1. Run git log --oneline -20 --name-only
  2. Map changed files to domains via domains.mddomain-map.confsession-domains.txtexperts/ scan
  3. Spawn {domain}-improve-agent per affected domain (parallel)
  4. 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

  1. Detect existing setup (domains.md, experts/, domain-map.conf)
  2. Scan project — language markers, directory structure, README
  3. Propose 3-7 domains with name, description, keywords, paths, language, build/test
  4. Generate: domains.md, domain-map.conf, experts/{domain}/ with tips.md + expertise.yaml
  5. Update CLAUDE.md project 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:

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: