@staff0rd/assist 0.300.0 → 0.302.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 +2 -1
- package/claude/commands/add-command.md +1 -1
- package/claude/commands/strip-comments.md +53 -0
- package/claude/commands/verify-new.md +2 -2
- package/claude/settings.json +3 -0
- package/dist/index.js +1381 -1306
- package/package.json +1 -1
- package/dist/commands/lint/biome.linter.json +0 -66
- package/dist/commands/lint/init.ts +0 -56
- package/dist/commands/lint/lint/applyMoves.ts +0 -50
- package/dist/commands/lint/lint/checkFileNames.ts +0 -81
- package/dist/commands/lint/lint/createLintProject.ts +0 -16
- package/dist/commands/lint/lint/fixFileNameViolations.ts +0 -16
- package/dist/commands/lint/lint/index.ts +0 -17
- package/dist/commands/lint/lint/renameExports.ts +0 -37
- package/dist/commands/lint/lint/runFileNameCheck.ts +0 -45
- package/dist/commands/lint/lint/runImportExtensionCheck.ts +0 -45
- package/dist/commands/lint/lint/runStaticImportCheck.ts +0 -45
- package/dist/commands/lint/shared.ts +0 -29
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
|
|
@@ -159,7 +160,7 @@ The first backlog command in a repository that still has a local `.assist/backlo
|
|
|
159
160
|
- `assist verify hardcoded-colors` - Check for hardcoded hex colors in src/ (supports `hardcodedColors.ignore` globs in config)
|
|
160
161
|
- `assist verify comment-policy` - Flag comments added on changed lines (staged + unstaged) unless they carry a justification marker; supports `commentPolicy.markers` and `commentPolicy.ignore` globs in config
|
|
161
162
|
- `assist lint [-f, --fix]` - Run lint checks for conventions not enforced by oxlint (use `-f` to auto-fix)
|
|
162
|
-
- `assist lint init` - Initialize
|
|
163
|
+
- `assist lint init` - Initialize oxlint with baseline linter config
|
|
163
164
|
- `assist refactor check [pattern]` - Check for files that exceed the maximum line count
|
|
164
165
|
- `assist refactor ignore <file>` - Add a file to the refactor ignore list
|
|
165
166
|
- `assist refactor rename file <source> <destination>` - Rename/move a TypeScript file and update all imports (dry-run by default, use `--apply` to execute)
|
|
@@ -18,7 +18,7 @@ Run `assist run add --help` to see the current CLI usage and options. Use the ou
|
|
|
18
18
|
Run `assist run add <name> <command> [args...]` with the appropriate arguments. For example:
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
assist run add lint
|
|
21
|
+
assist run add lint oxlint --fix
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
If the command needs a working directory, use `--cwd <dir>`.
|
|
@@ -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.
|
|
@@ -18,7 +18,7 @@ Run `assist run add --help` to see the current CLI usage and options. Use the ou
|
|
|
18
18
|
`assist verify` runs every `verify:*` entry in parallel and only surfaces output for the ones that fail. A noisy success drowns the signal, so before registering the command, find the flag(s) that make the wrapped tool silent on success:
|
|
19
19
|
|
|
20
20
|
- Check the tool's `--help` for options like `--silent`, `--quiet`, `-q`, `--reporter=dot`, `--reporter=line`, `--no-progress`, `--log-level=error`, `--no-color`, etc.
|
|
21
|
-
- Prefer reporters that print only failures (e.g. `vitest --reporter=dot`, `
|
|
21
|
+
- Prefer reporters that print only failures (e.g. `vitest --reporter=dot`, `oxlint --quiet`, `tsc --pretty false`).
|
|
22
22
|
- If the tool always prints a banner or summary on success, look for a way to suppress it (redirect, `--no-summary`, etc.). Mention any unavoidable noise to the user.
|
|
23
23
|
|
|
24
24
|
Apply those flags as part of the args you pass to `assist run add`.
|
|
@@ -29,7 +29,7 @@ Run `assist run add verify:<name> <command> [args...]` with the quiet flags appl
|
|
|
29
29
|
|
|
30
30
|
```
|
|
31
31
|
assist run add verify:test vitest run --reporter=dot
|
|
32
|
-
assist run add verify:lint
|
|
32
|
+
assist run add verify:lint oxlint . --quiet
|
|
33
33
|
assist run add verify:types tsc --noEmit --pretty false
|
|
34
34
|
```
|
|
35
35
|
|
package/claude/settings.json
CHANGED