feat: add sanity skills install command to allow manual skills install#1292
Open
mwritter wants to merge 10 commits into
Open
feat: add sanity skills install command to allow manual skills install#1292mwritter wants to merge 10 commits into
mwritter wants to merge 10 commits into
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (fe61c5d) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 11.13 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 902ms | -2ms, -0.2% |
bin:sanity
| Metric | Value | vs main (fe61c5d) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.06s | -9ms, -0.4% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (fe61c5dd)
| Metric | Value | vs main (fe61c5d) |
|---|---|---|
| Internal (raw) | 98.2 KB | - |
| Internal (gzip) | 23.3 KB | - |
| Bundled (raw) | 21.70 MB | - |
| Bundled (gzip) | 3.45 MB | - |
| Import time | 798ms | -13ms, -1.5% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (fe61c5dd)
| Metric | Value | vs main (fe61c5d) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Contributor
Coverage Delta
Comparing 9 changed files against main @ Overall Coverage
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e6a1629. Configure here.
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.

Description
Adds a standalone
sanity skills installcommand so users can install (and refresh) Sanity agent skills for their detected AI editors at any time, not just duringsanity init. Previously skills install only ran as part of init (bundled into the combined MCP + skills prompt) and there was no way to re-run it afterward, nor didsanity mcp configurecover skills. This command fills that gap while keeping skills logic cleanly decoupled from MCP setup.The command is intentionally non-interactive: it forwards every detected editor that has a skills-CLI mapping straight to
setupSkills, with no agent-selection prompt. Re-running is idempotent —skills add ... -g -yoverwrites the skill files in place, so runningsanity skills installagain updates already-installed skills to the latest version.AIGRO-5089
What to review
actions/skills/configureSkills.ts,commands/skills/install.ts) —configureSkillsdedupes the detected editors' skills-CLI agents and forwards all of them tosetupSkills; no prompt and no installed-state filtering, since re-installs are intentional and idempotent. The command skips authentication because skills install creates no Sanity token. TelemetrySkillsInstallTracerecords standalone installs.setupSkillsprogress UX (actions/skills/setupSkills.ts) — wraps the install in a spinner and prints✔ Sanity agent skills installedon success (or a failure message on error) so the user sees the CLI is doing work.readSkillStateuniversal-agent handling (actions/skills/readSkillState.ts,actions/skills/skillCandidates.ts) — now takes the detected editors and credits "universal" editors (whose skills live in the shared.agents/skillsdir) as installed even whenskills list -g --jsonomits them. Worth confirming the universal-path detection.setupMCP/ init alignment (actions/mcp/setupMCP.ts,types.ts,editorConfigs.ts) — init's combined prompt still derives "needs skills" from the sharedgetSkillCandidatesprimitive (replacing the oldeditor.skillInstalledmarking, now removed from theEditortype).sanity initruns the skills install immediately after the MCP/skills step (right aftersetupMCP), before the scaffolding "Success!" output, so the progress + result surface in sequence rather than trailing it.oclif.config.js,scripts/check-topic-aliases.ts).Testing
Added/updated unit tests:
configureSkills.test.ts— forwards every detected agent without prompting, dedupes agents, warns when no editors map to a skills agent, surfaces install failures, and re-installs even when skills are already present (update-in-place).skillCandidates.test.ts— candidate semantics and installed-agent display-name resolution.readSkillState.test.ts— credits universal editors when skills resolve under.agents/skills, and does not credit them otherwise.commands/skills/__tests__/install.test.ts— command success, install-error (non-fatal), and throw (exit 1) paths.setupMCP.test.tsandinit.bootstrap-app.test.tsto confirm the refactor and new init ordering are preserved.All of
check:types,check:lint,check:deps, and the build's topic-alias check pass.Screenshots
Note
Medium Risk
Changes init ordering and how installed skills are inferred across editors; mistakes could cause redundant installs or skip needed ones, but there is no auth or data-path exposure.
Overview
Adds a
sanity skillstopic andsanity skills installso Sanity agent skills can be installed outsidesanity init, via MCP-freeconfigureSkills(detect editors → dedupe skills-CLI agents →setupSkills). Re-runs are intentional to refresh skill files in place.Init / MCP alignment:
setupMCPnow derives “needs skills” from sharedgetSkillCandidatesinstead of mutatingEditor.skillInstalled.readSkillStatetakes detected editors and treats skills under.agents/skillsas installed for “universal” editors (e.g. Cursor) even whenskills listomits them; editor configs gainskillsDir(Claude Code uses.claude/skills).UX:
sanity initruns skills install immediately after the MCP/skills step (before scaffolding success output).setupSkillsuses a spinner for progress. TelemetrySkillsInstallTracerecords standalone installs.Reviewed by Cursor Bugbot for commit 0f9462e. Bugbot is set up for automated code reviews on this repo. Configure here.