Skip to content

Add copilot, kiro, and antigravity tools; use each tool's native root instruction file#63

Merged
sjquant merged 10 commits into
mainfrom
claude/update-agent-instructions-EoIaF
May 23, 2026
Merged

Add copilot, kiro, and antigravity tools; use each tool's native root instruction file#63
sjquant merged 10 commits into
mainfrom
claude/update-agent-instructions-EoIaF

Conversation

@sjquant

@sjquant sjquant commented May 22, 2026

Copy link
Copy Markdown
Owner

What changed

New tools: copilot, kiro, antigravity

Three tools are now fully supported alongside the existing claude-code, cursor, opencode, and codex:

Tool Project root instruction Global root instruction Skills Agents
copilot AGENTS.md ~/.github/copilot-instructions.md .github/skills .github/agents
kiro AGENTS.md — (not globally installable) .kiro/skills .kiro/agents
antigravity AGENTS.md ~/.gemini/GEMINI.md .agent/skills .agent/workflows

Native root instruction files per tool

Every tool now targets its own documented root instruction file rather than falling back to CLAUDE.md:

  • claude-codeCLAUDE.md (unchanged)
  • cursorAGENTS.md (was CLAUDE.md)
  • opencodeAGENTS.md (was CLAUDE.md)
  • codexAGENTS.md (unchanged)
  • copilotAGENTS.md (new)
  • kiroAGENTS.md (new)
  • antigravityAGENTS.md (new)

Tool-aware global path remapper

Copilot and antigravity both use AGENTS.md at project level but remap to different global targets. The previous flat Map keyed by project path caused one entry to overwrite the other. GLOBAL_REPO_REL_PATH_REMAP is now keyed by tool name so each tool independently resolves its own global destination.

Dynamic tool discovery

isRootInstructionConflictPath and selectRootInstructionSourcePath now derive the full set of root instruction paths from listToolDefinitions() at runtime instead of hardcoding a tool list, so new tools are picked up automatically.

Test coverage

  • Unit tests for buildGlobalRepoRelPathRemapper verify copilot and antigravity remap independently with no path collision
  • End-to-end global installation tests verify copilot writes to ~/.github/copilot-instructions.md, antigravity writes to ~/.gemini/GEMINI.md, and a bundle supporting both tools produces two separate files

claude added 8 commits May 21, 2026 00:25
cursor now targets .cursorrules (its documented project rules file) and
opencode now targets AGENTS.md (its documented primary instruction file),
replacing the previous CLAUDE.md fallback for both tools.

Also generalizes isRootInstructionConflictPath to derive the set of
root instruction paths from tool definitions rather than hardcoding,
and updates all help text strings to accurately describe per-tool targets.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
Cursor reads AGENTS.md (the VS Code-based agent instruction convention),
not .cursorrules. Updates tool definition, removes the now-unused
.cursorrules bundle-item alias, and corrects all help text and tests.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
antigravity and copilot now target AGENTS.md at project level,
following the principle that AGENTS.md is the first-class root
instruction for any tool that supports it. GEMINI.md is preserved
as a recognized bundle-item selector alias for Gemini CLI bundles,
and .github/copilot-instructions.md alias is similarly retained.

Bundle auto-detection for copilot is updated to look for AGENTS.md;
bundle translation for antigravity now also writes to AGENTS.md.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
In global mode, copilot targets .github/copilot-instructions.md and
antigravity targets GEMINI.md, matching their tool-native global config
conventions. Project-level targets remain AGENTS.md for both.

Global apply without --agent now auto-selects all globally-capable tools
the bundle supports (instead of requesting all tools upfront), so bundles
that cover only a subset of globally-capable tools work without error.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
Gemini CLI stores its global context file at ~/.gemini/GEMINI.md, not
~/GEMINI.md. Update the global tool definition to use the correct
repo-relative path (.gemini/GEMINI.md).

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
…pilot/antigravity path collision

Both copilot and antigravity use AGENTS.md at project level but remap to different global targets
(.github/copilot-instructions.md and .gemini/GEMINI.md). The flat path-keyed remap Map caused the
second entry to overwrite the first. The fix keys the remap by tool name and updates all three layers:
- tool-mapping.ts: GLOBAL_REPO_REL_PATH_REMAP keyed by tool name; remapper returns (toolName, p) => string
- bundle-materialization.ts: all repoRelPathRemapper signatures and call sites updated to pass toolName
- root-instruction-state.ts: same signature update; global mode now collects per-tool so each tool
  independently remaps its project path to its own global target without clobbering others

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
…tigravity

- cli.test.ts: fix stale comment saying cursor targets .cursorrules; it targets AGENTS.md
- index.global.test.ts: add three end-to-end tests covering the new global tool paths:
  - copilot writes to ~/.github/copilot-instructions.md
  - antigravity writes to ~/.gemini/GEMINI.md
  - a bundle supporting both tools produces two separate files (no path collision)

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
Four files had formatter errors caught by `biome check` in CI:
- bundle-auto-detection.test.ts: line-length wrapping in new test assertions
- cli.test.ts: trailing whitespace from comment edit
- index.global.test.ts: path.join and .toContain call wrapping
- tool-mapping.test.ts: .toBe() wrapping for long strings

No logic changes — pure formatting fixes.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.69%
⬆️ +0.45%
2502 / 2821
🔵 Statements 88.23%
⬆️ +0.48%
2536 / 2874
🔵 Functions 92.79%
⬆️ +0.73%
567 / 611
🔵 Branches 80.56%
⬆️ +0.55%
1712 / 2125
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/bundle-items.ts 86.56% 81.81% 100% 86.15% 39-41, 45-47, 66-68, 76, 132, 138, 171, 188, 204-206
src/bundle-materialization.ts 79.34% 69.47% 96.55% 81.34% 72, 103, 130-137, 211, 253, 345, 574, 662, 702, 708, 719, 732, 743, 781-844, 855, 906-913, 924-935, 938-944, 1004, 1010, 1014
src/cli.ts 67.21% 70.83% 63.93% 66.94% 212-225, 237-240, 257, 270-337, 349-449, 465-468, 475-482, 573, 583, 632, 1058-1067
src/index.ts 89.92% 78.11% 92.09% 90.2% 272, 288, 363-369, 501-505, 532, 595-600, 656-658, 670, 679-681, 686, 692-736, 839, 848, 856, 898-904, 914, 924, 928, 1016-1017, 1196, 1210, 1250, 1306, 1345, 1368, 1389-1391, 1608-1612, 1659, 1669-1678, 1836-1838, 2138, 2285, 2332-2348, 2411, 2416, 2541-2549, 2618-2623, 2685, 2768-2770, 2789-2791, 2824, 2901, 3031-3033, 3048-3050, 3069-3071, 3111-3115, 3216-3218, 3239-3241, 3265, 3279, 3307-3309, 3542, 3552, 3702-3710, 3814-3816, 3828, 3860, 3866, 3891, 3915-3917, 3974-3977, 4042-4044, 4062-4064, 4254-4261, 4273, 4309-4311, 4369-4372, 4385-4388, 4411, 4435, 4474, 4481-4497, 4501-4503, 4507-4508, 4528-4530, 4538, 4542-4549
src/root-instruction-state.ts 96.21% 89.39% 100% 96.12% 35, 144, 150, 193, 301
src/tool-mapping.ts 100% 100% 100% 100%
Generated in workflow #29 for commit b6e41b3 by the Vitest Coverage Report Action

@sjquant sjquant self-assigned this May 23, 2026
@sjquant sjquant changed the title Use each tool's native root instruction file instead of CLAUDE.md Add copilot, kiro, and antigravity tools; use each tool's native root instruction file May 23, 2026
claude added 2 commits May 23, 2026 09:38
1. mergeDesiredTools: switch from union to replace when re-applying
   without --agent, so tools dropped from the bundle are not left in
   desired state indefinitely. Controlled by a new replaceRequestedTools
   flag set when no explicit --agent filter is provided.

2. Warn instead of silently dropping tools that are in a bundle's
   manifest but not supported in global mode (e.g. kiro, cursor). The
   warning is emitted at the end of applyBundleGlobal.

3. Filter toolNames to globally-capable tools only before the per-tool
   content collection loop in collectRootInstructionContentByPath, so
   non-global tools that might appear in materialized state cannot write
   project-level paths (e.g. AGENTS.md) into the home directory.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
Object.keys() returns string[] but supportedTools is ToolName[]; cast to
string[] for the includes check so the compiler is satisfied.

https://claude.ai/code/session_01TSCSufkV1y4vNjEKL8Apr7
@sjquant sjquant merged commit 6c5fba4 into main May 23, 2026
1 check passed
@sjquant sjquant deleted the claude/update-agent-instructions-EoIaF branch May 23, 2026 14:33
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