feat(skills): add tsl syntax reference skill

This commit is contained in:
csh
2026-07-13 09:16:51 +08:00
parent 1a9a1aeee9
commit ce1b92bbde
42 changed files with 562 additions and 461 deletions
+27 -1
View File
@@ -34,7 +34,8 @@ class InstallSkillsTests(unittest.TestCase):
agents_index = (root / ".agents" / "tsl" / "index.md").read_text(
encoding="utf-8"
)
self.assertIn(f"`{docs_prefix}/tsl/index.md`", agents_index)
self.assertIn("`tsl-syntax-reference`", agents_index)
self.assertIn("`tsl-api-reference`", agents_index)
self.assertNotIn("`docs/tsl/index.md`", agents_index)
skill_file = (agents_home / "skills" / "style-cleanup" / "SKILL.md").read_text(
@@ -90,6 +91,31 @@ skills = ["karpathy-guidelines"]
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
self.assertTrue(skill_file.is_file())
def test_install_skills_installs_tsl_syntax_reference(self):
with tempfile.TemporaryDirectory() as tmp_dir:
target = Path(tmp_dir) / "agents"
config_body = f"""
[playbook]
project_root = "{tmp_dir}"
playbook_root = "{CUSTOM_DEPLOY_ROOT}"
install_mode = "snapshot"
[install_skills]
agents_home = "{target}"
mode = "list"
skills = ["tsl-syntax-reference"]
"""
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(config_body, encoding="utf-8")
result = run_cli("-config", str(config_path))
skill = target / "skills" / "tsl-syntax-reference"
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
self.assertTrue((skill / "SKILL.md").is_file())
self.assertTrue((skill / "agents" / "openai.yaml").is_file())
self.assertTrue((skill / "references" / "index.md").is_file())
def test_install_skills_rejects_removed_tsl_guide(self):
with tempfile.TemporaryDirectory() as tmp_dir:
target = Path(tmp_dir) / "agents"