session-to-guideline
БесплатноЗапускает вложенные скриптыНе проверенTurn a pi session into a Markdown "how-we-did-it" collaboration guideline: reads the session's JSONL transcript and synthesizes a reusable playbook of which…
от BlackBeltTechnology★ 357 звёзд на GitHubОб этом скилле
Session → Collaboration Guideline
Produces a Markdown document that reads like a playbook for collaborating with the AI on a task — not a raw transcript. It separates the goal from the steering, surfaces the skills/memories created and why they work, and ends with a reproduce-it checklist.
Two layers:
- Deterministic extract (
scripts/extract_session.ts) — parses the session JSONL on the active branch and emits a structured facts sheet (prompts in order, tool usage, files written/edited, searches, skills/memories created, failed commands, cost). This is raw material, not the deliverable. TypeScript, run withnpx tsx(repo convention). - Synthesis — read the facts sheet and write the guideline using
references/guideline-template.md. The why it's effective and what to steer parts require judgment. Run it inline for a single session, or delegate to theSessionGuidelinesubagent for batch / past-session application (see below) — the synthesis is self-contained (facts sheet in, one guideline out), so it isolates cleanly.
Where sessions live
~/.pi/agent/sessions/--<cwd-with-slashes-as-dashes>--/<timestamp>_<uuid>.jsonl
(JSONL tree; see the pi session-format docs). The scripts locate files for you.
Worktrees are included by default. A project's OpenSpec work runs in .worktrees/<name>
sub-checkouts, which get their own encoded session dir (--<project>-.worktrees-<name>--).
Both scripts resolve a --cwd to the project root + every .worktrees/* worktree, so
project-scoped listing/latest covers worktree sessions too (rows tagged [wt:<name>]).
Pass --no-worktrees for the old root-only behavior. Running from inside a worktree still
lists the whole project (the root is recovered by stripping /.worktrees/<name>).
Procedure
Pick the session. If the user didn't name one, list candidates:
npx tsx scripts/list_sessions.ts --cwd "$(pwd)" --limit 20 # this project + its worktrees npx tsx scripts/list_sessions.ts --cwd "$(pwd)" --no-worktrees # project root only npx tsx scripts/list_sessions.ts --all --limit 30 # every projectWorktree rows are tagged
[wt:<name>]so you can tell root work from worktree work. (tsxruns the.tsdirectly, no build step.) Show the table and confirm which one (by 8-char id or # index). The current live session is usually #0/latest; documenting a finished prior session gives a complete picture (the live one won't include the not-yet-written tail).Extract the facts sheet (cheap, deterministic). Use a UNIQUE output path per run — the fixed
/tmp/session_facts.mdis NOT parallel-safe: concurrent runs (e.g. a batch ofSessionGuidelinespawns) clobber the same file and every reader gets the last writer's sheet. Alwaysmktemp:FACTS=$(mktemp /tmp/session_facts.XXXXXX.md) npx tsx scripts/extract_session.ts <selector> --cwd "$(pwd)" --out-md "$FACTS"<selector>may be an 8-char id, a full path, orlatest(use--index Nfor the Nth most recent). In BATCH runs prefer the explicit JSONL path — the extract's parent-chain walk can drift to a parent file on forked sessions.- Use
--max-text/--max-cmdto widen truncation if you need more prompt/command text.
Read the facts sheet (
$FACTS). Pay attention to:- Prompt 1 = the goal; prompts 2..N = steering (corrections, scope additions, quality bars, yes/all-three style unlocks).
- Skills created / Memories saved — these are the reusable assets; explain why.
- Tool errors / failed commands — these become the Pitfalls section.
- Artifacts — the files the operator ends up with.
Synthesize the guideline following
references/guideline-template.md. Fill every section. Rules:- Write for a future operator with the same goal — instructive, not a log.
- Turn each steering turn into a guardrail ("the AI tended to X → state Y up front").
- For each skill/memory created, state the reusable problem it solves and when to invoke it.
- Rewrite weak prompts into the stronger version the reader should use.
- Quote sparingly; summarize tool activity into phases.
Write the deliverable into the weekly folder. The bucket is the
ISO week bucketline from the facts sheet Metadata (YYYY/Www, ISO-8601 week of the session start). Default location, unless the user says otherwise:<cwd>/Prompt stories/<YYYY>/W<WW>/<Topic>.md # e.g. Prompt stories/2026/W30/Hermes memory pressure.mdmkdir -pthe week folder first. (Do NOT write it inside a skill folder.) Name the file after the session name/topic. Begin the file with the YAML frontmatter block (seereferences/guideline-template.md), filled from the facts sheet:--- session: <8-char id> week: <YYYY/Www> type: <development|plannin
Установить session-to-guideline в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл session-to-guideline?
Turn a pi session into a Markdown "how-we-did-it" collaboration guideline: reads the session's JSONL transcript and synthesizes a reusable playbook of which prompts worked, what had to be steered, and how to reproduce the result faster. Use when: "document this session", "write up how we did X with the AI", "make a guideline from this session", "turn this session into a playbook/tutorial".
Как установить скилл session-to-guideline?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл session-to-guideline запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic