research-workflow-orchestrator
Coordinate an entire research project without turning consequential scientific
decisions into silent automation. The orchestrator resumes from
.research/workflow_state.yml, performs safe work automatically, and asks for
one structured decision only when the next action crosses a declared gate.
This is a coordination skill, not a new research engine. It routes to the
existing research-hub skills and available CLI/MCP integrations. Read
references/workflow-contract.md before the first run. Read
references/tool-adapters.md only for the current stage or when selecting a
tool adapter. The machine-readable state contract is
references/workflow-state.schema.json.
Use when
- The user asks to run, resume, automate, or supervise a multi-stage research
project.
- Work spans at least three of topic scoping, discovery, synthesis, design,
experiments, writing, and release.
- A persistent human-in-the-loop audit trail is required.
Do not use for one isolated operation. Route a single literature table to
literature-triage-matrix, one design conversation to
research-design-helper, one paper summary to paper-summarize, or project
orientation alone to research-project-orienter.
Required inputs
- Project root.
- User objective and constraints.
- Existing
.research/ manifests, if present.
- Available tool capabilities. Discover them; never assume an MCP server,
connector, credential, or browser session exists.
If the state file does not exist, propose a workflow ID and start at orient.
Creating the local state file is reversible, but present the initial plan before
executing later stages.
Automation policy
Classify every proposed action before invoking a tool:
| Action class |
Default behavior |
| Read-only discovery, validation, comparison |
Run automatically |
| Local deterministic generation with a preview or rollback |
Run automatically, preserve provenance |
| Local reversible metadata update |
Run automatically when inside approved scope |
| External write, public communication, account change |
Stop at external_write |
| Costly or long experiment/simulation |
Stop at experiment_authorization |
| Semantic manuscript/rebuttal change |
Stop at semantic_revision |
| Submission, publication, release, merge, destructive cleanup |
Stop at release_authorization |
Unknown risk is gated. Tool availability never lowers the gate class.
Run loop
- Load
.research/workflow_state.yml and validate the fields used by the
current run. If absent, initialize from the schema; do not invent completed
decisions or artifacts.
- Orient with
research-project-orienter, or create a previewed local
manifest using research-context-compressor after presenting the initial
plan. This reversible project-local initialization needs no separate gate;
freezing its research question or scope still needs scope_commitment.
- Plan the smallest next stage. Name inputs, expected artifacts, tool
adapter, validation, risk class, and any gate.
- Decide:
- no gate: execute and validate;
- gate: show the decision packet and wait;
- missing capability: use the documented fallback or report a blocker.
- Record stage, action, hashes/provenance, validation result, and decision.
Write state atomically; never record success before validation passes.
- Advance only when exit criteria in the workflow contract pass. Otherwise
retry within the declared bound or stop with a concrete blocker.
- Resume from the recorded pending action. Never rerun a costly or external
action merely because a new chat/session started.
Human decision packet
At a gate, present only what the researcher needs to decide:
Gate: <gate id>
Decision: <one sentence>
Why now: <evidence and uncertainty>
Proposed action: <tool + exact mutation/cost/scope>
Preview: <diff, plan, candidates, or artifact link>
Reversible: <yes/no and rollback>
Options: accept / decline / revise / cancel
accept: record approval for the exact action and scope, then continue.
decline: record the decision, choose a safe alternative if one exists, and
do not repeatedly ask for the same rejected action.
revise: block execution until a replacement action with a new hash is
presented and accepted.
cancel: record cancellation and stop the workflow cleanly.
An accept is valid only through a signed policy checkpoint or exact local-TTY
hash confirmation. A bare actor label from an agent or MCP caller is not human
authorization.
Approval is scoped to the described action. A later public, destructive, more
expensive, or semantically different action needs a new decision.
Stage routing
| Stage |
Primary routes |
Required evidence before advancing |
orient |
research-project-orienter, research-context-compressor |
project manifest and open questions |
scope |
gap-to-topic, research-design-helper |
accepted question, criteria, constraints |
discover |
literature-triage-matrix, research-hub search, Zotero |
query log, deduplicated candidate set |
synthesize |
paper-summarize, paper-memory-builder, NotebookLM verifier |
claim-evidence map with gaps |
design |
research-design-helper |
design dossier and explicit assumptions |
execute |
project-specific code/experiment tools |
reproducible command, outputs, validation |
write |
academic writing skill chain |
source-linked draft and review findings |
release |
verification, Git/GitHub/submission tools |
release checklist and human authorization |
Do not synthesize claims from unverified metadata or treat a NotebookLM brief as
ground truth. Do not invent missing sources, results, approvals, or tool output.
State and provenance
- Canonical state path:
.research/workflow_state.yml.
- Store artifact paths plus SHA-256, stage, and timestamp. Do not store artifact
contents in state.
- Store action IDs, exact scope, parameter/preview hashes, resource bounds, and
decision summaries—not private deliberation or credentials. Execute an
accepted action only when these machine-verifiable fields still match.
- Store every attempt and validation result in
actions[]; terminal
completed/cancelled states have no pending action, and cancelled must
include a cancel decision.
- Keep
pending_action specific enough to resume, but never include API keys,
cookies, OAuth tokens, or secrets.
- If current bytes, dependencies, or time-sensitive inputs differ from the
recorded evidence, rerun only the smallest affected validation.
Failure behavior
- Bound retries per action; default maximum is two attempts unless the plan
declares a smaller limit.
- On repeated failure, set status to
blocked, preserve the last verified
artifact, and report the exact recovery condition.
- Never silently switch data sources, models, research questions, or inclusion
criteria.
- Never treat an unavailable MCP tool as permission to perform a broader browser
or shell mutation.
Completion output
Return:
- current stage and status;
- completed stages and validated artifacts;
- human decisions and their scope;
- unresolved evidence gaps or blockers;
- exact next action, or
none when complete.
The workflow is complete only when the release exit criteria pass or the user
explicitly ends the project. A draft alone is not completion.
Executable runtime
Use the domain service through either interface; both paths make the same state
transition:
- CLI:
research-hub workflow init|status|validate|decide|resume|migrate
- MCP:
workflow_initialize, workflow_status, workflow_validate,
workflow_decide, workflow_resume, and workflow_migrate
All CLI operations accept --json. Migration is a dry run unless --apply
is given; apply creates a backup and atomically replaces the state. Schema 1.0
remains readable, while decisions and resume require migration to schema 1.1.
The optional agent-collab-harness v0.4 policy/checkpoint layer is discovered
at runtime. If no policy is configured, research-hub keeps its standalone
behavior. If a policy is configured but the package, policy, or checkpoint is
unavailable, resume fails closed. research-hub doctor --json reports the
integration as available, unavailable, or misconfigured.
1---2name: research-workflow-orchestrator3description: Run a resumable end-to-end research workflow that automates low-risk work, pauses at explicit human decision gates, records provenance, and routes each stage to the appropriate research-hub skill or MCP tool.4---56# research-workflow-orchestrator78Coordinate an entire research project without turning consequential scientific9decisions into silent automation. The orchestrator resumes from10`.research/workflow_state.yml`, performs safe work automatically, and asks for11one structured decision only when the next action crosses a declared gate.1213This is a coordination skill, not a new research engine. It routes to the14existing research-hub skills and available CLI/MCP integrations. Read15`references/workflow-contract.md` before the first run. Read16`references/tool-adapters.md` only for the current stage or when selecting a17tool adapter. The machine-readable state contract is18`references/workflow-state.schema.json`.1920## Use when2122- The user asks to run, resume, automate, or supervise a multi-stage research23 project.24- Work spans at least three of topic scoping, discovery, synthesis, design,25 experiments, writing, and release.26- A persistent human-in-the-loop audit trail is required.2728Do not use for one isolated operation. Route a single literature table to29`literature-triage-matrix`, one design conversation to30`research-design-helper`, one paper summary to `paper-summarize`, or project31orientation alone to `research-project-orienter`.3233## Required inputs34351. Project root.362. User objective and constraints.373. Existing `.research/` manifests, if present.384. Available tool capabilities. Discover them; never assume an MCP server,39 connector, credential, or browser session exists.4041If the state file does not exist, propose a workflow ID and start at `orient`.42Creating the local state file is reversible, but present the initial plan before43executing later stages.4445## Automation policy4647Classify every proposed action before invoking a tool:4849| Action class | Default behavior |50|---|---|51| Read-only discovery, validation, comparison | Run automatically |52| Local deterministic generation with a preview or rollback | Run automatically, preserve provenance |53| Local reversible metadata update | Run automatically when inside approved scope |54| External write, public communication, account change | Stop at `external_write` |55| Costly or long experiment/simulation | Stop at `experiment_authorization` |56| Semantic manuscript/rebuttal change | Stop at `semantic_revision` |57| Submission, publication, release, merge, destructive cleanup | Stop at `release_authorization` |5859Unknown risk is gated. Tool availability never lowers the gate class.6061## Run loop62631. **Load** `.research/workflow_state.yml` and validate the fields used by the64 current run. If absent, initialize from the schema; do not invent completed65 decisions or artifacts.662. **Orient** with `research-project-orienter`, or create a previewed local67 manifest using `research-context-compressor` after presenting the initial68 plan. This reversible project-local initialization needs no separate gate;69 freezing its research question or scope still needs `scope_commitment`.703. **Plan** the smallest next stage. Name inputs, expected artifacts, tool71 adapter, validation, risk class, and any gate.724. **Decide**:73 - no gate: execute and validate;74 - gate: show the decision packet and wait;75 - missing capability: use the documented fallback or report a blocker.765. **Record** stage, action, hashes/provenance, validation result, and decision.77 Write state atomically; never record success before validation passes.786. **Advance** only when exit criteria in the workflow contract pass. Otherwise79 retry within the declared bound or stop with a concrete blocker.807. **Resume** from the recorded pending action. Never rerun a costly or external81 action merely because a new chat/session started.8283## Human decision packet8485At a gate, present only what the researcher needs to decide:8687```text88Gate: <gate id>89Decision: <one sentence>90Why now: <evidence and uncertainty>91Proposed action: <tool + exact mutation/cost/scope>92Preview: <diff, plan, candidates, or artifact link>93Reversible: <yes/no and rollback>94Options: accept / decline / revise / cancel95```9697- `accept`: record approval for the exact action and scope, then continue.98- `decline`: record the decision, choose a safe alternative if one exists, and99 do not repeatedly ask for the same rejected action.100- `revise`: block execution until a replacement action with a new hash is101 presented and accepted.102- `cancel`: record cancellation and stop the workflow cleanly.103104An `accept` is valid only through a signed policy checkpoint or exact local-TTY105hash confirmation. A bare actor label from an agent or MCP caller is not human106authorization.107108Approval is scoped to the described action. A later public, destructive, more109expensive, or semantically different action needs a new decision.110111## Stage routing112113| Stage | Primary routes | Required evidence before advancing |114|---|---|---|115| `orient` | `research-project-orienter`, `research-context-compressor` | project manifest and open questions |116| `scope` | `gap-to-topic`, `research-design-helper` | accepted question, criteria, constraints |117| `discover` | `literature-triage-matrix`, research-hub search, Zotero | query log, deduplicated candidate set |118| `synthesize` | `paper-summarize`, `paper-memory-builder`, NotebookLM verifier | claim-evidence map with gaps |119| `design` | `research-design-helper` | design dossier and explicit assumptions |120| `execute` | project-specific code/experiment tools | reproducible command, outputs, validation |121| `write` | academic writing skill chain | source-linked draft and review findings |122| `release` | verification, Git/GitHub/submission tools | release checklist and human authorization |123124Do not synthesize claims from unverified metadata or treat a NotebookLM brief as125ground truth. Do not invent missing sources, results, approvals, or tool output.126127## State and provenance128129- Canonical state path: `.research/workflow_state.yml`.130- Store artifact paths plus SHA-256, stage, and timestamp. Do not store artifact131 contents in state.132- Store action IDs, exact scope, parameter/preview hashes, resource bounds, and133 decision summaries—not private deliberation or credentials. Execute an134 accepted action only when these machine-verifiable fields still match.135- Store every attempt and validation result in `actions[]`; terminal136 `completed`/`cancelled` states have no pending action, and `cancelled` must137 include a `cancel` decision.138- Keep `pending_action` specific enough to resume, but never include API keys,139 cookies, OAuth tokens, or secrets.140- If current bytes, dependencies, or time-sensitive inputs differ from the141 recorded evidence, rerun only the smallest affected validation.142143## Failure behavior144145- Bound retries per action; default maximum is two attempts unless the plan146 declares a smaller limit.147- On repeated failure, set status to `blocked`, preserve the last verified148 artifact, and report the exact recovery condition.149- Never silently switch data sources, models, research questions, or inclusion150 criteria.151- Never treat an unavailable MCP tool as permission to perform a broader browser152 or shell mutation.153154## Completion output155156Return:1571581. current stage and status;1592. completed stages and validated artifacts;1603. human decisions and their scope;1614. unresolved evidence gaps or blockers;1625. exact next action, or `none` when complete.163164The workflow is complete only when the `release` exit criteria pass or the user165explicitly ends the project. A draft alone is not completion.166167## Executable runtime168169Use the domain service through either interface; both paths make the same state170transition:171172- CLI: `research-hub workflow init|status|validate|decide|resume|migrate`173- MCP: `workflow_initialize`, `workflow_status`, `workflow_validate`,174 `workflow_decide`, `workflow_resume`, and `workflow_migrate`175176All CLI operations accept `--json`. Migration is a dry run unless `--apply`177is given; apply creates a backup and atomically replaces the state. Schema 1.0178remains readable, while decisions and resume require migration to schema 1.1.179180The optional `agent-collab-harness` v0.4 policy/checkpoint layer is discovered181at runtime. If no policy is configured, research-hub keeps its standalone182behavior. If a policy is configured but the package, policy, or checkpoint is183unavailable, resume fails closed. `research-hub doctor --json` reports the184integration as available, unavailable, or misconfigured.