feat(playbook): add no_backup deploy controls

remove obsolete main_language placeholders and language summary template text

limit generated .agents guidance to configured langs and normalize AGENT_RULES trailing newlines

document install_skills no_backup behavior and refresh tests for deployment links and sync flows
This commit is contained in:
csh
2026-04-24 10:06:03 +08:00
parent 8609d59d4a
commit a2e3cb07de
12 changed files with 138 additions and 90 deletions
+30
View File
@@ -74,6 +74,36 @@ no_backup = true
git_backups = list(root.glob(".gitattributes.bak.*"))
self.assertEqual(git_backups, [])
def test_install_skills_no_backup_replaces_existing_skill_without_backup(self):
with tempfile.TemporaryDirectory() as tmp_dir:
root = Path(tmp_dir)
skills_root = root / "agents" / "skills"
existing = skills_root / "brainstorming"
existing.mkdir(parents=True)
(existing / "stale.txt").write_text("old", encoding="utf-8")
config_body = f"""
[playbook]
project_root = "{tmp_dir}"
deploy_root = "{DEFAULT_DEPLOY_ROOT}"
[install_skills]
agents_home = "{root / 'agents'}"
mode = "list"
skills = ["brainstorming"]
no_backup = true
"""
config_path = root / "playbook.toml"
config_path.write_text(config_body, encoding="utf-8")
result = run_cli("-config", str(config_path))
self.assertEqual(result.returncode, 0, msg=result.stderr)
backups = list(skills_root.glob("brainstorming.bak.*"))
self.assertEqual(backups, [])
self.assertFalse((existing / "stale.txt").exists())
self.assertTrue((existing / "SKILL.md").is_file())
if __name__ == "__main__":
unittest.main()