@cyber-dash-tech/revela 0.17.8 → 0.17.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** | [中文](README.zh-CN.md)
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-611%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
5
+ [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-615%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
6
6
 
7
7
  <p align="center">
8
8
  <img src="assets/img/logo.png" alt="Revela" width="560" />
@@ -34,11 +34,13 @@ To install globally, add the same entry to `~/.config/opencode/opencode.json`.
34
34
  Install Revela through the Codex Git marketplace:
35
35
 
36
36
  ```bash
37
- codex plugin marketplace add https://github.com/cyber-dash-tech/revela --ref v0.17.8
37
+ codex plugin marketplace add https://github.com/cyber-dash-tech/revela --ref v0.17.10
38
38
  codex plugin add revela@revela
39
39
  ```
40
40
 
41
- Install from the full repository ref. Do not use a sparse checkout limited to `plugins/revela`; the Codex plugin resolves the shared runtime, built-in designs, and domains from the repository snapshot.
41
+ The Git marketplace install provides the Codex plugin shell, skills, hooks, and MCP configuration. When Codex starts the Revela MCP server for the first time, it runs `npx -y @cyber-dash-tech/revela@0.17.10 mcp` so npm can fetch the published package and its dependencies.
42
+
43
+ You do not need to run `bun install` inside the Codex marketplace clone.
42
44
 
43
45
  Start a new Codex thread after installing so Codex loads the Revela skills, MCP tools, and hooks.
44
46
 
@@ -89,55 +91,61 @@ Use these prompts in Codex from the workspace that contains your source material
89
91
  1. Choose the narrative domain before authoring so Revela frames the audience, decision, risks, and objections for your context.
90
92
 
91
93
  ```text
92
- Use Revela to list available domains, switch to the consulting domain, and use that framing for the narrative workflow.
94
+ revela, use consulting as the domain.
93
95
  ```
94
96
 
95
97
  2. Choose the deck design before rendering so generated artifacts use the intended visual language.
96
98
 
97
99
  ```text
98
- Use Revela to list available designs, switch to the summit design, and use it for the next deck.
100
+ revela, use summit as the design.
99
101
  ```
100
102
 
101
103
  3. Initialize the narrative from local materials. Init grounds the narrative in the workspace and surfaces gaps; it does not replace the research step.
102
104
 
103
105
  ```text
104
- Use Revela to initialize this workspace. Read the local materials, identify the audience, decision, thesis, claims, existing evidence, risks, objections, and gaps, then create or update the narrative vault.
106
+ revela, help me init this workspace from the local materials.
105
107
  ```
106
108
 
107
109
  4. Research the gaps and bind only source-supported evidence into the narrative.
108
110
 
109
111
  ```text
110
- Use Revela research to inspect the current narrative gaps, derive research targets, gather or evaluate findings, save research under researches/, and bind only source-supported evidence back into the narrative vault.
112
+ revela, research the current gaps and bind only source-supported evidence.
111
113
  ```
112
114
 
113
115
  5. Read Story before rendering to inspect the claim flow, evidence support, caveats, unsupported scope, and open gaps.
114
116
 
115
117
  ```text
116
- Use Revela Story to show the current claim flow, evidence support, caveats, unsupported scope, and open gaps.
118
+ revela, show me the Story before we make the deck.
119
+ ```
120
+
121
+ 6. Create or update the deck plan before generating HTML so slide order, chapter structure, evidence trace, caveats, and visual intent are explicit.
122
+
123
+ ```text
124
+ revela, create or update the deck plan before generating HTML.
117
125
  ```
118
126
 
119
- 6. Make an HTML deck from the canonical narrative and deck plan.
127
+ 7. Make an HTML deck from the current deck plan and canonical narrative.
120
128
 
121
129
  ```text
122
- Use Revela to make a deck from the current narrative. Create or update the deck plan, generate an HTML deck under decks/, run deck QA, and repair hard QA errors.
130
+ revela, make the deck from the current deck plan and narrative.
123
131
  ```
124
132
 
125
- 7. Review the generated deck for traceability, diagnostics, and targeted edits.
133
+ 8. Review the generated deck for traceability, diagnostics, and targeted edits.
126
134
 
127
135
  ```text
128
- Use Revela to review the generated deck. Open the Review UI for the HTML deck and also summarize diagnostics.
136
+ revela, review the generated deck.
129
137
  ```
130
138
 
131
- 8. Export a PDF after deck QA passes.
139
+ 9. Export a PDF after deck QA passes.
132
140
 
133
141
  ```text
134
- Use Revela to export the deck to PDF.
142
+ revela, export the deck to PDF.
135
143
  ```
136
144
 
137
- 9. Export an editable PPTX after deck QA passes.
145
+ 10. Export an editable PPTX after deck QA passes.
138
146
 
139
147
  ```text
140
- Use Revela to export the deck to PPTX.
148
+ revela, export the deck to PPTX.
141
149
  ```
142
150
 
143
151
  ## Review A Deck
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | **中文**
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-611%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
5
+ [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-615%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
6
6
 
7
7
  <p align="center">
8
8
  <img src="assets/img/logo.png" alt="Revela" width="560" />
@@ -34,11 +34,13 @@ Revela 可在 [OpenCode](https://opencode.ai) 和 Codex 中使用,把来源材
34
34
  通过 Codex Git marketplace 安装 Revela:
35
35
 
36
36
  ```bash
37
- codex plugin marketplace add https://github.com/cyber-dash-tech/revela --ref v0.17.8
37
+ codex plugin marketplace add https://github.com/cyber-dash-tech/revela --ref v0.17.10
38
38
  codex plugin add revela@revela
39
39
  ```
40
40
 
41
- 请从完整仓库 ref 安装。不要使用仅包含 `plugins/revela` sparse checkout;Codex plugin 会从仓库快照中解析 shared runtime、内置 designs domains
41
+ Git marketplace 安装的是 Codex plugin 壳、skills、hooks 和 MCP 配置。Codex 第一次启动 Revela MCP server 时,会运行 `npx -y @cyber-dash-tech/revela@0.17.10 mcp`,由 npm 获取已发布 package 及其 dependencies
42
+
43
+ 不需要在 Codex marketplace clone 里运行 `bun install`。
42
44
 
43
45
  安装后开启一个新的 Codex thread,让 Codex 加载 Revela 的 skills、MCP tools 和 hooks。
44
46
 
@@ -89,55 +91,61 @@ Domain 提供特定场景的叙事 guidance,例如 consulting、product 或 in
89
91
  1. 先选择 domain,让 Revela 按你的沟通场景 framing 受众、决策、风险和潜在质疑。
90
92
 
91
93
  ```text
92
- Revela 列出可用 domains,切换到 consulting domain,并把这个 framing 用在后续 narrative workflow 中。
94
+ revela,use consulting as domain.
93
95
  ```
94
96
 
95
97
  2. 再选择 design,让后续生成的 deck 使用指定视觉风格。
96
98
 
97
99
  ```text
98
- Revela 列出可用 designs,切换到 summit design,并把它用于下一次 deck 生成。
100
+ revela,use summit as design.
99
101
  ```
100
102
 
101
103
  3. 从本地材料初始化 narrative。Init 负责基于 workspace 做 grounding 并暴露 gap;它不替代 research 步骤。
102
104
 
103
105
  ```text
104
- Revela 初始化这个 workspace。读取本地材料,识别受众、决策目标、thesis、claims、已有 evidence、risks、objections 和 gaps,然后创建或更新 narrative vault。
106
+ revela,帮我 init 这个 workspace,先读本地材料。
105
107
  ```
106
108
 
107
109
  4. 针对 gap 做 research,并且只把来源明确支持的 evidence 绑定回 narrative。
108
110
 
109
111
  ```text
110
- 用 Revela research 检查当前 narrative gaps,生成 research targets,收集或评估 findings,把 research 保存到 researches/,并且只把有来源支撑的 evidence 绑定回 narrative vault
112
+ revela,research 当前 gaps,只绑定 source-supported evidence。
111
113
  ```
112
114
 
113
115
  5. 生成 deck 前先读 Story,检查 claim flow、证据支撑、caveats、unsupported scope 和 open gaps。
114
116
 
115
117
  ```text
116
- Revela Story 展示当前 claim flow、evidence support、caveats、unsupported scope 和 open gaps
118
+ revela,先给我看 Story,再 make deck
119
+ ```
120
+
121
+ 6. 先创建或更新 deck plan,明确 slide 顺序、章节结构、evidence trace、caveats 和 visual intent,再生成 HTML。
122
+
123
+ ```text
124
+ revela,生成 HTML 前先 create or update deck plan。
117
125
  ```
118
126
 
119
- 6. canonical narrativedeck plan 生成 HTML deck。
127
+ 7. 基于当前 deck plancanonical narrative 生成 HTML deck。
120
128
 
121
129
  ```text
122
- Revela 基于当前 narrative 制作 deck。创建或更新 deck plan,在 decks/ 下生成 HTML deck,运行 deck QA,并修复 hard QA errors
130
+ revela,基于当前 deck plan narrative make deck。
123
131
  ```
124
132
 
125
- 7. Review 生成后的 deck,检查 traceability、diagnostics,并做定向修改。
133
+ 8. Review 生成后的 deck,检查 traceability、diagnostics,并做定向修改。
126
134
 
127
135
  ```text
128
- 用 Revela review 生成好的 deck。打开这个 HTML deck 的 Review UI,并总结 diagnostics
136
+ revela,review 生成好的 deck。
129
137
  ```
130
138
 
131
- 8. QA 通过后导出 PDF。
139
+ 9. QA 通过后导出 PDF。
132
140
 
133
141
  ```text
134
- Revela deck 导出为 PDF。
142
+ revela,把 deck export PDF。
135
143
  ```
136
144
 
137
- 9. QA 通过后导出可编辑 PPTX。
145
+ 10. QA 通过后导出可编辑 PPTX。
138
146
 
139
147
  ```text
140
- Revela deck 导出为 PPTX。
148
+ revela,把 deck export PPTX。
141
149
  ```
142
150
 
143
151
  ## Review Deck
package/lib/log.ts CHANGED
@@ -1,28 +1,39 @@
1
- import { Logger } from "tslog"
2
-
3
1
  /**
4
- * Revela structured logger (tslog).
5
- *
6
- * Log levels:
7
- * 0 = silly, 1 = trace, 2 = debug, 3 = info, 4 = warn, 5 = error, 6 = fatal
8
- *
9
- * Set REVELA_DEBUG=1 to enable debug-level output (minLevel 2).
10
- * Default minLevel is 3 (info) in production.
2
+ * Revela logger facade.
3
+ * Keep this module dependency-free so lightweight runtime tools can load from
4
+ * Codex Git marketplace checkouts that do not have package dependencies
5
+ * installed. Logging is intentionally silent by default because Revela often
6
+ * runs over stdio protocols where stderr noise is user-visible.
11
7
  */
12
- const minLevel = process.env.REVELA_DEBUG === "1" ? 2 : 3
8
+ type LogMethod = (message?: unknown, ...args: unknown[]) => void
9
+
10
+ export interface RevelaLogger {
11
+ silly: LogMethod
12
+ trace: LogMethod
13
+ debug: LogMethod
14
+ info: LogMethod
15
+ warn: LogMethod
16
+ error: LogMethod
17
+ fatal: LogMethod
18
+ getSubLogger(input?: { name?: string }): RevelaLogger
19
+ }
20
+
21
+ const noop: LogMethod = () => {}
22
+
23
+ function createNoopLogger(_name = "revela"): RevelaLogger {
24
+ return {
25
+ silly: noop,
26
+ trace: noop,
27
+ debug: noop,
28
+ info: noop,
29
+ warn: noop,
30
+ error: noop,
31
+ fatal: noop,
32
+ getSubLogger: (input?: { name?: string }) => createNoopLogger(input?.name),
33
+ }
34
+ }
13
35
 
14
- export const log = new Logger({
15
- name: "revela",
16
- minLevel,
17
- type: "json",
18
- hideLogPositionForProduction: true,
19
- overwrite: {
20
- transportJSON: (_logObj: unknown) => {
21
- // Silenced: revela runs as an OpenCode plugin; writing to stderr
22
- // pollutes the host terminal. Logs are intentionally suppressed.
23
- },
24
- },
25
- })
36
+ export const log: RevelaLogger = createNoopLogger()
26
37
 
27
38
  /**
28
39
  * Create a child logger for a specific sub-module.
@@ -7,14 +7,10 @@ import { computeNarrativeHash } from "../narrative-state/hash"
7
7
  import { compileNarrativeVault } from "../narrative-vault/compile"
8
8
  import { runNarrativeMarkdownQa, type MarkdownQaOptions } from "../narrative-vault/markdown-qa"
9
9
  import { readDeckPlanArtifact } from "../narrative-state/deck-plan-artifact"
10
- import { exportToPdf } from "../pdf/export"
11
- import { exportToPptx } from "../pptx/export"
12
- import { assertExportQAPassed } from "../qa/export-gate"
13
- import { formatArtifactQAReport, runArtifactQA } from "../qa/artifact"
14
10
  import { extractDesignClasses } from "../design/designs"
15
11
  import { recordRenderedArtifact, workspaceRelative } from "../workspace-state/rendered-artifacts"
12
+ import type { ReviewDeckOpenInput, ReviewDeckReadInput } from "./review"
16
13
  export { bindResearchFindings, evaluateResearchFindings, researchSave, researchTargets } from "./research"
17
- export { reviewDeckOpen, reviewDeckRead } from "./review"
18
14
  export { storyRead } from "./story"
19
15
 
20
16
  export interface RuntimeWorkspaceInput {
@@ -91,6 +87,7 @@ export function createDeckFoundation(input: RuntimeDeckFoundationInput) {
91
87
  }
92
88
 
93
89
  export async function runDeckQa(input: RuntimeFileInput) {
90
+ const { formatArtifactQAReport, runArtifactQA } = await import("../qa/artifact")
94
91
  const workspaceRoot = root(input.workspaceRoot)
95
92
  const filePath = resolve(workspaceRoot, input.file)
96
93
  let vocabulary
@@ -113,6 +110,8 @@ export async function runDeckQa(input: RuntimeFileInput) {
113
110
  }
114
111
 
115
112
  export async function exportPdf(input: RuntimeFileInput) {
113
+ const { exportToPdf } = await import("../pdf/export")
114
+ const { assertExportQAPassed } = await import("../qa/export-gate")
116
115
  const workspaceRoot = root(input.workspaceRoot)
117
116
  const filePath = resolve(workspaceRoot, input.file)
118
117
  await assertExportQAPassed(filePath, { workspaceRoot })
@@ -127,6 +126,8 @@ export async function exportPdf(input: RuntimeFileInput) {
127
126
  }
128
127
 
129
128
  export async function exportPptx(input: RuntimeFileInput & { speakerNotes?: Array<string | null | undefined> }) {
129
+ const { exportToPptx } = await import("../pptx/export")
130
+ const { assertExportQAPassed } = await import("../qa/export-gate")
130
131
  const workspaceRoot = root(input.workspaceRoot)
131
132
  const filePath = resolve(workspaceRoot, input.file)
132
133
  await assertExportQAPassed(filePath, { workspaceRoot })
@@ -140,6 +141,16 @@ export async function exportPptx(input: RuntimeFileInput & { speakerNotes?: Arra
140
141
  return { ok: true, ...result }
141
142
  }
142
143
 
144
+ export async function reviewDeckRead(input: ReviewDeckReadInput) {
145
+ const review = await import("./review")
146
+ return review.reviewDeckRead(input)
147
+ }
148
+
149
+ export async function reviewDeckOpen(input: ReviewDeckOpenInput) {
150
+ const review = await import("./review")
151
+ return review.reviewDeckOpen(input)
152
+ }
153
+
143
154
  export function designList() {
144
155
  seedBuiltinDesigns()
145
156
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyber-dash-tech/revela",
3
- "version": "0.17.8",
3
+ "version": "0.17.10",
4
4
  "description": "OpenCode plugin for trusted narrative artifacts from local sources, research, and evidence",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revela",
3
- "version": "0.1.0+codex.20260523122203",
3
+ "version": "0.1.0+codex.20260524121829",
4
4
  "description": "Use Revela in Codex to build trusted, traceable narrative decision artifacts from local sources and research.",
5
5
  "author": {
6
6
  "name": "cyber-dash-tech",
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "mcpServers": {
3
3
  "revela": {
4
- "command": "bun",
5
- "args": [
6
- "--eval",
7
- "const fs = await import('fs');\nconst path = await import('path');\nconst { pathToFileURL } = await import('url');\nconst candidates = [];\nconst home = process.env.HOME || '';\nconst marketplaceNames = ['revela', 'revela-local'];\ncandidates.push(path.resolve(process.cwd(), 'bin/revela.ts'));\nconst configPath = path.join(home, '.codex', 'config.toml');\nif (fs.existsSync(configPath)) {\n const text = fs.readFileSync(configPath, 'utf-8');\n const sections = text.split(/\\n(?=\\s*\\[)/);\n for (const marketplaceName of marketplaceNames) {\n const section = sections.find((item) => item.trimStart().startsWith(`[marketplaces.${marketplaceName}]`));\n const match = section?.match(/^\\s*source\\s*=\\s*\"([^\"]+)\"/m);\n if (match) candidates.push(path.join(match[1], 'bin/revela.ts'));\n }\n}\nfor (const marketplaceName of marketplaceNames) {\n const cacheRoot = path.join(home, '.codex', 'plugins', 'cache', marketplaceName, 'revela');\n if (fs.existsSync(cacheRoot)) {\n for (const version of fs.readdirSync(cacheRoot).sort().reverse()) candidates.push(path.join(cacheRoot, version, 'bin/revela.ts'));\n }\n}\nconst cli = candidates.find((candidate) => fs.existsSync(candidate));\nif (!cli) {\n console.error(`Could not locate Revela CLI. Checked: ${candidates.join(', ')}`);\n process.exit(1);\n}\nprocess.env.REVELA_CLI_COMMAND = 'mcp';\nawait import(pathToFileURL(cli).href);"
8
- ]
4
+ "command": "npx",
5
+ "args": ["-y", "@cyber-dash-tech/revela@0.17.10", "mcp"]
9
6
  }
10
7
  }
11
8
  }
@@ -33,14 +33,27 @@ export function resolveRevelaRuntime(options: ResolveRuntimeOptions): ResolveRun
33
33
 
34
34
  const marketplaceName = marketplaceNameFromPluginRoot(pluginRoot)
35
35
  if (marketplaceName) {
36
- const source = marketplaceSourceFromCodexConfig(marketplaceName, options.homeDir ?? env.HOME)
36
+ const homeDir = options.homeDir ?? env.HOME
37
+ const source = marketplaceSourceFromCodexConfig(marketplaceName, homeDir)
37
38
  if (source) {
38
- const result = runtimeAt(source, "codex-marketplace", diagnostics)
39
- if (result.ok) return result
40
- diagnostics.push(`Marketplace ${marketplaceName} source did not contain lib/runtime/index.ts: ${source}`)
39
+ if (looksLikeLocalPath(source)) {
40
+ const result = runtimeAt(source, "codex-marketplace", diagnostics)
41
+ if (result.ok) return result
42
+ diagnostics.push(`Marketplace ${marketplaceName} local source did not contain lib/runtime/index.ts: ${source}`)
43
+ } else {
44
+ diagnostics.push(`Marketplace ${marketplaceName} source is not a local path: ${source}`)
45
+ }
41
46
  } else {
42
47
  diagnostics.push(`Marketplace ${marketplaceName} was not found in Codex config.`)
43
48
  }
49
+ const clone = marketplaceCloneRoot(marketplaceName, homeDir)
50
+ if (clone) {
51
+ const result = fullRepoRuntimeAt(clone, "codex-marketplace", diagnostics)
52
+ if (result.ok) return result
53
+ diagnostics.push(`Marketplace ${marketplaceName} clone did not contain a complete Revela runtime: ${clone}`)
54
+ } else {
55
+ diagnostics.push(`Marketplace ${marketplaceName} clone was not found in Codex temp marketplaces.`)
56
+ }
44
57
  } else {
45
58
  diagnostics.push(`Could not infer marketplace name from plugin root: ${pluginRoot}`)
46
59
  }
@@ -60,6 +73,17 @@ function runtimeAt(root: string, source: ResolveRuntimeResult["source"], diagnos
60
73
  : { ok: false, source: "missing", diagnostics }
61
74
  }
62
75
 
76
+ function fullRepoRuntimeAt(root: string, source: ResolveRuntimeResult["source"], diagnostics: string[]): ResolveRuntimeResult {
77
+ const repoRoot = resolve(root)
78
+ const runtimePath = join(repoRoot, "lib", "runtime", "index.ts")
79
+ const hasRuntime = existsSync(runtimePath)
80
+ const hasDesigns = existsSync(join(repoRoot, "designs"))
81
+ const hasDomains = existsSync(join(repoRoot, "domains"))
82
+ return hasRuntime && hasDesigns && hasDomains
83
+ ? { ok: true, repoRoot, runtimePath, source, diagnostics }
84
+ : { ok: false, source: "missing", diagnostics }
85
+ }
86
+
63
87
  function findSourceCheckoutRoot(pluginRoot: string): string | undefined {
64
88
  let current = resolve(pluginRoot)
65
89
  for (let i = 0; i < 6; i++) {
@@ -95,6 +119,16 @@ function marketplaceSourceFromCodexConfig(marketplaceName: string, homeDir: stri
95
119
  return match?.[1]
96
120
  }
97
121
 
122
+ function marketplaceCloneRoot(marketplaceName: string, homeDir: string | undefined): string | undefined {
123
+ if (!homeDir) return undefined
124
+ const candidate = join(homeDir, ".codex", ".tmp", "marketplaces", marketplaceName)
125
+ return existsSync(candidate) ? candidate : undefined
126
+ }
127
+
128
+ function looksLikeLocalPath(source: string): boolean {
129
+ return !/^[a-z][a-z0-9+.-]*:\/\//i.test(source)
130
+ }
131
+
98
132
  function sectionBody(text: string, sectionName: string): string | undefined {
99
133
  const lines = text.split(/\r?\n/)
100
134
  const header = `[${sectionName}]`
@@ -18,12 +18,24 @@ Use this skill when the user asks to make, generate, or update a Revela deck.
18
18
 
19
19
  1. Call `revela_compile_narrative` and `revela_markdown_qa`.
20
20
  2. Report narrative and Markdown diagnostics, but treat only malformed/unsafe files and technical artifact validity as hard blockers.
21
- 3. Call `revela_read_deck_plan`. If missing, author `deck-plan/index.md` and `deck-plan/slides/*.md` before HTML generation.
22
- 4. For new HTML files, call `revela_create_deck_foundation`.
23
- 5. Read active design guidance with `revela_design_list` and `revela_design_read` when choosing layouts/components. If the user asks to switch designs persistently, call `revela_design_activate`; if they ask for a one-off design, read that design by name and pass `designName` to `revela_create_deck_foundation`.
24
- 6. Patch slides into the foundation between Revela slide markers. Preserve positive 1-based `data-slide-index` values.
25
- 7. Generate chapter by chapter. Keep the HTML valid after each write.
26
- 8. After every HTML write, call `revela_run_deck_qa` and repair hard errors before review or export.
21
+ 3. Call `revela_read_deck_plan` as the required deck-plan preflight before any HTML generation.
22
+ 4. If `deck-plan/` is missing or incomplete, author or repair `deck-plan/index.md` and `deck-plan/slides/*.md` before calling `revela_create_deck_foundation`.
23
+ 5. Report deck-plan diagnostics before artifact generation, including stale narrative hashes, missing slide projections, missing evidence trace, caveats, or malformed plan files.
24
+ 6. Do not start HTML generation from narrative alone unless the user explicitly asks for a throwaway diagnostic smoke deck.
25
+ 7. For new HTML files, call `revela_create_deck_foundation`.
26
+ 8. Read active design guidance with `revela_design_list` and `revela_design_read` when choosing layouts/components. If the user asks to switch designs persistently, call `revela_design_activate`; if they ask for a one-off design, read that design by name and pass `designName` to `revela_create_deck_foundation`.
27
+ 9. Patch slides into the foundation between Revela slide markers. Preserve positive 1-based `data-slide-index` values.
28
+ 10. Generate chapter by chapter. Keep the HTML valid after each write.
29
+ 11. After every HTML write, call `revela_run_deck_qa` and repair hard errors before review or export.
30
+
31
+ ## Generated Visual Assets
32
+
33
+ - Codex may use the `imagegen` skill for deck-level visual assets when a slide's visual intent calls for an image or diagram and no suitable workspace/source asset exists.
34
+ - Prefer `imagegen` for flow diagrams, framework diagrams, process visuals, system relationship maps, journey maps, before/after schematics, conceptual illustrations, abstract heroes, chapter dividers, background textures, non-evidence metaphor visuals, and visual drafts.
35
+ - Do not use generated images for source evidence, factual screenshots, real people, real places, real products, logos, data charts, tables, or visuals that need verifiable factual accuracy.
36
+ - If the visual needs exact editable text, precise data, axes, code, tables, or strict structure, build it with HTML/CSS, ECharts, or `data-table` instead of `imagegen`.
37
+ - Generated images are artifact-level visuals only. Do not treat them as evidence, source materials, quote support, or factual proof.
38
+ - If a generated image is referenced by deck HTML, move or copy the final asset into the workspace, preferably under `assets/<topic>/media/` or the project's existing asset directory. Deck HTML must reference a workspace-relative local path, never Codex's default generated-image path.
27
39
 
28
40
  ## QA Repair Loop
29
41
 
@@ -19,6 +19,15 @@ Use this skill when the user asks to review, inspect, diagnose, or refine a gene
19
19
  8. Separate technical blockers from narrative/evidence diagnostics.
20
20
  9. Pure visual/layout/export fixes may patch artifacts directly when the user asks for a change. Meaning changes must update `revela-narrative/` first.
21
21
 
22
+ ## Generated Visual Assets
23
+
24
+ - For Review Comment or Apply Fix requests such as adding an image, replacing a cover visual, creating a concept illustration, making a media block visual, or turning a slide idea into a flow/framework diagram, Codex may use the `imagegen` skill.
25
+ - Prefer `imagegen` for flow diagrams, framework diagrams, process visuals, system relationship maps, journey maps, before/after schematics, conceptual illustrations, abstract heroes, chapter dividers, background textures, non-evidence metaphor visuals, and visual drafts.
26
+ - Do not use generated images for source evidence, factual screenshots, real people, real places, real products, logos, data charts, tables, or visuals that need verifiable factual accuracy. Use workspace/source assets instead, or report the missing asset.
27
+ - If the visual needs exact editable text, precise data, axes, code, tables, or strict structure, patch the deck with HTML/CSS, ECharts, or `data-table` instead of `imagegen`.
28
+ - Generated images are artifact-level visual patches only. Do not add them to evidence, source materials, narrative support, or factual trace.
29
+ - If a generated image is referenced by deck HTML, move or copy the final asset into the workspace, preferably under `assets/<topic>/media/` or the project's existing asset directory. Deck HTML must reference a workspace-relative local path, never Codex's default generated-image path.
30
+
22
31
  ## QA Notes
23
32
 
24
33
  - `revela_review_deck_read` is read-only: it must not mutate deck HTML, `revela-narrative/`, `deck-plan/`, assets, or compatibility state.