@staff0rd/assist 0.300.0 → 0.301.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,6 +58,7 @@ After installation, the `assist` command will be available globally. You can als
58
58
  - `/journal` - Append a journal entry summarising recent work, decisions, and notable observations
59
59
  - `/next [id]` - Signal completion and chain into the next backlog item; pass an `id` to run a specific item directly (falls back to the picker if the id is missing, done, won't-do, or blocked)
60
60
  - `/standup` - Summarise recent journal entries as a standup update
61
+ - `/strip-comments` - Enforce self-documenting code: declare the comment policy in CLAUDE.md if absent, then strip redundant comments, commented-out code, and section banners from tracked source files (functional directives and genuine workaround comments are preserved); edits are left unstaged
61
62
  - `/sync` - Sync commands and settings to ~/.claude
62
63
  - `/test-cover` - Incrementally increase test coverage by identifying and testing uncovered files
63
64
  - `/test-review` - Review existing tests for quality, coverage gaps, and adherence to conventions
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Enforce self-documenting code by declaring the comment policy and stripping redundant comments
3
+ ---
4
+
5
+ You are enforcing a self-documenting code style: code should explain itself, and comments should only earn their place when they convey something the code cannot.
6
+
7
+ ## Step 1: Ensure CLAUDE.md declares the policy
8
+
9
+ Read `CLAUDE.md` at the repository root.
10
+
11
+ Decide whether it already states a code-style or commenting policy — look for an existing `## Code style` heading, a `## Commenting code` (or similar) section, or any prose that tells contributors not to write comments that restate the code.
12
+
13
+ - If such a policy is **already present**, leave `CLAUDE.md` unchanged. Do not duplicate or reword it.
14
+ - If **no** such policy exists, append the following section verbatim (including the heading) to the end of `CLAUDE.md`:
15
+
16
+ ```markdown
17
+ ## Code style
18
+
19
+ Write self-documenting code. Do not add comments that restate what the code already says, label obvious sections, or narrate standard logic and syntax. Only comment when a line involves unintuitive complexity, a genuine hack, or a workaround that the code itself cannot make clear. Never leave commented-out code in the tree.
20
+ ```
21
+
22
+ ## Step 2: Enumerate tracked source files
23
+
24
+ List git-tracked source files with `git ls-files`. Restrict to source files (e.g. `.ts`, `.tsx`, `.js`, `.jsx`, `.cs`, `.py`, `.go`, `.rs`, `.java`, `.kt`, `.rb`, `.c`, `.h`, `.cpp`, `.css`, `.scss`, `.sh`). Skip generated output, lockfiles, vendored dependencies, and markdown/docs.
25
+
26
+ ## Step 3: Remove violating comments
27
+
28
+ Read each file and remove only comments that violate the policy:
29
+
30
+ - **Redundant explanatory comments** that restate what the adjacent code plainly does (e.g. `// increment counter` above `counter++`).
31
+ - **Commented-out code** — dead code left in the tree.
32
+ - **Section-banner comments** that merely label a region (e.g. `// ---- helpers ----`, `// === Setup ===`).
33
+
34
+ **Never remove** the following, even if they look like noise:
35
+
36
+ - **Functional directives** that the toolchain acts on: `eslint-disable*`, `@ts-expect-error`, `@ts-ignore`, `biome-ignore`, `prettier-ignore`, `// @ts-nocheck`, coverage pragmas (`c8 ignore`, `istanbul ignore`), `noqa`, `type: ignore`, `#pragma`, `//go:`-style directives, and similar.
37
+ - **Comments marking a genuine hack or workaround** — anything explaining *why* non-obvious code exists, including `HACK`/`WORKAROUND`/`FIXME`/`TODO` notes, links to issues, or rationale the code cannot convey on its own.
38
+ - **Doc comments** that form part of an API contract (JSDoc/TSDoc, XML doc comments, docstrings) unless they only restate the signature.
39
+
40
+ When in doubt, keep the comment. The cost of leaving a borderline comment is far lower than deleting one that carries intent.
41
+
42
+ ## Step 4: Apply as unstaged edits and summarise
43
+
44
+ Apply every removal directly to the working tree using Edit. **Do not stage and do not commit** — leave all changes unstaged for the user to review.
45
+
46
+ Then print a per-file summary, for example:
47
+
48
+ ```
49
+ src/foo.ts 3 removed
50
+ src/bar/baz.ts 1 removed
51
+ ```
52
+
53
+ For each file with removals, list the removed comments (a short quote of each) so the user can audit the changes. End with the total count and a reminder that the edits are unstaged and ready for review.
@@ -80,6 +80,9 @@
80
80
  "SlashCommand(/handover)",
81
81
  "Skill(recall)",
82
82
  "SlashCommand(/recall)",
83
+ "Skill(strip-comments)",
84
+ "SlashCommand(/strip-comments)",
85
+ "Bash(git ls-files:*)",
83
86
  "WebFetch(domain:staffordwilliams.com)"
84
87
  ],
85
88
  "deny": [
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.300.0",
9
+ version: "0.301.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.300.0",
3
+ "version": "0.301.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {