Skip to content

Commit cdb7ed8

Browse files
committed
Step: Implement dynamic structural testing for commands and agents.
1 parent cb3f34f commit cdb7ed8

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

TASKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Put done tasks into the Archive.
1818

1919
## Active Tasks
2020

21-
- [ ] Implement dynamic structural testing suite and finalize documentation sync. (See plan: plans/implement-maintenance-v2.md)
21+
- [/] Implement dynamic structural testing suite and finalize documentation sync. (@apiad) (See plan: plans/implement-maintenance-v2.md)
2222

2323
---
2424

journal/2026-03-23.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
[2026-03-23T07:10:07] - Perform maintenance audit and generate implementation plan for documentation harmonization.
1515
[2026-03-23T07:14:22] - Harmonize documentation, refactor tests with dynamic sync, and integrate uv/pytest.
1616
[2026-03-23T07:22:14] - Commit maintenance v2 plan and research before starting work.
17+
[2026-03-23T07:22:48] - Implement dynamic structural testing suite for all commands and agents.

tests/test_structure.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import os
2+
import tomllib
3+
import pytest
4+
5+
def get_commands():
6+
path = ".gemini/commands/"
7+
return [os.path.join(path, f) for f in os.listdir(path) if f.endswith(".toml")]
8+
9+
def get_agents():
10+
path = ".gemini/agents/"
11+
return [os.path.join(path, f) for f in os.listdir(path) if f.endswith(".md")]
12+
13+
@pytest.mark.parametrize("cmd_path", get_commands())
14+
def test_command_structure(cmd_path):
15+
with open(cmd_path, "rb") as f:
16+
config = tomllib.load(f)
17+
18+
assert "description" in config
19+
assert isinstance(config["description"], str)
20+
assert len(config["description"].strip()) > 0
21+
22+
assert "prompt" in config
23+
assert isinstance(config["prompt"], str)
24+
assert len(config["prompt"].strip()) > 0
25+
26+
@pytest.mark.parametrize("agent_path", get_agents())
27+
def test_agent_structure(agent_path):
28+
agent_name = os.path.basename(agent_path).replace(".md", "")
29+
with open(agent_path, "r") as f:
30+
content = f.read()
31+
32+
# Check for name in content (case-insensitive)
33+
assert agent_name.lower() in content.lower()
34+
35+
# Check for some basic structure (e.g. name: or # Title)
36+
assert f"name: {agent_name}" in content.lower() or f"# {agent_name}" in content.lower()

0 commit comments

Comments
 (0)