fix(skill): mark installed skills internal#279
Merged
Conversation
no-mistakes init vendors the agent skill into target repos (.claude/skills and .agents/skills). Skill discovery tools like `npx skills add <owner>/<repo>` surfaced those vendored copies alongside the repo's own public skills, and init refreshes would strip any downstream-added flag. Split the skill rendering: Markdown() stays the canonical public document (skills/no-mistakes/SKILL.md, still discoverable), while the new InstalledMarkdown() adds `metadata.internal: true` to the frontmatter and is what Install() writes, on fresh init and refresh alike. genskill now also generates and drift-checks this repo's own vendored copy in .agents/skills, so discovery on this repo surfaces exactly one no-mistakes skill.
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.
Intent
Fix no-mistakes so the skill files that 'no-mistakes init' vendors into target repos (.claude/skills/no-mistakes/SKILL.md and .agents/skills/no-mistakes/SKILL.md) are marked internal via 'metadata.internal: true' in the YAML frontmatter, so end-user skill discovery tools like 'npx skills add /' never surface the vendored copy alongside a repo's real public skills. Downstream repos (lavish-axi, chrome-devtools-axi, gh-axi) were patched by hand with this flag, but init refresh overwrites vendored files from its template and would strip it, so the fix belongs at the source. Deliberate decisions: (1) the rendering was split in internal/skill into Markdown() - the canonical public document, byte-identical to before, still used for skills/no-mistakes/SKILL.md which must REMAIN discoverable via npx skills add kunchenguid/no-mistakes - and a new InstalledMarkdown() that only adds the metadata.internal block; Install() now writes InstalledMarkdown() on both fresh init and refresh. (2) cmd/genskill was deliberately extended to also generate and drift-check this repo's own vendored copy at .agents/skills/no-mistakes/SKILL.md (.claude/skills is a symlink to it), so make skill / make lint keep the vendored copy in lockstep and discovery on this repo surfaces exactly one no-mistakes skill; the committed .agents/skills/no-mistakes/SKILL.md change is that regenerated output. (3) Tests updated accordingly: internal/skill Install tests now compare against InstalledMarkdown(), a new TestInstalledMarkdownMarksInternal guards that installed copies carry the marker, that the public rendering does not, and that the two renderings differ only by the marker; the e2e assertSkillInstalled helper now requires the marker. Verified end to end: fresh init and refresh-over-old-unflagged-copy in scratch /tmp repos both write the flag, npx skills add on the scratch repo finds no skills, and on this repo finds exactly the one public skill. go test -race ./..., make e2e, and make lint all pass.
What Changed
no-mistakes initvendored skill files as internal while keeping the publicskills/no-mistakes/SKILL.mddiscoverable.metadata.internal: trueto both.claudeand.agentsskill copies.Risk Assessment
✅ Low: The change is narrow, preserves the public skill rendering while marking only installed vendored copies internal, and updates generator and install assertions consistently.
Testing
Focused skill and init e2e tests passed, a manual CLI transcript demonstrated fresh init, refresh-over-stale-copy, target-repo discovery suppression, and public repo discovery, then the full Go race suite and full e2e suite passed; an initial evidence run exposed a setup-only Unix socket path length issue, so the manual check was rerun with a shorter approved temp
NM_HOMEand transient artifacts were cleaned.Evidence: End-to-end init and skills discovery transcript
Source: End-to-end init and skills discovery transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
go test -race ./internal/skill -run 'TestInstalledMarkdownMarksInternal|TestInstallWritesBothPaths|TestInstallIsIdempotent|TestInstallOverwritesStaleContent' -count=1go test -race ./internal/e2e -tags e2e -run 'TestInit' -count=1go build -o .no-mistakes/evidence/fm/nm-init-internal-t2/no-mistakes-test-bin ./cmd/no-mistakesManual end-to-end check: ranno-mistakes initin a fresh git repo with an origin remote, inspected.claude/skills/no-mistakes/SKILL.mdand.agents/skills/no-mistakes/SKILL.md, then rannpx --yes skills add <fresh-target-repo> --list --full-depth.Manual end-to-end check: seeded a target repo with a stale unmarked.claude/skills/no-mistakes/SKILL.md, ranno-mistakes init, inspected refreshed.claudeand.agentsfrontmatter, then rannpx --yes skills add <refresh-target-repo> --list --full-depth.Manual public-discovery check: inspectedskills/no-mistakes/SKILL.mdfrontmatter and rannpx --yes skills add . --list --full-depth.go test -race ./...make e2e✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.