迁移setup-engine工作流
This commit is contained in:
@@ -6,6 +6,7 @@ from __future__ import annotations
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -14,12 +15,86 @@ FORBIDDEN_NAMES = {".DS_Store", ".env", "plan.md"}
|
||||
FORBIDDEN_PARTS = {".git", "__pycache__"}
|
||||
EXPECTED_SKILLS = {
|
||||
"brainstorm",
|
||||
"setup-engine",
|
||||
}
|
||||
REQUIRED_RUNTIME_AGENTS = {
|
||||
"art-director.toml",
|
||||
"creative-director.toml",
|
||||
"godot-csharp-specialist.toml",
|
||||
"godot-gdextension-specialist.toml",
|
||||
"godot-gdscript-specialist.toml",
|
||||
"godot-shader-specialist.toml",
|
||||
"godot-specialist.toml",
|
||||
"producer.toml",
|
||||
"technical-director.toml",
|
||||
"ue-blueprint-specialist.toml",
|
||||
"ue-gas-specialist.toml",
|
||||
"ue-replication-specialist.toml",
|
||||
"ue-umg-specialist.toml",
|
||||
"unity-addressables-specialist.toml",
|
||||
"unity-dots-specialist.toml",
|
||||
"unity-shader-specialist.toml",
|
||||
"unity-specialist.toml",
|
||||
"unity-ui-specialist.toml",
|
||||
"unreal-specialist.toml",
|
||||
}
|
||||
DIRECTOR_RUNTIME_AGENTS = {
|
||||
"art-director.toml",
|
||||
"creative-director.toml",
|
||||
"producer.toml",
|
||||
"technical-director.toml",
|
||||
}
|
||||
EXPECTED_ENGINES = {
|
||||
"godot",
|
||||
"unity",
|
||||
"unreal",
|
||||
}
|
||||
REQUIRED_ENGINE_REFERENCE_FILES = {
|
||||
"VERSION.md",
|
||||
"breaking-changes.md",
|
||||
"current-best-practices.md",
|
||||
"deprecated-apis.md",
|
||||
}
|
||||
FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS = {
|
||||
"$architecture-decision",
|
||||
"$architecture-review",
|
||||
"$code-review",
|
||||
"$design-system",
|
||||
"$dev-story",
|
||||
"$map-systems",
|
||||
"$propagate-design-change",
|
||||
"$prototype",
|
||||
"$sprint-plan",
|
||||
"$team-ui",
|
||||
"$test-setup",
|
||||
"$ux-design",
|
||||
"$ux-review",
|
||||
"/gate-check",
|
||||
}
|
||||
FORBIDDEN_UNAVAILABLE_ROLE_REFS = {
|
||||
"accessibility-specialist",
|
||||
"audio-director",
|
||||
"devops-engineer",
|
||||
"engine-programmer",
|
||||
"game-designer",
|
||||
"gameplay-programmer",
|
||||
"lead-programmer",
|
||||
"level-designer",
|
||||
"localization-lead",
|
||||
"network-programmer",
|
||||
"performance-analyst",
|
||||
"prototyper",
|
||||
"qa-lead",
|
||||
"qa-tester",
|
||||
"security-engineer",
|
||||
"sound-designer",
|
||||
"systems-designer",
|
||||
"technical-artist",
|
||||
"tools-programmer",
|
||||
"ui-programmer",
|
||||
"ux-designer",
|
||||
"world-builder",
|
||||
"writer",
|
||||
}
|
||||
|
||||
|
||||
@@ -60,10 +135,13 @@ def assert_manifest() -> None:
|
||||
def assert_skill(skill_name: str) -> None:
|
||||
skill_dir = ROOT / "skills" / skill_name
|
||||
skill_path = skill_dir / "SKILL.md"
|
||||
details_path = skill_dir / "DETAILS.md"
|
||||
agent_path = skill_dir / "agents" / "openai.yaml"
|
||||
|
||||
if not skill_path.is_file():
|
||||
fail(f"Missing skill file: {skill_path.relative_to(ROOT)}")
|
||||
if not details_path.is_file():
|
||||
fail(f"Missing skill details file: {details_path.relative_to(ROOT)}")
|
||||
if not agent_path.is_file():
|
||||
fail(f"Missing skill UI metadata: {agent_path.relative_to(ROOT)}")
|
||||
|
||||
@@ -100,11 +178,43 @@ def assert_runtime_agents() -> None:
|
||||
if missing:
|
||||
fail(f"Missing runtime agents: {', '.join(missing)}")
|
||||
|
||||
for agent_name in sorted(REQUIRED_RUNTIME_AGENTS):
|
||||
text = (agent_dir / agent_name).read_text(encoding="utf-8")
|
||||
try:
|
||||
parsed = tomllib.loads(text)
|
||||
except tomllib.TOMLDecodeError as error:
|
||||
fail(f"{agent_name} is not valid TOML: {error}")
|
||||
for field_name in ["name", "description", "developer_instructions"]:
|
||||
if field_name not in parsed:
|
||||
fail(f"{agent_name} missing TOML field: {field_name}")
|
||||
if "specialist" in agent_name and "Version Awareness" not in text:
|
||||
fail(f"{agent_name} missing Version Awareness instructions")
|
||||
|
||||
forbidden_roles = sorted(
|
||||
role for role in FORBIDDEN_UNAVAILABLE_ROLE_REFS if role in text
|
||||
)
|
||||
if agent_name not in DIRECTOR_RUNTIME_AGENTS and forbidden_roles:
|
||||
fail(
|
||||
f"{agent_name} references unavailable role agents: "
|
||||
+ ", ".join(forbidden_roles)
|
||||
)
|
||||
forbidden_workflows = sorted(
|
||||
ref for ref in FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS if ref in text
|
||||
)
|
||||
if agent_name not in DIRECTOR_RUNTIME_AGENTS and forbidden_workflows:
|
||||
fail(
|
||||
f"{agent_name} references unavailable workflows: "
|
||||
+ ", ".join(forbidden_workflows)
|
||||
)
|
||||
|
||||
|
||||
def assert_project_template() -> None:
|
||||
template_path = ROOT / "project-template" / "AGENTS.md"
|
||||
tech_template_path = ROOT / "project-template" / "technical-preferences.md"
|
||||
if not template_path.is_file():
|
||||
fail("Missing project-template/AGENTS.md")
|
||||
if not tech_template_path.is_file():
|
||||
fail("Missing project-template/technical-preferences.md")
|
||||
|
||||
text = template_path.read_text(encoding="utf-8")
|
||||
required_fragments = [
|
||||
@@ -113,10 +223,119 @@ def assert_project_template() -> None:
|
||||
".codex/agents/",
|
||||
"design/gdd/game-concept.md",
|
||||
"design/gdd/game-pillars.md",
|
||||
"docs/technical-preferences.md",
|
||||
"docs/engine-reference/<engine>/VERSION.md",
|
||||
"$setup-engine",
|
||||
]
|
||||
for fragment in required_fragments:
|
||||
if fragment not in text:
|
||||
fail(f"project-template/AGENTS.md missing required content: {fragment}")
|
||||
legacy_import = "@." + "cla" + "ude"
|
||||
for fragment in [legacy_import, "coordination-rules", "coding-standards"]:
|
||||
if fragment in text:
|
||||
fail(f"project-template/AGENTS.md contains unavailable global import: {fragment}")
|
||||
forbidden_workflows = sorted(
|
||||
ref for ref in FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS if ref in text
|
||||
)
|
||||
if forbidden_workflows:
|
||||
fail(
|
||||
"project-template/AGENTS.md references unavailable workflows: "
|
||||
+ ", ".join(forbidden_workflows)
|
||||
)
|
||||
|
||||
tech_text = tech_template_path.read_text(encoding="utf-8")
|
||||
required_tech_fragments = [
|
||||
"# Technical Preferences",
|
||||
"## Engine & Language",
|
||||
"## Input & Platform",
|
||||
"## Engine Specialists",
|
||||
"File Extension Routing",
|
||||
]
|
||||
for fragment in required_tech_fragments:
|
||||
if fragment not in tech_text:
|
||||
fail(
|
||||
"project-template/technical-preferences.md missing required "
|
||||
f"content: {fragment}"
|
||||
)
|
||||
forbidden_tech_workflows = sorted(
|
||||
ref for ref in FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS if ref in tech_text
|
||||
)
|
||||
if forbidden_tech_workflows:
|
||||
fail(
|
||||
"project-template/technical-preferences.md references unavailable "
|
||||
"workflows: " + ", ".join(forbidden_tech_workflows)
|
||||
)
|
||||
|
||||
setup_details = ROOT / "skills" / "setup-engine" / "DETAILS.md"
|
||||
if setup_details.is_file():
|
||||
setup_text = setup_details.read_text(encoding="utf-8")
|
||||
required_setup_fragments = [
|
||||
"technical utility skill",
|
||||
"has no director gates",
|
||||
"Existing Configuration Check",
|
||||
"Specific section only",
|
||||
"May I write these changes to `docs/technical-preferences.md`?",
|
||||
"Rendering and Physics",
|
||||
"Verdict: COMPLETE",
|
||||
]
|
||||
for fragment in required_setup_fragments:
|
||||
if fragment not in setup_text:
|
||||
fail(
|
||||
"skills/setup-engine/DETAILS.md missing setup-engine "
|
||||
f"behavior: {fragment}"
|
||||
)
|
||||
forbidden_setup_workflows = sorted(
|
||||
ref for ref in FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS if ref in setup_text
|
||||
)
|
||||
if forbidden_setup_workflows:
|
||||
fail(
|
||||
"skills/setup-engine/DETAILS.md references unavailable workflows: "
|
||||
+ ", ".join(forbidden_setup_workflows)
|
||||
)
|
||||
|
||||
|
||||
def assert_engine_references() -> None:
|
||||
reference_root = ROOT / "references" / "engine-reference"
|
||||
if not reference_root.is_dir():
|
||||
fail("Missing references/engine-reference directory")
|
||||
|
||||
present = {path.name for path in reference_root.iterdir() if path.is_dir()}
|
||||
missing_engines = sorted(EXPECTED_ENGINES - present)
|
||||
if missing_engines:
|
||||
fail(f"Missing engine reference baselines: {', '.join(missing_engines)}")
|
||||
|
||||
for engine in sorted(EXPECTED_ENGINES):
|
||||
engine_dir = reference_root / engine
|
||||
missing_files = sorted(
|
||||
file_name
|
||||
for file_name in REQUIRED_ENGINE_REFERENCE_FILES
|
||||
if not (engine_dir / file_name).is_file()
|
||||
)
|
||||
if missing_files:
|
||||
fail(
|
||||
f"Missing {engine} reference files: "
|
||||
+ ", ".join(missing_files)
|
||||
)
|
||||
if not (engine_dir / "modules").is_dir():
|
||||
fail(f"Missing {engine} reference modules directory")
|
||||
|
||||
technical_template = (
|
||||
ROOT / "references" / "studio-docs" / "templates" / "technical-preferences.md"
|
||||
)
|
||||
if not technical_template.is_file():
|
||||
fail("Missing references/studio-docs/templates/technical-preferences.md")
|
||||
technical_template_text = technical_template.read_text(encoding="utf-8")
|
||||
forbidden_template_workflows = sorted(
|
||||
ref
|
||||
for ref in FORBIDDEN_UNAVAILABLE_WORKFLOW_REFS
|
||||
if ref in technical_template_text
|
||||
)
|
||||
if forbidden_template_workflows:
|
||||
fail(
|
||||
"references/studio-docs/templates/technical-preferences.md "
|
||||
"references unavailable workflows: "
|
||||
+ ", ".join(forbidden_template_workflows)
|
||||
)
|
||||
|
||||
|
||||
def assert_runtime_installer() -> None:
|
||||
@@ -158,6 +377,44 @@ def assert_package_hygiene() -> None:
|
||||
fail("Forbidden package candidates:\n- " + "\n- ".join(sorted(bad)))
|
||||
|
||||
|
||||
def assert_native_codex_language() -> None:
|
||||
try:
|
||||
tracked = run_git(["ls-files"])
|
||||
untracked = run_git(["ls-files", "--others", "--exclude-standard"])
|
||||
candidates = tracked + untracked
|
||||
except RuntimeError:
|
||||
candidates = [
|
||||
str(path.relative_to(ROOT))
|
||||
for path in ROOT.rglob("*")
|
||||
if path.is_file()
|
||||
]
|
||||
|
||||
blocked_terms = [
|
||||
"C" + "laude",
|
||||
"C" + "LAUDE",
|
||||
"." + "cla" + "ude",
|
||||
]
|
||||
bad: list[str] = []
|
||||
for rel_path in candidates:
|
||||
path = ROOT / rel_path
|
||||
if not path.is_file():
|
||||
continue
|
||||
try:
|
||||
text = path.read_text(encoding="utf-8")
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
for term in blocked_terms:
|
||||
if term in text:
|
||||
bad.append(rel_path)
|
||||
break
|
||||
|
||||
if bad:
|
||||
fail(
|
||||
"Files contain non-native Codex terminology:\n- "
|
||||
+ "\n- ".join(sorted(bad))
|
||||
)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
assert_manifest()
|
||||
assert_skill_set()
|
||||
@@ -165,8 +422,10 @@ def main() -> int:
|
||||
assert_skill(skill_name)
|
||||
assert_runtime_agents()
|
||||
assert_project_template()
|
||||
assert_engine_references()
|
||||
assert_runtime_installer()
|
||||
assert_package_hygiene()
|
||||
assert_native_codex_language()
|
||||
print("Codex Game Studios plugin validation passed.")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user