feat(copilot): support --integration-options="--skills" for skills-based scaffolding#2324
feat(copilot): support --integration-options="--skills" for skills-based scaffolding#2324
--integration-options="--skills" for skills-based scaffolding#2324Conversation
Add --skills integration option to CopilotIntegration that scaffolds commands as speckit-<name>/SKILL.md under .github/skills/ instead of the default .agent.md + .prompt.md layout. - Add options() with --skills flag (default=False) - Branch setup() between default and skills modes - Add post_process_skill_content() for Copilot-specific mode: field - Adjust build_command_invocation() for skills mode (/speckit-<stem>) - Update dispatch_command() with skills mode detection - Parse --integration-options during init command - Add 22 new skills-mode tests - All 15 existing default-mode tests continue to pass Agent-Logs-Url: https://github.com/github/spec-kit/sessions/a4903fab-64ff-46c3-8eb8-a47f495a70c0 Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/spec-kit/sessions/a4903fab-64ff-46c3-8eb8-a47f495a70c0 Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
--integration-options="--skills" for skills-based scaffolding
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a Copilot integration “skills mode” (--integration-options="--skills") that scaffolds speckit-<name>/SKILL.md under .github/skills/ (instead of .agent.md + .prompt.md + VS Code settings merge), along with CLI plumbing and tests.
Changes:
- Introduces
--skillsintegration option for Copilot and branchessetup()into default vs skills scaffolding. - Extends
initto parse and forward--integration-optionsinto integrationparsed_options, and persistsai_skillswhen an integration is operating in skills mode. - Adds a new test suite covering Copilot skills-mode scaffolding, post-processing, install/uninstall, and CLI integration.
Show a summary per file
| File | Description |
|---|---|
| tests/integrations/test_integration_copilot.py | Adds comprehensive tests for Copilot --skills mode behavior and CLI wiring. |
| src/specify_cli/integrations/copilot/init.py | Implements Copilot skills-mode scaffolding via a delegate SkillsIntegration helper and adds SKILL.md post-processing + dispatch changes. |
| src/specify_cli/init.py | Ensures init parses --integration-options and persists ai_skills for integrations operating in skills mode. |
| AGENTS.md | Documents Copilot’s new skills mode and how to enable it. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 4
- Reset _skills_mode at start of setup() to prevent singleton state leak - Tighten skills auto-detection to require speckit-*/SKILL.md (not any non-empty .github/skills/ directory) - Add copilot_skill_mode to init next-steps so skills mode renders /speckit-plan instead of /speckit.plan - Fix docstring quoting to match actual unquoted output - Add 4 tests covering singleton reset, auto-detection false positive, speckit layout detection, and next-steps skill syntax - Fix skipped test_invalid_metadata_error_returns_unknown by simulating InvalidMetadataError on Python versions that lack it
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
| ) | ||
|
|
||
| if skills_mode: | ||
| prompt = self.build_command_invocation(command_name, args) |
There was a problem hiding this comment.
In dispatch_command(), when skills mode is auto-detected from the project layout (skills_mode becomes True while self._skills_mode is still False), prompt = self.build_command_invocation(...) will fall back to default-mode behavior and omit the /speckit-<stem> invocation. This will run Copilot with just the raw args and no skill command.
Fix by building the prompt based on the local skills_mode decision (e.g., inline /speckit-... construction or temporarily setting self._skills_mode = skills_mode before calling build_command_invocation).
| prompt = self.build_command_invocation(command_name, args) | |
| prompt = f"/speckit-{stem}" | |
| if args: | |
| prompt = f"{prompt} {args}" |
| call_args = mock_run.call_args[0][0] | ||
| assert "--agent" not in call_args, ( | ||
| f"Skills mode should not use --agent, got: {call_args}" | ||
| ) |
There was a problem hiding this comment.
test_dispatch_detects_speckit_skills_layout only asserts that --agent is omitted, but it doesn’t assert that the prompt passed via -p actually includes the /speckit-<stem> invocation. This test would still pass if skills auto-detection removed --agent but left the prompt as raw args (regression).
Add an assertion on the value following -p in call_args (or join the args) to ensure /speckit-plan (and the user args) are present.
| ) | |
| ) | |
| prompt = call_args[call_args.index("-p") + 1] | |
| assert "/speckit-plan" in prompt, ( | |
| f"Skills mode prompt should invoke /speckit-plan, got: {prompt}" | |
| ) | |
| assert "my args" in prompt, ( | |
| f"Skills mode prompt should preserve user args, got: {prompt}" | |
| ) |
Adds a
--skillsflag to the Copilot integration enablingspeckit-<name>/SKILL.mdscaffolding under.github/skills/as an alternative to the default.agent.md+.prompt.md+ settings merge layout. The two modes are mutually exclusive.Implementation
_CopilotSkillsHelper(SkillsIntegration)with.github/skills/config is used as a delegate —CopilotIntegrationstays onIntegrationBasesetup()branches into_setup_default()and_setup_skills()based onparsed_options["skills"]post_process_skill_content()injectsmode: speckit.<stem>into SKILL.md frontmatter (Copilot-specific field, analogous to Claude'suser-invocable/disable-model-invocation)build_command_invocation()returns/speckit-<stem>in skills mode, bare args in default modedispatch_command()detects skills mode from_skills_modeflag or.github/skills/presence on diskCLI plumbing
initnow parses--integration-optionsvia_parse_integration_options()and merges intointegration_parsed_options(previously onlyintegration_install/integration_switchdid this)ai_skillsininit-options.jsonis set when_skills_modeis active, so downstream tools (presets, extensions) emit SKILL.md overrides correctlyTests
22 new tests in
TestCopilotSkillsModecovering: directory structure, no.prompt.md/.vscode/settings.jsonin skills mode, frontmatter structure withmode:field,post_process_skill_content()idempotency, manifest tracking, install/uninstall roundtrip,build_command_invocation()in both modes, full CLI integration, and complete file inventory. All 15 existing default-mode tests unchanged.