phase-gate-sequence

A fixed six-step checkpoint process for agents moving between work phases. It includes cleanup, a checkpoint, a commit, a search check, and context-window checks before the next phase or delegation.

In plain words
What is it for?
Use it after completing each domain phase and before assigning the next one, especially in long, multi-phase agent workflows.
Why use it?
It prevents phase transitions from relying on memory or repeated decisions. The defined sequence helps keep work records, code state, and available context consistent.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/endogenai/dogma/phase-gate-sequence
Any agent
npx skills add EndogenAI/dogma --skill phase-gate-sequence
Clone the repo
git clone --depth 1 https://github.com/EndogenAI/dogma

Made for: Claude Code, Codex.

Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,973 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00131 $0.01973
Opus 5 $0.00066 $0.00986
Sonnet 5 $0.00026 $0.00395
Haiku 4.5 $0.00013 $0.00197

Measured 3d ago against content hash 417c357aee91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

phase-gate-sequence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/phase-gate-sequence/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Phase Gate Sequence

This skill enacts the Algorithms-Before-Tokens axiom from MANIFESTO.md: the 6-step gate is a deterministic algorithm encoded once and shared across all executive agents, eliminating parallel re-derivation and enforcing consistent phase discipline fleet-wide.


Beliefs & Context

  • Governing axiom: Axiom 2 — Algorithms Before Tokens — deterministic procedure over repeated instruction
  • GitHub issue: #79 — Skills as Decision Codifiers
  • Formal FSM spec: data/phase-gate-fsm.yml — machine-readable state specification for this gate loop (states: INIT, PHASE_RUNNING, GATE_CHECK, COMPACT_CHECK, COMMIT, CLOSED)
  • Agents that use this skill: Executive Orchestrator, Executive Researcher, Executive Fleet, Executive Docs
  • Foundation docs:
    • AGENTS.md — compaction-aware writing, commit discipline, Programmatic-First
    • executive-orchestrator.agent.md — canonical per-phase sequence (lines 169–196) and context window alert protocol (lines 198–242)

Workflow

Run this sequence after every ## Phase N Output write, before delegating the next domain phase.

Step 0: Loop Audit (Pre-Phase)

Before any complex phase execution, run the orchestration loop detector:

uv run python scripts/detect_orchestration_loop.py \
  --task "<current-phase-name>" \
  --scratchpad ".tmp/$(git branch --show-current | tr '/' '-')/$(date +%Y-%m-%d).md"
  • If loop_detected: false → proceed to Step 1
  • If loop_detected: truedo not execute. Write to scratchpad: ## Loop Detected — [task] — iteration [N]; awaiting user direction. Surface to user: "I detected that I attempted this task [N] iterations ago. What should I do differently?"

Encoding point: Governed by AGENTS.md § Guardrails. Script: scripts/detect_orchestration_loop.py. Research basis: docs/research/orchestrator-autopilot-failure.md § Recommendation 4.

Read the full file on GitHub · 164 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 164 lines · 131 tokens per session scan A 417c357aee91

Subscribe to this mod's changes

phase-gate-sequence is a skill published in the GitHub repository EndogenAI/dogma (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 131 tokens to every session and 1,973 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.