PRD Agent

Product Requirements Document management with AI agents

Generate Diagrams

AI-generated

Summary

Generate ER and state machine diagrams as Mermaid diagrams from a given PRD project JSON using the Claude AI agent.

Inputs

  • Project JSON (required) — Current PRD project JSON describing the project details and structure.
  • Project Name (required) — Name of the project to be used in the PRD.
  • PRD Output Directory — Filesystem directory path to save generated PRD markdown files; if left empty, no files are saved.
  • Working Directory — Directory path where the Claude CLI command executes, affecting execution context.
  • Additional Options — Options including maxTurns (number of agentic interaction turns, 1-100, default 5), verbose (enable detailed logging, default false), and modelAlias (Claude model variant to use: 'sonnet', 'opus', or 'haiku', default 'sonnet').

Output shape

a list containing a single JSON object with properties such as the operation name, project name, the parsed AI response with Mermaid diagram content, optional saved markdown file path, Claude session usage info, turn count, and optionally detailed messages if verbose is enabled

The output may include a saved markdown file in the specified PRD Output Directory if set. The AI response is expected to be JSON parseable into diagram data. Errors during execution produce error messages unless continueOnFail is enabled.

Examples

Example 1: Generate Mermaid ER and state machine diagrams for a PRD

Provide 'Project JSON' with current PRD data, a 'Project Name', optionally a directory to save markdown files, set a working directory if needed, and optionally configure agent CLI and logging options.

Discussion