Skip to content
Back to skills

Doc Pass

BSecurity

Do a documentation-only pass over every source file in the target codebase (below, **the project**): full doc comments on every file, type, member, function, method, route and handler (see **Coverage** in `references/rules-core.md` and the language file), plus inline comments where the logic is non-obvious. Rewrite existing comments that are wrong, vague or below this standard, and keep everything on the **Preserve** lists exactly. In **terse style** (step 0) the comments are short instead: o...

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 9, 2026
ai-agentsjavascripttypescriptpythonrustgojavarubyphpswiftkotlin

Works with

  • cli
  • api

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

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

Scanned December 1, 2026

npx -y skills add chrismccoy/skills --skill doc-pass --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Doc Pass?

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

Security grade badge for Doc Pass
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/chrismccoy-doc-pass/badge)](https://www.skillsdirectory.com/skills/chrismccoy-doc-pass)

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
# Documentation pass for any popular language

Do a documentation-only pass over every source file in the target codebase (below, **the project**): full doc comments on every file, type, member, function, method, route and handler (see **Coverage** in `references/rules-core.md` and the language file), plus inline comments where the logic is non-obvious. Rewrite existing comments that are wrong, vague or below this standard, and keep everything on the **Preserve** lists exactly. In **terse style** (step 0) the comments are short instead: one-line doc comments on the public API, no tag boilerplate (see **Terse style** in `references/rules-core.md`). **Code must not change at all**; prove that mechanically before reporting. Some comments are code (lint and type-check directives, build tags, doctests, magic comments, spec-generating blocks), so the proof covers them too.

`<skill-dir>` is `${CLAUDE_PLUGIN_ROOT}/lib/doc-pass`, the folder that contains this procedure file; every relative `references/…` or `scripts/…` path below is inside it. `<scratchpad>` is the session's scratch directory (or a new temporary folder outside the project). `<project>` is the project root. Nothing from this pass except comments is ever written inside the project.

## Files in this skill

- `references/rules-core.md`: the **Hard rule**, **Failure protocol** and **Universal rules**. Read it in full before step 1's frozen scan.
- `references/discovery.md`: how to build the file list, the frozen scan, the maps, the groups and the plan in step 1, the baseline commands for step 2, the bug ranking for step 5, and how to keep large outputs out of the conversation.
- One language file per language in the project. Read each one that applies:

  | Language | Files | Reference |
  |---|---|---|
  | JavaScript / TypeScript (+ Vue, Svelte, Astro) | `.js .jsx .mjs .cjs .ts .tsx .mts .cts .vue .svelte .astro` | `references/lang/js.md`, then `js-style-jsdoc.md` and / or `js-style-tsdoc.md`, and `js-backend.md`, `js-frontend.md`, `js-meta-frameworks.md` as they apply (all in `references/lang/`) |
  | PHP | `.php .phtml .inc` (not `.blade.php`) | `references/lang/php.md` |
  | Python | `.py .pyi` | `references/lang/python.md` |
  | Go | `.go` | `references/lang/go.md` |
  | Rust | `.rs` | `references/lang/rust.md` |
  | Ruby | `.rb .rake .gemspec .ru .thor`, `Rakefile`, `Gemfile`, `Guardfile`, `Capfile`, `Brewfile`, `Vagrantfile` | `references/lang/ruby.md` |
  | Java, Kotlin | `.java .kt .kts` | `references/lang/jvm.md` |
  | C# | `.cs` | `references/lang/csharp.md` |
  | Swift | `.swift` | `references/lang/swift.md` |
  | C, C++ | `.c .h .cc .cpp .cxx .c++ .hpp .hh .hxx .ipp .inl` | `references/lang/c-cpp.md` |
  | Dart (+ Flutter) | `.dart` | `references/lang/dart.md` |
  | Elixir | `.ex .exs` | `references/lang/elixir.md` |
  | Erlang | `.erl .hrl .escript` | `references/lang/erlang.md` |
  | Haskell | `.hs .hsc` | `references/lang/haskell.md` |
  | Clojure | `.clj .cljs .cljc .cljd .bb` | `references/lang/clojure.md` |
  | Lua | `.lua .rockspec` | `references/lang/lua.md` |
  | Perl | `.pm .pl .t .psgi .cgi` | `references/lang/perl.md` |
  | PowerShell | `.ps1 .psm1 .psd1` | `references/lang/powershell.md` |

- `references/bug-check.md`: the read-only **Bug check only** mode, which replaces steps 1 to 5 when the user wants bugs found and nothing changed.
- `references/agent-verification.md`: what each agent checks on its own files. Agents get it through their `rules.md`; read it before step 3.
- `references/checker-spec.md`: the checker's specification. Read it only to write or debug a checker.
- `scripts/`: the checker (`verify.mjs`, `coverage.mjs`, `selftest.mjs`, `lib.mjs` for JS / TS via Babel, `treesitter.mjs` and `langs.mjs` for every other language, with `clojure.mjs` and `lexers.mjs` as readers for Clojure, Erlang, Haskell, Perl and Lua, `package.json` and `package-lock.json`).

## 0. Mode and intake

**Mode** comes from the request, whether or not intake runs:

- A request that only asks for bugs ("find bugs", "audit this code for bugs", "read only") is `Bug check only`. Follow `references/bug-check.md` instead of steps 1 to 5.
- A request for documentation is `Doc pass + bug report`, unless it says not to report bugs (`Doc pass only`).
- Ask only when the request leaves it open.
- **Style** also comes from the request (any request to make comments terse or shorter, or to trim, condense or shorten comments or docblocks, means `Terse`; "full" means `Full`), whether or not intake runs. Otherwise ask (single-select): `Full (Recommended)`, `Terse`. Headless: `Full`.

**Intake** runs only when no path is set. If the user gave no path, or it does not exist, do not guess. Ask with `AskUserQuestion`, one question at a time:

1. **Project path** (required). Offer the current directory first when it has a project manifest (`package.json`, `composer.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `Gemfile`, `pom.xml`, `build.gradle*`, `*.csproj`, `Package.swift`, `CMakeLists.txt`, `pubspec.yaml`, `mix.exs`, `rebar.config`, `*.cabal` / `stack.yaml`, `deps.edn` / `project.clj`, `*.rockspec`, `Makefile.PL` / `cpanfile`, `*.psd1`), then folders one level down that do. Confirm the path has source files; otherwise say so and ask again.
2. **Scope** (multi-select): `Application code`, `Client code (components, pages, browser scripts)`, `Tests and test helpers`, `Scripts and tooling`. Default: all.
3. **Mode** (single-select), when the request does not settle it: `Doc pass + bug report (Recommended)`, `Doc pass only`, `Bug check only`.

Skip any question the request already answers.

**No user to ask** (a headless or delegated run): wherever this skill says to ask, take the recommended option or the stated default; where there is neither, take the choice that changes nothing outside `<scratchpad>` (install nothing, fix nothing). List each choice in the report.

## 1. Discover

Details for every item below are in `references/discovery.md`; read it before starting. Write any output that grows with the project to a file under `<scratchpad>` and read it by count, by package or in chunks, never whole.

- **Languages and stack.** Read every manifest (root and workspaces or modules: npm / pnpm / Yarn workspaces, Composer, `pyproject.toml` / `requirements*.txt` / `setup.cfg`, `go.mod` / `go.work`, Cargo workspaces, `Gemfile`, Maven / Gradle modules, `.sln`, `Package.swift`, CMake). With no manifest (a folder copied out of a larger repo), treat the folder as one package, take its stack from the code and say so in the plan. Per package, note the languages, frameworks, runtime versions (`engines`, `require.php`, `requires-python`, `go`, `rust-version`, `.ruby-version`, target frameworks) and whether it is server, client or both. Then read the language files from the table, and inside them only the framework sections that apply.
- **Git state.** If the project is in git, run `git status --porcelain`. If any in-scope file has uncommitted changes, ask once whether to continue (recommend committing or stashing so `git diff` shows only this pass).
- **Configs, checked types and comment-reading tools.** Read the lint, format and type-check configs, pick each language's doc dialect, and decide whether **checked types** (`--checked-types`) and **schema tags** (`--schema-tags`) are on. In terse style only, with only per-file `// @ts-check`, **per-file mode** is on and adds `--ts-check-per-file` (`discovery.md`); full style passes `--checked-types` alone. In terse style, also list the doc-requiring lint rules that are on (each language file's `### Terse form` names them; `discovery.md`); if any is on, ask once: `Full (Recommended)` or `Terse, accept higher counts for these rules`, and keep the accepted rules for the facts. If the answer is `Full`, the whole pass switches to Full style and the report lists the switch. A headless run, whose Style came from the request, takes `Terse, accept higher counts for these rules` and reports it. When a comment-reading tool is found, follow **Comment-reading tools** in `discovery.md`: it turns schema tags on for the JS schema generators, and for the others asks once whether new summaries may flow into its output.
- **Checker.** Copy `<skill-dir>/scripts/` into `<scratchpad>/checker/`, make it writable (`chmod -R u+w`), and run `npm ci` there (it installs the exact versions in `package-lock.json`). Never install into the skill folder or the project. `npm ci` needs the npm registry: if it cannot reach it, say so and ask the user for network access or a local npm cache (`npm ci --offline`); never start editing without a working checker. If the bundled checker is missing, write one from `references/checker-spec.md`.
- **Files.** Build `<scratchpad>/files.txt` from the checker's own walk (`verify.mjs <project> --list-files --list-skipped`), then remove what the walk cannot know (review its `SKIPPED DIR:` lines too: a real package named `build/` or `out/` is pruned and must be added back by hand): intake's scope choices, unmarked generated clients, each language file's out-of-scope folders and file patterns, bundled third-party code and stale copies. Every checker run takes `--files-from`: `<scratchpad>/files.txt` unless the step names another list. Never open secret files.
- **Test the checker before trusting it:** `node <scratchpad>/checker/selftest.mjs <project> <scratchpad>/selftest --files-from <scratchpad>/files.txt [--schema-tags] [--checked-types] [--ts-check-per-file] [--terse]`. Over about 5,000 files, pass a sample list instead, the first 100 files of `files.txt` for each pair of top-level folder and file extension (the self-test parses every file it is given to pick the few it tests, so a long list is slow): `awk '{d=$0; sub(/\/.*/,"",d); e=$0; sub(/.*\./,"",e); if (++n[d" "e]<=100) print}' <scratchpad>/files.txt > <scratchpad>/selftest-files.txt`, then `--files-from <scratchpad>/selftest-files.txt`. It must end `SELFTEST OK`. A `SKIPPED` case means the project has nothing to test it with; list each skipped case once in the report, with the files it was skipped on. On a `FAIL`, fix the checker in `<scratchpad>/checker/` and rerun. This is the only time the checker may change; once editing starts, the **Failure protocol** forbids it.
- **Parse check and frozen scan.** Run `node <scratchpad>/checker/verify.mjs <project> <project> --list-frozen --files-from <scratchpad>/files.txt [--schema-tags] [--checked-types] [--ts-check-per-file] > <scratchpad>/frozen.txt` once on the unedited tree, with the tested checker and the same flags as every later run, except `--terse`, which is left out here because it does not change the frozen list. It exits non-zero when a file has an original parse error; that is expected. Remove every file whose `CODE CHANGED` line says `original` (`original parse error …`, or `original <script> block N: parse error …` for a component) from `files.txt` and list it in the report. (A plain JS / TS file Babel cannot parse falls back to tree-sitter and stays in scope. Its broken regions show as `LOCKED:` when tree-sitter finds any, and coverage lists it as `READ BY HAND`. It is reported as `original parse error` only when tree-sitter fails too.) Any other failure line in this self-compare (`CODE CHANGED` without `original`, `LAYOUT CHANGED`, `FROZEN COMMENT CHANGED`) means the checker is not deterministic on that file: stop, and fix or report the checker before any edit. Read only counts and parse errors from `frozen.txt`; its `FROZEN:` and `LOCKED:` lines reach agents as per-agent slices (step 3).
- **Facts library** (optional, when the user points to one), **`@since` policy**, **route, event and env maps** and **shared shapes**: build them as `discovery.md` says, each map in its own file under `<scratchpad>/maps/` (`routes.md`, `events.md`, `env.md`, `shapes.md`; create every one, empty when the project has none), one line per row with every file path it involves.
- **Typedefs** (terse style only, once the shapes map exists): when checked types are off (or per-file mode is on and some JS files lack `// @ts-check`) and the project has JS `@typedef` or `@callback` blocks (with their `@property` lines) not on the shapes map, ask: `Collapse to one line (Recommended)`, `Keep as is`, `Remove`; with nobody to ask, `Collapse to one line`. PHP type aliases (`@phpstan-type`, `@psalm-type`) always stay.
- **Tests.** Find the test commands per language and whether they need a database, a browser or network. The checker proves code identity, but tests and formatters catch what it cannot see: tests that read source text, formatters that space or reflow doc comments, doc tools that reject a link. When a toolchain or service is missing, ask the user once whether to install it in a folder they choose, never system-wide. Services (Postgres, Redis) run as private instances there, on their own ports, never the user's existing ones.
- **Groups.** Split the files into disjoint groups of 500–900 lines (never more than about 1,500), one language per group where practical; more than 7 groups run in **waves** of at most 7 agents. Under about 900 lines in total, work in the main session. Over about 20,000 lines, ask the user once which packages to do.
- **Show the plan** as `discovery.md` lists it. If intake did not run and the scope looks wrong, ask once. Otherwise proceed.

## 2. Safety net (before any edit)

- **Back up** the in-scope files, keeping the directory structure: `rsync -a --files-from=<scratchpad>/files.txt <project>/ <scratchpad>/orig/`.
- **Restored list.** Create `<scratchpad>/restored.txt` empty; the Failure protocol adds each file it restores.
- **Changed-paths snapshot.** Record the state before any edit, so step 4 can prove that nothing outside `files.txt` changed: `touch <scratchpad>/start-marker` (every file written later is newer than it), and in git also `git -C <project> status --porcelain=v1 -uall > <scratchpad>/status-before.txt` (deletions show only there).
- **One work copy.** Every tool that writes build output, caches or test artifacts (installs, test suites, `cargo`, `dotnet build`, `mix compile`, Gradle / Maven, `swift build`, `cabal build`, `python -m py_compile`) runs in `<scratchpad>/work/`, a copy of the project without its build and cache folders (`rsync -a --exclude .git --exclude node_modules --exclude target --exclude dist --exclude build --exclude .venv --exclude venv --exclude __pycache__ <project>/ <scratchpad>/work/`), never in the project. The copy includes secret files such as `.env`; they stay in the scratchpad and are never opened. Install dependencies there (below); when the user prefers not to reinstall, copy the project's `node_modules` in as well (never link it: tools write caches into `node_modules/.cache` and `.vite`). Use the same copy for every baseline here, for the agents' per-file linters, and in step 4. Check the free space first (`df -h <scratchpad>`): installs, toolchains (Go fetches the version `go.mod` asks for), module and build caches can need several GB, and the scratchpad may be a small RAM-backed `tmpfs`. If it is too small, ask the user once for a folder on disk outside the project, and put the work copy, the caches (`GOPATH`, `GOMODCACHE`, `GOCACHE`, `npm_config_cache`, `CARGO_HOME`, …) and the tools' temp folders (`TMPDIR`, `GOTMPDIR`) there; give that path in the report so the user can delete it.
- **Dependencies.** If a language's dependencies are not installed (`node_modules`, `vendor`, a virtualenv, `bundle` gems), ask once whether to install them in `<scratchpad>/work/` with the project's lockfile (`npm ci`, `pnpm install --frozen-lockfile`, `composer install`, `uv sync` / `pip install -r`, `bundle install`, `go mod download`, `cargo fetch`, `dotnet restore`). Never install into the project. If the user declines, skip those baselines and say so.
- **Tests.** Run each suite twice in `<scratchpad>/work/`, with a timeout (in the background when slow), and record pass, fail and skip counts per test. A test whose result differs between the two runs is **flaky**: list it, and leave it out of the step-4 comparison. Never pass snapshot-update flags. Never run a script that sends email, charges money or calls production services. If the suites already fail, note it; if they cannot run, say so and skip the comparison in step 4. Compare outcomes per test, not only counts: an already-failing suite can hide a new failure.
- **Type checks, linters and formatters.** Run each language's tools that the language file lists in `<scratchpad>/work/`, with the project's own installed versions, and save counts per file and rule or error code to `<scratchpad>/baseline/`. For formatters, record which in-scope files pass their check mode. Never run a fixer or formatter in write mode on the project or the work copy; the only exception is step 4, item 7, on a separate copy. When the project emits declarations (TS `declaration`, published `.d.ts`), emit them to `<scratchpad>/dts-before` too. `references/discovery.md` (**Baselines**) has the command forms.
- **Syntax baseline.** Run each language's syntax check (the language file names it) on the in-scope files in `<scratchpad>/work/`, and write the files that already fail to `<scratchpad>/baseline/syntax-fail.txt` (create it empty when none fail). Agents skip their syntax check on these files, and step 4, item 3 expects them to fail. When a language's syntax checker is not installed (and the user declined installing it, or no user could be asked), skip it here, between waves and in step 4, item 3, and report the pass as unverified for it.
- **Write the project facts** to `<scratchpad>/facts.md`: the absolute paths `<scratchpad>` and `<project>` stand for; languages and stack per package, dialects, line limit, `Style: full | terse`, the Typedefs answer and the accepted lint rules (terse only), checked types, per-file mode (terse only) and schema tags on or off, comment-reading tools and the user's answer, `@since` policy, the facts-library files that apply; the exact verify, coverage, syntax, lint and format commands agents run, with their flags (write `none` where the project has no such tool, and `not available: <tool>` where it is missing; verify as `node <scratchpad>/checker/verify.mjs <scratchpad>/orig <project> --files-from <list> --line-limit <limit> [--schema-tags] [--checked-types] [--ts-check-per-file] [--terse]`; coverage as `node <scratchpad>/checker/coverage.mjs <project> --files-from <list> --context-from <scratchpad>/files.txt`, plus `--since` when the policy uses it and `--terse` in terse style, run twice per agent: with `--files-from <agent>/cov.txt` after `grep -vxF -f <scratchpad>/line-docs.txt <agent>/files.txt > <agent>/cov.txt`, then, when `line-docs.txt` is not empty, with `--files-from <agent>/cov-line.txt --line-docs` after `grep -xF -f <scratchpad>/line-docs.txt <agent>/files.txt > <agent>/cov-line.txt`; the files in `baseline/syntax-fail.txt`; the files whose doc comments a tool would publish when the user declined that, and the Python files whose docstrings are code (PLY, docopt: `lang/python.md`), listed in `<scratchpad>/line-docs.txt` (always create it, empty when there are none), which coverage checks in a second run with `--line-docs`; and frozen and locked totals. Shared shapes stay in `<scratchpad>/maps/shapes.md`.

The checker's commands, flags and output lines are listed in **Command reference** in `references/checker-spec.md`.

## 3. Document (parallel agents)

For each group, build `<scratchpad>/agent-<n>/` at the start of its wave:

- `files.txt`: its exact file list, with no blank or `#` lines (an empty pattern makes the `grep -F -f` below match everything).
- `frozen.txt`: its slice of the frozen scan, from the unedited copy: `grep -F -f <scratchpad>/agent-<n>/files.txt <scratchpad>/frozen.txt | grep -E '^(FROZEN|LOCKED):' > <scratchpad>/agent-<n>/frozen.txt`. Each `LOCKED:` line gives the line ranges agents must leave alone. `grep -F` matches substrings, so the slice can hold lines for files outside the agent's `files.txt` (`src/a.tsx` lines in the `src/a.ts` agent's slice); those lines are not its own.
- `rules.md`: the group's rules, concatenated verbatim, never retyped. The order is `rules-core.md`, the language files for **this group's** languages in the table's order (for JS / TS: `lang/js.md`, then its style files `lang/js-style-*.md`, then its area files `lang/js-backend.md`, `lang/js-frontend.md`, `lang/js-meta-frameworks.md`), `agent-verification.md`, then `facts.md` and the group's rows of each map. Replace `<files>` with the group's language files:

  ```sh
  A=<scratchpad>/agent-<n>
  { for f in rules-core.md <files> agent-verification.md; do
      cat "<skill-dir>/references/$f"; echo
    done
    cat <scratchpad>/facts.md; echo
    for m in shapes routes events env; do
      echo "## Map: $m (rows for this group)"; grep -F -f "$A/files.txt" "<scratchpad>/maps/$m.md"; echo
    done
    echo "## Shapes (added)"; echo "Report new shared shapes in report.md; the main session adds them as rows above for the next wave."
  } > "$A/rules.md"
  ```

  For example, a group of TypeScript and PHP backend files uses `<files>` = `lang/js.md lang/js-style-tsdoc.md lang/js-backend.md lang/php.md`. `grep -F` matches substrings, so a group may get a few extra rows (`src/a.ts` also matches `src/a.tsx`); that is harmless. Each shape row names its owner file, so it filters like the other maps; shapes added between waves are rows too.

Launch one general-purpose agent per group, all groups of a wave in a single message. Give each agent the path to its `agent-<n>/` folder, with the instruction to read `rules.md` in full before editing and to keep helper scripts in that folder. Never retype or summarize the rules in agent prompts. Tell each agent to read collaborators read-only when it needs types, callers or routes (the full maps are in `<scratchpad>/maps/`), to run the checks in **Agent verification** on its own files only, and to report bugs and smells **without fixing them**. Each agent writes its full report to `<scratchpad>/agent-<n>/report.md` and returns one line: files done, files left undocumented, verification result. Some hosts refuse subagent writes of report files: then the agent returns the full report in its reply, and the main session saves it to `report.md` before reading the next one. With no agents, build one `rules.md` the same way for all of `files.txt`: run the snippet with `A=<scratchpad>` (so `$A/files.txt` is the full list and `<scratchpad>/frozen.txt` is the frozen slice), and do the work in the main session. Write the bugs and smells you notice to `<scratchpad>/report.md` as you go, in the agents' format and, in terse style, with a **Terse counts** section; step 5 reads it like an agent's report.

**Between waves:** run verify and each available syntax check on the finished wave's files only (`--files-from` each agent's `files.txt`), and apply the **Failure protocol** to any failure. Copy the wave's edited files into `<scratchpad>/work/` and run there, once, the module-wide checks the language files assign to the main session (`go vet ./...`, `cargo clippy`, `cargo check`, `cargo doc`, Gradle / Maven compile, `dotnet build`); compare them with the baseline. A new warning or error names a file and line: apply the **Failure protocol** to that file. Then take the new shared shapes from the agents' `report.md` files (read their **Shapes** sections only), pick one owner file and exact type name for each, and append them as rows to `<scratchpad>/maps/shapes.md`. The next wave's `rules.md` files pick them up.

## 4. Final verification (main session)

After the last wave, run these in order on the whole of `files.txt`. Every comment edit in this step comes first (item 1) or is followed by the reruns below, so nothing unchecked reaches the report.

1. **Consistency:** spot-check one file per group for the same voice, tag forms and type notation (in terse style also for comments that restate the code and leftover `@param` / `@returns` boilerplate); check that each event and shared shape has exactly one full definition, that every cross-file type reference resolves, and that no `.env` value or secret appears in any comment. Fix drift now, before the checks below.
2. Run `node <scratchpad>/checker/verify.mjs <scratchpad>/orig <project> --files-from <scratchpad>/files.txt --line-limit <limit>` with the flags in `facts.md`. Every check must pass for every file; otherwise apply the **Failure protocol**. Also:
   - **Line length** is part of verify (`--line-limit`): `LONG COMMENT LINE` lines are new or edited comment lines over the limit. Rewrap them.
3. Copy the edited in-scope files into the work copy (`rsync -a --files-from=<scratchpad>/files.txt <project>/ <scratchpad>/work/`) and run each language's syntax check there (the language file names it; the checker's parse covers JS / TS and the tree-sitter languages). Only the files in `baseline/syntax-fail.txt` may fail; any other failure goes to the **Failure protocol**.
4. Copy the edited in-scope files into the work copy (`rsync -a --files-from=<scratchpad>/files.txt <project>/ <scratchpad>/work/`), then rerun the tests there. Pass, fail and skip counts must equal the baseline, leaving out the flaky tests. When a count moves, find the group: restore one group's files in the work copy, rerun, and repeat until the count matches; then apply the **Failure protocol** to that group's files one by one.
5. Build the coverage list, `files.txt` minus the files restored under the Failure protocol (one per line in `<scratchpad>/restored.txt`, created empty in step 2) and minus `line-docs.txt`: `grep -vxF -f <(awk 1 <scratchpad>/restored.txt <scratchpad>/line-docs.txt) <scratchpad>/files.txt > <scratchpad>/cov-files.txt` (empty lists remove nothing). Run `coverage.mjs` with `--files-from <scratchpad>/cov-files.txt`, `--context-from <scratchpad>/files.txt` and the other coverage flags in `facts.md` (`--since` when the policy uses it, `--terse` in terse style); then, when `line-docs.txt` is not empty, run it again over `line-docs.txt` minus `restored.txt`, adding `--line-docs`. Both must print `OK`. `READ BY HAND` lines are plain JS / TS files that Babel cannot parse (verify checks them with tree-sitter): they are not gaps; check their docs by reading and list them in the report. `LOCKED DOC` lines are declarations that start inside locked regions, which cannot be documented: list them in the report with the restored files and the reason.
6. Rerun the type checkers in the work copy and compare per error code. A new error from a doc comment type is fixed in the comment; list any others. A count that **dropped** also needs review: a loosened type hides errors. If declarations were emitted in step 2, emit them again to `<scratchpad>/dts-after` and diff the two folders ignoring comments; any other difference is a failure.
7. Rerun the linters in the work copy and compare per file and rule: no new counts (in terse style, the rules accepted in step 1 may rise; every other count must not). Rerun each formatter's check mode: every file that passed still passes. When one now fails, copy `<scratchpad>/work/` to `<scratchpad>/fmt/` and run that formatter in write mode there, so the project's config and plugins apply. For each in-scope file that passed at baseline and now fails, save the project's version, copy the formatted file into `<project>`, and run verify on it. If verify passes, keep the file (the formatter moved only comments or blank lines). If it fails, put the saved version back and list the file as failing the formatter check. Say which files changed in the report. Formatters that reflow or space out doc comments (spring-javaformat, `mix format`, `dart format`) are the usual cause; the language files name them. Say which tools were not available.
8. **Changed paths**, last, after every tool above has run. List every file written since the snapshot, ignored and dependency folders included: `(cd <project> && find . -path ./.git -prune -o -type f -newer <scratchpad>/start-marker -print | sed 's|^\./||') | LC_ALL=C sort > <scratchpad>/changed.txt` (portable: BSD find has no `-printf`). Then `LC_ALL=C comm -23 <scratchpad>/changed.txt <(LC_ALL=C sort <scratchpad>/files.txt)` lists the paths outside `files.txt` (both lists are relative to `<project>`). In git, also compare `git -C <project> status --porcelain=v1 -uall` with `status-before.txt` for deleted files. Every path must be in `files.txt`. For any other path: a file that was tracked and clean in `status-before.txt` is restored with `git -C <project> restore <path>`; a new untracked file is removed; anything else (a file the user had already changed, or no git) is listed for the user, never overwritten. Say so in the report. Without git, a file deleted outside `files.txt` cannot be detected (verify catches a missing in-scope file); say that too.

**Reruns.** If any item from 2 to 7 leads to a comment change (a fix, or a file restored and redone under the Failure protocol), rerun items 2, 3 and 5 on the changed files (coverage still with `--context-from <scratchpad>/files.txt` and the flags from `facts.md`), then items 4, 6 and 7 once more for the whole project, after copying the changed files into the work copy. Repeat until a full pass needs no change, then run item 8.

## 5. Report

- The languages and stack per package, the dialects with their evidence, checked types, schema tags, comment-reading tools, and the `@since` policy.
- In a run with no user to ask, each choice taken in place of asking.
- Git state at the start, the changed-paths check (step 4, item 8), and how to review the change (`git diff --stat`, then `git diff`), or the scratchpad backup path without git.
- Files documented by area, out-of-scope and `SKIPPED:` and `SKIPPED DIR:` entries (templates, generated code, vendored code), locked declarations, and files left undocumented with the reason.
- In terse style, a per-area summary of what was condensed, dropped and kept, and why, counted from the agents' **Terse counts** sections.
- Verification: the three checker checks, the self-test (with skipped cases), syntax, tests before and after, coverage, type checkers, linters and formatters before and after, and which tools were not run. For each check that did not run, say that the pass is unverified for it and why (missing toolchain, service or platform). Include the number of frozen comments protected.
- Unless intake chose `Doc pass only`: a ranked, de-duplicated list of the **bugs and smells found**, built from the agents' `report.md` files, or `<scratchpad>/report.md` with no agents (read them by count first, then one at a time), each with `file:line`, a one-line problem and a one-line fix. Agents report line numbers from files they were still editing, so find each one again in the final tree (search for the code it names) before writing it down. Rank them as **Report ranking** in `references/discovery.md` says, security first. Do **not** fix them. Ask which ones to fix.

If the user then asks for fixes: add a regression test for each one, confirm it **fails against the original code** in a scratch copy and passes against the new code, and watch for async tests that hang or exit 0 early. Without a test harness, say so and propose the smallest one before writing fixes.

Files in this skill

  • SKILL.md28.4 KB
  • references/agent-verification.md5.1 KB
  • references/bug-check.md7.4 KB
  • references/checker-spec.md23.5 KB
  • references/discovery.md12.4 KB
  • references/lang/c-cpp.md6.7 KB
  • references/lang/clojure.md4.8 KB
  • references/lang/csharp.md6.8 KB
  • references/lang/dart.md5.9 KB
  • references/lang/elixir.md5.2 KB
  • references/lang/erlang.md4.7 KB
  • references/lang/go.md9.3 KB
  • references/lang/haskell.md4.3 KB
  • references/lang/js-backend.md8 KB
  • references/lang/js-frontend.md5.1 KB
  • references/lang/js-meta-frameworks.md6.9 KB
  • references/lang/js-style-jsdoc.md2.5 KB
  • references/lang/js-style-tsdoc.md2.5 KB
  • references/lang/js.md11 KB
  • references/lang/jvm.md7.4 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.