feat: add Mockup node type with AI-generated low-fi wireframes - #83
Merged
Merged
Conversation
Adds a `mockup` node type to the C4 + DDD + Governance preset so the model can show what the user-facing product looks like, not just how it is built and what it must do. A mockup is either a link to an external design (Figma, Penpot, ...) or a low-fidelity SVG wireframe generated by AI. Metamodel: - mockup node type (description, screen / route, design link), with its own Table View tab - illustrates: mockup -> requirement / scenario - presented-by: mockup -> webapp / container / component / system - navigates-to: mockup -> mockup (screen flow) Wireframe generation (ai/mockupWireframe.ts) is a single tool-less adapter call, like forgeClarify. The prompt is built from the model around the mockup: its description and route, the EARS requirements and Gherkin scenarios it illustrates, the container presenting it and the screens it navigates to. The returned SVG is extracted and sanitised (scripts, foreignObject, on* handlers and external hrefs stripped, 20 KB cap) and is only ever rendered through an <img> data URI, so it can never run code or fetch anything. UI: MockupNode renders the wireframe thumbnail on the canvas (or the link / a placeholder), and the properties panel gets a Wireframe section with a preview plus Generate / Regenerate (cancellable), Remove and Open design (http/https only). New "UX" palette group; mockups listed with governance items in the Wiki view. The wireframe is stored on the node as a `wireframe` string, so in md-folder documents it lands in the frontmatter as a multi-line block scalar (round-trip covered by a test). That means it loads eagerly with the rest of the frontmatter; moving it to a lazily-loaded sidecar file is a possible follow-up once lazy node bodies land. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deserializeFromMdFolder now returns { data, bodyPaths? } since #82.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a
mockupnode type to the C4 + DDD + Governance preset. The model can already describe how the system is built (C4) and what it must do (requirements, scenarios). A mockup adds a view of what the user sees. A mockup can be:Metamodel changes (
types/metamodel/presets/governance.ts)mockupnode type with three fields:description,screen(screen name or route) andlink(design link). It has its own Table View tab. There is deliberately no status field.illustrates: mockup → requirement / scenario.presented-by: mockup → webapp / container / component / system.navigates-to: mockup → mockup, for screen flow.Wireframe generation (
ai/mockupWireframe.ts)forgeClarify. It uses the user's configured generation model.<script>,<foreignObject>,on*handlers and non-fragmenthrefs are stripped<img>data URI. That context never runs scripts or loads external resources.UI changes
MockupNodeon the canvas. It shows the wireframe thumbnail if there is one, otherwise the design link or a placeholder.Storage trade-off
The wireframe is stored on the node as a
wireframestring. In md-folder documents it is written into the frontmatter as a multi-line block scalar; a test covers the round-trip. This needs no persistence changes. The downside is that wireframes load eagerly with the rest of the frontmatter. Now that lazy node bodies (#82) have landed, a follow-up could move them to a lazily loaded sidecar file.Type of change
Test plan
npm run typecheckpassesnpm testpasses: 384/384 tests in 37 files, including the newtests/mockupWireframe.test.ts, which covers:🤖 Generated with Claude Code