/mycelium:codex-reviewfrom mycelium
Resolves Codex review comments on a pull request by generalizing each flagged issue into an error pattern, auditing the entire branch for similar instances, fixing them, and drafting a reply. Prevents back-and-forth review loops.
Ships in mycelium. 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.
Read when SKILL.md points to them.
Resolve bundled skills/ paths relative to the Mycelium plugin root (two
directories above this SKILL.md). Resolve repository and .living/ paths
relative to the user's working repository.
Handle Codex review comments on a pull request so that each review round actually converges instead of looping. The point is in Step 3: when Codex flags one instance of a mistake, the same mistake is usually elsewhere on the branch too. Fixing only the flagged line invites Codex to surface the next instance on its next pass, and you burn cycles fixing them one at a time. This skill fixes the flagged instance and audits the whole branch for the same error pattern.
Codex reviews a diff and flags concrete instances. It does not (and cannot
reliably) tell you "and here are the four other places you made the same
mistake." An LLM coding agent responding to that comment tends to fix exactly the
line cited and move on — which is locally correct but globally incomplete. The
result is a back-and-forth: round 1 flags foo.py:40, you fix it, round 2 flags
bar.py:88 (same bug), and so on. Generalizing each comment into an error
pattern and sweeping the branch once collapses that loop.
Resolve the pull request first:
gh pr view --json number,url,headRefName,baseRefName. If there is no PR for
the current branch, ask the user which PR they mean rather than guessing.Then auto-detect comment scope:
If the user points you to a specific comment (pastes its text, gives a
comment URL, or describes one), target that single comment. You can fetch one
comment by id with gh api repos/{owner}/{repo}/pulls/comments/{comment_id}.
Otherwise, fetch all open Codex comments on the PR and handle them in one pass. Codex posts in more than one place, so check all three:
gh api repos/{owner}/{repo}/pulls/{number}/commentsgh api repos/{owner}/{repo}/pulls/{number}/reviewsgh api repos/{owner}/{repo}/issues/{number}/commentsKeep only the comments authored by Codex, and identify Codex by its author
login — case-insensitively containing codex (the connector usually appears
as chatgpt-codex-connector[bot]). Do not accept .user.type == "Bot"
alone: other automation (Dependabot, github-actions, release bots) is also type
Bot, so matching on type would pull unrelated bot comments in as "Codex
findings" — fixing the wrong thing and, worse, becoming false evidence for the
@codex review access gate in Step 5. Treat Bot type only as a secondary hint;
if no login clearly matches Codex but there are bot comments, show the candidate
authors to the user and confirm which (if any) is Codex rather than assuming.
"Open" means not already resolved or already addressed: if the repo exposes
review-thread resolution (GraphQL reviewThreads { isResolved }), skip resolved
threads; otherwise skip any comment that already has a reply from you fixing it,
and note which you skipped.
Record the PR's {owner}/{repo} and {number} — you will reuse them when
posting.
For each Codex comment in scope, open the flagged code at its file:line and
read enough surrounding context to understand why it is wrong. Then name the
underlying error pattern, not just the literal line. Examples:
None/empty guard before indexing a lookup result"except: pass"Write the pattern down (one line each). The pattern — not the line number — is what you will hunt for in Step 3.
Apply the smallest correct change that resolves the comment, consistent with the surrounding code's style and conventions. Don't gold-plate; fix the cited issue.
For each error pattern from Step 1, search the entire branch — not just the flagged file — for other instances, and fix them all now.
baseRefName you captured in Step 0, not a hardcoded branch. A PR may target
develop, release, or master, and a fresh checkout may only have the
remote ref, so prefer the remote-tracking form: set BASE=origin/<baseRefName>
(fall back to <baseRefName> if there is no remote), then run
git diff "$BASE...HEAD" --name-only for the touched files and
git diff "$BASE...HEAD" for the changes themselves. (On a local-only branch
with no PR, diff against the repository's default branch — resolve it from
git remote show origin, don't assume main.) The patterns Codex flags are
usually concentrated in the code this branch added or changed.grep/rg/Glob using a signature that matches
the generalized mistake (e.g. for swallowed exceptions, search
except.*:\s*pass and bare except:; for hardcoded paths, search for
absolute-path string literals). Reason about each hit — do not blindly
rewrite. Guard against false positives: a construct that looks similar but is
actually correct in its context should be left alone (and is worth a one-line
note).Run the project's relevant tests and linters for the files you touched (e.g.
pytest <paths>, the repo's lint command) and confirm the flagged fix and every
audited fix pass and don't break anything else. If the project has no test
covering the changed behavior and the change is non-trivial, say so — and, when
it makes sense, add a test (TDD) that would have caught the bug Codex flagged, so
the pattern can't silently return.
Draft a reply comment that summarizes, per Codex comment:
Gate the @codex review re-trigger on Codex access. Appending @codex review to a comment only does something if the user has Codex access on the
repo, so:
@codex review to the reply so Codex re-reviews the branch
automatically.@codex review to re-trigger Codex if you have access — want me to?" and
let them decide.Posting is an outward-facing action, so show the drafted reply (and whether it
includes @codex review) and post only after the user confirms. On
confirmation:
@codex review belongs, so Codex re-reviews the
branch): gh pr comment {number} --body "<reply>"gh api repos/{owner}/{repo}/pulls/{number}/comments -f body="<reply>" -F in_reply_to={comment_id}If the user chose draft-only, hand them the reply text and stop.
If the same error pattern has now shown up across more than one Codex round (or
more than one PR), log a short entry to .living/learnings.md per the core
Post-Action Hook Protocol (Derive mitigation_type by the rule in skills/core/templates/learning-entry.md: structural if a shipped test, assertion, type constraint, frozenset, or schema validation enforces it; otherwise convention if a .living/conventions.md entry covers it; otherwise ambient-awareness.) — e.g. "Codex has flagged swallowed exceptions on three
PRs; candidate for a lint rule / convention." Recurring patterns are exactly what
should crystallize into a convention so the mistake stops being made in the first
place. Otherwise no logging is needed.
/mycelium:review./mycelium:analyze) or reports
(/mycelium:report).../review/SKILL.md — the general analysis-aware review skill; use it when
there is no Codex comment to respond to.Post-Action Hook Protocol in ../core/SKILL.md governs
what to log to .living/ when an audit surfaces a recurring pattern.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub arjunrajlaboratory/mycelium --plugin mycelium11 skills in this plugin
/analyzeRun computational analysis using the repository's registered datasets, conventions, and validation requirements. Use for clustering, PCA/UMAP, differential expression, survival or time-series models, statistical tests, sensitivity analysis, continuing prior analyses, or debugging unexpected analytical results. Do not use for merely previewing data, ingesting files, writing reports, brainstorming, repository setup, or unrelated code fixes.
/coreInitialize and maintain Mycelium living repositories. Use when the user mentions Mycelium, living repos, crystallizing learnings or findings, recording decisions or settling which past decision still binds, installing conventions, tracking todo ideas, migrating an older Mycelium project, or managing the .living knowledge layer. Do not use for report writing, generic refactoring, brainstorming, git initialization, or ordinary folder organization.
/developDevelop, refactor, or review the Mycelium plugin itself across Claude Code and Codex. Use for shared skills, plugin manifests, lifecycle hooks, installers, migrations, session accounting, shell execution detection, data lineage, or cross-host compatibility changes in the Mycelium source repository. Apply branch-wide error-pattern review, TDD, compatibility checks, and real-host smoke testing. Do not use for maintaining an ordinary Mycelium-enabled project, performing scientific analysis, or responding to an existing Codex PR comment (use codex-review for that).
/hardenShip one learning's structural_mitigation_candidate as a real test, then mark the learning's mitigation_type structural. Picks a learning in .living/learnings.md that is still ambient-awareness but names a concrete check, writes the test in the repository's own test setup, proves it fails when the learning's problem is present and passes on the current code, and updates only that entry after the user confirms. Use when the user asks to harden, enforce, or turn a learning, gotcha, or lesson into a test or structural mitigation. Do not use for recording a new learning, promoting learnings to conventions, adding checks inside analysis code, or changing Mycelium itself.
/ideasBrainstorm research ideas using installed persona and ideation conventions. Use for fresh perspectives, creative angles, new analysis directions, expert viewpoints, "what are we missing?", or other open-ended exploration. Do not use for a defined analysis, code fix, project setup, or data ingestion task.
/ingestAdd or import files and datasets into a Mycelium project with metadata, provenance, validation, and DATA_MANIFEST updates. Use for collaborator or facility outputs and formats such as CSV, FASTQ, XLSX, TIFF, JSON, FCS, TSV, or images. Do not use for analyzing existing data, listing datasets, deleting data, downloading URLs, or editing code.
Other plugins' skills for the same job