Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/setup/user_skills.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,13 @@ func buildUserCandidates(opts UserInstallOptions) []userCandidate {
for _, client := range normalizeUserClients(opts.Clients) {
root := userClientRoot(client)
for _, asset := range skills.Native(nativeAssetClient(client)) {
content := strings.ReplaceAll(asset.Content, userVersionToken, opts.Version)
// The Agent Plugins 1.0 schema requires bare semver: a
// v-prefixed version invalidates the whole manifest. The
// build stamps Version from a v-prefixed git tag, so the
// v is dropped here. Status, plan, and update surfaces
// keep the v-prefixed form and are unchanged.
assetVersion := strings.TrimPrefix(opts.Version, "v")
content := strings.ReplaceAll(asset.Content, userVersionToken, assetVersion)
Comment on lines +446 to +447

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Release notes miss this fix. The repository requires an [area] scope: imperative summary commit subject, a Note: Fixed: ... trailer for user-facing fixes, and an update to the matching CHANGELOG.md. This commit has an unformatted subject, no trailer, and changes only the implementation and test files. Update the commit message and changelog before merging so the release bot includes this fix.

Rule Used: RYOKU COMMIT/PR CONVENTIONS (enforced by .githooks in every Ryoku repo; --no-verify is forbidden). Subjects: \[area\] scope: imperative summary, area one of global|installation|system|ryoku|docs|test|tooling|release (shell changes use [global]); 72 c... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/setup/user_skills.go
Line: 446-447

Comment:
**Release notes miss this fix.** The repository requires an `[area] scope: imperative summary` commit subject, a `Note: Fixed: ...` trailer for user-facing fixes, and an update to the matching `CHANGELOG.md`. This commit has an unformatted subject, no trailer, and changes only the implementation and test files. Update the commit message and changelog before merging so the release bot includes this fix.

**Rule Used:** RYOKU COMMIT/PR CONVENTIONS (enforced by .githooks in every Ryoku repo; --no-verify is forbidden). Subjects: `\[area\] scope: imperative summary`, area one of global|installation|system|ryoku|docs|test|tooling|release (shell changes use \[global\]); 72 c... ([source](https://app.greptile.com/-/switch-tenant?tenant=ryoku&next=%2Fcustom-context%3Fmemory%3Dc885c516-9406-453f-9659-5f5e48e9ae72))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

out = append(out, userCandidate{
client: client,
assetID: client + ":" + asset.Path,
Expand Down
31 changes: 31 additions & 0 deletions internal/setup/user_skills_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ func TestUserSkillPlanPreviewOrderingIsStable(t *testing.T) {

// TestUserSkillPlanFirstInstallChecksums proves a first install produces install
// actions whose checksums equal the exact bytes that would be written.
// TestUserSkillPlanFirstInstallChecksums proves a fresh install reports every
// asset with the expected checksum.
func TestUserSkillPlanFirstInstallChecksums(t *testing.T) {
opts := newUserOpts(t)
plan := mustPlan(t, opts)
Expand All @@ -291,6 +293,35 @@ func TestUserSkillPlanFirstInstallChecksums(t *testing.T) {
}
}

// TestUserSkillManifestVersionIsBareSemver pins the agent-plugins schema
// requirement: a v-prefixed build version must not reach the plugin manifest.
// The schema validator rejects the whole plugin on a non-semver version
// string, which takes every skill and command down with it.
func TestUserSkillManifestVersionIsBareSemver(t *testing.T) {
opts := newUserOpts(t)
opts.Version = "v9.9.9"
mustApply(t, opts)
for _, client := range opts.Clients {
manifest := filepath.Join(opts.Home, userClientRoot(client), ".claude-plugin", "plugin.json")
if client != "claude" {
continue
}
raw, err := os.ReadFile(manifest)
if err != nil {
t.Fatalf("read %s: %v", manifest, err)
}
var decoded struct {
Version string `json:"version"`
}
if err := json.Unmarshal(raw, &decoded); err != nil {
t.Fatalf("decode %s: %v", manifest, err)
}
if decoded.Version != "9.9.9" {
t.Errorf("manifest version %q, want bare semver \"9.9.9\" (Agent Plugins 1.0 schema rejects a v prefix)", decoded.Version)
}
}
}

// TestUserSkillPlanAllCurrentIsNoOp proves a re-plan after a successful install
// reports every asset as unchanged.
func TestUserSkillPlanAllCurrentIsNoOp(t *testing.T) {
Expand Down