{"_id":"@aaronkyriesenbach/pi-clean-comments","_rev":"5-29d97470cb3b3764723ee1a9f4b70772","name":"@aaronkyriesenbach/pi-clean-comments","dist-tags":{"docs-add-license-section":"0.1.0-docs-add-license-section.201711e","latest":"0.4.0"},"versions":{"0.1.1":{"name":"@aaronkyriesenbach/pi-clean-comments","version":"0.1.1","keywords":["pi-package","pi-extension"],"author":"Aaron Ky-Riesenbach","license":"MIT","_id":"@aaronkyriesenbach/pi-clean-comments@0.1.1","maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"pi":{"extensions":["./extensions/index.ts"]},"dist":{"shasum":"bc5f7175ff75696a0cc5eb311724623dfabd3054","tarball":"https://registry.npmjs.org/@aaronkyriesenbach/pi-clean-comments/-/pi-clean-comments-0.1.1.tgz","fileCount":3,"integrity":"sha512-pLMw4ZTqM5YsrlDL8pq1HRAE2J0D/0MGm421M8pGUJ/kdXqBhXj5gH3SzYJrWC4I/ZHCmvJq6WTQpXSWmzEnLw==","signatures":[{"sig":"MEUCICprvoq7iYrt8OERbJqnp4WQMiMhl77oVlgDYKJz6KcXAiEA3bek0hyEAkG9NQm90WaqdS+o5IkCa8ERbkWnj/M+UHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6964},"type":"module","shasum":"bc5f7175ff75696a0cc5eb311724623dfabd3054","engines":{"node":">=22.19.0"},"scripts":{"lint":"eslint .","test":"vitest run","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage","prepublishOnly":"bun run typecheck && bun run lint && bun run format:check && bun run test:coverage"},"_npmUser":{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"},"_integrity":"sha512-pLMw4ZTqM5YsrlDL8pq1HRAE2J0D/0MGm421M8pGUJ/kdXqBhXj5gH3SzYJrWC4I/ZHCmvJq6WTQpXSWmzEnLw==","repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"_npmVersion":"10.8.3","description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"^0.80.10"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-clean-comments_0.1.1_1785709197502_0.9560041710021183","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-docs-add-license-section.201711e":{"name":"@aaronkyriesenbach/pi-clean-comments","version":"0.1.0-docs-add-license-section.201711e","keywords":["pi-package","pi-extension"],"author":"Aaron Ky-Riesenbach","license":"MIT","_id":"@aaronkyriesenbach/pi-clean-comments@0.1.0-docs-add-license-section.201711e","maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"pi":{"extensions":["./extensions/index.ts"]},"dist":{"shasum":"de2bcbbb3c6891c249a20f7b89cec127b589a7dc","tarball":"https://registry.npmjs.org/@aaronkyriesenbach/pi-clean-comments/-/pi-clean-comments-0.1.0-docs-add-license-section.201711e.tgz","fileCount":3,"integrity":"sha512-aUu0Dn38VazRG9J38U9x4g29ClCHUiDeJj32GVlCm/g3GOxIhOmKBQdFbB4gz8L+Xpj+CapdJgn/OFAhkjkifA==","signatures":[{"sig":"MEUCIQCwm0E1dpR5lztcsBtipWWPuCJHAyRbFyi6yUNsKCfSkAIgPXmpinTapxbMhK3QeHOuJffbvo29tdty/eG1AJ6x32g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7014},"type":"module","shasum":"de2bcbbb3c6891c249a20f7b89cec127b589a7dc","engines":{"node":">=22.19.0"},"scripts":{"lint":"eslint .","test":"vitest run","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage","prepublishOnly":"bun run typecheck && bun run lint && bun run format:check && bun run test:coverage"},"_npmUser":{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"},"_integrity":"sha512-aUu0Dn38VazRG9J38U9x4g29ClCHUiDeJj32GVlCm/g3GOxIhOmKBQdFbB4gz8L+Xpj+CapdJgn/OFAhkjkifA==","repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"_npmVersion":"10.8.3","description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@earendil-works/pi-coding-agent":"^0.80.10"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-clean-comments_0.1.0-docs-add-license-section.201711e_1785709402523_0.6039997787678142","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aaronkyriesenbach/pi-clean-comments","version":"0.2.0","keywords":["pi-package","pi-extension"],"author":"Aaron Ky-Riesenbach","license":"MIT","_id":"@aaronkyriesenbach/pi-clean-comments@0.2.0","maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"pi":{"extensions":["./extensions/index.ts"]},"dist":{"shasum":"4634e683a5f0a73010556df6feb2bbd26521b59c","tarball":"https://registry.npmjs.org/@aaronkyriesenbach/pi-clean-comments/-/pi-clean-comments-0.2.0.tgz","fileCount":3,"integrity":"sha512-ZHUIL+1zAY7VFB9ikAhb+hDSGJaiHM3QPXj/ZXxTt9MXk4einOwrPkn3/vZyrqykEb8sxeQE6KSBrkQ9vDrH7Q==","signatures":[{"sig":"MEUCIQC3+WzhE4w7b5DoLwW39mPvCudleE4Br8Zs4kqRfSzzpAIgQy8BYWlwpYWitusVgYsLy60YcUH0lsZqZYxDm3Y6Iw8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6981},"type":"module","shasum":"4634e683a5f0a73010556df6feb2bbd26521b59c","engines":{"node":">=22.19.0"},"scripts":{"lint":"eslint .","test":"vitest run","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage","prepublishOnly":"bun run typecheck && bun run lint && bun run format:check && bun run test:coverage"},"_npmUser":{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"},"_integrity":"sha512-ZHUIL+1zAY7VFB9ikAhb+hDSGJaiHM3QPXj/ZXxTt9MXk4einOwrPkn3/vZyrqykEb8sxeQE6KSBrkQ9vDrH7Q==","repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"_npmVersion":"10.8.3","description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"^0.80.10"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-clean-comments_0.2.0_1785962091555_0.530405009977178","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aaronkyriesenbach/pi-clean-comments","version":"0.3.0","keywords":["pi-package","pi-extension"],"author":"Aaron Ky-Riesenbach","license":"MIT","_id":"@aaronkyriesenbach/pi-clean-comments@0.3.0","maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"pi":{"extensions":["./extensions/index.ts"]},"dist":{"shasum":"ede09d7f5943efa2d563190d544cfd098d7c7d33","tarball":"https://registry.npmjs.org/@aaronkyriesenbach/pi-clean-comments/-/pi-clean-comments-0.3.0.tgz","fileCount":3,"integrity":"sha512-fP+nbd8kTdc5w42NrkAQTOMke2xnMgxdJA3diCInlXyjXhMWBnr2DtqXPptfH/w/drqEIyIpyU+5Ot0QOOqisA==","signatures":[{"sig":"MEUCIQCfbXnQBFBj5uNJ4npz8u1xajNbSVFjF8PmfTtVR+APDQIgdmIS1qYR4SGBHf8R2mf7CixmTFlU8sLRgXtCC7W/zaI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14321},"type":"module","shasum":"ede09d7f5943efa2d563190d544cfd098d7c7d33","engines":{"node":">=22.19.0"},"scripts":{"lint":"eslint .","test":"vitest run","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage","prepublishOnly":"bun run typecheck && bun run lint && bun run format:check && bun run test:coverage"},"_npmUser":{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"},"_integrity":"sha512-fP+nbd8kTdc5w42NrkAQTOMke2xnMgxdJA3diCInlXyjXhMWBnr2DtqXPptfH/w/drqEIyIpyU+5Ot0QOOqisA==","repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"_npmVersion":"10.8.3","description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"^0.80.10"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-clean-comments_0.3.0_1786123205719_0.2649960686271218","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"pi":{"extensions":["./extensions/index.ts"]},"_id":"@aaronkyriesenbach/pi-clean-comments@0.4.0","bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"dist":{"shasum":"d35f4e24b997cb09fb966d45931e07dae9b3c327","tarball":"https://registry.npmjs.org/@aaronkyriesenbach/pi-clean-comments/-/pi-clean-comments-0.4.0.tgz","fileCount":3,"integrity":"sha512-uhxgcF5h8tvXub7FlieySiXEv1k873jF+b1moz96f44m1T102pIc5f6CU2l946mrOdX7h2bQvgMXyFT+TU/gKg==","signatures":[{"sig":"MEYCIQDq3H6RxCJdMMyPMnv94sUyCnBC5e/X7q8MbZ+qcaUBAgIhAODlItGFNt50kSIR+8k/1PmmVqqLyfBMJesUpazMLH71","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4XP8wkLNsE06LlmwOYxfcMfg9ro2Et9pMQU720nKt8AIgVgpq7GSKO90yB1J2l8EvUqD9y3ypQXZsSpdgeDXi3Go="}],"unpackedSize":20740},"name":"@aaronkyriesenbach/pi-clean-comments","type":"module","author":"Aaron Ky-Riesenbach","shasum":"d35f4e24b997cb09fb966d45931e07dae9b3c327","engines":{"node":">=22.19.0"},"license":"MIT","scripts":{"lint":"eslint .","test":"vitest run","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage","prepublishOnly":"bun run typecheck && bun run lint && bun run format:check && bun run test:coverage"},"version":"0.4.0","_npmUser":{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"},"homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","keywords":["pi-package","pi-extension"],"_integrity":"sha512-uhxgcF5h8tvXub7FlieySiXEv1k873jF+b1moz96f44m1T102pIc5f6CU2l946mrOdX7h2bQvgMXyFT+TU/gKg==","repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"_npmVersion":"10.8.3","description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","directories":{},"maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"_nodeVersion":"26.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"^0.80.10"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-clean-comments_0.4.0_1789060919722_0.026743580603665107"}}},"time":{"created":"2026-08-02T22:19:57.327Z","modified":"2026-09-10T17:21:59.983Z","0.1.1":"2026-08-02T22:19:57.628Z","0.1.0-docs-add-license-section.201711e":"2026-08-02T22:23:22.664Z","0.2.0":"2026-08-05T20:34:51.686Z","0.3.0":"2026-08-07T17:20:05.866Z","0.4.0":"2026-09-10T17:21:59.816Z"},"bugs":{"url":"https://github.com/aaronkyriesenbach/pi-packages/issues"},"author":"Aaron Ky-Riesenbach","license":"MIT","homepage":"https://github.com/aaronkyriesenbach/pi-packages/tree/master/packages/pi-clean-comments","keywords":["pi-package","pi-extension"],"repository":{"url":"git+ssh://git@github.com/aaronkyriesenbach/pi-packages.git","type":"git","directory":"packages/pi-clean-comments"},"description":"Pi extension that nudges the agent to reconsider every comment it adds or edits, favoring deletion unless a comment earns its place.","maintainers":[{"name":"aaronkyriesenbach","email":"npm.shimmy035@passmail.net"}],"readme":"# pi-clean-comments\n\nA [pi](https://pi.dev) extension that nudges the agent to reconsider every\ncomment it adds or edits, favoring deletion unless a comment earns its\nplace.\n\n## Why\n\nCoding agents tend to over-comment: narrating obvious lines, restating a\nfunction name in prose, or leaving comments that don't survive the code\nthey described being refactored. This extension adds a lightweight,\nstructural check (no NLP, no allowlist) that fires whenever an Edit or\nWrite tool call touches at least one comment line, appending a note that\nquotes back each added comment's file:line and text and reminds the agent\nto keep only comments that explain a non-obvious why or gotcha —\neverything else should be deleted or cut to the minimum.\n\nThe note is wrapped in a `<comment-check required severity=\"...\">` block\nand quotes the exact lines added rather than just a count — a generic \"N\ntouched\" tally is easy to skim past after the tenth occurrence, but the\nagent's own words quoted back at it are harder to wave off.\n\nContiguous added comment lines are grouped into one block, and both the\nwording and the tag's `severity` attribute scale with block length:\n\n| Block length | Severity | Framing                                                           |\n| ------------ | -------- | ----------------------------------------------------------------- |\n| 1 line       | `single` | Light sanity check — does this line earn its place?               |\n| 2–4 lines    | `short`  | Justify why it isn't one line, or delete it.                      |\n| 5+ lines     | `long`   | Almost never required — justify every line or cut it to ≤2 lines. |\n\nA 10-line comment block gets a noticeably harsher note than a single\ntrailing one-liner, since it's the case most likely to be narration\ninstead of a genuine why/gotcha.\n\n### Block comments\n\nFor file extensions with a registered `/* */`-style delimiter pair (most\nC-style languages — see `BLOCK_COMMENT_TOKENS` in\n`extensions/index.ts`), detection is block-aware in both tool paths:\n\n- **`write`**: the full supplied file body is scanned for open/close\n  delimiter pairs, so every line of a multi-line block comment is flagged,\n  not just the ones with their own token.\n- **`edit`**: the file's current on-disk content is read after the edit\n  and scanned the same way, then intersected with the lines the patch\n  actually added. This means an edit that appends a new line into the\n  middle of a block comment opened by an earlier, unrelated edit is still\n  flagged, even though that open delimiter never appears in the current\n  diff's hunk context. If the post-edit read fails (file deleted/moved,\n  permission error, etc.), detection falls back to patch-only, line-token\n  detection for that call rather than reporting nothing.\n\nFile extensions with no registered block delimiter (Python, YAML, shell,\nRuby, etc.) are unaffected and keep the exact line-token-only behavior\nthey've always had.\n\n## Install\n\n```bash\npi install npm:@aaronkyriesenbach/pi-clean-comments\n```\n\nOr add it to `.pi/settings.json` / `~/.pi/agent/settings.json`:\n\n```json\n{\n  \"packages\": [\"npm:@aaronkyriesenbach/pi-clean-comments\"]\n}\n```\n\n## Development\n\n```bash\nbun install\nbun run typecheck\nbun run lint\nbun run format:check\nbun run test:coverage\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}