feat(hosts): add GitHub Copilot CLI as 11th supported host#1291
Open
Bharath-varma-p wants to merge 4 commits intogarrytan:mainfrom
Open
feat(hosts): add GitHub Copilot CLI as 11th supported host#1291Bharath-varma-p wants to merge 4 commits intogarrytan:mainfrom
Bharath-varma-p wants to merge 4 commits intogarrytan:mainfrom
Conversation
added 4 commits
May 1, 2026 14:51
Adds a declarative host config for the standalone GitHub Copilot CLI (`copilot` binary, GA Feb 2026), following docs/ADDING_A_HOST.md exactly. Why this matters - Issue garrytan#393 has been open since March with 20 reactions and active community demand. As of Copilot CLI v1.0.36 (April 24, 2026), Copilot no longer auto-loads ~/.claude/ skills, so a dedicated host install is required to use gstack with Copilot. What this commit adds - hosts/copilot.ts - declarative config: paths, frontmatter, suppressed resolvers, runtime root assets, boundary instruction. - hosts/index.ts - registers copilot in ALL_HOST_CONFIGS. - test/host-config.test.ts - bumps host count assertion 10 -> 11. - .gitignore - excludes generated .copilot/ host subdir. Conservative v1 scope - frontmatter: allowlist {name, description} only - strips Claude's allowed-tools array since 'shell' is the only valid Copilot value and Copilot's per-tool approval flow handles this safely. - suppressedResolvers: REVIEW_ARMY, ADVERSARIAL_STEP, DESIGN_OUTSIDE_VOICES are suppressed for v1 (Claude Agent dispatch semantics don't translate cleanly). Can be re-enabled in a follow-up after validating Copilot's /fleet + task tool semantics. - skipSkills: codex (Claude wrapper around `codex exec`) and pair-agent (depends on Claude streaming). - boundaryInstruction: scoped to foreign home dirs only - repo-local .claude/skills, .agents/skills, .github/skills are intentionally allowed since Copilot officially supports those project paths. Verification - bun run scripts/host-config-export.ts validate -> All 11 configs valid - bun test test/host-config.test.ts -> 73 pass, 0 fail Refs - https://docs.github.com/copilot/concepts/agents/about-agent-skills - https://docs.github.com/copilot/how-tos/copilot-cli/customize-copilot/add-skills - garrytan#393
Maps Claude Code tool names to GitHub Copilot CLI equivalents using the
official tool catalog (docs.github.com/copilot/concepts/agents/about-copilot-cli):
Bash -> bash, Read -> view, Write -> create, Edit -> edit,
Agent -> task, Grep -> grep, Glob -> glob, AskUserQuestion -> ask_user
Covers three call patterns to match how skills phrase tool references:
- 'use the X tool' (imperative)
- 'the X tool' (declarative)
- 'X tool' (parenthesized: '(Read tool)', '(via Agent tool)')
The bare form is necessary to catch parenthesized usages that leak through
'the' / 'use the' rewrites. Verified ~30 occurrences across gstack-autoplan,
gstack-design-html, and gstack-design-consultation.
The plural form 'X tools' is intentionally left alone. It appears in the
freeze skill as 'Edit and Write tools only', where lowercase reads correctly
('Edit and create tools') without the rewrite changing semantics.
WebSearch is intentionally not rewritten: Copilot's web_fetch retrieves a
specific URL while WebSearch performs a search; the closer match would be
web_search, but rewriting risks misleading skills. Left for follow-up after
real Copilot session validation.
Mirrors the opencode integration pattern (the cleanest precedent for a
non-Claude host with allowlist frontmatter):
- COPILOT_SKILLS / COPILOT_GSTACK path env vars
- --host copilot CLI argument acceptance and case-statement validation
- INSTALL_COPILOT auto-detection via 'command -v copilot'
- Generation step (1e): bun run gen:skill-docs --host copilot
- create_copilot_runtime_root() symlinks bin, browse/dist, ETHOS.md,
review specialists, qa templates and references, dx-hall-of-fame.md
into ~/.copilot/skills/gstack/
- link_copilot_skill_dirs() symlinks each generated gstack-* skill dir
into ~/.copilot/skills/ where Copilot CLI auto-discovers them as
/gstack-* slash commands
- Install dispatch block (6d) wires it all together with success message
Tests:
- setup supports --host auto|claude|codex|kiro|opencode|copilot
- auto mode detects copilot binary alongside the others
- INSTALL_COPILOT, COPILOT_SKILLS, COPILOT_GSTACK env vars present
- create_copilot_runtime_root + link_copilot_skill_dirs hooked up
Verification:
./setup --host copilot
-> 'gstack ready (copilot).'
-> 43 skills linked into ~/.copilot/skills/
-> ~/.copilot/skills/gstack/ has bin, browse, design, ETHOS.md,
gstack-upgrade, plan-devex-review, qa, review, SKILL.md
Full test suite: 2220 pass, 8 fail (same 8 pre-existing failures as
baseline before our changes - none introduced by this PR).
…s/COPILOT.md README updates: - Bumps host count 10 -> 11 in the 'Other AI Agents' section - Adds GitHub Copilot CLI to the agent table with install path - Adds a dedicated 'GitHub Copilot CLI' subsection with quick install steps (npm/brew/winget) and usage example - Mentions v1 scope (which orchestration features are suppressed and why) - Adds ~/.copilot/skills/gstack* to the manual uninstall instructions bin/gstack-uninstall updates: - Adds Copilot CLI to the file-header asset list - Adds 'Remove Copilot CLI skills' block (mirrors the Kiro block) - Lists ~/.copilot/skills/gstack* in the interactive confirmation prompt docs/COPILOT.md (new): - Why a dedicated host (post-v1.0.36 ~/.claude/ removal) - Detailed install instructions with verification steps - What gets installed and where - Tool-name translation table (Claude -> Copilot) - v1 scope: suppressed resolvers, skipped skills, what works - Custom instructions (.github/copilot-instructions.md, AGENTS.md, etc.) - Uninstall instructions - Troubleshooting section (binary not found, /skills not showing, tool name leaks, getting orchestration features back)
|
you should also add "copilot" at line 59 in setup file. there is a static check for all the agents in the setup file, and it is failing. |
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.
What
Adds GitHub Copilot CLI as the 11th supported host in gstack, following the declarative
ADDING_A_HOST.mdpattern. Closes the gap that opened in Copilot CLI v1.0.36 (Apr 24, 2026) when~/.claude/skills stopped being auto-loaded.After this PR, users on the standalone
copilotCLI can:Why
~/.copilot/skills/) and rewrites Claude tool names to its own (Read -> view, Write -> create, Bash -> bash, Agent -> task, etc.).How (4 commits, ~450 lines, 9 files)
feat(hosts): add GitHub Copilot CLI as 11th supported hosthosts/copilot.tsdeclarativeHostConfighosts/index.ts, bumps host count assertion (10 -> 11)cliCommand: 'copilot'(the standalone npm@github/copilotbinary, not the oldergh copilotextension)globalRoot: '.copilot/skills/gstack',localSkillRoot: '.copilot/skills'frontmatterallowlist of{name, description}(strips Claude'sallowed-toolsarray which Copilot'sshellfield would reject)skipSkills: ['codex', 'pair-agent'](codex is a Claude wrapper aroundcodex exec; pair-agent depends on Claude streaming)suppressedResolvers: REVIEW_ARMY, ADVERSARIAL_STEP, DESIGN_OUTSIDE_VOICES, CODEX_SECOND_OPINION, CODEX_PLAN_REVIEW, GBRAIN_* (these expand to Claudesubagent_typeblocks that don't translate)boundaryInstructionscoped to FOREIGN home dirs only (~/.claude,~/.codex, etc.); the repo-local.claude/skills/is allowed since Copilot officially reads it.feat(hosts): add tool name rewrites for Copilot CLI compatibilitytoolRewritescovers 3 patterns per tool:use the X tool,the X tool, bareX tool(catches(Read tool),(via Agent tool)parenthesized usages).web_fetchretrieves URLs, not searches).Read tool|Write tool|Bash tool|Agent tool|...substrings remain in the generated 47k-line~/.copilot/skills/tree.feat(setup): add --host copilot install support--host copilotvalidation,INSTALL_COPILOTplumbing, generation step (1e), helper functionscreate_copilot_runtime_root+link_copilot_skill_dirs, install dispatcher block (6d)../setup --host copilotlinked 43 skills into~/.copilot/skills/;copilotthen shows them under/skills list.docs(copilot): README install section, gstack-uninstall coverage, docs/COPILOT.mdbin/gstack-uninstall: adds~/.copilot/skills/gstack*to the cleanup block and confirmation prompt (mirrors Kiro).docs/COPILOT.md: integration guide with tool-name translation table, v1 scope rationale, custom-instructions location matrix, troubleshooting.Differences vs PR #1044
I learned from #1044's groundwork; here are the deltas:
cliAliases['gh']gh copilotextension is a different product; this is the standalonecopilotbinary)X toolto catch(Read tool)parenthesized refs)pair-agentsuppressedResolvers(Claudesubagent_typesyntax doesn't run on Copilot)WebSearchweb_fetchlocalSkillRoot.github/skills/gstack.copilot/skills(avoids creating tracked-by-default git noise; Copilot reads.copilot/skills/natively)mainValidation
bun run scripts/host-config-export.ts validate-> "All 11 configs valid"bun test test/host-config.test.ts test/gen-skill-docs.test.ts-> 455 tests, 0 fail, 5623 expectsbun test(full suite) -> 2217 pass / 8 fail. The 8 failures are pre-existing baseline (doc-inventory cross-check for AGENTS.md/skills.md, ship-version-sync VERSION/pkg drift,read_secret_to_envvar-name validation, port-detection race tests). Zero regressions../setup --host copilot-> 43 skills linked into~/.copilot/skills/;copilot->/skills listshows them.bun run gen:skill-docs --host all-> 47074 lines, 541k tokens, no host-specific errors.v1 scope (intentional)
This PR ships a focused v1. The following are deferred to a follow-up once Copilot CLI's orchestration story matures:
/codex,/pair-agent(Claude-streaming-specific)./review,/qa,/plan-*-review,/cso,/design-*,/setup-gbrain) still install but the Claudesubagent_typeblocks are stripped, so they run as single-pass sessions instead of fan-out reviews.docs/COPILOT.mddocuments this and points users to the Claude or Codex hosts if they need the multi-agent reviews.Test plan for reviewers
Acknowledgements
Need help on this PR? Tag
@codesmithwith what you need.