| name | audit-paper |
| description | Rigorously audit scientific papers from arXiv or PDF. Runs 5-agent pipeline with adversarial review, mathematical verification, and code execution. Use when asked to review, audit, or analyze an academic paper. |
Paper Auditing Pipeline
Overview
You are orchestrating a rigorous 5-agent pipeline to audit a scientific/technical paper. Your goal is to produce a comprehensive, adversarial review that catches issues before publication.
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ "Audit this paper" โ
โ (YOU - Main Orchestrator) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Agent A: Deconstructor โ
โ Input: arXiv ID or PDF path โ
โ Output: Structured claim extraction (JSON) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Agent B โ โ Agent C โ โ Agent D โ
โ Formalist โ โ SKEPTIC โ โ Verifier โ
โ Math Audit โ โ ADVERSARY โ โ Code Exec โ
โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Agent E: Editor-in-Chief โ
โ Synthesizes all reports โ Final Decision Memo โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Input Parsing
Parse the user's input to determine the paper source:
arXiv ID formats:
arXiv:2512.15605
2512.15605
https://arxiv.org/abs/2512.15605
Local PDF:
./path/to/paper.pdf
/absolute/path/to/paper.pdf
def parse_input(arg):
arxiv_patterns = [
r'arXiv:(\d{4}\.\d{4,5})',
r'^(\d{4}\.\d{4,5})$',
r'arxiv\.org/abs/(\d{4}\.\d{4,5})'
]
for pattern in arxiv_patterns:
match = re.search(pattern, arg)
if match:
return {'type': 'arxiv', 'id': match.group(1)}
if arg.endswith('.pdf'):
return {'type': 'pdf', 'path': arg}
raise ValueError(f"Cannot parse input: {arg}")
Execution Flow
Phase 1: Paper Acquisition
For arXiv papers:
mkdir -p output/{paper_id}
Use WebFetch to get the paper from arXiv:
- Abstract page:
https://arxiv.org/abs/{paper_id}
- PDF:
https://arxiv.org/pdf/{paper_id}.pdf
For local PDFs:
- Verify file exists
- Extract paper ID from filename or generate one
- Copy to output directory
Phase 2: Agent A - Deconstruction
Run Agent A to extract structured claims:
Invoke skill: paper-audit:agent-a-deconstructor
Input: The paper content (PDF text or arXiv data)
Output: output/{paper_id}/deconstruction.json
Agent A deliverables:
Phase 3: Parallel Agent Execution (B, C, D)
IMPORTANT: Agents B, C, and D can run in PARALLEL since they all depend only on Agent A's output.
Launch these agents concurrently using the Task tool:
Agent B: Formalist (Math Audit)
Invoke skill: paper-audit:agent-b-formalist
Condition: Only if deconstruction.json has non-empty theoretical_claims
Output: output/{paper_id}/math_audit.md
Agent C: Skeptic (Adversarial Review)
Invoke skill: paper-audit:agent-c-skeptic
CRITICAL: This is the core adversarial agent - ensure maximum skepticism
Output:
- output/{paper_id}/adversarial_review.md
- output/{paper_id}/contradicting_papers.md
Agent C MUST:
Agent D: Verifier (Code Execution)
Invoke skill: paper-audit:agent-d-verifier
Output:
- output/{paper_id}/verification/main.py
- output/{paper_id}/verification/results.json
- output/{paper_id}/verification/execution_log.txt
- output/{paper_id}/verification/plots/
Agent D MUST:
Phase 4: Agent E - Synthesis
After all parallel agents complete:
Invoke skill: paper-audit:agent-e-editor
Input: All outputs from Agents A, B, C, D
Output:
- output/{paper_id}/decision_memo.md
- output/{paper_id}/FULL_RESEARCH_PROPOSAL.md
- output/{paper_id}/exploration_notebook.ipynb
- output/{paper_id}/literature_gaps.md
Phase 5: Create README Index
IMPORTANT: After all agents complete, create a README.md in the output directory to help users navigate the generated files. Users may be confused by the number of files generated.
Create output/{paper_id}/README.md with this structure:
# Paper Audit: {paper_title}
**arXiv:** {paper_id} | **Date:** {date} | **Decision:** {ACCEPT/MAJOR REVISION/REJECT}
## Quick Start - What to Read
| Priority | File | Description |
|----------|------|-------------|
| 1๏ธโฃ | `decision_memo.md` | **START HERE** - Final editorial decision with score breakdown |
| 2๏ธโฃ | `adversarial_review.md` | Critical issues and adversarial questions |
| 3๏ธโฃ | `math_audit.md` | Mathematical rigor analysis |
## All Generated Files
### Core Reports
- `decision_memo.md` - Final editorial decision (read first)
- `adversarial_review.md` - Skeptical analysis with 15+ adversarial questions
- `math_audit.md` - Mathematical rigor and calculation verification
- `contradicting_papers.md` - Prior art and conflicting research
### Research Outputs
- `FULL_RESEARCH_PROPOSAL.md` - Future research directions based on gaps found
- `literature_gaps.md` - Identified gaps in the literature
- `exploration_notebook.ipynb` - Interactive Jupyter notebook for exploration
### Data & Verification
- `deconstruction.json` - Structured extraction of all paper claims
- `verification/` - Code verification artifacts
- `main.py` - Verification scripts
- `results.json` - Verification results
- `plots/` - Generated visualizations
## Score Summary
- **Final Score:** {score}/10
{decision}
{difficulty}/10
Phase 6: Final Report
Display the final summary to the user and direct them to README.md:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AUDIT COMPLETE: {paper_id}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Paper: {title}
Authors: {authors}
DECISION: {ACCEPT/MAJOR REVISION/REJECT}
Score Breakdown:
โโ Agent B (Math): {score}/10 (weight: 30%)
โโ Agent C (Skeptic): {score}/10 (weight: 40%)
โโ Agent D (Verifier): {score}/10 (weight: 30%)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FINAL SCORE: {weighted_total}/10
Agent C Verdict: {SUSPICIOUS/QUESTIONABLE/DEFENSIBLE/ROBUST}
Rebuttal Difficulty: {score}/10
Verification Status: {X}/{Y} claims verified
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ START HERE: output/{paper_id}/README.md
The README provides a guided reading order for all generated
files based on your goals (quick summary, deep dive, research).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
IMPORTANT: Always end by pointing users to README.md as their entry point.
Progress Reporting
As orchestrator, report progress at each phase:
[paper-audit] Starting audit of {paper_id}...
[Phase 1] Fetching paper...
โ Paper downloaded: {title}
โ Output directory: output/{paper_id}/
[Phase 2] Agent A: Deconstructing paper...
โ Found {N} theoretical claims
โ Found {N} empirical claims
โ Found {N} comparative claims
โ Found {N} novelty claims
โ Saved: deconstruction.json
[Phase 3] Running parallel agents...
[Agent B] Auditing mathematical rigor...
[Agent C] Launching adversarial review...
[Agent C] Searching for contradicting papers...
[Agent D] Generating verification code...
[Agent D] Executing verification...
โ Agent B complete: {SOUND/QUESTIONABLE/N/A}
โ Agent C complete: {verdict}, {N} questions generated
โ Agent D complete: {X}/{Y} claims verified
[Phase 4] Agent E: Synthesizing reports...
โ Decision memo generated
โ Research proposal generated
โ Exploration notebook generated
[Phase 5] Creating README index...
โ README.md generated with reading guide
[Phase 6] Audit complete!
๐ Start here: output/{paper_id}/README.md
Error Handling
Paper Not Found
ERROR: Could not fetch paper {paper_id}
- Check if the arXiv ID is correct
- Check if the PDF path exists
- Try alternative format: arXiv:XXXX.XXXXX
Agent Failure
WARNING: Agent {X} failed with error: {error}
- Continuing with partial results
- {Agent} output will be marked as UNAVAILABLE
- Final score adjusted accordingly
Verification Code Failure
WARNING: Verification code failed after 3 self-healing attempts
- Manual intervention may be required
- See execution_log.txt for details
- Saved failing code for debugging
Configuration
Timeouts
- Paper fetch: 60 seconds
- Agent A: 5 minutes
- Agent B: 5 minutes
- Agent C: 10 minutes (includes web search)
- Agent D: 10 minutes (includes code execution)
- Agent E: 5 minutes
Verification Sandbox
- Prefer Docker if available
- Fallback to local subprocess with timeout
- Max execution time per script: 5 minutes
Checklist for Orchestrator
Before starting:
After Agent A:
After parallel agents:
After Agent E:
After README creation:
Final:
Example Invocation
User: Audit this paper: arXiv:2512.15605