agentleFS
pvalenapvalena/claude-skills/review-toolbox/SKILL.md

Review Toolbox

Skill2 starsChanged 2 months agoMITView on GitHub

Read-only source inspection for code/security review via the bundled `rtb` wrapper — named git/fs sources, composable filters, a whitelisted `git -C` read path, and one-approval Bash permission. Use instead of ad-hoc `cd … && git show/grep … | sed …`.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Before spawning a review subagent: run rtb facts and paste the output into its prompt so it starts with the correct paths, tags, version …

    line 29
  2. Very specific:

    Read-only, always: Never build/compile/run/execute the code under review.

    line 49
  3. Very specific:

    git = git -C <repo> <read-subcmd> only: No raw git in the allow-list.

    line 51
  4. Very specific:

    Compare against the shipped tree: When a distro/vendor patches upstream, the truth is the *patched* tree, not upstream alone — configure …

    line 58
  5. Very specific:

    Create it directly (.rtbrc in the project root), then run rtb sources to confirm every path resolves.

    line 101
  6. Very specific:

    New source: add SRC_<name>_* lines to .rtbrc and document it in your FACTS.md.

    line 152
  7. Very specific:

    Composable, not clever: Prefer chaining rtb filters over adding bespoke subcommands.

    line 162

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

Review Toolbox (rtb) Skill

Purpose: Standardize how a reviewer (you, or a subagent) reads source during code / vulnerability review. Instead of hand-writing cd /some/repo && git show TAG:path | sed -n '…' | grep … every time, route it through one wrapper: rtb (bundled with this skill). This gives:

  • One-time permission — approve Bash(…/rtb:*) once, not each git/grep/sed.
  • Read-only by construction — rtb only ever runs git -C <repo> <read-subcmd> from a fixed whitelist; there is no code path that writes, checks out, commits, archives, or cds into a repo. Writes are impossible, not just discouraged.
  • Named sources + tags — repos/paths/tags live in one config (.rtbrc) and an optional human narrative (a FACTS.md); agents get them via rtb facts instead of memorizing paths.
  • Composable filters — --lines, --grep, --ctx, --head/--tail, --count chain in one call, replacing | sed | grep | head pipelines.

When to Use

  • Any time you would otherwise run git show <ref>:<file>, git grep <pat> <ref> -- …, or sed -n 'A,Bp' / grep -n … -A N against a review source repo.
  • Before spawning a review subagent: run rtb facts and paste the output into its prompt so it starts with the correct paths, tags, version mapping, and hard rules.

Workflow

  1. Configure sources once — create ./.rtbrc (see Setup) declaring each repo/tree you'll read: upstream git source(s) + any patched/unpacked fs tree, plus an optional RTB_FACTS narrative. Run rtb sources to confirm they resolve.
  2. Hand facts to the reviewer — run rtb facts and paste the output into your own working notes or a review subagent's prompt, so paths/tags/rules are fixed up front.
  3. Read, don't run — inspect code with rtb cat / rtb grep / rtb log / rtb ls, chaining --lines/--grep/--ctx/--head/--tail instead of piping through sed/grep. Pick the source/ref with --src/--ref.
  4. Verify against what ships — when a finding depends on patched code, re-check it against the shipped/patched source (--src <release-tree>), not upstream alone.
  5. Stay inside the wrapper — never fall back to raw git/sed pipelines or build/run the code; that defeats the read-only permission boundary the wrapper exists to enforce.

Hard Rules (read first)

  1. Read-only, always. Never build/compile/run/execute the code under review. rtb is the only sanctioned way to touch the source repos.
  2. git = git -C <repo> <read-subcmd> only. No raw git in the allow-list; no checkout/commit/archive|tar/push/reset. If you truly need a raw git read not covered by rtb, run it explicitly as git -C <repo> … and let it prompt — never add a broad Bash(git *) allow back.
  3. Keep review data local when it's sensitive. For embargoed / private review material, keep inputs and outputs out of version control (e.g. a gitignored work dir) and never post externally. (Skip if the code under review is public.)
  4. Compare against the shipped tree. When a distro/vendor patches upstream, the truth is the patched tree, not upstream alone — configure both as sources (e.g. upstream + a release/prep fs source) and confirm verdicts against what actually ships.

Setup (one time per project)

  1. Config — a source registry at ./.rtbrc in the project: plain shell variable assignments, one block per source (gitignore it if it points at private paths). rtb only reads these variables out of it — it never execs logic from your args. Each source is one of two kinds:

    • git — a git repo read at a ref/tag/commit (SRC_<name>_REF), for upstream or dist-git clones where you inspect code as of a version.
    • fs — a plain directory on disk (no REF), for an unpacked / already-patched tree (e.g. a prep/build dir) that represents what actually ships.

    Variable schema:

    SRC_<name>_KIND=git|fs
    SRC_<name>_PATH=/abs/path
    SRC_<name>_REF=<default tag/branch>   # git sources only; ignored for fs
    RTB_DEFAULT_SRC=<name>                # source used when --src is omitted
    RTB_FACTS=./FACTS.md                  # optional narrative fed to subagents

    A complete example (generic — an upstream clone, a vendor patch repo, and the shipped tree):

    # ./.rtbrc — source registry for the "libfoo" review (LOCAL; gitignored)
    # upstream clone: inspect code as of the shipped version
    SRC_upstream_KIND=git
    SRC_upstream_PATH=/abs/path/to/libfoo/upstream
    SRC_upstream_REF=v2.4.0                 # also usable: --ref main, --ref v2.5.0-rc1
    
    # vendor/distro patch repo (spec + numbered *.patch over a tarball)
    SRC_distgit_KIND=git
    SRC_distgit_PATH=/abs/path/to/libfoo/dist-git
    SRC_distgit_REF=release-branch
    
    # SHIPPED TRUTH: unpacked tree with downstream patches already applied
    SRC_release_KIND=fs
    SRC_release_PATH=/abs/path/to/libfoo/prep/libfoo-2.4.0
    
    RTB_DEFAULT_SRC=upstream
    RTB_FACTS=./FACTS.md

    Create it directly (.rtbrc in the project root), then run rtb sources to confirm every path resolves. Add more components by giving each its own name prefix (e.g. SRC_bar_*). RTB_FACTS is optional and free-form: a short human narrative (paths, version→tag mapping, which source is authoritative, hard rules) that rtb facts prints ahead of the source table for pasting into a subagent prompt. Resolution order for the config itself: $RTB_CONF → ./.rtbrc → ./.review-toolbox.conf.

  2. Permission — in .claude/settings.local.json, allow the wrapper and drop broad shell allows:
    "allow": [ "Bash(/abs/path/to/rtb:*)", … ]   // add rtb
    // remove: "Bash(git *)", "Bash(grep *)", "Bash(awk *)"  ← these defeat the read-only goal
  3. (optional) PATH — ln -s ~/.claude/skills/review-toolbox/rtb ~/.local/bin/rtb so you can type rtb directly. The Bash permission should reference the path you actually invoke.

Command Reference

rtb facts                          # FACTS.md + resolved sources — feed to subagents
rtb sources                        # table of configured sources
rtb refs [--src N]                 # list tags for a git source
rtb cat  <path> [opts]             # show a file (git: at --ref; fs: from disk)
rtb show <path> [opts]             # alias of cat
rtb grep <pattern> [opts] [-- <pathspec…>]   # git grep at ref, or grep -rn on fs
rtb log  <path> [--src N --ref R --head N]
rtb ls   [subpath] [--src N --ref R]

Source/ref: --src NAME (default from config), --ref REF (override tag/branch/commit). Filters (chain freely; order lines→grep→head/tail): --lines A,B, --grep PAT, --ctx N/-C N, --head N, --tail N, --count.

Translating old habits

Old pipelinertb equivalent
cd R && git show v2.4.0:F | sed -n '33,75p'rtb cat F --ref v2.4.0 --lines 33,75
git show v2.4.0:F | grep -n P -A25 | head -40rtb cat F --ref v2.4.0 --grep P --ctx 25 --head 40
git grep -n P v2.4.0 -- F1 F2rtb grep P --ref v2.4.0 -- F1 F2
read a patched/unpacked tree on diskrtb cat F --src release
check a different tagrtb cat F --ref v2.5.0-rc1

Extending

rtb is a single bash file — extend in place, keep it read-only:

  • New post-filter (e.g. an awk transform): add a flag in parse_common() and a stage in apply_filters()/_filter_*. Keep the lines→grep→ends ordering predictable.
  • New reader (e.g. blame, annotate): add a cmd_<x>() and a main() case; call gitr so the read-only whitelist (GIT_READ_OK) still applies. To allow a new git read subcommand, add it to GIT_READ_OK — never bypass gitr.
  • New source: add SRC_<name>_* lines to .rtbrc and document it in your FACTS.md. No code change needed.

Core Principles

  1. One wrapper, one approval, zero writes. The value is the permission boundary — don't route around it with raw git/sed once it's set up.
  2. Facts flow to agents. Subagents shouldn't guess paths/tags — hand them rtb facts.
  3. Simplicity over portability. The script is generic and reusable; the per-project .rtbrc/FACTS.md are not meant to be shared.
  4. Composable, not clever. Prefer chaining rtb filters over adding bespoke subcommands.

See Also

  • review — full structured code review; use rtb as its read path.
  • sanity-check — quick pre-review malicious-intent scan; rtb for the reads.
  • verify-fix — confirm a patch blocks the vector; rtb to diff before/after at each ref.

Version History

  • 1.0.0: Initial version — read-only git -C wrapper with named sources (git+fs), composable line/grep/head filters, facts/sources/refs/cat/grep/log/ls, and one-approval Bash permission model.
  • 1.1.0: Genericized for the shared skills collection and made self-contained — the rtb script is now bundled alongside this SKILL.md; config defaults to ./.rtbrc; project-specific examples/rules removed.
  • 1.2.0: Documented .rtbrc creation — git vs fs source kinds, a complete generic example config, and what RTB_FACTS/FACTS.md should contain.

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.