Structured deep research pipeline with confirmation gates and resume support. Generates outline, launches parallel research agents, produces validated JSON results and markdown report.
Structured deep research pipeline with confirmation gates and resume support. Generates research outline from model knowledge + web search, launches parallel research agents, produces validated JSON results per item, and generates a markdown report. Supports resuming interrupted sessions.
Agent assumptions (applies to all agents and subagents):
Check for TARGET.md in the project root directory.
TARGET.md exists, read it in full and treat it as required context.date +%Y-%m-%d
Find the highest existing DR number:
ls workspace/research/ 2>/dev/null | grep -oE '[0-9]{4}' | sort -rn | head -1
New DR number = highest + 1. If no research sessions exist, start at 0001.
Generate a slug from the research topic:
Session directory: workspace/research/DR-<NNNN>-<slug>/
Do not create the directory yet. Wait until Gate 2 confirmation.
Trigger: User args contain the word "resume" and a path to an existing session directory.
Example invocation: /brutal-deepresearch resume research workspace/research/DR-0001-ai-coding
If resume mode is NOT detected, skip to Step 1.
outline.yaml from the given session path to get items listfields.yaml from the given session path to get field definitionsprogress.yaml (if it exists) for previous execution contextls <session_path>/results/*.json 2>/dev/null
ls <session_path>/results/*.started 2>/dev/null
Determine item status:
.json exists → completed (skip this item).started exists but no .json → interrupted (re-research this item)Compare items in outline.yaml against completed results:
Resume mode skips Steps 1-4 entirely — the outline and fields are already confirmed from the previous session.
Based on the user's research topic, use model knowledge to generate:
Items List: The main research objects/items in this domain. Each item should have:
name: Item namecategory: Classification (if applicable)description: Brief description of why this item is relevantField Framework: Suggested research field categories and fields per category. Each field should have:
name: Field name (snake_case)description: What this field capturesdetail_level: One of brief, moderate, or detailedPresent the framework to the user in a readable format.
This is a hard gate. Do not proceed past this step without explicit user confirmation.
Present:
Use AskUserQuestion to ask:
Hard gate: Do not proceed until user confirms. User can request additions or removals here.
Use AskUserQuestion to ask for time range:
Launch 1 web-search-agent (background) using the Task tool with model: sonnet and max_turns: 20.
Parameter Retrieval:
{topic}: User's research topic{YYYY-MM-DD}: Current date from Step 0.2{step1_output}: Complete output from Step 1 (items list + field framework){time_range}: User-specified time rangeHard Constraint: The following prompt must be strictly reproduced, only replacing variables in {xxx}. Do not modify structure or wording.
Prompt Template:
You are an elite internet researcher. Your task is to supplement an existing research framework with missing items and recommended fields.
## Research Methodology
Before searching, determine which search strategies apply to this topic. Use the appropriate strategies from the Search Strategy Reference below.
Get today's date first:
date +%Y-%m-%d
Generate 5-10 different search query variations to maximize coverage:
- Include technical terms, product names, and common variations
- Think of how different people might describe the same topic
- Use exact phrases in quotes for specific names
- Include version numbers and dates when relevant
## Information Gathering Standards
- Read beyond the first few results - valuable information is often buried
- Look for patterns across different sources
- Pay attention to dates to ensure relevance
- Note different approaches and their trade-offs
- Identify authoritative sources and experienced contributors
- Check for updated information or superseded approaches
- Verify across multiple sources when possible
## Task
Research topic: {topic}
Current date: {YYYY-MM-DD}
Based on the following initial framework, supplement latest items and recommended research fields.
## Existing Framework
{step1_output}
## Goals
1. Verify if existing items are missing important objects
2. Supplement items based on missing objects
3. Continue searching for {topic} related items within {time_range} and supplement
4. Supplement new fields
## Output Requirements
Return structured results directly (do not write files):
### Supplementary Items
- item_name: Brief explanation (why it should be added)
...
### Recommended Supplementary Fields
- field_name: Field description (why this dimension is needed)
...
### Sources
- [Source1](url1)
- [Source2](url2)
One-shot Example (assuming researching AI Coding History):
## Task
Research topic: AI Coding History
Current date: 2025-12-30
Based on the following initial framework, supplement latest items and recommended research fields.
## Existing Framework
### Items List
1. GitHub Copilot: Developed by Microsoft/GitHub, first mainstream AI coding assistant
2. Cursor: AI-first IDE, based on VSCode
...
### Field Framework
- Basic Info: name, release_date, company
- Technical Features: underlying_model, context_window
...
## Goals
1. Verify if existing items are missing important objects
2. Supplement items based on missing objects
3. Continue searching for AI Coding History related items within since 2024 and supplement
4. Supplement new fields
## Output Requirements
Return structured results directly (do not write files):
### Supplementary Items
- item_name: Brief explanation (why it should be added)
...
### Recommended Supplementary Fields
- field_name: Field description (why this dimension is needed)
...
### Sources
- [Source1](url1)
- [Source2](url2)
After the web search agent completes, merge its findings with the initial framework:
This is a hard gate. Do not proceed past this step without explicit user confirmation.
Present the merged outline:
Use AskUserQuestion to confirm the outline is correct.
User can say "add X item" or "add Y field" at this gate. If they do:
Repeat until user explicitly confirms. Do not generate files until confirmed.
After confirmation:
mkdir -p workspace/research/DR-<NNNN>-<slug>/results
Write outline.yaml: