mermate-tab-markdown
Stage 2 tab (Markdown Spec) of the Mermate pipeline — markdown architecture spec intake (paste/upload .md/.markdown/.txt), agent planning and spec refinement, and the Markdown → Mermaid unlock. Use wh
SKILL.md.windsurf/skills/mermate-tab-markdown/SKILL.md
GitHubMermate Tab 2 · Markdown Spec (md)
Operates under mermate master invariants; Lamport standards via specification-master-agent.
Stage Identity (from STAGE_REGISTRY.md, public/js/mermaid-gpt-app.js)
- Label: Markdown Spec · reveal:
STAGE 2 · MARKDOWN· color#38bdf8 - Expected duration: ≈10–60s · enhance default: ON · upload:
.md,.markdown,.txt - IPO contract:
- Input: idea artifact or pasted/uploaded .md
- Process: agent planning + spec refinement
- Output: corrected architecture spec, Mermaid unlocked
Owning Code
- Frontend:
public/js/mermaid-gpt-app.js(md input config, upload wiring) - Backend:
server/routes/render.jsPOST /api/renderwithinput_mode: 'md'; multipart viamulter - Agent refinement path:
server/routes/agent.js(POST /api/agent/runplanning phase) - Classification:
server/services/input-router.js→ content_statemd(orhybridwhen Mermaid signals are present)
Stage Invariants
- A successful md render emits
progressionUpdateunlocking at least['idea','md','mmd']— the Mermaid tab unlocks only from this server payload. - Uploaded file content is treated as untrusted text: validated, size-bounded, never executed.
- Hybrid content (markdown + Mermaid-like signals) routes through the provider-backed pipeline when enhance is requested; it must not be misclassified as pure
mmd.
Anti-Patterns (Reject)
- Client-side "spec correction" duplicating the agent planning phase.
- Accepting file types beyond the registry's
acceptlist without updatingSTAGE_REGISTRY.mdfirst. - Silently dropping uploaded content on enhance failure — fall back to raw spec, say so.
Verification
npm run test:fast; pipeline behavior →node --test test/test-e2e-pipeline.js