feat(hosts): add GitHub Copilot CLI as a first-class host#1436
feat(hosts): add GitHub Copilot CLI as a first-class host#1436andrey-esipov wants to merge 1 commit into
Conversation
19a5aa4 to
60c724f
Compare
|
Self-review pass via gstack Applied
Verified Known follow-ups (not in this PR)
|
…x pathRewrites, stale symlink cleanup Mirrors the three review fixes applied to upstream PR garrytan#1436: - hosts/copilot.ts: drop `target: github-copilot` so generated agents default to target=both (Copilot CLI + VS Code Copilot extension) - hosts/copilot.ts: rewrite all `.claude/skills*` references to $GSTACK_ROOT instead of the dead `.copilot/skills/gstack/` path - setup: clean stale gstack-*.agent.md symlinks before relinking Verified live: ./setup --host copilot now produces 46 fresh agents pointing at ~/.copilot/gstack via $GSTACK_ROOT, with stale entries cleaned up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ilot) Adds support for installing gstack as flat .agent.md files under ~/.copilot/agents/, per Copilot CLI's custom agents schema: https://docs.github.com/en/copilot/reference/custom-agents-configuration The change is purely additive — existing hosts are untouched: - New `outputLayout?: 'per-skill-dir' | 'flat-agent-md'` field on HostConfig. Default is 'per-skill-dir' (every existing host). Copilot uses 'flat-agent-md' to emit one file per skill, flat under <hostSubdir>/agents/. - processExternalHost branches on the new field to write to <hostSubdir>/agents/<name>.agent.md instead of the default <hostSubdir>/skills/<name>/SKILL.md. - hosts/copilot.ts: frontmatter allowlist (name/description), injects target=github-copilot + tools=["*"] per the schema. skipSkills includes 'codex' (per the every-external-host convention) and 'copilot' (to avoid recursing if a /copilot skill is ever added to the source tree). - setup: INSTALL_COPILOT flag, build trigger, install block that symlinks generated gstack-*.agent.md into ~/.copilot/agents/ and creates ~/.copilot/gstack/ runtime root with bin/browse-dist/upgrade symlinks. - Parameterized host smoke tests updated to handle both layouts; --host all test asserts the right output subdir per host. Two assertions updated for the new host count (10 → 11) and the new --host pass-through list. Verified end-to-end on macOS: - `./setup --host copilot` produces 46 agents under ~/.copilot/agents/. - `copilot --agent <name>` lists every gstack skill (autoplan, qa, review, codex, design-shotgun, …). - `bun test test/host-config.test.ts test/gen-skill-docs.test.ts` → 459 pass, 0 fail. Use: `copilot --agent qa "test the staging site"`. First-time setup: `export GSTACK_ROOT=$HOME/.copilot/gstack`.
60c724f to
ce5ea26
Compare
|
Additional refinement pushed (force-update on Skipped in this updateCopilot CLI agents are stateless single-invocation tools — each
After this change, Follow-up I'm happy to do separatelyThe rules from Test counts unchanged: 459/459 pass on |
|
Closing this PR — wrong architectural primitive. After it merged into my local fork I tried invoking
gstack's content is overwhelmingly skills ( Verified: writing a Will reopen with the right shape: emit Sorry for the noise. Sources: |
Adds support for installing gstack as Copilot CLI Skills (per the docs at https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills), so users can invoke `/qa`, `/review`, `/ship`, `/autoplan`, etc. directly in an interactive `copilot` session. Copilot CLI exposes two customization surfaces — Skills (SKILL.md, invoked as `/<name>` by the user) and Agents (.agent.md, invoked as tools by the model). gstack content is overwhelmingly Skills (workflows the user invokes), so this host emits SKILL.md via the existing per-skill-dir layout. No changes to `host-config.ts` or `gen-skill-docs.ts` — purely additive. Changes: - `hosts/copilot.ts` (new) — HostConfig: frontmatter allowlist (name + description), globalRoot `.copilot/skills/gstack`, skipSkills covers the five skills that don't translate to stateless single-invocation skills: freeze, unfreeze, careful, guard, plan-tune (plus the standard codex skip). - `hosts/index.ts` — register copilot in ALL_HOST_CONFIGS. - `setup` — INSTALL_COPILOT flag, build trigger, install block. Symlinks each generated skill under the collection subdir `~/.copilot/skills/gstack/<name>/` (bare name; the `gstack-` prefix is stripped during link creation) so users invoke `/<name>`, not `/gstack-<name>`. Creates `~/.copilot/gstack/` runtime root with bin/browse-dist/upgrade symlinks for $GSTACK_ROOT-relative tooling. - `.gitignore` — adds `.copilot/` for generated skill files. - Tests — host count assertion 10 → 11; --host pass-through string includes `copilot`. Verified on macOS: - `./setup --host copilot` → 41 skills installed under `~/.copilot/skills/gstack/`. - `copilot -p "/qa ..."`, `copilot -p "/office-hours ..."`, `copilot -p "/review ..."` all invoke the correct gstack skill. - `bun test test/host-config.test.ts test/gen-skill-docs.test.ts` → 459 pass, 0 fail. Replaces garrytan#1436 (which used the wrong Copilot primitive — Agents instead of Skills, making `/<name>` invocations not work).
Summary
Adds support for installing gstack as flat
.agent.mdfiles under~/.copilot/agents/, per Copilot CLI's custom agents schema. After./setup --host copilot, all 46 gstack skills are discoverable viacopilot --agent <name>.Purely additive — existing hosts (Codex, Cursor, Factory, OpenCode, Kiro, Slate, OpenClaw, Hermes, GBrain) are untouched.
What changed
outputLayout?: 'per-skill-dir' | 'flat-agent-md'field onHostConfig. Default is'per-skill-dir'(every existing host). Copilot uses'flat-agent-md'to emit one file per skill, flat under<hostSubdir>/agents/. Copilot CLI does not recurse into subdirectories under~/.copilot/agents/, so the flat layout is required.processExternalHostbranches on the new field to write to<hostSubdir>/agents/<name>.agent.mdinstead of the default<hostSubdir>/skills/<name>/SKILL.md.hosts/copilot.ts— new HostConfig:name,description)target: github-copilotandtools: [\"*\"]per the Copilot agents schemaskipSkills: ['codex', 'copilot']— matches every external host'scodexskip, plus self-skip to avoid future recursion if a/copilotskill is ever added to the source treesetup— addsINSTALL_COPILOTflag, build trigger, install block. Symlinks generatedgstack-*.agent.mdfiles into~/.copilot/agents/, creates~/.copilot/gstack/runtime root withbin/,browse-dist/,gstack-upgrade/,ETHOS.mdsymlinks for `$GSTACK_ROOT` resolution..gitignore— adds.copilot/for generated agent files.test/host-config.test.tsandtest/gen-skill-docs.test.tsupdated:per-skill-dirandflat-agent-md)--host alltest asserts the correct output subdir per hostVerification (macOS, on this branch)
Test plan
Notes for reviewers
Sources:
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.