Skip to content

Commit 34abbe1

Browse files
committed
1 parent 1cc9d29 commit 34abbe1

8 files changed

Lines changed: 44 additions & 207 deletions

File tree

plugins/claude-code/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jieli",
33
"displayName": "Jieli",
4-
"version": "0.1.21",
4+
"version": "0.1.22",
55
"description": "Sync Claude Code sessions to Jieli threads and attach Jieli thread trailers to Claude-created commits.",
66
"author": {
77
"name": "Jieli"

plugins/claude-code/skills/handoff/SKILL.md

Lines changed: 21 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,42 @@ description: "Create a paste-ready handoff/compress prompt for continuing the cu
55

66
# Handoff
77

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.
199

2010
## Inputs
2111

2212
- 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.
2414

2515
## Procedure
2616

2717
### 1. Resolve current session metadata
2818

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:
3020

3121
```bash
3222
node <resolved-skill-dir>/../../scripts/jieli_helper.mjs handoff-info
3323
```
3424

35-
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:
3826

3927
```bash
4028
jieli-handoff-info
4129
```
4230

4331
Do not enumerate plugin cache directories, choose wrapper files, or sort installed helpers in this skill.
4432

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`.
6234

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.
6636

6737
### 2. Compose the handoff context
6838

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.
7040

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.
7244

7345
Consider what would be useful for the next agent based on `My request`. Questions that may be relevant:
7446

@@ -81,79 +53,46 @@ Consider what would be useful for the next agent based on `My request`. Question
8153
- What caveats, limitations, unresolved questions, or verification gaps remain?
8254
- What should the next agent do first for the requested goal?
8355

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.
8757

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.
9759

9860
My request:
9961
<next goal / text after the handoff request, or the inferred open follow-up>
10062

10163
### 3. Assemble, write, and print
10264

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:
10466

10567
```text
10668
Continuing work from Jieli thread <THREAD_ID>.
10769
When you lack specific information, use the jieli-read skill to read the thread.
10870
109-
Relevant files: <path1> <path2> <path3> ...
71+
Relevant files: <path1>, <path2>, <path3>
72+
Suggested skills: <skill1>, <skill2>
11073
11174
<goal-filtered relevant information bullets>
11275
11376
My request: <next goal / text after the handoff request, or the inferred open follow-up>
11477
```
11578

116-
If the thread was not resolved, omit the first two lines and start with:
79+
If the thread was not resolved, start with:
11780

11881
```text
11982
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.
12184
```
12285

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:
130-
131-
```bash
132-
node <<'JS'
133-
const fs = require("node:fs");
134-
const os = require("node:os");
135-
const path = require("node:path");
136-
137-
const idOrSlug = "<THREAD_ID_OR_SLUG>";
138-
const safe = idOrSlug.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "handoff";
139-
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.
14687

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.
14889

14990
## Output
15091

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.
15494

15595
## Notes & Safety
15696

15797
- 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.
15898
- 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.

plugins/claude-code/skills/jieli-find/SKILL.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ description: "Search prior Jieli threads by keywords, repo, file, topic, or othe
55

66
# Jieli Find
77

8-
## When to Use
9-
10-
Use this skill immediately when:
11-
12-
- The user asks to find/search previous Jieli threads.
13-
- The user asks which thread mentioned something.
14-
- The user gives keywords, repo names, file paths, topics, labels, or vague clues instead of a known thread id.
15-
16-
Do not use this skill when the user already supplied a specific Jieli thread id or URL. Use `jieli-read` for known thread ids/URLs.
17-
188
## Inputs
199

2010
- Search keywords or clue text.

plugins/claude-code/skills/jieli-read/SKILL.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ description: "Read a specific known Jieli /threads/T-<uuid> link or raw T-<uuid>
55

66
# Jieli Read
77

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-
188
## Inputs
199

2010
- 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.

plugins/codex/.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jieli",
3-
"version": "0.1.21",
3+
"version": "0.1.22",
44
"description": "Sync Codex sessions to Jieli threads and attach Jieli thread trailers to Codex-created commits.",
55
"author": {
66
"name": "Jieli"

0 commit comments

Comments
 (0)