diff --git a/.agents/skills/delete-comment/SKILL.md b/.agents/skills/delete-comment/SKILL.md deleted file mode 100644 index 0501142b4..000000000 --- a/.agents/skills/delete-comment/SKILL.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -name: delete-comment -description: Remove the code comments in one area of the repository by kind (tautology, stale, excuse, decision record), move decisions into docs/adr, file an issue per area for excused hacks, and tighten the comment ratchet. Use when asked to delete, clean up or ratchet down comments in a file, folder or crate. ---- - -# /delete-comment - -Run one pass over an area (a crate, folder or file), not the whole repository: -each comment needs reading in context. The rule and its exemptions are in -`docs/adr/0001-comment-ratchet.md`. - -## 1. List - -```bash -python3 scripts/check-comments.py --list ... -``` - -This prints every counted comment line. Doc comments (`///`, `//!`, `/** */`), -`// SAFETY:` runs and tool directives are not listed and stay. Clap `///` text -is the CLI's `--help` output: keep it. Delete a non-clap doc comment only -when it is a pure tautology. - -Read each run of lines with the code under it before you choose. - -## 2. Categorise and act - -| Kind | Looks like | Action | -| --- | --- | --- | -| Tautology | Repeats the next line, a test step narrating its assert, a section label | Delete | -| Stale | Names code, a file, a version or behaviour that is gone; "used to", "after X.swift" | Delete | -| Excuse | Justifies a workaround: an invariant held by a comment (`copies[0]` "always one"), a limit raised for a hack, the same code copied with "as for …" | Delete, and add it to the area's issue | -| Decision record | A non-obvious reason: ordering, a race, a security boundary, a UX rule, an issue number | Move it into an ADR | - -Prefer turning a small reason into code over moving it: a name -(`template_safe_about`), a computed expected value in a test -(`1.0 * 1.25 + 0.1 * 10.0`), an assertion message, a type that makes the -invariant hold. - -## 3. Write the ADRs - -- One ADR per topic in `docs/adr/NNNN-.md`, numbered after the highest - one. Head it with `Status: accepted, . Code: `, then - short sections of bullets in plain words. Add it to the table in - `docs/adr/README.md`. -- Keep the issue numbers. Check every name you cite (functions, flags, - timeouts) against the code. -- If an area doc in `docs/` already explains the topic, add the decision - there instead and say so in the PR. - -## 4. File the excuses - -One issue per area, not one per comment: - -```bash -gh issue create --title "refactor(): remove the workarounds comments excused in " --body-file -``` - -The body has one checklist item for each excuse: `path:line` (before the -deletion), the deleted comment quoted, the hack, the fix, and the acceptance -criteria. Follow `AGENTS.md` › Issues. - -## 5. Ratchet and check - -```bash -python3 scripts/check-comments.py --update # the baseline only shrinks -python3 scripts/check-comments.py -``` - -Then run the repository's checks for the files you touched (`AGENTS.md` › -Checks). After deleting a block, look for blank-line leftovers. - -## 6. Report - -In the PR body, give the counts by kind, the ADRs written, the issue URL, -and the lines removed (`git diff --shortstat`). Name the area for the next -pass by the size of each area's baseline: - -```bash -awk '!/^#/{split($2,p,"/"); a[p[1]"/"p[2]]+=$1} END{for(k in a) print a[k], k}' scripts/comment-baseline.txt | sort -nr | head -``` diff --git a/.claude/skills/delete-comment b/.claude/skills/delete-comment deleted file mode 120000 index 9f883e374..000000000 --- a/.claude/skills/delete-comment +++ /dev/null @@ -1 +0,0 @@ -../../.agents/skills/delete-comment \ No newline at end of file diff --git a/.gitignore b/.gitignore index 82df4e74e..ab6aa4db1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,7 @@ docs/superpowers/ # Thread-tools eval transcripts (each run writes one). /scripts/evals/thread-tools/runs/ + +# per-user agent skills live in ~/.agents/skills +/.agents/ +/.claude/ diff --git a/docs/adr/0001-comment-ratchet.md b/docs/adr/0001-comment-ratchet.md index 2c4593f88..6c4003e51 100644 --- a/docs/adr/0001-comment-ratchet.md +++ b/docs/adr/0001-comment-ratchet.md @@ -27,8 +27,9 @@ silently, and an excuse in a comment lets a hack pass review. `prettier-ignore`, `rustfmt::…`) and a first-line shebang. - An existing comment is removed by its kind: a tautology or stale note is deleted; an excuse is deleted and the hack gets an issue; a decision moves - into an ADR here or the doc for its area. `/delete-comment` - (`.agents/skills/delete-comment/SKILL.md`) runs the pass on one area. + into an ADR here or the doc for its area. The global + `/delete-comment` skill (`~/.agents/skills/delete-comment`) runs the pass + on one area. ## Consequences