|
|
|
@@ -36,11 +36,18 @@ class SyncTemplatesPlaceholdersTests(unittest.TestCase):
|
|
|
|
|
)
|
|
|
|
|
self.assertNotIn("{{MAIN_LANGUAGE}}", templates_readme)
|
|
|
|
|
self.assertNotIn("{{LANGUAGE_1}}", templates_readme)
|
|
|
|
|
self.assertNotIn("docs/workflows/", templates_readme)
|
|
|
|
|
self.assertNotIn("templates/workflows/", templates_readme)
|
|
|
|
|
self.assertIn("docs/superpowers/", templates_readme)
|
|
|
|
|
self.assertIn("docs/prompts/README.md", templates_readme)
|
|
|
|
|
self.assertIn("完整主链只在 `AGENT_RULES.template.md` 定义", templates_readme)
|
|
|
|
|
|
|
|
|
|
agents_template = (ROOT / "templates" / "AGENTS.template.md").read_text(
|
|
|
|
|
encoding="utf-8"
|
|
|
|
|
)
|
|
|
|
|
self.assertNotIn("{{MAIN_LANGUAGE}}", agents_template)
|
|
|
|
|
self.assertIn("AGENT_RULES.md", agents_template)
|
|
|
|
|
self.assertIn("docs/prompts/README.md", agents_template)
|
|
|
|
|
|
|
|
|
|
tech_context_template = (
|
|
|
|
|
ROOT / "templates" / "memory-bank" / "tech-context.template.md"
|
|
|
|
@@ -48,36 +55,91 @@ class SyncTemplatesPlaceholdersTests(unittest.TestCase):
|
|
|
|
|
self.assertNotIn("{{MAIN_LANGUAGE}}", tech_context_template)
|
|
|
|
|
self.assertNotIn("{{LANGUAGE_1}}", tech_context_template)
|
|
|
|
|
self.assertNotIn("**主要语言**", tech_context_template)
|
|
|
|
|
self.assertIn("## 不可假设项", tech_context_template)
|
|
|
|
|
|
|
|
|
|
project_brief_template = (
|
|
|
|
|
ROOT / "templates" / "memory-bank" / "project-brief.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("## 成功定义", project_brief_template)
|
|
|
|
|
|
|
|
|
|
update_memory_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "coding" / "update-memory.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("workflow-state", update_memory_template)
|
|
|
|
|
self.assertIn("plan-status", update_memory_template)
|
|
|
|
|
self.assertIn("## Updated Files", update_memory_template)
|
|
|
|
|
self.assertIn("## New Context", update_memory_template)
|
|
|
|
|
self.assertIn("## Outstanding Risks", update_memory_template)
|
|
|
|
|
self.assertIn("AGENT_RULES.local.md", update_memory_template)
|
|
|
|
|
|
|
|
|
|
close_task_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "coding" / "close-task.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("main_loop.py finish", close_task_template)
|
|
|
|
|
self.assertIn("workflow-state.phase", close_task_template)
|
|
|
|
|
self.assertIn("## Completed", close_task_template)
|
|
|
|
|
self.assertIn("## Not Completed", close_task_template)
|
|
|
|
|
self.assertIn("## Verification", close_task_template)
|
|
|
|
|
self.assertIn("## Risks", close_task_template)
|
|
|
|
|
self.assertIn("## Next Steps", close_task_template)
|
|
|
|
|
|
|
|
|
|
verify_change_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "coding" / "verify-change.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("workflow-state.phase", verify_change_template)
|
|
|
|
|
self.assertIn("plan-status", verify_change_template)
|
|
|
|
|
self.assertIn("## Validated", verify_change_template)
|
|
|
|
|
self.assertIn("## Evidence", verify_change_template)
|
|
|
|
|
self.assertIn("## Not Validated", verify_change_template)
|
|
|
|
|
self.assertIn("## Risks", verify_change_template)
|
|
|
|
|
|
|
|
|
|
clarify_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "coding" / "clarify.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertNotIn("Vibe-coding", clarify_template)
|
|
|
|
|
self.assertIn("## Current Understanding", clarify_template)
|
|
|
|
|
self.assertIn("## Open Question", clarify_template)
|
|
|
|
|
self.assertIn("## Recommended Default", clarify_template)
|
|
|
|
|
|
|
|
|
|
code_review_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "coding" / "code-review.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("## Findings", code_review_template)
|
|
|
|
|
self.assertIn("## Open Questions", code_review_template)
|
|
|
|
|
self.assertIn("## Residual Risk", code_review_template)
|
|
|
|
|
|
|
|
|
|
prompts_readme = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "README.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("playbook.py -record-spec", prompts_readme)
|
|
|
|
|
self.assertIn("playbook.py -record-plan", prompts_readme)
|
|
|
|
|
self.assertIn("AGENT_RULES.md", prompts_readme)
|
|
|
|
|
self.assertIn("docs/superpowers/", prompts_readme)
|
|
|
|
|
self.assertIn("不是流程权威", prompts_readme)
|
|
|
|
|
self.assertNotIn("playbook.py -record-spec", prompts_readme)
|
|
|
|
|
self.assertNotIn("playbook.py -record-plan", prompts_readme)
|
|
|
|
|
self.assertNotIn("using-superpowers", prompts_readme)
|
|
|
|
|
self.assertNotIn("main_loop.py claim", prompts_readme)
|
|
|
|
|
self.assertNotIn("docs/workflows/", prompts_readme)
|
|
|
|
|
self.assertIn("设计与计划产物", prompts_readme)
|
|
|
|
|
|
|
|
|
|
agent_behavior_template = (
|
|
|
|
|
ROOT / "templates" / "prompts" / "system" / "agent-behavior.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("playbook.py -record-spec", agent_behavior_template)
|
|
|
|
|
self.assertIn("playbook.py -record-plan", agent_behavior_template)
|
|
|
|
|
self.assertIn("AGENT_RULES.md", agent_behavior_template)
|
|
|
|
|
self.assertIn("AGENT_RULES.local.md", agent_behavior_template)
|
|
|
|
|
self.assertIn("docs/superpowers/specs/", agent_behavior_template)
|
|
|
|
|
self.assertIn("docs/superpowers/plans/", agent_behavior_template)
|
|
|
|
|
self.assertNotIn("using-superpowers", agent_behavior_template)
|
|
|
|
|
self.assertNotIn("main_loop.py claim", agent_behavior_template)
|
|
|
|
|
self.assertNotIn("playbook.py -record-spec", agent_behavior_template)
|
|
|
|
|
self.assertNotIn("playbook.py -record-plan", agent_behavior_template)
|
|
|
|
|
self.assertIn("项目上下文与执行状态写入 `memory-bank/`", agent_behavior_template)
|
|
|
|
|
|
|
|
|
|
rules_template = (
|
|
|
|
|
ROOT / "templates" / "AGENT_RULES.template.md"
|
|
|
|
|
).read_text(encoding="utf-8")
|
|
|
|
|
self.assertIn("唯一流程约束中心", rules_template)
|
|
|
|
|
self.assertIn("唯一设计与计划产物中心", rules_template)
|
|
|
|
|
self.assertIn("memory-bank/progress.md", rules_template)
|
|
|
|
|
|
|
|
|
|
def test_sync_templates_replaces_playbook_scripts_without_main_language_support(self):
|
|
|
|
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
|
|
|