Repository navigation
feat: Copilot harness — repo-local .copilot/ output with install/uninstall workflow - #550
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds GitHub Copilot as a sixth harness: capability mappings, a CopilotAdapter that emits ChangesCopilot Harness Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CONTRIBUTING.md (1)
3-5:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate harness count to six.
The opening paragraph still references "five agentic harnesses" but this PR adds Copilot as the sixth supported harness. All other documentation files in this PR consistently use "six harnesses."
📝 Suggested fix
-Thanks for your interest in contributing. This marketplace ships to five agentic -harnesses (Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Gemini CLI) from a single -Markdown source. +Thanks for your interest in contributing. This marketplace ships to six agentic +harnesses (Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Gemini CLI, GitHub Copilot) +from a single Markdown source.🤖 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 `@CONTRIBUTING.md` around lines 3 - 5, Update the opening paragraph that currently reads "five agentic harnesses (Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Gemini CLI)" to reflect six harnesses by changing "five" to "six" and adding "Copilot" into the parenthetical list so it matches the rest of the PR's docs; keep the ordering consistent with other files in the PR.
🧹 Nitpick comments (2)
AGENTS.md (1)
48-49: 💤 Low valueClarify "all six" vs "all five" in generate-all comment.
Line 49's comment says "all six" but
make generate-allonly generates the five target harnesses (codex, cursor, opencode, gemini, copilot) since claude-code is the source of truth, not a generated artifact. While README.md disambiguates this, the comment here could be clearer.📝 Suggested clarification
make generate HARNESS=copilot # emits .copilot/agents/ -make generate-all # all six +make generate-all # all five (codex, cursor, opencode, gemini, copilot)🤖 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 `@AGENTS.md` around lines 48 - 49, The comment in AGENTS.md is misleading: the "make generate-all" line says "all six" but the make target only generates five harnesses (codex, cursor, opencode, gemini, copilot) because claude-code is the canonical source and not generated; update the comment to accurately reflect that it generates five harnesses (or explicitly note that claude-code is excluded and is the sixth, non-generated harness). Edit the line containing "make generate-all # all six" to read something like "# all five (claude-code is source/not generated)" so it matches the actual behavior of the make target and README clarification.tools/tests/test_validate_generated.py (1)
152-161: ⚡ Quick winAdd Copilot validator tests for invalid
namevalues.This class currently covers non-string
descriptiononly; add cases for non-string and emptynameto lock in schema behavior.🤖 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 `@tools/tests/test_validate_generated.py` around lines 152 - 161, Add tests in the TestCopilotValidator suite to cover invalid `name` values: create one test similar to test_non_string_description_errors that writes a bad agent file where the frontmatter has name: [oops] and asserts validate_copilot(Report()) produces an error whose message contains "name" and "string", and another test that writes an agent file with name: "" (or missing/empty) and asserts the report contains an error referencing "name" and "empty" (or required); use the same helpers and functions (Report, validate_copilot, _patch_worktree) and keep each case in its own test function (e.g., test_non_string_name_errors and test_empty_name_errors) mirroring the structure of the existing test_non_string_description_errors.
🤖 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 `@tools/adapters/copilot.py`:
- Around line 45-49: The constructor currently ignores the output_root parameter
by hardcoding WORKTREE / ".copilot" when calling super().__init__; change
__init__ so it uses the provided output_root if non-None (e.g., pass output_root
or fallback to WORKTREE / ".copilot") when invoking super().__init__, and keep
the existing repo_root assignment logic (repo_root -> self.repo_root) intact;
update references to output_root in the Copilot adapter constructor so CLI
--output-root controls the adapter path rather than being bypassed.
- Around line 22-24: _copilot_frontmatter currently emits scalars as unquoted
f"{k}: {value}", which lets plain YAML tokens (e.g., 123, true, [oops]) be
parsed as non-strings; change _copilot_frontmatter to conservatively quote
string scalars before emitting so description and other fields are always YAML
strings. Implement this by reusing the scalar-quoting logic from
tools/adapters/codex.py (call the existing quote_scalar or
yaml_scalar_needs_quoting helper used there) or by adding the same conservative
check: if a value is a string and would be interpreted as a non-string token,
wrap it in quotes and escape interior quotes/newlines as codex.py does, then
emit lines.append(f"{k}: {quoted_value}") instead of the current unquoted form.
In `@tools/validate_generated.py`:
- Around line 533-541: The validator currently only checks presence of "name" in
fm but allows non-string or empty values; update the check near where fm is
inspected (the block that calls report.add for missing `name`) to validate that
fm["name"] is a non-empty string (e.g., isinstance(fm["name"], str) and
fm["name"].strip() != "") and call report.add with a similar
severity="error"/remediation message if the value is missing, not a string, or
blank so invalid frontmatter fails validation.
---
Outside diff comments:
In `@CONTRIBUTING.md`:
- Around line 3-5: Update the opening paragraph that currently reads "five
agentic harnesses (Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Gemini CLI)"
to reflect six harnesses by changing "five" to "six" and adding "Copilot" into
the parenthetical list so it matches the rest of the PR's docs; keep the
ordering consistent with other files in the PR.
---
Nitpick comments:
In `@AGENTS.md`:
- Around line 48-49: The comment in AGENTS.md is misleading: the "make
generate-all" line says "all six" but the make target only generates five
harnesses (codex, cursor, opencode, gemini, copilot) because claude-code is the
canonical source and not generated; update the comment to accurately reflect
that it generates five harnesses (or explicitly note that claude-code is
excluded and is the sixth, non-generated harness). Edit the line containing
"make generate-all # all six" to read something like "# all five
(claude-code is source/not generated)" so it matches the actual behavior of the
make target and README clarification.
In `@tools/tests/test_validate_generated.py`:
- Around line 152-161: Add tests in the TestCopilotValidator suite to cover
invalid `name` values: create one test similar to
test_non_string_description_errors that writes a bad agent file where the
frontmatter has name: [oops] and asserts validate_copilot(Report()) produces an
error whose message contains "name" and "string", and another test that writes
an agent file with name: "" (or missing/empty) and asserts the report contains
an error referencing "name" and "empty" (or required); use the same helpers and
functions (Report, validate_copilot, _patch_worktree) and keep each case in its
own test function (e.g., test_non_string_name_errors and test_empty_name_errors)
mirroring the structure of the existing test_non_string_description_errors.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0aea84f9-9903-44e3-867e-08473a99cc07
📒 Files selected for processing (14)
.gitignoreAGENTS.mdARCHITECTURE.mdCONTRIBUTING.mdMakefileREADME.mddocs/harnesses.mddocs/round-trip-results.mdtools/adapters/capabilities.pytools/adapters/copilot.pytools/generate.pytools/tests/test_cli_smoke.pytools/tests/test_validate_generated.pytools/validate_generated.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use 'uv' as the package manager for Python tooling
Use 'ruff' for linting and formatting Python code
Use 'ty' for type checking instead of mypy
Files:
tools/tests/test_cli_smoke.pytools/validate_generated.pytools/generate.pytools/adapters/copilot.pytools/tests/test_validate_generated.pytools/adapters/capabilities.py
AGENTS.md
📄 CodeRabbit inference engine (CLAUDE.md)
AGENTS.md: Import the canonical AGENTS.md file following Anthropic's recommended cross-harness convention pattern for repository setup
Honor thetools:frontmatter verbatim in agent configurations for per-agent tool allowlist specificationKeep AGENTS.md lean and short (under ~150 lines) per OpenAI's harness-engineering practice; push procedural detail to skills and reference material to docs/
Files:
AGENTS.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:00:16.119Z
Learning: Never commit secrets to the repository
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:00:16.119Z
Learning: Never run destructive git operations (force-push, reset --hard, branch -D) without explicit ask
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:00:16.119Z
Learning: Run 'make validate STRICT=1', 'make garden', 'make test', and 'make smoke-test' before pushing code
🔇 Additional comments (19)
.gitignore (1)
31-32: LGTM!AGENTS.md (2)
3-5: LGTM!
63-63: LGTM!Also applies to: 73-73
ARCHITECTURE.md (1)
7-7: LGTM!Also applies to: 39-39, 86-86
CONTRIBUTING.md (1)
48-48: LGTM!Also applies to: 55-56
README.md (4)
5-7: LGTM!Also applies to: 10-10
27-27: LGTM!Also applies to: 32-32
79-86: LGTM!
89-89: LGTM!docs/harnesses.md (3)
22-38: LGTM!
45-53: LGTM!
18-18: LGTM!Also applies to: 65-65, 75-75
docs/round-trip-results.md (1)
108-108: LGTM!tools/adapters/capabilities.py (3)
261-266: LGTM!
192-204: ⚡ Quick winAdjust Copilot tool-name mappings to avoid conflating create/edit and URL fetch/search
Copilot’s agent tool vocabulary distinguishes file creation vs editing via separate tool names (
createvsedit). Intools/adapters/capabilities.pythe current mapping collapses them:"copilot": { "Read": "read", "Edit": "edit", "Write": "edit", "Bash": "execute", "Grep": "search", "Glob": "search", "WebFetch": "web", "WebSearch": "web", "TodoWrite": "todo", "Agent": "agent", "Task": "agent", },
- If
Writein this adapter is intended to create new files (vs only modifying existing contents), map it to Copilot’screateinstead ofedit.- Copilot also supports URL fetching via a dedicated
urltool kind; ifWebFetchis “fetch this specific URL”, mapping it to generic"web"likely loses the distinction.GrepvsGlob: Copilot has different workspace search capabilities (e.g.,grepvs file-search-style tools). IfGlobis file-pattern matching rather than content search, it shouldn’t be collapsed into the same"search"target.
92-111: ⚡ Quick winClarify Copilot’s
parallel_agentsvstask_spawnflagsIn
tools/adapters/capabilities.py(lines 92-111), Copilot setstask_spawn=Truebutparallel_agents=False, and there’s no in-repo reference explaining this behavior. Either ensure the flags match Copilot’s actual execution model or add a short rationale comment for why spawning is supported while parallel agent execution is not.tools/generate.py (1)
5-5: LGTM!Also applies to: 37-37, 59-63, 163-166, 191-191
Makefile (1)
160-160: LGTM!Also applies to: 194-205
tools/tests/test_cli_smoke.py (1)
131-143: LGTM!
fd8b249 to
975e94d
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/generate.py (1)
163-166:⚠️ Potential issue | 🟠 Major | ⚡ Quick winCopilot orphan pruning is targeting the wrong directory.
prune_orphans()checks.copilot/, but Copilot outputs are under.github/agentsand.github/skills. As written,--prunewon’t remove stale Copilot artifacts.Proposed fix
- elif harness_id == "copilot": - d = output_root / ".copilot" - if d.is_dir(): - candidates.extend(p for p in d.rglob("*") if p.is_file()) + elif harness_id == "copilot": + for sub_path in ( + output_root / ".github" / "agents", + output_root / ".github" / "skills", + ): + if sub_path.is_dir(): + candidates.extend(p for p in sub_path.rglob("*") if p.is_file())🤖 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 `@tools/generate.py` around lines 163 - 166, prune_orphans() is currently targeting output_root / ".copilot" for harness_id == "copilot", but Copilot artifacts live under .github/agents and .github/skills; change the branch where harness_id == "copilot" (the block that sets d = output_root / ".copilot") to instead collect files from output_root / ".github" / "agents" and output_root / ".github" / "skills" (e.g., build two Path objects for agents and skills and extend candidates with their rglob("*") file results if those dirs exist) so --prune removes stale Copilot outputs.
🤖 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 `@AGENTS.md`:
- Line 49: Update the regenerate note in AGENTS.md that follows the "make
generate-all" line: change the phrase "all five" to "all six" to reflect
inclusion of Copilot; locate the line containing "make generate-all" and the
adjacent explanatory text and adjust the count text accordingly.
In `@docs/harnesses.md`:
- Line 23: The table's separator row currently has eight columns
("|---|---|---|---|---|---|---|---|") but the header defines seven columns,
breaking markdown rendering; update the separator to match the header by
removing one "|---|" so it becomes seven separators
("|---|---|---|---|---|---|---|") ensuring the number of columns aligns with the
header row.
In `@tools/adapters/copilot.py`:
- Around line 3-18: Reorder and group imports in tools/adapters/copilot.py to
satisfy Ruff I001: keep "from __future__ import annotations" first, then
standard-library imports (place "import re" and "from pathlib import Path"
together, sorted), then a blank line, then local application imports from
tools.adapters.capabilities and tools.adapters.base (keep the symbols
TOOL_NAME_MAPS, resolve_model, and WORKTREE, AgentSource, EmitResult,
HarnessAdapter, PluginSource, SkillSource) and sort the names within each
from-import alphabetically; adjust blank lines between groups accordingly so
ruff check passes.
---
Outside diff comments:
In `@tools/generate.py`:
- Around line 163-166: prune_orphans() is currently targeting output_root /
".copilot" for harness_id == "copilot", but Copilot artifacts live under
.github/agents and .github/skills; change the branch where harness_id ==
"copilot" (the block that sets d = output_root / ".copilot") to instead collect
files from output_root / ".github" / "agents" and output_root / ".github" /
"skills" (e.g., build two Path objects for agents and skills and extend
candidates with their rglob("*") file results if those dirs exist) so --prune
removes stale Copilot outputs.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e9f9aaac-5328-465f-bdc0-3fd7078e3d41
📒 Files selected for processing (14)
.gitignoreAGENTS.mdARCHITECTURE.mdCONTRIBUTING.mdMakefileREADME.mddocs/harnesses.mddocs/round-trip-results.mdtools/adapters/capabilities.pytools/adapters/copilot.pytools/generate.pytools/tests/test_cli_smoke.pytools/tests/test_validate_generated.pytools/validate_generated.py
✅ Files skipped from review due to trivial changes (1)
- docs/round-trip-results.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Python tooling: use uv (package manager), ruff (lint/format), ty (type check). Do not use pip / mypy / black.
Files:
tools/validate_generated.pytools/tests/test_validate_generated.pytools/tests/test_cli_smoke.pytools/adapters/capabilities.pytools/generate.pytools/adapters/copilot.py
AGENTS.md
📄 CodeRabbit inference engine (CLAUDE.md)
AGENTS.md: Import the canonical AGENTS.md file following Anthropic's recommended cross-harness convention pattern for repository setup
Honor thetools:frontmatter verbatim in agent configurations for per-agent tool allowlist specificationThis file should never grow beyond ~150 lines (per OpenAI's harness-engineering practice).
Files:
AGENTS.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:39:20.710Z
Learning: Never commit secrets. Never run destructive git (force-push, `reset --hard`, branch -D) without explicit ask.
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:39:20.710Z
Learning: Generated artifacts are gitignored — never hand-edit them. Source-of-truth lives only under `plugins/`.
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:39:20.710Z
Learning: AGENTS.md is a map (table of contents), not an encyclopedia. Procedural detail lives in skills (loaded on demand); reference material lives in `docs/` (loaded on navigation).
🪛 GitHub Actions: Code Quality / 1_Python (ruff + ty).txt
tools/adapters/copilot.py
[error] 3-18: ruff check failed: I001 Import block is un-sorted or un-formatted. Help: Organize imports. (1 error found, 1 fixable with --fix)
🪛 GitHub Actions: Code Quality / Python (ruff + ty)
tools/adapters/copilot.py
[error] 3-18: ruff check failed: Import block is un-sorted or un-formatted (help: Organize imports). Found 1 error (1 fixable with --fix).
🪛 LanguageTool
README.md
[uncategorized] ~86-~86: The official name of this software platform is spelled with a capital “H”.
Context: ...nts (April 2026 spec) | | Copilot | .github/agents/, .github/skills/ | Markdown ...
(GITHUB)
[uncategorized] ~86-~86: The official name of this software platform is spelled with a capital “H”.
Context: ...c) | | Copilot | .github/agents/, .github/skills/ | Markdown agent profiles + SK...
(GITHUB)
AGENTS.md
[uncategorized] ~63-~63: The official name of this software platform is spelled with a capital “H”.
Context: ...LL.md- **Copilot**: agent profiles to.github/agents/, skills to .github/skills/` ...
(GITHUB)
[uncategorized] ~73-~73: The official name of this software platform is spelled with a capital “H”.
Context: ...claude/agents/directly - **Copilot**:.github/agents/__.agent.md` (Mar...
(GITHUB)
ARCHITECTURE.md
[uncategorized] ~7-~7: The official name of this software platform is spelled with a capital “H”.
Context: ...dex/, .cursor-plugin/, .opencode/, .github/agents/, .github/skills/, commands/...
(GITHUB)
[uncategorized] ~7-~7: The official name of this software platform is spelled with a capital “H”.
Context: ...gin/, .opencode/, .github/agents/, .github/skills/, commands/, agents/, skil...
(GITHUB)
docs/harnesses.md
[uncategorized] ~18-~18: The official name of this software platform is spelled with a capital “H”.
Context: ...t) | | GitHub Copilot | supported | .github/agents/ (agent profiles), `.github/ski...
(GITHUB)
[uncategorized] ~18-~18: The official name of this software platform is spelled with a capital “H”.
Context: ...d | .github/agents/ (agent profiles), .github/skills/ (SKILL.md skills) | ## Capabi...
(GITHUB)
[uncategorized] ~24-~24: The official name of this software platform is spelled with a capital “H”.
Context: ...a .claude/ | ✅ (auto-discovered) | ✅ (.github/skills/) | | Subagents (markdown nativ...
(GITHUB)
[uncategorized] ~69-~69: The official name of this software platform is spelled with a capital “H”.
Context: ...er ``` > Copilot discovers agents from .github/agents/ and skills from `.github/skill...
(GITHUB)
[uncategorized] ~69-~69: The official name of this software platform is spelled with a capital “H”.
Context: ... from .github/agents/ and skills from .github/skills/ at the repo root. Run `make ge...
(GITHUB)
🔇 Additional comments (6)
tools/adapters/copilot.py (1)
64-66:output_rootis still ignored in adapter initialization.
__init__acceptsoutput_rootbut always passesWORKTREE / ".github"tosuper(), so caller-supplied output roots are bypassed.tools/generate.py (1)
5-5: LGTM!Also applies to: 59-63, 191-191
Makefile (1)
160-160: LGTM!Also applies to: 194-194, 205-205
tools/validate_generated.py (1)
505-512: LGTM!Also applies to: 538-553, 562-569, 588-588
tools/tests/test_validate_generated.py (1)
12-12: LGTM!Also applies to: 149-162
tools/tests/test_cli_smoke.py (1)
136-138: LGTM!
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tools/adapters/copilot.py (1)
75-77:⚠️ Potential issue | 🟠 Major | ⚡ Quick winEnsure Copilot output is always scoped under
.github.Line 77 currently uses the provided
output_rootas-is; with CLI defaults this writes to repo-rootagents/andskills/instead of.github/agentsand.github/skills. That breaks theclean/prunepath contract intools/generate.py.Proposed fix
def __init__(self, output_root: Path | None = None, repo_root: Path | None = None) -> None: """Set output root (defaults to WORKTREE / .github) and optional repo root.""" - super().__init__(output_root=output_root or WORKTREE / ".github") + base_root = output_root if output_root is not None else WORKTREE + super().__init__(output_root=base_root / ".github") if repo_root is not None: self.repo_root = repo_root🤖 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 `@tools/adapters/copilot.py` around lines 75 - 77, The constructor Copilot.__init__ currently accepts output_root directly which can point outside the expected .github subtree; change it to always set a base = WORKTREE / ".github" and derive the effective output_root from that base: if the caller passed None use base, otherwise join the passed output_root under base (e.g., base / Path(output_root).relative_to(repo_root) or base / Path(output_root).name if repo_root is None) so all generated paths (output_root) are guaranteed under WORKTREE/".github"; update the assignment in __init__ to compute and pass this effective output_root to super().__init__ so clean/prune in tools/generate.py work correctly.
🤖 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.
Duplicate comments:
In `@tools/adapters/copilot.py`:
- Around line 75-77: The constructor Copilot.__init__ currently accepts
output_root directly which can point outside the expected .github subtree;
change it to always set a base = WORKTREE / ".github" and derive the effective
output_root from that base: if the caller passed None use base, otherwise join
the passed output_root under base (e.g., base /
Path(output_root).relative_to(repo_root) or base / Path(output_root).name if
repo_root is None) so all generated paths (output_root) are guaranteed under
WORKTREE/".github"; update the assignment in __init__ to compute and pass this
effective output_root to super().__init__ so clean/prune in tools/generate.py
work correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 62a7fe92-78bb-42eb-b874-208fd0752b56
📒 Files selected for processing (4)
AGENTS.mddocs/harnesses.mdtools/adapters/copilot.pytools/generate.py
✅ Files skipped from review due to trivial changes (2)
- AGENTS.md
- docs/harnesses.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Python tooling must use 'uv' for package management, 'ruff' for linting/formatting, and 'ty' for type checking. Do not use pip, mypy, or black.
Files:
tools/generate.pytools/adapters/copilot.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:59:35.056Z
Learning: Never commit secrets to the repository.
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:59:35.056Z
Learning: Never run destructive git operations (force-push, 'reset --hard', 'branch -D') without explicit ask from the team.
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:59:35.056Z
Learning: This repository should serve as the single source-of-truth for agentic content, consumed by Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Gemini CLI, and GitHub Copilot.
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T18:59:35.056Z
Learning: All quality gates including 'make validate STRICT=1', 'make garden', 'make test', and 'make smoke-test' must be run before pushing code.
🔇 Additional comments (2)
tools/adapters/copilot.py (1)
22-27: LGTM!Also applies to: 65-71, 82-83, 91-92, 95-99, 123-127
tools/generate.py (1)
37-37: LGTM!Also applies to: 164-169
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/adapters/copilot.py (1)
18-27:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winYAML quoting check incomplete for flow sequences and special characters.
The previous review flagged values like
[oops]as needing quotes to prevent YAML type coercion. The current implementation handles numeric and boolean-like strings but not:
- Flow sequences/mappings:
[...],{...}- YAML special markers:
!,&,*,@,`- Empty strings
A
descriptionvalue like[test]would be parsed as a YAML list rather than a string.🛡️ Proposed fix to extend quoting check
def _needs_yaml_quoting(value: str) -> bool: """Check if a string value needs YAML quoting to prevent type coercion.""" + if not value: + return True + if value[0] in "[{!&*@`#|>": + return True return bool(re.match(r"^\d+(\.\d+)?$", value)) or value.lower() in ( "true", "false", "yes", "no", "null", "~", )🤖 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 `@tools/adapters/copilot.py` around lines 18 - 27, The _needs_yaml_quoting function currently only checks numeric and boolean-like strings; update it to also return True for empty strings and for values that would be interpreted as flow sequences/mappings or special-marked YAML tokens: detect values that start with "[" or "{", or start with any of the special characters "!", "&", "*", "@", "`", or that equal "" (empty); incorporate these checks into the existing return logic (or an early return) inside _needs_yaml_quoting so values like "[test]" or strings beginning with YAML markers are flagged for quoting.
🤖 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.
Outside diff comments:
In `@tools/adapters/copilot.py`:
- Around line 18-27: The _needs_yaml_quoting function currently only checks
numeric and boolean-like strings; update it to also return True for empty
strings and for values that would be interpreted as flow sequences/mappings or
special-marked YAML tokens: detect values that start with "[" or "{", or start
with any of the special characters "!", "&", "*", "@", "`", or that equal ""
(empty); incorporate these checks into the existing return logic (or an early
return) inside _needs_yaml_quoting so values like "[test]" or strings beginning
with YAML markers are flagged for quoting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4f050f37-d1e1-43b6-b356-c215563ba8ab
📒 Files selected for processing (1)
tools/adapters/copilot.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use Python tooling: uv for package management, ruff for linting/formatting, ty for type checking. Do not use pip, mypy, or black
Files:
tools/adapters/copilot.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T19:05:00.166Z
Learning: Never commit secrets to the repository
Learnt from: CR
Repo: wshobson/agents
Timestamp: 2026-05-24T19:05:00.166Z
Learning: Never run destructive git operations (force-push, `reset --hard`, branch -D) without explicit ask
🔇 Additional comments (5)
tools/adapters/copilot.py (5)
1-16: LGTM!
30-46: LGTM!
49-60: LGTM!
63-79: LGTM!
80-131: LGTM!
|
Still testing.... |
| | `/comprehensive-review:full-review` | Multi-perspective analysis | | ||
| | `/comprehensive-review:pr-enhance` | Enhance pull requests | |
…hanges to test and base adapter - Delete agents_skills.txt and gemini_skills.txt (stale lint outputs) - Remove agents/*.agent.md gitignore guard - README.md: restore original table header, Claude Code row, simplify generate-all comment - docs/authoring.md: re-add Codex deprecated note alongside Copilot info - docs/usage.md: restore removed pr-enhance command - tools/adapters/base.py: remove AskUserQuestion mapping - tools/tests/test_cli_smoke.py: revert TTY skip in codex doctor test
|
Hey @mhenke — thanks for putting this together! Adding Copilot as a harness is a great contribution and the adapter follows the established patterns well. This one is really close to being mergeable. Here's what's left to get CI green: CI Blockers
Code Issues (from CodeRabbit review)
Once those are addressed, we should be in good shape to merge. Let us know if you have questions! |
- fix stem-parsing bug in doc_gardener.py (.agent suffix strip on Path.stem) - wrap skill.body with _rewrite_body_lowercase_tools() in copilot.py - add config_dir.is_dir() guard in install_copilot.py uninstall - fix ruff I001 import sorting across 5 files
|
Addressed all 5 review items from @wshobson:
All quality gates green: After the review fixes, also ran a documentation audit and fixed 3 gaps:
|
- Add --commit flag to tools/generate.py and default .copilot output_root - Validate .github/agents in tools/validate_generated.py - Makefile wiring for COMMIT=1 Co-authored-by: Copilot <[email protected]>
…ribution patterns) - Keep generation local by default (.copilot) - Revert opt-in --commit behavior that wrote to .github/agents - Retain validator adjustments scoped to .copilot - Clean branch focuses only on adapter ergonomics and validator behavior Co-authored-by: Copilot <[email protected]>
…ent)\n\nCo-authored-by: Copilot <[email protected]>
…dresses PR comment)\n\nAdds docstrings for validate_codex, validate_cursor, validate_opencode, validate_gemini, and main.
…rage (addresses PR comment)\n\nAdds docstrings for validate_codex, validate_cursor, validate_opencode, validate_gemini, and main." This reverts commit 091c218.
…github/ - CopilotAdapter now writes to ~/.copilot/agents/ and ~/.copilot/skills/ - Updated generate.py to pass ~/.copilot/ as output_root for copilot - Added copilot stale artifact detection to doc_gardener.py - Updated validate_generated.py to check ~/.copilot/agents/ (with fallback) - Removed old copilot gitignore entries and cleaned up stale artifacts - No install step needed — make generate HARNESS=copilot writes directly
… output - Generate to .copilot/agents/ and .copilot/skills/ (repo-local, gitignored) - make install-copilot symlinks to ~/.copilot/ for user-level discovery - tools/install_copilot.py + test_install_copilot.py (mirrors install_opencode) - tools/validate_generated.py: validate agents + skills - tools/doc_gardener.py: stale artifact detection for .copilot/ - tools/generate.py: _HARNESS_TARGETS + prune_orphans for .copilot/ - tools/tests/test_adapters.py: TestCopilotAdapter (9 tests) - tools/tests/test_round_trip.py: TestCopilotRoundTrip (3 tests) - tools/tests/test_validate_generated.py: expanded to 8 tests - docs/harnesses.md: install-copilot instructions + Pensyve entry - .gitignore: .copilot/ Closes wshobson#553 (follows same install pattern as OpenCode)
The 'make install-copilot' command now automatically clears Copilot's cache directories (pkg and marketplace-cache) after symlinking artifacts, ensuring new agents and skills are immediately discoverable without requiring manual cache clearing. This fixes the issue where installing agents like comprehensive-review required a separate manual cache clear step before they appeared in Copilot's agent discovery. - Add _clear_copilot_cache() to remove pkg/ and marketplace-cache/ - Update _print_report() to show cache clearing confirmation - Integrate cache clearing into main() install flow only Co-authored-by: Copilot <[email protected]>
…H1 when missing) Co-authored-by: Copilot <[email protected]>
- Commands now symlink to ~/.copilot/comprehensive-review/commands/ instead of ~/.copilot/commands/ - Adapter emits command files to .copilot/commands/<plugin>/ directory structure - Installer symlinks each command directory to ~/.copilot/<plugin>/commands/ - This matches Copilot CLI's discovery path for plugin commands Co-authored-by: Copilot <[email protected]>
Copilot does not support custom slash commands via `.copilot/commands/` — that path was a project invention with no official discovery mechanism. Plugin commands emitted there were invisible to Copilot CLI and VS Code. Instead, emit each plugin command as a Copilot skill SKILL.md with: - user-invocable: true (appears in VS Code / menu) - disable-model-invocation: true (not auto-loaded, only on demand) - hyphenated name `<plugin>-<command>` per VS Code Agent Skills spec Legacy `.copilot/commands/` emission retained for backward compat. Closes the loop on commands-not-working-in-Copilot-CLI investigation.
…hanges to test and base adapter - Delete agents_skills.txt and gemini_skills.txt (stale lint outputs) - Remove agents/*.agent.md gitignore guard - README.md: restore original table header, Claude Code row, simplify generate-all comment - docs/authoring.md: re-add Codex deprecated note alongside Copilot info - docs/usage.md: restore removed pr-enhance command - tools/adapters/base.py: remove AskUserQuestion mapping - tools/tests/test_cli_smoke.py: revert TTY skip in codex doctor test
…L quoting, validator helper
- docs/harnesses.md: remove dead reference to nonexistent make docs target - ARCHITECTURE.md: add missing copilot.py row to adapter framework table - AGENTS.md, README.md, docs/harnesses.md: add .copilot/commands/ to Copilot's generated output paths (emitted as legacy backward compat)
- fix stem-parsing bug in doc_gardener.py (.agent suffix strip on Path.stem) - wrap skill.body with _rewrite_body_lowercase_tools() in copilot.py - add config_dir.is_dir() guard in install_copilot.py uninstall - fix ruff I001 import sorting across 5 files
…nds mention, round-trip results
e498204 to
608568c
Compare
|
Great work on this, @mhenke! Really thorough contribution — the adapter, installer, validator, tests, and docs are all solid. Thanks for sticking with the review iterations and addressing every item. Merging now! |
Summary
Adds GitHub Copilot as a 5th generated output harness. Every plugin's agents, skills, and commands are emitted as Copilot-native
.agent.mdprofiles,SKILL.mdskills, and command-index files under.copilot/. Includesmake install-copilot/make uninstall-copilotfor symlinking into~/.copilot/, plus validator gates, gardener drift tracking, and 29 Copilot-specific tests.Scope
plugins/<name>/...)tools/adapters/)Affected harnesses
Summary of changes
New files (2)
tools/adapters/copilot.py(224 lines).copilot/agents/<plugin>__<agent>.agent.md), skills (.copilot/skills/<plugin>__<skill>/SKILL.md), commands-as-skills (.copilot/skills/<plugin>-<command>/SKILL.mdwithuser-invocable: true,disable-model-invocation: true), and legacy command-index files (.copilot/commands/<plugin>/). Tool names rewritten CamelCase->lowercase. Model aliases mapped to GPT-5 family.tools/install_copilot.py(205 lines).copilot/agents/,.copilot/skills/,.copilot/commands/into~/.copilot/. Uninstall removes only symlinks targeting the repo tree. RespectsCOPILOT_CONFIG_DIRandXDG_CONFIG_HOME. Clears Copilot CLI cache after install.Modified files (17)
tools/adapters/capabilities.pyCapabilityrow (skills_native=True,agents_native=True,commands_native=False->mapped to skills,parallel_agents=False,tool_allowlist_per_agent=True),TOOL_NAME_MAPS["copilot"](10 tool entries),MODEL_ALIASES["copilot"](4 aliases).tools/validate_generated.pyvalidate_copilot()-- validates.agent.mdfrontmatter (name,descriptionas non-empty strings),.copilot/skills/*/SKILL.mdfrontmatter, and.copilot/commands/**/*.mdwith description checks.tools/doc_gardener.py.copilot/agents/*.agent.mdand.copilot/skills/*/SKILL.md. Added.omo/directory noise skip.tools/generate.pyget_adapter(),_HARNESS_TARGETS(.copilot/agents,.copilot/skills,.copilot/commands),prune_orphans()for copilot.Makefilemake generate HARNESS=copilot,make install-copilot [FORCE=1],make uninstall-copilot. UpdatedHARNESSESlist,generate-all,clean-generated..gitignore.copilot/to harness output ignores.AGENTS.mdARCHITECTURE.mdcopilot.pyto adapter list in component overview and cross-harness framework table.README.mdCONTRIBUTING.mddocs/authoring.mddescription: plain string, lowercase tool names) and installation instructions.docs/harnesses.mddocs/round-trip-results.mdtools/tests/test_adapters.pyTestCopilotAdapter(10 tests: agent emission, tool rewriting, model aliasing, skill emission, command prompt files, YAML quoting, tools field handling).tools/tests/test_install_copilot.pytools/tests/test_round_trip.pyTestCopilotRoundTrip(5 tests: agent/skill/command count matches source, entrypoints exist, frontmatter correctness).tools/tests/test_validate_generated.pyTestCopilotValidator(8 tests: non-string description error, missing/empty name/description errors, valid agent passes, skill frontmatter errors).Design decisions
.copilot/output (not.github/): matches the OpenCode install pattern. Generated artifacts are gitignored;make install-copilotsymlinks them to~/.copilot/.user-invocable: true+disable-model-invocation: truefor VS Code/-menu. Legacy.copilot/commands/files also emitted for backward compat.opus->gpt-5,sonnet->gpt-5-mini,haiku->gpt-5-nano..copilot/tree.Test plan
make validate STRICT=1-- OK (5 harnesses)make garden-- OK (0 errors)make test-- 125 passed (adapter suite) including 29 Copilot-specific testsmake install-copilotspot-checked -- correctly symlinks.copilot/->~/.copilot/Cross-harness portability notes
N/A -- pure harness adapter addition, no plugin content changes.
Related issue(s)
Closes #557