preflight
Skill4 starsChanged 6 days agoMITView on GitHub
Phase 0 preflight for codex-flow — gate on Codex login/health, detect and offer to resume an interrupted run, and baseline the workspace (git cleanliness + ref, gitignore live logs, known-red test baseline) so later phases have a rollback point and review blames only new failures.
- Reads credentials
56 other projects use a version of this.
Adopted by
Most recently taken up by
- trac3r00/agent-skillstheir own version, first seen Nov 29, 2026
- Rune-kit/runetheir own version, first seen Nov 29, 2026
- trac3r00/core-skillstheir own version, first seen Nov 29, 2026
- openai/openai-codemodtheir own version, first seen Nov 29, 2026
- xavierforge/skillstheir own version, first seen Nov 25, 2026
- mo-cmyk/mazarbultheir own version, first seen Nov 22, 2026
Used with
Projects with it also use perf, repo-audit and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillperf
Speed and memory performance rules for Rust crates, the Node addon, webui-framework, and webui-delivery.
Also in 3 projects that use this
brandonsimpsonSkillrepo-audit
Use when asked to audit a repository's health, assess technical debt, evaluate codebase quality end-to-end, or produce a prioritized improvement plan — including "how bad is this code", new-team-takeover or pre-acquisition reviews, and periodic engineering health checks. Analysis-only; never modifies code.
Also in 3 projects that use this
asterkinSkilladr
Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.
Also in 4 projects that use this
BerryKuipersSkillscaffold
Detect project stack, apply architecture patterns, wire quality gates, and scaffold features. Use when bootstrapping a project, adding a vertical slice, wiring CI/CD, adding Docker compose, or setting up quality gates.
Also in 3 projects that use this
nicepkgSkillteam
根据任务快速组建临时 AI Agent 团队协作。自动从 .claude/agents/ 中选择最合适的成员组队。
Also in 3 projects that use this
dirienSkilldecide
Three-agent adversarial debate protocol for strategic decisions. Two advocates steelman opposing positions while a moderator identifies risks and synthesizes a binding consensus. Use when choosing between alternatives, evaluating tradeoffs, or making high-stakes decisions.
Also in 3 projects that use this
Other versions56 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 56
- webiny/webiny-js★ 8.1ksame name
- CrowdDotDev/crowd.dev★ 3.4ksame name
- tphakala/birdnet-go★ 2.5ksame name
- openfootmanager/openfootmanager★ 1.2ksame name
- mohebifar/tooscut★ 717same name
- me2resh/apexyard★ 542same name
- NVIDIA/kumo-engine★ 442same name
- linuxfoundation/insights★ 296same name
- sohaibt/product-mode★ 162same name
- unlearndev/skills★ 106same name
46 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accounting-bookkeepingSkill
- agent-context-persistenceSkill
- asoSkill
- brainstorm-argumentationSkill
- brainstorm-debateSkill
- brainstorm-lensesSkill
- causal-inferenceSkill
- context-disciplineSkill
- creative-briefSkill
- customer-support-opsSkill
- data-quality-checksSkill
- design-fundamentalsSkill
- ecommerce-operationsSkill
- event-taxonomySkill
- exec-coding-standardsSkill
- exec-cppSkill
- exec-csharpSkill
- exec-deliverableSkill
- exec-github-actionsSkill
- exec-goSkill
- exec-jvmSkill
- exec-phpSkill
- exec-pythonSkill
- exec-rubySkill
- exec-rustSkill
- exec-self-testingSkill
- exec-swiftSkill
- exec-typescriptSkill
- executor-fallbackSkill
- exec-visualizationSkill
- fast-pathSkill
- final-reviewSkill
- financial-auditSkill
- hr-recruitingSkill
- influencer-strategySkill
- interview-ask-backSkill
- interview-elicitationSkill
- jev-assistSkill
- json-data-wranglingSkill
- legal-contract-basicsSkill
- localization-copySkill
- manufacturing-ops-planningSkill
- marketing-attributionSkill
- media-planningSkill
- okr-planningSkill
- pack-game-analyticsSkill
- parallel-executionSkill
- performance-marketingSkill
- personal-financeSkill
- plan-architectureSkill
- plan-backlogSkill
- plan-research-firstSkill
- profile-contentSkill
- profile-designSkill
- profile-pilotSkill
- profile-planSkill
- real-estate-analysisSkill
- review-conformanceSkill
- review-dualSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 1 is distinctive, and 9 are very specific to this project.
0
Common
Most of the 50 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
If .codex-flow/STATE.md exists, treat it as an interrupted run even when PLAN.md or TASKS.md has not been created yet:
- Very specific: line 46
Read .codex-flow/STATE.md as the resume authority.
- Very specific: line 49
When both .codex-flow/PLAN.md and .codex-flow/TASKS.md exist, run node "${CLAUDE_PLUGIN_ROOT}/scripts/context-slice.mjs" --resume and read …
- Very specific: line 54
When TASKS.md exists, show its task Statuses.
- Very specific: line 56
Before scheduling anything, reconcile every task whose Status is in-progress.
- Distinctive: line 99
If STATE.md does not exist, do not offer resume.
- Very specific: line 112
Ignore live logs: ensure .codex-flow/live/ is in .gitignore (append if missing) so raw JSONL progress logs never land in checkpoint or …
- Very specific: line 118
Write run state: after baselining, create .codex-flow/STATE.md with node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" init --baseline …
- Very specific: line 163
Write STATE.md and TASKS.md status lines only through the helper: node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set <key> <value>, …
- Very specific: line 176
If .codex-flow/STATE.md, PLAN.md, TASKS.md or EVENTS.jsonl exists, load this skill and run Step 2 resume check FIRST.
“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Preflight (Phase 0 — run FIRST, it is a gate)
Helpers: required — doctor.mjs, context-slice.mjs, flow-state.mjs, project-context.mjs, profile-router.mjs (helper rule: missing → STOP and tell the user to reinstall the codex-flow plugin; non-zero exit → surface the error and STOP).
Nothing downstream is safe until these pass. Do not interview, plan, or execute until the gate is green.
Step 1 — Health gate
The command evaluates the Fast-path gate BEFORE this call: the analysis lane makes no
codex_health call at all unless the user requests a Codex second opinion (and then with
{ deep: true }); the small-change lane and the full flow make it once, after the gate decision
and the resume check.
In those lanes, call mcp__codex__codex_health with { deep: true } ONCE — after the gate
decision and the resume check, before anything else. The deep input adds
a one-shot read-only codex exec probe and returns execProbe
(ok | quota | model | error | skipped) plus execProbeMessage next to loggedIn; read
execProbe from that single call instead of re-probing later phases.
- Tool call fails / server missing → a connect timeout or closed connection is not "server missing": run
node scripts/doctor.mjs --probe-launcher, keep the folder downloaded or move the repo off cloud-synced storage, reconnect with/mcp, re-check health, and only then offer the Executor fallback. Otherwise, the MCP server isn't set up. Point the user to the codex-mcp README install steps (ornode scripts/doctor.mjs), then offer the command's Executor fallback: fix and re-check, or continue with Claude as executor. Never continue silently. loggedIn: false→ tell the user to runcodex login(ChatGPT Plus/Pro/Team, or setOPENAI_API_KEY), then offer the same Executor fallback choice. Proceed only after a re-check showsloggedIn: trueor the user explicitly chose the fallback.execProbe: quotaorexecProbe: model→ logged in but unable to execute. QuoteexecProbeMessageand offer the Executor fallback right away; aquotaormodelprobe result is sufficient on its own and requires NO unhealthy health re-check.execProbe: error→ reportexecProbeMessageverbatim, then offer the same fallback choice.loggedIn: truewithexecProbe: ok(orskipped) → report the Codex version, recordexecutor: codex, and continue.- The analysis lane of the Fast-path gate needs no Codex session and no fallback decision; when its optional Codex second opinion fails, the analysis is delivered Claude-only with the failure named in the "what I verified" note.
Step 2 — Resume check (don't clobber an interrupted run)
If .codex-flow/STATE.md exists, treat it as an interrupted run even when PLAN.md or TASKS.md has
not been created yet:
- Read
.codex-flow/STATE.mdas the resume authority. Its approval fields decide which phases may be skipped; any phase whose approval is not recorded MUST be re-run. The existence of PLAN.md/TASKS.md is NOT proof of approval. - When both
.codex-flow/PLAN.mdand.codex-flow/TASKS.mdexist, runnode "${CLAUDE_PLUGIN_ROOT}/scripts/context-slice.mjs" --resumeand read.codex-flow/RESUME.mdinstead of the raw files. If the helper is not found, STOP and tell the user to reinstall the codex-flow plugin (its scripts/ directory is required); if it is present but exits non-zero, surface the error to the user and STOP. Never edit control files by hand. When either file does not exist, read only the control files that exist; do not require a missing TASKS.md to resume an earlier phase. - When TASKS.md exists, show its task Statuses. Ask resume vs restart in every case except
phase: complete, which archives and starts fresh without a resume offer (see below). - Before scheduling anything, reconcile every task whose Status is
in-progress. Read its recorded Session line. The resume slice's Task statuses section carries Session content for every in-progress task even though it embeds the full task text only for the first unfinished task; do not assume the other in-progress task blocks are embedded. A launching line may be sequential (- Session: launching (base: <short sha>)) or parallel (- Session: launching (base: <short sha>, worktree: <path>, branch: <name>)). Extract the base sha from either launching form or the completed-session form. Then cross-checkgit log --oneline <base sha>..HEADandgit statusfor changes to the task's declaredFiles:since that base. Report the evidence and ask the user to choose exactly one: continue in the recorded session (when a real session id exists) / review the work as-is / reset to pending. For reset to pending, roll back through the checkpoint commit whencheckpointCommitsis enabled. Never blindly re-execute an in-progress task. phase: complete→ terminal, not resumable. Do NOT offer resume: archive the run's control files to.codex-flow/archive/<timestamp>/and begin fresh, exactly as Restart does. ArchiveEVENTS.jsonlwith them. Resume is offered only for a non-completephase.- Resume → first run
node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" check, adding--tasks .codex-flow/TASKS.mdwhenever that file exists so the terminal-status validation runs (node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" check --tasks .codex-flow/TASKS.md); when it reports only missing keys on a legacy file, add them withset(currentTask -,taskStage idle,wave -) and continue; any other violation is surfaced to the user before routing. Then skip only the phases whose approvals STATE.md records, and route from STATE.md's recordedphase. Forphase: execution, enter Phase 4 at the first task not marked done. Before that, first route bytaskStageregardless ofcurrentTask(currentTasknames the task in sequential mode; in parallel mode it is-andwavenames the wave):reviewing→ resume Phase 5 for that task;launchingorexecuting→ run the in-progress reconciliation above before anything else;handoff→ finish Phase 5 step 7's durable handoff (or the wave's Step 3.8);merge-conflict→ surface the conflict to the user and STOP;idle→ the next pending task. Forphase: review, resume Phase 5 completion work; when all tasks are done butphaseis notcomplete, also resume Phase 5 for the final dual review, requirement ID-walk, improvement gate, cost/report delivery gates, and completion write instead of concluding there is no work. For an earlier phase, enter its first unapproved gate. Treat every[verify]block as a hypothesis: confirm it againstgit diffand the current code before relying on it. Record the currentgit rev-parse HEADasresumeHeadwithnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" resume --head <sha>(add--phase <phase>only when entering an earlier phase); apart from the legacy-key backfill above, change no other STATE.md key as part of the resume operation. The reconciliation choice for an in-progress task (continue / review as-is / reset) is made first; thetaskStagerouting then applies to the task as the user left it. - On resume, reuse the report dir recorded under
## Session reportin PLAN.md; create it only if missing. - Restart → archive the old control files that exist to
.codex-flow/archive/<timestamp>/, includingEVENTS.jsonl, then begin fresh withnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" init --baseline <run-start HEAD> --known-red "<compact list>". Archive the journal files printed bynode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" archive-paths.
If STATE.md does not exist, do not offer resume. Treat any PLAN.md, TASKS.md or journal files named by the archive-paths helper as orphaned control files and offer to archive them before beginning a fresh run.
Step 3 — Baseline the workspace
- Git cleanliness + ref:
git status --porcelain. If porcelain is non-empty butgit -c core.fileMode=false status --porcelainis empty, it is mode-only noise: with user consent, offergit config core.fileMode falseinstead of commit/stash and treat the baseline as clean. Otherwise, dirty → ask the user to commit/stash first (recommended: clean per-task diffs + a rollback point) or proceed with the dirty baseline noted in PLAN.md. When the user proceeds dirty, write.codex-flow/baseline-dirty.patch: save the baseline-to-working-tree output fromgit diff HEAD, then append a# Untracked at run startcomment header with each untracked path fromgit status --porcelain. Record the baseline ref (git rev-parse HEAD). Not a git repo → warn that diffs/checkpoints/rollback are unavailable and confirm before continuing. - Ignore live logs: ensure
.codex-flow/live/is in.gitignore(append if missing) so raw JSONL progress logs never land in checkpoint or final commits. - Known-red baseline: detect the project's test command and run it once. Record pre-existing failures as the known-red baseline — Phase 5 compares against this list so Codex is blamed only for NEW failures. If the suite can't run at all, tell the user and agree how results will be verified before continuing.
Write run state: after baselining, create
.codex-flow/STATE.mdwithnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" init --baseline <run-start HEAD> --known-red "<compact list>"(add--dirty-baseline baseline-dirty.patch/--executor <fallback value>when applicable), with exactly one## Run statesection and these fixed- <key>: <value>lines:## Run state - phase: interview - requirementsApproved: no - planApproved: no - backlogApproved: no - runBaselineRef: <git HEAD at run start, or unavailable outside git> - resumeHead: - knownRed: <recorded known-red failures, compact; none when green> - checkpointCommits: - executionMode: undecided - dirtyBaseline: <none | baseline-dirty.patch> - executor: codex - currentTask: - - taskStage: idle - wave: - - profile: - - profileMode: off - evidenceMode: off - languageMode: off - runLanguage: - - packs: -These six keys are optional and validated when present;
flow-state'sinitsets them from the router'sinitFlags.executorrecords who writes code:codex(default),claude (fallback: <reason> <ISO 8601>)after an explicit Executor-fallback choice, orcodex (restored <ISO 8601>)after returning. It changes only at a task boundary and never silently.currentTaskis the task being worked (T<n>) or-;taskStageis one ofidle | launching | executing | reviewing | handoff | merge-conflict;waveis the current parallel wave number or-.phasestaysexecutionfor the whole task loop — per-task progress lives incurrentTask+taskStage;phase: reviewmeans the whole-feature review after the last task.phaseand the three approvals change only throughapprove,advance,requirement-delta,plan-drift,improvement-gate, andresume; typed commands journal to.codex-flow/EVENTS.jsonl, andcheckreports hand-edited gate keys or unfinished transactions; change other keys throughset. The helper takes no file lock and assumes one orchestrator writes STATE.md and the journal; parallel workers never do. Write STATE.md and TASKS.md status lines only through the helper:node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set <key> <value>,node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" check, andnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" task <T-id> <status>(which appends the transition line). If the helper is not found, STOP and tell the user to reinstall the codex-flow plugin (its scripts/ directory is required); if it is present but exits non-zero, surface the error to the user and STOP. Never edit control files by hand.The orchestrator is the only writer.
runBaselineRef,knownRed, anddirtyBaselineare written once at run start and NEVER modified on resume. A resume writesresumeHeadandphase; outsideexecution, it resetscurrentTask,taskStage, andwave(apart from the legacy-key backfill); later approval or execution transitions update only their corresponding mutable fields.
Command-routed details
If .codex-flow/STATE.md, PLAN.md, TASKS.md or EVENTS.jsonl exists, load this skill and run
Step 2 resume check FIRST; otherwise evaluate the Fast-path gate first and load preflight only after
it selects the small-change lane or the full flow. The analysis lane never loads preflight.
Orphaned control files are PLAN.md, TASKS.md or journal files named by the archive-paths helper
when STATE.md does not exist.
On a fresh run, before baselining, when .codex-flow/PROJECT.md is absent generate it with
node "${CLAUDE_PLUGIN_ROOT}/scripts/project-context.mjs" --generate, and ask the user to confirm or edit it in
the Phase 1 interview. PROJECT.md is tracked, not run state: include it in checkpoint and final
commits and never archive it with the run. .codex-flow/playbook.jsonl, like PROJECT.md, is never
archived with a run. When created before baselining, list it as pre-existing
in the baseline-dirty.patch manifest.
On a fresh run, create .codex-flow/reports/<YYYYMMDD-HHMMSS>/ using the session-start local-time
timestamp. On resume, reuse the report dir recorded under ## Session report in PLAN.md; it is the
single report dir later phases write into per codex-flow:session-report.
Profile router: Full flow only (not fast-path lanes): after the Fast-path gate selects full flow
and before baselining, classify the deliverable (code|data|design|plan|content|mixed) and run
node "${CLAUDE_PLUGIN_ROOT}/scripts/profile-router.mjs" resolve --profile <p> --request-file <path> --run-id <report dir name>.
<path> is a temp file outside the workspace holding the user's task (e.g. via mktemp);
<report dir name> is the session-start <YYYYMMDD-HHMMSS> used for the report dir. Add its
initFlags to flow-state's init. Load codex-flow:profile-pilot when profileMode is enforce,
evidenceMode is not off, or languageMode is on; its rules replace the gates it names.
Load codex-flow:pack-game-analytics per STATE packs.
On resume, do not re-run the router: read profile, profileMode, evidenceMode, languageMode,
runLanguage, and packs from STATE.md (missing legacy keys mean off modes, - profile/runLanguage,
and - packs—no pack) and apply the same load rule.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

