From 1c69a5bc299eecdd5cb0a74072447f8232c3db97 Mon Sep 17 00:00:00 2001 From: Oskar Kapala Date: Wed, 3 Jun 2026 16:06:46 +0200 Subject: [PATCH] feat(skills): save-session skill for Claude Code Records session facts (git log, diff --stat, deploys from transcript) by appending to docs/sessions/YYYY-MM-DD.md with a mandatory narrative placeholder. Never touches backlog.md or CLAUDE.md without explicit instruction. Commits only the session file. Co-Authored-By: Claude Sonnet 4.6 --- .claude/skills/save-session/SKILL.md | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .claude/skills/save-session/SKILL.md diff --git a/.claude/skills/save-session/SKILL.md b/.claude/skills/save-session/SKILL.md new file mode 100644 index 0000000..22f87d7 --- /dev/null +++ b/.claude/skills/save-session/SKILL.md @@ -0,0 +1,65 @@ +--- +name: save-session +description: Save and record the current work session to docs/sessions/. Trigger ONLY on explicit "save session", "zapisz sesję", or "wrap up" — never invoke proactively between tasks. +--- + +**Trigger condition**: user explicitly says "save session", "zapisz sesję", "wrap up", or equivalent. +Never invoke proactively. Never invoke mid-task. + +## 1. Determine Session Boundary + +1. Read the latest entry file in `docs/sessions/` — use its last `## Session HH:MM` heading timestamp as the start boundary. +2. Fallback if no previous entry exists: 24 hours ago. + +## 2. Collect Facts (deterministic only — no invention) + +Run exactly: +```bash +# All commits since boundary +git --no-pager log --oneline ..HEAD + +# Changed file summary +git --no-pager diff --stat ..HEAD +``` + +From the visible conversation transcript: deploys run and their outcomes, test results seen. + +## 3. Write the Session Entry + +**APPEND** to `docs/sessions/YYYY-MM-DD.md` (create the file if it doesn't exist for today). +Never overwrite existing content. + +```markdown +## Session HH:MM + +### Commits + + +### Files changed + + +### Deploys + + +### Narrative +> _user-provided summary_ +``` + +The `> _user-provided summary_` placeholder is **mandatory**. Never fill it in. The user supplies the narrative separately if desired. + +## 4. What NOT to Touch + +- `backlog.md` — only on explicit "update backlog" instruction +- `CLAUDE.md` — only on explicit "update CLAUDE.md" instruction +- Any other file not listed above + +## 5. Commit + +Stage and commit **only** the session file: + +```bash +git add docs/sessions/YYYY-MM-DD.md +git commit -m "docs: session YYYY-MM-DD HH:MM" +``` + +No other files. No `git add -A`.