feat(playbook): add plan progress tracking and rules updates

This commit is contained in:
csh
2026-01-26 16:51:23 +08:00
parent 6efd637119
commit 278750e3c9
23 changed files with 919 additions and 275 deletions
+42
View File
@@ -0,0 +1,42 @@
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SKILLS_MD = ROOT / "SKILLS.md"
SOURCES_LIST = ROOT / "codex" / "skills" / ".sources" / "superpowers.list"
def read_sources_list() -> list[str]:
return [
line.strip()
for line in SOURCES_LIST.read_text(encoding="utf-8").splitlines()
if line.strip() and not line.strip().startswith("#")
]
def read_skills_md_list() -> list[str]:
lines = SKILLS_MD.read_text(encoding="utf-8").splitlines()
start = "<!-- superpowers:skills:start -->"
end = "<!-- superpowers:skills:end -->"
try:
start_idx = lines.index(start) + 1
end_idx = lines.index(end)
except ValueError as exc:
raise AssertionError("superpowers markers missing in SKILLS.md") from exc
items = []
for line in lines[start_idx:end_idx]:
stripped = line.strip()
if not stripped.startswith("-"):
continue
items.append(stripped.lstrip("- ").strip())
return items
class SuperpowersListSyncTests(unittest.TestCase):
def test_superpowers_list_matches_skills_md(self):
self.assertEqual(read_sources_list(), read_skills_md_list())
if __name__ == "__main__":
unittest.main()