feat: wire MCP server, add compaction-continuity hooks + CI#15
Merged
Conversation
… hooks + CI
MCP:
- Add project-scoped .mcp.json shipping the GitHub remote MCP server (http,
env-gated via ${GITHUB_TOKEN}). Project scope means pending-approval, so it
never auto-connects. Documented in docs/MCP.md.
Hooks (two previously-unused events, wired into a continuity loop):
- PreCompact -> pre-compact-snapshot.sh: snapshot git/task state + back up
the transcript before compaction (PreCompact is side-effect only).
- SessionStart -> session-resume-breadcrumb.sh: re-surface that snapshot as
additionalContext on the next resume, one-shot.
- SessionEnd -> session-end-cleanup.sh: drop the single-use destructive-guard
bypass and GC old breadcrumbs/transcripts.
Config hygiene:
- marketplace.json: rewrite the two descriptions that still described the
pre-flatten layered model; drop "(overlays)" from the hooks.json description.
Tests / CI:
- validate-manifests.sh now validates marketplace.json (+ a regression guard
against stale layered-model text) and .mcp.json.
- smoke-plugin.sh section G exercises the PreCompact -> SessionStart ->
SessionEnd round-trip hermetically (temp HOME + repo).
- Add .github/workflows/validate.yml to run tests/run-all.sh on PRs and main.
Note: .claude/settings.json still has a stale `python3 scripts/*` allow-rule
(scripts/ was deleted in the flatten); the permission-edit guardrail blocked
removing it, so it is left for manual cleanup.
https://claude.ai/code/session_01U6H3oa4GEngboKuc8jvwC3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the improvements chosen from the kit review: fix stale configs, wire MCP, add the two unused session-lifecycle hooks, plus proven best-practice additions (CI + manifest validation).
MCP —
.mcp.jsonShips the GitHub remote MCP server (
type:"http",https://api.githubcopilot.com/mcp/,Authorization: Bearer ${GITHUB_TOKEN}). Project-scoped.mcp.jsonis pending-approval in Claude Code — it never auto-connects, so this is safe to ship. Env-var expansion keeps the token out of the repo. Documented indocs/MCP.md(approval flow + how to add more servers).Hooks — two previously-unused events, wired into a continuity loop
Claude Code only used 5 of 9 hook events; this adds the two highest-fit:
pre-compact-snapshot.sh: snapshots git/task state + backs up the transcript before compaction (PreCompact is side-effect-only by contract, confirmed against the docs).session-resume-breadcrumb.sh: re-surfaces that snapshot asadditionalContexton the next resume (one-shot).session-end-cleanup.sh: drops the single-use destructive-guard bypass and GCs old breadcrumbs/transcripts.This gives the kit's existing session-state machinery a real trigger on the exact event (compaction) it was built for.
Config hygiene
marketplace.json: rewrote the two descriptions that still described the pre-flatten layered model.hooks.json: dropped the stale(overlays)wording from the description.Tests / CI (best-practice additions)
.github/workflows/validate.yml— runstests/run-all.shon every PR and on pushes tomain(the repo previously had no CI).validate-manifests.shnow also validatesmarketplace.json(with a regression guard against stale layered-model text — the exact drift that slipped past the flatten) and.mcp.json.smoke-plugin.shgains section G: a hermetic PreCompact → SessionStart → SessionEnd round-trip test (tempHOME+ repo).All five validators pass locally (
smoke-plugin: PASS, 17 hook paths resolve).Not included / follow-ups
.claude/settings.jsonstill has a stalepython3 scripts/*allow-rule (that dir was deleted in the flatten). The permission-edit guardrail blocked me from removing it — left for you to delete manually (it's harmless; the rule just never matches).SKILL.md) was intentionally not taken.https://claude.ai/code/session_01U6H3oa4GEngboKuc8jvwC3
Generated by Claude Code