Back to Slidev

Implementation Plans

plans/README.md

52.19.07.0 KB
Original Source

Implementation Plans

Generated by the improve skill on 2026-07-10, planned against commit c63cb120 (Slidev v52.16.0). Each plan is a self-contained handoff for an executor with zero prior context: read the plan fully before starting, run its verification commands, honor its STOP conditions, and update your row below when done.

Advisor constraint: these plans were produced read-only. No source code was modified. The audit that produced them is summarized in each plan's "Why this matters" / "Current state". Verification baseline for the whole repo: pnpm install && pnpm build && pnpm typecheck && pnpm lint && pnpm test (tests require a prior pnpm build; plan 003 adds a verify aggregate).

Execution order & status

Ordered by leverage and dependencies: cheap/low-risk wins first, then high-confidence security + correctness, then larger refactors. You may cherry-pick — only the edges in "Dependency notes" are hard requirements.

PlanTitlePriorityEffortRiskDepends onStatus
001CI type-checks on every PRP1SLOWDONE (plan file removed)
002Cache the pnpm store in CIP2SLOWDONE (plan file removed)
003Aggregate verify script + document build-before-testP2SLOWDONE (plan file removed)
004Fix catalog drift (runtime deps on catalog:dev)P2SLOWDONE (plan file removed)
005Add contributor AGENTS.mdP3SLOWTODO
006Replace exec shell-string with execFile (edit shortcut)P2SLOWDONE (plan file removed)
007Guarantee Chromium teardown on export failureP1SLOWDONE (plan file removed)
008Guard against circular src: slide importsP1SLOWDONE (plan file removed)
009parseRangeString lower-bound / NaN validationP2SLOWTODO
010Harden getSlidePath against unknown slideP2SLOW-MEDTODO
011404 on out-of-range slide-patch requestP3SLOWTODO
012Fix no-op HMR utils refresh (missing await)P2SLOWTODO
013Free port + cleanup for build's temp serversP2S-MMEDTODO
014Confine deck-controlled file reads (snippets + src:)P1MMEDDONE (plan file removed)
015Validate paths in dev-server write sinksP1S-MMEDDONE (plan file removed)
016Confine export output path from deck exportFilenameP2SLOWTODO
017Validate WebSocket Origin on privileged ws handlersP2MMEDTODO
018Enforce --remote auth server-side (not just client)P3M-LMEDTODO
019Key getRoots() cache by entry (multi-entry build/export)P2MMEDTODO
020O(1) slide lookup Map (fix O(n²) TOC)P2SLOWTODO
021Consolidate divergent addToTree TOC buildersP2MMEDTODO
022Test the export pipeline (characterization tests)P1MLOWTODO
023Decompose god functions in export.ts/cli.tsP3LMED022TODO
024Incremental HMR parse cacheP3LMEDTODO
025Guard skills/-vs-docs/ drift in CIP3S-MLOWTODO

Status values: TODO | IN PROGRESS | DONE | BLOCKED (one-line reason) | REJECTED (one-line rationale).

If you don't run them all, start with the low-risk, high-confidence set (all clean verification stories): 001, 002, 003, 004, 006, 007, 008, 014, 015 — plus 022 early, because it unblocks the export refactor and de-risks 007/016/023.

Dependency notes

  • 023 requires 022: do not refactor exportSlides/serve handler until the export characterization tests exist (023's only safety net; there are no serve tests, so its Step 3 is manual + STOP-gated).
  • 021 ↔ 022: 021 moves addToTree into @slidev/parser as buildTocTree; 022 tests the export TOC path. If 021 lands first, 022 tests the shared builder; if 022 lands first, 021 keeps its test green. Land either order, but re-run the other's tests.
  • 018 subsumes the network-exposure parts of 015 and 017; still land 015 (path validation) and 017 (origin) as defense-in-depth regardless.
  • 012 ↔ 024: 012 makes the per-HMR utils refresh actually run (awaited); 024 reduces the parse cost that makes such per-HMR work expensive. If 012's cost proves high before 024 lands, see 012's STOP condition.
  • 010 ↔ 020: both touch packages/client/logic/slides.ts (getSlide/ getSlidePath). Whichever lands second must preserve the other's change (010 = undefined guard, 020 = lookup Map). Small merge; not a hard edge.
  • 001, 002, 003 are the CI/DX cluster — independent but naturally reviewed together.

Security cluster (findings share one theme)

014, 015, 016, 017, 018 all harden the dev-server + parser trust boundary that Slidev's existing vite/importGuard.ts began. 014 (arbitrary file read via snippets/src:) and 015 (traversal writes) are the highest-confidence, most-actionable; 018 is the larger architectural lift (real server-side auth). Frame all of them as defensive maintenance for the "untrusted deck" and "exposed dev server" threat models — consistent with the maintainers' own hardening intent.

Findings considered and rejected (so they aren't re-audited)

  • export.ts:630-655 "empty catches" — NOT a bug: a deliberate 4-location Playwright-resolution fallback chain ending in a helpful throw.
  • importGuard.ts skipping dynamic imports with ${ template specifiers — accepted limitation; defense-in-depth atop Vite's server.fs.strict, does not itself widen fs.allow.
  • resolver.ts catch {} blocks (:116/148/157/162) — deliberate best-effort resolution fallbacks; not load-bearing error swallowing.
  • prettier v2 (vscode) vs v3 (root) — documented decision (taze.config.ts:10).
  • PlantUML default egress to plantuml.com (parser/src/config.ts:37) — by-design/documented; a docs note at most, not a code change.
  • DEPS-02 minor version drift (@types/katex 0.16 vs katex 0.17; the @hedgedoc patch; @lillallol/outline-pdf bus-factor) — low leverage; monitor, no dedicated plan.
  • Global-install E2E disabled in smoke.yml — a documented pnpm-v11 limitation, not a defect.

Direction findings (not planned here — options for the maintainer)

Surfaced during the audit but out of the "fix" set; each is grounded in repo evidence and would be a design/spike plan if pursued:

  • D1 Agent deck-authoring LM tools (write side of the read-only packages/vscode/src/lmTools.ts, over @slidev/parser's existing stringify/ parseSlide).
  • D2 A skills/ generator (scripts/gen-skills.ts) — the automation behind plan 025's drift guard.
  • D3 Backend-agnostic deck introspection (extract lmTools.ts into CLI subcommands / an MCP server).
  • D4 Finish per-image snapshot export (integrations/snapshots.ts:25 TODO).