review-loop-ca3c4f — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited review-loop-ca3c4f (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Codex Stage 1 review-loop is an orchestrator prompt. You are the orchestrator. Do not do the planning or coding in the main thread. Coordinate the Executor and Reviewer backends, keep the user informed of review findings, and keep the shared .review-loop session file accurate.
This is the umbrella skill. For finer-grained control, see:
.agents/skills/plan/SKILL.md — planning phase only..agents/skills/execute/SKILL.md — three entry modes (--session,--plan, --review-only), --stop-after, multi-batch delivery.
The umbrella preserves the original end-to-end UX: detect prior state (plan-exists / code-exists / fresh) and run the planning + execution loops in sequence. entry_point: review-loop is written to the session metadata.
The Orchestrator MUST Read each of these files at start. They are the single source of truth for this skill's planning loop, execution loop, session schema, and output schemas.
docs/protocol/session-file.mddocs/protocol/planning.mddocs/protocol/execution.mddocs/protocol/executor-output.mddocs/protocol/reviewer-output.mdDo not re-derive any rule that already lives in a protocol doc. When a step below says "see docs/protocol/<doc>.md §Foo", follow that doc verbatim. The startup read set is complete only after all 5 docs above have been read explicitly; embedded executor/reviewer prompt bodies are not a substitute for reading executor-output.md and reviewer-output.md.
review-loop (umbrella), plan (planning sub-skill),execute (execution + polish + delivery sub-skill), guide, shared .review-loop/config.md, shared .review-loop/sessions/*.md, Claude CLI default reviewer, Codex fallback reviewer, shared reviewer schema, Stage 1 hallucination guards.
code-quality-loop, review-pr, reorganize, plugin packaging,Stage 2 behavior, concurrent writers to one session file. Codex Stage 1 follows the same broad exec -> polish -> docs -> security -> delivery lifecycle.
.review-loop/sessions/{uuid}.md.review_loop_executor never writes the session file directly.review_loop_reviewer never writes the session file directly.the required task context directly. Do not rely on inherited or forked parent thread context.
Otherwise create a new session with a new UUID.
## Current Phase and existing unresolved state.
not overwrite accumulated ## Review History as if the session were new.
At entry-point detection, immediately after Runtime Identity is resolved and Config Loading has populated the runtime fields, print the following banner once. This block is pure UX — it does not change reviewer dispatch, schema validation, or completed_stages minting.
── review-loop: Starting ──────────────────────────
Work item: {title}
Problem: {problem_description}
Reviewer backend: {claude-cli ({reviewer_model | judgment_model | claude-sonnet-4-6}) | codex (review_loop_reviewer / {codex_reviewer_model})}
Mode: {interactive | handsfree}
Soft limit: {soft_limit_plan} (plan) / {soft_limit_exec} (exec)
{if `## Historical Context` was populated by the plan sub-skill: Historical context: {N} relevant memories loaded}
────────────────────────────────────────────────────Print this banner once per session, immediately after entry-point detection and before the first sub-skill dispatch. Do not reprint on sub-skill resume or per-round dispatch.
The Reviewer backend row uses backend-appropriate labels resolved per §Config Loading: the claude-cli branch shows the model resolved through the reviewer_model | judgment_model | claude-sonnet-4-6 chain; the codex branch shows the local Codex reviewer agent name plus codex_reviewer_model. Codex Stage 1 ignores the shared reviewer config key for backend selection (per §Config Loading), so the banner does not surface that key.
Note on the Historical context row: the umbrella does not run Step 1.6 inline. The plan sub-skill at .agents/skills/plan/SKILL.md Step 1.6 owns historical-context retrieval, and resume-dedup keeps end-to-end behavior at exactly 1 fetch per session. The umbrella surfaces the count in the banner only when ## Historical Context has already been populated by that sub-skill before the banner is rendered (e.g. on resume); otherwise the row is omitted.
review_loop_executor andreview_loop_reviewer during the session.
spawn_agent call, call close_agent on any completed Codex subagent id from earlier planning, execution, or local-reviewer rounds unless the orchestrator explicitly intends to reuse that exact id.rejected, and any information needed for the session-file update, retry decision, or user-facing failure report has been copied into orchestrator-owned state.
finishes, close the completed Executor and local Reviewer subagents for that round before spawning the next agent or moving to the next phase.
prompt file immediately after the command returns.
update naming the cleanup count. Do not add cleanup details to the session file unless they affect the round result.
review-loop entry point, do not deliver, summarize success, or stop after the execution loop mints only exec; continue through Quality Polish, Documentation Consistency, Security Preflight, and delivery unless an explicit --stop-after value says otherwise.exec stage. It is nota terminal success state for the umbrella command unless the caller asked for --stop-after exec-round or --stop-after before-polish.
{exec, polish, docs, security} ⊆ completed_stages. If any downstream stage is missing, continue running the missing stage or set delivery_blocked_by instead of reporting completion.
.review-loop/config.md if present. If it is absent, use Stage 1defaults.
reviewer_model, judgment_model,cheap_model, soft_limit_plan, soft_limit_exec, handsfree, review_focus, quality_focus, review_style, and skip_quality_polish.
reviewer key to choose the reviewer backend in Codex.In Codex Stage 1, reviewer selection is controlled only by the runtime default and optional Codex-only keys.
codex_reviewer_backend: codex is present, skip the Claude path and usethe local Codex reviewer directly.
reviewer_model applies only to the Claude CLI reviewer path.judgment_model is the shared-tier fallback for that Claude CLI reviewerpath before the explicit claude-sonnet-4-6 backstop.
cheap_model is accepted in shared config but is a documented no-op inCodex Stage 1 because Stage 1 currently ships no cheap-tier Codex agents.
quality_focus applies only when Step 3.5 Quality Polish actually runs.skip_quality_polish: true mints polish as a no-op completion and still continues through docs and security.codex_reviewer_model applies only to the local Codex reviewer path.executor_model is ignored by the Codex runtime in Stage 1.codex_executor_model is reserved only and ignored in Stage 1.judgment tier. If a tier is omitted,treat it as judgment.
.review-loop/sessions/{uuid}.md..review-loop/tmp/{uuid}-reviewer-prompt.txt.
{session_id} when a reviewer prompt path or commandrefers to {session_id}.
.review-loop/tmp/{uuid}-reviewer-prompt.txt immediately after theClaude command returns.
## Problem Description## Context## Acceptance Criteria## Current Phase## Approved Plan## Review History## Files Changed## Key Related Files## Timing Log## Session Metadata as the final section in the file.Review History is logically append-only, but rewrite the full accumulatedsection each time.
Timing Log is logically append-only, but rewrite the full accumulatedsection each time.
Files Changed must reflect the latest known state after each Executor round.Key Related Files should list important task-relevant files that inform thework but were not changed in the latest accepted round, and refresh that list when the relevant context changes.
Session Metadata in full on each orchestrator update, and keep itlast.
schema. In particular, never substitute custom keys such as completed_at for lifecycle fields like completed_stages.
Use a final metadata block like:
## Session Metadata
- session_origin: codex-skill
- orchestrator_backend: codex
- executor_backend: codex-subagent
- reviewer_backend: claude-cli
- reviewer_fallback_used: falseThe example values above are illustrative. Replace them with the current session snapshot values. ## Session Metadata is session-level metadata only: it reflects the latest reviewer backend used for the current session snapshot and does not replace per-round reviewer-backend recording in ## Review History.
Planning rounds must use this exact structure:
## Solution Plan: {title}
### Problem Analysis
...
### Proposed Approach
...
### Implementation Steps
1. ...
2. ...
### Files to Modify / Create
- `path/to/file.ext` - reason
### Risks & Assumptions
- ...
### Open Questions
- ...Execution rounds must use this exact structure:
## Implementation Complete: {title}
### Changes Made
...
No code changes were required for this round.
### Files Modified / Created / Deleted
- `path/to/file.ext` - what changed
None
### Deviations from Plan
None
### Notes for Reviewer
...
No-op round. The approved plan and current code already satisfy this step.Rules:
review_loop_executor for planning rounds using a fresh,self-contained prompt that includes the work item, relevant session content, and the required planning schema directly in the subagent call.
review_loop_executor for execution rounds using a fresh,self-contained prompt that includes the approved plan, relevant session content, unresolved review issues, and the required execution schema directly in the subagent call.
codex_execution_executor_dispatch. The Codexexecution-phase Executor remains a judgment-tier local agent.
invalid under the Executor guard, reject it instead of guessing.
failure to the user.
All reviewer backends must return the shared Stage 1 reviewer schema:
### VERDICT: [APPROVE | REQUEST_CHANGES]
### Issues
- [CRITICAL] <description> - must be resolved before proceeding
File: `path/file.ext`, around line N
- [MINOR] <description> - recommended improvement
- None.
### Strengths
...
### Questions
- ...Rules:
APPROVE and REQUEST_CHANGES.[CRITICAL] and [MINOR]. Any otherseverity label is invalid reviewer output.
### Strengths is always required.### Issues may be omitted only when there are no issues.### Issues is present with no issues, it must contain exactly - None..no issues found or localized freetext equivalents inside ### Issues.
### Questions may be omitted only when there are no questions.APPROVE with no ### Issues section is valid.APPROVE with ### Issues containing exactly - None. is valid.REQUEST_CHANGES with no ### Issues section is invalid.REQUEST_CHANGES with ### Issues containing exactly - None. is invalid.APPROVE with any[CRITICAL] issue and REQUEST_CHANGES with only [MINOR] issues.
The umbrella runs the planning loop per docs/protocol/planning.md §Round loop. The operational details (session-file initialization, work-item parsing, per-round dispatch, schema validation, exit criteria) are the same as .agents/skills/plan/SKILL.md §Step 0 through §Step 3. Use that skill body as the procedural reference; this umbrella adds only the umbrella-level rules:
acceptance criteria. Write those values into the session file before the first planning round.
## Current Phase to planning.review_loop_executor andrequire the exact planning schema above.
## Approved Plan until a reviewer returnsa valid APPROVE.
## Review History and ## Timing Log.Record which reviewer backend (claude-cli or codex) was used.
soft_limit_plan is reached and blocking issues remain, surfacethe situation to the user instead of silently continuing or silently stopping. Respect the configured plan soft limit, but do not bypass review validation.
The umbrella runs the execution loop per docs/protocol/execution.md §Step 3. The operational details (drift check, round loop, provenance-aware reviewer prompts, no-op validation, stage minting, Quality Polish, Documentation Consistency, Security Preflight, Delivery) are the same as .agents/skills/execute/SKILL.md §Step 2 through §Step 4. Use that skill body as the procedural reference; this umbrella adds only the umbrella-level rules:
## Current Phase to execution.context to review_loop_executor and require the exact execution schema above.
session. Executor-created hidden worktrees are forbidden in Codex Stage 1.
Use it for file-presence validation and to help derive the current-round delta, but unchanged path sets alone do not prove a no-op.
file set. Compare the Executor's claimed file changes against the current-round delta attributable to that round, using the pre-round and post-round state, not just whether a file is dirty after the round.
explicit Executor self-report and no meaningful delta attributable to the current round. Same path sets alone are not enough.
execution schema: ### Changes Made states that no code changes were required, ### Files Modified / Created / Deleted is None, and ### Notes for Reviewer identifies the round as a no-op.
## Files Changed. Reject the result if the Executor claims changes that cannot be tied to a meaningful current-round delta.
## Files Changed from the actual accepted state, not fromguesswork.
## Review History and ## Timing Log.Record which reviewer backend (claude-cli or codex) was used.
APPROVE, run Step 3.4 before Step 3.5if the terminal gate has not yet run in this execution convergence. Step 3.4 is single-pass per execution convergence. Do not mint exec yet. Step 3.4 APPROVE or controlled SKIP mints exec into completed_stages in ## Session Metadata per the shared session-file lifecycle. Step 3.4 REQUEST_CHANGES withholds exec and feeds the gate findings into ordinary Step 3 Executor/Reviewer repair rounds; do not run Step 3.4 again while repairing those findings. A later normal Step 3 reviewer APPROVE after those repairs mints exec. This applies to both edit rounds and reviewed no-op rounds.
as completed_at; the shared protocol completion state is carried by completed_stages and related baseline metadata.
soft_limit_exec is reached and blocking issues remain, surfacethe situation to the user instead of silently continuing or silently stopping. Respect the configured execution soft limit, but do not bypass review validation.
Unless codex_reviewer_backend: codex is set, use this default reviewer path:
claude -p --no-session-persistence --output-format stream-json --include-partial-messages --model {reviewer_model if set; else judgment_model if set; else claude-sonnet-4-6} < .review-loop/tmp/{session_id}-reviewer-prompt.txtRules:
claude -p rehearsal as representative of thisreviewer path. If the command fails inside the sandbox, rerun the same command outside before declaring the Claude reviewer path unhealthy or switching to fallback.
.review-loop/tmp/{session_id}-reviewer-prompt.txt.
where type == "result" and use its result field as the reviewer output. Intermediate events (thinking deltas, assistant blocks, rate limit events) are heartbeat signals confirming the process is alive — log them if helpful but do not treat them as output. If no type == "result" line appears before the process exits, treat that as a command execution failure.
result field against the shared reviewer schema.Claude for that round.
summary in ## Review History. Include whether the failure was command execution, JSON parsing, missing result, or reviewer schema validation.
codex_reviewer_backend: codex is not set, surface that Claude-pathfailure to the user instead of auto-falling back. The default Stage 1 reviewer separation policy keeps review on the outside-sandbox Claude path unless the user explicitly opts into the local Codex reviewer.
When the orchestrator decides to dispatch N>1 independent reviewer rounds in the same wall-clock window (for example a polish-stage parallel sweep), shell out once to the conflict-aware parallel scheduler in scripts/review_verification.py instead of looping the single-shot path serially. N=1 dispatch keeps the single-shot invocation above byte-identical — argv, stdin handoff, model resolution, and temp-file lifecycle are unchanged.
Build <jobs.json> as a JSON list of objects with one entry per reviewer round, matching the schema accepted by _load_jobs in scripts/review_verification.py:
session_id (required) — current session uuidjob_id (required) — orchestrator-stable identifier unique within theround; used as the per-job prompt-file discriminator
runtime (optional, default "codex") — leave at "codex" for theCodex Stage 1 claude -p shell-out path
prompt_text (required for non-empty dispatch) — the full reviewerprompt body, identical to what would be rendered into .review-loop/tmp/{session_id}-reviewer-prompt.txt in the single-shot path
reviewer_model — resolved via the same shared model-tier rule used bythe single-shot path: reviewer_model if set; else judgment_model if set; else claude-sonnet-4-6 (per docs/protocol/planning.md §Shared model-tier contract)
timeout_secs (optional, default 300.0)conflict_keys, capacity_keys, extra_argv, worktree (optional;omit unless overriding scheduler defaults)
Inline prompt_text directly in the JSON object — do not write per-job prompt files yourself; the scheduler renders each job's prompt_text to .review-loop/tmp/{session_id}-reviewer-prompt.{job_id}.txt internally and hands the FD to the spawned claude -p via stdin redirection (per scripts/review_verification.py:457-459 Scheduler docstring and :648-651 _run_one). For runtime: "codex" jobs (the Codex Stage 1 fan-out path documented in this section), per-job stdout is captured by the scheduler via subprocess.PIPE and surfaced through each <results.json> entry's stdout field — there is no per-job output file. For runtime: "claude_code" jobs (the Claude-Code orchestrator's codex exec -o fan-out, not used here), per-job stdout is written to .review-loop/tmp/{session_id}-reviewer-output.{job_id}.txt.
Invoke the scheduler outside the sandbox:
python3 scripts/review_verification.py --jobs .review-loop/tmp/{session_id}-jobs.json --output .review-loop/tmp/{session_id}-results.json
<results.json> is a JSON list of objects, one per job, each carrying job_id, returncode, stdout, stderr, timed_out, parsed_verdict, parsed_issues, and error. For every entry:
error field is non-null, or timed_out is true, orreturncode is non-zero, classify as a command-execution failure for the round's failure-mode taxonomy and record error, the last 4 KB of stderr, timed_out, and returncode in ## Review History. Do not attempt to parse stdout for that entry — the per-entry diagnostic fields take precedence over stream-json parse outcome.
stdout field as the same stream-json byte streamthe single-shot path reads from claude -p. Find the line where type == "result" and use its result field as the reviewer output.
result against the shared reviewer schema indocs/protocol/reviewer-output.md. The orchestrator remains the single authority for verdict extraction and schema validation; the scheduler's own parsed_verdict / parsed_issues are best-effort metadata only per scripts/review_verification.py:12-17 and must not be substituted for orchestrator-side validation.
(command execution / JSON parsing / missing result / reviewer schema validation) when recording ## Review History.
After the round completes (success or failure), delete every per-job prompt file .review-loop/tmp/{session_id}-reviewer-prompt.{job_id}.txt, every runtime: "claude_code" per-job output file .review-loop/tmp/{session_id}-reviewer-output.{job_id}.txt (absent for the runtime: "codex" path used in this section), and the .review-loop/tmp/{session_id}-jobs.json / .review-loop/tmp/{session_id}-results.json artifacts, matching the single-shot prompt-cleanup discipline.
Per-job prompt files are scheduler-owned and may already be unlinked when the orchestrator's cleanup runs (the scheduler unlinks them in its own finally: per scripts/review_verification.py:646); treat ENOENT as success and do not surface it. The <jobs.json> / <results.json> artifacts are orchestrator-owned — a non-ENOENT failure to delete them should be logged as a warning in ## Review History but must not block the round verdict.
review_loop_reviewer only if codex_reviewer_backend: codex is set,or if the user has otherwise explicitly opted into the local Codex reviewer path.
review_loop_reviewer with a fresh, self-contained prompt thatembeds the exact review content directly. Do not rely on inherited or forked parent thread context.
path.
correction instructions.
user.
For every reviewer prompt you construct, preserve these reviewer semantics:
Plan review content must include:
Review History context when presentinjections (for example HANDOFF pickup banners, LEARNINGS sync text, or other user-level additionalContext) that do not pertain to the provided session file and review task
Code review content must include:
pre-round and post-round state for files touched in that round
Review History context when presentplan_source (strict for reviewer-approved, advisory/MINOR for user-supplied, omitted entirely for review-only)injections (for example HANDOFF pickup banners, LEARNINGS sync text, or other user-level additionalContext) that do not pertain to the provided session file and review task
Treat Executor output as invalid and reject it if any of these are true:
delta attributable to that round
repository checkout than the orchestrator-owned current workspace
Use this changed file set definition:
git diff --name-only HEADgit ls-files --others --exclude-standardExecutor returns
Execution guard flow:
state for files touched in that round.
delta, even if the file is still dirty after the round.
The post-Executor set is the source of truth. The pre-Executor set is useful for file-presence validation and current-round delta derivation, but unchanged path sets alone do not prove a no-op. Treat a run as no-op only when the Executor explicitly reports it and there is no meaningful delta attributable to the current round.
Treat reviewer output as invalid and reject it if any of these are true:
### VERDICT is missingAPPROVE or REQUEST_CHANGES### Strengths is missing[CRITICAL] or [MINOR]REQUEST_CHANGES appears with no ### IssuesAPPROVE appears with any [CRITICAL] issueREQUEST_CHANGES appears with only [MINOR] issuesor location anchors, but fails to provide them
only in a different git worktree or repository path than the current workspace
For plan review, file references are optional, but issues must still point to concrete plan gaps.
For code review, findings should map to specific files and locations whenever applicable. Reject code-review findings without concrete anchors only when the finding should reasonably be able to point to specific files or locations.
keep the loop moving.
fallback path defined above.
.review-loop protocol.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.