Adonis0123/adonis-skills / skills/open-code-review-loop
open-code-review-loop
UnverifiedRun a bounded OCR-delegation review-fix-re-review loop on a Git workspace until current evidence validates NO_FINDINGS. Use only when the user wants verified findings fixed and independently re-reviewed until clean with codex, claude-code, grok-build, or cursor-cli. Do not use for one-shot open-code-review-delegate or read-only review. A full loop request asks at most once for an unnamed Reviewer (recommending a product other than the host), then runs host mutation checks without further confirmation. Fail closed on missing ocr, reviewer mutation, skipped files, malformed output, stale evidence, or exhausted rounds.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.3 KB |
| evals/evals.json | config | 20.8 KB |
| evals/trigger-eval.json | config | 2.5 KB |
| references/adapter-contracts.md | markdown | 13.5 KB |
| references/fix-contract.md | markdown | 2.7 KB |
| references/fix-schema.json | config | 857 B |
| references/review-contract.md | markdown | 3.1 KB |
| references/review-schema.json | config | 2.8 KB |
| scripts/build_review_bundle.pyexecutable | script | 27.0 KB |
| scripts/extract_product_output.py | script | 3.6 KB |
| scripts/test_extract_product_output.py | script | 6.2 KB |
| scripts/test_validate_fix_result.py | script | 5.1 KB |
| scripts/test_validate_round.py | script | 103.0 KB |
| scripts/validate_fix_result.py | script | 5.4 KB |
| scripts/validate_round.pyexecutable | script | 41.4 KB |
scripts/test_extract_product_output.py
View on GitHub#!/usr/bin/env python3
from __future__ import annotations
import json
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
SCRIPT = Path(__file__).with_name("extract_product_output.py")
REFERENCES = Path(__file__).parents[1] / "references"
class ExtractProductOutputTest(unittest.TestCase):
def run_extract(
self, product: str, payload: object, session_id: str | None = None
) -> subprocess.CompletedProcess[str]:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
input_path = root / "input.json"
output_path = root / "output.json"
input_path.write_text(json.dumps(payload), encoding="utf-8")
command = [
sys.executable,
str(SCRIPT),
"--product",
product,
"--input",
str(input_path),
"--output",
str(output_path),
]
if session_id:
command.extend(["--session-id", session_id])
result = subprocess.run(
command,
check=False,
capture_output=True,
text=True,
)
if output_path.exists():
result.extracted = json.loads(output_path.read_text(encoding="utf-8"))
return result
def test_extracts_codex_direct_result(self) -> None:
payload = {
"schema_version": "1",
"reviewer": {"product": "codex", "session_id": None},
"verdict": "NO_FINDINGS",
}
result = self.run_extract("codex", payload, session_id="codex-session")
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.extracted["reviewer"]["product"], "codex")
self.assertEqual(result.extracted["reviewer"]["session_id"], "codex-session")
def test_extracts_claude_structured_output(self) -> None:
payload = {
"result": "human-readable text must not be parsed",
"session_id": "claude-session",
"structured_output": {
"schema_version": "1",
"reviewer": {"product": "wrong-product"},
"verdict": "FINDINGS",
},
}
result = self.run_extract("claude-code", payload)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.extracted["reviewer"]["product"], "claude-code")
self.assertEqual(result.extracted["reviewer"]["session_id"], "claude-session")
def test_extracts_grok_structured_output_and_ignores_text(self) -> None:
payload = {
"text": '{"first": true}{"second": true}',
"sessionId": "grok-session",
"structuredOutput": {
"schema_version": "1",
"reviewer": {},
"verdict": "NO_FINDINGS",
},
}
result = self.run_extract("grok-build", payload)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.extracted["reviewer"]["product"], "grok-build")
self.assertEqual(result.extracted["reviewer"]["session_id"], "grok-session")
def test_explicit_session_id_overrides_envelope(self) -> None:
payload = {
"session_id": "envelope-session",
"structured_output": {
"schema_version": "1",
"reviewer": {},
"verdict": "NO_FINDINGS",
},
}
result = self.run_extract(
"claude-code", payload, session_id="recorded-session"
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.extracted["reviewer"]["session_id"], "recorded-session")
def test_extracts_cursor_exact_json_result(self) -> None:
expected = {
"schema_version": "1",
"reviewer": {"product": "wrong-product", "session_id": "wrong-session"},
"verdict": "NO_FINDINGS",
}
result = self.run_extract(
"cursor-cli",
{"session_id": "cursor-session", "result": json.dumps(expected)},
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(result.extracted["reviewer"]["product"], "cursor-cli")
self.assertEqual(result.extracted["reviewer"]["session_id"], "cursor-session")
def test_rejects_cursor_prose_prefixed_json(self) -> None:
result = self.run_extract(
"cursor-cli",
{"result": 'Review complete.\n{"schema_version":"1"}'},
)
self.assertEqual(result.returncode, 2)
self.assertIn("exactly one JSON object", result.stderr)
def test_rejects_missing_product_field(self) -> None:
result = self.run_extract("grok-build", {"text": "{}"})
self.assertEqual(result.returncode, 2)
self.assertIn("structuredOutput", result.stderr)
class PortableSchemaTest(unittest.TestCase):
def assert_strict_object_shapes(self, node: object, path: str = "$") -> None:
if isinstance(node, dict):
if node.get("type") == "object":
properties = node.get("properties")
self.assertIsInstance(properties, dict, path)
self.assertEqual(
set(node.get("required", [])),
set(properties),
f"{path} must require every declared property",
)
self.assertFalse(node.get("additionalProperties", True), path)
for key, value in node.items():
self.assert_strict_object_shapes(value, f"{path}.{key}")
elif isinstance(node, list):
for index, value in enumerate(node):
self.assert_strict_object_shapes(value, f"{path}[{index}]")
def test_review_and_fix_schemas_are_portable_strict_objects(self) -> None:
for name in ("review-schema.json", "fix-schema.json"):
with self.subTest(name=name):
schema = json.loads((REFERENCES / name).read_text(encoding="utf-8"))
self.assert_strict_object_shapes(schema)
if __name__ == "__main__":
unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |