-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Description
Bug Description
install_ai_skills creates spurious skills from non-speckit agent files when using --ai copilot --ai-skills
Summary
When running specify init --here --ai copilot --ai-skills in a project that already has custom (non-speckit) agent files in .github/agents/, the install_ai_skills() function treats every .md file in that directory as a spec-kit command template - not just the speckit.* ones. This produces unexpected skill directories for user-authored agents that have nothing to do with spec-kit.
Root Cause
In src/specify_cli/__init__.py, AGENT_CONFIG defines the copilot entry as:
"copilot": {
"folder": ".github/",
"commands_subdir": "agents", # ← shared user directory
}For every other agent type, commands_subdir points to a dedicated directory (e.g. "commands"). For copilot, it points to .github/agents/ - the same directory that holds both spec-kit command agents and user-authored agents.
install_ai_skills() then performs an unfiltered glob:
templates_dir = project_path / agent_folder / commands_subdir # resolves to .github/agents/
command_files = sorted(templates_dir.glob("*.md")) # picks up ALL .md filesEvery .md file in .github/agents/ becomes a skill candidate, regardless of whether it is a spec-kit command or a user-authored agent.
Steps to Reproduce
Steps to Reproduce
-
Create a fresh spec-kit copilot project:
mkdir /tmp/repro && cd /tmp/repro specify init --here --ai copilot --ai-skills
-
Add a custom (non-speckit) agent file alongside the generated speckit ones:
cat > .github/agents/my-custom-agent.agent.md << 'EOF' --- name: my-custom-agent description: "A user-authored agent unrelated to spec-kit" --- You are a custom agent. EOF
-
Simulate a re-init / upgrade
specify init --here --ai copilot --ai-skills
-
Inspect the generated skills directory:
ls .github/skills/
Expected Behavior
Only speckit-analyze/, speckit-checklist/, etc. (the standard spec-kit commands).
Actual Behavior
Also creates speckit-my-custom-agent.agent/SKILL.md - a skill wrapper for the user's custom agent, with author: github-spec-kit falsely attributed in the frontmatter.
Specify CLI Version
0.3.0
AI Agent
Claude Code
Operating System
Ubuntu (WSL2) / Windows 11
Python Version
3.12.3
Error Logs
Additional Context
