对齐参考仓库移除临时技能

This commit is contained in:
wxm
2026-05-19 00:35:54 +08:00
parent 06799561ab
commit 8cd173889c
11 changed files with 32 additions and 82 deletions

View File

@@ -20,9 +20,10 @@ When this skill is invoked:
Director agent source files live in `../../runtime/agents/`. Before running
any `full` review-mode gate, verify the target project has the matching
`.codex/agents/<agent-name>.toml` files installed. If they are missing, run
`$setup-runtime` for the project first. When a gate is active, spawn the
named Codex custom agent; do not recreate the director role by pasting
profile text into a generic default agent.
`python3 scripts/install_codex_runtime.py <target-project>` from the plugin
root first. When a gate is active, spawn the named Codex custom agent; do not
recreate the director role by pasting profile text into a generic default
agent.
2. **Check for existing concept work**:
- Read `design/gdd/game-concept.md` if it exists (resume, don't restart)

View File

@@ -9,7 +9,7 @@ Run the Codex Game Studios brainstorm workflow.
Before acting, read `DETAILS.md` for the full workflow. Apply project guidance from `AGENTS.md` and use `../../standards/` for path-specific standards.
Director gates use the bundled custom agents from `../../runtime/agents/`. If the current project does not already have those agents installed in `.codex/agents/`, run `$setup-runtime` first.
Director gates use the bundled custom agents from `../../runtime/agents/`. If the current project does not already have those agents installed in `.codex/agents/`, run `python3 scripts/install_codex_runtime.py <target-project>` from the plugin root first.
Review mode controls review-gate intensity, not all custom-agent usage:
`full` runs key director/lead gates, `lean` runs only PHASE-GATE checks such as

View File

@@ -1,23 +0,0 @@
---
name: setup-runtime
description: "Use when a user asks to initialize, install, or refresh the Codex Game Studios runtime in a game project. Installs bundled director custom agents into the target project's .codex/agents directory."
---
# Setup Runtime
Install the Codex Game Studios runtime assets into the current game project.
## Workflow
1. Treat the current working directory as the target project unless the user names another path.
2. Run `scripts/install_codex_runtime.py <target-project>`.
3. Report installed, unchanged, and conflicting agent files.
4. If conflicts are reported, do not overwrite them unless the user explicitly asks for `--force`.
The installer copies runtime agents from the plugin's `runtime/agents/` directory to:
```text
<target-project>/.codex/agents/
```
The runtime currently contains only Codex custom-agent TOML files. It does not install hooks, rules, MCP servers, apps, or project templates.

View File

@@ -1,4 +0,0 @@
interface:
display_name: "Setup Runtime"
short_description: "Install game-studio agents into a project"
default_prompt: "Use $setup-runtime to initialize this game project."

View File

@@ -1,159 +0,0 @@
#!/usr/bin/env python3
"""Install Codex Game Studios runtime files into a game project.
Current runtime scope:
- Copy bundled Codex custom agents from this plugin's `runtime/agents/`
directory into the target project's `.codex/agents/` directory.
This installer intentionally does not install hooks, rules, MCP servers, apps,
or AGENTS.md templates yet.
"""
from __future__ import annotations
import argparse
import filecmp
import shutil
import sys
from dataclasses import dataclass
from pathlib import Path
def find_plugin_root(start: Path) -> Path:
"""Walk upward until the Codex plugin manifest is found."""
for candidate in [start, *start.parents]:
if (candidate / ".codex-plugin" / "plugin.json").is_file():
return candidate
raise FileNotFoundError(
f"Could not find .codex-plugin/plugin.json above: {start}"
)
PLUGIN_ROOT = find_plugin_root(Path(__file__).resolve())
SOURCE_AGENTS_DIR = PLUGIN_ROOT / "runtime" / "agents"
@dataclass(frozen=True)
class InstallResult:
installed: list[Path]
unchanged: list[Path]
conflicts: list[Path]
def relative_to_target(path: Path, target: Path) -> str:
try:
return str(path.relative_to(target))
except ValueError:
return str(path)
def discover_agent_files() -> list[Path]:
if not SOURCE_AGENTS_DIR.exists():
raise FileNotFoundError(f"Source agent directory not found: {SOURCE_AGENTS_DIR}")
agent_files = sorted(SOURCE_AGENTS_DIR.glob("*.toml"))
if not agent_files:
raise FileNotFoundError(f"No custom agent TOML files found in: {SOURCE_AGENTS_DIR}")
return agent_files
def install_agents(target: Path, *, force: bool, dry_run: bool) -> InstallResult:
agent_files = discover_agent_files()
target_agents_dir = target / ".codex" / "agents"
planned: list[tuple[Path, Path]] = []
unchanged: list[Path] = []
conflicts: list[Path] = []
for source in agent_files:
destination = target_agents_dir / source.name
if source.resolve() == destination.resolve():
unchanged.append(destination)
continue
if destination.exists():
if filecmp.cmp(source, destination, shallow=False):
unchanged.append(destination)
continue
if not force:
conflicts.append(destination)
continue
planned.append((source, destination))
if conflicts and not force:
return InstallResult(installed=[], unchanged=unchanged, conflicts=conflicts)
installed = [destination for _, destination in planned]
if not dry_run:
target_agents_dir.mkdir(parents=True, exist_ok=True)
for source, destination in planned:
shutil.copy2(source, destination)
return InstallResult(installed=installed, unchanged=unchanged, conflicts=conflicts)
def print_path_list(label: str, paths: list[Path], target: Path) -> None:
if not paths:
return
print(f"{label}:")
for path in paths:
print(f"- {relative_to_target(path, target)}")
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"target",
nargs="?",
default=".",
help="Target game project root. Defaults to the current directory.",
)
parser.add_argument(
"--force",
action="store_true",
help="Overwrite existing agent files when their content differs.",
)
parser.add_argument(
"--dry-run",
action="store_true",
help="Show what would be installed without writing files.",
)
return parser.parse_args()
def main() -> int:
args = parse_args()
target = Path(args.target).expanduser().resolve()
print("Codex Game Studios runtime installer")
print(f"Plugin root: {PLUGIN_ROOT}")
print(f"Target project: {target}")
print("Runtime scope: custom agents only")
try:
result = install_agents(target, force=args.force, dry_run=args.dry_run)
except FileNotFoundError as error:
print(f"ERROR: {error}", file=sys.stderr)
return 1
print_path_list("Installed" if not args.dry_run else "Would install", result.installed, target)
print_path_list("Unchanged", result.unchanged, target)
print_path_list("Conflicts", result.conflicts, target)
if result.conflicts:
print(
"ERROR: Existing agent files differ. Re-run with --force to overwrite them.",
file=sys.stderr,
)
return 2
print("Done.")
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -1,29 +0,0 @@
---
name: using-codex-game-studios
description: "Use when a user asks how the Codex Game Studios plugin is structured, what workflow to run next, how to initialize it, or how it differs from generic development workflow plugins."
---
# Using Codex Game Studios
Codex Game Studios is a game-production plugin built around plugin-discovered skills, not global `~/.codex/skills` bridge folders.
## Entry Points
- Use `$setup-runtime` when a project needs the bundled director agents installed into `.codex/agents/`.
- Use `$brainstorm` to turn a rough game idea into `design/gdd/game-concept.md`.
- Use `runtime/agents/` as the plugin source of bundled custom agents.
- Use `references/` and `standards/` only when the active workflow points to them.
## Review Intensity
`production/review-mode.txt` controls review-gate intensity, not whether agents
exist or whether future team workflows may use subagents for core work:
- `full` — all key director / lead review gates call their custom agents.
- `lean` — only PHASE-GATE review gates such as `/gate-check` call directors;
ordinary per-skill review gates are skipped.
- `solo` — all director review gates are skipped.
## Design Rule
Do not rely on a global `~/.codex/skills/codex-game-studio` bridge. The installed plugin exposes its skills through `.codex-plugin/plugin.json` with `"skills": "./skills/"`, matching the normal Codex plugin layout.

View File

@@ -1,4 +0,0 @@
interface:
display_name: "Using Codex Game Studios"
short_description: "Understand the game-studio plugin workflow"
default_prompt: "Use $using-codex-game-studios to explain this plugin workflow."