Prune Comments (Strict Zero-Tolerance)
Reviews every existing non-doc comment and deletes or refactors it. The codebase must adhere strictly to clean code principles where executable architecture replaces narration.
Scope
Resolve $ARGUMENTS to a target in this order — stop at the first match:
- No argument → run
git status --porcelain. Scope to uncommitted changes. - A filesystem path → scope to that path.
- A PR reference → scope to files in that PR's branch.
- A branch name → diff against merge base with
origin/HEADand scope to touched files. - Whole-repo request → the entire repo is in scope.
Regardless of scope, skip: .git, build/output dirs (target, dist), and vendored/generated code.
The Bar: Total Deletion & Executable Refactoring
ALL inline comments (//, #, --) fail the bar and MUST be deleted.
Instead of leaving comments, you must apply these transformations:
- Restatements & Design Defenses: Delete silently. Identifier names are the documentation.
- Commented-out code: Delete silently. Git history holds it.
- Complex Logic: You MUST refactor the code (extract methods, rename variables, simplify branching) to make the intent obvious.
- Platform Quirks / Safety Constraints / Cross-file Facts: You MUST encode these into the architecture. Translate the warning into a runtime assertion (
assert,require), a highly descriptive custom exception message, or a dedicated, explicitly named wrapper method that isolates the quirk.
What never gets touched
- License/copyright headers.
SAFETY:/# Safetycomments strictly required aboveunsafeblocks.- Formal doc comments (
///,/** */, docstrings) — these define API contracts and are out of scope.
Process
- Resolve scope from
$ARGUMENTS. - For each file in scope, find every inline comment.
- Edit in place: Delete all inline comments. Refactor code, extract methods, or add descriptive exception/assertion messages to absorb any critical constraints previously hidden in the comments. Do not add any new comments.
- After editing a file, verify it still parses/compiles/lints cheaply.
- Re-scan to ensure absolutely zero inline non-doc comments remain.
Reporting
Summarize per file: lines of comments eradicated, and list every structural refactor (method extractions, assertions added, exceptions renamed) performed to absorb load-bearing rationale.