feat(onboarding): /update command + SessionStart drift hook#117
Open
abdout wants to merge 2 commits into
Open
Conversation
…broken sync.sh Three install scripts (setup.sh, sync-repos.sh, installer.sh) had to be remembered + run in order to keep a teammate's machine current. And the existing sync.sh was broken — pulling from databayt/codebase (engine moved to databayt/kun long ago) with a hardcoded stale list of 30 agents. After this PR, the answer to "how do I update?" is `c /update`. ## /update slash command (.claude/commands/update.md) Chains: 1. git -C ~/kun pull --ff-only origin main # latest engine 2. bash ~/kun/.claude/scripts/setup.sh # mirror ~/kun/.claude/* → ~/.claude/* 3. bash ~/.claude/scripts/sync-repos.sh all # pull 11 org repos 4. bash ~/.claude/scripts/health.sh # verify Optional flags: --tools (also re-runs the smart-install bootstrap from PR #113 — brew/apt/winget upgrade in place); --dry (print steps only). Prints a one-line summary at the end (engine: <old> → <new>; repos: X synced; tools: skipped|refreshed; health: <status>). ## SessionStart drift hook (.claude/hooks/session-start-kun-drift.{sh,ps1}) Silently `git fetch`es ~/kun at every Claude Code session start. If ~/kun is N commits behind origin/main, prints:⚠️ ~/kun is N commits behind origin/main — run `c /update` to refresh Never auto-pulls — teammate decides when to refresh (respects the anti-auto-update posture from mcp.mdx for MCP versions; same posture for engine config). Silent on offline machines + when up to date. Registered in both .claude/settings.json (Darwin/Linux) and .claude/settings-windows.json under the SessionStart hook chain. ## setup.sh + setup.ps1 — copy .claude/hooks/* to ~/.claude/hooks/ New block in both scripts copies the hook directory during install or update, alongside existing agents/commands/rules/memory/scripts copies. chmod +x on .sh hooks. Prints "hooks (N)" count. ## Retire .claude/scripts/sync.sh + sync.ps1 Hard-deleted (-296 lines). Their replacement is `setup.sh` (already role-aware, already pulls from local ~/kun/.claude/* dynamically, already detects MODE=update if ~/.claude/agents/ exists). The /update command chains it. Updated content/docs/claude-code.mdx: - "Configuration Sync" section rewritten to point at `/update` - File-tree listing updated: removed sync.sh / sync.ps1; added installer*/onboarding-*/vercel-pull/health/secrets references ## New "Staying current" docs section (content/docs/onboarding.mdx) Inserted after "Auto-resume" (~line 519). Cheat-sheet table covering the four layers (engine config / org repos / tools / Claude CLI) with source-of-truth, refresh mechanism, and `--tools` guidance. Documents the SessionStart drift hook + the explicit non-bump for MCP versions (@playwright/mcp@0.0.75 stays pinned) + when to manually run vercel-pull.sh for env rotations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…b2cd34) 5b2cd34 only landed the sync.sh deletions because git add tripped on the already-deleted paths and bailed. This commit lands the rest: - .claude/commands/update.md — the /update slash command body - .claude/hooks/session-start-kun-drift.sh — bash drift hook - .claude/hooks/session-start-kun-drift.ps1 — Windows drift hook - .claude/settings.json — SessionStart chain registers the hook - .claude/settings-windows.json — same for Windows - .claude/scripts/setup.sh — copies .claude/hooks/* to ~/.claude/hooks/ - .claude/scripts/setup.ps1 — Windows equivalent - content/docs/claude-code.mdx — Configuration Sync section rewritten to point at /update; file-tree listing updated (no more sync.sh) - content/docs/onboarding.mdx — new "Staying current" section with cheat-sheet table after "Auto-resume" Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Why
After the 3 onboarding-overhaul PRs landed (#111, #113, #114), the question became: how does a teammate who paste-installed last week pick up today's changes? Three different layers, each with a different cadence:
~/.claude/*)databayt/kungit pull ~/kun→setup.shsync-repos.sh allclaude.ai/install.shAudit on 2026-05-25 found:
sync.sh/sync.ps1was broken — pulled fromdatabayt/codebase(engine moved todatabayt/kunlong ago) with a hardcoded stale list of 30 agents (real count differs)After this PR, the answer to "how do I update?" is
c /update.What lands
.claude/commands/update.md— the slash commandChains:
git pull ~/kun→setup.sh→sync-repos.sh all→health.sh. Flags:--tools(also re-runs the smart-install bootstrap from #113);--dry(print only). Prints a one-line summary at the end (engine: <old> → <new>; repos: X synced; tools: skipped|refreshed; health: <status>)..claude/hooks/session-start-kun-drift.{sh,ps1}— drift hookSilently
git fetches~/kunat every Claude Code session start. If behind, prints⚠️ ~/kun is N commits behind — run \c /update` to refresh. **Never auto-pulls** — respects the explicit anti-auto-update posture frommcp.mdx`. Silent on offline machines + when up to date.Registered in
.claude/settings.json(mac/linux) and.claude/settings-windows.jsonunder theSessionStarthook chain. Both hook script and registration ride along withsetup.sh.setup.sh+setup.ps1— copy.claude/hooks/*New block in both scripts copies the hook directory during install or update, alongside existing agents/commands/rules/memory/scripts copies.
Hard-deleted
.claude/scripts/sync.sh+.ps1Their replacement is
setup.sh(already role-aware, already pulls from local~/kun/.claude/*dynamically, already detectsMODE=update)./updatechains it.content/docs/claude-code.mdx/updatesync.sh/sync.ps1; addedinstaller*/onboarding-*/vercel-pull/health/secretsreferencescontent/docs/onboarding.mdx— new "Staying current" sectionAfter "Auto-resume" (~line 519). Cheat-sheet table covering the 4 layers with source-of-truth + refresh mechanism. Documents the drift hook + the explicit non-bump for MCP versions + when to run
vercel-pull.shmanually.Test plan
c /updateruns to completion; summary line accurate;~/.claude/agents/count matches~/kun/.claude/agents/⚠️ ~/kun is N commit(s) behindline appears in the session headerc /update --tools: runs the smart-install pass; brew/apt/winget output shows "up to date" or "upgraded" per toolsetup.shafter this PR: printshooks (2)and~/.claude/hooks/session-start-kun-drift.shexists + is executablegrep -rn 'scripts/sync\.\(sh\|ps1\)' .claude content/docsis emptypnpm buildof docs site greenCommits
5b2cd34git addtripped on pre-staged deletions)44d897aSquash-merge will collapse these into one. Net: +220 / -131 across both commits.
🤖 Generated with Claude Code