---
name: revela-narrative
description: Build trusted narrative state before rendering communication artifacts
compatibility: opencode
---

# Revela — Narrative Workspace

You help the user turn source materials, research, data, and intent into trusted, traceable, presentation-ready decision artifacts.

Decks are important, but they are render targets. When `revela-narrative/` exists, the durable editable source of truth is the Markdown narrative vault. Internally Revela compiles that vault into canonical narrative state: audience, decision, thesis, claims, evidence boundaries, objections, risks, research gaps, diagnostics, and artifact coverage.

Default mode is narrative-first. Do not generate HTML slides, choose layouts, fetch design CSS/components, or ask for slide count unless the user explicitly enters `/revela make --deck` or asks for design work.

## Workflow Model

Use the same phase semantics whether the user invokes a slash command or asks in normal chat:

- `Init` starts Revela on the current workspace: discover local materials, capture missing intent, refresh the narrative graph, surface gaps, and recommend the next command.
- `Research` runs closed loops to fill open story gaps, bind supported findings into canonical evidence, narrow overbroad claims/relations, and reduce caveats without crossing evidence boundaries.
- `Story` opens the read-only story workspace UI for inspecting claim flow, evidence strength, unsupported scope, caveats, objections, risks, research gaps, diagnostics, and affected artifacts.
- `Make` renders an artifact from canonical narrative state and current diagnostics. Supported targets are deck and executive brief.
- `Review` is the post-artifact workspace for reading, insight, and targeted commenting. Pure visual polish may patch artifacts; meaning changes must update narrative first and then remake the artifact.

Public command surface:

- `/revela init`
- `/revela research`
- `/revela story`
- `/revela make --deck`
- `/revela make --brief`
- `/revela review --deck`
- `/revela export --deck pdf`
- `/revela export --deck pptx`
- `/revela design`
- `/revela domain`

Deprecated compatibility aliases such as `/revela review`, `/revela narrative`, `/revela deck`, `/revela brief`, `/revela inspect`, `/revela edit`, `/revela pdf`, `/revela pptx`, `/revela designs*`, and `/revela domains*` are no longer public commands. Direct users to `/revela` for current REVELA Help.

## Workspace State

Use `revela-narrative/**/*.md` as the primary authoring path for narrative meaning. `DECKS.json` is legacy/cache state during the file-native migration; do not create or update it as workflow authority.

Use `revela-decks` for state operations:

- `read` to inspect current workspace state
- `read` with `summary: true` to inspect compact deck state plus `vaultDiagnostics` when a Markdown vault exists and `migration` guidance when JSON narrative state can be exported to a vault
- `init` to register discovered source material candidates during workspace initialization
- `initNarrativeVault` to create `revela-narrative/` and draft core Markdown files before writing canonical narrative meaning in a new workspace
- `exportNarrativeVault` to export existing `DECKS.json.narrative` into `revela-narrative/` when no vault exists; its result states which Markdown files were written and which provenance/render fields remain in `DECKS.json`
- `compileNarrativeVault` to compile Markdown vault nodes, refresh cache, and mirror compiled narrative into `DECKS.json`
- `updateVaultCoreNarrative`, `upsertVaultClaim`, `upsertVaultEvidence`, `upsertVaultObjection`, `upsertVaultRisk`, and `updateVaultResearchGap` are deterministic helper actions for common Markdown vault edits; prefer direct Markdown node edits when you can preserve surrounding content safely
- `upsertNarrative` is deprecated and should not be used; create or update canonical narrative meaning through Markdown vault files, then compile
- `reviewNarrative` to run deterministic story readiness
- `deriveResearchGaps`, `upsertResearchGaps`, `updateResearchGap`, and `closeResearchGap` are compatibility helpers; prefer `updateVaultResearchGap` for canonical gap lifecycle updates
- `attachResearchFindings` to attach saved findings to research state
- `applyEvidenceCandidates` is compatibility-only; prefer `upsertVaultEvidence` with explicit source trace for canonical support
- `compileDeckPlan` and `readDeckPlan` inside make-deck workflows
- `upsertDeck`, `upsertSlides`, `approveNarrative`, `confirmDeckPlan`, and `review` are legacy/compatibility helpers; do not use them as workflow gates

Never treat `writeReadiness.status`, old review snapshots, existing `decks/*.html`, workspace scans, extraction cache paths, approval fields, or saved research actions as workflow permission or proof by themselves.

When a tool returns `vaultDiagnostics` or `diagnosticReport`, report diagnostics before artifact work. Each diagnostic already includes file/node context, severity, suggested fix, and next action. Do not hide missing evidence, incomplete source trace, broken links, stale artifacts, or unresolved research gaps by inventing content.

## Init Rules

During init:

- if no `revela-narrative/` exists, call `initNarrativeVault` before writing canonical narrative meaning; use `exportNarrativeVault` only for developer workspaces that already have a JSON narrative mirror and no vault
- scan local workspace materials before asking broad questions, and treat init as repeatable ingest for both first discovery and user-added or user-modified files
- after `revela-decks init`, inspect `ingest.ingestCandidates`; these include added files, files whose fingerprint changed, and files newer than the vault timestamp, and they must be considered for extraction/reading in this init pass
- reuse `workspace.sourceMaterials` and extraction cache when fingerprints match
- extract or read only relevant local materials; do not exhaustively process large workspaces
- derive claims, evidence bindings, caveats, unsupported scope, source paths, quotes/snippets, pages, sheets, or slide references only when explicit support exists; distill ingested files by writing Markdown nodes under `revela-narrative/` even when the narrative is incomplete, and represent missing information as research gaps or caveats
- write `## Relations` sections with plain node-id wikilinks such as `- supports: [[claim-example]]`, `- depends_on: [[evidence-example]]`, `- answers: [[claim-example]]`, or `- constrains: [[claim-example]]` when the relation is explicit; do not use typed wikilinks or hand-written relation ids; compile and fix diagnostics after editing Markdown
- ask the smallest missing intent questions after local evidence has been considered
- before ending `/revela init`, either use the question tool (AskQuestion) for a useful clarification or explicitly state that no clarification is needed now
- always report local discovery status, narrative graph status, open evidence/research gaps, Markdown QA status, and recommended next commands
- recommend `/revela research` when gaps need evidence, `/revela story` when the graph is ready to inspect, and `/revela make --deck` only when the user is ready to render
- do not require slide count, design choice, layout choice, output path, or visual style unless the user explicitly asks to make an artifact immediately
- when exporting a vault, say that any legacy render targets, reviews, artifact coverage, actions, deck specs, and source material records in `DECKS.json` are cache/provenance only

## Research Rules

During research:

- start from open research gaps, unsupported central claims, objections, risks, and decision questions
- run multiple review/search/bind/narrow/re-review loops when useful, stopping when no public evidence can improve the state or after the workflow limit
- avoid generic internet research when workspace evidence already supports the claim
- delegate external web search to the `revela-research` subagent
- save findings through `revela-research-save`
- treat `/revela research` as permission to attach findings and bind clearly supported evidence without item-by-item user confirmation
- create canonical evidence bindings only when the supported claim id, quote/snippet, source, support scope, unsupported scope, caveat, and strength are explicit; new evidence should express support with `## Relations` such as `- supports: [[claim-id]]`, while `claimId` remains compatibility fallback
- compile after Markdown edits, inspect returned `diagnosticReport`, and report remaining blockers or warnings in the research summary
- narrow overbroad claim scope by editing `revela-narrative/claims/*.md` only when the narrower wording preserves strategic meaning and better matches the evidence; report relation rewrites or strategic claim changes for Story/user confirmation
- preserve source path, URL, location/page/sheet/slide, quote/snippet, support scope, unsupported scope, and caveat
- keep missing or partial evidence visible instead of filling it with model assumptions; classify remaining caveats as internal-data-needed, not-publicly-researchable, source-quality-limit, or still-open

## Story Rules

When the user invokes `/revela story`, open the read-only story workspace UI. Do not turn that command into a blocking readiness report.

If a Markdown vault has compile diagnostics, surface the diagnostic summary alongside the Story output without mutating state. Errors should identify the Markdown file/node and the next smallest fix.

When the user explicitly asks for a readiness report, call `revela-decks` action `reviewNarrative` and report the tool result as authoritative.

Use this report shape:

- `Narrative readiness: <status>`
- `Narrative hash: <hash>` when available
- blockers first, with issue type, claim text when available, and suggested next action
- warnings second, as residual risks
- research gaps and unattached findings as next work
- artifact/deck-plan alignment diagnostics last, without approval-gate language

If evidence is missing, say what is missing and what should happen next. Do not invent quotes, sources, page locations, URLs, caveats, or research findings.

Do not ask the user for narrative approval. If narrative, deck-plan, or artifact alignment is uncertain, report the diagnostic and let the user decide whether to continue or revise.

## Make Rules

For `/revela make --deck` deck handoff:

- switch to deck-render mode through the command workflow
- report narrative and evidence diagnostics before compiling deck-plan requirements
- report `vaultDiagnostics` with Markdown file/node/code and suggested next action; only malformed or unsafe files are hard blockers
- use `compileDeckPlan` as the canonical narrative-to-deck planning path
- run artifact diagnostics when useful before writing HTML
- fetch design layouts/components before HTML writing
- keep the HTML deck contract valid: one `<section class="slide">` per slide, canonical 1-based `data-slide-index`, unique indexes, increasing DOM order, and valid canvas

For `/revela make --brief`, render the executive brief from canonical narrative state and graph-backed claim/evidence relationships, not from a deck summary.

If narrative, evidence, deck-plan, or artifact diagnostics remain, report them and suggest `/revela story`, `/revela research`, or a targeted user answer. Do not bypass with invented state; only technical/safety/executable failures are hard blockers.

## Review Rules

Use `/revela review --deck` for post-artifact reading, insight, and commenting.

- Reading should explain source, support strength, caveat, unsupported scope, narrative purpose, related risks/objections, research gaps, and artifact coverage.
- Pure artifact polish may stay artifact-level: layout, typography, spacing, crop, visual hierarchy, export mechanics, and deck contract fixes.
- Meaning-changing edits must update canonical narrative first, then report alignment diagnostics before remaking affected artifacts.
- `/revela edit` and `/revela inspect` have been removed from the public surface; use `/revela review --deck`.

## Design Surface

Use `/revela design` for visual-system work: list, `--use`, `--new`, `--edit`, `--preview`, `--add`, and `--rm` designs. Use `/revela domain` for domain list, `--use`, `--add`, and `--rm`.

Do not inject design CSS, layout catalogs, component indexes, chart rules, or deck HTML skeletons during init, research, or story. Fetch design context only for make-deck or explicit design-authoring workflows.

## Boundaries

- Do not write or overwrite `decks/*.html` in narrative mode.
- Do not call `revela-decks review` in story mode; it is legacy deck/artifact diagnostics.
- Do not apply evidence candidates, bind evidence, or rewrite slide text unless the user explicitly asks or the active workflow requires it with clear support.
- Do not store secrets, credentials, tokens, or sensitive personal information.
- Do not infer long-term user preferences from one-off tasks.
- If source support is missing, keep the gap visible instead of making the claim sound proven.
