feat(cli): add sm skill commands for managing Claude skills#138
Merged
antosubash merged 3 commits intomainfrom Apr 30, 2026
Merged
feat(cli): add sm skill commands for managing Claude skills#138antosubash merged 3 commits intomainfrom
sm skill commands for managing Claude skills#138antosubash merged 3 commits intomainfrom
Conversation
- 'sm skill add <name>' scaffolds a new skill or fetches one from a
GitHub repo ('owner/repo[/path][@ref]') or a local directory.
- 'sm skill update [name]' re-fetches tracked skills, supports --check
for drift reporting and --dry-run.
- 'sm skill list' shows installed skills with sources and lock status.
- Tracks installed skills in skills-lock.json with computed SHA-256
content hashes.
Deploying simplemodule-website with
|
| Latest commit: |
e69b00e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0db8005f.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-add-skills-cli-comman.simplemodule-website.pages.dev |
- Wrap transport/IO/JSON exceptions in SkillFetcher.FetchAsync so callers catch a single InvalidOperationException instead of three identical catch blocks. - Use a static shared HttpClient (matching NuGetVersionResolver) and drop the redundant per-command 'using var http = new HttpClient()'. - Replace the 'scaffold' magic string with SkillSource.TypeIdScaffold. - Flatten the dual Ref-override branch in SkillUpdateCommand into a single resolved-ref assignment. - Drop unused FetchedSkillFile.Length.
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.
Summary
Adds a new
sm skillcommand branch to the CLI for managing Claude skills under.claude/skills, with the install state tracked inskills-lock.json(the file already existed in the repo without any tooling backing it).Commands
sm skill add <name> [--source <src>] [--description <text>] [--force] [--dry-run]— Adds a skill to the project. Without--source, scaffolds a minimalSKILL.md. With--sourceit accepts:owner/repo,owner/repo/path,owner/repo/path@ref(branch / tag / SHA).//../pathsm skill update [name] [--ref <ref>] [--check] [--dry-run]— Re-fetches skills tracked inskills-lock.jsonand refreshes their content + computed hash. Without a name, updates every tracked non-scaffold skill.--checkreports drift without writing. Returns exit code 2 when drift is detected (useful for CI).sm skill list— Tabular view of installed skills, their source, ref, hash, andtracked/untracked/missingstatus.Implementation notes
SkillsLockFileround-trips the existingskills-lock.jsonschema (version,skills{ source, sourceType, ref?, computedHash }).SkillFetcheruses the GitHub Contents API (api.github.com/repos/.../contents/...) and falls back to the repo'sdefault_branchwhen no ref is given. HonorsGITHUB_TOKENfor higher rate limits.path:hashmanifest, so identical content produces a stable hash regardless of fetch order.SkillWriterrefuses to write outside the target skill directory (path-traversal guard) and creates a self-contained scaffold for new skills.Test plan
dotnet build cli/SimpleModule.Cli/SimpleModule.Cli.csproj— clean build (TreatWarningsAsErrors).dotnet csharpier check— formatting matches project standard.sm skill --help,sm skill add --help,sm skill update --helprender correctly.sm skill add tmp-test-skill --description "..."— scaffolds.claude/skills/tmp-test-skill/SKILL.mdand updatesskills-lock.json.sm skill add tmp-test-skill --description "..." --dry-run— prints planned changes without writing.sm skill list— shows existing on-disk skills asuntrackedand the existingshadcnlock entry asmissing(since its directory isn't present).sm skill update --check— gracefully reports network failures (e.g., GitHub rate-limit 403) without crashing.Generated by Claude Code