@@ -116,35 +116,24 @@ def test_manifest_has_required_fields(self):
116116 for field in ("name" , "version" , "description" ):
117117 assert field in data , f"plugin.json missing '{ field } '"
118118
119- def test_manifest_has_commands_array (self ):
120- data = _plugin_json ()
121- assert "commands" in data
122- assert isinstance (data ["commands" ], list )
123- assert len (data ["commands" ]) > 0
124-
125- def test_manifest_has_skills_array (self ):
126- data = _plugin_json ()
127- assert "skills" in data
128- assert isinstance (data ["skills" ], list )
129- assert len (data ["skills" ]) > 0
130-
131- def test_each_command_has_name_and_description (self ):
132- for cmd in _plugin_json ()["commands" ]:
133- assert "name" in cmd , f"Command missing 'name': { cmd } "
134- assert "description" in cmd , f"Command missing 'description': { cmd } "
135-
136- def test_each_skill_has_name_path_and_description (self ):
137- data = _plugin_json ()
138- for skill in data ["skills" ]:
139- assert "name" in skill , f"Skill missing 'name': { skill } "
140- assert "path" in skill , f"Skill missing 'path': { skill } "
141- assert "description" in skill , f"Skill missing 'description': { skill } "
142- skill_path = REPO_ROOT / skill ["path" ]
143- assert skill_path .exists (), f"Skill file not found: { skill_path } "
144-
145- def test_known_commands_present (self ):
146- command_names = {cmd ["name" ] for cmd in _plugin_json ()["commands" ]}
119+ def test_commands_directory_has_expected_files (self ):
120+ """Auto-discovery finds commands from the commands/ directory."""
121+ commands_dir = REPO_ROOT / "commands"
122+ assert commands_dir .is_dir (), "commands/ directory missing"
123+ command_files = {p .stem for p in commands_dir .glob ("*.md" )}
147124 expected = {"optimize" , "generate-evaluator" , "intake" , "explain" , "budget" , "score" , "analyze" }
148- assert expected .issubset (command_names ), (
149- f"Missing commands in manifest: { expected - command_names } "
125+ assert expected .issubset (command_files ), (
126+ f"Missing command files: { expected - command_files } "
127+ )
128+
129+ def test_skills_directory_has_expected_entries (self ):
130+ """Auto-discovery finds skills from skills/*/SKILL.md."""
131+ skills_dir = REPO_ROOT / "skills"
132+ assert skills_dir .is_dir (), "skills/ directory missing"
133+ skill_dirs = {
134+ p .parent .name for p in skills_dir .glob ("*/SKILL.md" )
135+ }
136+ expected = {"generate-evaluator" , "optimization-guide" }
137+ assert expected .issubset (skill_dirs ), (
138+ f"Missing skill directories: { expected - skill_dirs } "
150139 )
0 commit comments