安装项目 AGENTS 指南

This commit is contained in:
wxm
2026-05-18 19:21:55 -07:00
parent 8cd173889c
commit 0c4227cba6
7 changed files with 240 additions and 23 deletions

View File

@@ -101,6 +101,41 @@ def assert_runtime_agents() -> None:
fail(f"Missing runtime agents: {', '.join(missing)}")
def assert_project_template() -> None:
template_path = ROOT / "project-template" / "AGENTS.md"
if not template_path.is_file():
fail("Missing project-template/AGENTS.md")
text = template_path.read_text(encoding="utf-8")
required_fragments = [
"Codex Game Studios Project Guide",
"production/review-mode.txt",
".codex/agents/",
"design/gdd/game-concept.md",
"design/gdd/game-pillars.md",
]
for fragment in required_fragments:
if fragment not in text:
fail(f"project-template/AGENTS.md missing required content: {fragment}")
def assert_runtime_installer() -> None:
installer_path = ROOT / "scripts" / "install_codex_runtime.py"
if not installer_path.is_file():
fail("Missing scripts/install_codex_runtime.py")
text = installer_path.read_text(encoding="utf-8")
required_fragments = [
"PROJECT_AGENTS_TEMPLATE",
"project-template",
"AGENTS.md",
"--force-agents-md",
]
for fragment in required_fragments:
if fragment not in text:
fail(f"install_codex_runtime.py missing required content: {fragment}")
def assert_package_hygiene() -> None:
try:
tracked = run_git(["ls-files"])
@@ -129,6 +164,8 @@ def main() -> int:
for skill_name in sorted(EXPECTED_SKILLS):
assert_skill(skill_name)
assert_runtime_agents()
assert_project_template()
assert_runtime_installer()
assert_package_hygiene()
print("Codex Game Studios plugin validation passed.")
return 0