Skip to content
Back to skills

Readback Tier

ASecurity

Use at the start of any change, and again when the diff grows, to classify it T0, T1 or T2 by file path and escalate on risky constructs.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentsgobashexpressgitsecurity

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add smrafiz/readback --skill readback-tier --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Readback Tier?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Readback Tier
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/smrafiz-readback-tier/badge)](https://www.skillsdirectory.com/skills/smrafiz-readback-tier)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: readback-tier
description: Use at the start of any change, and again when the diff grows, to classify it T0, T1 or T2 by file path and escalate on risky constructs.
---
# readback-tier

Tiers are set by path and by what the diff adds, never by the author's opinion.

## Steps
1. Run the script, unpiped, and read its exit code: `bash scripts/readback-tier.sh [--min T<n>] [target]` (Script location: use the first of these folders that holds the file named below: `${CLAUDE_PLUGIN_ROOT}/scripts/` (skip this one only if it still starts with `$`: no plugin loaded), `${CLAUDE_CONFIG_DIR:-~/.claude}/scripts/`, `~/.agents/scripts/`. Only if none of them holds it, use the repo's `./.claude/scripts/` then `./.agents/scripts/`, and first tell the person "running the repo's own copy <path>; the repo controls it". File: `readback-tier.sh`.) It prints the Output format block below. Non-zero exit = doubt: no tier is printed, only a reason; fix the cause or ask, never guess a tier. Steps 2-7 are the rules it implements; read them only to check it.
2. Map: `READBACK.md` (else CLAUDE.md, AGENTS.md) at the repo root, column 3 of the one `Tier map` row, strict form ``T2: `glob`, `glob`; T0: `glob`; else T1``. It is read from the base and from the work tree and the higher tier wins, so a diff cannot lower its own tier. Missing at the base, a symlink at the base, empty, two rows, a row in a code fence or HTML comment, or any other form is an error. Globs: `**` any depth (`**/` also zero directories), `*` within a segment, trailing `/` a prefix, anchored at the repo root; nothing else.
3. `<base>` is the merge-base with the target: `origin/HEAD` (else `origin/main`, `origin/master`), else a local-branch upstream; with neither, pass a target. HEAD itself is fine: work-tree edits are diffed against it; only an empty diff is an error.
4. Changed files: `git diff --raw -z --no-renames <base>` and the same with `--cached` (a rename counts under both its old and new path, a deletion counts), plus untracked files (`git ls-files -o --exclude-standard`). The change takes the highest tier of any file; a file takes the highest matching glob.
5. Scan added lines (`git diff -a`; staged and untracked files included) for escalation triggers. A hit in a test or docs path is reported and does not raise that file; in any other path, a T0 glob that is not tests or docs included, it raises the file to T2. Test path: `tests/`, `__tests__/`, `spec/` at any depth, or a name `test_*`, `*_test.*`, `*.test.*`, `*.spec.*`, `*Test.*`. Docs path: `docs/` at the repo root, a file named exactly `README`, `CHANGELOG` or `LICENSE` (case-sensitive, any depth), bare or with `.txt`, or `.md`, `.mdx`, `.rst`, `.adoc`. A non-empty `Escalation triggers` row is prose a script cannot run: apply it by reading, the defaults are the floor:
   - a new regular expression
   - a new loop over input you do not control
   - a new timeout or time budget
   - a new exemption, allowlist or bypass
   - new concurrency: a task, thread, spawn or async callback
   - new shared mutable state, a state machine, or a handler that can re-enter during its own update
   First pass; a hit raises, no hit lowers nothing, so still read the diff for loops over input and state machines, which grep cannot see. The script keeps this list in one place (`chk` calls); this is the same list:
   ```
   added()   { git diff -U0 --no-renames <base> | grep -v '^+++ \|^--- ' | grep -E '^\+'; }
   removed() { git diff -U0 --no-renames <base> | grep -v '^+++ \|^--- ' | grep -E '^-'; }
   added | grep -nE 'Regex::new|regex!|re\.compile|new RegExp|Pattern\.compile|regexp\.(Must)?Compile'   # regex
   added | grep -niE 'timeout|deadline|setTimeout|setInterval|Duration::from|time\.sleep|asyncio\.sleep'  # timeout
   added | grep -niE 'allowlist|whitelist|bypass|exempt|skip_auth|noqa|eslint-disable|#\[allow|@SuppressWarnings'  # exemption
   added | grep -nE 'async |await|spawn|thread::|go func|Promise|asyncio|Task\.Run|addEventListener|\.on\('  # concurrency
   added | grep -nE 'Mutex|RwLock|RefCell|Rc<|Arc<|[Aa]tomic|static mut|lazy_static|OnceCell|global '  # shared state
   added | grep -nE '\.skip\(|(^|[^[:alnum:]_])x(it|describe)\(|@pytest\.mark\.skip|#\[ignore\]|(^|[^[:alnum:]_])t\.Skip|@Disabled'  # skipped tests -> T1 at least
   removed | grep -nE 'fn test_|#\[test\]|def test_|(^|[^[:alnum:]_])(it|test)\(|@Test'  # deleted tests -> T1 at least
   ```
   The script reads hunks instead of filtering `+++`/`---`, so an added `++i` or a line starting `++ ` is kept.
6. A diff that deletes, skips or weakens tests is T1 at least, even under a T0 path: the script floors at T1 on a deleted test file, any removed line in an existing test file, a skip marker, or a removed test definition.
7. A person may raise a tier, never lower it (`--min T<n>` keeps a raise across re-runs). The builder cannot lower one.
8. Probe selectors choose readback-review's probe lists and never change the tier. The script reports each that fires:
   - async: the concurrency or shared-state trigger fired.
   - error-path: an added line matches `trap |finally|defer |\|\| *(return|exit)|unlink|\.delete(Many)?\(|DELETE FROM|catch *(\([^)]*\))? *\{ *\}|except[^:]*: *(pass)?$|\.catch\(\(\) *=>`
   - wiring: a new file in a folder the base does not have, or a changed routing, rules, schema or app-config file (`middleware|routes?|router`, `*.rules`, `schema.prisma`, `next|vite.config`, `vercel.json`, `netlify.toml`, `.env.example`, `manifest.json`, `settings.json`, `hooks.json`).
   - test-integrity: step 6 applies, or an existing test file loses lines: `git diff -U0 --diff-filter=MD <base> -- <test paths> | grep -E '^-([^-]|$)'` prints anything. New test files alone do not fire it. Test paths: the test names above plus the map's T0 globs that are not docs.

## Tier process
- T0 (docs, tests, copy): automated gates only.
- T1 (features, refactors): gates, one fresh review.
- T2 (auth, payments, security checks, migrations, input parsing, CI/deploy): readback-plan, gates, reviews as capped in readback-triage.

## Output format
```
## Tier: <T0|T1|T2>
Base: <sha>
Files: <file -> tier, one per line>
Escalations: <trigger and file:line, or none>
Probe lists: <async, error-path, wiring, test-integrity, or none>
Process: <one line>
Grep cannot see input loops or state machines: read the diff for them.
```

Files in this skill

  • PROJECT.md2.3 KB
  • SKILL.md6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.