Skip to content

fix(ai-skills): exclude non-speckit copilot agent markdown from skill…#1867

Open
darkglow-net wants to merge 7 commits intogithub:mainfrom
darkglow-net:fix/copilot-ai-skills-filter
Open

fix(ai-skills): exclude non-speckit copilot agent markdown from skill…#1867
darkglow-net wants to merge 7 commits intogithub:mainfrom
darkglow-net:fix/copilot-ai-skills-filter

Conversation

@darkglow-net
Copy link

Description

Fix issue #1858 - install_ai_skills creates spurious skills from non-speckit agent files when using --ai copilot --ai-skills

Fix: install_ai_skills() now filters copilot command templates to speckit.*.md - preventing user-authored agent files in agents from being incorrectly converted into skills.
Other agents are unaffected since their commands_subdir directories contain only speckit templates.

Test: Adds test_copilot_ignores_non_speckit_agents to verify that non-speckit markdown files (e.g. other-agent.agent.md) in the shared agents directory are excluded from skill generation.

Testing

  1. Create dummy agent in .github/agents/
  2. specify init --ai copilot --ai-skills --here
  3. Confirm no misattributed non-speckit skills created in .github/skills/
image

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

RCA and remediation developed with Github Copilot. Code review conducted with Opus 4.6.

@darkglow-net darkglow-net requested a review from mnriem as a code owner March 16, 2026 15:25
Copilot AI review requested due to automatic review settings March 16, 2026 15:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes #1858 by preventing install_ai_skills() from generating skills from non–spec-kit GitHub Copilot agent markdown files that may coexist in .github/agents/.

Changes:

  • Update install_ai_skills() to filter Copilot templates to speckit.*.md.
  • Update the all-agents skills installation test to respect commands_subdir and adjust Copilot’s template filename.
  • Add a new test ensuring non-speckit Copilot agent markdown files are ignored during skill generation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/specify_cli/__init__.py Adds Copilot-specific template globbing to avoid converting unrelated .md files into skills.
tests/test_ai_skills.py Updates fixture setup to follow commands_subdir and adds coverage for ignoring non-speckit Copilot agent files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable please explain why

Fix missing `.agent` filename suffix

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 17, 2026 00:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes issue #1858 where install_ai_skills (for --ai copilot --ai-skills) incorrectly converts non–spec-kit Markdown files in .github/agents/ into generated skills.

Changes:

  • Filter Copilot command templates during skill installation to only include speckit.*.md files.
  • Update the “all agents” skills install test to respect commands_subdir and add a Copilot-specific regression test to ignore non-speckit agent Markdown.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/specify_cli/__init__.py Adds Copilot-only template glob filtering (speckit.*.md) during skill generation.
tests/test_ai_skills.py Updates multi-agent install test to use commands_subdir; adds regression test ensuring non-speckit Copilot agent Markdown doesn’t generate skills.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 17, 2026 01:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes issue #1858 where install_ai_skills incorrectly generated skills from user-authored (non–spec-kit) Copilot agent markdown files under .github/agents/.

Changes:

  • Filter Copilot skill generation inputs to speckit.*.md templates only.
  • Update the cross-agent skills installation test to respect each agent’s commands_subdir.
  • Add a regression test ensuring non-speckit.* Copilot agent markdown files are ignored.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/specify_cli/__init__.py Adds Copilot-specific glob filtering so only speckit.*.md templates in .github/agents/ are considered for skill generation.
tests/test_ai_skills.py Updates the parametrized test to use commands_subdir and adds a Copilot regression test for ignoring non-speckit agent markdown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fix(ai-skills): normalize Copilot .agent template names and align template fallback filtering
Copilot AI review requested due to automatic review settings March 17, 2026 04:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes issue #1858 where install_ai_skills incorrectly generated skills from non–spec-kit Copilot agent markdown files found in .github/agents/ when using --ai copilot --ai-skills.

Changes:

  • Restricts Copilot skill-template discovery to speckit.*.md to avoid treating user-authored agent markdown as spec-kit command templates.
  • Normalizes Copilot-derived command names by stripping the speckit. prefix and any trailing .agent suffix for consistent skill naming/description lookup.
  • Adds a regression test to ensure non-speckit markdown files in .github/agents/ do not produce skills.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/specify_cli/__init__.py Filters Copilot template glob and normalizes .agent-style filenames so only spec-kit templates generate skills.
tests/test_ai_skills.py Updates agent-wide skill install test to respect per-agent commands_subdir and adds a Copilot-specific regression test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Clarify comment regarding Copilot's use of templates in tests.
Add extra test assertion
@darkglow-net
Copy link
Author

It was fun getting the opportunity to contribute to this project. I've made the corrections and re-run all tests.
Confirmed specify init --here --ai copilot --ai-skills is no longer creatign misattributed skill files from non-speckit agents.

@darkglow-net darkglow-net requested a review from mnriem March 17, 2026 04: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.

3 participants