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

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

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
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

Team Lifecycle

  1. TeamCreate — establish team
  2. TaskCreate — break into tasks with file ownership
  3. Spawn teammates (all in one message for parallelism)
  4. Monitor and coordinate
  5. Shut down specialists
  6. Spawn reviewer for cross-validation
  7. Acknowledge expertise suggestions
  8. TeamDelete + 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)

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: