← Corpus / dididecks-ai / sitemap
/api/slide-decompose — non-destructive stub generator for the Phase 1 → Phase 2 transition
Dev-only API route that writes an empty per-slide stub file at `{slidesComponentsRoot}/{variant}/{slot}-{slug}.astro` in the consumer's working tree. Non-destructive: refuses to overwrite, returns 409 if the file already exists. The stub is a minimal `<section data-slot data-variant></section>` with a generated-by header comment instructing the recreate-do-not-extract discipline (Phase 2 of the deck-iteration-workflow). Static Vercel builds never carry this route; file writes only happen against a local working tree.
- Path
- sitemap/routes/api-slide-decompose.md
- Authors
- Michael Staton
/api/slide-decompose
Workflow position
This endpoint is the Phase 1 → Phase 2 bridge in the deck-iteration-workflow skill:
- Phase 1 — the scroll-deck variant exists as a single long page.
- The founder ranks slots in-place (via SlideRankPill) or on the TOC.
- Click scaffold on a slot. This route fires. An empty stub appears at the per-slide path.
- Phase 2 — the founder recreates the slot’s content into the stub at component-library quality. The single-page variant continues rendering unchanged.
The “recreate, don’t extract” discipline is encoded in the stub’s header comment.
Safety
- Refuses to overwrite (
409 Conflicton existing files). - Validates the slot is in
SLOTS[variantSlug]before writing. - Static builds never include this route — file mutations are dev-loop only.
Related
- [[../components/SlideRankPill]] — surfaces the workflow that produces decompose requests.
- [[toc]] — scaffold buttons.
- [[../components/DecomposeFirstPlaceholder]] — fallback rendered when a slot exists in SLOTS but no per-slide file exists yet (i.e. decompose hasn’t been run).
- [[api-slide-rank]] — sibling read/write API.