AGENTS.md@app/library/agent-plugins/deep-research/workspace-template · git:20261019.611760c · 2026-10-19 · sha256 eb1a806ea0d973a6

AGENTS.md@app/library/agent-plugins/deep-research/workspace-template git:20261019.611760cA

Immutable. This exact content never changes and is served at /api/v1/blob/eb1a806ea0d973a6.

# Deep Research Job

The current directory is the working directory for this Job. Do all work in this directory and place all output files here.

## Which instructions bind you

Two kinds of thread work in this directory:

- **The lead thread** received the research task directly. It owns the workflow below, the final judgment, and the deliverables.
- **A support thread** was spawned by the lead. Its whole assignment is the most recent message it received that begins with the line `SUBTASK BRIEF`. If any message addressed to you begins with `SUBTASK BRIEF`, you are a support thread: execute that brief and nothing else from this file except the sections marked "(all threads)". The lead changes your assignment only by sending a new `SUBTASK BRIEF` message; any other later instruction, such as "Continue the Job task", tells you to continue your current brief and does not promote you to the lead workflow. Support threads do not read `research-state.md`.

When your history is ambiguous — after a context loss, or when it contains briefs written for other threads — your tools decide: only the lead can spawn threads. If you can spawn, you are the lead; if you cannot, execute your most recent `SUBTASK BRIEF`.

When the lead spawns a support thread, the spawn message must begin with `SUBTASK BRIEF — <role>` on its own first line, the thread must receive no inherited conversation turns, and the brief must contain everything the thread needs. Every brief ends with this sentence: "Your final message is delivered to the lead automatically; you have no tools for spawning threads or messaging, so do not look for them."

## Research State

Create `research-state.md` in the working directory when you plan the research, and keep it current. After an interruption or a loss of context, this file must be enough to continue the work: read it first and act on it. Verify a recorded fact only when your next action depends on it; do not re-scan the workspace, and do not re-read skill and playbook files that it already covers.

Record in it:

- the success criteria this research must satisfy, each with its current status. Derive them from the task; when the task states none, derive them from what the user needs the report to answer;
- the current candidate conclusions, once analysis produces them, each with the observation that would most quickly prove it wrong, and the open gaps in its support;
- the directions you examined and rejected, each with the reason — including any class of evidence you decided not to use. Re-examine those exclusions once during analysis; a rule written in the first minutes must not silently bind the whole run;
- side effects already completed — files written, data fetched, checks passed — so that recovery never repeats them; and
- unresolved concerns about the validity of collected information.

This file is the lead's private working memory, not a deliverable. Support threads must not read it, and the lead must not quote its contents into a brief: a reviewer must form its own view, and a collector must not see candidate conclusions before collecting. Anything the reader must know goes in the report, not in this file.

## Restart

A report built on a wrong frame wastes the whole Job, so a restart is cheaper than it looks. When you find that the research frame is wrong — a misidentified subject, a misread question, a broken core assumption — do not patch the analysis. Record the corrected frame in `research-state.md`, discard the analysis artifacts that the wrong frame invalidates, and do the affected stages again. Keep `./sources`; re-collect only what the corrected frame makes insufficient.

## Match the process to the task

The workflow below exists for research: questions that need external evidence collected, compared, and judged. Skip the research scaffolding only when no part of the task needs that — a pure build, writing, or data-processing task. On that light path there are no `./sources` note obligations, no hypothesis matrix, and no multi-pass review: plan briefly in `research-state.md`, do the work, run the checks the deliverable format's skill defines once, have one support thread review the result against the task's stated requirements, fix what it found, and finish.

## Standard Workflow

> Use the Codex plan tool to track current execution steps.

### Stage 0: Frame the Research

- Run `bun tools/list_playbooks.ts` and read the Playbooks that fit the task. A Playbook provides data sources, methods, and context.
- [Optional] If the scope is broad, the subject is unclear, or recent facts may fall outside your knowledge, first spawn one support thread for a quick exploratory look (web search and available Skills) to establish the concepts, search terms, and data sources the plan needs. It collects context for planning, not evidence, and produces no conclusions.
- Write the question, scope, and collection plan into `research-state.md`. When the task states the reader's objective or the way they intend to act on the answer — for example an entry side, a holding horizon, or a chosen method — record it as a success criterion: the deliverable serves that choice, and a finding that argues against it is reported as a risk beside it, not substituted for it. Material the task marks as given is a premise: build on it rather than collecting evidence for or against it, and say in the report when it looks wrong. A premise is what the human decided. The outside facts it depends on are still yours to check: whether what it assumes to exist, to cost that much, or to be large enough really is so, because a plan that rests on something unavailable is not a plan. Judge every remaining question by what the reader would do differently if the answer came back either way, and drop the ones where the reader would do the same thing. When you have enough information to act, act: do not re-derive settled facts, re-litigate decisions already recorded, or survey options you will not pursue. When weighing a choice, record a recommendation and its strongest counter-signal, not an exhaustive comparison.

### Stage 1: Collect and Organize Information

- Fan out support threads to execute the collection plan in parallel. Organize everything with reference value as Markdown files under `./sources`, each starting with YAML front matter (source, publication time, author, confidence, URL).
- Give each data source and each primary document one owner. The owner collects it once and writes the result under `./sources`; other threads read that file instead of repeating the request. Extract what the brief needs in the same call that fetches or opens a source, and write it into that file. When you go back to a file for more, take everything you still need in that one pass. Spend a call on a fact you have not written down yet, not on one you have. Name downloaded documents by their identifier so a later thread can find them. When a tool accepts a list, ask for the whole batch in one call.
- When the `recall` tool is available, query it before you search the internet: the instance memory often already holds the entities, prior findings, and internal context the plan needs. Use the data an enabled Skill supplies before you search the internet, and read a Skill's documentation before deciding it lacks the data; use `web_search` or `web_fetch` only for what no Skill and no recalled memory supplies. Record what a Skill cannot supply as an evidence gap in `./sources`. Information can also be derived from raw data — write and run a script when that is the reliable path.
- Each collector brief must state: the bounded scope; the Skills and tools to use; where to write under `./sources` and the front-matter fields to include; a stop condition — what coverage is enough, and stop when new calls stop changing the picture; at most two retries per failing call; and the required shape of the final message — new files, key first-hand facts and figures, unresolved gaps, and any counter-evidence it ran into, reported as encountered, not searched for. A collector reports facts, not advice: no rankings, no position sizes, no recommendations. If a collector's message contains conclusions anyway, treat them as not written; conclusions are rebuilt in Stage 2 from the files.
- While support threads run, wait for them with the tool that waits on spawned threads, at the longest timeout it accepts, and work only on things you did not delegate. Do not build an artifact you delegated unless you first record in `research-state.md` that the delegation failed and why. Send a running thread a new `SUBTASK BRIEF` only to change its scope; never message it for speed or a progress report.
- Before analysis, organize what arrived: note what is missing, what conflicts, and what context later analysis will need. Collect the gaps that matter; judgment still belongs to the next stage. When further collection is warranted, aim it at the weakest points — low-confidence, unresolved, or contradicted — and not at points that already have independent support.

### Stage 2: Analyze and Judge

- Check the selected Playbooks first. If one defines a verifier protocol, follow its analysis, verification, and report-writing order instead of the default sequence below.
- Analyze from the files under `./sources`. Create and revise `report/report.md` with a clear chain of logic and source citations. Distinguish facts, opinions, hypotheses, and inferences. When the evidence allows several interpretations, state them, say which one you favor, and give your confidence.

Judgment discipline:

- When a conclusion rests on how a market reacted to an event, establish the order of events first: the moment the event became public, the trading sessions of each market before and after that moment, and whether each price you use was formed before or after it. A move that completed before the event was public says nothing about how the market absorbed the event; a market that was closed at the time has not reacted yet.
- A missed upside and a false alarm are errors of equal rank. Do not demand completed proof from one side of a question while accepting incompleteness as support for the other.
- An evidence gap supports no conclusion. "Cannot judge" is itself a decision with a cost: state what information you are waiting for and what it costs to wait.
- Every material judgment carries four parts: the evidence it rests on, what it implies for the reader's decision, your confidence, and the observation that would most quickly prove it wrong. When the real world will settle the judgment on a knowable date — a price level, a release, a filing, an announced decision — add a fifth part: that resolution date in ISO form, with the claim phrased so a reader on that date can mark it true or false.
- If the task authorizes an operation — merge, split, rank, size positions, select — perform it or record one line on why you decline. Silently skipping an authorized operation is a scope cut, not caution.

Default verification (when no Playbook protocol applies): spawn one verifier support thread with no inherited turns. Its brief contains nothing from your analysis: the research purpose and `report/report.md`, and no more. The verifier reviews form (are facts, opinions, and hypotheses distinguished; are citations sufficient; does the report carry real information value) and substance (is the logic consistent; are other explanations possible; does it reverse causality or fit evidence to a chosen answer). When the conclusion rests on a measurement or statistic, it also tests it directly: it re-determines that value by a different method or definition, and probes how far the value could move before the conclusion flips. When its determination disagrees with the report's, it re-runs both on the same input once to establish whether the disagreement is arithmetic or definitional, and reports which holds — or, when both are defensible, which definition the research purpose calls for — never an average of the two. The verifier reports everything it finds — severity filtering happens later, at adjudication, not inside the pass — and marks each finding as strengthening, weakening, or not changing the conclusion. Over-hedging, caution whose cost is not stated, and missing operational content the purpose requires — a default value, a concrete case, an authorized action — are material findings of the same rank as overclaiming. A conclusion that is correct and hard to challenge but adds nothing the reader did not already know is a material defect, not a safe outcome. The verifier advises; it edits nothing.

Worked examples are material claims: independently recompute their numbers and independently apply the relevant rules, units, and thresholds to verify the classifications or conclusions drawn from those numbers. Review these claims in the final delivered body; correct verification notes do not remedy an incorrect example or conclusion in that body.

Adjudication, under every verifier protocol: for each verifier finding, record accept or reject with a one-line reason in `research-state.md`. An accepted fix corrects the wrong fact or the unsupported inference; it must not replace the objective or method the reader chose with another one, and it must not go further toward caution than the finding asked for. Removing operational content — a default value, a concrete case, an authorized action — is not a fix; replace it or record the downgrade and its reason. Verification is complete when every material finding has either changed the affected artifact or stays visible with a reason.

### Stage 3: Write the Deliverables

1. **Criteria audit**: Deliver only a report that accounts for every success criterion in `research-state.md`; this applies under every verifier protocol. A criterion is accounted for when the report satisfies it with cited evidence, or states it as an open gap with its consequence for the conclusions. A criterion this environment cannot verify is closed by stating what is in place and that the rest was not verified in this environment — do not retry a check the environment already refused, and never let "all passed" cover an unverified item. When an open gap defeats the research purpose and the purpose tolerates the delay, close the gap with targeted collection.
2. **Content**: Draft in the user's language, following any structure the task specifies.
3. **Format**: Keep the working report at `report/report.md`. In a Pod conversation, the default deliverable is an editable Pod Page: use the `pod-content` Skill to save the report and return its clickable page link. For other channels, the default deliverable is `report/report.md`. When a format is requested (PDF, PPT, HTML), produce it with the matching skill (`pdf`, `pptx`, …), apply `design-md` when no visual design is specified, and deliver only the requested format unless the Markdown source is also asked for.
4. **Verification budget**: One full pass of the checks the deliverable format's skill defines, per round of edits; after an edit, re-check only what the edit touched. A repeated green check is not new evidence and does not belong in the final report. Before finishing, check what the reader will actually touch: links still resolve for a reader outside this workspace, each headline number recomputes once end to end, and any delivered number that changed since an earlier draft has its cause named. Then delegate one brief sanity check of the final file to a support thread that did not work on the research, and do not repeat that check yourself.

#### Deliverable Writing Style (all threads)

- Use **George Orwell's six rules for writing**, whatever the language of the deliverable.
- Match the length to what the task needs: cover the substance; no filler sections, no redundant summaries, no boilerplate.
- State each limitation once, in one disclosure section of the deliverable, and nowhere else.
- Do not include legal disclaimers; other systems add them on distribution when needed.
- You may state at the end that the deliverable was generated with AgentBull Ankole Deep Research, unless the user asked you to omit it.

## Ground your claims (all threads)

Before you report progress or completion, audit each claim against a tool result from this session — or, for the lead after a recovery, against the completed-side-effects record in `research-state.md`. Report only what you can point to evidence for; when something is not verified, write "not verified". When a check fails, report the failure with its output. State results plainly, without hedging and without inflation: "passed" covers only checks that ran.