feat(skills): install skill bundles from a git repository - #1166
Open
addyCooks wants to merge 2 commits into
Open
feat(skills): install skill bundles from a git repository#1166addyCooks wants to merge 2 commits into
addyCooks wants to merge 2 commits into
Conversation
docs/features/skills.md calls a bundle "one shareable artifact", but
there was no install path anywhere in source/skills/ - every skill had
to be hand-authored into .nanocoder/skills/. This adds the fetch half.
`nanocoder skills add <name|owner/repo|git-url|path>` is a CLI fast path
mirroring `nanocoder daemon`: it loads only the installer, no Ink, no
providers, no tool registry.
Installing a skill is arbitrary code execution - a bundle tool is a
shell script, `approval: never` skips confirmation entirely, and a
`subscribe:` block makes the daemon fire it headless. So nothing is
written into the project until the user has seen what that means:
1. shallow-clone into a temp dir (git is already a hard dependency,
so no tarball library is needed) and strip .git
2. reject any bundle containing a symlink - a bundle is markdown and
YAML, so a symlink is only ever an escape attempt
3. validate through parseSkillManifest and the /skills check linter
4. render a trust prompt naming every tool WITH its declared approval
policy and every subscription with its trigger - names alone don't
tell you what you are agreeing to
5. land it through applyPromotion, so collision and --force behave
exactly like /skills promote
Bare names resolve through a plain skills.json index hosted in a git
repo - no registry service. NANOCODER_SKILLS_INDEX or --index points at
another list, including a local file a team checks into its own repo. An
index entry that promises one name but delivers a bundle declaring
another is refused.
Reuse rather than new machinery: checkSkillBundle gains an optional
bundle-path override (so it can lint a clone that is not in the project
yet) and returns the loaded Skill for the trust prompt; PromotionPlan
gains a `remote` origin.
Tests are hermetic - they clone from local git fixtures in a temp dir
and never touch the network - and cover the adversarial bundles:
symlink escape (staged as a git mode-120000 entry so the fixture works
without symlink privileges), path traversal via --subdir and via the
manifest's include globs, and an index/manifest name mismatch.
Refs Nano-Collective#1163.
addyCooks
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
September 3, 2026 09:38
Implements issue Nano-Collective#1162 in three phases: Phase 1 - Resources: - Add MCPResource types and client methods (listResources, readResource) - Integrate resources into mention system as @-mentions - Add RESOURCE placeholder type and formatter Phase 2 - Prompts: - Add MCPPrompt types and client methods (listPrompts, getPrompt) - Register MCP prompts as slash commands (mcp:server:prompt format) - Integrate into lazy command registry Phase 3 - Sampling: - Add sampling capability to MCP client - Implement setSamplingHandler for server-initiated sampling requests - Add MCPSamplingRequest/Result types All phases include comprehensive test coverage. Resolves Nano-Collective#1162
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.
Closes #1163.
Description
Adds
nanocoder skills add, the install path for skill bundles described above. Seven files: two new (source/skills/install.ts,source/skills/install.spec.ts), three small edits to existing skills/CLI code, plus docs and a changeset.The trust prompt as it actually renders:
--yesstill prints that summary before installing, so an unattended install leaves a record of what it agreed to.Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist