Skip to content

feat(claude-setup): derive skill version from release tag; port SKILL.md lazy-load guidance#21

Merged
stepan-romankov merged 2 commits into
masterfrom
skill/derive-version-from-release
May 21, 2026
Merged

feat(claude-setup): derive skill version from release tag; port SKILL.md lazy-load guidance#21
stepan-romankov merged 2 commits into
masterfrom
skill/derive-version-from-release

Conversation

@stepan-romankov
Copy link
Copy Markdown
Contributor

What

  • Drop the hand-maintained skill version. Replace the inline <!-- samurai-skill-v3 --> marker + const version = "3" with a version derived at install time from the module release via runtime/debug.ReadBuildInfo() (Main.Version). The marker written into installed SKILL.md becomes the release tag, e.g. <!-- samurai-skill-v0.9.0 -->; local builds fall back to dev.
  • Fix a latent double-marker bug. main.go appended a marker to embedded content that already ended with one, so fresh installs wrote it twice. Removing the inline marker from the source SKILL.md leaves a single, runtime-generated marker.
  • 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.

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.
  • Scratch install: writes a single marker; second run reports "already up to date"; installed file = source body + one appended marker line.

🤖 Generated with Claude Code

stepan-romankov and others added 2 commits May 21, 2026 11:08
….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>
@stepan-romankov stepan-romankov merged commit 755c69c into master May 21, 2026
2 checks 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.

1 participant