From research-factory
Critical-review and auto-proceed mode handling, with fix-in-loop until APPROVED before next phase
How this skill is triggered — by the user, by Claude, or both
Slash command
/research-factory:critical-review-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill defines the behavior of the `--critical-review` and `--auto-proceed` flags for **all conductors** (DA, DE, PW, Rev). Every conductor activates this skill instead of duplicating the protocol.
This skill defines the behavior of the --critical-review and --auto-proceed flags for all conductors (DA, DE, PW, Rev). Every conductor activates this skill instead of duplicating the protocol.
Parse the user's first message for these flags (case-sensitive):
--critical-review — turn on adversarial review at every MANDATORY STOP--auto-proceed — overnight mode: skip user approval if all gates passIf neither flag is present → standard interactive behavior. SS-Critic is NOT invoked. Skip the rest of this skill.
--critical-review — Adversarial Review with Fix LoopAt every MANDATORY STOP, before presenting deliverables to the user:
If verdict is NOT READY or ALMOST, do NOT pass control back to the user yet. Run the fix loop:
Identify the fixer subagent based on the deliverable type:
| Deliverable | Fixer |
|---|---|
| Paper section / prose | PW-Drafter |
| LaTeX formatting / tables | PW-Typesetter |
| Citations / references | PW-Bibliographer |
| Regression / table results | DA-Executor |
| Sample / data construction | DA-Builder |
| Extraction code / cleaned data | DE-Miner / DE-Refiner |
| Referee response document | Rev-Respondent |
| Figures | SS-Vizmaker |
Delegate the EXACT critic findings to the fixer. Inline only the issues list — do NOT re-paste the full deliverable. Tell the fixer:
Re-invoke SS-Critic in re-review mode. Critic checks each prior issue (FIXED / PARTIAL / NOT FIXED / REGRESSED) and may add new issues.
Loop until verdict = APPROVED (zero CRITICAL, zero MAJOR) or max 3 rounds (not 5 — token budget).
Cap by issue count: if a single round still has >5 CRITICAL issues, abort the loop and escalate to the user — the deliverable needs structural rework, not patching.
--auto-proceed — Overnight ModeMANDATORY STOPs become conditional. Auto-approve only if ALL of these are true:
--critical-review is also active: the fix-loop above ended in APPROVED.If any condition fails → STOP and wait for the user.
Log every auto-approval to docs/_STATE.md:
Auto-approved: Phase {N} — {validator} APPROVED, Critic loop {rounds}r APPROVED
Timestamp: {date}
At pipeline end, present a summary of all auto-approved decisions for user acknowledgment.
The flag-gated review above handles prose/deliverable QA. This section handles a different failure mode: subagents stuck patching the same error class repeatedly (e.g., 16 jobs all failing on different DuckDB columns with the same root cause). This loop activates automatically — the user never has to ask for it.
column 'revenue' not found, column 'permno' not found → look like different errorsDuckDB fetchmany returns bytes for VARCHAR columns from this source → one structural fix resolves alldocs/_STATE.md:
Active error classes (this phase):
- duckdb-bytes-to-str-bse_daily_raw: attempts=2/3, last=2026-05-20T14:32, fixer=DE-Miner
"Scan ALL similar call sites in this script / phase in one pass. Do not patch only the failing line. Report structural patterns before fixing."
3 attempts on error class "{class label}" all failed.
Attempts: [round1 fix → outcome, round2 fix → outcome, round3 fix → outcome]
Request: structural diagnosis — what do all these failures share? Recommend root-level fix vs patch.
_STATE.mdWhen the conductor sees ≥2 failures already in this phase that share a root cause (even without retrying), it MUST detect the pattern before any individual fix:
Pattern detected before retry: N jobs failing with "{class}".
Individual patches will likely fail on the next similar call site.
Recommending: invoke SS-Critic for structural diagnosis NOW (skipping rounds 1-2).
When a fixer is dispatched and the conductor's message includes RETRY_ROUND: {N} and ERROR_CLASS: {label}, the fixer MUST:
_STATE.md before proposing a fixESCALATE: same root cause, no new fix available instead of repeatingEvery attempt must be logged to docs/_STATE.md under Active error classes. This survives context-window resets and prevents losing retry history. The retry count is the total across the session, not per-subagent-call — switching subagents does NOT reset the counter.
--auto-proceed does NOT bypass this escalation. At round 3, the conductor halts and waits for user input even in overnight mode (escalation is a structural decision, not a routine validation gate).npx claudepluginhub xuxiguo/research-factory-claude --plugin research-factoryManages brand identity, voice, visual assets, and messaging frameworks. Automates sync to design tokens and validates asset naming, size, and format.