agentleFS
choi138choi138/toki/.agents/skills/codex-review-loop/SKILL.md

codex-review-loop

Skill9 starsChanged 6 months agoMITView on GitHub

Review Toki uncommitted changes, branches, or commits with path- and semantic-routed specialist lanes, normalize P0-P3 findings, and optionally fix only findings the user explicitly approves. Use when the user asks for a local code review, review loop, review-and-fix pass, re-review, or approved finding remediation in the Toki repository. Keep GitHub review submission, PR comments, push, merge, and other remote writes outside this skill.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. pawaca/dsh-edge★ 17same name
    2. yamadashy/skills★ 7same name

    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 repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 12 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run an rvw-compatible lane review, then apply the codex-lb-style approval, atomic-fix, verification, and bounded re-review loop.

    line 8
  2. Distinctive:

    Treat every review request as read-only until the user explicitly approves a write mode.

    line 13
  3. Very specific:

    Never infer permission to edit or commit from phrases such as "review this" or from a GitHub @codex review request.

    line 15
  4. Distinctive:

    Never push, submit a GitHub review, comment, resolve threads, label, merge, or otherwise mutate remote state from this skill.

    line 17
  5. Distinctive:

    Treat local usage logs, databases, audit findings, prompts, transcripts, and credentials as sensitive.

    line 21
  6. Very specific:

    Treat this section as the contract a finding is measured against: report a finding when it breaks an invariant below, and classify it …

    line 31
  7. Very specific:

    Only trusted executables run.

    line 46
  8. Very specific:

    No repository-configured program executes.

    line 49
  9. Distinctive:

    Every scope fails closed. A submodule, embedded repository, escaping symlink, non-UTF-8 path, or unbounded inventory marks the scope unsafe …

    line 55
  10. Distinctive:

    Add a regression test with every change that touches an invariant, and name the invariant in the test.

    line 66
  11. Very specific:

    Use --uncommitted for staged, unstaged, and untracked changes.

    line 90
  12. Very specific:

    Use --base <branch> for the current branch relative to a base branch.

    line 91
  13. Very specific:

    Use --commit <sha> for one commit.

    line 92
  14. Distinctive:

    Prefer an exact scope named by the user.

    line 94
  15. Very specific:

    Stop before invoking Codex when safeToReview is false or hasChanges is false.

    line 106
  16. Very specific:

    Always read the common reviewer prompt and baseline lane.

    line 112
  17. Distinctive:

    Treat lane activation as additive.

    line 116
  18. Distinctive:

    Run the baseline lane and every activated specialist lane:

    line 121
  19. Distinctive:

    Treat "Fix P0/P1 only" as a valid selection.

    line 161
  20. Very specific:

    Use apply_patch for the narrow fix.

    line 172
  21. Distinctive:

    Run the smallest verification profile that can prove the finding fixed.

    line 173
  22. Distinctive:

    If verification fails, reverse only the patch introduced for that finding.

    line 175
  23. Very specific:

    After approved fixes, rerun baseline plus only lanes affected by the fix.

    line 185

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Toki Codex Review Loop

Run an rvw-compatible lane review, then apply the codex-lb-style approval, atomic-fix, verification, and bounded re-review loop.

Core Contract

  • Treat every review request as read-only until the user explicitly approves a write mode.
  • Never infer permission to edit or commit from phrases such as "review this" or from a GitHub @codex review request.
  • Never push, submit a GitHub review, comment, resolve threads, label, merge, or otherwise mutate remote state from this skill.
  • Preserve unrelated staged, unstaged, and untracked changes. Never use git reset, git checkout, or broad restoration to undo a finding fix.
  • Treat local usage logs, databases, audit findings, prompts, transcripts, and credentials as sensitive. Do not print raw matched diff content.
  • Apply project-conventions and read its task-specific references before fixing Toki source, tests, resources, or project configuration.
  • Apply .agents/conventions/git-workflow.md before any commit. A commit requires explicit user authorization separate from review authorization.

Trust Boundary

Scope resolution runs before any review and must survive a hostile repository. Treat this section as the contract a finding is measured against: report a finding when it breaks an invariant below, and classify it wont_fix with this section as the reason when it only restates a non-goal.

Untrusted Inputs

  • Repository file contents and tree layout, including untracked and ignored paths.
  • Repository Git configuration: .git/config, .gitattributes, .gitmodules, and any configured hook or helper program.
  • The inherited PATH and every GIT_* environment variable.
  • Lane result JSON, including every path and line number it reports.

Enforced Invariants

  1. Only trusted executables run. git and the review binary resolve from the platform default path, never from an inherited PATH, and the runner narrows PATH before invoking any external command.
  2. No repository-configured program executes. Content filters, textconv, external diff, core.fsmonitor, core.hooksPath, and lazy fetch are overridden to inert values or the scope is refused.
  3. Workspace confinement is derived from the filesystem, not from Git. The inventory walks the real tree from the repository root and validates every symbolic link target, so ignore rules and index modes cannot hide a path.
  4. Every scope fails closed. A submodule, embedded repository, escaping symlink, non-UTF-8 path, or unbounded inventory marks the scope unsafe and stops before Codex is invoked.
  5. Paths keep byte fidelity across process boundaries. Roots and path lists cross as NUL-terminated data and are never trimmed.
  6. Reported findings are untrusted data. A finding path must be repository-relative, free of NUL, and free of empty, current, or parent segments before it is used.
  7. The baseline lane is always on. A registry that marks it otherwise is rejected.

Add a regression test with every change that touches an invariant, and name the invariant in the test.

Non-Goals

  • Sandboxing the host. This skill reduces what executes during review; it does not isolate a repository the user already chose to open.
  • Restricting native review to the reviewed diff. codex exec review may read other in-repository files by design, so confinement is to the repository root, not to changedPaths.
  • Content-level secret detection inside reviewed changes. Exclusion is by path pattern only.
  • Supporting attacker-chosen repository root paths, such as sibling names that differ only by trailing whitespace. Exact roots are preserved, but the user is assumed to name their own repository.
  • Byte-exact handling of non-UTF-8 paths. Such scopes are refused, not supported.

Workflow

1. Resolve One Review Scope

Choose exactly one scope:

  • Use --uncommitted for staged, unstaged, and untracked changes.
  • Use --base <branch> for the current branch relative to a base branch.
  • Use --commit <sha> for one commit.

Prefer an exact scope named by the user. Do not fetch or change branches merely to infer a scope.

Run the resolver:

python3 .agents/skills/codex-review-loop/scripts/resolve_review_scope.py \
  --repo . \
  --uncommitted \
  --pretty

Stop before invoking Codex when safeToReview is false or hasChanges is false. Excluded sensitive paths make the scope unsafe because codex exec review --uncommitted cannot exclude individual paths.

2. Load Only Activated Review Rules

Always read the common reviewer prompt and baseline lane. Read only the specialist lane files named by activatedLanes. Also read the finding schema and verification reference before reporting or fixing findings.

Treat lane activation as additive. Never disable baseline correctness or security reasoning merely because a path pattern did not match.

3. Run One Pass Per Activated Lane

Run the baseline lane and every activated specialist lane:

.agents/skills/codex-review-loop/scripts/run_review_lane.sh \
  --repo . \
  --lane baseline \
  --base main

The runner passes bounded lane instructions through Codex developer_instructions, uses the structured-output schema, requests an ephemeral Codex session, and refuses inactive or unsafe lanes. Run lanes sequentially by default. Do not add replicated reviewers or an adjudicator unless the user explicitly expands the workflow.

4. Validate And Merge Findings

Capture each lane's JSON result in a temporary directory, then merge:

python3 .agents/skills/codex-review-loop/scripts/merge_findings.py merge \
  /tmp/toki-review/baseline.json \
  /tmp/toki-review/remote-sync.json

Reject malformed results. Conservatively merge overlapping findings with a similar root cause, retain every contributing lane, use the highest priority, and surface materially conflicting priority opinions.

5. Report Before Writing

Present the normalized findings with ID, priority, confidence, location, impact, suggested fix, and verification plan. Then request one explicit mode:

  1. Report only.
  2. Fix selected findings without commits.
  3. Fix all actionable findings without commits.
  4. Fix selected findings and create one verified commit per finding.
  5. Fix all actionable findings and create one verified commit per finding.

Treat "Fix P0/P1 only" as a valid selection. For a P0/P1 fix that changes existing product behavior rather than restoring clearly intended behavior, describe that behavior change and obtain a second confirmation.

6. Fix One Finding At A Time

Before each fix:

  1. Re-read the affected code and relevant project-conventions references.
  2. Inspect git status and the affected diff.
  3. Record the pre-fix state of only the files or hunks that will change.
  4. Use apply_patch for the narrow fix.
  5. Run the smallest verification profile that can prove the finding fixed.

If verification fails, reverse only the patch introduced for that finding. If that boundary cannot be proven, stop and report the failure instead of risking the user's work.

For --uncommitted reviews, default to no commits. Create atomic commits only when the user explicitly selects a commit mode and the new fix can be separated from pre-existing changes without staging unrelated hunks.

7. Re-review With A Bound

After approved fixes, rerun baseline plus only lanes affected by the fix. Stop after three total review rounds. If the same root cause returns in two consecutive rounds, mark it wont_fix with the reason instead of looping.

Count externally triggered rounds against the same bound. A pushed branch can re-request review automatically, so a GitHub @codex review round is a round here too.

Fix at the invariant, not at the reported case. When a finding names one variant of an invariant in the trust boundary, audit every other variant of that same invariant locally and fix them together in one change. Repairing only the reported case is what turns one finding into a new round, because the next round reports the next variant. Before pushing, state which invariant each fix restores and which adjacent variants were checked.

8. Finish With A Local Report

Report:

  • Review scope and activated lanes.
  • Findings fixed, skipped, wont_fix, or left for reporting only.
  • Verification commands and outcomes.
  • Commits created, if explicitly authorized.
  • Remaining risks or unverified checks.

State explicitly that no push or GitHub write occurred.

Reference Map

  • Common contract: reviewer.md
  • Lane registry: lane-registry.json
  • Finding schema: review-findings.schema.json
  • Verification profiles: verification.md
  • Baseline: baseline.md
  • Usage and pricing: usage-pricing.md
  • Privacy and security: privacy-security.md
  • Remote sync: remote-sync.md
  • Concurrency and lifecycle: concurrency-lifecycle.md
  • SwiftUI architecture: swiftui-architecture.md
  • Build and portability: build-portability.md
  • Testing: testing.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.