feat(sync): add templates and standards actions

This commit is contained in:
csh
2026-01-23 14:37:55 +08:00
parent 49bbfa13e4
commit 3d1582ce9e
2 changed files with 455 additions and 1 deletions
+36
View File
@@ -65,5 +65,41 @@ langs = ["tsl"]
self.assertEqual(result.returncode, 0)
self.assertTrue(snapshot.is_file())
def test_sync_templates_creates_memory_bank(self):
with tempfile.TemporaryDirectory() as tmp_dir:
config_body = f"""
[playbook]
project_root = "{tmp_dir}"
[sync_templates]
project_name = "Demo"
"""
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(config_body, encoding="utf-8")
result = run_cli("-config", str(config_path))
memory_bank = Path(tmp_dir) / "memory-bank/project-brief.md"
self.assertEqual(result.returncode, 0)
self.assertTrue(memory_bank.is_file())
def test_sync_standards_creates_agents(self):
with tempfile.TemporaryDirectory() as tmp_dir:
config_body = f"""
[playbook]
project_root = "{tmp_dir}"
[sync_standards]
langs = ["tsl"]
"""
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(config_body, encoding="utf-8")
result = run_cli("-config", str(config_path))
agents_index = Path(tmp_dir) / ".agents/tsl/index.md"
self.assertEqual(result.returncode, 0)
self.assertTrue(agents_index.is_file())
if __name__ == "__main__":
unittest.main()