--- name: create-mode description: Create or fork a Pneuma mode, scaffold its manifest, viewer, skill, seeds, and showcase. Use for new-mode authoring in this repository; discover unresolved requirements, document the design brief, then implement and verify. --- # Create Mode A guided journey for adding a new mode to Pneuma Skills. The journey has **three phases** — Discovery (ask the right questions), Brief (write down key choices and resolve material unknowns), Implementation (generate files). Each phase has a clear handoff to the next; **never skip Brief**. Pneuma has a stable contract layer; a concise design brief keeps the viewer aligned with the user's intended work. This skill runs in Claude Code and Codex. Use the active harness's file, planning, browser, and question tools; native Claude tool names are not prerequisites. Resolve paths from this skill directory. Apply the root [product and architecture guidance](../../../AGENTS.md#product-and-architecture) and [Engineering Judgment](../../../AGENTS.md#engineering-judgment) to the brief: identify domain invariants and ownership before choosing Source kinds or actions, and inspect existing modes and mature implementations before building anew. The reference material in `references/` is where the **knowledge** lives — go read the relevant one whenever you're about to make a meaningful decision. SKILL.md is the **journey**, not the textbook. --- ## When to use Trigger this skill when the user asks for any of: - "create a new mode for X" - "fork slide / webcraft / … for a different domain" - "scaffold a mode" - "add a [mindmap | spreadsheet | timeline | annotator | …] mode" - "design the viewer for a mode that …" If the user *only* asks about an existing mode's behavior, this skill is **not** the right tool — direct them to `docs/reference/viewer-agent-protocol.md` or the mode's own SKILL.md. --- ## Phase 1 — Discovery interview Goal: fill the design brief from the user's request, existing decisions, and repository evidence. Ask only for missing choices that materially affect the result. Use the question tool available in the active harness, or a concise chat question; never require a tool named `AskUserQuestion`. Bundle closely related unknowns and continue independent work while waiting. ### Discovery checklist (reuse known answers; ask only where needed) 1. **Identity** — name (kebab-case), one-line displayName, two-line description, intended icon style. *This is the only question you can pose as a single multi-line form.* 2. **Domain in one sentence** — what is the user creating with this mode? A document? A canvas of objects? A timeline? Let the user answer free-form before you offer Source-kind options. Read `references/domain-and-sources.md` while they think. 3. **Inspiration vs original** — does this mode borrow content (commands, references, design language, taxonomy) from an existing tool, library, or project? If yes, ask the upstream's name + URL + license. This determines whether you'll write `NOTICE.md` and set `inspiredBy`. Read `references/external-integrations.md` for the borrow-vs-inspiration line. 4. **Source kind** *(branch on Q2 + Q3)* — present `file-glob` / `json-file` / `aggregate-file` / `memory` with the one that fits Q2's domain pre-selected as "Recommended". Explain *why* it fits in the option's `description`. If `aggregate-file` wins, note that you'll also generate `domain.ts`. 5. **Workspace model** *(when Q4 is not `memory`)* — `"all"` / `"manifest"` / `"single"`; do users author many independent files, an ordered/structured set, or one main document? See `references/viewer-contract-patterns.md` for the FileWorkspaceModel matrix. 6. **ViewerAddress vocabulary** — "what's the smallest thing the user can point at?" Propose a draft `{ contentSet?, ... }` based on Q2's domain noun (slide / page / row / node / heading). Confirm with the user; explicitly name the coarse "where" key and any fine "within" key. See `references/viewer-contract-patterns.md::ViewerAddress`. 7. **Initial action space** — propose the smallest sufficient set with id / label / category / agentInvocable, tying each action to a concrete task. Include `navigate-to` when users need addressable navigation; add `ui` and `custom` for demonstrated needs. Don't list `capture` — it's framework-built-in. 8. **External integrations** *(conditional — only ask if Q2 or Q3 implied an external API / SDK / CDN / library / API key)* — does the viewer fetch external APIs (→ `proxy`)? does the agent or viewer need API keys (→ `init.params` with `sensitive: true` + `envMapping`)? does this need an MCP server (→ `skill.mcpServers`)? Read `references/external-integrations.md` for the proxy / Babel-JIT / NOTICE patterns. 9. **Cloud surfaces** — resolve both choices in every brief; reuse existing decisions and ask only when unclear. Two independent questions, in this order: (a) *should a finished piece of work in this mode be shareable as a read-only page a stranger can open with no Pneuma installed?* — that's the hosted player, and it obligates the viewer to render from workspace files alone, with no live backend; (b) *does the mode produce a deployable static site?* — that's Vercel / Cloudflare Pages deploy. Put the real trade-off in each option's `description`: "yes" buys shareability and costs a read-only degradation path plus a browser verification pass on every viewer change; "no" costs nothing and can be revisited in a later release. Read `references/cloud-surfaces.md` before you ask — the compatibility checklist there is what "yes" actually commits to. 10. **Seed strategy** — single file, multiple use-case content sets, or language×theme matrix? What's the *first* seed's narrative — what story does it tell to a brand-new user? See `references/seed-and-showcase.md`. 11. **Evolution directive** — give the evolve agent a one-sentence "what should it learn for this mode?" (e.g., "Learn the user's slide design preferences: typography, palette, density, structure"). This is what makes the mode personalize over time. ### What to read while interviewing | When you're about to ask … | Read first | |---|---| | Q2 / Q4 (domain → source kind) | `references/domain-and-sources.md` | | Q5 / Q6 / Q7 (workspace / address / actions) | `references/viewer-contract-patterns.md` | | Q3 / Q8 (inspiration / external deps) | `references/external-integrations.md` | | Q9 (cloud surfaces) | `references/cloud-surfaces.md` | | Q10 (seed strategy) | `references/seed-and-showcase.md` | | Q11 (evolution directive) | `references/skill-md-patterns.md` (evolution section) | If you ever find yourself stuck choosing between two patterns, open `references/case-studies.md` — it indexes which existing mode made which choice, so you can read that mode's manifest as a concrete precedent. --- ## Phase 2 — Design brief & user confirmation Goal: write down **every key choice** with a one-line rationale in one place. Use the brief for Phase 3; label assumptions and resolve material unknowns before dependent implementation. An approved brief or explicit instruction to implement already supplies authorization. ### Brief structure Present a concise brief in chat, or link the design document if the task already uses one. Cover the applicable fields below without asking the user to repeat known decisions: ```markdown # Mode design brief — ## Identity - name: - displayName: - description: - icon: ## Domain ## Invariants and implementation choice - required invariants: - state and writers: - reuse: - added abstraction or complexity: ## Source layer - kind: - domain type T: - why this kind: - domain.ts needed: ## Workspace model - type: <"all" | "manifest" | "single"> - multiFile: - ordered: - hasActiveFile: - supportsContentSets: ## ViewerAddress vocabulary - coarse keys: - fine keys: - example address: `{ contentSet: "en-light", slide: 3 }` - documented in: skill/SKILL.md (will write a sub-section) ## Action space | id | label | category | agentInvocable | params | |----|-------|----------|----------------|--------| | navigate-to | Go to … | navigate | true | { address: object } | | … | … | … | … | … | (framework provides `capture` automatically — not listed) ## Seed strategy - shape: - content sets: - first seed narrative: ## External integrations - proxy: - init.params: - skill.mcpServers: - viewer.refreshStrategy: <"auto" | "manual"> - NOTICE.md required: - inspiredBy: - external effects (if any): ## Cloud surfaces - hosted player: - artifact deploy: - obligations (only when either is yes): - registration: <`core/player-support.ts` whitelist entry / `compatibleModes` entry in BOTH deploy plugins + an `/export/` route> - read-only degradation: - verification: ## Launcher surface - visibility: