@staff0rd/assist 0.220.1 → 0.221.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
@@ -45,9 +45,11 @@ After installation, the `assist` command will be available globally. You can als
45
45
  - `/devlog` - Generate devlog entry for the next unversioned day
46
46
  - `/draft` - Draft a new backlog item with LLM-assisted questioning
47
47
  - `/forward-comments` - Split a coarse PR comment (e.g. from Slack) into per-line review comments on the current branch's PR, attributed to the original reviewer
48
+ - `/handover` - Write a session handover note (`.assist/HANDOVER.md`) for the next conversation; archives any prior handover first. The SessionStart hook surfaces the handover at the start of the next session
48
49
  - `/pr` - Raise a PR with a concise description
49
50
  - `/refactor` - Run refactoring checks for code quality
50
51
  - `/prompts` - Analyze denied tool calls and suggest settings changes to auto-allow recurring prompts
52
+ - `/recall` - Recall context from the most recent prior session in this repo by summarising its transcript (skips sdk-cli-only sessions); read-only, emits a `# Recall` block in chat
51
53
  - `/refine` - Refine an existing backlog item through conversation
52
54
  - `/restructure` - Analyze and restructure tightly-coupled files
53
55
  - `/review-comments` - Process PR review comments one by one
@@ -201,6 +203,9 @@ After installation, the `assist` command will be available globally. You can als
201
203
  - `assist sql tables [connection]` - List tables in the connected database (via INFORMATION_SCHEMA.TABLES)
202
204
  - `assist sql columns <table> [connection]` - List columns for a table (use `schema.table` for non-default schema; via INFORMATION_SCHEMA.COLUMNS)
203
205
  - `assist screenshot <process>` - Capture a screenshot of a running application window (e.g. `assist screenshot notepad`). Output directory is configurable via `screenshot.outputDir` (default `./screenshots`)
206
+ - `assist handover archive [--suffix <s>]` - Archive the current `.assist/HANDOVER.md` to `.assist/handovers/archive/<ISO-ts>[-<suffix>].md`. Prints the archive path; no-op when no handover exists
207
+ - `assist handover summarise <jsonl>` - Print a one-line summary of a session JSONL via `claude -p --model haiku`. Filters sdk-cli-only transcripts and sets a recursion-guard env var so the inner SessionStart hook short-circuits
208
+ - `assist handover load` - SessionStart hook entry point: reads `{cwd, session_id}` from stdin, archives any existing `.assist/HANDOVER.md`, and emits `{ hookSpecificOutput: { hookEventName: "SessionStart", additionalContext }, systemMessage }`. When no handover exists, falls back to summarising the most-recent non-current, non-sdk-cli prior JSONL under `~/.claude/projects/<encoded-cwd>/`. Honors `_CLAUDE_HOOK_SUMMARISE_RUNNING` so nested invocations short-circuit silently
204
209
  - `assist mermaid export [file.md]` - Render each fenced mermaid block to `<stem>-<index>.svg` via [Kroki](https://kroki.io). With no file, scans `*.md` in the current directory (non-recursive). Use `--out <dir>` to override the output directory. Use `--index <n>` to render only the nth mermaid block (1-based; requires a file argument). Endpoint is configurable via `mermaid.krokiUrl` (default `https://kroki.io`).
205
210
  - `assist prompts` - Show top 10 denied tool calls by frequency with count and repo breakdown
206
211
  - `assist coverage` - Print global statement coverage percentage
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Write a session handover note for the next conversation
3
+ ---
4
+
5
+ Write a concise handover note for the next session working on this repo. The note captures everything the next session needs to pick up where this one left off.
6
+
7
+ ## Step 1: Archive the previous handover
8
+
9
+ Run `assist handover archive` first. If a `.assist/HANDOVER.md` already exists, it is moved to `.assist/handovers/archive/<ISO-ts>.md` (path printed to stdout). If no handover exists, the command is a no-op.
10
+
11
+ Do NOT skip this step — re-running `/handover` must never overwrite a prior unsaved note.
12
+
13
+ ## Step 2: Write `.assist/HANDOVER.md`
14
+
15
+ Always operate on the current working directory. Write the file at `.assist/HANDOVER.md` (create the `.assist/` directory if needed). Use the following sections, in this order, and omit none even if empty (use a single "—" placeholder line):
16
+
17
+ ```markdown
18
+ # Handover
19
+
20
+ ## Current Task
21
+
22
+ What is actively being worked on right now — one or two sentences. Include the backlog item ID or PR number if applicable.
23
+
24
+ ## Just Done
25
+
26
+ The most recent things completed in this session. Bullet list. Include file paths where relevant.
27
+
28
+ ## Next Steps
29
+
30
+ What the next session should do next, in order. Bullet list. Be concrete — name files, commands, or decisions.
31
+
32
+ ## Key Files
33
+
34
+ Files that the next session will most likely need to read or edit. Bullet list of `path:line` references where useful.
35
+
36
+ ## Open Decisions
37
+
38
+ Choices that have not yet been made, or were deferred. State the options briefly so the next session can resume the deliberation.
39
+
40
+ ## Watch Out For
41
+
42
+ Non-obvious gotchas, in-flight refactors, broken tests, half-applied changes, or anything that could trip up the next session.
43
+
44
+ ## Don't Do
45
+
46
+ Things that have been ruled out, attempted unsuccessfully, or that the user has explicitly asked not to do. Saves the next session from repeating dead ends.
47
+ ```
48
+
49
+ ## Guidelines
50
+
51
+ - Keep each section terse — bullets, not paragraphs. The next session will read this cold.
52
+ - Reference concrete file paths and line numbers wherever it helps orientation.
53
+ - Do not summarise context that is already obvious from the code or git history.
54
+ - Do not commit `.assist/HANDOVER.md` — it is gitignored.
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: Recall context from the most recent prior session in this repo
3
+ ---
4
+
5
+ Summarise the most recent **prior** Claude Code session for this working directory, so the current session can pick up where it left off. Always operate on the current working directory; do not ask which repo to recall.
6
+
7
+ ## Step 1: Locate the prior session JSONL
8
+
9
+ Sessions are stored under `~/.claude/projects/<encoded-cwd>/`, where `<encoded-cwd>` is the absolute current working directory with every `/` replaced by `-` (e.g. `/home/me/git/foo` → `-home-me-git-foo`).
10
+
11
+ 1. Compute `<encoded-cwd>` from the absolute path of the current working directory. Do not hard-code a path — derive it.
12
+ 2. List `*.jsonl` files in that directory, newest-first by mtime.
13
+ 3. Walk the list and pick the **first** file that satisfies all of:
14
+ - It is **not** the current session's JSONL (the current session id is in `$CLAUDE_SESSION_ID` if set, or matches the JSONL whose tail you would actively be appending to right now — when in doubt, skip the newest if it could be this session).
15
+ - It is **not** an sdk-cli-only transcript. A transcript is sdk-cli-only when every `type:"user"` entry with text content has `"entrypoint":"sdk-cli"`. If at least one `type:"user"` entry has `"entrypoint":"cli"` (or any value other than `sdk-cli`), the transcript counts as a real interactive session and is eligible.
16
+
17
+ If no eligible prior session exists, emit:
18
+
19
+ ```markdown
20
+ # Recall
21
+
22
+ No prior session found for this directory.
23
+ ```
24
+
25
+ …and stop.
26
+
27
+ ## Step 2: Emit the # Recall block
28
+
29
+ Read enough of the chosen JSONL to understand what the previous session was working on (recent human user turns are the highest signal — skip tool results and assistant messages). Then emit a single `# Recall` block directly in chat. **Do not write any file.**
30
+
31
+ Use this structure:
32
+
33
+ ```markdown
34
+ # Recall
35
+
36
+ **Previous session:** <one-line summary of what the prior session was doing>
37
+
38
+ **Key points:**
39
+ - <bullet> — what was happening, decisions made, or where it stopped
40
+ - <bullet>
41
+ - <bullet>
42
+
43
+ **Suggested next step:** <one concrete thing to do now, or "—" if unclear>
44
+ ```
45
+
46
+ ## Guidelines
47
+
48
+ - Always operate on the current working directory — never guess or substitute another repo.
49
+ - Keep the summary terse. The user is reading it cold at the start of a new session.
50
+ - Prefer concrete file paths, command names, and backlog IDs over vague descriptions.
51
+ - If `.assist/HANDOVER.md` exists, the SessionStart hook will already have surfaced it — `/recall` complements that by pulling context from the prior transcript, not the handover file.
52
+ - Do not modify any files. `/recall` is read-only.
@@ -19,6 +19,12 @@
19
19
  "matcher": "",
20
20
  "hooks": [{ "type": "command", "command": "assist notify" }]
21
21
  }
22
+ ],
23
+ "SessionStart": [
24
+ {
25
+ "matcher": "",
26
+ "hooks": [{ "type": "command", "command": "assist handover load" }]
27
+ }
22
28
  ]
23
29
  },
24
30
  "permissions": {
@@ -70,6 +76,10 @@
70
76
  "SlashCommand(/test-cover)",
71
77
  "Skill(test-review)",
72
78
  "SlashCommand(/test-review)",
79
+ "Skill(handover)",
80
+ "SlashCommand(/handover)",
81
+ "Skill(recall)",
82
+ "SlashCommand(/recall)",
73
83
  "WebFetch(domain:staffordwilliams.com)"
74
84
  ],
75
85
  "deny": [