agentleFS
ethosagentethosagent/ethos/skills/github/github-code-review/SKILL.md

github-code-review

Skill22 starsChanged 8 days agoMITView on GitHub

Review someone else's PR. Checks out into an isolated worktree under the repo's .ethos-work/review-worktrees/ so the user's main checkout is untouched, walks the diff, posts inline comments grouped by severity. Cleans up the worktree on completion.

52 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use V3 CLI Modernization, V3 Core Implementation and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ruvnetSkill

    V3 CLI Modernization

    CLI modernization and hooks system enhancement for claude-flow v3. Implements interactive prompts, command decomposition, enhanced hooks integration, and intelligent workflow automation.

    Also in 16 projects that use this

  • ruvnetSkill

    V3 Core Implementation

    Core module implementation for claude-flow v3. Implements DDD domains, clean architecture patterns, dependency injection, and modular TypeScript codebase with comprehensive testing.

    Also in 16 projects that use this

  • chatman-mediaSkill

    agentic-jujutsu

    Quantum-resistant, self-learning version control for AI agents with ReasoningBank intelligence and multi-agent coordination

    Also in 6 projects that use this

  • +7 more from ruvnet

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the title, body, and base branch.

    line 43
  2. Very specific:

    If a worktree at <main-repo>/.ethos-work/review-worktrees/<number> already exists from a prior run, prune-and-recreate (do not silently use …

    line 58
  3. Distinctive:

    Always remove the worktree when the review is finished.

    line 117
  4. Distinctive:

    Worktree cleanup is mandatory: Every checkout must be paired with a remove.

    line 123

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “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

GitHub Code Review

Reviewing a PR is a read-and-comment action — never modify the user's main working tree.

When to use this skill

  • The user said "review PR #123" / "look at this PR" / "code-review this".
  • The user pasted a PR URL.
  • The user is on-call to review and is going through a queue of PRs.

Step 1 — fetch metadata

gh pr view <number> --json number,title,author,body,baseRefName,headRefName,additions,deletions,files

Read the title, body, and base branch. Note the size — if additions + deletions > 1000, warn the user that the review will be slower and ask whether to focus on specific files.

Step 2 — check out into an isolated worktree

mkdir -p <main-repo>/.ethos-work/review-worktrees
grep -qxF '.ethos-work/' <main-repo>/.git/info/exclude || echo '.ethos-work/' >> <main-repo>/.git/info/exclude
gh pr checkout <number> --branch pr-<number> --recurse-submodules
git -C <main-repo> worktree add <main-repo>/.ethos-work/review-worktrees/<number> pr-<number>

The .git/info/exclude line keeps .ethos-work/ out of git status without editing any tracked file. The worktree lives inside the repo rather than under ~/.ethos: the terminal guard refuses any command that names the Ethos state dir, and read_file reaches the workspace.

The user's main checkout is never touched. All file reads in subsequent steps reference the worktree path.

If a worktree at <main-repo>/.ethos-work/review-worktrees/<number> already exists from a prior run, prune-and-recreate (do not silently use a stale worktree).

Step 3 — read project conventions

Same logic as the local code-review skill: read CLAUDE.md, AGENTS.md, .cursorrules, DESIGN.md, CONTRIBUTING.md from the worktree (the PR may have updated them).

Step 4 — walk the diff

gh pr diff <number>

For each changed file, apply the same review categories as the local code-review skill (security, quality, conventions). Tag every finding with:

  • File and line (use the post-image line number — that's what GitHub expects for inline comments).
  • Severity: critical | warning | suggestion | nit.
  • Optional: a one-line suggested change.

Step 5 — group findings

## Critical
- `<path>:<line>` — <issue>

## Warning
- ...

## Suggestion
- ...

## Nit
- ...

A nit is a stylistic preference with no impact on correctness — surface them under their own header so they are easy to skip.

Step 6 — post the review

Two posting modes; the user picks.

Inline comments (preferred for line-specific findings):

gh api -X POST /repos/<owner>/<repo>/pulls/<number>/comments \
  -f body='<comment>' -f commit_id='<head-sha>' -f path='<file>' -F line=<line>

Single review comment with the grouped findings (better for cross-cutting feedback):

gh pr review <number> --comment --body-file <findings.md>

For the review verdict (request changes vs approve vs comment-only), let the user decide. Do not auto-approve or auto-request-changes.

Step 7 — clean up

git -C <main-repo> worktree remove <main-repo>/.ethos-work/review-worktrees/<number> --force

Always remove the worktree when the review is finished. Stale worktrees accumulate fast.

Hard rules

  • Never modify the PR. This skill reads and comments. It does not push, not even formatting fixes — that's the author's call.
  • Never approve without explicit instruction. Approval is a personal endorsement; the agent does not own one.
  • Worktree cleanup is mandatory. Every checkout must be paired with a remove. Set up the cleanup as the first thing on completion, before exiting.

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.