Track skill version and auto-refresh after upgrade#265
Conversation
Stamp .installed-version alongside SKILL.md on install. On every command, compare a ~/.config/basecamp/.last-run-version sentinel against the running CLI version; on mismatch, silently refresh the installed skill and print a one-line notice to stderr. Add a "Skill Version" doctor check that reports stale/current/untracked status, gated on the baseline skill being installed.
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/commands/skill.go">
<violation number="1" location="internal/commands/skill.go:342">
P2: Sentinel is updated even when skill refresh fails, permanently skipping the retry for this CLI version. If `installSkillFiles()` fails transiently, the auto-refresh won't be attempted again until the *next* version upgrade. Move the sentinel write so it's skipped when a needed refresh failed.</violation>
</file>
<file name="internal/commands/doctor.go">
<violation number="1" location="internal/commands/doctor.go:958">
P2: The "Skill Version" breadcrumb is unreachable. `checkSkillVersion` sets status to `"warn"` for stale versions, but `buildDoctorBreadcrumbs` only processes checks with `"fail"` status. The user will see the warning but never the `basecamp skill install` breadcrumb.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 910e724874
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds version tracking for the embedded Basecamp agent skill and introduces an automatic “refresh on CLI upgrade” mechanism, plus a new basecamp doctor check to surface skill staleness.
Changes:
- Stamp a
.installed-versionfile alongside the installed baselineSKILL.md. - Add
RefreshSkillsIfVersionChanged()to refresh the baseline skill when the CLI version changes, using a~/.config/basecamp/.last-run-versionsentinel. - Add a new “Skill Version” doctor check and hook the refresh into the root command’s
PersistentPostRunE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| internal/commands/skill.go | Writes .installed-version and adds version-sentinel-based auto-refresh logic. |
| internal/commands/doctor.go | Adds “Skill Version” diagnostic check and breadcrumb wiring. |
| internal/cli/root.go | Calls skill auto-refresh after commands and prints a stderr notice on refresh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tests - Only update version sentinel when refresh wasn't needed or succeeded, so transient failures retry on next run - Include warn-status checks in breadcrumb generation so the stale Skill Version breadcrumb is reachable - Suppress refresh notice in machine output modes (--json, --agent) - Add tests for checkSkillVersion (4 scenarios), installedSkillVersion, installSkillFiles version stamping, RefreshSkillsIfVersionChanged (sentinel missing/matching/mismatched/dev/failure-retry), and breadcrumb for warn status
Summary
installSkillFiles()and the wizard now stamp.installed-versionalongside SKILL.mdRefreshSkillsIfVersionChanged()compares~/.config/basecamp/.last-run-versionsentinel against the running CLI version; on mismatch, silently refreshes the baseline skill and prints a one-line stderr noticePersistentPostRunE— works for all upgrade paths (Homebrew, manual, go install)basecamp doctorgains a "Skill Version" check (up to date / stale / untracked / dev build) with breadcrumb tobasecamp skill installTest plan
basecamp skill install→ verify.installed-versionexists at~/.agents/skills/basecamp/.last-run-versionto an old version → run any command → verify skill refreshed + notice printed.last-run-versionto current version → run command → no noticebasecamp doctor→ verify "Skill Version" check appearsbin/cipasses