@staff0rd/assist 0.599.0 → 0.600.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 -0
- package/claude/commands/add-rule.md +45 -0
- package/dist/commands/sessions/web/bundle.js +397 -393
- package/dist/index.js +672 -508
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ After installation, the `assist` command will be available globally. You can als
|
|
|
41
41
|
## Claude Commands
|
|
42
42
|
|
|
43
43
|
- `/add-command` - Add a new run command to assist.yml
|
|
44
|
+
- `/add-rule` - Capture a new `CLAUDE.md` rule from a review comment: words the rule from the note, infers the scope from the commented file (asking only when genuinely ambiguous, defaulting to the nearest `CLAUDE.md`), and writes it with `assist rules add`. Sent by the comment pane's **Add rule** button
|
|
44
45
|
- `/branch <description> [--jira KEY]` - Create a branch off the fresh remote default, deriving a kebab-case slug from the description
|
|
45
46
|
- `/bug` - File a bug with reproduction steps, expected and actual behavior
|
|
46
47
|
- `/comment` - Add pending review comments to the current PR
|
|
@@ -235,6 +236,7 @@ The Config tab of the sessions web dashboard never receives secret values: `GET
|
|
|
235
236
|
### Rules
|
|
236
237
|
|
|
237
238
|
- `assist rules list [path]` - List the rules in scope for a path (default: cwd), read from the `## Rules` section of every `CLAUDE.md` from that path's directory up to the repo root, nearest scope first, grouped by the file each rule came from. Rules are `- **<code>** — <text>` bullets
|
|
239
|
+
- `assist rules add <text> [--scope <path>]` - Add a rule to the `## Rules` section of the scope's `CLAUDE.md`, creating the section when absent and allocating the next repo-wide code. `--scope` takes a file or directory (resolved to the nearest existing `CLAUDE.md` at or above it, defaulting to cwd) or a `CLAUDE.md` path written to directly and created if absent. After writing, the root `CLAUDE.md` records the directories that carry their own `## Rules` so scoped rules stay discoverable from the root
|
|
238
240
|
|
|
239
241
|
### Devlog
|
|
240
242
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Capture a new CLAUDE.md rule from a review comment
|
|
3
|
+
allowed_args: "[quoted text, file and note from the comment pane]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are turning a review comment into a written rule in a `CLAUDE.md` file, so the same mistake is caught next time. `$ARGUMENTS` carries what the comment pane sent: an optional `File:` line, the quoted text in a fenced block, and the reviewer's note.
|
|
7
|
+
|
|
8
|
+
## Step 1: Read what you were given
|
|
9
|
+
|
|
10
|
+
Pull three things out of `$ARGUMENTS`:
|
|
11
|
+
|
|
12
|
+
- **File** — the path the selection came from, if a `File:` line is present. The document preview pane has no path, so it may be missing.
|
|
13
|
+
- **Quote** — the selected text, the concrete example of the rule being broken.
|
|
14
|
+
- **Note** — the reviewer's words, the substance of the rule.
|
|
15
|
+
|
|
16
|
+
If `$ARGUMENTS` is empty, ask the user what rule they want to add and skip to Step 3.
|
|
17
|
+
|
|
18
|
+
## Step 2: Word the rule
|
|
19
|
+
|
|
20
|
+
Write the rule as one short imperative sentence that generalises the note beyond this one instance — what to do (or not do), not what went wrong here. Keep it to a single line: it becomes a `- **<code>** — <text>` bullet.
|
|
21
|
+
|
|
22
|
+
Ask the user a clarifying question only when the note is genuinely too vague to word a rule from. One question, then write it.
|
|
23
|
+
|
|
24
|
+
## Step 3: Work out the scope
|
|
25
|
+
|
|
26
|
+
The scope is the directory whose `CLAUDE.md` gets the rule. Infer it — do not ask by default:
|
|
27
|
+
|
|
28
|
+
- With a file path, the default is the nearest `CLAUDE.md` walking up from that file's directory to the repo root. `assist rules list <path>` shows what is already in scope there, which tells you where sibling rules live.
|
|
29
|
+
- If the note is clearly about a kind of document that lives in one directory (and the file sits in it), that directory's `CLAUDE.md` is the scope — pass `--scope <dir>/CLAUDE.md` to create it there when it does not exist yet.
|
|
30
|
+
- If the rule plainly applies repo-wide, use the root `CLAUDE.md`.
|
|
31
|
+
- Without a file path, use the repo root unless the note names a directory.
|
|
32
|
+
|
|
33
|
+
Ask the user only when two scopes are genuinely defensible and the choice changes where the rule applies. Otherwise take the nearest `CLAUDE.md` and say which one you chose.
|
|
34
|
+
|
|
35
|
+
## Step 4: Write it
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
assist rules add '<rule text>' --scope <path> 2>&1
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`--scope` takes a file, a directory, or a `CLAUDE.md` path directly. A file or directory resolves to the nearest existing `CLAUDE.md` at or above it; a `CLAUDE.md` path is written to as given, created if absent. The command allocates the next repo-wide code, creates the `## Rules` section when the file has none, and records the directories that carry their own `## Rules` in the root `CLAUDE.md`.
|
|
42
|
+
|
|
43
|
+
Use single quotes around the rule text to avoid shell escaping issues.
|
|
44
|
+
|
|
45
|
+
Show the command output — it names the allocated code and the file — then tell the user in one line which rule was added and where. Do not make any other edit: the rule is the whole task, and fixing the quoted text is not part of it unless the user asks.
|