@staff0rd/assist 0.1070.0 → 0.1071.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/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.1070.0",
9
+ version: "0.1071.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -853,6 +853,17 @@ function warnYmlRepoOverride(key) {
853
853
  );
854
854
  }
855
855
 
856
+ // src/shared/stripLegacyReviewKeys.ts
857
+ var LEGACY_REVIEW_HIGH_LEVEL_KEYS = ["slices"];
858
+ function stripLegacyReviewKeys(review2) {
859
+ if (!review2 || typeof review2 !== "object") return review2;
860
+ const { highLevel, ...rest } = review2;
861
+ if (!highLevel || typeof highLevel !== "object") return review2;
862
+ const kept = { ...highLevel };
863
+ for (const key of LEGACY_REVIEW_HIGH_LEVEL_KEYS) delete kept[key];
864
+ return { ...rest, highLevel: kept };
865
+ }
866
+
856
867
  // src/shared/stripLegacyConfigKeys.ts
857
868
  var LEGACY_SESSIONS_KEYS = [
858
869
  "windowsProjectsRoot",
@@ -899,6 +910,7 @@ function stripLegacyConfigKeys(config) {
899
910
  stripped.worktree = withoutKeys(stripped.worktree, LEGACY_WORKTREE_KEYS);
900
911
  if (stripped.devlog)
901
912
  stripped.devlog = withoutKeys(stripped.devlog, LEGACY_DEVLOG_KEYS);
913
+ if (stripped.review) stripped.review = stripLegacyReviewKeys(stripped.review);
902
914
  return stripped;
903
915
  }
904
916
 
@@ -1279,8 +1291,7 @@ var assistConfigShape = {
1279
1291
  uiPaths: z6.array(z6.string()).default([]),
1280
1292
  descriptionWordCap: z6.number().int().positive().default(300),
1281
1293
  testPaths: z6.array(z6.string()).default(["**/*.{test,spec}.{ts,tsx,js,jsx}"]),
1282
- collapsedPaths: z6.array(z6.string()).default(["**/*.test.*", "**/generated/**"]),
1283
- slices: z6.boolean().default(false)
1294
+ collapsedPaths: z6.array(z6.string()).default(["**/*.test.*", "**/generated/**"])
1284
1295
  }).optional()
1285
1296
  }).optional(),
1286
1297
  readTime: z6.strictObject({
@@ -6664,11 +6675,6 @@ var reviewConfigHelp = [
6664
6675
  key: "review.highLevel.collapsedPaths",
6665
6676
  setter: 'assist config set review.highLevel.collapsedPaths "**/*.test.*,**/generated/**"',
6666
6677
  note: "comma-separated globs whose files start collapsed in the high-level changed-files tree; every other file starts expanded (default **/*.test.*,**/generated/**)"
6667
- },
6668
- {
6669
- key: "review.highLevel.slices",
6670
- setter: "assist config set review.highLevel.slices true",
6671
- note: "experimental; in an assist session, --high-level has the session agent split the PR into slices (via --slices) and groups the Structure item by slice (default false)"
6672
6678
  }
6673
6679
  ];
6674
6680
 
@@ -40833,8 +40839,7 @@ function resolveHighLevelConfig(config) {
40833
40839
  uiPaths: highLevel?.uiPaths ?? [],
40834
40840
  descriptionWordCap: highLevel?.descriptionWordCap ?? DEFAULT_DESCRIPTION_WORD_CAP,
40835
40841
  testPaths: highLevel?.testPaths ?? DEFAULT_TEST_PATHS,
40836
- collapsedPaths: highLevel?.collapsedPaths ?? DEFAULT_COLLAPSED_PATHS,
40837
- slices: highLevel?.slices ?? false
40842
+ collapsedPaths: highLevel?.collapsedPaths ?? DEFAULT_COLLAPSED_PATHS
40838
40843
  };
40839
40844
  }
40840
40845
 
@@ -41366,7 +41371,7 @@ var EXAMPLE = {
41366
41371
  };
41367
41372
  function formatSlicingRequest(hunks) {
41368
41373
  return [
41369
- "Slicing required: review.highLevel.slices is on, so this PR must be split into slices before the review opens.",
41374
+ "Slicing required: this PR must be split into slices before the review opens.",
41370
41375
  "",
41371
41376
  "Write the slices and the manual testing steps as JSON to a scratch file, then re-run this command with the same arguments plus `--slices <file>`:",
41372
41377
  "",
@@ -41871,7 +41876,7 @@ function gatherHighLevelSubject(prNumber, force, slicing) {
41871
41876
  const fetched = fetchHighLevelFiles(prNumber, slug2);
41872
41877
  const files = capHighLevelPatches(fetched, config.criticalPaths);
41873
41878
  const head = { repo: slug2, headRef: pr.headRef, headSha: pr.headSha };
41874
- const sliced = slicing && config.slices ? gatherHighLevelSlices(head, files, slicing) : void 0;
41879
+ const sliced = slicing ? gatherHighLevelSlices(head, files, slicing) : void 0;
41875
41880
  return {
41876
41881
  ...head,
41877
41882
  prNumber,
@@ -44660,7 +44665,7 @@ function addReviewModeOptions(command) {
44660
44665
  "Check the PR out and open the high-level review checklist in the web UI preview pane, then post it to the PR as an Approve, Comment or Request changes review. Outside a Claude session it starts one running /review-high-level <number>. A review saved for the same head SHA is reopened unless --force is passed. Cannot be combined with --refine, --apply, --backlog, --submit or --checkout-only"
44661
44666
  ).option(
44662
44667
  "--slices <file>",
44663
- `With --high-level and review.highLevel.slices on, in an assist session: read the PR's slices from a JSON file of [{title, summary, hunks[]}], where hunks are the path#index labels printed when the command refuses without slices. Unknown refs are dropped with a warning, unclaimed hunks go into an "Everything else" slice, and the slices are saved for this head SHA so a reopen reuses them unless --force is passed`
44668
+ `With --high-level, in an assist session: read the PR's slices from a JSON file of [{title, summary, hunks[]}], where hunks are the path#index labels printed when the command refuses without slices. Unknown refs are dropped with a warning, unclaimed hunks go into an "Everything else" slice, and the slices are saved for this head SHA so a reopen reuses them unless --force is passed`
44664
44669
  ).option(
44665
44670
  "--configure",
44666
44671
  "With --high-level: review nothing and instead ask for review.highLevel.criticalPaths, uiPaths and descriptionWordCap one at a time, each prefilled with its current value or, when unset, globs Claude proposes from this repo's own tree (for criticalPaths, merged with its defaults), then write the answers in one pass to either this repo's override in the shared assist database or the project assist.yml. A blank answer leaves that key unset"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.1070.0",
3
+ "version": "0.1071.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,56 +0,0 @@
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`), plus `#`-comment config and script files: `Dockerfile` (and variants `Dockerfile.*` / `*.dockerfile`), `*.env`, `*.sh`, and GitHub workflow and action YAML (`.github/workflows/*.yml` / `.yaml`, `action.yml` / `action.yaml`). Skip generated output, lockfiles, vendored dependencies, and markdown/docs.
25
-
26
- For `*.sh` files, leave the leading header block untouched — the contiguous run of shebang, blank, and `#` lines from the top of the file, ending at the first line of code. Only strip violating `#` comments that appear **after** that header block. Dockerfile and `*.env` files have no such allowance; treat every `#` comment as in-scope.
27
-
28
- ## Step 3: Remove violating comments
29
-
30
- Read each file and remove only comments that violate the policy:
31
-
32
- - **Redundant explanatory comments** that restate what the adjacent code plainly does (e.g. `// increment counter` above `counter++`).
33
- - **Commented-out code** — dead code left in the tree.
34
- - **Section-banner comments** that merely label a region (e.g. `// ---- helpers ----`, `// === Setup ===`).
35
-
36
- **Never remove** the following, even if they look like noise:
37
-
38
- - **Functional directives** that the toolchain acts on: `eslint-disable*`, `@ts-expect-error`, `@ts-ignore`, `oxlint-disable`, `prettier-ignore`, `// @ts-nocheck`, coverage pragmas (`c8 ignore`, `istanbul ignore`), `noqa`, `type: ignore`, `#pragma`, `//go:`-style directives, and similar.
39
- - **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.
40
- - **SHA-pin version comments** — a trailing comment naming the tag/version on a `uses:` line pinned to a commit SHA (e.g. `uses: actions/checkout@<sha> # v4.2.2`).
41
- - **Doc comments** that form part of an API contract (JSDoc/TSDoc, XML doc comments, docstrings) unless they only restate the signature.
42
-
43
- When in doubt, keep the comment. The cost of leaving a borderline comment is far lower than deleting one that carries intent.
44
-
45
- ## Step 4: Apply as unstaged edits and summarise
46
-
47
- 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.
48
-
49
- Then print a per-file summary, for example:
50
-
51
- ```
52
- src/foo.ts 3 removed
53
- src/bar/baz.ts 1 removed
54
- ```
55
-
56
- 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.