Case study: shipping “AI reports support custom HTML 3D components” in one day
A full walkthrough of a real feature, from request to release. Focus on what the person did and what Claude Code did at each stage.
Requirement
The “AI-generated reports” feature was modeled on another big-screen dashboard product of ours, which supports custom HTML components. These are used for advanced components such as 3D building floors and 3D globes that the built-in charts can’t do.
Tech background: Java back end and Vue front end. The AI plans, pulls data and generates the reports.
Stage 1: research and plan (about 20 minutes)
Done by Claude Code:
- Read the module’s
CLAUDE.md, the report data structures, and the rendering code for the four styles (dashboard / monthly report / big screen / print); - Fetched the official docs of the reference big-screen product, and also found the original implementation in its front-end bundle: an iframe sandbox plus an injected data-bridge object;
- Proposed a plan: add an
htmlfield to analysis items, render them in a sandboxed iframe on the front end, have the AI generate code on demand, and add two new endpoints: save and generate.
Done by the person: answered two questions. The 3D library may be loaded from a CDN; the AI only generates a component when the requirement names it or the built-in charts can’t do the job.
Stage 2: development (about 2 hours)
- Back end: added helper classes (prompts, HTML sanitizing, sample-data assembly), hooked HTML generation into three flows (generate report, conversational edit, add analysis item), and added two endpoints.
- Front end:
- Added an HTML rendering component that handles the sandboxed iframe and the data bridge;
- Wired up the rendering branches for all four styles;
- Added an edit dialog: AI generate / modify, code editing, and live preview;
- When exporting, requests a screenshot from the iframe;
- Big-screen layout makes the 3D component the visual focus first.
- Samples: built in several sample reports.
Partway through there was one plan change. The original plan was to make HTML a new chart type. Research showed that chart types are validated in dozens of places, so the plan switched to a “render overlay”, and the reason was explained proactively.
Stage 3: iterating on user feedback
| User feedback | Action |
|---|---|
| “I added it by hand, why can’t I see it?” | The entry point was only in the card toolbar; the “Add component” dialog was missed → added the 5th component type |
| “Only one?” “Make a more advanced one.” | The samples were too small and cramped on the big screen → rebuilt two advanced samples, using explicit layouts so the 3D component fills most of the screen |
| “Reference the 3D building in the original big-screen product.” | Took the original component source from the reference product’s live sample. It turned out the original was pure CSS 3D, so it was ported directly, with no external library dependency, and it works on the intranet |
| “Something’s off with the styling, right?” + screenshot | Traced it to buttons using the 28px icon-button style and the overlay color pulling the wrong variable; fixed both one by one |
A screenshot is the most efficient kind of feedback: one screenshot is far more precise than a paragraph of description.
Stage 4: review and testing
- Dispatched an independent review subagent, given only the code and no conclusions. It found 13 issues (security, data consistency, cost limits, etc.). After checking them one by one, 12 were fixed.
- Back end: 47 method-level tests (with a fake AI). Front end: 32 browser tests, plus screenshot regression on the samples.
- Two more issues were found and fixed during testing.
Stage 5: standards and release
- Checked item by item against the team standards (a Skill): added the author and date to the Javadoc, extracted repeated code into shared methods, split methods longer than 50 lines, and merged the change log into a single entry that labels the new files.
- Updated the module’s
CLAUDE.md, the to-do list and the feature comparison doc. - Committed the code. Then added the new samples to the product website’s sample list: took the cover images from the live pages, updated the sample list, ran the website locally to verify, and committed.
Review: which practices paid off most
- Plan before code: the two key decisions were settled before work began, so nothing had to be torn down and redone later.
- Find the original implementation before building: porting the reference big-screen component gave much better results, and was much faster, than designing it from scratch.
- Independent review: looking at your own code from a viewpoint that doesn’t know the design reasoning catches many problems.
- Evidence first: every stage had a build, a test or a screenshot, so what users see is already verified.
- Turn standards into a Skill: at the end, a single command checks the changes against the team standards.
What could have gone better
- The first version didn’t account for the “Add component” entry point, and it was only added after a user spotted the gap → the planning stage should list every user entry point.
- The first version had too many samples, and they were too small → samples should first settle what they are meant to show, with fewer and better ones.
- Verifying on real pages depended on restarting the back end, so some checks could only be done offline → confirm the verification environment before development starts.