AI Agent Integration
Prodara is designed to be driven by AI coding agents. Most users never write Prodara by hand - they describe what they want in natural language, and their AI agent writes and iterates on the .prd specification using the compiler as a feedback loop.
Compatible AI Providers
Any AI agent that can read files, write files, and run terminal commands works with Prodara.
How It Works
The agent-driven workflow is a three-party loop between You (the human), Your AI Agent, and the Prodara Compiler:
You describe what you want
Tell your AI agent in natural language what your product should do - entities, workflows, rules, screens.
Agent writes .prd files
The agent creates or modifies Prodara specification files based on your description.
Agent compiles with the CLI
The agent runs `prodara build --format json` and reads the structured output.
Agent fixes errors
If the compiler reports diagnostics, the agent reads the suggested fixes and applies them automatically.
You review the result
The VS Code extension shows you the spec with syntax highlighting and diagnostics. Approve or request changes.
Repeat
Continue the loop - describe a new feature, the agent writes it, the compiler validates, you review.
VS Code Extension
The Prodara VS Code extension enhances the agent workflow with real-time feedback:
- Syntax Highlighting - Full TextMate grammar for
.prdfiles so you can review agent output at a glance - Real-Time Diagnostics - Errors and warnings appear inline as the agent writes, without needing to run the CLI
- LSP Integration - Go-to-definition, hover info, and symbol navigation across modules
- Agent-Friendly - AI agents running in VS Code (Copilot, Cursor, etc.) can see diagnostics directly in the editor context
CLI Contract
The CLI is the agent's interface to the compiler. It's designed to be non-interactive, deterministic, and machine-readable:
- Non-interactive - No prompts, no user input required
- Deterministic - Same input always produces the same output
- JSON output -
--format jsonon every command - Clean exit codes - 0 for success, 1 for errors
- stdout/stderr separation - JSON on stdout, logs on stderr
Agent Workflow Commands
A typical agent workflow follows this sequence:
# 1. Validate the spec
prodara validate --format json ./project
# 2. If errors, apply fixes and re-validate
# (the agent reads diagnostics and fixes automatically)
# 3. Emit the Product Graph
prodara graph --format json ./project
# 4. Generate incremental plan
prodara plan --format json ./project
# 5. Run spec tests
prodara test --format json ./projectIterative Fix Loop
When validation fails, diagnostics include fix.suggestions with exact file locations and machine-applicable text edits. The agent reads the diagnostic, applies the fix, and re-validates until the spec compiles cleanly.
{
"code": "PRD0301",
"severity": "error",
"message": "Type mismatch: expected 'money', got 'string'",
"location": {
"file": "billing.prd",
"line": 12,
"column": 10
},
"fix": {
"description": "Change field type to money",
"edits": [
{ "line": 12, "oldText": "total: string", "newText": "total: money" }
]
}
}Four JSON Outputs
Diagnostics
Errors, warnings, and machine-applicable fix suggestions with exact source locations.
Product Graph
The compiled semantic model - all nodes, edges, and metadata as JSON.
Plan Artifact
Incremental change analysis with impact propagation and actionable tasks.
Test Results
Spec test pass/fail status for transitions, authorization, and validation rules.
Example Agent Prompt
Here's an example prompt you can give your AI agent to create a Prodara spec:
I have a Prodara project in ./my-project. Create a billing module with:
- An invoice entity with customer reference, line items, total, status
- Workflows: create_invoice, issue_invoice, pay_invoice
- A dashboard surface for viewing all invoices
- Authorization: only accountants can create invoices
- Tests for the status transitions
Run `prodara build --format json ./my-project` after writing the spec
to validate it. Fix any errors the compiler reports.Next Steps
Learn about the single AI prompt file generated for each agent, try interactive modes like Explore, Help, and Party, or configure custom reviewers for the review pipeline.