@kurrent/kcap 0.8.17 → 0.9.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "kcap",
3
- "version": "0.8.17",
3
+ "version": "0.9.0",
4
4
  "description": "Records and visualizes Claude Code sessions via kcap CLI hooks"
5
5
  }
@@ -7,6 +7,10 @@
7
7
  "kcap-sessions": {
8
8
  "command": "kcap",
9
9
  "args": ["mcp", "sessions"]
10
+ },
11
+ "kcap-memory": {
12
+ "command": "kcap",
13
+ "args": ["mcp", "memory"]
10
14
  }
11
15
  }
12
16
  }
package/kcap/.mcp.json CHANGED
@@ -14,7 +14,13 @@
14
14
  "command": "kcap",
15
15
  "args": ["mcp", "flows"],
16
16
  "cwd": "${CLAUDE_PROJECT_DIR}",
17
- "description": "Structured AI review flows — start_review_flow, submit_review_round, get_review_flow_status, close_review_flow. Launches a hosted reviewer agent through your daemon; requires `kcap login` and a running daemon with this repo checked out (the tools are inert otherwise)."
17
+ "description": "Structured AI review flows — start_review_flow, submit_review_round, get_review_flow_status, close_review_flow. Launches a SEPARATE hosted reviewer agent through your daemon and iterates to sign-off; requires `kcap login` and a running daemon with this repo checked out (the tools are inert otherwise). Use only when the user explicitly asks for a review flow / to submit for review — for an ordinary 'review my PR' or 'code review' request, review directly and do not call these tools."
18
+ },
19
+ "kcap-memory": {
20
+ "command": "kcap",
21
+ "args": ["mcp", "memory"],
22
+ "cwd": "${CLAUDE_PROJECT_DIR}",
23
+ "description": "Team memory — search, read, and save durable learnings scoped to you, your team, or the org."
18
24
  }
19
25
  }
20
26
  }
package/kcap/README.md CHANGED
@@ -31,6 +31,21 @@ PR review context tools. Each PR-scoped tool accepts an optional `pr` argument (
31
31
  | `list_sessions` | Sessions that contributed to the PR | optional |
32
32
  | `get_transcript` | Full transcript of a specific session | n/a (keys off `session_id`) |
33
33
 
34
+ ### `kcap-memory`
35
+
36
+ Search, save, and update durable team memories — preferences, feedback, project facts, and references scoped to you, your team, or the org.
37
+
38
+ | Tool | Description |
39
+ |------|-------------|
40
+ | `search_memories` | Hybrid semantic + keyword search over memories visible to you |
41
+ | `get_memory` | Fetch a memory's full content by id or slug |
42
+ | `save_memory` | Save a new memory (`audience`, `slug`, `description`, `content`, `kind`); scoped to the cwd repo unless `global: true` |
43
+ | `update_memory` | Update an existing memory's description/content/kind |
44
+ | `rescope_memory` | Change a memory's audience (e.g. promote user → team/org) |
45
+ | `archive_memory` | Soft-delete a memory |
46
+
47
+ Repo- and machine-aware: it resolves the cwd to a repo hash and the local persisted machine id at startup to scope saves and bias search results.
48
+
34
49
  `kcap mcp judge` is intentionally not auto-registered. Add it with `claude mcp add kcap-judge -- kcap mcp judge` if you want it.
35
50
 
36
51
  **Hooks** — Automatically captures session activity and forwards it to the Kurrent Capacitor server:
@@ -15,7 +15,7 @@ description: >-
15
15
  kcap-sessions MCP tools.
16
16
  ---
17
17
 
18
- > **For agents:** When the `kcap-sessions` MCP server is available, prefer its tools (`search_sessions`, `get_session_summary`, `get_session_transcript`) for retrieving past sessions. This CLI-wrapped skill remains a fallback for shell use and when MCP isn't installed.
18
+ > **For agents:** When the `kcap-sessions` MCP server is available, prefer its tools (`search_sessions`, `get_session_summary`, `list_turns`, `get_turn`, `get_session_transcript`) for retrieving past sessions. This CLI-wrapped skill remains a fallback for shell use and when MCP isn't installed.
19
19
 
20
20
  # Session Recap
21
21
 
@@ -26,7 +26,7 @@ Retrieve session history recorded by Kurrent Capacitor. Supports single-session
26
26
  **IMPORTANT:** Always use the `kcap recap` CLI command. Do NOT call the HTTP API directly via `curl`, `WebFetch`, or `HttpClient` — the CLI handles formatting, error handling, and server URL resolution.
27
27
 
28
28
  ```bash
29
- # Current session summary (default concise AI-generated overview)
29
+ # Current session summary + per-turn outline (default)
30
30
  kcap recap
31
31
 
32
32
  # Full transcript (all prompts, responses, file changes)
@@ -41,10 +41,17 @@ kcap recap --chain --full
41
41
  # Recent session summaries for the current repository
42
42
  kcap recap --repo
43
43
 
44
+ # Compact per-turn metadata index (no prose)
45
+ kcap recap --per-turn
46
+
47
+ # One turn's full transcript, drilling down from the outline
48
+ kcap recap --get-turn <N>
49
+
44
50
  # Explicit session ID (overrides env var)
45
51
  kcap recap <sessionId>
46
52
  kcap recap --full <sessionId>
47
53
  kcap recap --chain <sessionId>
54
+ kcap recap --get-turn <N> <sessionId>
48
55
  ```
49
56
 
50
57
  `kcap recap` resolves the current session id from the environment when the host agent CLI exposes one. If no session id is available, pass it explicitly: `kcap recap <sessionId>`.
@@ -61,14 +68,35 @@ Returns AI-generated summaries from the most recent ended sessions in the curren
61
68
 
62
69
  **Progressive disclosure:** Start with `--repo` for the overview. If a specific session's summary is relevant, drill into it with `kcap recap --full <sessionId>` to get the complete transcript. This avoids loading full transcripts for all sessions into context.
63
70
 
64
- ## Default Output (Summary)
71
+ ## Default Output
72
+
73
+ `kcap recap` (no flags) prints, in order:
74
+
75
+ 1. **`## Plan`** — the plan captured for the session, if any.
76
+ 2. **`## Summary`** — an AI-generated narrative covering:
77
+ - **Context** — why the work was done
78
+ - **Key decisions** — trade-offs and design choices that matter for future work
79
+ - **Unfinished/Risks** — anything deferred or left incomplete
80
+ 3. **`## Turns`** — an outline with one line per turn:
81
+ - If the turn has a prose summary, that summary (1-3 sentences).
82
+ - Otherwise, a truncated user-prompt excerpt plus tool/file metadata (tool names, file count).
83
+ 4. A closing pointer: `→ kcap recap --get-turn <N> [sessionId]` for one turn's full detail.
84
+
85
+ A session that has turns but no summary yet (generation hasn't run, or an ended session has no `whats_done`/`plan` entry) still shows the `## Turns` outline — only the plan/summary blocks are skipped. If there's neither a summary nor any turns (e.g. an active session with no recorded turns), recap prints a hint to use `--full` instead.
86
+
87
+ With `--chain`, this same summary + outline is rendered per session under a `# Session <id>` header, oldest first.
88
+
89
+ ## Turn-by-turn drill-down
90
+
91
+ Once you've read the `## Turns` outline, fetch one turn's complete transcript (user prompt, tool calls + results, assistant text):
92
+
93
+ ```bash
94
+ kcap recap --get-turn <N> [sessionId]
95
+ ```
65
96
 
66
- Shows the plan (if any) and an AI-generated summary with:
67
- - **Context** — why the work was done
68
- - **Key decisions** — trade-offs and design choices that matter for future work
69
- - **Unfinished/Risks** — anything deferred or left incomplete
97
+ For a plain metadata index instead of the outline (turn #, prompt excerpt, tool names, file count, token count, time range — no prose), use `kcap recap --per-turn [sessionId]`.
70
98
 
71
- If no summary is available (e.g., active session), a hint is shown to use `--full`.
99
+ **MCP agents:** call `list_turns` to get a session's full turn map (`turn_index`, `prose`, `user_prompt`, `tools`, `files`, token counts), then `get_turn(session_id, turn_index)` for one turn's full transcript. Use `get_session_summary` for the whole-session narrative instead of drilling into individual turns.
72
100
 
73
101
  ## Full Output (`--full`)
74
102
 
@@ -85,8 +113,10 @@ When using `--chain`, sessions are separated by `# Session <id>` headers, and ag
85
113
  ## When to Use Each Flag
86
114
 
87
115
  - **`--repo`** (`kcap recap --repo`) — recent session summaries across the repo (start here for "what did we do recently?")
88
- - **No flags** (`kcap recap`) — quick context on the current session
89
- - **`--full`** (`kcap recap --full`) — when you need exact prompts, responses, or file contents from a specific session
116
+ - **No flags** (`kcap recap`) — summary + per-turn outline for the current session
117
+ - **`--per-turn`** (`kcap recap --per-turn`) — compact metadata index per turn (prompt excerpt, tools, files, tokens, time), no prose
118
+ - **`--get-turn <N>`** (`kcap recap --get-turn <N>`) — one turn's full transcript, drilling down from the outline or the per-turn index
119
+ - **`--full`** (`kcap recap --full`) — whole transcript: exact prompts, responses, and file contents for a specific session
90
120
  - **`--chain`** (`kcap recap --chain`) — understanding the full history of a task that spanned multiple sessions
91
121
  - **`--chain --full`** — complete transcript across all continuations
92
122
 
@@ -97,7 +127,7 @@ The `KCAP_URL` environment variable overrides the default server URL (`http://lo
97
127
  ## Tips
98
128
 
99
129
  - **For "what have we been working on?"** — use `--repo` first, then drill into specific sessions.
100
- - Start with the default summary. Only use `--full` when you need specific details.
130
+ - Start with the default summary + turn outline. Drill into a specific turn with `--get-turn <N>` before reaching for `--full`.
101
131
  - When continuing work from a previous session, use `--chain` to get summaries across continuations.
102
132
  - Summarize key decisions and changes for the user rather than echoing the full recap output verbatim.
103
133
  - The `kcap` CLI must be available on PATH (typically installed at `~/.local/bin/kcap`).
@@ -1,20 +1,32 @@
1
1
  ---
2
2
  name: review-flows
3
3
  description: >-
4
- This skill should be used when the user asks to "review this spec",
5
- "review this design", "review my PR", "code review", "get this reviewed",
6
- "re-review", "start a review flow", "review flow", "submit for review",
7
- or wants structured iterative review with findings and sign-off.
4
+ This skill should be used ONLY when the user explicitly asks to run a
5
+ structured review *flow* e.g. "start a review flow", "submit this for
6
+ review", "re-review after I address findings", or wants an iterative review
7
+ loop run by a separate reviewer that continues until sign-off. Do NOT use
8
+ this skill (and do NOT call the flows MCP tools) for an ordinary review
9
+ request such as "review my PR", "review this diff/spec/design", or "code
10
+ review" where the user just wants you to review it yourself — perform that
11
+ review directly instead.
8
12
  ---
9
13
 
10
14
  # Review Flows
11
15
 
12
- Use `kcap mcp flows` MCP tools to run structured review loops for specs/designs and PR/code work. A review flow submits your work to a reviewer, collects findings, lets you address them, and keeps iterating until the reviewer returns `NO FINDINGS`.
16
+ Use the `kcap mcp flows` MCP tools (`start_review_flow`, `submit_review_round`, …) to run a structured review **flow**: your work is submitted to a **separate, hosted reviewer** agent, which returns findings; you address them and keep iterating until the reviewer returns `NO FINDINGS`. This is a deliberate, heavier workflow — use it only when the user explicitly opts into it.
13
17
 
14
- ## When to use
18
+ ## When NOT to use this skill / these tools
15
19
 
16
- - Reviewing a spec or design document use `kind: "spec-review"`
17
- - Reviewing code changes or a pull request → use `kind: "code-review"`
20
+ These tools do **not** perform a review they hand the work off to a separate hosted reviewer. If the user simply asked *you* to review something in a normal session — e.g. "review my PR", "review this diff", "code review this", "look over this spec" — just perform the review yourself and report your findings directly. Do **NOT** call `start_review_flow` / `submit_review_round` for an ordinary review request; that would spin up a hosted reviewer the user did not ask for.
21
+
22
+ Only start a flow when the user explicitly asks for a review *flow* — e.g. "start a review flow", "submit this for review", "get an independent review", or "re-review after I address the findings".
23
+
24
+ ## Choosing the flow kind
25
+
26
+ Once the user has explicitly opted into a flow (see above), pick the `kind`:
27
+
28
+ - Spec or design document → `kind: "spec-review"`
29
+ - Code changes or a pull request → `kind: "code-review"`
18
30
 
19
31
  ## If the flows MCP tools are not loaded
20
32
 
@@ -56,7 +68,7 @@ if FINDINGS:
56
68
 
57
69
  | Tool | Required args | Optional args | When to call |
58
70
  |---|---|---|---|
59
- | `start_review_flow` | `kind` (`spec-review`\|`code-review`), `target_kind` (what is being reviewed: `spec`, `code`, `pr`, `branch`, `file`, etc.), `target_ref` (a path, branch name, or PR URL/number that identifies the target), `target_title` (short human-readable title, e.g. spec name or PR title), `context` (background context: what to focus on, constraints, definition of done) | `instructions`, `mode` (`context-only` — required for code-review unless the reviewer runs in your exact repo checkout) | Once, at the start of a review task. |
71
+ | `start_review_flow` | `kind` (`spec-review`\|`code-review`), `target_kind` (what is being reviewed: `spec`, `code`, `pr`, `branch`, `file`, etc.), `target_ref` (a path, branch name, or PR URL/number that identifies the target), `target_title` (short human-readable title, e.g. spec name or PR title), `context` (background context: what to focus on, constraints, definition of done) | `instructions`, `mode` (`context-only` — optional; by default, on the same machine, the reviewer's worktree is mirrored from your working tree including uncommitted changes, so it reads the actual source. Pass `context-only` to opt out and treat the submitted context as authoritative) | Once, at the start of a review task. |
60
72
  | `submit_review_round` | `flow_run_id`, `context` | `instructions` | After addressing findings. Pass the same `flow_run_id` and the updated context. |
61
73
  | `get_review_flow_status` | `flow_run_id` | — | Poll or check the current status of a flow (running, waiting, completed, failed). |
62
74
  | `close_review_flow` | `flow_run_id` | — | Only after the reviewer returns `NO FINDINGS`. |
@@ -64,14 +76,14 @@ if FINDINGS:
64
76
  ## Example (code review)
65
77
 
66
78
  ```
67
- # Step 1 — start (all five required args must be provided; mode=context-only is required for code-review)
79
+ # Step 1 — start (all five required args must be provided; on the same machine the reviewer sees
80
+ # your working tree, uncommitted changes included — pass mode="context-only" to opt out)
68
81
  start_review_flow(
69
82
  kind="code-review",
70
83
  target_kind="branch",
71
84
  target_ref="feature/add-null-check",
72
85
  target_title="Add null check on user input",
73
- context="Review the diff on this branch for correctness and adherence to project conventions.",
74
- mode="context-only"
86
+ context="Review the diff on this branch for correctness and adherence to project conventions."
75
87
  )
76
88
  # → returns flow_run_id, e.g. "flow_abc123"
77
89
  # → reviewer returns FINDINGS: missing null check on line 42
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kurrent/kcap",
3
- "version": "0.8.17",
3
+ "version": "0.9.0",
4
4
  "description": "CLI companion for Kurrent Capacitor — records and visualizes Claude Code sessions",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -14,12 +14,12 @@
14
14
  "postinstall": "node bin/postinstall.js"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@kurrent/kcap-darwin-arm64": "0.8.17",
18
- "@kurrent/kcap-linux-x64": "0.8.17",
19
- "@kurrent/kcap-linux-arm64": "0.8.17",
20
- "@kurrent/kcap-linux-musl-x64": "0.8.17",
21
- "@kurrent/kcap-linux-musl-arm64": "0.8.17",
22
- "@kurrent/kcap-win-x64": "0.8.17"
17
+ "@kurrent/kcap-darwin-arm64": "0.9.0",
18
+ "@kurrent/kcap-linux-x64": "0.9.0",
19
+ "@kurrent/kcap-linux-arm64": "0.9.0",
20
+ "@kurrent/kcap-linux-musl-x64": "0.9.0",
21
+ "@kurrent/kcap-linux-musl-arm64": "0.9.0",
22
+ "@kurrent/kcap-win-x64": "0.9.0"
23
23
  },
24
24
  "files": [
25
25
  "bin/",