agentleFS
tsubasaogawatsubasaogawa/skills/ai-credit-efficient-review/SKILL.md

ai-credit-efficient-review

Skill0 starsChanged 32 days agoMITView on GitHub

Review a PR, branch diff, or changed files while spending AI Credit efficiently. Use when the user asks for a cheaper, lightweight, or major-issues-only review, e.g. 'AI Credit を節約しつつレビューして', '軽めにレビューして', '重大な問題だけ見て'. Not for a full exhaustive review or when a dedicated /review workflow is already in effect.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 18 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to a two-stage review:

    line 16
  2. Distinctive:

    Selective deepening: only on the files or behaviors that deserve more attention.

    line 19
  3. Distinctive:

    no security, permissions, auth, data, CI/CD, production Terraform, or migration hotspots appear

    line 30
  4. Distinctive:

    If escalation is needed, do it once and with a narrowed scope.

    line 46
  5. Distinctive:

    If the target is obvious from the request, proceed.

    line 58
  6. Very specific:

    Always start with the bundled script.

    line 62
  7. Distinctive:

    If needed, compare explicit refs:

    line 74
  8. Distinctive:

    Before reading patches, prioritize files in this order:

    line 91
  9. Distinctive:

    only then the remaining changed files if still necessary

    line 97
  10. Very specific:

    Never spend reading time on skippable_files.

    line 99
  11. Distinctive:

    Do not read the same diff repeatedly through multiple tools unless new information justifies it.

    line 101
  12. Very specific:

    Use direct git or gh commands plus targeted file reads.

    line 107
  13. Distinctive:

    Keep the investigation narrow.

    line 124
  14. Distinctive:

    If the change is genuinely risky, call a code-review style subagent once with:

    line 128
  15. Distinctive:

    Do not launch both exploratory and review agents over the same scope.

    line 135
  16. Distinctive:

    When there are findings, return:

    line 141
  17. Distinctive:

    only the meaningful findings, prioritized by severity

    line 144
  18. Distinctive:

    When there are no findings, say that plainly.

    line 147
  19. Distinctive:

    Keep the response concise.

    line 149
  20. Distinctive:

    Run triage for PR #2575.

    line 172
  21. Distinctive:

    If the diff is small and localized, inspect only the changed files directly.

    line 173

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

AI Credit Efficient Review

Perform a high-signal, cost-aware review. The goal is not to read everything equally. The goal is to spend the cheapest effort that still gives the user useful risk detection.

Core idea

Default to a two-stage review:

  1. Cheap triage first to understand scope, size, and risk.
  2. Selective deepening only on the files or behaviors that deserve more attention.

This usually saves AI Credit because the expensive part of review is broad, repeated reasoning over low-risk changes. A fast scope pass lets you avoid that.

When to keep the review lightweight

Stay in lightweight mode when most of these are true:

  • the diff is small
  • changed files are few and localized
  • changes are documentation, comments, naming, or straightforward wiring
  • no security, permissions, auth, data, CI/CD, production Terraform, or migration hotspots appear
  • the user asked for "major issues only", "quick review", or "AI Credit efficient review"

In lightweight mode, do not invoke a heavy review subagent. Use direct commands and direct file inspection.

When to deepen or escalate

Deepen the review when cheap triage shows real risk, for example:

  • authentication, authorization, IAM, secrets, encryption, network policy
  • Terraform for production or shared/global infrastructure
  • schema changes, migrations, destructive operations, data handling
  • GitHub Actions, deployment logic, rollback-sensitive automation
  • large diffs, cross-cutting refactors, or many files with coupled behavior
  • the user explicitly asks for a deeper or more exhaustive review

If escalation is needed, do it once and with a narrowed scope. Pass the risky files, risk reasons, and review goal instead of asking a subagent to rediscover the whole repository.

Workflow

1. Identify the review target

Determine whether the user wants to review:

  • a GitHub PR number
  • the current branch diff
  • specific changed files

If the target is obvious from the request, proceed. Ask only if you truly cannot tell what should be reviewed.

2. Run cheap scope triage first

Always start with the bundled script. <skill-dir> below means this skill's base directory (announced when the skill is invoked); do not assume any particular install location.

python <skill-dir>/scripts/review_scope.py --pr <PR_NUMBER>

or for the current branch:

python <skill-dir>/scripts/review_scope.py --current-branch

If needed, compare explicit refs:

python <skill-dir>/scripts/review_scope.py --base <BASE_REF> --head <HEAD_REF>

The script prints JSON with everything triage needs:

  • files: per-file insertions/deletions plus hotspot labels, so you can rank what to read
  • hotspots: risky categories (auth/IAM, terraform, migrations, CI, production scope) with the matching files
  • skippable_files: lockfiles, generated artifacts, vendored code, binary assets — do not read their diffs; at most confirm they are what they look like from the path
  • substantive_file_count / substantive_changed_lines: size of the change excluding skippable noise; use these, not the raw totals, to judge how big the review really is
  • largest_files: the biggest substantive files, a good default reading order after hotspots
  • recommended_review_mode and risk_reasons: the script's lightweight/escalate suggestion

3. Read only what matters first

Before reading patches, prioritize files in this order:

  1. hotspot files flagged by the triage script
  2. config or infra entrypoints that fan out behavior
  3. the largest_files entries, since big diffs hide more bugs
  4. tests covering risky code
  5. only then the remaining changed files if still necessary

Never spend reading time on skippable_files. A 3000-line lockfile diff is not a 3000-line review.

Do not read the same diff repeatedly through multiple tools unless new information justifies it.

Review strategy by mode

Lightweight mode

Use direct git or gh commands plus targeted file reads.

Recommended commands:

git --no-pager diff --stat <range>
git --no-pager diff --name-status <range>
git --no-pager diff <range> -- <important-paths>

For PRs, you can also use:

gh pr diff <PR_NUMBER> --name-only
gh pr view <PR_NUMBER> --json title,body,files

Keep the investigation narrow. Focus on correctness risks, not line-by-line commentary.

Escalated mode

If the change is genuinely risky, call a code-review style subagent once with:

  • the exact review target
  • the hotspot file list
  • the risk reasons from triage
  • a request to focus on substantive issues only

Do not launch both exploratory and review agents over the same scope. Do not rerun equivalent reviews unless the user changes the goal or new evidence appears.

Output format

Lead with the result.

When there are findings, return:

  1. a short verdict
  2. only the meaningful findings, prioritized by severity
  3. file references when available

When there are no findings, say that plainly.

Keep the response concise. The whole point of this skill is to save both AI Credit and the user's time.

What to avoid

  • exhaustive commentary on every touched file
  • style-only feedback unless the user asked for it
  • repeatedly re-summarizing the whole diff
  • launching a heavy review agent before cheap triage
  • using multiple heavy agents for the same review target
  • pretending the review was exhaustive when it was intentionally selective

Example behavior

Example 1: cheap PR review

User

PR #1234 を AI Credit を節約しつつレビューして。重大な問題だけ見たい。

Good behavior

  1. Run triage for PR #2575.
  2. If the diff is small and localized, inspect only the changed files directly.
  3. Return either "no substantive issues" or a short list of real risks.

Example 2: escalate because risk is high

User

この PR は IAM と production Terraform を触っています。AI Credit は意識しつつも見落としは減らしたいです。

Good behavior

  1. Run triage.
  2. Notice the security / shared-infra hotspots.
  3. Narrow the scope to those files and escalate once if direct inspection is not enough.

Why this works

Cost-aware review is mostly about better selection, not weaker thinking. Triage cheaply, spend depth where the risk is concentrated, and avoid paying for broad reasoning that adds little value.

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.