Skip to content

feat: You tube creator copilot#210

Open
RohitIndurke wants to merge 4 commits into
Lamatic:mainfrom
RohitIndurke:YouTube-Creator-Copilot
Open

feat: You tube creator copilot#210
RohitIndurke wants to merge 4 commits into
Lamatic:mainfrom
RohitIndurke:YouTube-Creator-Copilot

Conversation

@RohitIndurke

@RohitIndurke RohitIndurke commented Jul 10, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • config.json present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified
  • Added the website-optimiser kit configuration, metadata, environment templates, Git ignore rules, documentation, agent capabilities, and constitution guidelines.
  • Added the webrevive-orchestrator flow:
    • Uses a GraphQL/API request trigger node to receive website URL, business context, and audit data.
    • Passes the request to a dynamic LLM node with system and user prompt templates.
    • Produces a structured JSON website audit, including SEO, performance, UX, competitors, conversion recommendations, outreach content, and a business proposal.
  • Added a Next.js application for the WebRevive AI website audit and cold-outreach experience.
  • Added the interactive audit form with URL validation, optional business details, loading/error states, reset functionality, and tabbed results dashboard.
  • Added server-side orchestration that runs the Lamatic flow and PageSpeed analysis concurrently, normalizes AI output, overlays Lighthouse metrics, and provides fallback handling for malformed responses.
  • Added PageSpeed API integration for mobile performance scores and metrics including FCP, LCP, CLS, TBT, and Speed Index.
  • Added comprehensive UI styling, animations, design tokens, responsive dashboard sections, score displays, issue cards, outreach previews, and proposal views.
  • Added reusable UI components for buttons, forms, inputs, labels, and Radix-based selects, plus shared Tailwind class utilities.
  • Added Next.js, TypeScript, Tailwind, PostCSS, dependency, and editor configuration files.
  • Added the WebRevive system prompt defining the required inputs, strict JSON schema, website-specific analysis rules, scoring requirements, and outreach-generation behavior.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

WebRevive AI adds a Lamatic audit workflow, PageSpeed-backed server orchestration, and a Next.js dashboard for submitting website audits and viewing structured SEO, performance, UX, competitor, conversion, outreach, and proposal results.

WebRevive workflow

Layer / File(s) Summary
Workflow contracts and prompt definitions
kits/website-optimiser/flows/..., kits/website-optimiser/prompts/..., kits/website-optimiser/lamatic.config.ts, kits/website-optimiser/constitutions/...
Defines the Lamatic flow graph, system prompt, kit metadata, and generated audit output requirements.

Audit services

Layer / File(s) Summary
Audit contracts and external data services
kits/website-optimiser/apps/actions/pagespeed.ts, kits/website-optimiser/apps/actions/orchestrate.ts
Adds typed report structures and retrieves mobile Lighthouse performance metrics.
Website audit orchestration
kits/website-optimiser/apps/actions/orchestrate.ts
Executes Lamatic and PageSpeed requests, parses model responses, normalizes reports, handles fallback output, and overlays performance data.

Dashboard interface and setup

Layer / File(s) Summary
Dashboard interface and application setup
kits/website-optimiser/apps/app/..., kits/website-optimiser/apps/components/..., kits/website-optimiser/apps/lib/..., kits/website-optimiser/apps/package.json, kits/website-optimiser/apps/*.json, kits/website-optimiser/README.md, kits/website-optimiser/.env.example
Adds the validated audit form, tabbed report dashboard, shared UI components, global styling, Next.js configuration, environment templates, and setup documentation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the new YouTube Creator Copilot kit/template and summarizes the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@akshatvirmani akshatvirmani changed the title You tube creator copilot feat: You tube creator copilot Jul 13, 2026
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/website-optimiser

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@akshatvirmani

Copy link
Copy Markdown
Contributor

/validate

@github-actions

Copy link
Copy Markdown
Contributor

📡 Running Studio validation — results will appear here shortly.

@github-actions

Copy link
Copy Markdown
Contributor

Studio Runtime Validation (Phase 2)

Studio validation failed. The kit was rejected by Lamatic Studio.

Errors

youtube-creator-copilot

  • Flow: agentic-youtube-creator — GraphQL realtime trigger requires a connected GraphQL Response node
  • Flow: agentic-youtube-creator | Node: LLMNode_1 — Required field "Generative Model Name" (generativeModelName) is missing on Generate Ideas
  • Flow: webrevive-orchestrator — GraphQL realtime trigger requires a connected GraphQL Response node
  • Flow: webrevive-orchestrator | Node: LLMNode_1 — Required field "Generative Model Name" (generativeModelName) is missing on WebRevive 12-Agent Orchestrator

Please fix the errors above and push a new commit to re-run validation.
Refer to CONTRIBUTING.md for guidance.

@akshatvirmani

Copy link
Copy Markdown
Contributor

@RohitIndurke resolve the comments above

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
kits/youtube-creator-copilot/README.md (1)

1-22: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Wrong dossier handed to the agent — this briefing describes a different mission entirely.

This README describes a YouTube "viral video ideas, scripts, thumbnail concepts" copilot and only tells users to deploy the agentic-youtube-creator flow. But the actual shipped app (layout.tsx, page.tsx) is "WebRevive AI" — a website-audit/cold-outreach tool that requires WEBREVIVE_FLOW_ID (per orchestrate.ts's analyzeWebsite, which fails immediately without it). A user following these instructions verbatim will never set WEBREVIVE_FLOW_ID, and the app will error out on first use.

Please update the README to reflect the WebRevive AI product, name the webrevive-orchestrator flow, and document WEBREVIVE_FLOW_ID in the setup steps.

🤖 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/youtube-creator-copilot/README.md` around lines 1 - 22, Rewrite the
README to describe the WebRevive AI website-audit and cold-outreach application
instead of the YouTube creator copilot. Replace references to
`agentic-youtube-creator` with `webrevive-orchestrator`, and update the setup
instructions to require configuring `WEBREVIVE_FLOW_ID` alongside the Lamatic
credentials before running the app.
🤖 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/youtube-creator-copilot/agent.md`:
- Around line 1-5: Add blank lines immediately after the # Identity and #
Capabilities headings in the agent documentation, preserving the existing
heading text and list content so the Markdown satisfies MD022.

In `@kits/youtube-creator-copilot/apps/actions/orchestrate.ts`:
- Around line 148-152: Update analyzeWebsite in
kits/youtube-creator-copilot/apps/actions/orchestrate.ts:148-152 to import
../../lamatic.config and obtain the flow ID from the kit’s step definitions
instead of process.env.WEBREVIVE_FLOW_ID. The sibling site
kits/youtube-creator-copilot/apps/.env.example:1-5 requires no direct change
because the env-var lookup should be removed rather than retained as a fallback.
- Around line 178-180: Remove the unconditional raw AI output logging around the
orchestration flow, including the three console.log calls surrounding rawOutput.
If diagnostic logging is required, gate it behind the existing debug
configuration and ensure production execution never logs rawOutput or other
sensitive generated content.

In `@kits/youtube-creator-copilot/apps/app/globals.css`:
- Line 1: Update the lint configuration for the CSS containing the Tailwind
directives so Stylelint recognizes `@tailwind` and `@apply`, using Tailwind-aware
configuration such as stylelint-config-tailwindcss or ignoreAtRules, and exclude
CSS from Biome’s linter scope if needed. Ensure CI no longer reports these
directives as unknown syntax.
- Line 5: Remove the Google Fonts `@import` from globals.css and configure Inter
and JetBrains Mono through next/font/google in the app’s layout component, using
the existing CSS variable names and applying the generated font variables to the
document or root layout.
- Around line 1-3: Upgrade the app’s Tailwind setup from v3 to v4: replace the
v3 directives in globals.css with the v4 CSS entrypoint, update the tailwindcss
dependency and PostCSS plugin configuration in package.json and related config,
and migrate the theme configuration to the v4 format while preserving existing
design tokens and styling.

In `@kits/youtube-creator-copilot/apps/app/page.tsx`:
- Around line 227-255: Update the tab navigation around the mapped buttons to
expose complete ARIA tab semantics: mark the container as a tablist, give each
button role="tab" with aria-selected reflecting activeTab and aria-controls
referencing its corresponding panel, and ensure each tab panel uses the matching
tabpanel role/id relationship. Preserve the existing activeTab behavior.
- Around line 86-155: Replace the raw state-managed intake form fields around
handleSubmit with react-hook-form and zod validation, defining a schema for URL,
businessName, industry, and targetService and wiring submission through the form
hook. Use the project’s shadcn/ui Form, Input, and Select components instead of
native input/select elements, while preserving the existing fields, optional
values, loading-disabled behavior, and submit flow.
- Around line 21-25: Update handleCopy so setCopiedKey and its timeout run only
after navigator.clipboard.writeText successfully resolves; handle the rejected
promise without showing the copied confirmation.
- Around line 259-691: Guard every nested array rendered by the dashboard,
including competitors.list, finalReport.priorityFixes, proposal.timeline, and
the other visible .map() sources, so missing values default to empty arrays
before mapping. Prefer normalizing these fields in orchestrate.ts if that is the
established parser boundary; otherwise add local fallbacks in the relevant
render expressions while preserving existing results for populated arrays.

In `@kits/youtube-creator-copilot/apps/package.json`:
- Line 13: Update the lamatic dependency entry in package.json from the floating
latest tag to the latest stable published version, using a specific pinned
version or caret range so installs remain reproducible and controlled.

In `@kits/youtube-creator-copilot/apps/tsconfig.tsbuildinfo`:
- Line 1: Remove the generated tsconfig.tsbuildinfo artifact from the kit source
and add *.tsbuildinfo to the repository ignore configuration. Do not commit
regenerated build-cache files; they should only be created during local or CI
TypeScript builds.

In `@kits/youtube-creator-copilot/lamatic.config.ts`:
- Around line 1-20: Update the exported kit metadata to identify YouTube Creator
Copilot rather than webrevive-ai, including its name, description, and relevant
tags. In the steps array, register both the creator workflow from
agentic-youtube-creator.ts and the existing website-audit workflow using their
intended environment keys. Update the github and deploy links to target the
YouTube Creator Copilot kit while preserving the kit’s required metadata
structure.

In
`@kits/youtube-creator-copilot/prompts/agentic-youtube-creator_llm-node_system.md`:
- Around line 1-7: Add a neutral top-level H1 heading at the beginning of the
system prompt before the existing “You are an expert YouTube Strategist”
instructions, preserving all current prompt content and Markdown formatting.

In `@kits/youtube-creator-copilot/README.md`:
- Line 12: Update the fenced shell code block in the README so it has blank
lines before and after the ```sh fence, satisfying markdownlint’s required
spacing while preserving the block content.

---

Outside diff comments:
In `@kits/youtube-creator-copilot/README.md`:
- Around line 1-22: Rewrite the README to describe the WebRevive AI
website-audit and cold-outreach application instead of the YouTube creator
copilot. Replace references to `agentic-youtube-creator` with
`webrevive-orchestrator`, and update the setup instructions to require
configuring `WEBREVIVE_FLOW_ID` alongside the Lamatic credentials before running
the app.
🪄 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: a11541e8-54c0-43aa-8c17-53acf50a5c91

📥 Commits

Reviewing files that changed from the base of the PR and between dafde4c and 68cf6aa.

⛔ Files ignored due to path filters (1)
  • kits/youtube-creator-copilot/apps/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • kits/youtube-creator-copilot/.gitignore
  • kits/youtube-creator-copilot/README.md
  • kits/youtube-creator-copilot/agent.md
  • kits/youtube-creator-copilot/apps/.env.example
  • kits/youtube-creator-copilot/apps/.vscode/settings.json
  • kits/youtube-creator-copilot/apps/actions/orchestrate.ts
  • kits/youtube-creator-copilot/apps/actions/pagespeed.ts
  • kits/youtube-creator-copilot/apps/app/globals.css
  • kits/youtube-creator-copilot/apps/app/layout.tsx
  • kits/youtube-creator-copilot/apps/app/page.tsx
  • kits/youtube-creator-copilot/apps/next-env.d.ts
  • kits/youtube-creator-copilot/apps/next.config.mjs
  • kits/youtube-creator-copilot/apps/package.json
  • kits/youtube-creator-copilot/apps/postcss.config.js
  • kits/youtube-creator-copilot/apps/tailwind.config.ts
  • kits/youtube-creator-copilot/apps/tsconfig.json
  • kits/youtube-creator-copilot/apps/tsconfig.tsbuildinfo
  • kits/youtube-creator-copilot/constitutions/default.md
  • kits/youtube-creator-copilot/flows/agentic-youtube-creator.ts
  • kits/youtube-creator-copilot/flows/webrevive-orchestrator.ts
  • kits/youtube-creator-copilot/lamatic.config.ts
  • kits/youtube-creator-copilot/prompts/agentic-youtube-creator_llm-node_system.md
  • kits/youtube-creator-copilot/prompts/webrevive-orchestrator_system.md

Comment thread kits/youtube-creator-copilot/agent.md Outdated
Comment thread kits/website-optimiser/apps/actions/orchestrate.ts
Comment thread kits/youtube-creator-copilot/apps/actions/orchestrate.ts Outdated
Comment thread kits/youtube-creator-copilot/apps/app/globals.css Outdated
Comment thread kits/youtube-creator-copilot/apps/app/globals.css Outdated
Comment thread kits/youtube-creator-copilot/apps/package.json Outdated
Comment thread kits/youtube-creator-copilot/apps/tsconfig.tsbuildinfo Outdated
Comment thread kits/youtube-creator-copilot/lamatic.config.ts Outdated
Comment thread kits/youtube-creator-copilot/prompts/agentic-youtube-creator_llm-node_system.md Outdated
Comment thread kits/youtube-creator-copilot/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 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/website-optimiser/apps/actions/orchestrate.ts`:
- Around line 149-340: Refactor normalizeReport by adding reusable safeNumber,
safeArray, safeString, and safeBool helpers, then replace the repeated inline
type and fallback checks throughout the normalized report with those helpers.
Preserve each field’s current defaults, including the USD fallback for
proposal.estimatedCost.currency and the existing mapped handling for
competitors, faqItems, timeline, and priorityFixes.
- Around line 400-405: Expand the completeness condition in the fallback logic
after normalizeReport to also require competitors, conversionAudit,
redesignSuggestions, copywriting, coldEmail, and linkedinOutreach on parsedObj.
Preserve the existing parseFailed, data, and currently validated section checks
so any missing required section triggers Raw Output Mode before normalized
defaults can mask the omission.

In `@kits/website-optimiser/apps/app/globals.css`:
- Line 1: Update the Stylelint disable comment at the top of globals.css to
remove the invalid scss/at-rule-no-unknown reference and use only the valid
at-rule-no-unknown rule.

In `@kits/website-optimiser/apps/app/page.tsx`:
- Line 132: Remove the explicit id props from the form controls associated with
FormControl in the page component, including the control using id="website-url".
Let FormControl inject the field id so FormLabel htmlFor correctly targets the
rendered control.

In `@kits/website-optimiser/apps/package.json`:
- Line 26: Update the tailwind-merge dependency in package.json to a v3 release
compatible with Tailwind CSS v4, preserving the existing dependency declaration
format so the cn helper in apps/lib/utils.ts uses the compatible twMerge
implementation.

In `@kits/website-optimiser/constitutions/default.md`:
- Around line 1-6: Replace the YouTube-focused rules in the Constitution with
WebRevive website-audit and cold-outreach guidance: require SEO and performance
claims to be grounded in provided PageSpeed data, prohibit fabricated contact
information, and require cold emails to cite real website observations. Remove
the viewer-retention, CTR, video-title, and script-outline guidance while
preserving the encouraging, professional tone where applicable.
🪄 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: ca64f5b6-1ec1-492c-80a1-8a617ab6982d

📥 Commits

Reviewing files that changed from the base of the PR and between 68cf6aa and c859db5.

⛔ Files ignored due to path filters (1)
  • kits/website-optimiser/apps/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (26)
  • kits/website-optimiser/.env.example
  • kits/website-optimiser/.gitignore
  • kits/website-optimiser/README.md
  • kits/website-optimiser/agent.md
  • kits/website-optimiser/apps/.env.example
  • kits/website-optimiser/apps/.vscode/settings.json
  • kits/website-optimiser/apps/actions/orchestrate.ts
  • kits/website-optimiser/apps/actions/pagespeed.ts
  • kits/website-optimiser/apps/app/globals.css
  • kits/website-optimiser/apps/app/layout.tsx
  • kits/website-optimiser/apps/app/page.tsx
  • kits/website-optimiser/apps/components/ui/button.tsx
  • kits/website-optimiser/apps/components/ui/form.tsx
  • kits/website-optimiser/apps/components/ui/input.tsx
  • kits/website-optimiser/apps/components/ui/label.tsx
  • kits/website-optimiser/apps/components/ui/select.tsx
  • kits/website-optimiser/apps/lib/utils.ts
  • kits/website-optimiser/apps/next-env.d.ts
  • kits/website-optimiser/apps/next.config.mjs
  • kits/website-optimiser/apps/package.json
  • kits/website-optimiser/apps/postcss.config.js
  • kits/website-optimiser/apps/tsconfig.json
  • kits/website-optimiser/constitutions/default.md
  • kits/website-optimiser/flows/webrevive-orchestrator.ts
  • kits/website-optimiser/lamatic.config.ts
  • kits/website-optimiser/prompts/webrevive-orchestrator_system.md

Comment on lines +149 to +340
score: typeof data.conversionAudit?.score === "number" ? data.conversionAudit.score : 0,
leadForms: {
present: !!data.conversionAudit?.leadForms?.present,
quality: data.conversionAudit?.leadForms?.quality || "",
},
trustSignals: {
present: !!data.conversionAudit?.trustSignals?.present,
detail: data.conversionAudit?.trustSignals?.detail || "",
},
socialProof: {
present: !!data.conversionAudit?.socialProof?.present,
detail: data.conversionAudit?.socialProof?.detail || "",
},
ctaEffectiveness: data.conversionAudit?.ctaEffectiveness || "",
recommendations: Array.isArray(data.conversionAudit?.recommendations) ? data.conversionAudit.recommendations : [],
},
redesignSuggestions: {
heroSection: data.redesignSuggestions?.heroSection || "",
colorPalette: {
primary: data.redesignSuggestions?.colorPalette?.primary || "",
secondary: data.redesignSuggestions?.colorPalette?.secondary || "",
accent: data.redesignSuggestions?.colorPalette?.accent || "",
rationale: data.redesignSuggestions?.colorPalette?.rationale || "",
},
typography: {
heading: data.redesignSuggestions?.typography?.heading || "",
body: data.redesignSuggestions?.typography?.body || "",
rationale: data.redesignSuggestions?.typography?.rationale || "",
},
navigationRedesign: data.redesignSuggestions?.navigationRedesign || "",
sectionOrder: Array.isArray(data.redesignSuggestions?.sectionOrder) ? data.redesignSuggestions.sectionOrder : [],
animationIdeas: Array.isArray(data.redesignSuggestions?.animationIdeas) ? data.redesignSuggestions.animationIdeas : [],
premiumFeatures: Array.isArray(data.redesignSuggestions?.premiumFeatures) ? data.redesignSuggestions.premiumFeatures : [],
mobileFirstImprovements: Array.isArray(data.redesignSuggestions?.mobileFirstImprovements) ? data.redesignSuggestions.mobileFirstImprovements : [],
imagePrompt: data.redesignSuggestions?.imagePrompt || "",
},
copywriting: {
headline: data.copywriting?.headline || "",
subheadline: data.copywriting?.subheadline || "",
primaryCTA: data.copywriting?.primaryCTA || "",
secondaryCTA: data.copywriting?.secondaryCTA || "",
aboutSection: data.copywriting?.aboutSection || "",
valueProps: Array.isArray(data.copywriting?.valueProps) ? data.copywriting.valueProps : [],
faqItems: Array.isArray(data.copywriting?.faqItems) ? data.copywriting.faqItems.map((f: any) => ({
q: f?.q || "",
a: f?.a || "",
})) : [],
footerTagline: data.copywriting?.footerTagline || "",
},
coldEmail: {
subject: data.coldEmail?.subject || "",
body: data.coldEmail?.body || "",
followUp3Days: {
subject: data.coldEmail?.followUp3Days?.subject || "",
body: data.coldEmail?.followUp3Days?.body || "",
},
followUp7Days: {
subject: data.coldEmail?.followUp7Days?.subject || "",
body: data.coldEmail?.followUp7Days?.body || "",
},
},
linkedinOutreach: {
connectionRequest: data.linkedinOutreach?.connectionRequest || "",
firstMessage: data.linkedinOutreach?.firstMessage || "",
followUpMessage: data.linkedinOutreach?.followUpMessage || "",
shortPitch: data.linkedinOutreach?.shortPitch || "",
},
proposal: {
executiveSummary: data.proposal?.executiveSummary || "",
problemsFound: Array.isArray(data.proposal?.problemsFound) ? data.proposal.problemsFound : [],
proposedSolutions: Array.isArray(data.proposal?.proposedSolutions) ? data.proposal.proposedSolutions : [],
projectGoals: Array.isArray(data.proposal?.projectGoals) ? data.proposal.projectGoals : [],
timeline: Array.isArray(data.proposal?.timeline) ? data.proposal.timeline.map((t: any) => ({
phase: t?.phase || "",
duration: t?.duration || "",
deliverables: Array.isArray(t?.deliverables) ? t.deliverables : [],
})) : [],
estimatedCost: {
min: typeof data.proposal?.estimatedCost?.min === "number" ? data.proposal.estimatedCost.min : 0,
max: typeof data.proposal?.estimatedCost?.max === "number" ? data.proposal.estimatedCost.max : 0,
currency: data.proposal?.estimatedCost?.currency || "USD",
notes: data.proposal?.estimatedCost?.notes || "",
},
maintenancePlan: data.proposal?.maintenancePlan || "",
whyUs: data.proposal?.whyUs || "",
callToAction: data.proposal?.callToAction || "",
},
finalReport: {
overallScore: typeof data.finalReport?.overallScore === "number" ? data.finalReport.overallScore : 0,
priorityFixes: Array.isArray(data.finalReport?.priorityFixes) ? data.finalReport.priorityFixes.map((pf: any) => ({
rank: typeof pf?.rank === "number" ? pf.rank : 0,
title: pf?.title || "",
urgency: pf?.urgency || "",
estimatedImpact: pf?.estimatedImpact || "",
})) : [],
estimatedBusinessImpact: data.finalReport?.estimatedBusinessImpact || "",
executiveOneLiner: data.finalReport?.executiveOneLiner || "",
},
};
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

This normalizer is doing 190 lines of the same three moves, agent — extract the gadget.

Every field repeats one of three patterns: typeof x === "number" ? x : 0, Array.isArray(x) ? x : [], x || ""/!!x. Small safeNumber/safeArray/safeString/safeBool helpers would collapse this to a fraction of the size and remove an entire class of copy-paste drift risk for the next section someone adds.

♻️ Sketch of helper-based approach
const num = (v: unknown, fallback = 0) => (typeof v === "number" ? v : fallback);
const arr = <T,>(v: unknown, fallback: T[] = []) => (Array.isArray(v) ? (v as T[]) : fallback);
const str = (v: unknown, fallback = "") => (v || fallback) as string;
const bool = (v: unknown) => !!v;

// usage:
score: num(data.seoAudit?.score),
issues: arr(data.seoAudit?.issues),
🤖 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/website-optimiser/apps/actions/orchestrate.ts` around lines 149 - 340,
Refactor normalizeReport by adding reusable safeNumber, safeArray, safeString,
and safeBool helpers, then replace the repeated inline type and fallback checks
throughout the normalized report with those helpers. Preserve each field’s
current defaults, including the USD fallback for proposal.estimatedCost.currency
and the existing mapped handling for competitors, faqItems, timeline, and
priorityFixes.

Comment on lines +400 to +405
if (!parseFailed && parsedObj) {
data = normalizeReport(parsedObj);
}

// Fallback: If parse fails or structure is incomplete, package the raw response as a report so the user can verify connection
if (parseFailed || !data || !parsedObj.websiteAnalysis || !parsedObj.seoAudit || !parsedObj.performance || !parsedObj.uiuxReview || !parsedObj.proposal || !parsedObj.finalReport) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

The safety net has holes — six sections can go missing undetected.

The completeness check only verifies websiteAnalysis, seoAudit, performance, uiuxReview, proposal, and finalReport. If the LLM omits competitors, conversionAudit, redesignSuggestions, copywriting, coldEmail, or linkedinOutreach entirely, normalizeReport silently fills them with empty defaults instead of tripping the "Raw Output Mode" fallback — so the dashboard would render a seemingly-successful report with a blank cold email and blank proposal, which is the core value of this tool.

🛠️ Proposed fix
-    if (parseFailed || !data || !parsedObj.websiteAnalysis || !parsedObj.seoAudit || !parsedObj.performance || !parsedObj.uiuxReview || !parsedObj.proposal || !parsedObj.finalReport) {
+    if (
+      parseFailed ||
+      !data ||
+      !parsedObj.websiteAnalysis ||
+      !parsedObj.seoAudit ||
+      !parsedObj.performance ||
+      !parsedObj.uiuxReview ||
+      !parsedObj.competitors ||
+      !parsedObj.conversionAudit ||
+      !parsedObj.redesignSuggestions ||
+      !parsedObj.copywriting ||
+      !parsedObj.coldEmail ||
+      !parsedObj.linkedinOutreach ||
+      !parsedObj.proposal ||
+      !parsedObj.finalReport
+    ) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!parseFailed && parsedObj) {
data = normalizeReport(parsedObj);
}
// Fallback: If parse fails or structure is incomplete, package the raw response as a report so the user can verify connection
if (parseFailed || !data || !parsedObj.websiteAnalysis || !parsedObj.seoAudit || !parsedObj.performance || !parsedObj.uiuxReview || !parsedObj.proposal || !parsedObj.finalReport) {
if (!parseFailed && parsedObj) {
data = normalizeReport(parsedObj);
}
// Fallback: If parse fails or structure is incomplete, package the raw response as a report so the user can verify connection
if (
parseFailed ||
!data ||
!parsedObj.websiteAnalysis ||
!parsedObj.seoAudit ||
!parsedObj.performance ||
!parsedObj.uiuxReview ||
!parsedObj.competitors ||
!parsedObj.conversionAudit ||
!parsedObj.redesignSuggestions ||
!parsedObj.copywriting ||
!parsedObj.coldEmail ||
!parsedObj.linkedinOutreach ||
!parsedObj.proposal ||
!parsedObj.finalReport
) {
🤖 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/website-optimiser/apps/actions/orchestrate.ts` around lines 400 - 405,
Expand the completeness condition in the fallback logic after normalizeReport to
also require competitors, conversionAudit, redesignSuggestions, copywriting,
coldEmail, and linkedinOutreach on parsedObj. Preserve the existing parseFailed,
data, and currently validated section checks so any missing required section
triggers Raw Output Mode before normalized defaults can mask the omission.

@@ -0,0 +1,558 @@
/* stylelint-disable at-rule-no-unknown scss/at-rule-no-unknown */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix invalid stylelint rule reference in disable comment.

The scss/at-rule-no-unknown rule does not exist in Stylelint 17.x — the correct rule is at-rule-no-unknown. The static analysis confirms this error. While VS Code CSS validation is disabled, this still causes issues if Stylelint is run via CLI or CI.

🔧 Proposed fix
-/* stylelint-disable at-rule-no-unknown scss/at-rule-no-unknown */
+/* stylelint-disable at-rule-no-unknown */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* stylelint-disable at-rule-no-unknown scss/at-rule-no-unknown */
/* stylelint-disable at-rule-no-unknown */
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 1-1: Unknown rule scss/at-rule-no-unknown. Did you mean at-rule-no-unknown?

(scss/at-rule-no-unknown)

🤖 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/website-optimiser/apps/app/globals.css` at line 1, Update the Stylelint
disable comment at the top of globals.css to remove the invalid
scss/at-rule-no-unknown reference and use only the valid at-rule-no-unknown
rule.

Source: Linters/SAST tools

<FormLabel className="text-xs font-semibold text-zinc-400 uppercase tracking-wider">Website URL *</FormLabel>
<FormControl>
<Input
id="website-url"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether any tests or other code reference these explicit IDs before removing them.
rg -n "website-url\|business-name\|target-service" kits/website-optimiser --type ts --type tsx -g '!**/node_modules/**' -g '!**/.next/**'

Repository: Lamatic/AgentKit

Length of output: 182


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the page component around the flagged lines.
sed -n '110,230p' kits/website-optimiser/apps/app/page.tsx

# Find the form primitives used by FormControl/FormLabel.
fd -a 'form.tsx' kits/website-optimiser
fd -a 'form.*' kits/website-optimiser | sed -n '1,20p'

# Search for the explicit IDs with valid ripgrep flags.
rg -n -S "website-url|business-name|industry|target-service" kits/website-optimiser/apps/app -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx'

# Map the form component definitions before reading them.
ast-grep outline kits/website-optimiser -p 'export const FormControl = $_' --lang typescript
ast-grep outline kits/website-optimiser -p 'export const FormLabel = $_' --lang typescript

Repository: Lamatic/AgentKit

Length of output: 9206


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,240p' kits/website-optimiser/apps/components/ui/form.tsx

Repository: Lamatic/AgentKit

Length of output: 3915


🌐 Web query:

@radix-ui/react-slot prop precedence child props override slot props id merge semantics

💡 Result:

The @radix-ui/react-slot component is designed to merge props from the Slot component onto its immediate child element while ensuring both sets of props are respected [1]. Its merging logic is governed by a mergeProps function that follows specific precedence and composition rules [2][3][4]. Prop Merge Semantics: 1. Event Handlers (on*): If an event handler is present on both the Slot and the child, the Slot composes them into a single function where the child's handler is executed first, followed by the Slot's handler [2][3][4]. If the handler exists only on the Slot, that handler is used [2][4]. 2. Style Prop: The style objects from both the Slot and the child are shallowly merged, with child styles taking precedence in the event of a conflict (i.e., {...slotStyle,...childStyle }) [2][4]. 3. ClassName Prop: The className strings from both the Slot and the child are combined into a single string separated by a space [2][4]. 4. Other Props (including id): For general props (such as id), the child's props take precedence [3]. When the Slot merges these onto the child, the child's attributes effectively override any conflicting attributes defined on the Slot [3][4]. Regarding id specifically, because child props take precedence, if you provide an id prop on the child element (e.g., <Button asChild><button id="my-id" /></Button>), it will override any id generated or passed by the Radix component [3]. Users often encounter hydration issues if they rely on auto-generated IDs while manually setting IDs in specific environments like lists or dynamic tables; in such cases, explicitly defining unique IDs on the child element is the recommended practice to ensure consistency [5]. Recent updates have introduced more flexibility, allowing developers to customize this mergeProps behavior for individual Slots or globally via Slot.Provider for more advanced control over how conflicts are resolved [6].

Citations:


Mission directive: remove the explicit id props here. FormControl already injects the field id, and these child ids win in Slot, so FormLabel’s htmlFor no longer points at the rendered control.

🤖 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/website-optimiser/apps/app/page.tsx` at line 132, Remove the explicit id
props from the form controls associated with FormControl in the page component,
including the control using id="website-url". Let FormControl inject the field
id so FormLabel htmlFor correctly targets the rendered control.

"react-hook-form": "^7.60.0",
"react-markdown": "^9.0.0",
"tailwind-merge": "^2.5.5",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check tailwind-merge latest version and Tailwind v4 support
npm view tailwind-merge versions --json | jq '.[-10:]'
npm view tailwind-merge@3 peerDependencies

Repository: Lamatic/AgentKit

Length of output: 1984


🌐 Web query:

tailwind-merge v3 Tailwind CSS v4 support official documentation changelog peerDependencies

💡 Result:

Tailwind-merge v3 is the official version required to support Tailwind CSS v4 [1][2]. Key details regarding this support include: - Version Compatibility: Tailwind-merge v3 was released specifically to add support for Tailwind CSS v4 and drop support for Tailwind CSS v3 [1][2]. Users intending to stay on Tailwind CSS v3 should continue using tailwind-merge v2.6.0 [3][4]. - Peer Dependencies: Tailwind-merge does not list Tailwind CSS as a peer dependency in its package.json [5]. The maintainer has explicitly noted that because the library does not import from Tailwind CSS, including it as a peer dependency is not strictly necessary and could cause issues in certain development environments where multiple or non-standard Tailwind versions are utilized [5]. - Documentation and Changelog: Official support updates are tracked in the tailwind-merge repository's README and changelogs [3][6][5]. You can verify the specific Tailwind CSS versions supported by any release of tailwind-merge by checking the README of that specific version's tag [5]. As of May 2026, tailwind-merge supports Tailwind CSS v4.0 through v4.3 [3][4][7]. - Migration: The v3.0.0 release includes breaking changes specifically related to Tailwind CSS v4 support, including shifts in theme scales and class syntax expectations [1]. A detailed migration guide from v2 to v3 is available in the official repository [1][2].

Citations:


Upgrade tailwind-merge to v3 for Tailwind CSS v4.
tailwindcss is pinned to v4.1.9, but tailwind-merge v2.x targets Tailwind v3. The cn helper in apps/lib/utils.ts relies on twMerge, so this can leave conflicting v4 utilities unresolved and cause styling mismatches across components.

🤖 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/website-optimiser/apps/package.json` at line 26, Update the
tailwind-merge dependency in package.json to a v3 release compatible with
Tailwind CSS v4, preserving the existing dependency declaration format so the cn
helper in apps/lib/utils.ts uses the compatible twMerge implementation.

Comment on lines +1 to +6
# Constitution

1. Always prioritize viewer retention and high-CTR principles in advice.
2. Avoid generic, boring video titles. Aim for curiosity gaps.
3. Keep script outlines concise and action-oriented.
4. Ensure tone is encouraging, professional, and creative.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Agent, this constitution belongs to a different mission file.

Your target is website-optimiser — a website-audit/cold-outreach kit — yet this dossier briefs the agent on YouTube retention, CTR, and video-title curiosity gaps. Looks like a cross-kit copy/paste (possibly leaked from a YouTube-focused kit in this same PR stack). These guardrails don't apply to WebRevive's SEO/performance/outreach domain at all.

Replace with rules actually relevant to WebRevive (e.g., "always ground SEO/performance claims in the provided PageSpeed data," "never fabricate contact info," "cold email must cite a real observation").

🤖 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/website-optimiser/constitutions/default.md` around lines 1 - 6, Replace
the YouTube-focused rules in the Constitution with WebRevive website-audit and
cold-outreach guidance: require SEO and performance claims to be grounded in
provided PageSpeed data, prohibit fabricated contact information, and require
cold emails to cite real website observations. Remove the viewer-retention, CTR,
video-title, and script-outline guidance while preserving the encouraging,
professional tone where applicable.

Source: Learnings

@github-actions

Copy link
Copy Markdown
Contributor

Hi @RohitIndurke! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants