Research

From SethGammon/Citadel · View interactive version

Research is an AI agent skill from the GitHub repository SethGammon/Citadel. Focused research investigations. Converts questions into structured findings with confidence levels and source citations. Single agent by default; with --parallel (or when the question decomposes into 3+ independent angles) it spawns scout agents whose findings are compressed into a unified brief. D

How to use this skill

Skill file

/research — Focused Investigation

When to Use

Don't use when: you need to act on findings immediately (use /marshal which calls /research internally).

Modes

Single (default): one agent, 2-4 queries, 3-6 sources. Steps 1-5 below.

Parallel (/research --parallel): scout agents investigate independent

angles of the same question using Fleet wave mechanics. See Parallel Mode

below. Without the flag, prefer parallel mode (and say so in the plan) when

the question naturally decomposes into 3+ independent angles: evaluating

multiple competing technologies or approaches, distinct sub-questions that

don't depend on each other, or time-sensitive research where parallel

execution matters.

If the question is narrow and focused, stay single-agent. Don't parallelize

what a single agent can answer in 5 minutes.

Protocol (Single Mode)

Step 1: FORMULATE

Convert the research question into 2-4 specific search queries:

State the question clearly in one sentence before searching.

Step 2: SEARCH

Execute searches and read actual content (not just snippets):

The WebFetch Restrictions under Parallel Mode apply in single mode too: never

WebFetch rendered GitHub pages.

Step 3: EXTRACT

For each finding, record:

Step 4: WRITE

Write findings to .planning/research/{topic-slug}.md:

# Research: {Topic}

> Question: {The original question}
> Date: {ISO date}
> Confidence: {overall: high/medium/low}

## Findings

### 1. {Finding title}
**What:** {description}
**Source:** {URL}
**Confidence:** {high/medium/low}
**Action:** {recommendation or "informational"}

### 2. {Finding title}
...

## Summary
{2-3 sentences: what was learned, what the recommendation is}

## Open Questions
{Anything that couldn't be resolved — needs human judgment or deeper investigation}

Step 5: RETURN

Return the summary and recommendation to the caller (user, Marshal, or Archon).

The research document persists for future reference.

Parallel Mode (--parallel)

The former /research-fleet behavior now lives in this parallel mode. Spawns

multiple scout agents, each investigating a different angle of the same

question. Findings are compressed between waves. Produces a unified research

brief from multiple independent perspectives.

Inputs: the question, plus optional angles (specific sub-questions to

investigate). If not provided, decompose the question into 3-5 angles

automatically.

Step P1: DECOMPOSE

Break the research question into 3-5 independent angles:

Example: "Should we migrate from Express to Fastify?"

Each angle must be:

Step P1b: INITIALIZE GRAPH (Explicit Opt-In)

With explicit --operation-graph, assign 3-5 opaque angle IDs and initialize a graph plus bound operation:

node .citadel/scripts/operation-graph-runner.js research-init --project-root . --graph .planning/research/fleet-{slug}/operation-graph.json --operation .planning/research/fleet-{slug}/operation-spec.json --journal .planning/research/fleet-{slug}/graph-journal --run-id research-{slug} --angles {id1,id2,id3}

For each P2-P5 node, call node .citadel/scripts/operation-graph-effects.js start with the graph journal, --effects .../effect-journal, node ID, and payload digest before work; call node .citadel/scripts/operation-graph-effects.js complete with its evidence digest after verification. Keep prompts and findings outside graph state.

On resume run node .citadel/scripts/operation-graph-effects.js status; resolve blocked nonrepeatable work with reviewed evidence. After the arbiter passes, run node .citadel/scripts/operation-graph-effects.js receipt with the bound operation. Without the flag, create no graph state.

Step P2: DEPLOY WAVE 1

Spawn one scout agent per angle using Fleet wave mechanics:

For each scout:

  1. Create an isolated worktree
  2. Inject the scout's specific angle as the research question
  3. Each scout follows the single-mode protocol (formulate, search, extract, write)
  4. Each scout writes its findings to .planning/research/fleet-{slug}/{angle-slug}.md

All scouts run in parallel. Wait for all to complete.

Step P3: COMPRESS

After Wave 1 completes:

  1. Read all scout findings
  2. Identify:
  1. Compress into a unified brief (~500 tokens)

Step P4: WAVE 2 (Optional)

If gaps or conflicts exist:

  1. Spawn targeted scouts to resolve specific conflicts or fill gaps
  2. Each Wave 2 scout receives the compressed brief from Wave 1 as context
  3. Wave 2 scouts don't re-research what Wave 1 already covered

Skip Wave 2 if Wave 1 produced clear, consistent findings.

Step P5: REPORT

Write the unified report to .planning/research/fleet-{slug}/REPORT.md:

# Research Fleet: {Topic}

> Question: {The original question}
> Date: {ISO date}
> Scouts: {N} across {waves} wave(s)
> Confidence: {overall: high/medium/low}

## Consensus Findings
{Findings confirmed by 2+ scouts}

## Conflicts
{Findings where scouts disagreed — present both sides}

## Key Findings by Angle

### {Angle 1}: {title}
{Summary from scout 1}
Source: {scout report path}

### {Angle 2}: {title}
{Summary from scout 2}
Source: {scout report path}

...

## Recommendation
{2-3 sentences: what the evidence says, what the recommendation is}

## Open Questions
{What couldn't be resolved — needs human judgment}

Log the completed wave through Citadel's project-local telemetry helper:

node .citadel/scripts/telemetry-log.cjs --event wave-complete --agent research-fleet --session fleet-{slug} --status success

If the helper is unavailable, skip telemetry without blocking the research result.

Keep the scout count and total wave count authoritative in REPORT.md and the

parallel-mode HANDOFF rather than duplicating them in telemetry metadata.

Safety Rules (Parallel Mode)

If a scout exceeds its timeout, skip it and proceed with other scouts' results.

A timed-out scout's angle becomes a "Gap" in the final report.

WebFetch Restrictions

Every scout prompt MUST include this instruction:

Do NOT use WebFetch on GitHub repository pages (github.com/{user}/{repo}).

These pages are massive HTML documents (500KB+) that hang the fetcher indefinitely.

Instead:

- Use WebSearch to find information about repos (search snippets contain what you need)

- If you need a repo's README content, fetch the raw URL:

https://raw.githubusercontent.com/{user}/{repo}/{branch}/README.md

- Never fetch rendered GitHub pages: issues, pull requests, repo root, or file views

This restriction exists because a real research-fleet run hung for 38+ minutes

on WebFetch(https://github.com/jehna/readme-best-practices) with zero output.

The circuit breaker didn't catch it because the tool didn't fail — it just

never completed.

What /research Does NOT Do

Fringe Cases

Contextual Gates

Reversibility: Green. Writes files under .planning/research/ only; delete to undo.

Cost: Single mode spawns no agents and needs no confirmation. Parallel mode spawns up to 5 scouts per wave (max 2 waves); state the scout count before deploying.

Trust: No gates. Read-only investigation plus report files, safe at all trust levels.

Quality Gates

Parallel mode additionally:

Exit Protocol

Output findings summary, then the HANDOFF for the mode that ran.

Single mode:

---HANDOFF---
- Research: {topic}
- Findings: {count} sources analyzed
- Recommendation: {one-line summary}
- Document: .planning/research/{slug}.md
- Reversibility: green — one file written to .planning/research/; delete to undo
---

Parallel mode:

---HANDOFF---
- Research (parallel): {topic}
- Scouts: {N} across {waves} wave(s)
- Consensus: {one-line summary of agreed findings}
- Conflicts: {any unresolved disagreements}
- Recommendation: {one-line}
- Report: .planning/research/fleet-{slug}/REPORT.md
- Reversibility: green — delete `.planning/research/fleet-{slug}/` to undo
---
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.