Mission Plugin for Claude Code v1.0
A strict 3-role orchestration system that turns Claude Code into a disciplined engineering team. The Orchestrator plans, Workers code, and the Validator tests — each role isolated by hard hook enforcement at the tool-call level. Features structured tracking via features.json, model enforcement, and Factory-grade anti-drift protection.
Why Mission?
Claude Code is powerful, but without structure it can skip tests, mix concerns, or lose track of quality. Mission Mode forces a disciplined loop:
Plan → Create features.json → Dispatch Workers per feature → Validate → Fix → Validate → ... → Done
No role can do another role's job. Workers can't run tests. Validators can't write source code. The Orchestrator can't touch files outside .mission/. All enforced by Python PreToolUse hooks — not just prompts.
Install
# From GitHub
/plugin marketplace add riftzen-bit/mission
/plugin install mission
# Or from a local clone
/plugin install /path/to/mission
Quick Start
/enter-mission Build a REST API for user authentication
That's it. Mission Mode activates and runs the full loop automatically:
- Orchestrator reads your codebase, creates
features.json with structured feature list
- Workers implement code per feature (parallel for independent features)
- Validator validates per-feature with structured assertion tracking, generates report
- If issues found → Workers fix → Validator re-verifies
- Loop until all features pass → cleanup → done
Commands
| Command | Description |
|---|
/enter-mission [task] | Start Mission Mode (or resume if interrupted) |
/exit-mission | Emergency stop — always works, bypasses all guards via endedAt |
/mission-status | Dashboard: phase, round, per-feature progress from features.json |
/mission-config | View or set models for orchestrator, worker, validator + persistence |
Roles
Orchestrator
Plans, delegates, reviews. Spawns Workers and Validators via the Agent tool.
- CAN: Read any file, write to
.mission/, create/update features.json, spawn agents
- CANNOT: Write or edit source code (hooks block it)
Worker
Implements code exactly as assigned per feature from features.json. Produces structured JSON handoffs.
- CAN: Read/write source files, run build commands
- CANNOT: Run tests, write test files, modify
.mission/state.json, spawn Validators
Validator
The ruthless quality gate. Validates per-feature, writes tests, runs all checks, finds bugs.
- CAN: Write test files, write
.mission/reports/*, run any command
- CANNOT: Modify source files, modify mission state, spawn Workers
Hook Enforcement
Roles are enforced at the tool-call level by a Python hook engine (hooks/engine.py) shared across eight hooks:
hooks/phase-guard.py (PreToolUse) — Blocks forbidden tool calls per phase
hooks/mission-reminder.py (PreToolUse) — Injects role-specific anti-drift reminders with feature context
hooks/mission-continue.py (PostToolUse) — Injects continuation reminders with strength gradient
hooks/mission-stop.py (Stop) — Blocks session from ending while mission is active
hooks/mission-subagent-stop.py (SubagentStop) — Blocks sub-agents from premature stopping
hooks/mission-precompact.py (PreCompact) — Saves checkpoint before context compaction
hooks/mission-session-start.py (SessionStart) — Auto-injects mission context on session start/resume
hooks/mission-prompt.py (UserPromptSubmit) — Injects mission context on every user message
All 8 hooks across 7 event types registered in hooks/hooks.json via direct python3 invocation. Single-process execution per hook (no subprocess chains).
| Defense | What it blocks |
|---|
| Phase Lock | Tool calls that don't match the current phase |
| Completion Guard | Completing without a validator report (relentless: requires Verdict: PASS) |
| Cleanup Guard | Deactivating without summary.md + clean worker-logs |
| Worker Test Block | Workers writing *.test.*, *.spec.*, *_test.*, tests/*, __tests__/* |
| Validator Path Lock | Validators writing to .mission/ except .mission/reports/* |
| Anti-Premature Stop | Completion in relentless mode when report says FAIL |
| Model Enforcement | Wrong model on Agent dispatch (auto-injects if missing) |
| Unknown Phase Block | All tool calls when phase is not in valid set |
| Symlink Protection | Path traversal via symlinks (realpath resolution) |
| Phase Transitions | Invalid transitions (e.g., worker → complete) |
| Stop Guard | Droid stopping while mission active (non-complete phase) |
| SubagentStop Guard | Workers/Validators stopping without handoff/report |
Feature Tracking
The Orchestrator creates .mission/features.json as the structured tracking system: