/crosscheck:tri-planfrom Model Crosscheck
Plans features using Claude, OpenAI Codex, and Google Gemini in a three-model workflow: Claude drafts the plan, Codex and Gemini independently critique it, then Claude adjudicates and implements after user approval.
Ships in Model Crosscheck. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Feature workflow with three models: Claude drives, Codex and Gemini independently critique at two gates, the plan and (via /tri-review) the final diff. Both critics are prompted to find what the plan gets wrong, not to agree with it; a point BOTH raise independently is near-certain real.
Sibling skills.
/dual-review,/tri-reviewand the rest name the other skills in this set. Installed as the plugin, invoke them as/crosscheck:<name>; as plain copies, as/<name>. Either way their files sit next to this one, so "see /tri-review's Notes" means../tri-review/SKILL.mdrelative to this skill's base directory.
Aim: converge in at most 3 complete rounds. Extra rounds mostly come
from readings of existing behaviour the claims table never listed (step
1), owner decisions left open (OWNER-DECISION, step 3), and fixes that
break something else (step 3, "check the fix"). Lens B still reviews the
shared build harness in full until its own plan lands. History:
<shared dir>/WHY.md.
Sibling rule. Where this skill and /dual-plan, or this skill and a shared file, still differ: follow the stricter rule, report the difference to the user, and never edit a skill during a run.
Claude Code loads only this SKILL.md. Resolve <shared dir>: the absolute
path of <this skill's base directory>/../../crosscheck-shared (Claude Code states a
skill's base directory when it loads it). Write that absolute path in every
command: commands run from the target repo, where a relative path would
resolve against the repo. If the folder is missing, stop and say the
install is incomplete (README, "Install").
Before step 0, Read each of these files in full; their rules are part of this skill:
<this skill's base directory>/../../crosscheck-shared/gate.md<this skill's base directory>/../../crosscheck-shared/run.md<this skill's base directory>/../../crosscheck-shared/codex.md<this skill's base directory>/../../crosscheck-shared/gemini.md<this skill's base directory>/../../crosscheck-shared/egress.md<this skill's base directory>/../../crosscheck-shared/tiers.mdPrompt templates, in <shared dir>/prompts/
(filled per egress.md, "Prompt templates"): probe.md, plan-round0.md,
plan-preamble-codex.md, gemini-read-preamble.md, plan-lens-a.md,
plan-lens-a-close.md, plan-lens-b.md, plan-lens-b-close.md,
plan-ledger-appendix.md, standing-risks-head.md.
Gate and run folder. Run the gate check (gate.md). Create the run
folder (run.md, skill name tri-plan) and check
the user's paused directory, if they named one, for a run to resume or
an old one to ask about (run.md, "Pausing"). From the session's working directory
record <repo root> (git rev-parse --show-toplevel) and <base>
(git -C "<repo root>" rev-parse HEAD). Documents with no repo: stage the
documents in the run folder, use the run folder as <repo root> and
none as <base>, skip every git command in this skill except the
run-folder check (run.md), run the critics from the run folder with
--skip-git-repo-check on codex exec only, and re-check citations
against the staged files.
Scope the feature. Explore the codebase as usual (the repo's
CLAUDE.md or AGENTS.md rules apply). Write
<run folder>/plan.md in two passes. First: a first line naming the
version (# <title> (v<V>), a plain title with no quotes, backticks
or $), the repo root and base commit, the OWNER QUESTIONS section
(below) and the claims table. Round 0 (step 1b) checks those. Only
then add the plan itself after them (goal, files to touch, approach,
data-shape changes, risks, test plan).
One plan per risk level. If the work mixes a low-risk part (copy,
styling, docs) with a part that touches data shape, auth, tenancy,
credentials, queues or deploy, propose a split in OWNER QUESTIONS
(default: split). Each resulting plan gets the gate tiers.md gives it;
a plan skill, once running, never shortens its own review. A plan that
ships first must be safe to ship alone, and its Lens B judges that. A
critic may object to the split (or to not splitting) like any other
point.
Cross-repo impact goes in the plan. For every queue, message field,
event or API another repo consumes that the plan touches, run whatever
cross-repo search the project has (a script that searches sibling
repos, a code-search tool, from <repo root>) and record, in
the plan's risks section, each repo, file path and direction
(consumes / produces) plus any repo it could not search,
so both critics (Lens B especially) judge the real consumers. Never
paste its matched code lines, and handle the other repos' names per
egress.md.
The claims table has one row per API, function, CLI flag, config
key or credential the plan relies on, and one row per behaviour of
existing code the approach depends on: which value wins when two
sources disagree (header vs query, channel vs account), what happens on
a missing or failed read (fail open, reject, default), what a library
call returns for the actual type (for example .lean() on a Mongoose
Map), which scope a request resolves to and from where. Each row says
what is assumed and how it was checked (file:line of the definition,
--help output, the vendor's docs). Checks are read-only: read the
source, read docs, and run --help only on installed third-party CLIs,
never on the repo's own scripts (a script that ignores its arguments
simply runs). Name a credential by its identifier, never by opening its
store. A behaviour that reading cannot settle, and anything that would
call a live service, touch data, or need a credential, is marked
UNVERIFIED rather than probed, unless the user approves that specific
call or script (propose it in OWNER QUESTIONS: what it runs, what it
imports, what it can reach). The table is a set of assertions for the
critics to attack, not facts they inherit: Claude's checks share
Claude's blind spots.
OWNER QUESTIONS. If the plan touches something a specific person
is accountable for (see "A human who owns the resource", below), list
each question for them, with the safe default the plan uses until it is
answered, and mark each LOAD-BEARING (the answer could change scope,
privilege, credentials, retention or behaviour) or not. Give the list to
the user before round 0; they send it, or name the channel Claude may send
it through. Round 1 waits for the LOAD-BEARING answers unless the user
says to proceed on the defaults (a wait is a pause: run.md, "Pausing");
the others run alongside the rounds. None: write
"OWNER QUESTIONS: none".
1b. Round 0: claims pass, Codex only. Run the Codex probe (codex.md).
Freeze attempt 0 exactly as step 2 says (same snapshot command, secret
scan and checks), fill plan-round0.md with the snapshot's path into
<run folder>/a0-codex-claims.prompt.md, and launch it with codex.md's
prompted form, <dir> = <repo root>, <name> = a0-codex-claims.
Valid per step 2 (receipt PLAN: <snapshot first line>, only verdict
CLAIMS-CHECKED). Fix every WRONG row, add every missing row, then
draft the approach. Round 0 does not count toward the cap and needs no
sign-off; Gemini re-checks every row in round 1. It is Codex only
because Gemini's quota is the scarce resource, and it shows early
whether Codex is up.
Critique gate: four passes per round, in parallel, in the background. Two critics times two lenses.
Freeze the version. git -C "<repo root>" rev-parse HEAD must
still equal <base>; if not, the code moved: update the plan's base,
re-check the claims it touches, and treat it as a new version.
git -c core.fsmonitor=false -C "<repo root>" status --porcelain must
print nothing, so every critic reads exactly <base>. On a dirty tree,
stop and ask the user to commit the work the plan builds on (or to
approve the exact files Claude may commit), then use that commit as
<base>; never commit or stash it unasked. Nobody edits the repo while
a round runs. Then write the snapshot in one command:
cd "<run folder>" && umask 077 && { printf '# %s (v%s, attempt %s, nonce %s)\n' "<title>" "<V>" "<K>" "$(openssl rand -hex 4)"; tail -n +2 plan.md; } > "plan-v<V>-a<K>.md" && chmod 444 "plan-v<V>-a<K>.md" && head -1 "plan-v<V>-a<K>.md" && shasum -a 256 "plan-v<V>-a<K>.md"
PowerShell (untested):
Set-Location '<run folder>'; $nonce = -join (1..4 | ForEach-Object { '{0:x2}' -f (Get-Random -Maximum 256) }); $out = 'plan-v<V>-a<K>.md'; @("# <title> (v<V>, attempt <K>, nonce $nonce)") + @(Get-Content plan.md | Select-Object -Skip 1) | Set-Content $out; Set-ItemProperty $out -Name IsReadOnly -Value $true; Get-Content $out -TotalCount 1; (Get-FileHash -Algorithm SHA256 $out).Hash
Record the printed first line and sha256. <K> goes up by one at every
freeze and is never reused, so a void or incomplete round never
collides with an earlier read-only snapshot. The cap counts complete
rounds only; "round 2" below means the second complete round. Every
prompt names the snapshot, never the live plan.md. Secret-scan the
snapshot (run.md) before any pass starts.
Assemble each prompt in this order (one file per pass:
a<K>-codex-A, a<K>-codex-B, a<K>-gemini-A, a<K>-gemini-B):
plan-preamble-codex.md, or
gemini-read-preamble.md filled with the snapshot's path;plan-lens-a.md or plan-lens-b.md;plan-ledger-appendix.md, filled;sr-codex.md or
sr-gemini.md (built once per run, egress.md; empty files when the
user named no list);plan-lens-a-close.md or plan-lens-b-close.md,
filled. Nothing comes after it.Write parts 1 to 3 as a<K>-<critic>-<lens>.head.md and part 5 as
a<K>-<lens>.close.md with the Write tool, then join, for example:
cd "<run folder>" && umask 077 && cat a<K>-gemini-B.head.md sr-gemini.md a<K>-B.close.md > a<K>-gemini-B.prompt.md && { grep -c '<FILL:' a<K>-gemini-B.prompt.md || true; }
(Lens A joins head and close only.) It must print 0.
Launch the Gemini preflight first if it has not run (gemini.md),
then four Bash calls with run_in_background: true, noting each task
id. Both critics run from the repo, so each reads the right tree and
Codex loads its AGENTS.md:
cd "<repo root>" && umask 077 && codex exec --ephemeral --ignore-user-config -s read-only -c model_reasoning_effort="high" -o "<run folder>/a<K>-codex-<lens>.out" - < "<run folder>/a<K>-codex-<lens>.prompt.md" > "<run folder>/a<K>-codex-<lens>.log" 2>&1
cd "<repo root>" && umask 077 && agy --sandbox --model <gemini-seat> --print-timeout 25m -p "$(cat "<run folder>/a<K>-gemini-<lens>.prompt.md")" > "<run folder>/a<K>-gemini-<lens>.out" 2> "<run folder>/a<K>-gemini-<lens>.log"
A pass is valid only if its output is non-empty, its first line is
the receipt with this attempt's nonce (Codex
PLAN: <snapshot first line>; Gemini READ: <snapshot first line>),
it has exactly one Verdict: <v> line with <v> from its lens's
vocabulary, and its log has no fatal diagnostic (codex.md, gemini.md).
Anything else is a failed pass, whatever the exit code. After all four
return, recompute the snapshot's sha256, HEAD and the clean-tree check:
if any changed, the round is void, not retried; freeze a new version
and start again. A pass still running at 30 minutes is stopped per
run.md and counts as failed.
Two lenses, not one prompt. Each critic gets BOTH lenses as separate passes. Lens A asks whether the plan is right; Lens B asks whether you would let it run. They surface different defect classes, and a plan can pass A completely while failing B in ways that damage production.
From round 2 the ledger appendix carries the compact ledger and this version's change log; without it the critics re-review from scratch and the ledger cannot close. The appended text never tells a critic how to label or grade a specific point ("mark it OWNER-DECISION", "do not repeat this argument"): that is a rebuttal, and goes in the ledger as one, with its evidence.
The executable-claim check in Lens A is the highest-value single rule. A plan that says "inject the credentials at call time" against a function whose signature takes no credentials cannot run, and that is invisible to anyone reading only the plan's prose. Confirm the capability in the source, not the intent. Lens A's "verify, don't tour" line matters most for Gemini, which otherwise wanders past its timeout.
Merge and adjudicate. Dedupe the four critiques into one points
ledger, <run folder>/ledger.md (ID, critic, lens, severity, the
point, its disposition), then:
-PENDING-OWNER verdict that rested on it,
is written into the plan and its change log, and goes to every
critic, both lenses, as a normal full-plan round: a new snapshot,
the full prompts, the ledger appendix. That round is the single
allowed exception to the 3-round cap. It does not reopen closed
points (a critic may still raise a new point anywhere, including one
the ruling's edits cause). Each such ruling gets exactly one ruling
round; what it leaves open goes to the user as named decision points,
as at the cap. This holds even when the loop had already stopped.
Approval never happens with a ruling the critics have not seen.FIX-UNVERIFIED, so the critics know where to look.<ref> = <base>: the tree is clean, so
that is what the critics read).⚠️ Weigh convergence by whether the critics shared a question. Two models agreeing within the same lens were independent of each other but perfectly dependent on the prompt, so they share its blind spots. Agreement across different lenses is the strong signal, and unanimous silence on a whole category means nobody was asked about it, never "no problems there".
Converge: BOTH critics sign off on the FINAL plan, on BOTH lenses.
Every round sends the full revised plan (a new snapshot) with changes
in the change log and the ledger attached, never just the changes: an
amendment can break something elsewhere. Repeat until both return
SOUND and AUTHORIZE (or the -PENDING-OWNER forms), up to 3
complete rounds, plus any ruling rounds (step 3). Every lens runs
every round: a fix for a correctness point can open an operational
hole.
UNREVIEWED in
what the user sees, and the plan is never described as signed off while
any exists. Whether to spend a further round on it is the user's call.User approval. Present the converged plan with: what each critic
changed; a per-round table of open BLOCKER and SHOULD counts per critic
and lens, with the verdicts, marking incomplete rounds, ruling rounds
and round 0; which Gemini model ran each pass; the total critic calls
and elapsed time; every SHOULD still open, with its risk; every
OWNER-DECISION with its default, the critics' safety judgement and
the user's ruling or "not yet ruled"; every UNREVIEWED change and
FIX-UNVERIFIED entry; every [disputed] point. Run the gate check
again first (gate.md). Approval comes before any code, and not while an
OWNER-DECISION or a resource owner's gate (below) is open, nor while a
ruling that differs from a reviewed default lacks its ruling round
(step 3).
Implement. Claude writes the code (Claude holds the MCP tools, memory and the repo's rules). Neither critic edits the working tree.
Close with /tri-review, before any PR, MR or merge. Save the approved
plan in full first: cd "<run folder>" && umask 077 && cp plan.md plan-approved.md.
Invoke /tri-review on the finished diff and give it the absolute path
of plan-approved.md, so it adds the plan-trace pass (4d): the closing
review checks the diff does what was approved, nothing more, nothing
missing. If implementation will outlive this session, pause the run
with the approved plan (run.md, "Pausing") and hand that copy's path to
the closing review instead. The PR or MR description gets a summary of the
approved plan, not the claims table or the critiques.
When the run ends for any reason (closed, rejected plan, failed
critic): cleanup per run.md, delete any paused copy, and, only if the
user named a run-log file, append its line (run.md): rounds complete and incomplete, critic calls and
wall-clock minutes per pass, the final verdict per critic and lens,
open-point counts per round, the Gemini model per round. When
/tri-review or production later finds a defect the plan stage should
have caught, log it credited to the critic and lens that raised it, or
MISSED-BY-ALL.
If the plan touches something a specific person is accountable for (the
production database, the deploy pipeline, the cloud account), route it
past that person before round 1, through step 1's OWNER QUESTIONS,
not after. They ask a different question, because they are the one who
gets paged, and their review lands the operational blockers (enforced
privilege, egress exposure, retention) that correctness review does not
reach, in one pass.
Treat their sign-off as a gate, not a data point, and give them the same Lens B checklist so the ask is concrete.
If such a reviewer requires a change that contradicts the written spec or brief, do not silently pick a side: revise the plan to the safer, more reversible option, define exactly one behaviour so an unattended run is never ambiguous, and escalate the conflict to whoever owns the brief. Nothing is implemented until the user approves the revised plan (step 5).
A plan is not an implementation. When the deliverable is scripts, a runbook, or config that will run later, say plainly what remains unverifiable until it exists, and gate the real run behind a bounded dry run against the actual scripts rather than another document round.
Execute state-machine logic instead of reasoning about it. For supervisors, retry, cleanup and timeout handling and exit-code contracts, write the truth table and run it in that dry run (or earlier, as a script the user approved under step 1): such bugs have passed several model reviews and surfaced only when the code ran (WHY.md).
<this skill's base directory>/../dual-plan/SKILL.md, section
"Advanced: Codex as co-coder", and follow it unchanged; its validity rule is in
codex.md ("Co-coder run").What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
multi-model, code-review, feature-planning, ai-collaboration
7 skills in this plugin
/dual-planPlan and build a feature with Claude AND OpenAI Codex together: Claude drafts the implementation plan, Codex critiques it against the codebase, Claude merges and implements after user approval, then /dual-review gates the merge. Use when the user says "dual plan", "plan with both", "plan this with ChatGPT/Codex", or wants both models on a feature./dual-reviewDual code review: Claude writes its own blind findings on the gated top-tier model (main loop or pinned subagents; /code-review only as an extra finder) while OpenAI Codex CLI reviews the same pinned diff, then both are verified and merged into one consolidated report. Use when the user says "dual review", "review with both", "Claude + ChatGPT review", or before a merge when they want two independent reviewers./npx claudepluginhub sameerkhan/model-crosscheck --plugin crosscheckOther plugins' skills for the same job