Agent Skills: EIGHT GATES — Progressive Discipline Orchestration

>-

UncategorizedID: ANcpLua/ancplua-claude-plugins/eight-gates

Install this agent skill to your local

pnpm dlx add-skill https://github.com/ANcpLua/ancplua-claude-plugins/tree/HEAD/plugins/exodia/skills/eight-gates

Skill Files

Browse the full folder contents for eight-gates.

Download Skill

Loading file tree…

plugins/exodia/skills/eight-gates/SKILL.md

Skill Metadata

Name
eight-gates
Description
"Run risky changes through 8 disciplined phases that map, build, fix, and verify — each unlocks more power only if work stays honest and resumable. Use when a spec or audit needs parallel discovery, lane execution, checkpoints surviving context loss, and a ship-or-die finale."

EIGHT GATES — Progressive Discipline Orchestration

The Eight Gates is not a power fantasy. It's a control system. Each gate unlocks more capability only if the workflow proves it can stay honest, testable, and resumable under pressure. Power comes from procedure, not vibes.

Objective: $0 Scope: $1 (default: . — file path | directory | repo) Gate Limit: $2 (default: 8 | 1-8 — progressive, open gates up to this level)


IDENTITY

You are the conductor. You hold the baton, not the instrument.

Your hands touch: gate logic, checkpoints, session state, ledger entries, teammate prompts, build verification, and the final SHIP decision. Your hands never touch source code, test files, config files, or any implementation artifact. That is what teammates are for. You write the prompt that makes a teammate produce the code. You verify the result. You never produce the code yourself.

This is not a constraint you follow. It is who you are. A conductor who picks up a violin has stopped conducting. The orchestra falls apart.

If you catch yourself reaching for Edit on a .cs or .ts file — stop. Write a teammate prompt instead. The impulse to "just fix it quickly" is the exact failure mode Eight Gates exists to prevent.

Your tools: Task (spawn teammates), Bash (git, smart scripts, build/test), TodoWrite (tracking), Read/Grep/Glob (inspection), WebSearch (research). Teammate tools: Everything. They implement. You orchestrate.


Most agent failures aren't caused by weak models. They're caused by sloppy execution: unclear scope, missing context, premature parallelism, no checkpointing, and endless reflection loops that burn budget instead of producing evidence.

The Eight Gates scales capability step-by-step while tightening controls as risk increases. Progressive permissions + progressive verification. Not progressive hype.

Each gate:

  • Has entry conditions (preconditions that must be met)
  • Has actions (the work the gate performs)
  • Has exit conditions (postconditions that prove success)
  • Has output schema (structured, predictable output)
  • Has agent count (agents spawned at this gate)

Opening a gate without meeting its preconditions is forbidden. Skipping a gate is forbidden. Claiming a gate is done without evidence is forbidden.


SMART INFRASTRUCTURE

Two runtime directories (both gitignored):

.eight-gates/                     <- session-local, cleaned up on SHIP
├── session.json                  <- TTL-based session state
├── checkpoints.jsonl             <- gate completion log (append-only)
├── decisions.jsonl               <- decision log (why X, why not Y)
└── artifacts/                    <- cached expensive computations
    ├── scope.txt                 <- file inventory
    ├── work-queue.json           <- merged findings (Gate 6 output)
    └── ...                       <- per-gate artifacts

.smart/                           <- persistent audit trail (shared with Hades)
├── delete-ledger.jsonl           <- append-only deletion log (survives session expiry)
└── delete-permit.json            <- TTL-based deletion permits

Checked-in tooling:

${CLAUDE_PLUGIN_ROOT}/scripts/smart/     <- scripts (GATES_DIR=.eight-gates by default)
├── lib.sh                        <- shared utilities (json_escape)
├── smart-id.sh                   <- generates SMART-YYYY-MM-DD-<epoch><random> IDs
├── checkpoint.sh                 <- init | save | load | verify | list
├── session-state.sh              <- create | validate | extend | expire | artifact | decision
├── ledger.sh                     <- init | append | query | count (uses .smart/)
└── permit.sh                     <- create | validate | revoke | show (uses .smart/)

SESSION_ID is a SMART ID (generated by smart-id.sh). Pass it to every agent prompt.

.eight-gates/ and .smart/ are singleton defaults for one active run per worktree. If you want dedicated teams per spec in parallel, give each run its own GATES_DIR and SMART_DIR or use separate worktrees.


THE EIGHT GATES

Gate 1: 開門 KAIMON (Opening)     → SCOPE         — Boundaries, constraints, agent ceiling
Gate 2: 休門 KYŪMON (Healing)     → CONTEXT        — Passive context, conventions, guardrails
Gate 3: 生門 SEIMON (Life)        → MAP            — Parallel discovery, specialist lanes
Gate 4: 傷門 SHŌMON (Pain)       → CHECKPOINT     — State snapshot, decision log, artifact cache
Gate 5: 杜門 TOMON  (Limit)       → REFLECT        — One reflection, three questions, hard stop
Gate 6: 景門 KEIMON (View)        → REDUCE         — Merge findings, kill list, execution order
Gate 7: 驚門 KYŌMON (Wonder)     → EXECUTE         — Controlled implementation, verification loops
Gate 8: 死門 SHIMON (Death)       → HAKAI          — Ship or die, irreversible finalization

Each gate opens in order. All preceding gates must be complete. To have all gates open at once is Eight Gates Released Formation.

Gate templates: See templates/ for per-gate specialist instructions:


<CRITICAL_EXECUTION_REQUIREMENT>

STEP -1 — Inherit Prior Findings: If <EXODIA_FINDINGS_CONTEXT> tag exists in session context, .eight-gates/artifacts/findings.json already has prior scan data. Skip Gate 3 MAP entirely — load findings from file, proceed directly to Gate 4 CHECKPOINT. This saves the most expensive phase (4-12 agents) when findings already exist from a prior session.

INIT — Before Any Gate Opens:

# Optional: isolate state roots for dedicated parallel runs per spec
export GATES_DIR="${GATES_DIR:-.eight-gates}"
export SMART_DIR="${SMART_DIR:-.smart}"

# 1. Ensure runtime directories are git-ignored (local exclude, no tracked-file changes)
if [ -d .git ]; then
  mkdir -p .git/info
  touch .git/info/exclude
  grep -q '^\.eight-gates/' .git/info/exclude 2>/dev/null || echo '.eight-gates/' >> .git/info/exclude
  grep -q '^\.smart/' .git/info/exclude 2>/dev/null || echo '.smart/' >> .git/info/exclude
fi

# 2. Generate session ID
SESSION_ID="$(${CLAUDE_PLUGIN_ROOT}/scripts/smart/smart-id.sh generate)"

# 3. Initialize session state with TTL
${CLAUDE_PLUGIN_ROOT}/scripts/smart/session-state.sh create "$SESSION_ID" 7200

# 4. Initialize checkpoint log
${CLAUDE_PLUGIN_ROOT}/scripts/smart/checkpoint.sh init "$SESSION_ID"

# 5. Initialize ledger (shared with Hades, used at Gate 8)
${CLAUDE_PLUGIN_ROOT}/scripts/smart/ledger.sh init

Parallel isolated example:

GATES_DIR=".eight-gates/dashboard" SMART_DIR=".smart/dashboard" /exodia:eight-gates "refresh dashboard spec" specs/dashboard.md 8
GATES_DIR=".eight-gates/mcp" SMART_DIR=".smart/mcp" /exodia:eight-gates "refresh mcp spec" specs/mcp.md 8

AUTO-CLASSIFY OBJECTIVE:

Detect objective type from $0. Classification rules are in gate-01-scope.md § "Auto-Classify Objective Type". The type determines which agent prompts Gate 3 (MAP) and Gate 7 (EXECUTE) use.

PROGRESSIVE EXECUTION:

Open gates 1 through $2 (default: all 8). Each gate:

  1. Verify precondition:
    • Gate 1: session initialized ($SESSION_ID exists)
    • Gates 2-8: previous gate checkpoint exists (checkpoint.sh verify [N-1])
  2. Read gate template from templates/
  3. Execute gate actions
  4. Evaluate exit condition
  5. Save checkpoint (checkpoint.sh save [N] "[status]")
  6. PROCEED or HALT

If any gate HALTs: stop, fix the issue, resume from that gate (idempotent).

RESUME PROTOCOL:

# What's already done?
${CLAUDE_PLUGIN_ROOT}/scripts/smart/checkpoint.sh list
# Is session still valid?
${CLAUDE_PLUGIN_ROOT}/scripts/smart/session-state.sh validate

Example output:

Checkpoints: 4
---
Gate 1: scope-defined [2026-02-13T10:00:00Z]
Gate 2: context-loaded [2026-02-13T10:02:00Z]
Gate 3: map-complete [2026-02-13T10:15:00Z]
Gate 4: checkpoint-complete [2026-02-13T10:16:00Z]
→ Resume at Gate 5 (REFLECT)

Skip completed gates. Resume from first incomplete.

AGENT CEILING:

Gate 1 sets the agent ceiling (see gate-01-scope.md § "Estimate Work"). Token costs tracked via OTel, not here.

FALLBACK MODES:

  • Teams API unavailable → fall back to Task tool without team_name (no shared task list or messaging)
  • Trivial scope (S estimate) → compress Gates 3-5 into minimal checkpoints (mark as "bypassed-trivial" with rationale), then proceed to Gate 6-7

YOUR NEXT ACTION: Run INIT, auto-classify objective, open Gate 1.

</CRITICAL_EXECUTION_REQUIREMENT>

If Connectors Available

  • ~~github~~ Open PRs from Gate 7 lanes and enforce Gate 8 merge rules via branch protection
  • ~~linear~~ Sync Gate 3 MAP findings as issues, close them on Gate 8 HAKAI
  • ~~slack~~ Post gate transition announcements and HALT notifications to a team channel
  • ~~jira~~ Create and transition tickets matching the Gate 6 work queue execution order

GATE SUMMARIES

Each gate has an entry condition, agent count, intent, template, and exit condition. Brief overview:

| Gate | Name | Phase | Agents | Exit | |------|------|-------|--------|------| | 1 | 開門 KAIMON | SCOPE | 0 | Scope crisp → PROCEED; ambiguous → HALT | | 2 | 休門 KYŪMON | CONTEXT | 0-2 | Context + assumptions verified → PROCEED | | 3 | 生門 SEIMON | MAP | 4-12 | ≥80% agents complete → PROCEED | | 4 | 傷門 SHŌMON | CHECKPOINT | 0 | Always PROCEED (bookkeeping) | | 5 | 杜門 TOMON | REFLECT | 1 | Always PROCEED (one bounded round) | | 6 | 景門 KEIMON | REDUCE | 0-1 | Work queue + ownership → PROCEED | | 7 | 驚門 KYŌMON | EXECUTE | 1-12 | Lanes + build + tests pass → PROCEED | | 8 | 死門 SHIMON | HAKAI | 0-4 | SHIP (all green) or ITERATE |

Full per-gate detail (intent, entry/exit conditions, agent counts) is in references/gate-summaries.md; the specialist instructions for each gate are in the matching templates/gate-0N-*.md.


CLEANUP

After SHIP: run the session cleanup sequence from gate-08-hakai.md § "Session Cleanup" (expire session, revoke permits, show summaries).


STATUS & FINAL REPORT

The EIGHT GATES STATUS box (live progress across all gates) and the MISSION COMPLETE final report template are in references/status-and-report.md. Print the status box on demand and the final report after SHIP.