dr-run
Skill4 starsChanged 7 months agoMITView on GitHub
Execute the next batch of research tasks autonomously. Reads todo.md, spawns subagents for each task, verifies output, and loops until the current phase is complete or a stop condition is hit. Use after /dr-new has scaffolded the project.
The file
Show its rules and text
We split this skill into the rules it gives an agent
51 rules. About 0 are common, 23 are distinctive, and 28 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
When auto mode is active:
- Distinctive: line 21
All web searches, fetches, and scrapes proceed without asking
- Distinctive: line 22
All file writes proceed without asking
- Distinctive: line 23
All bash commands needed for research proceed without asking
- Very specific: line 41
Check if the user passed a mode argument: sequential | parallel | sequential-auto-improve | parallel-auto-improve
- Very specific: line 42
Check if the user passed auto or ask as an additional argument
- Very specific: line 43
Check if the user passed --no-adversary flag
- Distinctive: line 44
If no mode argument, read CLAUDE.md for the "Execution Mode" section and use the default mode listed there
- Very specific: line 45
If no permission argument, read CLAUDE.md for the "Permission Mode" section.
- Very specific: line 46
If CLAUDE.md has no "Execution Mode" section, fall back to sequential
- Very specific: line 50
When --no-adversary is passed:
- Distinctive: line 51
All adversary batches in Step 10.5 are skipped
- Distinctive: line 53
No sidecar files are created
- Very specific: line 57
If mode is parallel or parallel-auto-improve:
- Very specific: line 59
Check if .research/parallel-plan.md exists AND was created after the last todo.md change (compare file modification times using stat)
- Very specific: line 60
If the plan does not exist or is stale: a.
- Very specific: line 66
If the plan exists and is fresh, re-read .research/parallel-plan.md and proceed using its recommended strategy.
- Very specific: line 70
Read .research/ROADMAP.md.
- Very specific: line 74
Update the current phase status to IN_PROGRESS in .research/ROADMAP.md.
- Very specific: line 86
Read .research/ARCHITECTURE.md to get the output schema for this phase's entity type.
- Distinctive: line 99
If auto mode is active, prepend this instruction to the subagent prompt:
- Very specific: line 104
Use the Agent tool with subagent_type: "dr-researcher" and include the full task context.
- Distinctive: line 110
Check each subagent's output:
- Distinctive: line 119
If all verification checks pass:
- Distinctive: line 124
If any verification check fails:
- Distinctive: line 130
If the parallel plan required temp files for RISKY tasks:
- Very specific: line 131
After the batch completes, read all data/{file}.{task_id}.tmp.json files
- Distinctive: line 133
Delete the temp files after successful merge
- Distinctive: line 134
If merge fails, log the error and leave temp files in place for manual review
- Very specific: line 150
Every 5 tasks (or after each parallel batch), write a checkpoint entry to .research/CHANGELOG.md:
- Distinctive: line 156
All phase tasks checked → go to Step 11
- Distinctive: line 162
Auto mode behavior: When auto mode is active, do not print intermediate progress messages between tasks.
- Distinctive: line 164
If not stopped, go to Step 3.
- Distinctive: line 170
After the checkpoint fires every 5 tasks (or after each parallel batch), run adversarial verification on the completed tasks from this …
- Very specific: line 174
Load provenance fields: Read provenance_fields from .research/ARCHITECTURE.md.
- Very specific: line 193
Use the Agent tool with subagent_type: "dr-adversary".
- Very specific: line 198
Validate adversary output: After the adversary completes, validate its output against prompts/adversary-schema.json:
- Very specific: line 199
If verdict is refuted or weakened and adversary_evidence is empty or missing → downgrade verdict to unverifiable
- Very specific: line 200
If verdict is weakened and confidence_delta is null → set confidence_delta to -0.3
- Very specific: line 201
If output fails schema validation entirely → claims stay pending, log warning to CHANGELOG: [timestamp] | adversary_batch | FAIL | …
- Distinctive: line 222
When all tasks for the current phase are checked:
- Very specific: line 223
Update phase status to COMPLETE in .research/ROADMAP.md
- Distinctive: line 224
Write phase completion entry to CHANGELOG
- Very specific: line 230
Before starting the next phase, automatically run the /dr-improve loop against the completed phase's data
- Distinctive: line 232
If improved: next phase uses the new researcher.
- Very specific: line 269
If CLAUDE.md is missing, tell the user to run /dr-new first.
- Very specific: line 270
If todo.md is missing, tell the user to run /dr-new first.
- Very specific: line 271
If a subagent crashes without output, mark the task [!] and continue.
- Distinctive: line 272
If a data file already exists, the subagent should merge/append, not overwrite.
- Distinctive: line 273
If parallel-plan.md is missing when running in parallel mode, spawn dr-planner first (Step 0.5).
- Very specific: line 274
If the planner recommends SEQUENTIAL ONLY, suggest /dr-run sequential and do not proceed in parallel.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are executing an autonomous research loop. Read CLAUDE.md for the full execution protocol.
Accepts optional arguments: /dr-run, /dr-run sequential, /dr-run parallel, /dr-run parallel-auto-improve, /dr-run sequential-auto-improve, /dr-run auto, /dr-run parallel auto, /dr-run sequential auto, /dr-run --no-adversary, /dr-run parallel --no-adversary.
Auto mode
/dr-run supports an auto flag that suppresses all permission prompts and user interruptions.
Usage: /dr-run → default, asks for approval on sensitive operations /dr-run auto → fully autonomous, no prompts /dr-run parallel auto → combine with parallel mode /dr-run sequential auto → explicit sequential + auto
When auto mode is active:
- All web searches, fetches, and scrapes proceed without asking
- All file writes proceed without asking
- All bash commands needed for research proceed without asking
- Subagents spawn with inherited permissions (no extra approval per subagent)
- User is NOT interrupted between tasks
- Research runs uninterrupted until: phase completes, stop condition hits, or auto mode is explicitly disabled
Safety in auto mode:
- The researcher subagent still follows all rules in CLAUDE.md (NOT_FOUND over guessing, source URLs required, 10-min time budget per task)
- Rate-limit detection still triggers checkpoints (see CHANGELOG)
- 3 consecutive failures still stops the run
- 3+ hour cumulative runtime still stops the run
- User can interrupt at any time with Ctrl+C
Auto mode is the recommended setting for overnight runs and long research sessions.
Execution Loop
Step 0: Determine Execution Mode, Permission Mode, and Adversary Flag
- Check if the user passed a mode argument:
sequential|parallel|sequential-auto-improve|parallel-auto-improve - Check if the user passed
autooraskas an additional argument - Check if the user passed
--no-adversaryflag - If no mode argument, read
CLAUDE.mdfor the "Execution Mode" section and use the default mode listed there - If no permission argument, read
CLAUDE.mdfor the "Permission Mode" section. If absent, default toask - If
CLAUDE.mdhas no "Execution Mode" section, fall back tosequential
Print: Mode: {mode} | Permissions: {auto or ask} | Adversary: {enabled or disabled}
When --no-adversary is passed:
- All adversary batches in Step 10.5 are skipped
- Provenance envelopes are still produced by the researcher (
adversary_verdictstays"pending"on all claims) - No sidecar files are created
Step 0.5: Dependency Analysis (parallel modes only)
If mode is parallel or parallel-auto-improve:
- Check if
.research/parallel-plan.mdexists AND was created after the lasttodo.mdchange (compare file modification times usingstat) - If the plan does not exist or is stale:
a. Spawn the
dr-plannersubagent to analyze the current phase. Use the Agent tool withsubagent_type: "dr-planner". b. After the planner returns, STOP and show the plan summary to the user. c. Print: "Parallel plan written to.research/parallel-plan.md. Review it, then run/dr-run parallelagain to proceed." d. If the plan recommends SEQUENTIAL ONLY, print: "The planner recommends sequential execution for this phase. Consider running/dr-run sequentialinstead." e. Do NOT proceed automatically — force the user to confirm by re-running the command after reviewing the plan. - If the plan exists and is fresh, re-read
.research/parallel-plan.mdand proceed using its recommended strategy.
Step 1: Find Current Phase
Read .research/ROADMAP.md. Find the current phase — the first phase with status NOT_STARTED or IN_PROGRESS. If all phases are COMPLETE, tell the user and suggest /dr-report.
Step 2: Activate Phase
Update the current phase status to IN_PROGRESS in .research/ROADMAP.md.
Step 3: Find Next Task(s)
Read todo.md.
Sequential modes: Find the first unchecked task matching - [ ] P{current_phase}.*. If no unchecked tasks remain for this phase, go to Step 11.
Parallel modes: Read .research/parallel-plan.md for the task classification table. Collect the next batch of up to 5 unchecked tasks that are classified as SAFE (or RISKY with merge strategy). Do not include BLOCKING tasks whose dependencies haven't completed yet. If no unchecked tasks remain for this phase, go to Step 11.
Step 4: Load Schema
Read .research/ARCHITECTURE.md to get the output schema for this phase's entity type.
Step 5: Spawn Researcher(s)
Sequential modes: Spawn ONE dr-researcher subagent with this prompt:
Your task: {task description from todo.md}
Output schema: {relevant schema from ARCHITECTURE.md}
Write to: {file path specified in the task}
Follow the data rules in CLAUDE.md. You have a 10-minute time budget.If auto mode is active, prepend this instruction to the subagent prompt:
Run autonomously. Do not ask for permission on any tool call. Complete the task or report NOT_FOUND for missing data.Use the Agent tool with subagent_type: "dr-researcher" and include the full task context.
Parallel modes: Spawn up to 5 dr-researcher subagents in a single message using multiple Agent tool calls. Each subagent gets the same prompt format as above (including the auto mode prefix if active) but for its specific task. If the parallel plan requires merge strategy for RISKY tasks, instruct each subagent to write to data/{file}.{task_id}.tmp.json instead of the canonical file.
Step 6: Verify Output
Check each subagent's output:
- a) File exists at the specified path
- b) File parses as valid JSON or valid markdown (depending on expected format)
- c) Required fields are populated (not empty strings, not null)
- d)
sourcesarray has at least 1 URL - e)
statusfield is set to COMPLETE, INCOMPLETE, or INACCESSIBLE
Step 7: Mark Success
If all verification checks pass:
- Change
- [ ]to- [x]intodo.mdfor this task
Step 8: Mark Failure
If any verification check fails:
- Change
- [ ]to- [!]intodo.mdfor this task - Note which checks failed
Step 8.5: Merge Temp Files (parallel modes with merge strategy)
If the parallel plan required temp files for RISKY tasks:
- After the batch completes, read all
data/{file}.{task_id}.tmp.jsonfiles - Merge entries into the canonical output file (append to existing array)
- Delete the temp files after successful merge
- If merge fails, log the error and leave temp files in place for manual review
Step 9: Log to Changelog
Append to .research/CHANGELOG.md:
[ISO timestamp] | {task_id} | DONE or FAIL | {output file} | {one-line summary} | mode:{sequential or parallel}For parallel batches, log all tasks in the batch together:
[ISO timestamp] | BATCH | {task_ids} | mode:parallel | {done_count} done, {fail_count} failedStep 10: Checkpoint
Every 5 tasks (or after each parallel batch), write a checkpoint entry to .research/CHANGELOG.md:
[ISO timestamp] | CHECKPOINT | completed: {N}, failed: {N}, remaining: {N} | mode:{mode} | patterns: {observations} | recommendation: continue/stopCheck stop conditions:
- All phase tasks checked → go to Step 11
- 3+ hours elapsed → stop with time warning
- 3+ failures in one batch (parallel) → fall back to sequential for the rest of the phase, log:
[ISO timestamp] | MODE_FALLBACK | parallel→sequential | reason: {N} failures in batch - 3 consecutive failures (sequential or after fallback) → stop the run with failure warning
- Rate limited 3 times → stop with rate limit warning
Auto mode behavior: When auto mode is active, do not print intermediate progress messages between tasks. Just log to CHANGELOG and keep going. Only print output at checkpoints and phase completion.
If not stopped, go to Step 3.
Step 10.5: Adversary Batch
Skip this step if --no-adversary flag was passed.
After the checkpoint fires every 5 tasks (or after each parallel batch), run adversarial verification on the completed tasks from this batch:
- Collect completed tasks: Gather the
[x]tasks from this batch only. Filter out[!](failed) and[ ](unchecked) tasks. If no[x]tasks in this batch, skip. - Load provenance fields: Read
provenance_fieldsfrom.research/ARCHITECTURE.md. The adversary only attacks claims on these fields. - Spawn adversary: Spawn the
dr-adversarysubagent with this prompt:
Verify the claims in these completed research entries.
Data files to check: {list of output file paths for the batch's [x] tasks}
Provenance fields to verify: {provenance_fields from ARCHITECTURE.md}
Source cache: .research/source-cache/
Adversary schema: prompts/adversary-schema.json
Write your verdicts to: data/{original-file}.adversary.json
If the sidecar file already exists, read it first and append your new verdicts to the existing array.
You have 5 minutes. Focus on provenance_fields claims only.Use the Agent tool with subagent_type: "dr-adversary".
Sequential mode: Adversary blocks (runs synchronously before next research task). ~4% time overhead.
Parallel mode: Adversary runs in the background (non-blocking) using run_in_background: true. Results merge into sidecar files when ready. Near-zero overhead because researchers and adversary write to different files (researchers → data/*.json, adversary → data/*.adversary.json).
- Validate adversary output: After the adversary completes, validate its output against
prompts/adversary-schema.json:- If verdict is
refutedorweakenedandadversary_evidenceis empty or missing → downgrade verdict tounverifiable - If verdict is
weakenedandconfidence_deltais null → setconfidence_deltato-0.3 - If output fails schema validation entirely → claims stay
pending, log warning to CHANGELOG:[timestamp] | adversary_batch | FAIL | [batch_task_ids] | Adversary output malformed, claims unverified
- If verdict is
- Calculate survival scores for each claim using the adversary verdicts:
confirmed:survival_score = confidence_score(unchanged)weakened:survival_score = max(0.0, confidence_score + confidence_delta)refuted:survival_score = 0.0unverifiable:survival_score = confidence_score * 0.5
- Log batch summary (3 lines to stdout):
Adversary batch {N}: {X} claims tested | confirmed: {A}, weakened: {B}, refuted: {C}, unverifiable: {D}
lowest: "{claim_text}" (score: {0.XX})- Error handling:
- Adversary timeout (>5 min): claims stay
pending, non-blocking warning in CHANGELOG - Adversary crash: claims stay
pending, mark batch as failed in CHANGELOG, continue to next research task - Sidecar file write failure: log warning, adversary results lost for this batch but run continues
- Adversary timeout (>5 min): claims stay
Step 11: Phase Complete
When all tasks for the current phase are checked:
- Update phase status to
COMPLETEin.research/ROADMAP.md - Write phase completion entry to CHANGELOG
- Count done
[x]and failed[!]tasks for this phase
Step 11.5: Auto-Improve (auto-improve modes only)
If mode is sequential-auto-improve or parallel-auto-improve:
- Before starting the next phase, automatically run the
/dr-improveloop against the completed phase's data - Log to CHANGELOG:
[ISO timestamp] | AUTO_IMPROVE | phase:{N} | old_pass_rate:{X}% | new_pass_rate:{Y}% | decision:{kept or reverted} - If improved: next phase uses the new researcher. If reverted: next phase uses the previous researcher.
- Continue to the next phase automatically.
Step 12: Completion Output
Print results based on mode:
Sequential modes:
Phase {N} complete. {done} done, {failed} failed.
Next steps:
/dr-status — see overall progress
/dr-review — validate data quality for this phase
/dr-improve — run self-improvement loop on the researcher
/dr-run — continue to next phaseParallel modes: Also show batch-level stats:
Phase {N} complete. {done} done, {failed} failed.
Batches: {batch_count} | Fallbacks to sequential: {fallback_count}
Next steps:
/dr-status — see overall progress (includes mode stats)
/dr-review — validate data quality for this phase
/dr-run — continue to next phaseAuto-improve modes: Also show researcher version history:
Researcher evolution: v1 ({score1}%) → v2 ({score2}%) → ...
Decision: {kept or reverted}Error Handling
- If CLAUDE.md is missing, tell the user to run
/dr-newfirst. - If todo.md is missing, tell the user to run
/dr-newfirst. - If a subagent crashes without output, mark the task
[!]and continue. - If a data file already exists, the subagent should merge/append, not overwrite.
- If parallel-plan.md is missing when running in parallel mode, spawn dr-planner first (Step 0.5).
- If the planner recommends SEQUENTIAL ONLY, suggest
/dr-run sequentialand do not proceed in parallel.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

