agentleFS
ethosagentethosagent/ethos/skills/software-development/requesting-code-review/SKILL.md

requesting-code-review

Skill22 starsChanged 8 days agoMITView on GitHub

Prepare a change for review *before* pushing the PR — pre-commit security + quality gate, lint + typecheck + test, then a self-review against the project's rules. Pairs with `code-review` (this skill teaches the requester; `code-review` is the reviewer's playbook).

  • Commits and pushes

187 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 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.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 20 projects that use this

  • math-incSkill

    heartmula

    Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.

    Also in 9 projects that use this

  • Tommy-ywSkill

    webhook-subscriptions

    Create and manage webhook subscriptions for event-driven agent activation, or for direct push notifications (zero LLM cost). Use when the user wants external services to trigger agent runs OR push notifications to chats.

    Also in 5 projects that use this

  • john-data-chenSkill

    touchdesigner-mcp

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.

    Also in 7 projects that use this

  • +3 more from Leodorareluctant259

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 5

    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. Distinctive:

    If the diff is empty, stop.

    line 51
  2. Distinctive:

    Run these in order. Each must pass before proceeding to the next.

    line 55
  3. Very specific:

    If any step fails, stop and fix.

    line 69
  4. Distinctive:

    Read the conventions sources, in this order, merging what you find:

    line 73
  5. Distinctive:

    Empty "Test plan": If you can't articulate how to verify, the reviewer can't either.

    line 127
  6. Distinctive:

    Security findings block the push: No exceptions.

    line 133
  7. Very specific:

    Frozen schema changes require the §VII ritual: If the project documents one (Ethos does), follow it — two-maintainer approval, CHANGELOG …

    line 134

“Common” is measured: kept by at least 6 in 10 of the 173 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

Requesting Code Review

The pre-flight your change goes through before a human is asked to look at it. The goal: do not waste a reviewer's time on issues a script could have caught.

When to use this skill

  • Substantial edits are complete and tests pass locally.
  • The next natural action is git push + gh pr create.
  • User said "I'm ready to push" / "self-review before I commit" / "pre-commit".

When NOT to use this skill

  • Mid-spike — code is still throwaway.
  • One-line typo fix — running the full gate is overkill.
  • The change is already on a PR and CI is running — read CI output instead.

Step 1 — capture the diff

git diff --stat                       # quick scope check
git diff --staged 2>/dev/null         # staged-only (preferred for the actual review)
git diff main...HEAD                  # branch-scoped fallback if nothing staged

If the diff is empty, stop. There is nothing to review.

Step 2 — local gates

Run these in order. Each must pass before proceeding to the next.

# 1. Typecheck — surfaces signature mistakes before behaviour
pnpm typecheck    # or: tsc --noEmit / mypy . / cargo check

# 2. Lint — auto-fix first, then verify clean
pnpm lint:fix && pnpm lint
# (substitute project-appropriate command from package.json / pyproject.toml)

# 3. Tests — only the suites your change touches, then the full sweep
pnpm test

If any step fails, stop and fix. Do not paper over with --no-verify, // @ts-ignore, or pytest -k 'not <my_failing_test>'. The failure is the signal.

Step 3 — self-review against project rules

Read the conventions sources, in this order, merging what you find:

FileRole
CLAUDE.md / AGENTS.md / .cursorrulesAgent rules for the repo
CONTRIBUTING.mdHuman-process rules
ARCHITECTURE.md / DESIGN.mdStructural / visual rules

Then read every changed file with those rules in mind. For each file in the diff:

  • Are new exports documented or intentionally kept private?
  • Does any new public API have a test exercising the happy path + at least one error path?
  • Are new error messages actionable (operator can fix without reading source)?
  • Did the change touch a frozen schema? (Check ARCHITECTURE.md §VII or its equivalent — Ethos has explicit drift-gate tests.)
  • Did unused imports, dead branches, or stale comments get removed?

Step 4 — security gate

Even when the gate is "soft", scan for the five high-impact classes:

  1. Hardcoded secrets — tokens, API keys, passwords, signing keys.
  2. Injection surfaces — string-concatenated SQL near user input; unsanitised input to a shell; dangerouslySetInnerHTML on untrusted data.
  3. Path traversal — user input concatenated into a file path.
  4. SSRF / open redirect — user-controlled URL passed to fetch without an allowlist.
  5. Authn / authz changes — anything that adjusts who can do what.

A finding here blocks the push. Rotate any secret that landed in git even briefly.

Step 5 — package the request

Once the gates are green, prepare the PR body. The reviewer should be able to act on this without re-reading every file:

## Summary
<1-3 sentences — what changed and why>

## Test plan
- <bulleted, verifiable steps — what the reviewer should check>

## Out of scope
<deliberate omissions — pre-empts the "why didn't you also fix X" comment>

## Related
<links to plan / issue / prior PR>

Title format: sentence-case, under 70 chars, imperative verb first ("Add rate limit on …", not "Adding rate limits").

Anti-patterns

  • Skipping gates because "tests pass locally". Lint and typecheck failures land in CI and waste a round-trip; catch them here.
  • Suppressing lint with // biome-ignore without a reason comment. The reason field is the contract — "intentional X" satisfies the linter; "why X is intentional" satisfies the reviewer.
  • Auto-fix without re-running tests. A fix that breaks behaviour is worse than the original lint warning.
  • PR title that's a question or status. "WIP" / "Trying something" — open as Draft instead.
  • Empty "Test plan". If you can't articulate how to verify, the reviewer can't either.

Hard rules

  • Never push with failing gates. A red local check stays red in CI.
  • Never use --no-verify to skip hooks. Hooks exist because someone got burnt; fix the root cause.
  • Security findings block the push. No exceptions.
  • Frozen schema changes require the §VII ritual. If the project documents one (Ethos does), follow it — two-maintainer approval, CHANGELOG entry, in-lockstep test update.

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.