Visual path from Full Prompt to analysis board
This board turns a generation run into traceable assets: the Full Prompt is the contract, code is the implementation, Save publishes the draft as a work, and the analysis page renders Prompt, HTML, Design.md, and Skills back into boards.
User input, assets, and Skills become overview, designSystem, siteTemplate, and fullPrompt.
siteTemplatefullPromptdesignSystemSectionsThe Full Prompt is the final code-generation contract for structure, copy, assets, style, and acceptance criteria.
generation.fullPromptworkflow_run_versions.full_promptThe HTML path returns htmlCode directly; the React/Vite path stores projectFiles, builds them, and inlines the result as htmlCode.
htmlCodeprojectFilesartifactKindGenerated output first lands in workflow_run_versions with version, QA, build log, and canvas state.
versionIdbuildLogqaReportworkflowGraphSave work calls the save route and copies the current workflow version into generated_pages.
generatedPageIdprompthtml_codedesign_mdThe work page reads saved fields, parses HTML, Design.md, Full Prompt, and Skills, then renders Style / Prompt / Code boards.
buildWorkAnalysisWorkDesignSystemBoardWorkPreviewPanelStandard planning output sends fullPrompt into the HTML request, and normalizeHtml turns the model response into iframe-ready htmlCode.
fullPrompt -> htmlSystemPrompt -> htmlCodeComplete production prompts can become a compact implementation brief, then CSS, body, and script are generated in parallel and assembled by htmlFromParts.
fullPrompt -> CSS/body/script -> htmlCodeDeepSeek full prompts default to real React/Vite files; the server runs Vite build and inlines built assets back into htmlCode.
fullPrompt -> projectFiles -> Vite build -> htmlCodeworkflow_run_versions.full_promptgenerated_pages.promptAnalysis Prompt tabworkflow_run_versions.html_codegenerated_pages.html_codePreview iframe / Code tabworkflow_run_versions.project_filesgenerated_pages.project_filesCode artifactworkflow_run_versions.design_md_zh/engenerated_pages.design_md_zh/enStyle board tokensworkflow_run_versions.workflow_graphgenerated_pages.workflow_graphReturn to Agent editingworkflow_runs.selected_skill_slugsgenerated_page_skillsSkill mapsrc/lib/generation/workflow.tsrunWorkflowGenerate / generateReactViteWithModelsrc/app/api/generate/workflow/stream/route.tsinsertVersion / sendStandardArtifactssrc/app/api/generate/workflow/save/route.tsPOST /api/generate/workflow/savesrc/components/project-workflow.tsxmergeArtifact / saveCurrentVersionsrc/app/[locale]/create/[id]/page.tsxbuildWorkAnalysis + board componentsAgent Output to Work Analysis Board
This document explains the Full Prompt -> code -> saved work -> analysis board path. It does not introduce a new generation flow. It documents how the existing Agent workflow, save route, and created-work analysis page exchange data.
2026-05-18 update: workflow versions and generated pages now also carry Prompt Intelligence fields: intent_profile, decision_brief, design-system panel/token/trace JSON, prompt-template payload, prompt-quality report, prompt trace, and interaction state. The created-work Style board reads panel data first and falls back to DESIGN.md.
One Sentence
Full Prompt is the code-generation contract, htmlCode/projectFiles are the implementation artifacts, Save work publishes the draft version into generated_pages, and the analysis page reads the saved Prompt, HTML, Design.md, and Skills back into Style, Prompt, and Code boards.
Stage 1: Agent Compiles Context Into Full Prompt
The project creation page sends user messages, uploaded assets, selected model, and Skills to the workflow stream route. The server decides inside runWorkflowGenerate whether the run should use standard planning, complete production-prompt conversion, HTML generation, or React/Vite generation.
Standard requests first produce planning fields: overview, designSystem, designSystemSections, siteArchitecture, contentInput, siteTemplate, and fullPrompt. If the user pasted a complete production prompt, the system can convert it into a SiteGenerationTemplate, then compile that structure back into the final Full Prompt.
Stage 2: Full Prompt Becomes Code
The system currently has three main code paths:
- Standard HTML path:
fullPromptis sent into the HTML generation request, the model returns a full single-file document, and the server normalizes it intohtmlCode. - Direct full-prompt path: a complete production prompt becomes a compact implementation brief, then CSS, body, and optional script are generated in parallel and assembled by
htmlFromParts. - React/Vite path: DeepSeek full prompts default to a real React/Vite file pack. The server runs Vite build, inlines the built CSS and JS into
htmlCode, and keepsprojectFiles,buildLog, andqaReport.
All paths still produce htmlCode, because iframe preview, community publishing, and the analysis page can all consume a single HTML document.
Stage 3: Output First Becomes A Workflow Draft
After generation completes, the SSE route writes the result to workflow_run_versions. This is a recoverable draft version, not yet a saved work.
Important fields:
full_prompt: the Full Prompt used by this generation.html_code: the final previewable HTML.artifact_kind:htmlorreact-vite.project_files: React/Vite source files.build_logandqa_report: build and quality metadata.design_md_zh/en: design documentation for analysis and reuse.site_template,site_architecture,content_input: planning-layer data.workflow_graph: canvas nodes, state, positions, and edges.
The ProjectWorkflow frontend listens for artifact:complete SSE events and merges these fields into artifacts, so the Full Prompt, Code, and Preview panels are different views of the same version payload.
Stage 4: Save Work Publishes The Draft
When the user clicks Save work, the frontend calls /api/generate/workflow/save. The save route does not regenerate code. It reads the current workflow_run_versions row and copies that version into generated_pages.
Field mapping:
workflow_run_versions.full_prompt->generated_pages.promptworkflow_run_versions.html_code->generated_pages.html_codeworkflow_run_versions.project_files->generated_pages.project_filesworkflow_run_versions.design_md_zh/en->generated_pages.design_md_zh/enworkflow_run_versions.workflow_graph->generated_pages.workflow_graphworkflow_runs.selected_skill_slugs->generated_page_skills
After a successful save, the system writes workflow_run_versions.generated_page_id, linking the draft version back to the saved work. That is why a created-work analysis page can reopen the same workflow for editing or update the same work later.
Stage 5: The Analysis Page Reorganizes The Saved Work
The created-work analysis page reads generated_pages. If a linked workflow draft exists, the page prefers the draft's fullPrompt, htmlCode, and designMd so the latest editable version stays aligned.
The page then:
- Uses
generatedPageToTemplateto adapt a saved work into the sharedTemplateWithRelationsshape. - Uses
buildWorkAnalysisto infer colors, typography, buttons, layout, motion, regions, and special-skill mapping from HTML and Skills. - Uses
WorkDesignSystemBoardandWorkPreviewPanelto renderdesignMd + fullPrompt + htmlCode + analysisas Style, Prompt, and Code boards.
The analysis board is therefore evidence organization for a saved work, not a second code-generation step.
Frontend Touchpoints
- Workflow workspace:
src/components/project-workflow.tsx - Save route:
src/app/api/generate/workflow/save/route.ts - Created-work detail page:
src/app/[locale]/create/[id]/page.tsx - Analysis builder:
src/lib/work-analysis.ts - Style / Prompt / Code board:
src/components/work-design-system-board.tsx - Preview panel:
src/components/work-preview-panel.tsx
Maintenance Rules
Update this document when any of these change:
- The structure or meaning of Full Prompt.
- The HTML, Direct Prompt, or React/Vite generation path.
- The field mapping between
workflow_run_versionsandgenerated_pages. - The behavior of
Save work. - The created-work analysis page adds or removes Style, Prompt, Code, or Skill board behavior.
The boundary to preserve is: generation happens in the workflow, publishing happens through the save route, and analysis happens on the created-work page. Do not collapse these into one opaque one-shot action.