MongLong0214/frontier-simplify / skills/frontier-simplify-review
frontier-simplify-review
UnverifiedReview a change for concrete defects, check them with a refuter and a reproducer, then check repairs and their regressions against the preserved review. Use for substantial PR reviews or repeated review rounds. Stops automatic review after at most three attempts per PR and names the calling agent's next action; does not guarantee safe merge convergence.
scripts/lib/render-prompt.py
View on GitHub#!/usr/bin/env python3
"""Render a round prompt from SKILL.md.
SKILL.md is the authority for the prompt text. Copying it into a second file beside
the skill would be class G7 -- a formula restated outside its declared authority --
and the copy is what goes stale. So the harness reads the heading it needs and
substitutes the placeholders.
render-prompt.py SKILL.md 1 KEY=VALUE ...
render-prompt.py SKILL.md 1 --values-stdin
render-prompt.py SKILL.md refuter --values-stdin
"""
import json
import re
import sys
def fail(message):
sys.exit('render-prompt: ' + message)
def unique_object(pairs):
result = {}
for key, value in pairs:
if key in result:
raise ValueError('duplicate key')
result[key] = value
return result
if len(sys.argv) < 3:
fail('expected SKILL.md, round or validator role, and values')
skill, rnd = sys.argv[1:3]
args = sys.argv[3:]
if args == ['--values-stdin']:
try:
subs = json.loads(sys.stdin.buffer.read().decode('utf-8'), object_pairs_hook=unique_object)
except (UnicodeError, ValueError):
fail('values stdin must be a UTF-8 JSON object with unique string keys and values')
if not isinstance(subs, dict) or not all(isinstance(k, str) and isinstance(v, str)
for k, v in subs.items()):
fail('values stdin must be a UTF-8 JSON object with unique string keys and values')
else:
if '--values-stdin' in args or any('=' not in a for a in args):
fail('use either KEY=VALUE arguments or --values-stdin')
subs = dict(a.split('=', 1) for a in args)
try:
text = open(skill, encoding='utf-8').read()
except (OSError, UnicodeError):
fail('cannot read prompt source')
# The two validators check the finder's candidates; their prompts sit beside the round prompts.
heading = {'refuter': 'Refuter prompt', 'reproducer': 'Reproducer prompt'}.get(rnd, 'Round %s prompt' % rnd)
m = re.search(r"^## %s\s*$" % re.escape(heading), text, re.M)
if not m:
sys.exit("render-prompt: SKILL.md has no '## %s' heading" % heading)
fence = re.search(r"^```\w*\n(.*?)^```", text[m.end():], re.S | re.M)
if not fence:
sys.exit("render-prompt: no fenced block under '## %s'" % heading)
body = fence.group(1)
token = re.compile(r"\{\{([A-Z0-9_]+)\}\}")
left = sorted(set(token.findall(body)) - subs.keys())
if left:
# An unsubstituted placeholder reaches the reviewer as the literal string
# "{{BASE_SHA}}", and a reviewer that reviews a placeholder still answers.
sys.exit("render-prompt: unsubstituted placeholders: " + ", ".join(left))
try:
sys.stdout.buffer.write(token.sub(lambda match: subs[match.group(1)], body).encode('utf-8'))
except UnicodeError:
fail('rendered prompt is not valid UTF-8')
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: 471k | 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 |