feat: hydrogen skills check for checking if skills are up to date - #3994
Open
fredericoo wants to merge 10 commits into
Open
feat: hydrogen skills check for checking if skills are up to date#3994fredericoo wants to merge 10 commits into
hydrogen skills check for checking if skills are up to date#3994fredericoo wants to merge 10 commits into
Conversation
hydrogen skills check for checking if skills are up to date
update installs the current dist-tag with the detected package manager, then runs skills sync. skillsSyncCheck() reuses the sync planner read-only on dev-server startup and warns through the Vite logger when synced skills no longer match the installed package. Package-manager detection moves out of setup.ts so both commands share it. Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
…, take force as a boolean - only skillsSyncCheck is exported from @Shopify/hydrogen/vite - RunCommand/spawnRunCommand live in run-command.ts; gql, setup and update share it - syncSkills and updateHydrogen take force; argv is parsed once in the CLI entry so bad flags fail before anything runs Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
- document the update forward-compat contract (installed CLI runs, tag moves must ship one release early, metadata must read across versions) - resolve the project root upward from Vite root (Nuxt 4 style srcDir) - warn once per process across multiple Vite servers - spawn package managers through a shell on Windows (.cmd shims) Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
…eferences Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
A new CLI command is a permanent compatibility surface. Users bump the dependency themselves and the dev-server warning tells them when to resync. setup.ts and gql.ts return to their base-branch shape. Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
Shares the status description with the Vite warning; exits non-zero when a sync would change anything, including when skills were never synced. Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
Removes skillsSyncCheck() and its template/example wiring, plus the managed flag that only existed to keep the plugin quiet in projects that never synced. Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
- templates prefix their dev scripts with it - the hydrogen-setup skill instructs agents to do the same and verifies it - validate:preview-dist runs checkSkills per template so dist-preview can never ship skills that drifted from the package they pin - warn mode stays silent when skills are current Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
fredericoo
force-pushed
the
fb-skills-update
branch
from
September 7, 2026 16:38
d1cb1a4 to
4cf1813
Compare
fredericoo
marked this pull request as ready for review
September 7, 2026 16:38
fredericoo
commented
Sep 7, 2026
| "type": "module", | ||
| "scripts": { | ||
| "dev": "next dev", | ||
| "dev": "hydrogen skills check --mode=warn && next dev", |
Contributor
Author
There was a problem hiding this comment.
optional, but good practice to keep them in check! this will always warn in local dev as expected, but when in dist-preview it'll work
Assisted-By: devx/d55d9e75-1efe-4d16-b7b7-20b3cae4124e
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.
Stacked on #3992. Merge that first; this diff is the commits after
edf93705a.TL;DR: #3992 makes skills resyncable, but nothing fails when someone bumps Hydrogen and forgets to resync. This adds
hydrogen skills check, a read-only command that exits non-zero when the synced skills do not match the installed package, so CI can enforce it.Before
pnpm add @shopify/hydrogen@preview # ...forget the next line and agents keep following last version's skills, silently npx @shopify/hydrogen skills syncAfter
{ "scripts": { "check:skills": "hydrogen skills check", "dev": "hydrogen skills check --mode=warn && vite dev" } }What this changes
hydrogen skills check(cli/skills.tscheckSkills): runs the same plannerskills syncexecutes, in read-only mode, and throws with a one-line summary when a sync would add, update, or remove anything, when locally modified skills are behind, or when an unmanaged directory collides with a shipped name. A project that never synced fails too; running the command is the opt-in. Exit 0 prints the version it is aligned with.--mode=warnprints the same message and exits 0, for dev scripts that should nag but not block;--mode=erroris the default.getSkillsSyncStatus()/describeSkillsSyncStatus(): the read-only view and its message, split out so the CLI cannot disagree with whatsyncwould do. Counts distinct skills rather than directories, since both.claude/skillsand.agents/skillsare written.syncSkillstakesforce: booleaninstead of raw argv;cli/index.tsparses flags once at the boundary.hydrogen skills check --mode=warn && <dev>is the standarddevscript. Both templates ship it, and thehydrogen-setupskill (scaffold step) instructs agents to prefix the app's existing dev command with it and verifies the chain in the final step. Warn mode prints nothing when skills are current, so the only output is the resync nudge after an upgrade.prepare:preview-distsyncs skills into both harness roots, and the compiled template'sdevprefix is silent afterwards.Developer impact
Includes a minor changeset for
@shopify/hydrogen: one new CLI subcommand under the existingskillsnamespace.setupandskills syncbehaviour is unchanged. No new package exports.Template source in this monorepo has no skills (they are synced only when compiling
dist-preview), so runningpnpm devinsidetemplates/*here prints the "19 new" nudge every time. Compiled templates are silent. Runpnpm exec hydrogen skills syncinside a template to quiet it locally; the generated.claude/skillsand.agents/skillsare untracked.Out of scope
hydrogen updatecommand and no Vite dev-server warning. Both were built and dropped in review: a top-level command is a permanent compatibility surface for something package managers already do, and there is no umbrella Hydrogen Vite plugin to hang a warning on.skills checkin CI is the single gate.hydrogen-setupskill does not yet tell agents to addskills checkto a consumer's CI. Deliberate for now.How to Test
pnpm install && pnpm build:pkgs.mkdir app && cd app && echo '{"name":"app","dependencies":{"@shopify/hydrogen":"*"}}' > package.json.node <repo>/packages/hydrogen/bin/hydrogen.mjs skills check. Confirm it reports 19 new skills and exits 1.node <repo>/packages/hydrogen/bin/hydrogen.mjs skills sync, thenskills checkagain. Confirm it reports up to date and exits 0.version:in both.agents/skills/hydrogen-money/SKILL.mdand.claude/skills/hydrogen-money/SKILL.mdto an older version. Runskills check. Confirm it reports 1 to update and exits 1, and that no files changed.hydrogen-money/SKILL.mdcopies instead. Runskills check. Confirm it reports 1 locally modified and points at--force.skills check --mode=warn && echo continued. Confirm the message prints andcontinuedfollows. Runskills check --mode=loudand confirm it rejects the value.node scripts/preview-template-dist.ts prepare 2026.10.0-preview.2, thencd templates/react-router && pnpm exec hydrogen skills check --mode=warn. Confirm it prints nothing and exits 0. Restore withgit restore templatesand remove the generated.agents/.claudedirs.