feat(agent): add GitHub Copilot as an install target#194
Conversation
Adds `copilot` to the agent-install targets. GitHub Copilot reads path-specific custom instructions from `.github/instructions/*.instructions.md` (VS Code / Visual Studio / Copilot Chat), with YAML frontmatter carrying an `applyTo` glob. The skill installs to `.github/instructions/testsprite-verify.instructions.md` (and the onboard skill alongside) with `applyTo: '**'` so the guidance attaches to every request in the repo. Because `applyTo: '**'` is always-on (Copilot has no on-demand 'model decides' mode like Cursor/Windsurf), the target renders the COMPACT body — the same reasoning behind windsurf's compact render — keeping the always-injected context small (~6 KB vs the ~23 KB full body). Slots into the existing TARGETS machinery, so `agent list`, `setup --agent`, and skill-nudge install-detection pick it up automatically. Updates the AgentTarget union, pathFor, TARGETS, help/docs, unit + e2e matrix guards, and the help snapshot. Fixes TestSprite#193
WalkthroughThis PR adds ChangesCopilot agent target support
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/lib/agent-targets.ts (1)
153-165: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winUnquoted
descriptionin YAML frontmatter risks breaking Copilot parsing.
wrapCopilotinterpolatesdescriptionraw (description: ${description}) with no quoting. If the skill description ever contains a colon, leading special character, or other YAML-significant sequence, this frontmatter becomes invalid YAML — a documented failure mode where GitHub Copilot (and other tools using this pattern, like YAML-based skill loaders) will silently skip or fail to parse the file. This mirrors the same unquoted pattern already inwrapWindsurf(line 150), so it's not a new class of bug, but it doubles the exposed surface.🛡️ Proposed fix: quote the description
function wrapCopilot(_name: string, description: string, body: string): string { - return `---\ndescription: ${description}\napplyTo: '**'\n---\n\n${body}\n`; + return `---\ndescription: ${JSON.stringify(description)}\napplyTo: '**'\n---\n\n${body}\n`; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/agent-targets.ts` around lines 153 - 165, The YAML frontmatter generated by wrapCopilot is writing description unquoted, which can break parsing when the text contains YAML-significant characters. Update wrapCopilot so the description field is safely quoted/escaped before interpolation, following the same pattern used for other instruction generators in this module, and keep the existing applyTo and body formatting unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/agent.ts`:
- Line 1064: The top-level agent command description is missing Kiro even though
it is a supported target. Update the description string in agent.ts where the
agent command metadata is defined so it matches the --target help text and docs
by including Kiro alongside the other supported editors/tools. Keep the wording
aligned with the existing list in the agent command definition.
---
Nitpick comments:
In `@src/lib/agent-targets.ts`:
- Around line 153-165: The YAML frontmatter generated by wrapCopilot is writing
description unquoted, which can break parsing when the text contains
YAML-significant characters. Update wrapCopilot so the description field is
safely quoted/escaped before interpolation, following the same pattern used for
other instruction generators in this module, and keep the existing applyTo and
body formatting unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b3efd0a7-3675-49de-ab25-396b1f6c3be4
⛔ Files ignored due to path filters (1)
test/__snapshots__/help.snapshot.test.ts.snapis excluded by!**/*.snap,!**/*.snap
📒 Files selected for processing (8)
DOCUMENTATION.mdREADME.mdsrc/commands/agent.test.tssrc/commands/agent.tssrc/lib/agent-targets.test.tssrc/lib/agent-targets.tstest/e2e/agent-install.e2e.test.tstest/e2e/setup.e2e.test.ts
The top-level `agent` command description listed the other targets but omitted Kiro (a pre-existing gap), leaving it inconsistent with the `--target` help text and the docs. Align the description with the `--target` list so every supported target is named.
zeshi-du
left a comment
There was a problem hiding this comment.
Reviewed: scoped, tests included, CI green across the matrix.
What does this PR do?
Adds GitHub Copilot as an
agent installtarget — the most widely-used AI coding assistant, and the biggest remaining gap in the target set.GitHub Copilot reads path-specific custom instructions from
.github/instructions/*.instructions.md(VS Code, Visual Studio, Copilot Chat), with YAML frontmatter carrying anapplyToglob. This PR installs the verification-loop skill there the same way it's installed for Cursor/Cline/Windsurf:.github/instructions/testsprite-verify.instructions.md(+testsprite-onboard.instructions.md).applyTo: '**'+description. Copilot instruction files have no on-demand "model decides" mode (unlike Cursor'salwaysApply: falseor Windsurf'strigger: model_decision), so always-apply is the correct idiom.applyTo: '**'injects the file into every Copilot request, the target renders the compact body (~6 KB) instead of the full ~23 KB body — the same reasoning behind windsurf's compact render, keeping the always-injected context cost small.It slots into the existing
TARGETSmachinery, soagent list,setup --agent, and skill-nudge install-detection pick it up automatically.Verified locally
Related issue
Fixes #195
Type of change
Checklist
mainbranch.npm run lintandnpm run format:checkpass.npm run typecheckpasses.npm testpasses and coverage stays at or above the 80% gate.README.md/DOCUMENTATION.md.Notes for reviewers
AgentTargetunion,pathFor,TARGETS, help strings, README/DOCUMENTATION, both e2e matrix guards, and the regenerated help snapshot.renderOwnFileWithMarker/buildSkillMarker), soagent statustracks copilot files like every other own-file target.AI usage disclosure
Yes, I used AI assistance for this change — investigation, implementation, and tests. I reviewed and verified everything myself (installed the target, inspected the rendered file and its frontmatter/size, and ran the full gate suite).
Summary by CodeRabbit
New Features
descriptionandapplyTo: '**'.Bug Fixes
Documentation
Tests