All cases
#009 · Prototype Development

Case study · Prototype Development

Revenue & Cost Monitoring System for the Power Industry

You are a developer or pre-sales person in the power industry, holding the customer’s "Revenue & Cost Monitoring – Early-Warning System" XMind feature mind map, and your task is to produce a demo-ready prototype quickly without touching the backend. Work through the three steps in this article and you will get a feature structure-tree JSON, 14 guard tests, and a 40.6KB single-file high-fidelity prototype — 15 pages, ECharts charts, an industrial-grade power-sector dark theme, ready to demo the moment it opens in a browser.

Target: a 352KB XMind requirements mind map· Constraints: pure front-end static display · no backend/database· Landi large model· Deliverable: a 15-page prototype · 40.6KB single file· Self-check: pytest 14/14 · ruff/semgrep 0 issues

Session replays & reports are original records in Simplified Chinese · Built with AVL Code + the Landi model

Overview

  1. 01

    Parse the mind map — a feature structure tree of 5 top-level modules lands on disk

    You write the role setting, step-by-step tasks, delivery criteria and self-check gate into the instruction in one pass, hand the XMind to AVL Code, and get the standardized feature structure tree feature_tree.json.

  2. 02

    Generate the prototype — a 15-page single-file high-fidelity HTML

    The parsed result drives the prototype directly: hash-routed pages, ECharts charts, an industrial-grade dark theme — a 40.6KB single file that demos the moment it opens in a browser.

  3. 03

    Self-check gate — all 14 tests pass · static scans find zero issues

    The parser and prototype go through the gate as soon as they are written: pytest 14/14, ruff 0 issues, semgrep 0 findings — delivery is acceptance.

Task for AVL Code

1. Role: act as a senior full-stack architect and UI/UX designer. I am in the power industry and need to develop a revenue-and-cost monitoring–early-warning system. Input material: I will upload/provide the system’s functional design document as an XMind mind map. It contains all core modules, sub-features and business-logic links. Task goals (execute step by step): strictly based on the XMind content I provide, proceed as follows: Parse and organize: deeply parse the node hierarchy in the XMind and convert the mind map’s "keywords" into a standardized product feature structure tree. Interface prototype: based on the organized feature structure, generate a high-fidelity visual preview of the admin interface (if you support code, generate HTML/CSS/JS; if you only support drawing, produce an ASCII layout or the corresponding SVG/chart layout). Core requirements: the interface must include the core modules of the top-level directory; the layout should lean industrial/enterprise style, emphasizing data visualization (charts, status lights, lists). Delivery standard: first show me a runnable interface demo (in one HTML file or a clear rendered image). For now do not write backend logic or database connection code — at this stage only static display and interaction demos. Once the interface matches the XMind logic and I have accepted it, I will provide real API data sources for integration.2. After the code is done it must pass the self-check gate

Prerequisites: AVL Code is logged in; the customer’s XMind file (.xmind) is in the workspace attachments/ ("收入与成本监控预警系统.xmind" in this case, about 352KB); the workspace has the ruff / pytest / semgrep toolchain; pure front-end static display — no backend or database needed

Reproduction materials at the end of this article Try it yourself ↓

Parse the Mind Map

The instruction states the role, material, step-by-step tasks, core requirements, delivery criteria and self-check gate in one pass. The first thing after sending is not to start work — it is to confirm the input is really at hand:

You type → AVL Code
Parse and organize: deeply parse the node hierarchy in the XMind and convert the mind map’s "keywords" into a standardized product feature structure tree.
AVL Code runs → you see
Verifies the input first: no XMind file in the current turn → proactively checks the workspace and finds the .xmind and an existing unpacked directory
→ The xmind package is not installed → installs nothing, reads the unpacked content.json directly
→ fs.exec environment pitfalls (sh instead of cmd, absolute paths banned) → switches to relative paths to call Python
→ Reads the full tree: root = Revenue & Cost Monitoring – Early-Warning System, 5 top-level modules, cost and progress are empty nodes
→ Writes tools/xmind_parser.py to parse into a standardized feature structure tree, saved as feature_tree.json

Generate the Prototype

With the feature tree in hand, the instruction’s "first show me a runnable interface demo" points at a single HTML file. The key to generation is not writing code but where the mock data comes from:

You type → AVL Code (excerpt from the instruction)
Interface prototype: based on the organized feature structure, generate a high-fidelity visual preview of the admin interface (if you support code, generate HTML/CSS/JS; if you only support drawing, produce an ASCII layout or the corresponding SVG/chart layout). Core requirements: the interface must include the core modules of the top-level directory; the layout should lean industrial/enterprise style, emphasizing data visualization (charts, status lights, lists). Delivery standard: first show me a runnable interface demo (in one HTML file or a clear rendered image). For now do not write backend logic or database connection code — at this stage only static display and interaction demos.
AVL Code runs → you see
Plans 15 hash-routed pages: Comprehensive Analysis Center / Revenue Management, 6 pages / Cost Management / Progress Management / Early-Warning Center / System Configuration, 4 pages
→ Faithfulness discipline: empty nodes get placeholder hints instead of invented sub-modules; no top-level items added that the XMind does not have
→ Mock data sticks to the XMind’s real fields: a 13-field contract ledger, 7 contract-type categories, the maintenance-revenue share formula
→ Technical route: single-file index.html (ECharts CDN + dark theme + status lights)
→ Mid-run it keeps outputting design notes without acting → lands the work immediately after a system reminder
→ Delivers prototype/index.html (40.6KB)

Self-Check Gate

The second item in the instruction is a single sentence — "after the code is done it must pass the self-check gate" — yet executing it is the most winding stretch: a false alarm first, a real problem after:

You type → AVL Code (excerpt from the instruction)
2. After the code is done it must pass the self-check gate
AVL Code runs → you see
Builds its own verify_html.py to validate → reports 11 views vs 15 menu items, suspected omissions
→ Investigation: the grep pattern fails to match dotted syntax → each item confirmed present, false alarm
→ The gate passes item by item: pytest 14/14 · ruff 0 issues after one fix · semgrep 0 findings
→ Gate table all green: HTML 40.6KB · DOCTYPE ✓ · all 15 views present

Try it yourself

After putting the customer’s XMind file into the workspace attachments/, send the instruction from the prompt above to AVL Code verbatim (structure = role + input material + step-by-step tasks + core requirements + delivery standard + self-check gate); after delivery you can re-run the gate locally:

› 1. Role: act as a senior full-stack architect and UI/UX designer. I am in the power industry and need to develop a revenue-and-cost monitoring–early-warning system. …… (full text in the prompt above; place <the customer’s XMind file> into workspace attachments/ before sending)
› python -m ruff check tools/ tests/
› python -m pytest -q
› semgrep scan <target directory>
  • After delivery, re-run the self-check gate locally: once all three commands above pass, the deliverable is accepted.
  • The whole session has only one user instruction; each chapter’s left column is a verbatim excerpt of the corresponding task in that instruction (unrewritten). "About 12 minutes", "80+ feature nodes" and "7 deliverable files" come from the case’s existing archive (index.ts) and do not appear directly in the session — the session’s delivery table actually lists 5 output files, so the "7 deliverable files" figure cannot be independently confirmed from the session. The session export has no separate tool-call lines; the duo right column is reconstructed from the assistant’s process narration.

Next question: Once the prototype passes acceptance, how do you connect real API data sources for integration and replace the static mock with live data?