Skip to content

feat: wire MCP server, add compaction-continuity hooks + CI#15

Merged
SchnappAPI merged 1 commit into
mainfrom
feat/mcp-continuity-hooks-ci
May 30, 2026
Merged

feat: wire MCP server, add compaction-continuity hooks + CI#15
SchnappAPI merged 1 commit into
mainfrom
feat/mcp-continuity-hooks-ci

Conversation

@SchnappAPI
Copy link
Copy Markdown
Owner

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

Ships the GitHub remote MCP server (type:"http", https://api.githubcopilot.com/mcp/, Authorization: Bearer ${GITHUB_TOKEN}). Project-scoped .mcp.json is 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 in docs/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:

  • PreCompactpre-compact-snapshot.sh: snapshots git/task state + backs up the transcript before compaction (PreCompact is side-effect-only by contract, confirmed against the docs).
  • SessionStartsession-resume-breadcrumb.sh: re-surfaces that snapshot as additionalContext on the next resume (one-shot).
  • SessionEndsession-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 — runs tests/run-all.sh on every PR and on pushes to main (the repo previously had no CI).
  • validate-manifests.sh now also validates marketplace.json (with a regression guard against stale layered-model text — the exact drift that slipped past the flatten) and .mcp.json.
  • smoke-plugin.sh gains section G: a hermetic PreCompact → SessionStart → SessionEnd round-trip test (temp HOME + repo).

All five validators pass locally (smoke-plugin: PASS, 17 hook paths resolve).

Not included / follow-ups

  • .claude/settings.json still has a stale python3 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).
  • The skill-slimming option (44 heavy SKILL.md) was intentionally not taken.

Note: opened from a fresh feat/ branch because PR #14 was squash-merged, which left the previous branch diverged from main.

https://claude.ai/code/session_01U6H3oa4GEngboKuc8jvwC3


Generated by Claude Code

… 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
@SchnappAPI SchnappAPI merged commit 1d0354b into main May 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants