Skip to content

feat: Add vehicle-service-advisor kit - #325

Open
saivarun1410 wants to merge 6 commits into
Lamatic:mainfrom
saivarun1410:agent/vehicle-service-advisor
Open

feat: Add vehicle-service-advisor kit#325
saivarun1410 wants to merge 6 commits into
Lamatic:mainfrom
saivarun1410:agent/vehicle-service-advisor

Conversation

@saivarun1410

@saivarun1410 saivarun1410 commented Aug 5, 2026

Copy link
Copy Markdown

What changed

Adds a complete Vehicle Service Advisor kit under kits/vehicle-service-advisor/:

  • safety-first Lamatic flow with externalized prompts, constitution, and model config
  • structured urgency, possible-cause, inspection-plan, and mechanic-handoff output
  • responsive Next.js interface with server-side Lamatic SDK integration
  • Zod validation at both request and response boundaries
  • sample-report preview for product walkthroughs without credentials
  • setup, architecture, safety, limitations, and troubleshooting documentation
  • Vercel-compatible Next.js tracing configuration

Live demo

https://agent-kit-smoky.vercel.app

Why

Vehicle owners often describe warning lights, noises, smells, and drivability issues imprecisely. This kit turns those observations into a focused pre-inspection brief while explicitly avoiding false diagnostic certainty and unsafe repair advice.

The deployment follow-up removes a custom outputFileTracingRoot override that caused Vercel's Next.js monorepo packager to resolve the application as a nonexistent top-level /apps directory.

User impact

Owners get clear urgency guidance and a better workshop handoff. Technicians receive a concise, evidence-based symptom summary instead of an unstructured description.

Validation

  • npm run lint
  • npm run typecheck
  • npm run build
  • Vercel production prebuild and deployment
  • production route returned HTTP 200
  • automated production-browser assessment using a Toyota Corolla with a flashing check-engine light
  • rendered Stop driving and Do not drive with no browser runtime errors
  • repository required-file and reference-path audit

Notes

The Lamatic provider credential, project API key, and deployed flow ID are intentionally excluded. Import the flow into Studio, select a provider credential, deploy it, and populate apps/.env.local from the provided example.

  • Added the Vehicle Service Advisor kit under kits/vehicle-service-advisor/.
  • Added setup and operational documentation in README.md and agent.md.
  • Added environment templates and ignore rules for Lamatic credentials, flow configuration, and build artifacts.
  • Added a safety-first vehicle triage constitution with hazard escalation, prohibited advice, uncertainty handling, privacy rules, and strict JSON output requirements.
  • Added externalized prompts for:
    • System-level safety rules and structured report generation.
    • User vehicle observations and metadata.
  • Added an Anthropic Claude Haiku 4.5 model configuration for LLMNode 201.
  • Added Lamatic kit configuration with metadata, tags, deployment links, and the required VEHICLE_SERVICE_ADVISOR_FLOW_ID.
  • Added the vehicle service advisor flow with:
    • A vehicle-observation trigger node.
    • An LLM assessment node.
    • An API response node that returns the generated report.
    • Edges that connect input, assessment, and response execution.
  • The flow converts vehicle symptoms into a focused pre-inspection brief. It provides urgency guidance, possible causes, inspection steps, owner actions, clarifying questions, mechanic handoff details, confidence, and limitations. It avoids definitive diagnoses and unsafe repair advice.
  • Added the Next.js application with:
    • Responsive assessment form.
    • Loading, error, report, and empty states.
    • Credential-free sample-report preview.
    • Structured assessment report rendering.
    • Server-side Lamatic SDK integration.
    • Zod request and response validation.
    • Safe error logging and user-facing error handling.
  • Added shared assessment types, validation schemas, and the typed SAMPLE_REPORT fixture.
  • Added reusable UI utilities and a CVA-based Button component.
  • Added Next.js, TypeScript, ESLint, Tailwind, PostCSS, and shadcn/ui configuration.
  • Added Vercel-compatible tracing and deployment configuration.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 627b4b5a-689f-4e8a-b791-9586eaa100b2

📥 Commits

Reviewing files that changed from the base of the PR and between f5d0968 and 45ca2a1.

📒 Files selected for processing (7)
  • kits/vehicle-service-advisor/.env.example
  • kits/vehicle-service-advisor/.gitignore
  • kits/vehicle-service-advisor/apps/.env.example
  • kits/vehicle-service-advisor/apps/.gitignore
  • kits/vehicle-service-advisor/apps/components/ui/button.tsx
  • kits/vehicle-service-advisor/apps/features/assessment/components/assessment-report.tsx
  • kits/vehicle-service-advisor/apps/package.json

Walkthrough

Changes

Vehicle Service Advisor

Layer / File(s) Summary
Flow contract and safety behavior
kits/vehicle-service-advisor/constitutions/default.md, flows/vehicle-service-advisor.ts, prompts/*, model-configs/*, agent.md
Defines safety rules, structured JSON output, model configuration, vehicle inputs, assessment nodes, and flow edges.
Validated server assessment
apps/features/assessment/types/*, apps/features/assessment/validation/*, apps/lib/*, apps/actions/orchestrate.ts
Validates inputs and flow reports, executes the configured Lamatic flow, maps responses, and returns structured failures.
Assessment interface and report display
apps/app/*, apps/features/assessment/components/*, apps/features/assessment/hooks/*, apps/components/ui/button.tsx
Collects vehicle details, manages assessment state, renders reports or sample data, and applies responsive styling.
Kit setup and documentation
README.md, apps/README.md, lamatic.config.ts, apps/package.json, apps/*.json, apps/*.mjs, .env.example, .gitignore
Adds setup instructions, kit metadata, environment templates, package configuration, build configuration, and ignore rules.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and validation but omits the repository's required PR checklist sections and confirmations. Add the required PR checklist and mark each applicable item, including contribution type, file structure, secrets, workflows, comments, and scope.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding the Vehicle Service Advisor kit.
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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/vehicle-service-advisor

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.

@saivarun1410
saivarun1410 marked this pull request as ready for review August 6, 2026 05:10
@coderabbitai
coderabbitai Bot requested review from amanintech and d-pamneja August 6, 2026 05:10

@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: 5

🤖 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/vehicle-service-advisor/apps/features/assessment/components/assessment-form.tsx`:
- Around line 118-120: Update the “Preview sample report” button in the
assessment form to set its disabled state from isLoading, preventing
onShowSample while the assessment submission is pending; preserve the existing
button label and click behavior when loading is false.

In
`@kits/vehicle-service-advisor/apps/features/assessment/hooks/use-assessment.ts`:
- Around line 21-28: Update the assessment submission flow around assessVehicle
so setIsLoading(false) executes in a finally block even when the server action
rejects. Preserve the existing success handling, report assignment, and error
fallback for resolved unsuccessful results, while ensuring rejected requests
also surface through the existing error state as appropriate.

In
`@kits/vehicle-service-advisor/apps/features/assessment/types/sample-report.ts`:
- Around line 4-48: Update the sample report’s stopDriving field to true and
revise the safetyMessage, ownerActions, and inspectionPlan guidance to prohibit
continued driving and recommend towing or immediate professional inspection.
Keep the overheating evidence and diagnostic details unchanged while ensuring
the preview consistently communicates a no-drive response.

In `@kits/vehicle-service-advisor/apps/package.json`:
- Around line 12-17: Update the app package configuration around the
dependencies block to declare the required UI stack: Tailwind CSS v4 tooling,
react-hook-form, lucide-react, shadcn/ui components, and next.config.mjs, while
preserving the existing Next.js, React, Zod, and lamatic dependencies. Add the
corresponding missing configuration files, or reference the repository-level
source that provides them.

In
`@kits/vehicle-service-advisor/prompts/vehicle-service-advisor_llmnode-201_system_0.md`:
- Around line 11-17: Update the JSON response schema in the system prompt to
define stop_driving as urgency-dependent: require true when urgency is stop_now
and false for urgent, soon, or monitor. Keep the existing response shape and
valid urgency values unchanged.
🪄 Autofix

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 Plus

Run ID: d48701d6-9451-446f-a7e3-b61743118e0f

📥 Commits

Reviewing files that changed from the base of the PR and between adcfa70 and 667bd48.

⛔ Files ignored due to path filters (1)
  • kits/vehicle-service-advisor/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (30)
  • kits/vehicle-service-advisor/.env.example
  • kits/vehicle-service-advisor/.gitignore
  • kits/vehicle-service-advisor/README.md
  • kits/vehicle-service-advisor/agent.md
  • kits/vehicle-service-advisor/apps/.env.example
  • kits/vehicle-service-advisor/apps/.gitignore
  • kits/vehicle-service-advisor/apps/README.md
  • kits/vehicle-service-advisor/apps/actions/orchestrate.ts
  • kits/vehicle-service-advisor/apps/app/globals.css
  • kits/vehicle-service-advisor/apps/app/layout.tsx
  • kits/vehicle-service-advisor/apps/app/page.tsx
  • kits/vehicle-service-advisor/apps/eslint.config.mjs
  • kits/vehicle-service-advisor/apps/features/assessment/components/assessment-form.tsx
  • kits/vehicle-service-advisor/apps/features/assessment/components/assessment-report.tsx
  • kits/vehicle-service-advisor/apps/features/assessment/hooks/use-assessment.ts
  • kits/vehicle-service-advisor/apps/features/assessment/types/assessment.ts
  • kits/vehicle-service-advisor/apps/features/assessment/types/sample-report.ts
  • kits/vehicle-service-advisor/apps/features/assessment/validation/assessment-schema.ts
  • kits/vehicle-service-advisor/apps/lib/lamatic-client.ts
  • kits/vehicle-service-advisor/apps/lib/server-logger.ts
  • kits/vehicle-service-advisor/apps/next-env.d.ts
  • kits/vehicle-service-advisor/apps/next.config.ts
  • kits/vehicle-service-advisor/apps/package.json
  • kits/vehicle-service-advisor/apps/tsconfig.json
  • kits/vehicle-service-advisor/constitutions/default.md
  • kits/vehicle-service-advisor/flows/vehicle-service-advisor.ts
  • kits/vehicle-service-advisor/lamatic.config.ts
  • kits/vehicle-service-advisor/model-configs/vehicle-service-advisor_llmnode-201_generative-model-name.ts
  • kits/vehicle-service-advisor/prompts/vehicle-service-advisor_llmnode-201_system_0.md
  • kits/vehicle-service-advisor/prompts/vehicle-service-advisor_llmnode-201_user_1.md

Comment thread kits/vehicle-service-advisor/apps/features/assessment/hooks/use-assessment.ts Outdated
Comment thread kits/vehicle-service-advisor/apps/package.json
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hi @saivarun1410! 👋

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! 🙏

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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/vehicle-service-advisor/.gitignore`:
- Around line 4-5: Update the .gitignore environment-file patterns to ignore all
.env variants using .env*, then explicitly re-include only .env.example so
template configuration remains trackable.

In `@kits/vehicle-service-advisor/apps/.env.example`:
- Around line 1-4: Reorder the environment variable entries alphabetically in
both kits/vehicle-service-advisor/apps/.env.example lines 1-4 and
kits/vehicle-service-advisor/.env.example lines 1-4, preserving all existing
keys and empty values.

In `@kits/vehicle-service-advisor/apps/.gitignore`:
- Around line 3-4: Update the environment-file rules in the app .gitignore to
ignore all .env* variants, including Next.js development and production files,
while explicitly re-including .env.example so the template remains trackable.

In `@kits/vehicle-service-advisor/apps/components/ui/button.tsx`:
- Around line 32-48: Update the public Button component to use the app’s
established React 19-compatible ref-forwarding approach, such as
React.forwardRef or the exported useForwardRef utility. Explicitly accept and
pass the ref to the rendered component, ensuring native button refs work when
asChild is false while preserving Slot behavior when asChild is true.

In
`@kits/vehicle-service-advisor/apps/features/assessment/components/assessment-report.tsx`:
- Around line 93-95: Replace the native button in the assessment report with the
shared Button component imported from "`@/components/ui/button`". Preserve the
onClear handler, button type, label, and className="secondary-button", and set
variant="outline".

In `@kits/vehicle-service-advisor/apps/package.json`:
- Line 10: Make clean-checkout typechecking deterministic: in
kits/vehicle-service-advisor/apps/package.json at line 10, update the typecheck
script to run Next.js type generation before tsc; in
kits/vehicle-service-advisor/apps/.gitignore at line 6, add next-env.d.ts; and
remove the tracked generated file
kits/vehicle-service-advisor/apps/next-env.d.ts.
🪄 Autofix

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 Plus

Run ID: 504a08c5-1dda-4944-a169-2085cd124eb2

📥 Commits

Reviewing files that changed from the base of the PR and between e0d0f8c and f5d0968.

⛔ Files ignored due to path filters (1)
  • kits/vehicle-service-advisor/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (34)
  • kits/vehicle-service-advisor/.env.example
  • kits/vehicle-service-advisor/.gitignore
  • kits/vehicle-service-advisor/README.md
  • kits/vehicle-service-advisor/agent.md
  • kits/vehicle-service-advisor/apps/.env.example
  • kits/vehicle-service-advisor/apps/.gitignore
  • kits/vehicle-service-advisor/apps/README.md
  • kits/vehicle-service-advisor/apps/actions/orchestrate.ts
  • kits/vehicle-service-advisor/apps/app/globals.css
  • kits/vehicle-service-advisor/apps/app/layout.tsx
  • kits/vehicle-service-advisor/apps/app/page.tsx
  • kits/vehicle-service-advisor/apps/components.json
  • kits/vehicle-service-advisor/apps/components/ui/button.tsx
  • kits/vehicle-service-advisor/apps/eslint.config.mjs
  • kits/vehicle-service-advisor/apps/features/assessment/components/assessment-form.tsx
  • kits/vehicle-service-advisor/apps/features/assessment/components/assessment-report.tsx
  • kits/vehicle-service-advisor/apps/features/assessment/hooks/use-assessment.ts
  • kits/vehicle-service-advisor/apps/features/assessment/types/assessment.ts
  • kits/vehicle-service-advisor/apps/features/assessment/types/sample-report.ts
  • kits/vehicle-service-advisor/apps/features/assessment/validation/assessment-schema.ts
  • kits/vehicle-service-advisor/apps/lib/lamatic-client.ts
  • kits/vehicle-service-advisor/apps/lib/server-logger.ts
  • kits/vehicle-service-advisor/apps/lib/utils.ts
  • kits/vehicle-service-advisor/apps/next-env.d.ts
  • kits/vehicle-service-advisor/apps/next.config.mjs
  • kits/vehicle-service-advisor/apps/package.json
  • kits/vehicle-service-advisor/apps/postcss.config.mjs
  • kits/vehicle-service-advisor/apps/tsconfig.json
  • kits/vehicle-service-advisor/constitutions/default.md
  • kits/vehicle-service-advisor/flows/vehicle-service-advisor.ts
  • kits/vehicle-service-advisor/lamatic.config.ts
  • kits/vehicle-service-advisor/model-configs/vehicle-service-advisor_llmnode-201_generative-model-name.ts
  • kits/vehicle-service-advisor/prompts/vehicle-service-advisor_llmnode-201_system_0.md
  • kits/vehicle-service-advisor/prompts/vehicle-service-advisor_llmnode-201_user_1.md

Comment thread kits/vehicle-service-advisor/.gitignore Outdated
Comment thread kits/vehicle-service-advisor/apps/.env.example Outdated
Comment thread kits/vehicle-service-advisor/apps/.gitignore Outdated
Comment thread kits/vehicle-service-advisor/apps/components/ui/button.tsx Outdated
Comment thread kits/vehicle-service-advisor/apps/package.json Outdated
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.

1 participant