@@ -430,9 +430,12 @@ def test_skills_install_for_all_agents(self, temp_dir, agent_key):
430430
431431 # Place .md templates in the agent's commands directory
432432 agent_folder = AGENT_CONFIG [agent_key ]["folder" ]
433- cmds_dir = proj / agent_folder .rstrip ("/" ) / "commands"
433+ commands_subdir = AGENT_CONFIG [agent_key ].get ("commands_subdir" , "commands" )
434+ cmds_dir = proj / agent_folder .rstrip ("/" ) / commands_subdir
434435 cmds_dir .mkdir (parents = True )
435- (cmds_dir / "specify.md" ).write_text (
436+ # Copilot filters for speckit.*.md; other agents use plain names
437+ fname = "speckit.specify.md" if agent_key == "copilot" else "specify.md"
438+ (cmds_dir / fname ).write_text (
436439 "---\n description: Test command\n ---\n \n # Test\n \n Body.\n "
437440 )
438441
@@ -448,6 +451,26 @@ def test_skills_install_for_all_agents(self, temp_dir, agent_key):
448451 assert expected_skill_name in skill_dirs
449452 assert (skills_dir / expected_skill_name / "SKILL.md" ).exists ()
450453
454+ def test_copilot_ignores_non_speckit_agents (self , project_dir ):
455+ """Non-speckit markdown in .github/agents/ must not produce skills."""
456+ agents_dir = project_dir / ".github" / "agents"
457+ agents_dir .mkdir (parents = True , exist_ok = True )
458+ (agents_dir / "speckit.plan.md" ).write_text (
459+ "---\n description: Generate implementation plan.\n ---\n \n # Plan\n \n Body.\n "
460+ )
461+ (agents_dir / "other-agent.agent.md" ).write_text (
462+ "---\n description: Some other agent\n ---\n \n # Other\n \n Body.\n "
463+ )
464+
465+ result = install_ai_skills (project_dir , "copilot" )
466+
467+ assert result is True
468+ skills_dir = project_dir / ".github" / "skills"
469+ assert skills_dir .exists ()
470+ skill_dirs = [d .name for d in skills_dir .iterdir () if d .is_dir ()]
471+ assert "speckit-plan" in skill_dirs
472+ assert "speckit-other-agent.agent" not in skill_dirs
473+
451474
452475
453476class TestCommandCoexistence :
0 commit comments