Ar9av/PaperOrchestra / skills/content-refinement-agent
content-refinement-agent
VerifiedStep 5 of the PaperOrchestra pipeline (arXiv:2604.05018). Iteratively refine drafts/paper.tex by simulating peer review and applying targeted revisions, with strict accept/revert halt rules, deterministic 0-100 decision bands (Accept/Minor/Major/Reject) that drive a target-met early stop, and a Devil's Advocate concession-threshold guard that blocks acceptance on unresolved critical findings. Maintains a worklog and snapshots each iteration so revert is real, not symbolic. TRIGGER when the orchestrator delegates Step 5 or when the user asks to "refine the draft", "iterate on the paper", or "run peer review on this paper".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.3 KB |
| references/ai-failure-modes.md | markdown | 813 B |
| references/claim-evidence-map.md | markdown | 3.1 KB |
| references/da-reviewer.md | markdown | 3.9 KB |
| references/halt-rules.md | markdown | 6.1 KB |
| references/prompt.md | markdown | 5.7 KB |
| references/reverse-outline.md | markdown | 3.0 KB |
| references/reviewer-rubric.md | markdown | 6.8 KB |
| references/safe-revision-rules.md | markdown | 4.8 KB |
| references/writing-quality-check.md | markdown | 720 B |
| scripts/apply_worklog.py | script | 3.1 KB |
| scripts/concession_guard.py | script | 7.5 KB |
| scripts/decision_band.py | script | 3.6 KB |
| scripts/reverse_outline.py | script | 10.3 KB |
| scripts/score_delta.py | script | 7.2 KB |
| scripts/score_trajectory.py | script | 8.6 KB |
| scripts/snapshot.py | script | 1.6 KB |
| scripts/test_reverse_outline.py | script | 5.7 KB |
| scripts/update_critique_memory.py | script | 11.1 KB |
scripts/apply_worklog.py
View on GitHub#!/usr/bin/env python3
"""
apply_worklog.py — Append a timestamped iteration entry to worklog.json.
The worklog is the canonical history of the refinement loop: every
iteration's review, score, decision, and actions taken. The orchestrator
reads it at the end to identify the best snapshot to promote.
Usage:
python apply_worklog.py \\
--worklog workspace/refinement/worklog.json \\
--iter 2 \\
--review iter2/review.json \\
--score iter2/score.json \\
--decision ACCEPT_IMPROVED \\
--actions iter2/worklog_entry.json # the agent's emitted worklog block
The script creates worklog.json if it doesn't exist.
"""
import argparse
import datetime as dt
import json
import os
import sys
def load_json(path: str | None) -> dict | list | None:
if not path or not os.path.exists(path):
return None
with open(path) as f:
return json.load(f)
def main() -> int:
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("--worklog", required=True, help="path to worklog.json")
p.add_argument("--iter", type=int, required=True, help="iteration number (0-indexed)")
p.add_argument("--review", help="path to review.json for this iteration")
p.add_argument("--score", help="path to score.json for this iteration")
p.add_argument("--decision", required=True,
help="ACCEPT_IMPROVED / ACCEPT_TIED_NON_NEGATIVE / "
"REVERT_OVERALL_DECREASED / REVERT_TIED_NEGATIVE_SUBAXIS")
p.add_argument("--actions", help="path to the agent's worklog block JSON "
"(addressed_weaknesses, integrated_answers, actions_taken)")
p.add_argument("--halted-because", help="reason if this iteration triggers a halt")
args = p.parse_args()
if os.path.exists(args.worklog):
with open(args.worklog) as f:
wl = json.load(f)
else:
wl = {"iterations": [], "halted_because": None, "best_iter": None}
entry = {
"iter": args.iter,
"timestamp": dt.datetime.now(dt.timezone.utc).isoformat(),
"decision": args.decision,
"review": load_json(args.review),
"score": load_json(args.score),
"actions": load_json(args.actions),
}
wl["iterations"].append(entry)
if args.halted_because:
wl["halted_because"] = args.halted_because
# Re-compute best_iter: highest accepted overall_score
accepted = [
it for it in wl["iterations"]
if it.get("decision", "").startswith("ACCEPT") and it.get("score")
]
if accepted:
best = max(accepted, key=lambda it: it["score"].get("overall_score", 0))
wl["best_iter"] = best["iter"]
os.makedirs(os.path.dirname(os.path.abspath(args.worklog)) or ".", exist_ok=True)
with open(args.worklog, "w") as f:
json.dump(wl, f, indent=2, ensure_ascii=False)
print(f"OK: appended iter {args.iter} ({args.decision}) to {args.worklog}")
if wl["best_iter"] is not None:
print(f" current best_iter: {wl['best_iter']}")
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |