Back/Engineering/Cursor
BeginnerEngineering

How to Perform an AI-Powered Codebase Audit and Architecture Visualization

Use an AI model like GLM 5.2 to analyze an entire codebase, summarize its architecture and recent changes, and then generate a visual HTML report to share with your team.

How to Perform an AI-Powered Codebase Audit and Architecture Visualization

11:04 to 16:37: Claire asks GLM 5.2 to inspect a repository, explain its architecture and recent work, then render the findings as an HTML visual.

Before you start

What you need

  • A local repository opened in Cursor
  • The branch or commit range that defines recent work
  • The audience and questions the visual should answer

What you’ll make

A shareable HTML architecture map grounded in the repository, with major systems, data flow, and recent changes explained.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

5 steps

Step01

Open Codebase in AI Editor

Configure an AI model like GLM 5.2 in your code editor, such as Cursor. Make sure the model has access to your project's entire codebase.

Example prompt
Configure an AI model like GLM 5.2 in your code editor, such as Cursor. Make sure the model has access to your project's entire codebase.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for open codebase in ai editor.
Step02

Prompt for Initial Analysis

Prompt the AI to analyze the entire codebase. Ask for a summary of its architecture and recent development activity, such as features shipped in the last few weeks.

Example prompt
This is the chat, PRD code base. Please explore it and tell me a little bit about its architecture and the most recent things we have been shipping on this code base.
Step03

Review the AI's Summary

Review the AI's summary. Check for accuracy in its description of your tech stack, the overall architecture, and its summary of recent commits or shipped features.

Example prompt
Review the AI's summary. Check for accuracy in its description of your tech stack, the overall architecture, and its summary of recent commits or shipped features.

My actual values:
[insert the files, settings, accounts, or constraints for this step]

Give me the exact commands, settings, or output to use. Finish with a pass or fail check for review the ai's summary.
Step04

Prompt for HTML Visualization

Prompt the AI to transform its text analysis into a single, self-contained HTML file. Specify that the page should visually represent the application's architecture and summarize the product strategy or upcoming roadmap.

Example prompt
Turn this into an HTML page that can communicate the overall architecture of the app and give a sense of the upcoming roadmap. You can use whatever components you want to make this look good and communicate to me the end developer, the major pieces of the architecture and product strategy. Give me a page to pull up when it's ready to review.
Step05

Review Final HTML Page

Open the generated HTML file in a browser. Review the page for clarity, design quality, and accuracy. Check if the model successfully visualized the architecture and roadmap, and note if it correctly inferred details like brand colors or product pillars.

Example prompt
This is a good start. I like the overall layout and the roadmap section. However, can you make a few changes?
1. The color used for the main header is too dark. Please change it to [hex code or color description].
2. The diagram for '[Component Name]' is confusing. Please regenerate it as a simple list instead of a flow chart.
3. Add a new section titled 'Key Integrations' and list the following: [list of integrations].

What good looks like

  • Every named component maps to a real file or directory
  • Recent changes are tied to commits or diffs rather than guessed
  • The HTML opens locally and makes the main architecture legible without reading the code

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The report invents services or relationships
Require a file path beside every component and remove any statement the model cannot trace to code.
The HTML is attractive but hard to navigate
Ask for a simpler system map, a short legend, and separate sections for architecture, data flow, and recent changes.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready