7 Commits

Author SHA1 Message Date
f1be677b0a fix(session-handoff): hook command literal path [v0.3.3]
PostToolUse hook in `~/.claude/settings.json` was using
`$env:USERPROFILE` (PowerShell syntax), but Claude Code on
Windows runs hook commands through git-bash. Bash treats `$env`
as an empty variable, leaving `":USERPROFILE\..."` as the literal
`-File` argument — PowerShell fails with "invalid filename
format" and the hook never fires.

Install snippet in hooks/README.md now uses literal absolute
path `C:\Users\<you>\.claude\...` with a "Why literal path"
section explaining why `$env:VAR` / `%VAR%` / `~` all break
through the bash-harness chain on Windows.

Retracts the v0.3.0 "live-hook e2e smoke done" closure — that
result was from synthetic replay through the PowerShell tool,
which bypassed the broken harness chain. Real e2e verification
requires this fix plus a CC restart, then a substantive commit
to observe `additionalContext` surface.
2026-05-25 06:54:15 +03:00
790f1f41b8 docs(session-handoff): pwsh/powershell choice + restart-after-edit caveat [v0.3.2]
Two findings from live-hook e2e smoke 2026-05-25 on this Windows machine:

(1) README snippet was pwsh-only — PS 7 Core isn't on stock Windows. PS 5.1
(`powershell`) is always present and the hook script runs cleanly under both.
README now leads with `powershell` and notes the `pwsh` swap for PS 7+ users.

(2) Missing caveat that hooks load at Claude Code session start — mid-session
edits to ~/.claude/settings.json don't activate the hook until CC restart.
Without this note user would think the hook is broken after applying the
snippet (standalone smoke would pass but live in-session wouldn't fire).
Added explicit restart instruction + verification recipe.

Also: dist/session-handoff.skill now tracked (was missing since promotion —
inconsistent with other dist/*.skill artifacts that ship in repo).

PATCH bump 0.3.1 → 0.3.2 (docs-only, no behavioral change in hook or skill).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 00:24:23 +03:00
d089df7e9f fix(session-handoff): PowerShell hook body char count [v0.3.1]
`(& git log -1 --format='%b')` in PowerShell collapses multi-line subprocess
output into string[]. The threshold check used `$body.Length` which on a
string[] returns the line count, not char count — so the body>200 condition
was effectively comparing "more than 200 lines", which is much harder to
meet. Files-count saves it in practice for big commits, but small-file
big-message commits were under-detected.

Fix: join the array back into a single string with `-join "`n"` before
measuring length. Verified via stdin-pipe smoke against current HEAD:
body chars now report 1255 (vs 29 before — the line count).

POSIX `.sh` variant unaffected — `$()` collapses output and `${#var}` is
char count.

Bump 0.3.0 → 0.3.1 PATCH (bugfix, no behavior contract change).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 23:41:26 +03:00
cc6c321b57 feat(session-handoff): add PostToolUse commit-detector hook [v0.3.0]
Hooks live in skills/session-handoff/hooks/:
- commit-detector.ps1  Windows/PowerShell
- commit-detector.sh   POSIX (python3 for JSON parsing)
- README.md            opt-in instructions, cross-platform settings.json
                       snippets, smoke procedure

Hook reads PostToolUse stdin, detects substantive `git commit` (prefix
not in meta/docs/style/chore + fix typo, AND body >200 chars OR files >3).
On hit, emits hookSpecificOutput.additionalContext so Claude Code
surfaces a system reminder next iteration. Silent skip on --amend, failed
commits, non-git cwd, trivial prefix, below thresholds.

install.sh deliberately does NOT mutate settings.json — opt-in via the
README hook config snippet, applied once per machine. SKILL.md body
mentions the hook as an optional alternative to the agent-side
behavioral heuristic.

Bump 0.2.1 -> 0.3.0 MINOR (new opt-in capability, backward-compatible —
SKILL keeps working without the hook).

Deferred (separate follow-ups if needed):
- live-hook e2e smoke (would interfere with current session commits)
- rebase/cherry-pick batch deduplication

Closes [session-handoff-posttooluse-hook] (partial: stdin smoke,
live-hook deferred).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 23:36:04 +03:00
90c5be7c88 fix(skills): session-handoff yaml desc, double-quote [v0.2.1]
Bare-scalar description contained `: ` (colon-space) inside backticks
(`Триггер-строка CLAUDE.md ` + literal trigger-line containing `: `).
Strict YAML parser treated the inner `: ` as nested mapping → description
field dropped → harness fallback to H1 → skill listing showed
"session-handoff: session-handoff" (trigger phrases non-functional).

Fix: wrap entire description in double-quotes. Shrink 650→462 chars
(865→555 bytes) by moving substantive-commit heuristic, sliding-overwrite
detail, and project-scope clause to body Steps/Side/Failure sections
(already documented there). All 6 session-end triggers + 4 skip phrases
+ trigger-line preserved verbatim.

Bump 0.2.0 → 0.2.1 PATCH (frontmatter wording, no behavior change).
Closes [session-handoff-install]; unblocks [session-handoff-test-trigger].

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:56:30 +03:00
30330df63a feat(skills): session-handoff body filled, bump 0.1.0 -> 0.2.0
MINOR bump — skeleton (v0.1.0) gets functional 6-section body. Source: .workshop/.archive/2026-05-24-session-handoff-skill.md (Round 1 design + Round 2 resolved Q1-Q10).

Body sections: When to use (read/write triggers + skip patterns), Inputs (read/write), Steps (read 5 + write 5), Failure modes (incl. secret-detection abort), Side effects (sliding overwrite + git-tracked, no global state), What NOT to do (no auto-execute, no append-with-archive, no cross-project, no SessionEnd-hook dependency).

Still skeleton from claude-skills/ POV: no install.sh run, no push, no hermes/mapping.yaml entry — those remain in baseline tasks (session-handoff-install / -hermes-mapping / -test-trigger / -bootstrap-template-extend / -review umbrella).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:44:32 +03:00
eb9e9823ba feat(skills): add session-handoff v0.1.0
Promoted from .workshop/.brainstorm/session-handoff-skill.md (Round 1 design + Round 2 resolved 2026-05-24, Q1-Q10).

Skeleton only — header + empty 6-section body. Body filled in second pass from .workshop/.archive/2026-05-24-session-handoff-skill.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:44:32 +03:00