You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/claude-code/skills/handoff/SKILL.md
+21-82Lines changed: 21 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,70 +5,42 @@ description: "Create a paste-ready handoff/compress prompt for continuing the cu
5
5
6
6
# Handoff
7
7
8
-
Compress the current session into a self-contained handoff prompt that a fresh agent can start from. When the current Jieli thread can be identified, embed its thread id and URL so the next agent can use the `jieli-read` skill to read the full transcript if the summary is not enough.
9
-
10
-
## When to Use
11
-
12
-
Use this skill when:
13
-
14
-
- The user asks to hand off, hand over, or pass the work to another agent or a new session.
15
-
- The user asks to compress, compact, or summarize the context to keep working past the context window.
16
-
- The user wants a prompt they can paste into a fresh Claude Code (or other) session to continue this work.
17
-
18
-
Do not use this skill for ordinary status updates or to read/search other threads. Reading known thread ids/URLs is the `jieli-read` skill; searching by clues is the `jieli-find` skill.
8
+
Write a handoff document so a fresh agent can continue the work. If a Jieli thread is available, include its id and URL for optional transcript lookup.
19
9
20
10
## Inputs
21
11
22
12
- Optional next goal: what the next agent should do first. If the user did not give one, derive it from the most recent request and any open follow-ups in this conversation.
23
-
- Current session metadata from the `jieli-handoff-info` helper. The helper receives hook context from the `PreToolUse` hook and returns JSON. No API key is needed; the helper only builds a thread URL and never calls the Jieli API.
13
+
- Current session metadata from the `jieli-handoff-info` helper. It returns the current Jieli thread metadata without needing an API key.
24
14
25
15
## Procedure
26
16
27
17
### 1. Resolve current session metadata
28
18
29
-
First resolve `../../scripts/jieli_helper.mjs` relative to this `SKILL.md` file and run the bundled helper:
19
+
Resolve `../../scripts/jieli_helper.mjs` relative to this `SKILL.md` file and run:
This is the primary path. It loads the plugin runtime directly and uses the most recent hook context persisted by the plugin.
36
-
37
-
If the bundled helper is not available or does not print valid JSON, then try the plain helper command so the `PreToolUse` hook may inject the current `session_id`, `transcript_path`, and `cwd`:
25
+
If that fails or prints invalid JSON, try:
38
26
39
27
```bash
40
28
jieli-handoff-info
41
29
```
42
30
43
31
Do not enumerate plugin cache directories, choose wrapper files, or sort installed helpers in this skill.
44
32
45
-
Expected JSON shape:
46
-
47
-
```json
48
-
{
49
-
"confidence": "high",
50
-
"provider": "claude_code",
51
-
"session_id": "...",
52
-
"thread_id": "T-...",
53
-
"url": "https://jieli.app/threads/T-...",
54
-
"cwd": "...",
55
-
"repo_url": "...",
56
-
"branch": "...",
57
-
"worktree_status": "clean"
58
-
}
59
-
```
60
-
61
-
Rules:
33
+
Expected fields include `thread_id`, `url`, `cwd`, `repo_url`, `branch`, and `worktree_status`.
62
34
63
-
- Include the Jieli read-thread line only when the helper returns a non-empty `thread_id` and `url` for the current session.
64
-
- If either `thread_id` or `url` is empty, do not guess from the newest transcript. Still produce the handoff prompt, but omit the Jieli thread/read-thread lines and mention that the current thread could not be identified.
65
-
- If the helper fails or prints invalid JSON, continue without a thread id and state that session metadata could not be resolved.
35
+
Include Jieli thread lines only when both `thread_id` and `url` are present. If metadata is missing or invalid, continue without a thread id and do not guess from recent transcripts.
66
36
67
37
### 2. Compose the handoff context
68
38
69
-
You already hold the full conversation, so write the context yourself; do not call a model and do not read the full transcript. Treat any text after the handoff/compress request as `My request` and use it as the relevance filter. Prioritize facts, files, decisions, verification, and next steps that help that request; keep only global constraints and safety notes from unrelated work.
39
+
You already hold the full conversation, so write the context yourself; do not call a model or read the full transcript. If the user passed arguments, treat them as the next session focus and tailor the handoff accordingly.
70
40
71
-
Use helper metadata such as `cwd`, `repo_url`, `branch`, and `worktree_status` as source context, but do not force those fields into the final handoff unless they are useful for the request.
41
+
Use helper metadata such as `cwd`, `repo_url`, `branch`, and `worktree_status` only when useful. Prioritize facts, files, decisions, verification, risks, and next steps that help the next agent continue.
42
+
43
+
Do not duplicate content already captured in other artifacts such as PRDs, plans, ADRs, issues, commits, or diffs. Reference them by path or URL instead.
72
44
73
45
Consider what would be useful for the next agent based on `My request`. Questions that may be relevant:
74
46
@@ -81,79 +53,46 @@ Consider what would be useful for the next agent based on `My request`. Question
81
53
- What caveats, limitations, unresolved questions, or verification gaps remain?
82
54
- What should the next agent do first for the requested goal?
83
55
84
-
Extract what matters for the specific request below. Don't answer questions that aren't relevant. Pick an appropriate length based on the complexity of the request.
85
-
86
-
Focus on capabilities and behavior, not file-by-file changes. Avoid excessive implementation details (variable names, storage keys, constants) unless critical.
56
+
Extract only what matters for the request. Focus on capabilities and behavior, not file-by-file changes. Avoid excessive implementation details unless critical.
87
57
88
-
Format: Plain text with bullets. No markdown headers, no bold/italic, no code fences. Use workspace-relative paths for files.
89
-
90
-
Relevant files rules:
91
-
92
-
- Workspace-relative paths only. Maximum 10. Put the most important files first.
93
-
- Directories are allowed when several files under them matter.
94
-
- Do not invent files or use absolute paths.
95
-
96
-
Never include API keys, secrets, tokens, cookies, `.env` contents, full transcripts, large raw logs, or sensitive private data. Say that sensitive values were omitted when relevant.
58
+
Format: plain-text bullets, no markdown headers, no code fences. Include suggested skills only when the next agent should invoke them. Use workspace-relative paths only. List at most 10 relevant files or directories, most important first. Never invent files. Never include API keys, secrets, tokens, cookies, `.env` contents, full transcripts, large raw logs, or sensitive private data.
97
59
98
60
My request:
99
61
<next goal / text after the handoff request, or the inferred open follow-up>
100
62
101
63
### 3. Assemble, write, and print
102
64
103
-
If the current thread was identified, assemble the handoff prompt in this shape. The first two lines are fixed; the body is the goal-filtered plain-text bullet context from step 2. Include helper metadata such as repo/cwd/branch/status only when useful for the request.
65
+
If the current thread was identified, assemble:
104
66
105
67
```text
106
68
Continuing work from Jieli thread <THREAD_ID>.
107
69
When you lack specific information, use the jieli-read skill to read the thread.
108
70
109
-
Relevant files: <path1> <path2> <path3> ...
71
+
Relevant files: <path1>, <path2>, <path3>
72
+
Suggested skills: <skill1>, <skill2>
110
73
111
74
<goal-filtered relevant information bullets>
112
75
113
76
My request: <next goal / text after the handoff request, or the inferred open follow-up>
114
77
```
115
78
116
-
If the thread was not resolved, omit the first two lines and start with:
79
+
If the thread was not resolved, start with:
117
80
118
81
```text
119
82
You are continuing work from a previous Claude Code session.
120
-
Current Jieli thread could not be identified automatically; ask the user for the thread id or Jieli URL if full transcript access is needed.
83
+
No Jieli thread id is included; continue from the handoff context.
121
84
```
122
85
123
-
Write the full handoff prompt to a temp file, but do not print the full prompt in your reply:
124
-
125
-
- With a thread id: use `handoff-<THREAD_ID>.md`.
126
-
- Without a thread id: derive a short slug from the user goal if present, otherwise from the handoff summary title, and use `handoff-<SLUG>.md`.
127
-
- Always place the file under Node's `os.tmpdir()` via `path.join(os.tmpdir(), filename)`. Do not hard-code `/tmp`, because Windows agents need a platform-native temp directory.
128
-
129
-
Use a safe writer, for example Node, so prompt content cannot break a shell here-doc and the temp path stays cross-platform:
const out = path.join(os.tmpdir(), `handoff-${safe}.md`);
140
-
141
-
fs.writeFileSync(out, `<assembled handoff prompt>
142
-
`, "utf8");
143
-
console.log(`Wrote handoff to ${out}`);
144
-
JS
145
-
```
86
+
Write the full handoff prompt to a temp file, but do not print it in your reply. Save to Node's `os.tmpdir()` as `handoff-<THREAD_ID>.md` when a thread id exists; otherwise use a short filename-safe slug from the next goal, falling back to `handoff.md`. Use a safe writer such as Node so prompt content cannot break shell quoting.
146
87
147
-
Then reply with only a brief summary: the saved file path, whether a thread id was included, the relevant files count/list, and the next goal. Do not include the full handoff prompt unless the user explicitly asks to print it.
88
+
Reply only with the saved path, whether a thread id was included, the relevant files count/list, and the next goal. Print the full handoff only if the user explicitly asks.
148
89
149
90
## Output
150
91
151
-
- The full ready-to-paste handoff prompt saved to the temp path printed by the Node writer.
152
-
- A brief reply summary with the saved path and key metadata, not the full handoff content.
153
-
- If a thread id is available, the next agent can use the `jieli-read` skill to read `<THREAD_ID>` for the full transcript.
92
+
- Save the full ready-to-paste handoff prompt to the temp path.
93
+
- Reply with a brief summary and the saved path, not the full handoff content.
154
94
155
95
## Notes & Safety
156
96
157
97
- The current turn is uploaded to Jieli by the Stop hook after this turn ends, so `read_thread` may cover history only up to the previous sync. The handoff prompt itself must carry the key current context.
158
98
- A wrong thread is worse than no thread. If the helper cannot identify the current thread, do not guess.
159
-
- Never include API keys, secrets, tokens, cookies, `.env` contents, full transcripts, large raw logs, or sensitive private data in the handoff prompt.
Copy file name to clipboardExpand all lines: plugins/claude-code/skills/jieli-read/SKILL.md
-10Lines changed: 0 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,6 @@ description: "Read a specific known Jieli /threads/T-<uuid> link or raw T-<uuid>
5
5
6
6
# Jieli Read
7
7
8
-
## When to Use
9
-
10
-
Use this skill immediately when:
11
-
12
-
- The user pastes or references a Jieli thread URL whose path contains `/threads/<thread_id>`, including relative links like `/threads/T-...` and export links like `/threads/<thread_id>.md` or `/threads/<thread_id>.json`.
13
-
- The user references a raw provider thread id, such as `T-...`.
14
-
- The user asks to apply, summarize, continue, compare, or reuse work from a specific known Jieli thread.
15
-
16
-
Do not use this skill when the user only gives keywords, repo names, file names, or vague clues. Use `jieli-find` first for search/discovery. Do not use this skill for the current conversation when the needed context is already visible.
17
-
18
8
## Inputs
19
9
20
10
- A Jieli URL such as `https://jieli.app/threads/<provider_thread_id>`, `https://jieli.app/threads/<provider_thread_id>.md`, or a raw provider thread id.
0 commit comments