Skip to content

Commit 73c17d7

Browse files
committed
fixing tests
1 parent b41adeb commit 73c17d7

2 files changed

Lines changed: 24 additions & 73 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,9 @@
33
"version": "0.1.0",
44
"description": "Optimize any text artifact using gepa — prompts, code, configs, skills",
55
"keywords": ["optimization", "gepa", "prompts", "evaluator"],
6-
"author": "optimize-anything contributors",
7-
"commands": [
8-
{
9-
"name": "optimize",
10-
"description": "Run optimization on a seed artifact with an evaluator"
11-
},
12-
{
13-
"name": "generate-evaluator",
14-
"description": "Generate an evaluator script for a text artifact"
15-
},
16-
{
17-
"name": "intake",
18-
"description": "Normalize evaluator intake specification"
19-
},
20-
{
21-
"name": "explain",
22-
"description": "Explain the optimization plan for a seed artifact"
23-
},
24-
{
25-
"name": "budget",
26-
"description": "Recommend evaluation budget for a seed artifact"
27-
},
28-
{
29-
"name": "score",
30-
"description": "Score a single artifact with an evaluator without optimizing"
31-
},
32-
{
33-
"name": "analyze",
34-
"description": "Analyze an artifact to discover quality dimensions for LLM judge optimization"
35-
}
36-
],
37-
"skills": [
38-
{
39-
"name": "generate-evaluator",
40-
"path": "skills/generate-evaluator/SKILL.md",
41-
"description": "Generate an evaluator script for a text artifact, choosing the right scoring pattern for the objective"
42-
},
43-
{
44-
"name": "optimization-guide",
45-
"path": "skills/optimization-guide/SKILL.md",
46-
"description": "Guide for running optimizations with optimize-anything, covering modes, configuration, and interpretation"
47-
}
48-
]
6+
"author": {
7+
"name": "optimize-anything contributors"
8+
},
9+
"repository": "https://github.com/ASRagab/optimize-anything",
10+
"license": "MIT"
4911
}

tests/test_doc_contract.py

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)