feat(claude-setup): derive skill version from release tag; port SKILL.md lazy-load guidance#21
Merged
Conversation
….md lazy-load guidance Replace the hand-maintained skill version (inline `<!-- samurai-skill-v3 -->` marker + `const version`) with a version derived at install time from the module release via runtime/debug.ReadBuildInfo. Cutting a git tag/release is now the only version action — nothing to keep in sync by hand. Removing the inline marker from skill/SKILL.md also fixes a latent double-marker bug: main.go appended a marker to content that already ended with one, so fresh installs wrote it twice. Port three generic SKILL.md improvements that had diverged in a downstream copy: a Good For/Bad For summary, a lazy-load resources heading, and per-file "read only when" guidance for api.md/pitfalls.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…printf Replace string concatenation for the version marker with a small skillMarker helper and fmt.Sprintf; compute the version once per run. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
What
<!-- samurai-skill-v3 -->marker +const version = "3"with a version derived at install time from the module release viaruntime/debug.ReadBuildInfo()(Main.Version). The marker written into installedSKILL.mdbecomes the release tag, e.g.<!-- samurai-skill-v0.9.0 -->; local builds fall back todev.main.goappended a marker to embedded content that already ended with one, so fresh installs wrote it twice. Removing the inline marker from the sourceSKILL.mdleaves a single, runtime-generated marker.SKILL.mdimprovements that had diverged in a downstream copy: aGood For/Bad Forsummary, a lazy-load resources heading, and per-file "read only when" guidance forapi.md/pitfalls.md.Why
Cutting a git tag/release is already done every time the skill changes, so a separate hand-synced skill version was redundant duplication (and drifted before — see commit 16ac1f7). Tying the marker to the release tag means creating the tag is the version bump; the installer auto-detects when a downstream copy is stale.
Trade-off
The marker now changes on every release, so a downstream re-install rewrites the skill files even when the skill content was unchanged. Acceptable: re-installing is an intentional manual action, and it skips when the installed marker already matches the running binary's release.
Verification
go build ./cmd/claude-setup,go vet,go test ./...— all pass.🤖 Generated with Claude Code