Model routing, PostCompact hook, parallel spawning, error recovery

Model tier assignment:
- model: haiku → help, sprint-status, story-readiness, scope-check,
  project-stage-detect, changelog, patch-notes, onboard (read-only/format)
- model: opus → review-all-gdds, architecture-review, gate-check
  (multi-doc synthesis, high-stakes verdicts)

PostCompact hook:
- New .claude/hooks/post-compact.sh — fires after compaction, reminds
  Claude to re-read production/session-state/active.md to restore context
- Registered in settings.json between PreCompact and Stop

Parallel Task spawning:
- review-all-gdds: Phase 2 (consistency) and Phase 3 (design theory) now
  explicitly instructed to spawn as parallel Task agents simultaneously

Error Recovery Protocol:
- Standard BLOCKED-handling section added to: review-all-gdds,
  architecture-review, dev-story, team-combat, team-qa, team-narrative,
  team-level, team-ui, team-audio, team-release, team-polish
- Pattern: surface blocker → assess dependencies → offer 3 options via
  AskUserQuestion → always produce partial report

Coordination rules:
- Added Model Tier Assignment table with routing rationale
- Added Subagents vs Agent Teams section (experimental agent teams docs)
- Added Parallel Task Protocol (when/how to spawn parallel agents)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Donchitos
2026-03-16 15:33:21 +11:00
parent 9f731f3d86
commit f36494e70c
23 changed files with 302 additions and 0 deletions

View File

@@ -11,3 +11,63 @@
`producer` agent coordinates the propagation.
5. **No Unilateral Cross-Domain Changes**: An agent must never modify files
outside its designated directories without explicit delegation.
## Model Tier Assignment
Skills and agents are assigned to model tiers based on task complexity:
| Tier | Model | When to use |
|------|-------|-------------|
| **Haiku** | `claude-haiku-4-5-20251001` | Read-only status checks, formatting, simple lookups — no creative judgment needed |
| **Sonnet** | `claude-sonnet-4-6` | Implementation, design authoring, analysis of individual systems — default for most work |
| **Opus** | `claude-opus-4-6` | Multi-document synthesis, high-stakes phase gate verdicts, cross-system holistic review |
Skills with `model: haiku`: `/help`, `/sprint-status`, `/story-readiness`, `/scope-check`,
`/project-stage-detect`, `/changelog`, `/patch-notes`, `/onboard`
Skills with `model: opus`: `/review-all-gdds`, `/architecture-review`, `/gate-check`
All other skills default to Sonnet. When creating new skills, assign Haiku if the
skill only reads and formats; assign Opus if it must synthesize 5+ documents with
high-stakes output; otherwise leave unset (Sonnet).
## Subagents vs Agent Teams
This project uses two distinct multi-agent patterns:
### Subagents (current, always active)
Spawned via `Task` within a single Claude Code session. Used by all `team-*` skills
and orchestration skills. Subagents share the session's permission context, run
sequentially or in parallel within the session, and return results to the parent.
**When to spawn in parallel**: If two subagents' inputs are independent (neither
needs the other's output to begin), spawn both Task calls simultaneously rather
than waiting. Example: `/review-all-gdds` Phase 1 (consistency) and Phase 2
(design theory) are independent — spawn both at the same time.
### Agent Teams (experimental — opt-in)
Multiple independent Claude Code *sessions* running simultaneously, coordinated
via a shared task list. Each session has its own context window and token budget.
Requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` environment variable.
**Use agent teams when**:
- Work spans multiple subsystems that will not touch the same files
- Each workstream would take >30 minutes and benefits from true parallelism
- A senior agent (technical-director, producer) needs to coordinate 3+ specialist
sessions working on different epics simultaneously
**Do not use agent teams when**:
- One session's output is required as input for another (use sequential subagents)
- The task fits in a single session's context (use subagents instead)
- Cost is a concern — each team member burns tokens independently
**Current status**: Not yet used in this project. Document usage here when first adopted.
## Parallel Task Protocol
When an orchestration skill spawns multiple independent agents:
1. Issue all independent Task calls before waiting for any result
2. Collect all results before proceeding to dependent phases
3. If any agent is BLOCKED, surface it immediately — do not silently skip
4. Always produce a partial report if some agents complete and others block