feat: Add prd-copilot kit#195
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR adds a PRD Copilot kit with draft/refine agent documentation, Lamatic orchestration, a three-step Next.js client workflow, Mermaid rendering, and local application configuration. ChangesPRD Copilot Kit
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@kits/prd-copilot/apps/actions/orchestrate.ts`:
- Line 92: The logging in orchestrate.ts is exposing the full Lamatic response
payload via JSON.stringify(resData), which can leak user ideas, answers, and
generated PRDs. Update the console.log in orchestrate flow handling to log only
a minimal non-sensitive summary or metadata (for example, status or identifiers)
instead of the raw payload, and keep the rest of the response out of logs.
In `@kits/prd-copilot/apps/app/layout.tsx`:
- Around line 6-7: The Geist and Geist Mono fonts are created in layout.tsx but
never applied, so their generated font-face values won’t be used. Update the
layout component to attach the appropriate font className/variable from _geist
and _geistMono to the root DOM element (typically body), and then change
globals.css to reference those font variables instead of the literal Geist
family name. Make sure the fix is centered around the existing Geist and
Geist_Mono declarations in layout.tsx and the font-sans / font-mono settings in
globals.css.
- Around line 9-13: Update the metadata in layout.tsx so the exported metadata
for the app uses PRD Copilot branding instead of the default v0 template values.
In the metadata object, change the title, description, and generator fields in
the metadata export to match the PRD Copilot kit identity, keeping the rest of
the metadata structure intact.
In `@kits/prd-copilot/apps/app/page.tsx`:
- Around line 252-268: The clarifying questions form in the page component is
still using raw inputs with manual answer state, so replace that form handling
with react-hook-form and zod in the questions section. Update the form logic
around the questions rendering to use a schema-based resolver, register each
question field through the form API, and move the existing
handleAnswerChange/answers state flow to react-hook-form-managed values while
keeping the current UI and validation behavior compatible with React 19.
In `@kits/prd-copilot/apps/components/MermaidDiagram.tsx`:
- Around line 17-29: The Mermaid initialization in MermaidDiagram is using a
permissive security setting that can allow unsafe HTML through diagram labels.
Update the mermaid.initialize call to use strict sanitization by changing the
securityLevel setting from loose to strict while keeping the existing theme and
themeVariables configuration intact.
In `@kits/prd-copilot/apps/next.config.mjs`:
- Around line 3-5: Remove the TypeScript build override from next.config.mjs by
updating the Next.js config object so it no longer sets ignoreBuildErrors inside
the typescript block. Keep the rest of the configuration, including
images.unoptimized, unchanged, and make sure the exported config from the
Next.js settings enforces type checking during builds.
In `@kits/prd-copilot/apps/orchestrate.js`:
- Around line 1-27: Convert the orchestrate config from the current JavaScript
module to a TypeScript module so the exported shape is typed instead of inferred
as any. Define explicit interfaces/types for the config object and the nested
flow entry used by config.flows["prd-copilot"], then export config with that
type so consumers like lamatic-client.ts and orchestrate.ts get compile-time
checking for fields such as workflowId, expectedOutput, and api properties.
Update the module name/imports accordingly so the typed config remains the
single source of truth and catches drift or typos in the orchestrate contract.
In `@kits/prd-copilot/apps/package.json`:
- Line 46: Remove the redundant Tailwind v3-era dependencies from the package
manifest: drop autoprefixer and tailwindcss-animate from the apps package so
Tailwind CSS v4 relies on its built-in Lightning CSS prefixing and the existing
tw-animate-css plugin instead. Update the dependency list in the package.json
used by the app, keeping only the v4-compatible animation package, and make sure
no build/config files still reference autoprefixer or tailwindcss-animate after
the cleanup.
- Line 53: The dependency list in package.json still pins lamatic to latest, and
react-markdown should be fixed too; replace both with explicit version numbers
instead of floating tags so installs are reproducible. Update the dependencies
entries for lamatic and react-markdown together, keeping the rest of the package
manifest unchanged.
In `@kits/prd-copilot/apps/tsconfig.json`:
- Line 9: The TypeScript compiler target in the main tsconfig is too old for the
Next.js 16 / React 19 setup, so update the tsconfig `target` setting from ES6 to
ES2017 or higher. Use the existing `target` entry in the tsconfig file and keep
the rest of the compiler options unchanged unless needed, so type checking can
recognize modern built-ins like `Object.entries` and async/await without extra
lib tweaks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6425f034-fb84-4622-b9b4-3c79763c3e2b
⛔ Files ignored due to path filters (1)
kits/prd-copilot/apps/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (19)
kits/prd-copilot/README.mdkits/prd-copilot/agent.mdkits/prd-copilot/apps/.env.examplekits/prd-copilot/apps/.gitignorekits/prd-copilot/apps/actions/orchestrate.tskits/prd-copilot/apps/app/globals.csskits/prd-copilot/apps/app/layout.tsxkits/prd-copilot/apps/app/page.tsxkits/prd-copilot/apps/components.jsonkits/prd-copilot/apps/components/MermaidDiagram.tsxkits/prd-copilot/apps/lib/lamatic-client.tskits/prd-copilot/apps/next.config.mjskits/prd-copilot/apps/orchestrate.jskits/prd-copilot/apps/package.jsonkits/prd-copilot/apps/postcss.config.mjskits/prd-copilot/apps/tsconfig.jsonkits/prd-copilot/constitutions/default.mdkits/prd-copilot/flows/prd-copilot.tskits/prd-copilot/lamatic.config.ts
…and ts migrations
|
@coderabbitai Please re-review the pull request. We have addressed all your review feedback in the latest commits:
Please verify these fixes and update the PR status accordingly. Thanks! |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
cd /tmp 2>/dev/null || true
# Check orchestrate.ts logging
echo "=== orchestrate.ts ==="
fd orchestrate.ts kits/prd-copilot || true
cat kits/prd-copilot/apps/actions/orchestrate.ts 2>/dev/null || true
echo "=== orchestrate.ts (root, formerly .js) ==="
cat kits/prd-copilot/apps/orchestrate.ts 2>/dev/null || echo "not found"
fd 'orchestrate.js' kits/prd-copilot || echo "orchestrate.js not found"
echo "=== MermaidDiagram.tsx ==="
cat kits/prd-copilot/apps/components/MermaidDiagram.tsx 2>/dev/null
echo "=== layout.tsx ==="
cat kits/prd-copilot/apps/app/layout.tsx 2>/dev/null
echo "=== globals.css ==="
cat kits/prd-copilot/apps/app/globals.css 2>/dev/null
echo "=== package.json ==="
cat kits/prd-copilot/apps/package.json 2>/dev/nullLength of output: 1418 🏁 Script executed: #!/bin/bash
set -euo pipefail
pwd
ls
echo "=== find kits ==="
fd -t d prd-copilot
echo "=== orchestrate files ==="
fd orchestrate kits/prd-copilotLength of output: 569 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== actions/orchestrate.ts ==="
cat kits/prd-copilot/apps/actions/orchestrate.ts
echo "=== apps/orchestrate.ts ==="
cat kits/prd-copilot/apps/orchestrate.ts
echo "=== MermaidDiagram.tsx ==="
cat kits/prd-copilot/apps/components/MermaidDiagram.tsx
echo "=== layout.tsx ==="
cat kits/prd-copilot/apps/app/layout.tsx
echo "=== globals.css (head) ==="
sed -n '1,40p' kits/prd-copilot/apps/app/globals.css
echo "=== package.json ==="
cat kits/prd-copilot/apps/package.jsonLength of output: 13517
This message will self-destruct... just kidding, but the mission is a success. Triggering a fresh review now to lock in the verification. ✅ Action performedReview finished.
|
|
@coderabbitai Please verify if all review checks are now complete and resolved with the latest commits. If everything is perfect and ready for merge, |
|
Tip For best results, initiate chat on the files or code changes.
This tape will self-destruct in five seconds — but before it does: Good luck, and godspeed. 🫡 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@kits/prd-copilot/apps/actions/orchestrate.ts`:
- Line 95: The fallback in orchestrate.ts currently uses an unsafe as any cast
on the Lamatic response path, which bypasses type checking. Update the rawAnswer
assignment to use a precise type assertion for the alternate output.answer shape
instead of any, and keep the existing resData/result/answer access pattern
intact. Use the surrounding symbols rawAnswer and resData to locate the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: a32b01d9-4d40-4eb8-a40f-84093c13cb6e
📒 Files selected for processing (9)
kits/prd-copilot/apps/actions/orchestrate.tskits/prd-copilot/apps/app/globals.csskits/prd-copilot/apps/app/layout.tsxkits/prd-copilot/apps/components/MermaidDiagram.tsxkits/prd-copilot/apps/lib/lamatic-client.tskits/prd-copilot/apps/next.config.mjskits/prd-copilot/apps/orchestrate.tskits/prd-copilot/apps/package.jsonkits/prd-copilot/apps/tsconfig.json
💤 Files with no reviewable changes (1)
- kits/prd-copilot/apps/next.config.mjs
|
Hi @Mahajan-Sachin! 👋 Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review. Steps to follow:
This helps keep the review process efficient for everyone. Thank you! 🙏 |
|
@coderabbitai could you please tell me whats happening right now? is there any changes which you requested but i didn't do? |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@kits/prd-copilot/apps/app/page.tsx`:
- Around line 173-178: The product idea input textarea in page.tsx is missing an
accessible label, so add an aria-label directly on the existing textarea element
used for the idea state. Keep the current placeholder and styling, and update
the textarea in the page component so assistive technologies can identify it
without relying on placeholder text.
- Around line 86-91: The clipboard flow in handleCopyPRD should not mark success
before navigator.clipboard.writeText completes, since the Promise can reject and
currently leaves the UI in a false “Copied!” state. Update handleCopyPRD in
page.tsx to await the writeText call (or chain it) and handle failures with a
catch so setCopied(true) only runs on success. Use the existing handleCopyPRD,
setCopied, and navigator.clipboard.writeText symbols to locate the fix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: c1a3f601-471e-4a52-857e-9e3a42bfe539
⛔ Files ignored due to path filters (1)
kits/prd-copilot/apps/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (20)
kits/prd-copilot/.env.examplekits/prd-copilot/README.mdkits/prd-copilot/agent.mdkits/prd-copilot/apps/.env.examplekits/prd-copilot/apps/.gitignorekits/prd-copilot/apps/actions/orchestrate.tskits/prd-copilot/apps/app/globals.csskits/prd-copilot/apps/app/layout.tsxkits/prd-copilot/apps/app/page.tsxkits/prd-copilot/apps/components.jsonkits/prd-copilot/apps/components/MermaidDiagram.tsxkits/prd-copilot/apps/lib/lamatic-client.tskits/prd-copilot/apps/next.config.mjskits/prd-copilot/apps/orchestrate.tskits/prd-copilot/apps/package.jsonkits/prd-copilot/apps/postcss.config.mjskits/prd-copilot/apps/tsconfig.jsonkits/prd-copilot/constitutions/default.mdkits/prd-copilot/flows/prd-copilot.tskits/prd-copilot/lamatic.config.ts
|
@coderabbitai all checks are passed, whats next? is there any change left? |
|
Tip For best results, initiate chat on the files or code changes.
All six checkpoints remain green from CodeRabbit's side:
Nothing new has landed since the last verification pass, so there's no additional intel to report. The ball is now in the maintainers' court — This channel will remain open in case anything changes. Good work, agent — over and out. 🫡 |
|
@coderabbitai, do I need to tag github-actions too? because earlier it tagged me, telling me to comment after fulfilling all your changes requirements. if yes tell github-actions yourself, all changes are addressed |
|
Tip For best results, initiate chat on the files or code changes.
CodeRabbit and the So yes — if From my side, the mission is still green: all six checkpoints are verified and there's nothing outstanding. Over to you to close the loop with the other agent. 🫡 |
|
All requested changes from CodeRabbit have been successfully addressed and resolved. |
|
@github-actions All requested changes from CodeRabbit have been successfully addressed and resolved. |
All requested changes from CodeRabbit have been successfully addressed and resolved. |
… handling in page.tsx
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
kits/prd-copilot/apps/app/page.tsx (1)
277-283: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winThe "Start over" button has no safety catch — a pending promise can hijack the user back to the result step.
The "Start over" button in the questions step lacks
disabled={loading}. If a user clicks it whilehandleFinalizePRDis still in flight,handleRestartresets all state to the input step — but the staleorchestratePRD("refine", ...)promise is still running. When it resolves, it callssetStep("result"), teleporting the user away from whatever they're doing and overwriting state with the old result.🔧 Lock the escape hatch during loading
<button onClick={handleRestart} + disabled={loading} className="flex items-center space-x-1.5 text-sm text-slate-500 hover:text-slate-300 transition" > <ArrowLeft className="h-4 w-4" /> <span>Start over</span> </button>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@kits/prd-copilot/apps/app/page.tsx` around lines 277 - 283, Add disabled={loading} to the “Start over” button in the questions-step markup, identified by its onClick={handleRestart} handler, so users cannot restart while handleFinalizePRD is pending and trigger stale result updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@kits/prd-copilot/apps/app/page.tsx`:
- Around line 277-283: Add disabled={loading} to the “Start over” button in the
questions-step markup, identified by its onClick={handleRestart} handler, so
users cannot restart while handleFinalizePRD is pending and trigger stale result
updates.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8c347d2c-3af5-4b55-a1f9-b642395fa1c8
📒 Files selected for processing (1)
kits/prd-copilot/apps/app/page.tsx
|
@coderabbitai Resolved. Added |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
fd page.tsx kits/prd-copilot
rg -n "Start over" kits/prd-copilot/apps/app/page.tsx -A5 -B5
rg -n "disabled=\{loading\}" kits/prd-copilot/apps/app/page.tsxLength of output: 990
This objective is officially closed. No further outstanding items from my side — the file self-destructs in five seconds. 🫡 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
This Pull Request introduces the PRD Copilot Kit to AgentKit. The PRD Copilot is an agentic tool that automates the generation of detailed Product Requirements Documents (PRDs) and visual application flowcharts from raw user ideas, incorporating interactive clarifying questions.
Key Features:
mode: draftvsmode: refine).PR Checklist
1. Select Contribution Type
kits/<category>/<kit-name>/)bundles/<bundle-name>/)templates/<template-name>/)2. General Requirements
kebab-caseand matches the flow IDREADME.md(purpose, setup, usage)3. File Structure (Check what applies)
lamatic.config.tspresent with valid metadata (name, description, tags, steps, author, env keys).env.examplewith placeholder values only (kits only)4. Validation
npm install && npm run devworks locally (kits: UI runs; bundles/templates: flows are valid)feat: Add prd-copilot kit)kits/prd-copilot/:README.md(end-to-end kit/flow setup, GraphQL/API inputs, and draft-vs-refine routing + expected JSON output shapes)agent.md(agent behavior:draftgenerates PRD outline + clarifying questions;refinefinalizes PRD + generates Mermaid + empty questions list)lamatic.config.ts(kit metadata + step wired toPRD_COPILOT_FLOW_ID)flows/prd-copilot.ts(Lamatic flow placeholder exportingmeta, references, andnodes = [],edges = [])constitutions/default.md(assistant safety/tone/data-handling rules).env.example(placeholders forPRD_COPILOT_FLOW_IDand Lamatic API env vars)kits/prd-copilot/apps/:package.json,package-lock.jsontsconfig.json,next.config.mjs,postcss.config.mjscomponents.json(shadcn config).env.example,.gitignoreapp/globals.css(Tailwind + light/dark theme tokens)app/layout.tsx(typedmetadata+ root layout)app/page.tsx(client UI/workflow: idea input → generated questions → finalize PRD; supports copy/download/restart; PRD vs flowchart tabs)components/MermaidDiagram.tsx(client-side Mermaid rendering to SVG with error panel)kits/prd-copilot/apps/orchestrate.ts(typed GraphQL/kit config +configreferencing theprd-copilotflow and env wiring)kits/prd-copilot/apps/actions/orchestrate.ts(server actionorchestratePRD(mode, instructions, answers?); executes Lamatic flow and parses/normalizes the LLM output to{ prd, questions, mermaid }with robust JSON/code-fence handling and fallback/error responses)kits/prd-copilot/apps/lib/lamatic-client.ts(Lamatic client bootstrap + required env validation forPRD_COPILOT_FLOW_IDand Lamatic API credentials)flow.json/exported flow graph (with concrete nodetypes) exists in this repo.kits/prd-copilot/flows/prd-copilot.tsdefines no nodes/edges (nodes = [],edges = []), so node types cannot be validated here.kits/prd-copilot/README.md.orchestratePRDtwice:mode: "draft": sendsinstructions(user idea) and returns PRD draft + clarifying questions.mode: "refine": sends the draft plus an answers block and returns finalized PRD + Mermaid flowchart code.orchestratePRDruns the Lamatic Studio flow identified byPRD_COPILOT_FLOW_IDand normalizes the LLM result into a consistent response shape for the UI to render.