feat(cozystack): add comment-audit and comment-trim skills - #21
Draft
Timofei Larkin (lllamnyp) wants to merge 1 commit into
Draft
Timofei Larkin (lllamnyp) wants to merge 1 commit into
Timofei Larkin (lllamnyp) wants to merge 1 commit into
Conversation
Reviews regularly stall on code comments that argue instead of inform: product rationale, before/after narrative, incident retelling and the same argument restated in a package doc, at the call site and in the PR description. Two skills cover the two halves of that work. cozystack:comment-audit classifies every comment a change added against a single rule -- a comment earns its place when it tells the reader something the code cannot -- and reports cuts, keeps and duplicated arguments with line anchors and quoted text. It is read-only. cozystack:comment-trim applies an audit claim by claim rather than block by block, so a cut claim ends up absent rather than merely shorter, and proves the result with a bundled string-aware stripper that compares both sides of the diff with comments removed. It leaves the edits in the working tree. Both skills are repository-agnostic and carry no Cozystack-specific assumptions. Register them in the plugin and marketplace descriptions, the README catalogue and the layout listing, and bump the plugin minor version for the two additive features. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two skills to the
cozystackplugin, invoked as/cozystack:comment-auditand/cozystack:comment-trim. Plugin version1.15.1→1.16.0(additive features).Both are repository-agnostic — they carry no Cozystack-specific assumptions and are usable on any codebase, in the same way
linstor:recoveris useful on any cluster running LINSTOR.Why
Reviews regularly stall on code comments that argue instead of inform: product rationale, before/after narrative, incident retelling, and the same argument restated in a package doc, again at the call site, and again in the PR description. The two skills split that work into the classification half and the editing half, so the second never runs on comments the first has not judged.
/cozystack:comment-auditClassifies every comment a change added against one rule — a comment earns its place when it tells the reader something the code cannot (mechanism, ordering constraint, aliasing hazard, "why not the obvious approach", silent-failure warning) and is design-doc prose when it argues (product rationale, evolution narrative, incident retelling, UX reasoning, editorializing, restating the line below).
Four phases: scope to the diff, classify each added block in full, sweep for the same argument appearing at several sites, build the keep list. Output is a fixed report shape with line anchors and quoted text, so a reviewer can act without re-reading the diff.
Reports only, modifies nothing — read-only end to end, so there is nothing to gate.
Notable anti-goals it enforces on itself: never forecast an aggregate line count (the estimate runs high and then measures the work); don't judge by comment density (if the surrounding files already carry prose, the local average is the thing being corrected); don't audit generated files or operator-facing config docs like
values.yamland chart templates, where verbosity is usually correct./cozystack:comment-trimApplies an audit. The failure it exists to prevent is compressing an essay and calling it deleted — length was never the complaint, so it works claim by claim rather than block by block: a cut claim must be absent afterwards, a kept claim keeps saying what it said. Where a comment existed to keep code and a design doc in sync, it leaves a pointer to the section rather than a paraphrase, because a paraphrase is a second copy that will drift.
Ships
scripts/comments-only.py, a string-aware comment stripper that compares both sides of the diff with comments removed and exits 0 (no code moved) / 1 (code moved, files named) / 2 (unrecognised language, needs a human). URLs inside literals, Go raw strings, rune literals and Rust lifetimes do not fool it. Verification is two steps: the script, then the project's build/lint/tests for the touched packages only.Leaves changes in the working tree; does not stage, commit, push, or comment on a PR. Gate-and-confirm as usual: read-only lookups run freely, the file-and-claim list is stated before the first edit, and a commit is a separate ask.
Conformance to repo conventions
name, trigger-orienteddescription,argument-hint.# cozystack:<name>, carries the explicit does / does-not-do paragraph, the gate-and-confirm framing, thecozystack:<name>self-naming instruction, phase-transition announcements, and the operator-natural-language note (report prose follows the operator's language; quoted comment text, paths and identifiers stay verbatim).plugins/cozystack/.claude-plugin/plugin.jsonand theplugins[]entry in.claude-plugin/marketplace.json, in the establishedname (one-line summary)pattern, plus the trailing "Invoked as …" list.README.mdskills table and repository-layout listing updated (eleven → thirteen skills). TheCLAUDE.mdskill enumeration was stale at ten and is now correct at thirteen.Verification
bash tools/check-refs.sh— all five checks pass.jqparses both manifests.comments-only.pysmoke-tested; exits 0 on an unchanged file.Review focus
These skills were originally written for private work and have been genericized for publication. The worked examples, the incident-retelling and product-rationale samples, and the design-doc pointer target (
docs/design/upload.md) are all invented placeholders in a neutral upload/retry and cache-key domain. Worth a cold read of bothSKILL.mdfiles for anything that still assumes a particular codebase.Opened as a draft for that reason.