Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

REFACTOR (agents): Drop Codex support and load Claude Code skills through a symlink to .agents/skills, so every skill has one source file

Rostislav Duginc6c543ffa190
diff --git a/.agent-hooks/review_gate.py b/.agent-hooks/review_gate.py
index c27cd2e0..0c436aaa 100755
--- a/.agent-hooks/review_gate.py
+++ b/.agent-hooks/review_gate.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
-"""Review hooks for Claude Code and Codex, wired in .claude/settings.json and .codex/hooks.json.
+"""Review hooks for Claude Code, wired in .claude/settings.json.
-Usage: review_gate.py <action> --client <claude|codex>
+Usage: review_gate.py <action>
review_gate.py doctor
-The clients start it through run.sh, which runs it with the Python and OpenSpec versions pinned
+Claude Code starts it through run.sh, which runs it with the Python and OpenSpec versions pinned
in mise.toml and stops the agent with the reason when the hook cannot start or crashes.
Actions:
@@ -52,7 +52,6 @@ import shutil
import signal
import subprocess
import sys
-import tempfile
import time
@@ -89,8 +88,6 @@ class MissingToolError(Exception):
class Reviewer:
claude_model: str
claude_effort: str
- codex_model: str
- codex_effort: str
schema_path: Path
timeout_seconds: int
@@ -101,16 +98,12 @@ class Reviewer:
QUICK_REVIEWER = Reviewer(
claude_model="opus",
claude_effort="low",
- codex_model="gpt-6.1-sol",
- codex_effort="low",
schema_path=HOOKS_DIR / "review-result.schema.json",
timeout_seconds=540,
)
IMPLEMENTATION_REVIEWER = Reviewer(
claude_model="opus",
claude_effort="medium",
- codex_model="gpt-6.1-sol",
- codex_effort="high",
schema_path=HOOKS_DIR / "implementation-result.schema.json",
timeout_seconds=1800,
)
@@ -118,10 +111,7 @@ PROPOSAL_REVIEWER = replace(IMPLEMENTATION_REVIEWER, schema_path=HOOKS_DIR / "pr
OPENSPEC_PLANNING_COMMANDS = (
"/opsx:propose",
"/opsx:update",
- "$openspec-propose",
- "$openspec-update-change",
)
-PLANNING_COMMANDS = (*OPENSPEC_PLANNING_COMMANDS, "/plan")
# The repeat review reads the reply after a block, so the reply names the rejected findings,
# and the summary for the user waits until the review accepts the result.
FULL_REVIEW_REPLY_INSTRUCTION = (
@@ -466,12 +456,6 @@ def has_command(request, commands):
return any(command in prompt for command in commands)
-def is_planning(payload, request):
- if get_field(payload, "permission_mode", "permissionMode") == "plan":
- return True
- return has_command(request, PLANNING_COMMANDS)
-
-
def get_active_changes(root):
changes_dir = root / "openspec" / "changes"
if not changes_dir.is_dir():
@@ -586,50 +570,11 @@ def parse_review_result(value):
def get_reviewer_environment():
environment = os.environ.copy()
environment[REVIEWER_ACTIVE_ENV] = "1"
- for name in ("CLAUDECODE", "CLAUDE_CODE_SESSION_ID", "CODEX_SESSION_ID", "CODEX_THREAD_ID"):
+ for name in ("CLAUDECODE", "CLAUDE_CODE_SESSION_ID"):
environment.pop(name, None)
return environment
-def run_codex_reviewer(root, prompt, model, effort, schema_path, timeout_seconds):
- with tempfile.TemporaryDirectory(prefix="codex-review-") as temporary_dir:
- output_path = Path(temporary_dir) / "result.json"
- command = [
- "codex",
- "exec",
- "--ephemeral",
- "--disable",
- "hooks",
- "--model",
- model,
- "--config",
- f'model_reasoning_effort="{effort}"',
- "--sandbox",
- "read-only",
- "--cd",
- str(root),
- "--output-schema",
- str(schema_path),
- "--output-last-message",
- str(output_path),
- "--color",
- "never",
- "-",
- ]
- process = subprocess.run(
- command,
- input=prompt,
- text=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=get_reviewer_environment(),
- timeout=timeout_seconds,
- )
- if process.returncode != 0:
- raise RuntimeError(process.stderr.strip() or f"codex exited with code {process.returncode}")
- return load_reviewer_output(output_path.read_text())
-
-
def run_claude_reviewer(root, prompt, model, effort, schema_path, timeout_seconds):
command = [
"claude",
@@ -674,11 +619,7 @@ def run_claude_reviewer(root, prompt, model, effort, schema_path, timeout_second
return load_reviewer_output(process.stdout)
-def run_reviewer(root, prompt, client, reviewer):
- if client == "codex":
- return run_codex_reviewer(
- root, prompt, reviewer.codex_model, reviewer.codex_effort, reviewer.schema_path, reviewer.timeout_seconds
- )
+def run_reviewer(root, prompt, reviewer):
return run_claude_reviewer(
root, prompt, reviewer.claude_model, reviewer.claude_effort, reviewer.schema_path, reviewer.timeout_seconds
)
@@ -689,9 +630,9 @@ def describe_reviewer_error(error):
return f"The automatic reviewer could not run: {message}"
-def review(root, prompt, client):
+def review(root, prompt):
try:
- result = parse_review_result(run_reviewer(root, prompt, client, QUICK_REVIEWER))
+ result = parse_review_result(run_reviewer(root, prompt, QUICK_REVIEWER))
except (OSError, ValueError, RuntimeError, subprocess.TimeoutExpired) as error:
return False, describe_reviewer_error(error)
@@ -700,13 +641,13 @@ def review(root, prompt, client):
return False, result["reason"].strip() or "The reviewer rejected the result without a reason."
-def gate_plan_tool(session, gate, client):
+def gate_plan_tool(session, gate):
gate_path = session.gate_path(gate)
state = load_state(gate_path)
plan = read_plan(get_field(session.payload, "tool_input", "toolInput") or {})
if plan:
prompt = build_review_prompt(session, gate, "plan", plan, get_changed_paths(session.root))
- is_accepted, reason = review(session.root, prompt, client)
+ is_accepted, reason = review(session.root, prompt)
else:
is_accepted, reason = False, "ExitPlanMode carried no plan text, so the plan could not be reviewed."
@@ -738,30 +679,22 @@ def gate_plan_tool(session, gate, client):
)
-def get_stop_subject(
- gate, client, is_plan_turn, is_openspec_turn, is_workspace_changed, blocks, is_code_changed=False
-):
- # Claude shows a plan through ExitPlanMode, which has its own check. Codex has no such
- # tool, and its plan reaches the user in the final message.
- is_plan_in_message = is_plan_turn and client != "claude"
-
+# A plan reaches the reviewer through ExitPlanMode, which has its own check, so a finished turn
+# never carries one.
+def get_stop_subject(gate, is_openspec_turn, is_workspace_changed, blocks, is_code_changed=False):
if gate == "naming":
return "finished change" if is_code_changed or blocks > 0 else None
if gate == "necessity":
- if is_openspec_turn and is_workspace_changed:
- return "OpenSpec proposal"
- return "plan" if is_plan_in_message else None
+ return "OpenSpec proposal" if is_openspec_turn and is_workspace_changed else None
if gate == "plan":
- return "plan" if is_plan_in_message else None
- if gate == "architecture" and is_plan_in_message:
- return "plan"
+ return None
if is_workspace_changed or blocks > 0:
return "finished change"
return None
-def gate_stop(session, gate, client):
+def gate_stop(session, gate):
request = session.load_request()
if gate in GATES_YIELDING_TO_PROPOSAL_REVIEW and is_proposal_review_turn(session.root, request):
emit({})
@@ -773,8 +706,6 @@ def gate_stop(session, gate, client):
blocks = int(state.get("blocks") or 0)
subject = get_stop_subject(
gate,
- client,
- is_planning(session.payload, request),
is_openspec_planning(request, session.root),
request.get("baseline") != fingerprint,
blocks,
@@ -787,7 +718,7 @@ def gate_stop(session, gate, client):
candidate = str(get_field(session.payload, "last_assistant_message", "lastAssistantMessage") or "(not available)")
prompt = build_review_prompt(session, gate, subject, candidate, get_changed_paths(session.root))
- is_accepted, reason = review(session.root, prompt, client)
+ is_accepted, reason = review(session.root, prompt)
if is_accepted:
save_state(gate_path, {"blocks": 0, "accepted": fingerprint})
@@ -1095,11 +1026,11 @@ def parse_findings(full_review, value):
return [{"category": finding["category"], "file": finding["file"], "summary": finding["summary"]} for finding in findings]
-def run_review_job(root, client, full_review, job, deadline):
+def run_review_job(root, full_review, job, deadline):
if deadline - time.monotonic() < full_review.reviewer.timeout_seconds:
return [], describe_reviewer_error(BUDGET_EXHAUSTED_ERROR)
try:
- return parse_findings(full_review, run_reviewer(root, job.prompt, client, full_review.reviewer)), None
+ return parse_findings(full_review, run_reviewer(root, job.prompt, full_review.reviewer)), None
except (OSError, ValueError, RuntimeError, subprocess.TimeoutExpired) as error:
return [], describe_reviewer_error(error)
@@ -1121,7 +1052,7 @@ def block_full_review(session, full_review, report, instruction):
emit({"decision": "block", "reason": f"{AUTOMATIC_REVIEW_PREFIX} {full_review.gate}\n{report}\n\n{instruction}"})
-def gate_full_review(session, client, full_review, deadline):
+def gate_full_review(session, full_review, deadline):
root = session.root
targets = full_review.select_targets(session)
if not targets:
@@ -1152,7 +1083,7 @@ def gate_full_review(session, client, full_review, deadline):
jobs = [job for target in targets for job in build_review_jobs(session, full_review, target)]
with ThreadPoolExecutor(max_workers=MAX_PARALLEL_REVIEWERS) as executor:
- results = list(executor.map(lambda job: run_review_job(root, client, full_review, job, deadline), jobs))
+ results = list(executor.map(lambda job: run_review_job(root, full_review, job, deadline), jobs))
reports = []
has_blocking = False
@@ -1315,16 +1246,11 @@ def check_environment():
"git": shutil.which("git"),
"openspec": shutil.which("openspec"),
"claude": shutil.which("claude"),
- "codex": shutil.which("codex"),
}
for tool, path in tool_paths.items():
print(f"{tool}: {path or 'not found'}")
- is_missing_tool = not all(tool_paths[tool] for tool in ("python", "git", "openspec"))
- is_reviewer_missing = not (tool_paths["claude"] or tool_paths["codex"])
- if is_reviewer_missing:
- print("no reviewer CLI found: the review hooks need claude or codex")
- return 1 if is_missing_tool or is_reviewer_missing else 0
+ return 0 if all(tool_paths.values()) else 1
def stop_for_missing_tool(error):
@@ -1339,20 +1265,17 @@ def main():
deadline = time.monotonic() + FULL_REVIEW_BUDGET_SECONDS
parser = argparse.ArgumentParser()
parser.add_argument("action", choices=("session-start", "snapshot", "doctor", *GATES))
- parser.add_argument("--client", choices=("claude", "codex"))
arguments = parser.parse_args()
if arguments.action == "doctor":
sys.exit(check_environment())
- if arguments.client is None:
- parser.error(f"--client is required for {arguments.action}")
try:
- run_action(arguments.action, arguments.client, deadline)
+ run_action(arguments.action, deadline)
except MissingToolError as error:
stop_for_missing_tool(error)
-def run_action(action, client, deadline):
+def run_action(action, deadline):
payload = read_payload()
if os.environ.get(REVIEWER_ACTIVE_ENV) == "1":
emit({})
@@ -1367,14 +1290,14 @@ def run_action(action, client, deadline):
return
if action in FULL_REVIEWS:
- gate_full_review(session, client, FULL_REVIEWS[action], deadline)
+ gate_full_review(session, FULL_REVIEWS[action], deadline)
return
event = get_field(payload, "hook_event_name", "hookEventName")
if event == "PreToolUse":
- gate_plan_tool(session, action, client)
+ gate_plan_tool(session, action)
return
- gate_stop(session, action, client)
+ gate_stop(session, action)
if __name__ == "__main__":
diff --git a/.agent-hooks/review_gate_test.py b/.agent-hooks/review_gate_test.py
index c40a3b41..b6bf1468 100644
--- a/.agent-hooks/review_gate_test.py
+++ b/.agent-hooks/review_gate_test.py
@@ -19,7 +19,7 @@ import review_gate
HOOK_PATH = Path(__file__).resolve().parent / "review_gate.py"
CHANGE_NAME = "add-widgets"
PROPOSAL_NAME = "add-gadgets"
-STUB_NAMES = ("claude", "codex", "openspec", "golangci-lint", "pnpm", "npm", "just")
+STUB_NAMES = ("claude", "openspec", "golangci-lint", "pnpm", "npm", "just")
# The stub stands in for every external command: it takes its answer from <stubs>/<name>.json
# and records each call in <stubs>/calls, so a test sees the arguments, the working directory
@@ -37,7 +37,7 @@ STUB_SOURCE = textwrap.dedent(
stubs_dir = Path(os.environ["REVIEW_GATE_STUBS"])
name = Path(sys.argv[0]).name
arguments = sys.argv[1:]
- prompt = sys.stdin.read() if name in ("claude", "codex") else ""
+ prompt = sys.stdin.read() if name == "claude" else ""
calls_dir = stubs_dir / "calls"
calls_dir.mkdir(exist_ok=True)
(calls_dir / f"{name}-{uuid.uuid4().hex}.json").write_text(
@@ -68,9 +68,6 @@ STUB_SOURCE = textwrap.dedent(
result = config.get("result", {"ok": True, "reason": "", "findings": []})
if name == "claude":
sys.stdout.write(json.dumps({"structured_output": result}))
- elif name == "codex":
- output_path = arguments[arguments.index("--output-last-message") + 1]
- Path(output_path).write_text(json.dumps(result))
elif name == "openspec" and arguments[0] == "status":
sys.stdout.write(config.get("output", json.dumps({"isPlanningComplete": True})))
else:
@@ -219,12 +216,10 @@ class HookRepository:
self.write(f"openspec/changes/{name}/tasks.md", f"# Tasks\n\n- [x] 1.1 Build\n- [x] 1.2 Verify\n{verification_section}")
def set_reviewer_result(self, result):
- for name in ("claude", "codex"):
- (self.stubs_dir / f"{name}.json").write_text(json.dumps({"result": result}))
+ self.set_stub("claude", {"result": result})
def set_reviewer_failure(self, output):
- for name in ("claude", "codex"):
- (self.stubs_dir / f"{name}.json").write_text(json.dumps({"exit_code": 1, "output": output}))
+ self.set_stub("claude", {"exit_code": 1, "output": output})
def set_stub(self, name, config):
(self.stubs_dir / f"{name}.json").write_text(json.dumps(config))
@@ -240,15 +235,15 @@ class HookRepository:
return [call for call in self.calls() if call["name"] in ("golangci-lint", "pnpm", "npm", "just")]
def reviewer_calls(self):
- return [call for call in self.calls() if call["name"] in ("claude", "codex")]
+ return [call for call in self.calls() if call["name"] == "claude"]
def clear_calls(self):
for path in (self.stubs_dir / "calls").glob("*.json"):
path.unlink()
- def run_hook(self, action, payload, client="claude"):
+ def run_hook(self, action, payload):
process = subprocess.run(
- [sys.executable, str(HOOK_PATH), action, "--client", client],
+ [sys.executable, str(HOOK_PATH), action],
cwd=self.root,
env=self.environment,
input=json.dumps({"cwd": str(self.root), **payload}),
@@ -281,19 +276,19 @@ class HookRepository:
mock.patch.object(
review_gate, "CHECKS_TOTAL_TIMEOUT_SECONDS", checks_timeout_seconds or review_gate.CHECKS_TOTAL_TIMEOUT_SECONDS
),
- mock.patch.object(sys, "argv", ["review_gate.py", action, "--client", "claude"]),
+ mock.patch.object(sys, "argv", ["review_gate.py", action]),
mock.patch.object(sys, "stdin", io.StringIO(json.dumps(payload))),
mock.patch.object(sys, "stdout", stdout),
):
review_gate.main()
return json.loads(stdout.getvalue())
- def submit_prompt(self, prompt, session_id="session-1", client="claude"):
- self.run_hook("snapshot", {"hook_event_name": "UserPromptSubmit", "session_id": session_id, "prompt": prompt}, client)
+ def submit_prompt(self, prompt, session_id="session-1"):
+ self.run_hook("snapshot", {"hook_event_name": "UserPromptSubmit", "session_id": session_id, "prompt": prompt})
- def stop(self, action, session_id="session-1", client="claude", message="Done."):
+ def stop(self, action, session_id="session-1", message="Done."):
payload = {"hook_event_name": "Stop", "session_id": session_id, "last_assistant_message": message}
- return self.run_hook(action, payload, client)
+ return self.run_hook(action, payload)
def finding(category, summary, file="src/widgets.py:10"):
@@ -426,7 +421,7 @@ class LauncherTest(unittest.TestCase):
launcher.install_mise(launcher.home / ".local" / "bin")
payload = json.dumps({"hook_event_name": "Stop", "session_id": "session-1"})
- process = launcher.run("naming", "--client", "claude", stdin=payload)
+ process = launcher.run("naming", stdin=payload)
self.assertEqual(process.returncode, 0)
self.assertEqual(json.loads(process.stdout), {})
@@ -437,7 +432,7 @@ class LauncherTest(unittest.TestCase):
["-C", root, "ls", "--current", "--missing", "--no-truncate", "python", "npm:@fission-ai/openspec"],
)
[call] = launcher.mise_calls("exec")
- self.assertEqual(call["arguments"], ["-C", root, "exec", "--", "python3", str(HOOK_PATH), "naming", "--client", "claude"])
+ self.assertEqual(call["arguments"], ["-C", root, "exec", "--", "python3", str(HOOK_PATH), "naming"])
self.assertEqual(call["exec_auto_install"], "false")
self.assertEqual(call["stdin"], payload)
@@ -446,7 +441,7 @@ class LauncherTest(unittest.TestCase):
launcher.install_mise(launcher.bin_dir)
launcher.set_mise_answer("ls", stdout=f"{MISSING_OPENSPEC_LINE}\n")
- process = launcher.run("proposal", "--client", "claude")
+ process = launcher.run("proposal")
self.assert_stops_agent(process, "not installed", MISSING_OPENSPEC_LINE, "mise install", "just doctor")
self.assertEqual(launcher.mise_calls("exec"), [])
@@ -456,7 +451,7 @@ class LauncherTest(unittest.TestCase):
launcher.install_mise(launcher.bin_dir)
launcher.set_mise_answer("ls", stdout="", stderr="mise ERROR Config file mise.toml is not trusted\n", exit_code=1)
- process = launcher.run("diff", "--client", "claude")
+ process = launcher.run("diff")
self.assert_stops_agent(process, "mise exited with code 1", "is not trusted", "just doctor")
self.assertEqual(launcher.mise_calls("exec"), [])
@@ -464,7 +459,7 @@ class LauncherTest(unittest.TestCase):
def test_stops_agent_when_version_manager_is_missing(self):
launcher = Launcher(self)
- process = launcher.run("diff", "--client", "claude")
+ process = launcher.run("diff")
self.assert_stops_agent(process, "could not find the version manager mise", "just doctor")
@@ -473,7 +468,7 @@ class LauncherTest(unittest.TestCase):
launcher.install_mise(launcher.bin_dir)
launcher.set_mise_answer("exec", stdout="", stderr="Traceback: KeyError\n", exit_code=3)
- process = launcher.run("implementation", "--client", "codex")
+ process = launcher.run("implementation")
self.assert_stops_agent(process, "`implementation`", "exit code 3", "just doctor")
@@ -482,7 +477,7 @@ class LauncherTest(unittest.TestCase):
launcher.install_mise(launcher.bin_dir)
launcher.set_mise_answer("exec", stdout="", stderr='KeyError: "baseline"\\ \t\x1b[31m\r\n', exit_code=1)
- process = launcher.run("diff", "--client", "claude")
+ process = launcher.run("diff")
response = self.assert_stops_agent(process)
self.assertIn('KeyError: "baseline"\\', response["stopReason"])
@@ -549,25 +544,16 @@ class DoctorTest(unittest.TestCase):
f"git: {repository.root.parent / 'system-bin' / 'git'}",
f"openspec: {bin_dir / 'openspec'}",
f"claude: {bin_dir / 'claude'}",
- f"codex: {bin_dir / 'codex'}",
],
)
- def test_exits_with_code_0_when_only_one_reviewer_cli_is_present(self):
- repository = HookRepository(self, missing_tools=("codex",))
-
- process = repository.run_doctor()
-
- self.assertEqual(process.returncode, 0, process.stdout)
- self.assertIn("codex: not found", process.stdout.splitlines())
-
def test_reports_missing_reviewer_cli_and_exits_with_nonzero_code(self):
- repository = HookRepository(self, missing_tools=("claude", "codex"))
+ repository = HookRepository(self, missing_tools=("claude",))
process = repository.run_doctor()
self.assertNotEqual(process.returncode, 0)
- self.assertIn("no reviewer CLI found", process.stdout)
+ self.assertIn("claude: not found", process.stdout.splitlines())
class RunChecksTest(unittest.TestCase):
@@ -611,14 +597,14 @@ class RunChecksTest(unittest.TestCase):
class FullReviewBudgetTest(unittest.TestCase):
- def get_hook_timeouts(self, config_path, gate):
- config = json.loads((HOOK_PATH.parent.parent / config_path).read_text())
+ def get_hook_timeouts(self, gate):
+ config = json.loads((HOOK_PATH.parent.parent / ".claude" / "settings.json").read_text())
return [
hook["timeout"]
for groups in config["hooks"].values()
for group in groups
for hook in group["hooks"]
- if f'run.sh" {gate} --client' in hook["command"]
+ if hook["command"].endswith(f'run.sh\" {gate}')
]
def test_budget_fits_checks_and_two_reviewer_waves(self):
@@ -628,11 +614,10 @@ class FullReviewBudgetTest(unittest.TestCase):
review_gate.CHECKS_TOTAL_TIMEOUT_SECONDS + 2 * full_review.reviewer.timeout_seconds,
)
- def test_budget_ends_before_full_review_hook_timeouts_of_both_clients(self):
- for config_path in (".claude/settings.json", ".codex/hooks.json"):
- for gate in review_gate.FULL_REVIEWS:
- [timeout_seconds] = self.get_hook_timeouts(config_path, gate)
- self.assertLess(review_gate.FULL_REVIEW_BUDGET_SECONDS, timeout_seconds, f"{config_path} {gate}")
+ def test_budget_ends_before_full_review_hook_timeouts(self):
+ for gate in review_gate.FULL_REVIEWS:
+ [timeout_seconds] = self.get_hook_timeouts(gate)
+ self.assertLess(review_gate.FULL_REVIEW_BUDGET_SECONDS, timeout_seconds, gate)
class ChangeVerificationParsingTest(unittest.TestCase):
@@ -752,6 +737,7 @@ class PlanGateTest(unittest.TestCase):
output = response["hookSpecificOutput"]
self.assertEqual(output["permissionDecision"], "deny")
self.assertIn("The plan keeps a compatibility alias.", output["permissionDecisionReason"])
+ self.assertIn("Revise the plan and show it again", output["permissionDecisionReason"])
def test_denies_exit_plan_mode_without_plan_text(self):
repository = HookRepository(self)
@@ -787,18 +773,6 @@ class DiffGateTest(unittest.TestCase):
self.assertIn("a summary of the final state, without retelling this review", response["reason"])
self.assertNotIn("Fix the result", response["reason"])
- def test_asks_to_revise_plan_when_necessity_blocks_codex_plan_in_final_message(self):
- repository = HookRepository(self)
- repository.set_reviewer_result({"ok": False, "reason": "The plan keeps a compatibility alias."})
- repository.submit_prompt("/plan the widgets", client="codex")
-
- response = repository.stop("necessity", client="codex", message="# Plan\n\nAdd widgets.\n")
-
- self.assertEqual(response["decision"], "block")
- self.assertIn("The plan keeps a compatibility alias.", response["reason"])
- self.assertIn("Revise the plan and show it again", response["reason"])
- self.assertNotIn("summary", response["reason"])
-
def test_diff_reviewer_prompt_checks_agent_instructions(self):
repository = HookRepository(self)
repository.submit_prompt("Fix the docs")
@@ -830,16 +804,6 @@ class DiffGateTest(unittest.TestCase):
self.assertIn("--model opus --effort low", " ".join(call["arguments"]))
self.assertEqual(call["effort_env"], "low")
- def test_runs_codex_reviewer_on_gpt_with_low_effort(self):
- repository = HookRepository(self)
- repository.submit_prompt("Add a widget", client="codex")
- repository.write("src/widgets.py", "WIDGETS = []\n")
-
- repository.stop("diff", client="codex")
-
- [call] = repository.calls("codex")
- self.assertIn("--model gpt-6.1-sol --config model_reasoning_effort=\"low\"", " ".join(call["arguments"]))
-
def test_stops_agent_after_fourth_rejection(self):
repository = HookRepository(self)
repository.set_reviewer_result({"ok": False, "reason": "No test for an empty list."})
@@ -953,17 +917,6 @@ class NamingGateTest(unittest.TestCase):
[call] = repository.calls("claude")
self.assertIn("--model opus --effort low", " ".join(call["arguments"]))
- def test_runs_codex_reviewer_on_gpt_with_low_effort(self):
- repository = HookRepository(self)
- repository.submit_prompt("Add a widget", client="codex")
- repository.write("backend/internal/features/widgets/service.go", "package widgets\n")
-
- repository.stop("naming", client="codex")
-
- [call] = repository.calls("codex")
- self.assertIn("--model gpt-6.1-sol --config model_reasoning_effort=\"low\"", " ".join(call["arguments"]))
-
-
class ImplementationGateStartTest(unittest.TestCase):
def test_runs_full_review_when_agent_completes_last_task(self):
repository = HookRepository(self)
@@ -1047,7 +1000,7 @@ class ImplementationGateStartTest(unittest.TestCase):
repository = HookRepository(self)
process = subprocess.run(
- [sys.executable, str(HOOK_PATH), "implementation", "--client", "claude"],
+ [sys.executable, str(HOOK_PATH), "implementation"],
cwd=repository.root,
env=repository.environment,
input="",
@@ -1265,19 +1218,6 @@ class ImplementationGateReviewTest(ShortReplyAssertions, unittest.TestCase):
],
)
- def test_runs_codex_reviewers_on_gpt_with_high_effort(self):
- repository = HookRepository(self)
- repository.write_change(spec_names=("widgets", "gadgets"), tasks="- [x] 1.1 Build\n")
- repository.submit_prompt("Continue", client="codex")
- repository.complete_tasks()
-
- repository.stop("implementation", client="codex")
-
- calls = repository.calls("codex")
- self.assertEqual(len(calls), 4)
- for call in calls:
- self.assertIn("--model gpt-6.1-sol --config model_reasoning_effort=\"high\"", " ".join(call["arguments"]))
-
def test_implementation_docs_reviewer_prompt_checks_agent_instructions(self):
repository = HookRepository(self)
repository.submit_prompt("Continue")
@@ -1672,18 +1612,6 @@ class ProposalGateReviewTest(ShortReplyAssertions, SummaryAssertions, unittest.T
],
)
- def test_runs_codex_reviewers_on_gpt_with_high_effort(self):
- repository = HookRepository(self)
- repository.submit_prompt("Write a spec", client="codex")
- repository.write_proposal(spec_names=("gadgets", "gizmos"))
-
- repository.stop("proposal", client="codex")
-
- calls = repository.calls("codex")
- self.assertEqual(len(calls), 4)
- for call in calls:
- self.assertIn("--model gpt-6.1-sol --config model_reasoning_effort=\"high\"", " ".join(call["arguments"]))
-
def test_tasks_reviewer_prompt_requires_every_scenario_covered_by_task_with_test(self):
repository = HookRepository(self)
repository.submit_prompt("Write a spec")
diff --git a/.agent-hooks/run.sh b/.agent-hooks/run.sh
index dd345191..7b473b43 100755
--- a/.agent-hooks/run.sh
+++ b/.agent-hooks/run.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Starts review_gate.py with the Python and OpenSpec versions pinned in mise.toml, so a client
+# Starts review_gate.py with the Python and OpenSpec versions pinned in mise.toml, so a Claude Code
# started from an IDE without the mise shims on PATH runs the same hook as a terminal one.
# A hook that cannot run stops the agent with the reason instead of letting the turn pass unreviewed.
# Only bash builtins and coreutils run before mise, because nothing else is guaranteed on PATH yet.
diff --git a/.agents/skills/.openspec-target b/.agents/skills/.openspec-target
deleted file mode 100644
index 2695308a..00000000
--- a/.agents/skills/.openspec-target
+++ /dev/null
@@ -1 +0,0 @@
-codex
diff --git a/.agents/skills/openspec-apply-change/SKILL.md b/.agents/skills/openspec-apply-change/SKILL.md
index 2af3f1b1..152cea74 100644
--- a/.agents/skills/openspec-apply-change/SKILL.md
+++ b/.agents/skills/openspec-apply-change/SKILL.md
@@ -18,7 +18,7 @@ Implement tasks from an OpenSpec change.
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
-**Input**: Optionally specify a change name (e.g., `$openspec-apply-change (Codex) or /openspec-apply-change (other agents) add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
+**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
@@ -29,7 +29,7 @@ Implement tasks from an OpenSpec change.
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
- Always announce: "Using change: <name>" and how to override (e.g., `$openspec-apply-change (Codex) or /openspec-apply-change (other agents) <other>`).
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
2. **Check status to understand the schema**
```bash
@@ -55,7 +55,7 @@ Implement tasks from an OpenSpec change.
- Optional `operationGuidance`: current advisory guidance for apply
**Handle states:**
- - If `state: "blocked"` (missing artifacts): show message, suggest using `$openspec-continue-change (Codex) or /openspec-continue-change (other agents)` (if it is not installed, run `openspec status --change "<name>" --json` to see the next artifact and `openspec instructions <artifact-id> --change "<name>" --json` for how to create it)
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` (if it is not installed, run `openspec status --change "<name>" --json` to see the next artifact and `openspec instructions <artifact-id> --change "<name>" --json` for how to create it)
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation
@@ -144,7 +144,7 @@ Working on task 4/7: <task description>
- [x] Task 2
...
-All tasks complete! You can archive this change with `$openspec-archive-change (Codex) or /openspec-archive-change (other agents)`.
+All tasks complete! You can archive this change with `/opsx:archive`.
```
**Output On Pause (Issue Encountered)**
diff --git a/.agents/skills/openspec-archive-change/SKILL.md b/.agents/skills/openspec-archive-change/SKILL.md
index 7ab02af3..520dda5a 100644
--- a/.agents/skills/openspec-archive-change/SKILL.md
+++ b/.agents/skills/openspec-archive-change/SKILL.md
@@ -34,7 +34,7 @@ Archive a completed change in the experimental workflow.
When prompting, show only active changes (not already archived).
Include the schema used for each change if available.
- Always announce: "Using change: <name>" and how to override (e.g., `$openspec-archive-change (Codex) or /openspec-archive-change (other agents) <other>`).
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:archive <other>`).
**Load current archive inputs before the existing archive checks:**
diff --git a/.agents/skills/openspec-explore/SKILL.md b/.agents/skills/openspec-explore/SKILL.md
index 92ace1ae..3021742c 100644
--- a/.agents/skills/openspec-explore/SKILL.md
+++ b/.agents/skills/openspec-explore/SKILL.md
@@ -227,7 +227,7 @@ You: [reads codebase]
**User is stuck mid-implementation:**
```
-User: $openspec-explore (Codex) or /openspec-explore (other agents) add-auth-system
+User: /opsx:explore add-auth-system
The OAuth integration is more complex than expected
You: [reads change artifacts]
diff --git a/.agents/skills/openspec-propose/SKILL.md b/.agents/skills/openspec-propose/SKILL.md
index 9e98d94a..f47742c2 100644
--- a/.agents/skills/openspec-propose/SKILL.md
+++ b/.agents/skills/openspec-propose/SKILL.md
@@ -131,7 +131,7 @@ After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
- What's ready: "All artifacts needed for implementation are ready."
-- Prompt: "The artifacts are ready for review. When you are ready, run `$openspec-apply-change (Codex) or /openspec-apply-change (other agents)` or ask me to apply this change."
+- Prompt: "The artifacts are ready for review. When you are ready, run `/opsx:apply` or ask me to apply this change."
**Artifact Creation Guidelines**
diff --git a/.agents/skills/openspec-sync-specs/SKILL.md b/.agents/skills/openspec-sync-specs/SKILL.md
index 8da05845..2bacea02 100644
--- a/.agents/skills/openspec-sync-specs/SKILL.md
+++ b/.agents/skills/openspec-sync-specs/SKILL.md
@@ -35,7 +35,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
When prompting, show changes that have delta specs (under `specs/` directory).
- Always announce: "Using change: <name>" and how to override (e.g., `$openspec-sync-specs (Codex) or /openspec-sync-specs (other agents) <other>`).
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:sync <other>`).
2. **Resolve change context**
diff --git a/.agents/skills/openspec-update-change/SKILL.md b/.agents/skills/openspec-update-change/SKILL.md
index 35ed948b..c2f80cdd 100644
--- a/.agents/skills/openspec-update-change/SKILL.md
+++ b/.agents/skills/openspec-update-change/SKILL.md
@@ -20,7 +20,7 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
-`$openspec-continue-change (Codex) or /openspec-continue-change (other agents)` is an optional workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, `openspec status --change "<name>" --json` shows the next artifact and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to create it.
+`/opsx:continue` is an optional workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, `openspec status --change "<name>" --json` shows the next artifact and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to create it.
**Steps**
@@ -39,7 +39,7 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
- Always announce: "Using change: <name>" and how to override (e.g., `$openspec-update-change (Codex) or /openspec-update-change (other agents) <other>`).
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
2. **Get the change's artifacts**
```bash
@@ -63,7 +63,7 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
- Read the artifact(s) the request touches and the change's other existing artifacts.
- Apply the requested edit. Then check every other existing artifact against it - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
- Note everything that is now inconsistent, missing, or contradictory.
- - Revise only files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `$openspec-continue-change (Codex) or /openspec-continue-change (other agents)` to create them.
+ - Revise only files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `/opsx:continue` to create them.
- If the change is already coherent, say so and make no edits.
5. **Confirm and apply, one artifact at a time**
@@ -75,21 +75,21 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
```
6. **Point to the next step (guidance only - NEVER act on it)**
- - Artifacts still missing -> suggest `$openspec-continue-change (Codex) or /openspec-continue-change (other agents)` to create them.
- - Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `$openspec-apply-change (Codex) or /openspec-apply-change (other agents)` to carry the delta into code.
- - Everything done and implemented -> suggest `$openspec-archive-change (Codex) or /openspec-archive-change (other agents)`.
+ - Artifacts still missing -> suggest `/opsx:continue` to create them.
+ - Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/opsx:apply` to carry the delta into code.
+ - Everything done and implemented -> suggest `/opsx:archive`.
**Output**
After each invocation, show:
- Which artifacts were revised (and which proposed revisions were rejected)
-- Anything deferred to `$openspec-continue-change (Codex) or /openspec-continue-change (other agents)` (not-yet-created artifacts or files)
+- Anything deferred to `/opsx:continue` (not-yet-created artifacts or files)
- Where the change stands and the recommended next command
**Guardrails**
-- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `$openspec-apply-change (Codex) or /openspec-apply-change (other agents)`.
+- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
- Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
- Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
-- Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `$openspec-continue-change (Codex) or /openspec-continue-change (other agents)`'s job.
+- Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/opsx:continue`'s job.
- Confirm every edit with the user before writing.
-- If the request changes the change's *intent* rather than refining it, first verify whether the optional `$openspec-new-change (Codex) or /openspec-new-change (other agents)` workflow is available. If it is, recommend starting fresh with `$openspec-new-change (Codex) or /openspec-new-change (other agents)` (the "Update vs. Start Fresh" heuristic). If it is unavailable, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead.
+- If the request changes the change's *intent* rather than refining it, first verify whether the optional `/opsx:new` workflow is available. If it is, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic). If it is unavailable, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead.
diff --git a/.agents/skills/run-app/SKILL.md b/.agents/skills/run-app/SKILL.md
index 1b4374c4..1f5125ca 100644
--- a/.agents/skills/run-app/SKILL.md
+++ b/.agents/skills/run-app/SKILL.md
@@ -5,7 +5,7 @@ description: Start, reuse and stop the local Databasus app, and check its pages
# Run the app and check it in the browser
-The browser server is registered for Claude Code and Codex as `chrome-devtools`. It opens a fresh browser profile in every session, so sign in at the start of each one. Whether the browser is headless or visible is the developer's choice in `.env`; leave `BROWSER_HEADLESS` as it is.
+The browser server is registered for Claude Code as `chrome-devtools`. It opens a fresh browser profile in every session, so sign in at the start of each one. Whether the browser is headless or visible is the developer's choice in `.env`; leave `BROWSER_HEADLESS` as it is.
The ports to check and open are the ones the `links` process prints in [`process-compose.yaml`](../../../process-compose.yaml). The account, the seeded databases and their sources are listed in the package comment of the [seed command](../../../backend/cmd/seed_dev/doc.go).
diff --git a/.claude/settings.json b/.claude/settings.json
index 266b95a7..dfc7645c 100644
--- a/.claude/settings.json
+++ b/.claude/settings.json
@@ -5,7 +5,7 @@
"hooks": [
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" session-start --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" session-start",
"timeout": 10
}
]
@@ -16,7 +16,7 @@
"hooks": [
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" snapshot --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" snapshot",
"timeout": 30
}
]
@@ -28,19 +28,19 @@
"hooks": [
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" plan --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" plan",
"timeout": 600,
"statusMessage": "Reviewing the plan"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" necessity --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" necessity",
"timeout": 600,
"statusMessage": "Checking whether the task is needed"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" architecture --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" architecture",
"timeout": 600,
"statusMessage": "Checking architecture"
}
@@ -52,37 +52,37 @@
"hooks": [
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" diff --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" diff",
"timeout": 600,
"statusMessage": "Reviewing the diff"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" necessity --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" necessity",
"timeout": 600,
"statusMessage": "Checking whether the task is needed"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" architecture --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" architecture",
"timeout": 600,
"statusMessage": "Checking architecture"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" naming --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" naming",
"timeout": 600,
"statusMessage": "Checking names"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" implementation --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" implementation",
"timeout": 7200,
"statusMessage": "Full implementation review"
},
{
"type": "command",
- "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" proposal --client claude",
+ "command": "\"$(git -C \"${CLAUDE_PROJECT_DIR}\" rev-parse --show-toplevel)/.agent-hooks/run.sh\" proposal",
"timeout": 7200,
"statusMessage": "Full proposal review"
}
diff --git a/.claude/skills b/.claude/skills
new file mode 120000
index 00000000..2b7a412b
--- /dev/null
+++ b/.claude/skills
@@ -0,0 +1 @@
+../.agents/skills
\ No newline at end of file
diff --git a/.claude/skills/git-commits/SKILL.md b/.claude/skills/git-commits/SKILL.md
deleted file mode 120000
index c6297788..00000000
--- a/.claude/skills/git-commits/SKILL.md
+++ /dev/null
@@ -1 +0,0 @@
-../../../.agents/skills/git-commits/SKILL.md
\ No newline at end of file
diff --git a/.claude/skills/humanizer/SKILL.md b/.claude/skills/humanizer/SKILL.md
deleted file mode 120000
index c6a9be73..00000000
--- a/.claude/skills/humanizer/SKILL.md
+++ /dev/null
@@ -1 +0,0 @@
-../../../.agents/skills/humanizer/SKILL.md
\ No newline at end of file
diff --git a/.claude/skills/run-app/SKILL.md b/.claude/skills/run-app/SKILL.md
deleted file mode 120000
index a4ef2c65..00000000
--- a/.claude/skills/run-app/SKILL.md
+++ /dev/null
@@ -1 +0,0 @@
-../../../.agents/skills/run-app/SKILL.md
\ No newline at end of file
diff --git a/.claude/skills/testing/SKILL.md b/.claude/skills/testing/SKILL.md
deleted file mode 120000
index fcbefaef..00000000
--- a/.claude/skills/testing/SKILL.md
+++ /dev/null
@@ -1 +0,0 @@
-../../../.agents/skills/testing/SKILL.md
\ No newline at end of file
diff --git a/.codex/config.toml b/.codex/config.toml
deleted file mode 100644
index b68729ef..00000000
--- a/.codex/config.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-# The same browser server .mcp.json registers for Claude Code; scripts/browser-mcp.sh explains it.
-[mcp_servers.chrome-devtools]
-command = "bash"
-args = ["-c", "exec \"$(git rev-parse --show-toplevel)/scripts/browser-mcp.sh\""]
diff --git a/.codex/hooks.json b/.codex/hooks.json
deleted file mode 100644
index 967b9259..00000000
--- a/.codex/hooks.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "description": "Review the plan, the task's necessity, the diff, architecture and names, plus the full review of a finished OpenSpec proposal and a finished implementation, before Codex finishes a turn.",
- "hooks": {
- "SessionStart": [
- {
- "hooks": [
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" session-start --client codex",
- "timeout": 10
- }
- ]
- }
- ],
- "UserPromptSubmit": [
- {
- "hooks": [
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" snapshot --client codex",
- "timeout": 30
- }
- ]
- }
- ],
- "Stop": [
- {
- "hooks": [
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" plan --client codex",
- "timeout": 600,
- "statusMessage": "Reviewing the plan"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" necessity --client codex",
- "timeout": 600,
- "statusMessage": "Checking whether the task is needed"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" diff --client codex",
- "timeout": 600,
- "statusMessage": "Reviewing the diff"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" architecture --client codex",
- "timeout": 600,
- "statusMessage": "Checking architecture"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" naming --client codex",
- "timeout": 600,
- "statusMessage": "Checking names"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" implementation --client codex",
- "timeout": 7200,
- "statusMessage": "Full implementation review"
- },
- {
- "type": "command",
- "command": "\"$(git rev-parse --show-toplevel)/.agent-hooks/run.sh\" proposal --client codex",
- "timeout": 7200,
- "statusMessage": "Full proposal review"
- }
- ]
- }
- ]
- }
-}
diff --git a/.gitignore b/.gitignore
index d40f2205..d575744f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,12 +17,7 @@ node_modules/
.claude/*
!.claude/agents/
!.claude/settings.json
-!.claude/skills/
-.claude/skills/*
-!.claude/skills/git-commits/
-!.claude/skills/humanizer/
-!.claude/skills/run-app/
-!.claude/skills/testing/
+!.claude/skills
backend/cleanup_test_db.exe
plans/
diff --git a/AGENTS.md b/AGENTS.md
index 112cbc4f..75a37d31 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -18,7 +18,7 @@ This root file holds the engineering philosophy that applies everywhere.
## Mandatory communication skill
-At the start of every turn, before sending any message or taking any action, read the [how-to-communicate skill](.agents/skills/humanizer/SKILL.md) completely. Load it explicitly regardless of automatic skill selection. This applies to every request and workflow, for all agents working in this repository, including Claude Code, Codex and subagents.
+At the start of every turn, before sending any message or taking any action, read the [how-to-communicate skill](.agents/skills/humanizer/SKILL.md) completely. Load it explicitly regardless of automatic skill selection. This applies to every request and workflow, for all agents working in this repository, including Claude Code and its subagents.
Apply the skill in embedded mode to all agent-authored prose, including chat responses, progress updates, plans, documentation, OpenSpec artifacts, review findings, commit messages and pull request text. Prioritize the reader's understanding, factual accuracy and necessary context before style and brevity. Run its draft, audit and final pass internally, then emit only the final text. Preserve exact code, commands, paths, identifiers, schemas, required templates, quotations and user-provided text unless the user asks to edit them. Select relevant information for original answers without hiding material limitations; preserve substantive claims when editing supplied text unless summarization is requested. Editing must not change facts, behavior, scope or technical meaning.
@@ -30,6 +30,8 @@ Reply to the user in the language they write in, and keep everything committed t
Work happens on a Fedora host; any other host distro is on its own. Tool versions are pinned in [`mise.toml`](mise.toml): run `mise install` once and activate mise in your shell, so every command below resolves to the pinned version. In a fresh worktree, copy `.env.example` to `.env`.
+The repository's skills live in `.agents/skills/`; `.claude/skills` is a symlink to that directory, so each skill has one source file.
+
| Command | Purpose |
|---|---|
| `just run` | Start the app locally: dev database, test fixtures, WAL backup source with its load generator, backend and frontend; seeds a dev account with databases and restarts the backend when its code changes |
@@ -135,7 +137,7 @@ Several agents sometimes work in one branch at once. A file or change the agent
### Agent memory
-The agent writes no rules, preferences or facts to its local memory outside the repository, such as `~/.claude/projects/*/memory`. Other agents and people cannot read that memory, Claude Code and Codex keep separate ones, and it drifts from the repository rules. A rule or preference that must outlive the session goes, with the user's consent, into an `AGENTS.md` file or a repository skill.
+The agent writes no rules, preferences or facts to its local memory outside the repository, such as `~/.claude/projects/*/memory`. Other agents and people cannot read that memory, and it drifts from the repository rules. A rule or preference that must outlive the session goes, with the user's consent, into an `AGENTS.md` file or a repository skill.
### Naming
@@ -261,6 +263,8 @@ One rule is written in one place. Other documents link to it instead of retellin
## OpenSpec
+The `openspec-*` skills are generated by OpenSpec for Claude Code, plus a hand-added "Humanizer preflight" section; after regenerating them, restore that section.
+
A request to write a spec, write up a change or write its artifacts goes through the `openspec-propose` skill, and an edit to a finished change through `openspec-update-change`. This way the change gets every artifact in OpenSpec format at once.
When the user asks to pack a change, in any language, the agent first checks that every task in its `tasks.md` is checked; if one is not, it changes nothing and names the unchecked tasks. Otherwise it archives the change through the `openspec-archive-change` skill, and the pack request answers that skill's sync prompt: "Sync now" when the main specs need the delta specs, "Archive now" when they are already synced. Then it commits the implementation, the main specs and the archived change in one commit per the [Git commits skill](.agents/skills/git-commits/SKILL.md). The request is the user's consent to the sync and to that commit, so the agent asks about neither again. The commit leaves out changes the agent did not make, per [Other agents' changes in the working tree](#other-agents-changes-in-the-working-tree), and the agent does not push.
diff --git a/openspec/specs/agent-workflow/spec.md b/openspec/specs/agent-workflow/spec.md
index d517f6af..b96a11d0 100644
--- a/openspec/specs/agent-workflow/spec.md
+++ b/openspec/specs/agent-workflow/spec.md
@@ -23,8 +23,8 @@ After a review hook blocked the turn and the agent fixed or rejected the finding
- **WHEN** the diff check blocks the turn because a test is missing, and the agent adds the test and finishes the turn again
- **THEN** the agent's reply is a summary of the finished work for the user and does not mention the diff check or its finding
-#### Scenario: A quick check blocks a plan in the final message
-- **WHEN** in Codex the necessity check blocks a plan the agent wrote in its final message
+#### Scenario: A quick check blocks a plan
+- **WHEN** the necessity check blocks a plan the agent submits through ExitPlanMode
- **THEN** the block text asks the agent to revise the plan and show it again, not to write a summary of a result
#### Scenario: The full implementation review blocks a turn
@@ -68,16 +68,16 @@ The agent MUST NOT write rules, preferences or facts to its local memory outside
- **WHEN** the user says that every future change should do something a certain way
- **THEN** the agent proposes the edit to `AGENTS.md` or a skill and writes nothing to its local memory
-### Requirement: Every repository skill is available to each agent client
-Each of the repository's own skills, that is every skill except the generated `openspec-*` skills, SHALL be loadable as a skill both in Claude Code and in Codex, from one source file, so the two clients never read different versions of it.
+### Requirement: Every repository skill has one source file
+Every skill of the repository, including the generated `openspec-*` skills, SHALL have one source file under `.agents/skills/`. Claude Code SHALL load it through `.claude/skills`, a symlink to that directory, so no copy can drift from the source.
#### Scenario: The commit skill in Claude Code
- **WHEN** Claude Code lists the skills it can load in this repository
-- **THEN** the list contains the Git commits skill, and it reads the same file Codex reads
+- **THEN** the list contains the Git commits skill, read from `.agents/skills/git-commits/SKILL.md`
### Requirement: The agent can see and drive the local app
-The repository SHALL register one browser automation server for both Claude Code and Codex. With it, an agent opens pages of the local app and reads what the page shows, including a screenshot, the page structure, console messages and network requests. It also clicks, types and navigates. Both clients SHALL start the server from the same repository configuration. The server SHALL drive the Chrome browser installed on the host. Each agent session SHALL get its own temporary browser profile, which is discarded when the session's browser closes, so that two sessions running at once do not block each other and no sign-in carries over between sessions.
+The repository SHALL register one browser automation server for Claude Code. With it, an agent opens pages of the local app and reads what the page shows, including a screenshot, the page structure, console messages and network requests. It also clicks, types and navigates. Claude Code SHALL start the server from the repository configuration. The server SHALL drive the Chrome browser installed on the host. Each agent session SHALL get its own temporary browser profile, which is discarded when the session's browser closes, so that two sessions running at once do not block each other and no sign-in carries over between sessions.
The repository SHALL hold a skill that tells the agent how to check the app in the browser:
@@ -123,11 +123,6 @@ A browser check SHALL add to the tests a task names and SHALL NOT replace them.
- **WHEN** two agent sessions open the browser at the same time
- **THEN** both browsers start, each with its own empty profile
-#### Scenario: Codex opens a page
-
-- **WHEN** Codex is started in the repository
-- **THEN** it lists the same browser server Claude Code uses, at the same pinned version
-
### Requirement: The developer chooses a visible or headless browser
The browser the agent drives SHALL run headless unless the developer asks otherwise. The `BROWSER_HEADLESS` setting in the developer's `.env` file SHALL choose headless when `true` and a visible window when `false`. A value set in the environment the agent client starts from SHALL take precedence over the file. When neither sets it, the browser SHALL run headless. Any value other than `true` or `false` SHALL keep the browser server from starting, with an error that names `BROWSER_HEADLESS`. The example environment file SHALL contain the setting with its default value. The choice SHALL take effect the next time the agent client starts the browser server.
diff --git a/openspec/specs/implementation-review/spec.md b/openspec/specs/implementation-review/spec.md
index 2fa867a3..1f9948f0 100644
--- a/openspec/specs/implementation-review/spec.md
+++ b/openspec/specs/implementation-review/spec.md
@@ -6,7 +6,7 @@ Reviews the finished implementation of an OpenSpec change as a whole, so that bu
## Requirements
### Requirement: The full implementation review starts after a change is implemented
-The hook that runs when the agent finishes a turn, in Claude Code and in Codex, SHALL start the full implementation review when all of these hold: every task of an active change is checked, the working tree changed during this turn, and its state differs from the last state the full implementation review accepted for this change. The accepted state SHALL be stored per change, not per session. The full implementation review MUST NOT start while a task is unchecked, in a turn that left the working tree unchanged, or in a turn whose request carries an OpenSpec planning command. Archived changes are not reviewed.
+The hook that runs when the agent finishes a turn SHALL start the full implementation review when all of these hold: every task of an active change is checked, the working tree changed during this turn, and its state differs from the last state the full implementation review accepted for this change. The accepted state SHALL be stored per change, not per session. The full implementation review MUST NOT start while a task is unchecked, in a turn that left the working tree unchanged, or in a turn whose request carries an OpenSpec planning command. Archived changes are not reviewed.
#### Scenario: The agent checks the last task
- **WHEN** the agent checks the last task of a change and finishes the turn
@@ -103,11 +103,11 @@ The tests reviewer SHALL check every test the change added or changed against th
- **THEN** the tests reviewer returns no finding about the missing section, because the module check runs the hook tests
### Requirement: Full review models
-The full review reviewers SHALL run on Opus with `medium` effort in Claude Code and on `gpt-6.1-sol` with `high` effort in Codex. The quick checks SHALL run on Opus with `low` effort in Claude Code and on `gpt-6.1-sol` with `low` effort in Codex.
+The full review reviewers SHALL run on Opus with `medium` effort. The quick checks SHALL run on Opus with `low` effort.
-#### Scenario: Review in Codex
-- **WHEN** the full review starts from Codex
-- **THEN** the reviewers run on `gpt-6.1-sol` with `high` effort
+#### Scenario: Full review in Claude Code
+- **WHEN** the full implementation review starts from Claude Code
+- **THEN** the reviewers run on Opus with `medium` effort
#### Scenario: Quick check in Claude Code
- **WHEN** the diff check starts from Claude Code
diff --git a/openspec/specs/proposal-review/spec.md b/openspec/specs/proposal-review/spec.md
index 266f7e30..441b9854 100644
--- a/openspec/specs/proposal-review/spec.md
+++ b/openspec/specs/proposal-review/spec.md
@@ -6,7 +6,7 @@ Reviews a finished OpenSpec proposal as a whole before implementation, so that g
## Requirements
### Requirement: The full proposal review starts once the proposal is written
-The hook that runs when the agent finishes a turn, in Claude Code and in Codex, SHALL start the full proposal review of an active change when all of these hold: the change has every artifact its schema requires, its task list has tasks and none is checked, the change's files changed during this turn, and their state differs from the last state the full proposal review accepted for this change. The turn SHALL be recognized by the change's files, not by the request text: whether the agent started through a command, a skill or a plain request MUST NOT matter. The accepted state SHALL be stored per change, not per session. Archived changes are not reviewed.
+The hook that runs when the agent finishes a turn SHALL start the full proposal review of an active change when all of these hold: the change has every artifact its schema requires, its task list has tasks and none is checked, the change's files changed during this turn, and their state differs from the last state the full proposal review accepted for this change. The turn SHALL be recognized by the change's files, not by the request text: whether the agent started through a command, a skill or a plain request MUST NOT matter. The accepted state SHALL be stored per change, not per session. Archived changes are not reviewed.
#### Scenario: The agent writes every artifact after a plain request
- **WHEN** the user writes "write a spec for this", and the agent creates the proposal, design, delta specs and tasks and finishes the turn
diff --git a/openspec/specs/review-hook-launch/spec.md b/openspec/specs/review-hook-launch/spec.md
index 9c01710d..e11cf3dc 100644
--- a/openspec/specs/review-hook-launch/spec.md
+++ b/openspec/specs/review-hook-launch/spec.md
@@ -7,7 +7,7 @@ Makes the review hooks start the same way in every environment and refuse to sta
## Requirements
### Requirement: Hooks run with the repository's pinned tools
-Every review hook, in Claude Code and in Codex, SHALL start through one launcher that runs the hook with the Python and OpenSpec versions pinned in the repository's tool versions file. The launcher SHALL find the version manager even when the client was started outside a login shell, for example from an IDE. The launcher MUST NOT install a missing tool itself, because an installation would not fit the hook timeout.
+Every review hook SHALL start through one launcher that runs the hook with the Python and OpenSpec versions pinned in the repository's tool versions file. The launcher SHALL find the version manager even when the client was started outside a login shell, for example from an IDE. The launcher MUST NOT install a missing tool itself, because an installation would not fit the hook timeout.
#### Scenario: A client started from an IDE
- **WHEN** Claude Code was started from an IDE whose environment does not activate the version manager, and the agent finishes a turn
@@ -33,15 +33,15 @@ When the launcher cannot find the version manager, when the hook exits with an e
- **THEN** the agent stops, and the user sees which hook action failed, its exit code, and that `just doctor` checks the environment
### Requirement: The environment check reports every tool the hooks need
-The repository SHALL have a command that reports, one line per tool, whether the hooks can find Python, git, OpenSpec and the CLI of at least one reviewer client, Claude Code or Codex. The command SHALL run through the same launcher as the hooks, and SHALL exit with a non-zero code when any of them is missing or the version manager cannot be found.
+The repository SHALL have a command that reports, one line per tool, whether the hooks can find Python, git, OpenSpec and the Claude Code CLI that runs the reviewers. The command SHALL run through the same launcher as the hooks, and SHALL exit with a non-zero code when any of them is missing or the version manager cannot be found.
#### Scenario: Every tool is present
- **WHEN** the user runs `just doctor` with every tool installed
- **THEN** each tool is reported with its path and the command exits with code 0
#### Scenario: No reviewer CLI
-- **WHEN** neither the Claude Code CLI nor the Codex CLI is installed and the user runs `just doctor`
-- **THEN** the command reports that no reviewer CLI was found and exits with a non-zero code
+- **WHEN** the Claude Code CLI is not installed and the user runs `just doctor`
+- **THEN** the command reports `claude` as not found and exits with a non-zero code
#### Scenario: No version manager
- **WHEN** the version manager cannot be found and the user runs `just doctor`
diff --git a/scripts/browser-mcp.sh b/scripts/browser-mcp.sh
index 34f2a427..5bc79850 100755
--- a/scripts/browser-mcp.sh
+++ b/scripts/browser-mcp.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Starts the Chrome DevTools MCP server that Claude Code (.mcp.json) and Codex (.codex/config.toml)
-# register, at the version pinned in mise.toml. BROWSER_HEADLESS chooses a headless browser (true,
+# Starts the Chrome DevTools MCP server that Claude Code registers in .mcp.json,
+# at the version pinned in mise.toml. BROWSER_HEADLESS chooses a headless browser (true,
# the default) or a visible window (false); a value in the client's environment wins over .env.
# --isolated gives every session a temporary profile, so parallel sessions never share a lock.
set -euo pipefail