Skip to content

fix(install)!: delegate gh skills to GitHub CLI - #3277

Draft
austintraver wants to merge 7 commits into
dyoshikawa:mainfrom
austintraver:codex/gh-skill-native
Draft

austintraver wants to merge 7 commits into
dyoshikawa:mainfrom
austintraver:codex/gh-skill-native

Conversation

@austintraver

@austintraver austintraver commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Skills installed by gh mode appeared in gh skill list, but their source/version were blank and gh skill update skipped them: Rulesync wrote top-level fields where gh expects metadata.github-*. This follows up on #1524 and #1533.

This change delegates installation to GitHub CLI so its preview implementation owns skill metadata and updates. rulesync.jsonc.sources remains the declaration; Rulesync no longer reads or writes rulesync-gh.lock.yaml.

With --force, repeated installation overwrites existing skills with the configured source version. This refreshes branch contents before a release and exact-path skills that gh update cannot rediscover. Without it, gh retains its normal overwrite confirmation/error behavior.

Rulesync's lockfile flags now report errors in gh mode:

  • --update previously refreshed the Rulesync lock. Without that lock, callers explicitly choose forced installation of their declared branch or native gh update, which can select a release instead.
  • --frozen cannot retain its locked-install guarantee: gh has no equivalent operation, and downloading a moving branch again can change the installed files.

Migration uses rulesync install --mode gh --force, native list/update verification, and removal of the obsolete lock. The guide covers preserving an old revision and leftover files.

Real gh 2.102.0 tests verified source/version reporting, dry-run behavior, updates after the source advanced, and overwrite behavior in terminals and scripts. All five upstream CI checks pass, including Ubuntu, macOS, and Windows E2E tests.

Use gh skill install for file deployment, provenance, and native installed
state instead of writing incompatible frontmatter and a Rulesync gh lock.
Keep source declarations, route explicit refs through skill@ref, and use
read-only gh tree discovery for the existing all-skills-at-ref layout.

Ignore legacy lockfiles and document reinstallation and cleanup. Reject
update/frozen flags with native-update and fixed-revision guidance rather
than promising a lock that re-resolves moving refs. Exercise the real CLI
against an advancing GitHub source in an opt-in integration test.

BREAKING CHANGE: gh mode requires GitHub CLI and delegates installed state;
--update and --frozen are no longer supported in gh mode.

Agent-Session: Codex 01a0fdab-8bab-7953-bb23-ad125b2e03d4
Agent-Host: hoenn
@austintraver
austintraver marked this pull request as ready for review October 2, 2026 18:03
Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Documented skills: ["*"] declarations are forwarded as a literal selector and fail instead of installing all skills.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Delegates gh-mode skill installation and provenance management to GitHub CLI, replacing Rulesync’s legacy installer and lockfile.

Changes:

  • Invokes gh skill install --force for declared sources.
  • Removes legacy gh path, metadata, and lockfile handling.
  • Documents migration, update, and frozen-mode behavior.
File Description
src/​lib/​npm-sources-lock.ts Updates lockfile documentation.
src/​lib/​gh/​gh-paths.ts Removes legacy path mapping.
src/​lib/​gh/​gh-paths.test.ts Removes path mapping tests.
src/​lib/​gh/​gh-lock.ts Removes Rulesync gh lockfile support.
src/​lib/​gh/​gh-lock.test.ts Removes gh lockfile tests.
src/​lib/​gh/​gh-install.user-scope.test.ts Removes legacy user-scope tests.
src/​lib/​gh/​gh-install.ts Delegates installation to GitHub CLI.
src/​lib/​gh/​gh-install.test.ts Tests subprocess delegation and migration.
src/​lib/​gh/​gh-frontmatter.ts Removes custom provenance injection.
src/​lib/​gh/​gh-frontmatter.test.ts Removes frontmatter tests.
src/​generated/​docs-content.ts Regenerates installation documentation.
src/​config/​config.ts Allows GitHub CLI-defined agent IDs.
src/​cli/​program.ts Clarifies unsupported gh-mode flags.
src/​cli/​commands/​install.ts Updates gh-mode command handling.
src/​cli/​commands/​install.test.ts Updates command tests.
src/​cli/​commands/​install-gh.integration.test.ts Adds real GitHub CLI integration coverage.
docs/​guide/​declarative-sources.md Documents delegation and migration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/gh/gh-install.ts Outdated
@austintraver
austintraver marked this pull request as draft October 2, 2026 18:22
Infer argv and environment assertions from one typed mock instead of repeated any casts. Keep test behavior unchanged.

Agent-Session: Codex 01a0fdab-8bab-7953-bb23-ad125b2e03d4
Agent-Host: hoenn
Remove the file-existence check and warning. The installer has no reason to know the old lock filename; migration remains documented and a regression test proves an invalid legacy lock has no effect.

Agent-Session: Codex 01a0fdab-8bab-7953-bb23-ad125b2e03d4
Agent-Host: hoenn
Treat the documented "*" selector as all skills before invoking GitHub
CLI, using native --all or explicit-ref discovery as appropriate. Cover
both routes with subprocess regressions and the real branch-advancement
integration test. Preserve the current update and frozen flag behavior.

Validation: 16 adapter tests, real gh 2.102.0 integration test, typecheck,
formatting, and lint pass. The live test confirms native list metadata,
dry-run discovery, and successful updates after a GitHub source advances.

Agent-Session: Codex 01a0fdab-8bab-7953-bb23-ad125b2e03d4
Agent-Host: hoenn
Pass --force only when requested. Let gh use the existing terminal through
inherited stdio, while capturing output for JSON and silent invocations.
Keep --update and --frozen unsupported and document explicit forced migration.

Verify fresh and repeated installs, legacy migration, and native list/update
against gh 2.102.0 with isolated homes. Real terminal checks cover declining,
accepting, and forcing overwrite; focused regressions pass.

Agent-Session: Codex 01a0fdab-8bab-7953-bb23-ad125b2e03d4
Agent-Host: hoenn
@austintraver
austintraver marked this pull request as ready for review October 3, 2026 02:12
Copilot AI balanced review requested due to automatic review settings October 3, 2026 02:12
@austintraver

austintraver commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

@dyoshikawa This is ready for review. Could you take a look?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Inline ref construction misparses valid Git refs containing @.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread src/lib/gh/gh-install.ts
...(skill ? [] : ["--all"]),
"--",
`https://github.com/${source.owner}/${source.repo}`,
...(skill ? [source.ref ? `${skill}@${source.ref}` : skill] : []),
@austintraver
austintraver marked this pull request as draft October 3, 2026 05:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants