octocode-cli 1.3.1 → 1.5.1

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.
Files changed (102) hide show
  1. package/README.md +193 -34
  2. package/out/chunks/chunk-7476PETK.js +309 -0
  3. package/out/chunks/chunk-CVNNNSMQ.js +26 -0
  4. package/out/chunks/chunk-OQBJTZWK.js +60 -0
  5. package/out/chunks/chunk-UCZCF3BQ.js +9 -0
  6. package/out/chunks/command-help-specs-JZXVSLZ5.js +8 -0
  7. package/out/chunks/commands-XBFPLHSQ.js +8 -0
  8. package/out/chunks/help-P7TCOYAJ.js +10 -0
  9. package/out/chunks/main-help-ULF5PAQY.js +10 -0
  10. package/out/chunks/prompts-5E6VKRX5.js +8 -0
  11. package/out/chunks/spinner-URV2OX6O.js +8 -0
  12. package/out/chunks/tool-command-M6VA7P2F.js +8 -0
  13. package/out/octocode-cli.js +1 -1
  14. package/package.json +5 -3
  15. package/skills/README.md +13 -1
  16. package/skills/agentic-flow-best-practices/SKILL.md +280 -0
  17. package/skills/agentic-flow-best-practices/references/agent-collaboration-patterns.md +75 -0
  18. package/skills/agentic-flow-best-practices/references/pr-review-agent-example.md +47 -0
  19. package/skills/agentic-flow-best-practices/references/resources.md +112 -0
  20. package/skills/octocode-chrome-devtools/README.md +541 -0
  21. package/skills/octocode-chrome-devtools/SKILL.md +197 -0
  22. package/skills/octocode-chrome-devtools/agents/openai.yaml +7 -0
  23. package/skills/octocode-chrome-devtools/references/CDP_AGENT_REFERENCE.md +401 -0
  24. package/skills/octocode-chrome-devtools/references/CHROME_FLAGS.md +234 -0
  25. package/skills/octocode-chrome-devtools/references/INTENTS.md +108 -0
  26. package/skills/octocode-chrome-devtools/references/INTENTS_AUTH.md +179 -0
  27. package/skills/octocode-chrome-devtools/references/INTENTS_AUTOMATION.md +214 -0
  28. package/skills/octocode-chrome-devtools/references/INTENTS_DEBUG.md +329 -0
  29. package/skills/octocode-chrome-devtools/references/INTENTS_ENVIRONMENT.md +237 -0
  30. package/skills/octocode-chrome-devtools/references/INTENTS_INSPECT.md +263 -0
  31. package/skills/octocode-chrome-devtools/references/INTENTS_STORAGE_CONSENT.md +214 -0
  32. package/skills/octocode-chrome-devtools/references/RECOVERY.md +39 -0
  33. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS.md +43 -0
  34. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_ASYNC_WORKERS.md +345 -0
  35. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_BROWSER.md +403 -0
  36. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_OBSERVE.md +275 -0
  37. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_SPECIAL.md +18 -0
  38. package/skills/octocode-chrome-devtools/scripts/cdp-runner.mjs +503 -0
  39. package/skills/octocode-chrome-devtools/scripts/cdp-sandbox.mjs +123 -0
  40. package/skills/octocode-chrome-devtools/scripts/cdp-template.mjs +81 -0
  41. package/skills/octocode-chrome-devtools/scripts/octocode-chrome-devtools.vpn.example.json +8 -0
  42. package/skills/octocode-chrome-devtools/scripts/open-browser.mjs +362 -0
  43. package/skills/octocode-chrome-devtools/scripts/sourcemap-resolver.mjs +193 -0
  44. package/skills/octocode-chrome-devtools/scripts/undercover.mjs +226 -0
  45. package/skills/octocode-design/README.md +2 -2
  46. package/skills/octocode-documentation-writer/README.md +1 -1
  47. package/skills/octocode-engineer/README.md +1 -1
  48. package/skills/octocode-engineer/SKILL.md +4 -2
  49. package/skills/octocode-engineer/references/output-files.md +3 -3
  50. package/skills/octocode-engineer/scripts/run.js +136 -136
  51. package/skills/octocode-engineer/src/reporting/summary-md.test.ts +48 -0
  52. package/skills/octocode-engineer/src/reporting/summary-md.ts +43 -2
  53. package/skills/octocode-install/SKILL.md +1 -1
  54. package/skills/octocode-pull-request-reviewer/README.md +5 -5
  55. package/skills/octocode-pull-request-reviewer/SKILL.md +1 -1
  56. package/skills/octocode-research/AGENTS.md +1 -1
  57. package/skills/octocode-research/README.md +2 -2
  58. package/skills/octocode-research/docs/ARCHITECTURE.md +1 -1
  59. package/skills/octocode-research/scripts/server.js +191 -246
  60. package/skills/octocode-research/src/routes/github.ts +4 -21
  61. package/skills/octocode-research/src/routes/local.ts +4 -21
  62. package/skills/octocode-research/src/utils/fileContentTransform.ts +44 -0
  63. package/skills/octocode-search-skill/SKILL.md +245 -229
  64. package/skills/octocode-search-skill/references/agent-skills-guide.md +177 -0
  65. package/skills/octocode-search-skill/references/discovery-surfaces.md +162 -0
  66. package/skills/octocode-search-skill/references/fetch-and-create-locally.md +57 -0
  67. package/skills/octocode-search-skill/references/install-reference.md +130 -0
  68. package/skills/octocode-search-skill/references/references-template.md +27 -0
  69. package/skills/octocode-search-skill/references/references.md +62 -0
  70. package/skills/octocode-slides/README.md +307 -0
  71. package/skills/octocode-slides/SKILL.md +410 -0
  72. package/skills/octocode-slides/references/01-brief.md +156 -0
  73. package/skills/octocode-slides/references/02-research.md +149 -0
  74. package/skills/octocode-slides/references/03-outline.md +172 -0
  75. package/skills/octocode-slides/references/04-design.md +301 -0
  76. package/skills/octocode-slides/references/05-implementation.md +213 -0
  77. package/skills/octocode-slides/references/06-review.md +258 -0
  78. package/skills/octocode-slides/references/animation.md +281 -0
  79. package/skills/octocode-slides/references/design-system.md +316 -0
  80. package/skills/octocode-slides/references/html-templates.md +673 -0
  81. package/skills/octocode-slides/references/image-generation.md +448 -0
  82. package/skills/octocode-slides/references/resources.md +840 -0
  83. package/skills/octocode-slides/references/slide-rules.md +541 -0
  84. package/skills/octocode-slides/references/wireframes.md +727 -0
  85. package/skills/octocode-slides/scripts/animation.js +182 -0
  86. package/skills/octocode-slides/scripts/base.css +353 -0
  87. package/skills/octocode-slides/scripts/base.html +655 -0
  88. package/skills/octocode-slides/scripts/generate_image.py +221 -0
  89. package/skills/octocode-slides/scripts/navbridge.js +79 -0
  90. package/skills/octocode-slides/scripts/presenter.js +316 -0
  91. package/skills/octocode-slides/scripts/slide.html +248 -0
  92. package/skills/octocode-stats/SKILL.md +73 -0
  93. package/skills/octocode-stats/assets/template.html +1332 -0
  94. package/skills/octocode-stats/scripts/build_dashboard.mjs +407 -0
  95. package/assets/example.png +0 -0
  96. package/out/chunks/chunk-QCY7Q7YW.js +0 -389
  97. package/out/chunks/command-help-specs-CQ3RBLP6.js +0 -8
  98. package/out/chunks/commands-OCTZP2TO.js +0 -51
  99. package/out/chunks/help-XPXP46ZT.js +0 -10
  100. package/out/chunks/main-help-35HX2UDQ.js +0 -10
  101. package/out/chunks/tool-command-HOSMVLNK.js +0 -8
  102. package/skills/octocode-search-skill/INSTALL_REFERENCE.md +0 -112
@@ -0,0 +1,149 @@
1
+ # Phase 2 — Research
2
+
3
+ **Role:** Research agent. Fill the gaps identified in `request.md` with sourced evidence — facts, code, context, comparisons, quotes, and data.
4
+
5
+ **Input:** `.content/request.md`
6
+ **Output:** Findings appended to `.content/request.md` under the `<!-- Phase 2 -->` separator
7
+
8
+ ---
9
+
10
+ ## Skip gate — read first
11
+
12
+ Open `.content/request.md`. If **all** of the following are true, skip to the append step and write "None needed":
13
+ - "Known gaps" section says "None"
14
+ - User source files cover all key facts
15
+ - User said "skip research", "quick deck", or "no research needed"
16
+
17
+ Otherwise continue.
18
+
19
+ ---
20
+
21
+ ## Step 1 · Extract the research agenda
22
+
23
+ From `request.md`, identify:
24
+ - **Known gaps** (explicitly listed)
25
+ - **Depth level** — determines what kind of evidence to prioritise
26
+
27
+ | Depth level | Prioritise finding |
28
+ |-------------|-------------------|
29
+ | Executive | Business outcomes, risk statements, ROI data, market stats |
30
+ | Management | Trade-off comparisons, feasibility evidence, progress signals |
31
+ | Technical | Working code, benchmarks, architecture diagrams, failure modes |
32
+ | Mixed | One strong narrative hook + technical proof in separate sections |
33
+ | Async | Self-explanatory charts, step-by-step flows, full context |
34
+
35
+ Only research what is needed to fill the gaps. Do not do exhaustive research for slides whose content is already in the source files.
36
+
37
+ ---
38
+
39
+ ## Step 2 · Deep-read source files (if not done in Phase 1)
40
+
41
+ If source files were listed in `request.md` but not yet fully read, go deeper now. Use the same tool routing as Phase 1 Step 3:
42
+
43
+ | Source type | Deeper research approach |
44
+ |-------------|-------------------------|
45
+ | Local workspace / folder | `localSearchCode` for key concepts and patterns → `localGetFileContent` on specific files → `lspGotoDefinition` to trace a function to its definition → `lspFindReferences` to see where a type/function is used → `lspCallHierarchy` to trace call chains (for code-flow slides) |
46
+ | GitHub repo | `githubSearchCode` for key API patterns or architecture → `githubGetFileContent` for specific files/sections → `githubSearchPullRequests` for context on design decisions |
47
+ | Package / library | `packageSearch` → check deprecation, repo URL → dive into repo with GitHub tools |
48
+
49
+ For code repos: search key concepts, trace function call chains with LSP tools, and read 3–5 files that directly support the slide content. Extract: real code patterns (≤20 lines), architecture decisions, API signatures, error handling examples, benchmarks.
50
+
51
+ Do not read all files indiscriminately — stay focused on what fills the gaps in `request.md → Known gaps`.
52
+
53
+ ---
54
+
55
+ ## Step 3 · Web research
56
+
57
+ **When:** A gap requires context, data/stats, comparisons, or validation that source files don't cover.
58
+
59
+ **Skip when:** Source files cover all gaps, or topic is internal/proprietary, or user said "skip research".
60
+
61
+ Run queries in parallel — pick the types that match the gaps:
62
+
63
+ | Gap type | Approach |
64
+ |----------|---------|
65
+ | Statistics / data | Primary or official source first; search only when URL is unknown |
66
+ | Best practices | Official docs or known authoritative articles directly |
67
+ | Case studies / examples | Search `"<topic> real-world"`, read original source |
68
+ | Comparisons | Fetch both primary docs; don't rely on second-hand summaries |
69
+ | Definitions | Official spec or standard directly |
70
+
71
+ For each finding: record the exact URL and which slide it will support.
72
+
73
+ **Ask the user only if:** a critical fact is needed and web research returned nothing reliable, and the gap would leave a slide marked `[NEEDS SOURCE]` with no alternative.
74
+
75
+ ---
76
+
77
+ ## Step 4 · Octocode research — external code, repos, and packages
78
+
79
+ **When:** Deck needs real code samples, API references, real-world architecture patterns, or library usage examples that aren't in the user's source files.
80
+
81
+ **Tool routing by goal:**
82
+
83
+ | Goal | Tool chain |
84
+ |------|-----------|
85
+ | Find repos for a topic | `githubSearchCode(match="path", keywords)` → pick 1-2 credible results → `githubViewRepoStructure` → `githubGetFileContent` |
86
+ | Find a code pattern in a known repo | `githubSearchCode(match="file", owner, repo, keywords)` → `githubGetFileContent(matchString=...)` for the relevant section |
87
+ | Research a library / package | `packageSearch(name)` → check repo URL → `githubViewRepoStructure` → read README + key source files |
88
+ | Trace how a function is used | Clone repo locally with `githubCloneRepo` → `localSearchCode` → `lspFindReferences` or `lspCallHierarchy` |
89
+ | Find real-world examples of a pattern | `githubSearchCode(match="file", keywords=["pattern", "example"])` across GitHub |
90
+
91
+ **Code quality criteria — feature only code that is:**
92
+ - From a credible, maintained repo (known org, recent commits, reasonable star count)
93
+ - Short enough to read on a slide (≤20 lines; trim setup/imports unless they're the point)
94
+ - Directly illustrating the claim in the slide title — not surrounding scaffolding
95
+ - Real, not paraphrased or invented from memory
96
+
97
+ Record each code snippet with its exact source URL and line range in the `Code to feature` section (Step 5).
98
+
99
+ ---
100
+
101
+ ## Step 5 · Append findings to request.md
102
+
103
+ Append the findings block below the `<!-- Phase 2 -->` separator in `.content/request.md`. Do not create a new file.
104
+
105
+ ```markdown
106
+ ## Research findings
107
+
108
+ ### From local workspace
109
+ {{Key findings from local source files not already captured in Phase 1. Include file path and relevant lines.}}
110
+ | Path:lines | Finding | Supports |
111
+ |------------|---------|---------|
112
+ | {{path:L12-28}} | {{architecture decision / API shape / key pattern}} | {{which slide}} |
113
+
114
+ ### From web
115
+ | URL | Key fact / quote | Supports |
116
+ |-----|-----------------|---------|
117
+ | {{url}} | {{fact}} | {{which part of deck}} |
118
+
119
+ ### From GitHub / external repos
120
+ | Repo | Key finding | Link |
121
+ |------|-------------|------|
122
+ | {{owner/repo}} | {{architecture insight or code pattern}} | {{URL#L}} |
123
+
124
+ ### Code to feature
125
+ \```{{language}}
126
+ // Source: {{full URL with line range, or local path:L12-28}}
127
+ {{snippet — max 20 lines, trimmed to the point}}
128
+ \```
129
+
130
+ ### Facts and data confirmed
131
+ | Claim | Source | Status |
132
+ |-------|--------|--------|
133
+ | {{stat or insight}} | {{URL or path}} | confirmed / assumed |
134
+
135
+ ### Gaps still open
136
+ {{Anything that couldn't be found. If none: "None."}}
137
+ ```
138
+
139
+ ---
140
+
141
+ ## Gate 2 — Continue immediately
142
+
143
+ Research is infrastructure, not a deliverable. Do not ask for approval. Send a one-line note and continue:
144
+
145
+ ```
146
+ Research complete → {{n}} sources · {{n}} code samples · gaps: {{list or "none"}} → building outline
147
+ ```
148
+
149
+ Only stop here if a gap critical to the deck's main claim cannot be filled and only the user can resolve it. State the specific gap and ask one targeted question.
@@ -0,0 +1,172 @@
1
+ # Phase 3 — Outline
2
+
3
+ **Role:** Information architect. You turn research into the smallest narrative structure that achieves the user's goal — choosing slide order, types, and content balance for the audience.
4
+
5
+ **Input:** `.content/request.md`
6
+ **Output:** `.content/outline.md`
7
+
8
+ ---
9
+
10
+ ## Step 1 · Read inputs
11
+
12
+ Read both now (in parallel):
13
+ - `.content/request.md` — audience, goal, tone, slide count, source content, research findings, gaps
14
+ - `references/slide-rules.md` — master rule set for content, narrative, layout, and anti-patterns (required by Global Rule 9)
15
+
16
+ ---
17
+
18
+ ## Step 2 · Calibrate to audience depth
19
+
20
+ Translate the brief's audience profile into slide-level constraints using `references/slide-rules.md` §0 (Audience & Depth).
21
+
22
+ | From brief | Resolve to |
23
+ |-----------|------------|
24
+ | Audience expertise | Expert / Practitioner / Informed / General |
25
+ | Depth level | Executive · Management · Technical · Mixed · Async |
26
+ | Evidence type needed | Business outcomes · Code · Before/after · Timeline |
27
+ | Target slide count | Cross-check against depth ranges in §0.5 |
28
+
29
+ Take a moment before continuing — the answer here governs every later decision in this phase, including which material to cut. Write one sentence:
30
+
31
+ > *"Depth: {{level}} — this means {{slide style implications}}."*
32
+
33
+ If the audience is mixed or the brief is ambiguous, decide who the deck is *primarily* for and design for them; secondary audiences get appendix slides. Don't try to satisfy every viewer at full depth — that's how decks turn into documents.
34
+
35
+ ---
36
+
37
+ ## Step 3 · Choose the narrative arc
38
+
39
+ Before writing any slides, decide how the deck should move:
40
+
41
+ | Arc | When to use |
42
+ |-----|-------------|
43
+ | **Problem → Solution** | Pitches, proposals, product launches |
44
+ | **Context → Insight → Action** | Executive updates, business reviews |
45
+ | **Concept → Examples → Practice** | Technical talks, tutorials, onboarding |
46
+ | **Before → After → How** | Case studies, retrospectives, migrations |
47
+ | **Now → Future → Path** | Strategy decks, roadmaps, vision talks |
48
+
49
+ Write one sentence naming the arc and why it fits the audience + goal.
50
+
51
+ ---
52
+
53
+ ## Step 4 · Select slide types
54
+
55
+ For each idea from research, pick the type that makes the point legible in 3 seconds without the presenter speaking. **Type is a design decision, not a format choice.**
56
+
57
+ The full type → use-case table lives in `SKILL.md → Visual Type Decision`. Read it once, then return here.
58
+
59
+ **Two judgement calls only this phase makes:**
60
+
61
+ - **Vary types as the arc demands.** Three consecutive `content` slides usually means the agent stopped thinking. If it's intentional rhythm (e.g., a teaching sequence), record why; otherwise rework.
62
+ - **For `chart` slides — pick the library now, not in Phase 5.** Add it to the `Key content` column as `chart · {{Library}}` (e.g., `chart · Chart.js`). Decision rules → `references/resources.md → Data Visualization — Library Decision`. Deciding here prevents mis-matched library loads at implementation and flags `[NEEDS SOURCE]` for any chart whose data isn't confirmed.
63
+
64
+ ---
65
+
66
+ ## Step 5 · Draft the outline
67
+
68
+ Create `.content/outline.md` inside `.octocode/slides/{{slideName}}/`. This file is the complete implementation contract — no per-slide spec files are needed.
69
+
70
+ ```markdown
71
+ # Outline: {{Title}}
72
+
73
+ **Arc:** {{name}} — {{one sentence justification}}
74
+ **Depth:** {{Executive / Management / Technical / Mixed / Async}} — {{one sentence on what this means for slide style}}
75
+
76
+ | # | Slug | Title (claim sentence) | Type | Key content | Source | Flow logic |
77
+ |---|------|------------------------|------|-------------|--------|------------|
78
+ | 01 | title | {{Deck title}} | title | Title, subtitle, presenter name | — | Raises: "What is this?" |
79
+ | 02 | agenda | Agenda | agenda | Section list matching arc | — | Raises: "Where do we start?" |
80
+ | 03 | {{slug}} | {{Claim sentence}} | content | {{final bullets · max 5 · ≤10 words each}} | request.md §{{section}} | Answers: {{prior Q}} · Raises: {{next Q}} |
81
+ | … | … | … | … | … | … | … |
82
+ | N | closing | {{CTA sentence}} | closing | Next step, contact, link | — | Answers: "What do I do now?" |
83
+
84
+ ## Slide notes
85
+
86
+ {{Only add a note for slides that need special treatment — a specific widget, chart config, missing source, or layout instruction. Simple content/stats/code slides need no notes.}}
87
+
88
+ ### {{slug}} — {{title}}
89
+ - **Widget/chart:** {{e.g., "Chart.js donut — data: [42, 31, 27] — labels: [A, B, C] — key: A dominates"}}
90
+ - **Code:** {{e.g., "lines 12–28 of src/auth.ts — show the token validation path"}}
91
+ - **Image:** {{path or "user will provide — placeholder needed"}}
92
+ - **Data source:** {{URL or file — or "[NEEDS SOURCE]"}}
93
+ - **Layout note:** {{anything special: two-col, full-bleed, specific animation}}
94
+
95
+ ### {{slug}} — {{title}}
96
+ ...
97
+ ```
98
+
99
+ **Slide type options:**
100
+ `title` · `agenda` · `section` · `content` · `two-col` · `stats` · `quote` · `code` · `chart` · `image` · `timeline` · `comparison` · `closing`
101
+
102
+ **Guidelines:**
103
+ - Non-structural slide titles (all except `title`, `agenda`, `section`, `closing`) should be **claim sentences** — sentences the audience can repeat without the slide.
104
+ - Source columns point to sections in `request.md` or a user file path. If source support is missing, validate with Octocode/local tools or web research when appropriate; if still unresolved, mark `[NEEDS SOURCE]` and ask the user before making it a confident claim.
105
+ - Slide count should stay within the range in `request.md` (calibrated by depth level in Step 2). If the outline exceeds the upper bound by more than 3, trim slides or explicitly note why the added depth is necessary.
106
+ - Prefer the fewest slides that answer the audience's core question. If two adjacent slides make the same point, merge or cut.
107
+ - Dense content → split the slide rather than shrinking text.
108
+ - Avoid 3 consecutive slides of the same type unless the rhythm is intentional.
109
+ - The opening should hook early — state the problem, opportunity, or striking fact before detailed solution content.
110
+ - The close should land — one clear insight, one action, one next step.
111
+ - **Ghost outline test:** Read the titles alone as a paragraph. They should tell the complete story — argument, evidence, and conclusion — without the body content. If they don't, revise the structure before adding body content.
112
+ - **Question-Answer chain (slide-rules.md §5.1):** Each slide title should answer the implicit question raised by the previous slide and raise the question the next slide answers. Record each in the `Flow logic` column as `Answers: "X" · Raises: "Y"`. **If the chain breaks** (a slide answers a question that was never raised, or raises a question that is never answered): (a) reorder — the misplaced slide likely belongs earlier or later; (b) add a bridge slide if the logical gap is real; (c) cut the slide if it adds no new information to the chain. Never leave a broken chain and ship — a gap in titles means a gap in the audience's understanding.
113
+ - **Data needs context:** each `chart`, `stats`, or `code` slide should have a context slide before or after it that states what the data means.
114
+ - **Appendix slides** go after `closing`, are labeled `[APPENDIX]`, and do not count against the target slide count.
115
+
116
+ ---
117
+
118
+ ## Step 5b · Bidirectional validation
119
+
120
+ Before Gate 3, run the bidirectional + three-lens check defined in `SKILL.md → Bidirectional Slide Planning`. Apply it to *this* outline:
121
+
122
+ - **Top-down (row 1 → N):** Does the opening hook create discomfort before slide 3? Each section follow logically? Ghost outline test pass — reading titles alone tells the complete story?
123
+ - **Bottom-up (row N → 1):** Does the closing CTA trace back to the opening problem? Each slide's claim support its section? Every `[NEEDS SOURCE]` resolvable, or should the slide be cut / reframed / sent to the user?
124
+ - **Per-slide three-lens** (Content · UX · UI — defined in SKILL.md). Mark any slide failing two or more lenses `[REVISIT]`. Resolve before Phase 5 or ask the user which direction to take.
125
+
126
+ The lenses are a thinking tool, not a checkbox grade. If a slide fails one lens but the brief explicitly justifies the trade-off (e.g., a known-dense reference slide for an async deck), record the reason inline rather than forcing a rewrite.
127
+
128
+ ---
129
+
130
+ ## Gate 3 — Always show the outline and ask
131
+
132
+ **Default: always show the outline to the user and wait for feedback before moving to Phase 4.**
133
+
134
+ The outline determines the entire arc, content, and slide count. Getting it wrong at this stage means rebuilding slides later. Showing it takes 30 seconds; rebuilding takes 30 minutes.
135
+
136
+ **Run the Think-before-asking protocol first** (`SKILL.md → Think before asking`). Before presenting, complete this reasoning pass internally:
137
+ - What did I know about the audience/goal, and how did it drive the arc choice?
138
+ - What did I assume, and could the user correct it?
139
+ - Are any beats missing or any slides weak in the chain?
140
+
141
+ **Run the storytelling arc check:**
142
+
143
+ | Beat | Required slide | Present? |
144
+ |------|---------------|----------|
145
+ | **Discomfort** | A slide that surfaces a real problem — before any solution | Slide #__ or `[MISSING]` |
146
+ | **Relief** | A slide that reframes the problem or names the insight | Slide #__ or `[MISSING]` |
147
+ | **Confidence** | Evidence slide — numbers, code, outcome — that proves the solution works | Slide #__ or `[MISSING]` |
148
+ | **Momentum** | Closing CTA — one specific action the audience can take now | Slide #__ or `[MISSING]` |
149
+
150
+ Any `[MISSING]` beat = structurally incomplete. Add the beat, merge it into an adjacent slide, or ask the user whether it is out of scope.
151
+
152
+ **Then show the user** using the `SKILL.md → Presenting options to the user` format — reasoning first, choices second:
153
+
154
+ ```
155
+ Outline ready — "{{title}}" · {{N}} slides · {{arc}} arc
156
+
157
+ Why this arc: {{1-2 sentences — how audience + goal drove this structure}}
158
+ Assumptions: {{list or "none — all confirmed"}}
159
+
160
+ Story beats: Discomfort (#__) · Relief (#__) · Confidence (#__) · Momentum (#__)
161
+
162
+ {{Paste full outline table}}
163
+
164
+ Slides needing attention:
165
+ {{List only [NEEDS SOURCE] or special-treatment slides — or "none"}}
166
+
167
+ Reply "good" to move to design — or describe what to change.
168
+ ```
169
+
170
+ **Exception — fast mode:** If the user said "your call", "just build it", or "fast mode", send a compact one-line summary ("Outline: {{N}} slides, {{arc}} arc — starting design") and continue without waiting.
171
+
172
+ Update `.content/outline.md` with any changes before proceeding to Phase 4. Resolve all `[NEEDS SOURCE]` gaps before implementation or clearly flag them for the user.
@@ -0,0 +1,301 @@
1
+ # Phase 4 — Design
2
+
3
+ **Role:** Visual designer. You create a fitting visual identity for this specific deck through deliberate choices grounded in the brief. Be distinctive where it matters, but do not create design process overhead when the goal is speed.
4
+
5
+ **Input:** `.content/request.md` · `.content/outline.md`
6
+ **Output:** `.content/DESIGN.md` · `css/base.css` · `css/theme.css`
7
+
8
+ > **Design gate (default: ask).** Show the user 3 design directions and wait for a choice before writing CSS. Skip when the user explicitly delegates ("fast mode", "your call", "just build it") or a brand guide is locked. Complete the Design Reasoning Chain (between Step 2 and Step 3 below) before any aesthetic choice — short-circuiting it is how decks end up looking like generic templates.
9
+
10
+ ---
11
+
12
+ ## Step 1 · Read design references
13
+
14
+ Read now (in parallel):
15
+ - `references/design-system.md` — CSS variable contract, design process, anti-slop guide, resources
16
+ - `references/resources.md` — CDN libraries, font catalogs, color tools, inspiration sources
17
+ - `references/wireframes.md` — general slide layout examples for content, images, stats, charts, quotes, code, timelines, and closing slides
18
+ - `references/slide-rules.md` §§2–3 — Visual/Design rules and Layout rules (required by Global Rule 9)
19
+ - `.content/outline.md` — slide list with inline notes from Phase 3; use Slide notes for special design treatment per slide
20
+
21
+ ---
22
+
23
+ ## Step 2 · Map explicit and implied images
24
+
25
+ Read `request.md` → Images section and `.content/outline.md` → Slide notes. Map both:
26
+ - **Explicit images** the user already mentioned.
27
+ - **Implied images** the design would benefit from, such as title hero art, product screenshots, portraits, diagrams, object photos, or any visual used to describe something.
28
+
29
+ Do **not** invent, search for, download, or generate missing images during design. If the image is not already provided, create a `PLACEHOLDER` entry and let the user add the real image later.
30
+
31
+ | Decision | What to record |
32
+ |----------|----------------|
33
+ | Is the image file ready? | `ready` → use `<img src="{{path}}">` directly in Phase 5 |
34
+ | Is the image "user will provide"? | `placeholder` → use the `PLACEHOLDER` component: `image-ph` / `image-ph-bleed` from `references/html-templates.md` |
35
+ | Did design identify a needed image that the user did not provide? | `placeholder` → record the expected image in plain English and ask the user to provide it later |
36
+ | Full-bleed or inline? | Full-bleed → `slide--image` type; inline → `image-ph` inside `content` or `two-col` |
37
+ | Does image require text overlay? | Add `image-overlay` gradient div when needed to keep text legible on full-bleed slides |
38
+
39
+ Record as a table in `DESIGN.md` → Layout notes. Also update each affected slide's inline notes in `outline.md` (`Images` and `UX / UI`). Leave placeholder slides marked with `[IMAGE PLACEHOLDER]` in the outline so Phase 5 knows to use the placeholder template.
40
+
41
+ For every placeholder, include:
42
+ - Slide slug or number.
43
+ - Placement: `inline` or `full-bleed`.
44
+ - Expected image description, e.g. "PLACEHOLDER: product screenshot showing the dashboard".
45
+ - User question, e.g. "Please provide the dashboard screenshot for slide 03, or keep the placeholder."
46
+
47
+ If no explicit or implied images are needed: record `Images: none` in `DESIGN.md` and continue.
48
+
49
+ ---
50
+
51
+ ## Design Reasoning Chain — complete this before any aesthetic decision
52
+
53
+ Every design choice must trace back to the audience and goal. Work through these six questions in order. Write 1–2 sentence answers for each in `DESIGN.md → Visual identity`. Never skip this chain to jump to "looks cool."
54
+
55
+ | Step | Question | What a strong answer sounds like |
56
+ |------|----------|----------------------------------|
57
+ | 1 · Audience signal | Who is in the room and what do they trust? | "Developers who distrust vague claims → high contrast, code-native fonts, specific numbers." |
58
+ | 2 · Energy | Dark (focused, projector) or Light (readable, print)? | "Stage / conference room → dark background dominant." |
59
+ | 3 · Temperature | Warm, cool, or neutral? | "AI/infrastructure topic → cool (blues, slates) signals precision." |
60
+ | 4 · Personality | What emotion should the first slide trigger? | "Trust and momentum — not excitement, not fear." |
61
+ | 5 · Differentiation | What does the competition look like, and what should this NOT look like? | "Generic startup decks use cyan+magenta on black → avoid, use slate+amber instead." |
62
+ | 6 · Constraint | Is there a brand guide, color palette, or font stack locked by the user? | "No guide provided → full design latitude." |
63
+
64
+ **Only after completing this chain:** pick colors, pick fonts, pick layouts, pick libraries. Every pick should have a one-line reason that points back to a step above.
65
+
66
+ ---
67
+
68
+ ## Step 3 · Review per-slide design needs
69
+
70
+ Before writing CSS, check `outline.md → Slide notes` for any slide whose visual treatment is not obvious.
71
+
72
+ For each slide with special treatment in `Slide notes`, confirm:
73
+
74
+ | Section | What Phase 4 should add or confirm |
75
+ |---------|----------------------------------|
76
+ | `Content` | Final on-slide text is short enough for the chosen layout; flag overloaded copy before implementation |
77
+ | `Data` | Exact values, units, source, and intended visual encoding for any metric or chart |
78
+ | `Widgets` | Component choice and library, e.g. Motion counter, code block, Mermaid diagram, callout, progress bar |
79
+ | `Graphs` | Chart type, library, data mapping, labels, key insight, source |
80
+ | `Images` | File path or placeholder, alt text, crop/framing, overlay, caption |
81
+ | `UX / UI` | Layout type, dominant visual, reading order, density, animation, accessibility/contrast |
82
+
83
+ If a design review reveals a slide is overloaded, add a split note in `outline.md → Slide notes` and flag it for Phase 5.
84
+
85
+ ---
86
+
87
+ ## Step 4 · Research visual direction (skip if brand_guide: locked)
88
+
89
+ Do this when the brief asks for a custom aesthetic, the topic benefits from visual research, or the direction is not obvious. Skip deep visual research when a brand guide is locked, the user delegated choices, or the design-system matrix clearly matches the goal.
90
+
91
+ When research is useful, run at least 2 of these in parallel based on your analysis and the tools available in the current agent environment:
92
+
93
+ ```
94
+ Open or search Dribbble for "{{mood}} presentation"
95
+ Open or search Behance for "{{context}} presentation"
96
+ Search GitHub/Octocode for "HTML presentation CSS theme {{aesthetic}}"
97
+ Open or search Awwwards for "{{aesthetic}}"
98
+ Open Fontshare for distinctive display fonts
99
+ ```
100
+
101
+ Extract: color pairings, font personalities, layout patterns, spacing rhythms.
102
+ Take notes — don't copy. The goal is direction, not theft.
103
+
104
+ For fonts: pick a heading/body pair from `design-system.md` → Font Pairing Presets, OR find something new via Google Fonts / Fontshare. Guideline: the heading font should have enough personality to feel chosen, not defaulted.
105
+
106
+ Fallback if these tools are unavailable: use available web search/browser tools, official font catalogs, local examples, or the curated palettes and font pairings in `design-system.md`.
107
+
108
+ ---
109
+
110
+ ## Step 5 · Generate style previews
111
+
112
+ **Default:** generate three previews and ask the user to choose before writing CSS. Design is subjective — an agent that silently auto-selects colors and fonts produces a deck the user hates often enough that 3 minutes of previews beats 30 minutes of rebuilds.
113
+
114
+ **Skip previews and auto-select when:**
115
+ - User explicitly said "fast mode", "your call", "just build it", or "skip design"
116
+ - A `brand_guide: locked` entry exists in `request.md`
117
+ - The user already approved a specific theme in this conversation
118
+ - The brief is so specific (e.g., "match this exact reference") that previews would only delay confirmation
119
+
120
+ When skipping, write `> Auto-selected: {{theme}} — {{one-line reason}}` at the top of `DESIGN.md` so the choice is visible.
121
+
122
+ When previews are needed, write exactly three standalone HTML files — each a different visual direction:
123
+ - `.content/preview-a.html`
124
+ - `.content/preview-b.html`
125
+ - `.content/preview-c.html`
126
+
127
+ Each preview shows **the title slide only**, fully rendered: color palette, font pair, heading hierarchy, spacing, one accent element. Must look great when opened in a browser.
128
+
129
+ **Rules for the three previews:**
130
+ - Each should have a **distinct visual direction** — not just the same layout with a different accent color
131
+ - Prefer a mix of dark and light backgrounds when that helps the user choose
132
+ - None may copy color values verbatim from `design-system.md` themes
133
+ - None may score 2+ on the Visual Slop Test, and none may fail the Content Slop Test (from SKILL.md)
134
+ - If the title slide would benefit from a hero image that is not provided, render the `PLACEHOLDER` component in the preview and label what image the user should add later.
135
+
136
+ **Run the Think-before-asking protocol first** (`SKILL.md → Think before asking`). Before presenting previews, complete this reasoning pass internally:
137
+ - What audience/goal signals drove the three direction choices?
138
+ - Which direction is most likely right, and why?
139
+ - What assumption could the user correct that would change the direction?
140
+
141
+ Show the user using the `SKILL.md → Presenting options to the user` format — reasoning first, choices second:
142
+
143
+ ```
144
+ Three style directions for "{{title}}" — built for {{audience}} × {{goal}}:
145
+
146
+ Why these three: {{1-2 sentences on what drove the visual directions — audience trust signals, energy, differentiation}}
147
+
148
+ A → .content/preview-a.html — {{8-word descriptor tied to audience signal}}
149
+ B → .content/preview-b.html — {{8-word descriptor tied to a different signal}}
150
+ C → .content/preview-c.html — {{8-word descriptor — most distinct from A and B}}
151
+
152
+ Open them and reply "A", "B", or "C" — or describe what to adjust.
153
+ ```
154
+
155
+ **Gate 4a — Smart stop.** Stop for a choice only when previews were generated. Write DESIGN.md after the user picks a direction or delegates the choice.
156
+
157
+ **If the user rejects all three previews:** Ask for one concrete direction change ("darker", "more minimal", "warmer colors", "different font personality") and generate one revised preview incorporating that direction. Repeat Gate 4a. Generate 3 new previews only when the user explicitly requests it.
158
+
159
+ **If `brief.md` has `brand_guide: locked`:** SKIP Steps 4–5 (research and style previews). Still do Step 2 (image mapping) and Step 3 (context analysis). Read the brand values from the brief, map them directly to DESIGN.md tokens, and proceed to Step 6.
160
+
161
+ ---
162
+
163
+ ## Step 5b · Pointer & click feedback (default: off — opt-in)
164
+
165
+ A subtle layer of pointer chrome — custom cursor + mouse-down spark — makes the deck feel like a live console. **Default: off.** Enable only when the brief explicitly signals a live context.
166
+
167
+ **Enable when** the user says "live presentation", "demo mode", or "add cursor effects", OR the brief explicitly calls for a live talk, demo, or dark/tech theme.
168
+
169
+ **Leave off when:**
170
+ - The brief is async/silent, print/PDF-first, or the presentation context is unspecified
171
+ - Audience profile is `Executive` print-readers or accessibility-first contexts
172
+ - Brand guide forbids non-OS cursor behaviour
173
+ - User explicitly opts out ("no custom cursor", "default cursor only")
174
+ - Running in fast mode with no live-context signal in the brief
175
+
176
+ When kept, list the two libraries in `DESIGN.md → Libraries` (see `references/resources.md → Pointer & Click Feedback` for full URLs and theme bindings) and add the `## Pointer & click feedback` block to `DESIGN.md`. Implementation wiring belongs in Phase 5 — design only declares intent + tokens.
177
+
178
+ When not enabled, write `Pointer chrome: off` in `DESIGN.md → Libraries` with a one-line reason (or omit the section entirely if the deck has no live context).
179
+
180
+ ---
181
+
182
+ ## Step 6 · Write DESIGN.md
183
+
184
+ Write `.content/DESIGN.md` inside `.octocode/slides/{{slideName}}/`. Keep it short and actionable. Every decision should explain the WHY, not just the WHAT.
185
+
186
+ ```markdown
187
+ # DESIGN.md — {{Deck Title}}
188
+
189
+ > Visual system for this presentation. All CSS values come from this document.
190
+
191
+ ## Visual identity
192
+
193
+ **Mood:** {{Two sentences — how it feels and what it communicates to this audience}}
194
+ **Inspiration:** {{What informed the choices — describe the source, include URLs if from research}}
195
+ **Distinctive choice:** {{The one design decision that sets this deck apart from a generic template}}
196
+
197
+ ## Color system
198
+
199
+ | Token | Value | Role |
200
+ |-------|-------|------|
201
+ | `--bg` | `{{hex or oklch}}` | Slide background |
202
+ | `--surface` | `{{}}` | Card / panel backgrounds |
203
+ | `--border` | `{{}}` | Dividers, code block edges |
204
+ | `--accent` | `{{}}` | One focal element per slide |
205
+ | `--text` | `{{}}` | Body text |
206
+ | `--muted` | `{{}}` | Captions, metadata, labels |
207
+ | `--code-bg` | `{{}}` | Code block background |
208
+ | `--code-text` | `{{}}` | Code block text |
209
+
210
+ Contrast: `--text` vs `--bg` = {{ratio}} · Must be ≥ 4.5:1 WCAG AA
211
+
212
+ ## Typography
213
+
214
+ | Token | Font | Weight | Use |
215
+ |-------|------|--------|-----|
216
+ | `--font-head` | {{Google/Fontshare name}} | 700 | Slide headings |
217
+ | `--font-body` | {{Google/Fontshare name}} | 400/500 | Body text, bullets |
218
+ | `--font-mono` | {{Font}} | 400 | Code blocks |
219
+
220
+ Google Fonts `@import` URL: `{{full URL}}`
221
+
222
+ Type scale (all clamp — no raw px or rem on text):
223
+ - `--t-display`: `{{clamp(Xrem, Yvw, Zrem)}}` — title slides only
224
+ - `--t-title`: `{{clamp(...)}}` — slide headings
225
+ - `--t-sub`: `{{clamp(...)}}` — subtitles, column headings
226
+ - `--t-body`: `{{clamp(...)}}` — bullets, paragraphs
227
+ - `--t-small`: `{{clamp(...)}}` — captions, metadata
228
+
229
+ ## Layout notes
230
+
231
+ List only slides that need special design attention. All slide-level notes live in `.content/outline.md → Slide notes`.
232
+
233
+ | Slide | Special treatment |
234
+ |-------|------------------|
235
+ | {{01-title}} | {{Full-bleed? Background image? Specific layout?}} |
236
+ | {{NN-chart}} | {{Chart.js? SVG? Color mapping?}} |
237
+
238
+ ## Animation approach
239
+
240
+ - Simple entrances: CSS `.fade-in` / `.slide-up` from `base.css`
241
+ - Sequences / stagger / counters: Motion (motion.dev) on slides: {{list or "none"}}
242
+ - `@media (prefers-reduced-motion: reduce)` respected in every animated slide
243
+
244
+ ## Pointer & click feedback
245
+
246
+ Default: OFF. Include this section only when enabled (see Step 5b). Add a one-line reason when enabled: which brief signal triggered the opt-in.
247
+
248
+ | Element | Behaviour | Token |
249
+ |---------|-----------|-------|
250
+ | Custom cursor | Small ring + center dot; ring lags dot ~80 ms for a debugger-feel pointer. Native cursor preserved on form fields, links, and during text selection. | `--accent` ring, `--accent-2` dot |
251
+ | Hover state | Ring scales to 1.6× and shifts to `--accent-strong` over interactive elements (buttons, cards, code panels). | `--accent-strong` |
252
+ | Mouse-down spark | 6-spoke radial spark at click point — short (~320 ms), `cubic-bezier(0.22, 1, 0.36, 1)`. Honours `prefers-reduced-motion: reduce`. | `--accent` (+ optional `--violet` focal ray) |
253
+ | Iframe handoff | Parent (`index.html`) owns one shared overlay so the cursor stays continuous across slide transitions; HUD/progress/counter excluded from spark hits. Disabled in overview mode (`body.overview`). | — |
254
+
255
+ ## Libraries
256
+
257
+ Only list libraries actually needed. For each: which slide, and why this library over alternatives.
258
+
259
+ | Library | Slides | Why this library |
260
+ |---------|--------|------------------|
261
+ | {{highlight.js}} | {{05}} | Code slide — real syntax colours, not faked |
262
+ | {{Chart.js}} | {{06}} | Bar/line/donut — lightest option |
263
+ | {{Motion}} | {{01}} | Counter/stagger — CSS alone cannot sequence |
264
+ | {{tholman/cursor-effects}} | parent | Pointer chrome — themable custom cursor that already respects `prefers-reduced-motion` |
265
+ | {{hexagoncircle/click-spark}} | parent | Mouse-down spark — single Web Component themed via `--click-spark-color` |
266
+
267
+ **Library decision rules:** one chart lib per slide. Full table → `references/resources.md → Data Visualization — Library Decision`. Pointer chrome libs load once on `index.html`, not per-slide. The Libraries table above only needs to list libraries this deck actually uses, with the `Why` column tied back to the audience and content (not just "lightest").
268
+ ```
269
+
270
+ ---
271
+
272
+ ## Step 7 · Generate CSS files
273
+
274
+ 1. `css/base.css` at the deck root — **copy `scripts/base.css` verbatim** (`cp scripts/base.css css/base.css`). Never paraphrase.
275
+ 2. `css/theme.css` at the deck root — Google Fonts `@import` at top, then override only the variables defined in `:root` of `scripts/base.css` (colors, fonts, type scale `clamp()` ranges) using the exact values from DESIGN.md. Layout rules stay in `base.css`.
276
+
277
+ ---
278
+
279
+ ## Gate 4b — Smart stop
280
+
281
+ Show this only when user design approval is needed. In fast/delegated mode, send a short update and continue to Phase 5.
282
+
283
+ Use the `SKILL.md → Presenting options to the user` format — show reasoning before the approval ask:
284
+
285
+ ```
286
+ Design locked — "{{title}}"
287
+
288
+ Why these choices:
289
+ - Color: {{accent is X — chosen because Y tied to audience signal}}
290
+ - Font: {{X for headings — why it fits this audience; Y for body}}
291
+ - Distinctive: {{the one decision that sets this apart from a generic template}}
292
+
293
+ Libraries: {{list or "none"}}
294
+
295
+ Image placeholders: {{list slide slug + expected image — or "none"}}
296
+ {{If any: "Provide these later or reply that placeholders should remain."}}
297
+
298
+ Reply "good" to start building slides — or describe any changes.
299
+ ```
300
+
301
+ Stop only when approval is required. After approval, or when continuing in delegated mode, delete previews if they exist: `rm .content/preview-*.html`