analyze-code
CommandAnalyze code quality, identify issues, and suggest improvements.
Review a community-contributed PR for safety, correctness, and adherence to Nimbalyst rules
> /plugin marketplace add nimbalyst/nimbalyst> /plugin install nimbalyst-wiki@nimbalyst
name: review-contribution description: Review a community-contributed PR for safety, correctness, and adherence to Nimbalyst rules
Review a community-contributed PR and answer one question: **is there anything that blocks merging?** Non-blocking improvements get a brief mention so the maintainer can clean them up post-merge -- they do not belong in the response to the contributor.
This review runs **entirely from the GitHub API** via `gh`. The user's current working directory is off-limits.
**Forbidden** -- never run, even "just to look":
**Allowed** -- read-only only:
If the maintainer has uncommitted changes or is on a feature branch, **do not care** -- the review does not depend on working-directory state and must not modify it.
`/review-contribution <PR# | PR URL>`
A PR identifier is **required**. If the user runs `/review-contribution` with no argument, ask for a PR number or URL.
Call `update_session_meta` once at the start with `phase: "planning"` and leave it there for the whole review:
update_session_meta({ name: "PR #<number> contribution review", add: ["review", "github-pr"], phase: "planning" })Reading someone else's code and deciding what to do about it is exploration, and this command writes no code of its own. `validating` means **we** made a change and are now testing it -- a session that has edited nothing has nothing to validate. Two specific traps:
If the review turns into actual work -- the maintainer asks you to fix the PR's problems yourself in a worktree -- that is when the phase moves to `implementing`, and `validating` only once you are testing those edits.
gh pr view <pr> --json number,title,author,body,headRefName,baseRefName,headRepositoryOwner,additions,deletions,changedFiles,labels,state,mergeable,mergeStateStatus,reviewDecision,files,commits,isCrossRepository gh pr diff <pr> gh pr checks <pr>
For larger PRs you can pull per-file patches via `gh api repos/{owner}/{repo}/pulls/{pr}/files` -- still read-only.
Capture only what feeds the verdict: author type, cross-repo / fork status, CI status, file count, lines changed. If CI is failing, look at the failing job log to decide whether it's caused by this PR or pre-existing main breakage -- this matters for the verdict.
`mergeable: CONFLICTING` / `mergeStateStatus: DIRTY` on its own says nothing about severity. A `CHANGELOG.md` conflict is expected on almost every contribution -- every merged PR adds a bullet to `[Unreleased]`, so any PR that also adds one conflicts. The maintainer fixes that in seconds at merge time.
Determine the likely conflict set read-only, without checking anything out:
# merge base of the PR
gh api repos/{owner}/{repo}/compare/<baseRefName>...<headRefName> --jq '.merge_base_commit.sha'
# files main changed since that merge base
gh api repos/{owner}/{repo}/compare/<mergeBaseSha>...<baseRefName> --jq '.files[].filename'Intersect that list with the PR's changed files. The intersection is the set of files that *can* conflict.
# PR-side hunks for the file
gh api repos/{owner}/{repo}/compare/<mergeBaseSha>...<headRefName> --jq '.files[] | select(.filename=="<file>") | .patch' | grep '^@@'
# main-side commits touching it since the merge base, then that commit's hunks
gh api "repos/{owner}/{repo}/commits?path=<file>&sha=<baseRefName>&since=<mergeBaseDate>" --jq '.[].sha'
gh api repos/{owner}/{repo}/commits/<sha> --jq '.files[] | select(.filename=="<file>") | .patch' | grep '^@@'Ranges more than 3 lines apart (git's context size) merge cleanly. If every non-`CHANGELOG.md` file in the intersection clears this check, the conflict is CHANGELOG-only -- apply the rule above. Otherwise it's a real review finding and feeds the verdict as usual.
Caveat: `compare` truncates at 300 files an
Nimbalyst - The open-source visual workspace for Claude Code, Codex, and OpenCode. Run multiple coding agents in parallel, edit their work visually in markdown, mockups, and diagrams, and track tasks. Free, MIT-licensed desktop app for macOS, Windows, Linux, with mobile companion for iOS and Android.
Analyze code quality, identify issues, and suggest improvements.
Audit recent AI coding sessions to find repeated mistakes, speed losses, and missed Nimbalyst tool usage — then propose harness…
Triage pnpm audit findings and produce a prioritized, supply-chain-cautious package-update plan, then apply approved batches
Survey recently triaged GitHub issues, propose the ones safe to fix without a product decision, and fan the selected ones out to…
Gather details and draft an actionable bug report for developers.
Shortcut for "continue working" — pick the work in flight back up exactly where it stopped and keep going until it is done or…