This file provides guidance to Codex when maintaining this repository.
This repo's main artifact is a Claude Code skill package named graph-engineer,
which uses Codex as its default implementation and review worker. There is no
application code, build step, application test suite, or package manifest.
The skill lives here; supporting documentation, validation hooks, and cycle
state also exist in the repository:
skills/graph-engineer/
├── SKILL.md # the skill's instructions (source of truth)
└── references/
├── goal-templates.md # ready-to-use /goal templates per scenario
├── quality-gate-detection.md # generic quality-gate command resolver algorithm
├── elevated-assurance.md # optional opt-in multi-lens CRITIQUE variant
├── backend-selection.md # opt-in per-cycle writer/reviewer routing
├── context-lifecycle.md # scoped feature context, round history, and archival
└── sources.md # provenance: what's official Anthropic/OpenAI vs. not
Below, SKILL.md means skills/graph-engineer/SKILL.md; reference-file
basenames such as sources.md mean files in skills/graph-engineer/references/.
README.md at the repo root is the human-facing explanation of the same skill and
must stay consistent with skills/graph-engineer/SKILL.md — they describe the same
8-node cycle from two angles (marketing/usage vs. operational instructions). When
editing one, check whether the other needs a matching update (e.g. node numbering,
flag names, the anti-loop cutoff wording). Their section order is deliberately
different, though: README.md is ordered for reading (what is this → what does
the cycle look like → how do I use it → what can go wrong), while SKILL.md is
ordered for execution (node 0 through node 7 in sequence). Don't treat a
reordering of one as something that needs mirroring in the other — only the
claims need to match, not the layout.
There is no application build or test suite. Development primarily means editing
Markdown and validating documentary consistency. Keep the following consistent
across skills/graph-engineer/SKILL.md, README.md, and the reference files:
- The 8-node cycle order and names: PRE-FLIGHT → SPEC → IMPL → QUALITY GATE → CRITIQUE → DEBATE/TRIAGE → REFACTOR → VERIFY.
- The single entry point claim: every Codex interaction routes through the
codex:codex-rescuesubagent — no other/codex:*command is invoked programmatically by this skill. - The pinned plugin version (
openai-codexv1.0.6) that the routing assumptions were verified against. If that version changes,README.md,SKILL.md, andsources.mdall reference it and need to move together. Elevated assurance's fan-in barrier specifically depends on this version's--resume-lastsemantics (seesources.md's Verification method section) — a plugin update that adds resume-by-thread-ID could relax that barrier's requirements, but don't assume it without re-verifying the source.
After any non-trivial doc edit, and before committing, review the changed claims against the invariants below and the relevant source-of-truth references. From the repository root, Codex can run these supporting checks:
rtk git diff --check
rtk printf '%s\n' '{"tool_input":{"file_path":"README.md"}}' | rtk bash .claude/hooks/check-doc-invariants.sh
rtk rg -n 'elevated-write-goal:(start|end)' README.md skills/graph-engineer/references/goal-templates.mdThe hook checks pin/cycle/entry-point drift across the docs, but only warns:
inspect its output even when it exits 0. The marker search must show exactly one
start/end pair in goal-templates.md and no matches in README.md. These checks
are partial; they do not replace the semantic review of the invariants.
In Claude Code, /invariant-check dispatches the report-only
doc-consistency-reviewer, and .claude/settings.json configures Edit/Write
hooks. Its guard-goal-template-duplication.sh blocks matching README edits
with exit 2. Codex must not assume that this slash command is available or that
those Claude Code hooks run automatically for its own edits.
CLAUDE.mdandAGENTS.mdshare project facts and design invariants, but may differ in agent-specific commands and tooling. Keep shared claims consistent when both files are in scope; do not require identical wording or edit a file the user has excluded. Report any shared-rule change needing a separate update.- This repo is developed with graph-engineer itself:
PROJECT_CONTEXT.mdandPROJECT_CONTEXT.archive/are live cycle state (pointer lines carry archive sha256 hashes). Don't hand-edit them outside a cycle. Commits made by a cycle usegraph-engineer(<feature>): …; plain doc edits use conventional commits (docs(README): …).
The orchestrating Claude never edits implementation files with Edit/Write
anywhere in the cycle — the writer selected at PRE-FLIGHT does: Codex by
default via codex:codex-rescue --write, unless the user opts into a Claude
backend for that cycle. PROJECT_CONTEXT.md in the consuming repo is the
orchestrating Claude's only ordinary writable file-content artifact while the
cycle is active:
for an existing feature section, PRE-FLIGHT writes the ### Quality gate and
### Backend resolution metadata there before SPEC. For a brand-new full-cycle
feature, PRE-FLIGHT resolves those values and gives required user-facing
disclosures, then SPEC's initial section-creation write persists them with the
feature contract. In write-authorized modes PRE-FLIGHT/SPEC also finalize the
### Critique assurance resolution before IMPL — see
skills/graph-engineer/references/elevated-assurance.md and
skills/graph-engineer/references/backend-selection.md. All four are namespaced
per feature under the applicable ## <feature-name> heading, and ### Critique assurance is a
finalized resolution, not a runtime progress log — don't have any node write
intermediate elevated-assurance state (which lens finished, whether
canonicalization happened yet) to PROJECT_CONTEXT.md. Any change to SKILL.md
that would have the orchestrating Claude editing implementation files directly
breaks the reasons this skill exists: preserving Claude's context/tokens for
orchestration and judgment, reducing correlated self-review failure by putting
Claude in the arbitration path, and specializing the dispatched writer/reviewer
and the orchestrating contract/triage roles.
The sole file-content exception is terminal archival: only after VERIFY passes
(or refactor-only reaches its final DONE-clearing review), and only when
checkpoint commits were authorized, Claude may move the entire feature section
verbatim to PROJECT_CONTEXT.archive/<feature-slug>.md and replace it with the
required pointer. Both file changes must land together in the single terminal
Cycle-State: COMPLETE commit; any missing pointer/archive counterpart is a
PRE-FLIGHT stop condition, never permission to repair it automatically. See
skills/graph-engineer/references/context-lifecycle.md. This exception does not
permit writes to any other file-content path.
One narrow, explicitly scoped exception: when PRE-FLIGHT has authorized checkpoint
commits, Claude may run local git commit after a passing QUALITY GATE (node 3),
before CRITIQUE — see the "Checkpoint commit on a passing gate" paragraph there. This
writes to .git (index/objects/refs) on the current branch, never to tracked file
content, and never pushes or rewrites history. It exists because a long elevated-mode
cycle can chain many REFACTOR rounds with no restore point between them if nothing
commits until the end — don't read this exception as license for Claude to touch
implementation file content, and don't let it drift into pushing or amending history.
Related invariants worth preserving when editing SKILL.md:
- On the default
codexpath, CRITIQUE calls never pass--write— this is enforced by the underlyingcodex-companion.mjssandbox (workspace-writevsread-only), not just a prompt convention. Don't describe it as a soft/optional guarantee on that path. This includes every Codex elevated-assurance lens and the exit challenger — none of them ever pass--write. Non-Codex guarantees and mandatory mutation detection are defined inskills/graph-engineer/references/backend-selection.md. - On the default
codexpath, after the first CRITIQUE in a cycle, every subsequent CRITIQUE and normal REFACTOR call passes--resume-lastso Codex retains its own prior findings and Claude's triage decisions. The documented REFACTOR exception applies if a resumed read-only session rejects--resume-last --write: compare a before/after snapshot (untracked status, tracked diff, content hashes —git diff --checkalone doesn't prove nothing changed) and, only if they match, start a fresh non-resumed session with--writefrom the beginning instead of retrying the resume. Elevated assurance adds further exceptions to the blanket "every subsequent call resumes" rule: the initial 3 lenses are fresh, the canonicalization call after fan-in is fresh, and the exit challenger is fresh and deliberately becomes the new canonical thread on that Codex path — only the calls between those points resume as usual. Thebackend: claudeelevated path has no canonical thread or--resume-last; followskills/graph-engineer/references/backend-selection.md. - DEBATE (node 5) must classify every finding as valid / debatable / false positive — never a flat pass/fail — and false-positive rulings need one line of written justification, not silent discard. This holds under elevated assurance too: cross-lens corroboration is recorded as metadata only, never as a fourth verdict, and never as a substitute for evidence.
- The anti-loop cutoff (two consecutive CRITIQUE rounds restating the same underlying
finding with no net code change) is a signal Claude escalates to the user — it does
not by itself end a
/goal-bound turn unless the user's/goaltext includes an explicit stop/escalate clause. Don't describe it as an unconditional guarantee. - The cycle is exactly 8 nodes; elevated assurance is a variant of node 4, never a 9th node. Don't let its diagrams or wording imply a new node.
- The elevated write-authorized
/goalprompt lives in exactly one place now:goal-templates.md, still wrapped in<!-- elevated-write-goal:start/end -->markers.README.mddoes not duplicate it — it links toelevated-assurance.mdandgoal-templates.mdinstead of embedding the template. Don't re-add a copy of the prompt toREADME.md; if the template needs to change, edit it once ingoal-templates.md.
- "Graph engineering" is explicitly not an official Anthropic or OpenAI term (see
sources.md) — it's this skill's own mental-model framing for nesting Evaluator-Optimizer inside Orchestrator-Workers (both of which are real, documented Anthropic patterns). Don't imply otherwise in edits. - Don't confuse this skill with
launchdarkly/agent-skills@agent-graphs, an unrelated project about LaunchDarkly AI Configs (noted insources.md).