Skip to content

Track skill version and auto-refresh after upgrade#265

Merged
jeremy merged 2 commits intomainfrom
skill-version-tracking
Mar 11, 2026
Merged

Track skill version and auto-refresh after upgrade#265
jeremy merged 2 commits intomainfrom
skill-version-tracking

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • installSkillFiles() and the wizard now stamp .installed-version alongside SKILL.md
  • RefreshSkillsIfVersionChanged() compares ~/.config/basecamp/.last-run-version sentinel against the running CLI version; on mismatch, silently refreshes the baseline skill and prints a one-line stderr notice
  • Called from PersistentPostRunE — works for all upgrade paths (Homebrew, manual, go install)
  • basecamp doctor gains a "Skill Version" check (up to date / stale / untracked / dev build) with breadcrumb to basecamp skill install

Test plan

  • basecamp skill install → verify .installed-version exists at ~/.agents/skills/basecamp/
  • Tamper .last-run-version to an old version → run any command → verify skill refreshed + notice printed
  • Match .last-run-version to current version → run command → no notice
  • basecamp doctor → verify "Skill Version" check appears
  • bin/ci passes

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.
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 07:07
Copilot AI review requested due to automatic review settings March 11, 2026 07:07
@github-actions github-actions bot added the commands CLI command implementations label Mar 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-version file alongside the installed baseline SKILL.md.
  • Add RefreshSkillsIfVersionChanged() to refresh the baseline skill when the CLI version changes, using a ~/.config/basecamp/.last-run-version sentinel.
  • 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
@github-actions github-actions bot added tests Tests (unit and e2e) enhancement New feature or request labels Mar 11, 2026
@jeremy jeremy merged commit 0773d06 into main Mar 11, 2026
26 checks passed
@jeremy jeremy deleted the skill-version-tracking branch March 11, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants