Skip to content

feat: Add offer-negotiator kit#181

Open
Asquarer02 wants to merge 4 commits into
Lamatic:mainfrom
Asquarer02:feat/offer-negotiator
Open

feat: Add offer-negotiator kit#181
Asquarer02 wants to merge 4 commits into
Lamatic:mainfrom
Asquarer02:feat/offer-negotiator

Conversation

@Asquarer02

@Asquarer02 Asquarer02 commented Jul 6, 2026

Copy link
Copy Markdown

Offer Negotiator — Offer & Salary Negotiation Copilot

A new kit that owns the offer stage of the job hunt — the one stage none of the existing kits cover. Paste your offer and priorities and get an assessment, the leverage you actually hold, target numbers, talking points, a ready-to-send counter-offer email, and a call script.

What's inside

  • One Lamatic flow (API Request → Generate Text (LLM) → Code parse → API Response), returning a structured answer object. All resources externalized as @references.
  • A runnable Next.js app — an offer form → a sectioned "negotiation brief" with copy-to-clipboard for the counter-offer email and call script.
  • agent.md, README.md, constitutions/default.md.

Guardrails

Reasons from the numbers you provide plus general principles; never presents a market-salary figure as fact (estimates are flagged as assumptions); never advises dishonesty; not legal/financial advice.

Scope

Touches only kits/offer-negotiator/**.

Submitted for the AgentKit Challenge.

  • Added kits/offer-negotiator/.env.example

  • Added kits/offer-negotiator/.gitignore

  • Added kits/offer-negotiator/README.md

  • Added kits/offer-negotiator/agent.md

  • Added kits/offer-negotiator/constitutions/default.md (safety/grounding/guardrails for negotiation advice)

  • Added kits/offer-negotiator/lamatic.config.ts (kit registration + step keyed by OFFER_NEGOTIATOR)

  • Added kits/offer-negotiator/flows/offer-negotiator.ts (Offer Negotiator flow definition)

  • Added kits/offer-negotiator/model-configs/offer-negotiator-flow_llmnode-516_generative-model-name.ts (LLM model config: gpt-4o-mini)

  • Added kits/offer-negotiator/prompts/offer-negotiator-flow_llmnode-516_system_0.md (system prompt + required JSON output + guardrails)

  • Added kits/offer-negotiator/prompts/offer-negotiator-flow_llmnode-516_user_1.md (user prompt template for offer/comp inputs)

  • Added runnable Next.js app under kits/offer-negotiator/apps/**:

    • Added kits/offer-negotiator/apps/.env.example
    • Added kits/offer-negotiator/apps/.gitignore
    • Added kits/offer-negotiator/apps/actions/orchestrate.ts (server action to run the Lamatic offerNegotiator flow and return the structured result)
    • Added kits/offer-negotiator/apps/orchestrate.js (Lamatic flow wiring: workflow id process.env.OFFER_NEGOTIATOR + input schema)
    • Added kits/offer-negotiator/apps/package.json, kits/offer-negotiator/apps/package-lock.json
    • Added kits/offer-negotiator/apps/next.config.js, kits/offer-negotiator/apps/tsconfig.json, kits/offer-negotiator/apps/next-env.d.ts, kits/offer-negotiator/apps/postcss.config.js
    • Added UI/pages:
      • Added kits/offer-negotiator/apps/app/layout.tsx
      • Added kits/offer-negotiator/apps/app/page.tsx (offer form → negotiation brief view)
      • Added kits/offer-negotiator/apps/app/globals.css
      • Added kits/offer-negotiator/apps/components/offer-form.tsx (form + Zod validation via react-hook-form)
      • Added kits/offer-negotiator/apps/components/negotiation-brief.tsx (sectioned brief + copy-to-clipboard for counter email/call script)
      • Added kits/offer-negotiator/apps/components/ui/button.tsx, form.tsx, input.tsx, label.tsx, textarea.tsx (shared UI primitives)
    • Added supporting code:
      • Added kits/offer-negotiator/apps/lib/lamatic-client.ts (env-validated Lamatic client init)
      • Added kits/offer-negotiator/apps/lib/types.ts (OfferInput + NegotiationResult types and emptyOffer)
      • Added kits/offer-negotiator/apps/lib/utils.ts (cn utility with clsx + tailwind-merge)

Flow summary (kits/offer-negotiator/flows/offer-negotiator.ts)

  • Uses these node types:
    • triggerNode (“API Request”, provides advance_schema for the offer input fields)
    • dynamicNode “Generate Text” (LLM node) driven by the referenced system/user prompt markdown and the generative model config
    • dynamicNode “Code” (code parsing step; referenced script output is used as the final answer)
    • responseNode (“API Response”) that maps the code node output into the response shape as { answer: "{{codeNode_533.output}}" }
  • Edge wiring:
    • Trigger → LLM node → Code node → Response node
    • Response node also includes a responseEdge back to the trigger for completion
  • High-level behavior:
    • Collects user-provided offer/comp details (strings like base/bonus/equity, priorities, constraints)
    • Prompts the LLM to produce a strict negotiation JSON (with assumptions/risks/guardrails)
    • Runs a code step to parse/validate that JSON and return it under the answer field.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 60617d85-20ce-452b-afdf-9f38cf0f613a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Introduces a new offer-negotiator kit with a Lamatic flow, prompts, model and kit configuration, a Next.js app for submitting offers and viewing negotiation briefs, plus documentation and environment/setup templates.

Changes

Offer Negotiator Kit

Layer / File(s) Summary
Flow, prompts, model config, and kit config
kits/offer-negotiator/flows/offer-negotiator.ts, kits/offer-negotiator/prompts/*, kits/offer-negotiator/model-configs/*, kits/offer-negotiator/constitutions/default.md, kits/offer-negotiator/lamatic.config.ts
Defines the workflow graph, system/user prompts, model configuration, constitution, and kit-level Lamatic config for the offer-negotiator flow.
Types, Lamatic client, and server action
kits/offer-negotiator/apps/lib/types.ts, kits/offer-negotiator/apps/lib/lamatic-client.ts, kits/offer-negotiator/apps/lib/utils.ts, kits/offer-negotiator/apps/actions/orchestrate.ts, kits/offer-negotiator/apps/orchestrate.js
Adds OfferInput/NegotiationResult, initializes lamaticClient with env validation, adds a class merge helper, and implements the negotiateOffer server action with flow execution and error handling.
Offer form, negotiation brief, and page wiring
kits/offer-negotiator/apps/app/page.tsx, kits/offer-negotiator/apps/app/layout.tsx, kits/offer-negotiator/apps/components/*
Implements the offer form, negotiation brief display, shared UI primitives, and the client page that manages loading, error, and result state.
Styling and app configuration
kits/offer-negotiator/apps/app/globals.css, kits/offer-negotiator/apps/{next.config.js,tsconfig.json,postcss.config.js,package.json,.gitignore,.env.example,next-env.d.ts}
Adds global styling and the Next.js, TypeScript, PostCSS, package, and ignore/config files for the app.
Documentation, agent guide, and env templates
kits/offer-negotiator/README.md, kits/offer-negotiator/agent.md, kits/offer-negotiator/.env.example, kits/offer-negotiator/.gitignore
Adds kit documentation, agent guidance, setup instructions, failure modes, and environment/ignore templates.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the Offer Negotiator kit.
Description check ✅ Passed The description covers the kit purpose, flow, app, guardrails, scope, and key supporting files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 Jul 6, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/offer-negotiator

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.

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

Caution

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

⚠️ Outside diff range comments (1)
kits/offer-negotiator/apps/package.json (1)

1-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

File naming: guideline expects next.config.mjs.

Coding guidelines specify the kit app should have its own next.config.mjs; this app ships next.config.js instead. Functionally both work, but flagging for consistency with the stated contract.

As per coding guidelines, "the Next.js app must be located in the apps/ directory with its own package.json, next.config.mjs, tsconfig.json, and .env.example."

🤖 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/offer-negotiator/apps/package.json` around lines 1 - 32, The
offer-negotiator app is missing the required Next.js config file naming expected
by the kit contract. Add or rename the app’s Next.js config to use
next.config.mjs and make sure the app references that config consistently,
keeping the existing app setup in package.json unchanged. Verify the app still
builds and runs with the updated config file name so it matches the required
apps/ package layout alongside tsconfig.json and .env.example.

Source: Coding guidelines

🤖 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/offer-negotiator/apps/components/offer-form.tsx`:
- Around line 9-42: The required indicator in Field is only visual, so update
the actual form controls to expose requirement semantics by passing required
and/or aria-required to the input in Field and the priorities textarea. Use the
existing Field component and the priorities textarea rendering to thread the
required flag through so assistive technologies can announce mandatory fields
correctly.
- Around line 1-160: The OfferForm component is still using local useState and
manual canSubmit logic instead of the required form stack. Update OfferForm to
use react-hook-form with zod-based validation, keeping the existing field names
and using the form’s submit/validation state in place of manual checks. Replace
the hand-rolled inputs, textarea, button, and labels in OfferForm/Field with
shadcn/ui form primitives so the markup matches the project standards, and make
sure the kit is updated to Tailwind CSS v4+ as required by the app guidelines.

In `@kits/offer-negotiator/apps/package.json`:
- Line 16: The package manifest currently pins lamatic to "latest", which makes
installs non-reproducible. Update the dependency in package.json to a fixed,
explicit version (ideally the exact version already tested in this workspace) so
fresh installs resolve consistently and can be rolled back safely.
- Line 25: The offer-negotiator app is still wired for Tailwind v3, so update
the Tailwind setup to the v4 package/API. Adjust the dependency in package.json
to the v4 Tailwind release, then revise the app’s PostCSS and Tailwind config
files (postcss.config.js and tailwind.config.js) to match the v4 plugin/config
approach used elsewhere in the repo. Make sure the app bootstrap and any
Tailwind imports or directives in the app entry points still resolve correctly
after the config migration.

---

Outside diff comments:
In `@kits/offer-negotiator/apps/package.json`:
- Around line 1-32: The offer-negotiator app is missing the required Next.js
config file naming expected by the kit contract. Add or rename the app’s Next.js
config to use next.config.mjs and make sure the app references that config
consistently, keeping the existing app setup in package.json unchanged. Verify
the app still builds and runs with the updated config file name so it matches
the required apps/ package layout alongside tsconfig.json and .env.example.
🪄 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: 2847b997-4ba0-402d-8023-e64936e8482d

📥 Commits

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

⛔ Files ignored due to path filters (1)
  • kits/offer-negotiator/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (28)
  • kits/offer-negotiator/.env.example
  • kits/offer-negotiator/.gitignore
  • kits/offer-negotiator/README.md
  • kits/offer-negotiator/agent.md
  • kits/offer-negotiator/apps/.env.example
  • kits/offer-negotiator/apps/.gitignore
  • kits/offer-negotiator/apps/actions/orchestrate.ts
  • kits/offer-negotiator/apps/app/globals.css
  • kits/offer-negotiator/apps/app/layout.tsx
  • kits/offer-negotiator/apps/app/page.tsx
  • kits/offer-negotiator/apps/components/negotiation-brief.tsx
  • kits/offer-negotiator/apps/components/offer-form.tsx
  • kits/offer-negotiator/apps/lib/lamatic-client.ts
  • kits/offer-negotiator/apps/lib/types.ts
  • kits/offer-negotiator/apps/lib/utils.ts
  • kits/offer-negotiator/apps/next-env.d.ts
  • kits/offer-negotiator/apps/next.config.js
  • kits/offer-negotiator/apps/orchestrate.js
  • kits/offer-negotiator/apps/package.json
  • kits/offer-negotiator/apps/postcss.config.js
  • kits/offer-negotiator/apps/tailwind.config.js
  • kits/offer-negotiator/apps/tsconfig.json
  • kits/offer-negotiator/constitutions/default.md
  • kits/offer-negotiator/flows/offer-negotiator.ts
  • kits/offer-negotiator/lamatic.config.ts
  • kits/offer-negotiator/model-configs/offer-negotiator-flow_llmnode-516_generative-model-name.ts
  • kits/offer-negotiator/prompts/offer-negotiator-flow_llmnode-516_system_0.md
  • kits/offer-negotiator/prompts/offer-negotiator-flow_llmnode-516_user_1.md

Comment thread kits/offer-negotiator/apps/components/offer-form.tsx
Comment thread kits/offer-negotiator/apps/components/offer-form.tsx Outdated
Comment thread kits/offer-negotiator/apps/package.json Outdated
"next": "14.2.35",
"react": "^18",
"react-dom": "^18",
"lamatic": "latest",

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

Don't trust an unmarked package with "latest" clearance.

Pinning lamatic to "latest" means every fresh install can silently pull a different (possibly breaking) version — no reproducibility, no rollback safety.

🕵️ Proposed fix
-    "lamatic": "latest",
+    "lamatic": "^1.0.0",
📝 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
"lamatic": "latest",
"lamatic": "^1.0.0",
🤖 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/offer-negotiator/apps/package.json` at line 16, The package manifest
currently pins lamatic to "latest", which makes installs non-reproducible.
Update the dependency in package.json to a fixed, explicit version (ideally the
exact version already tested in this workspace) so fresh installs resolve
consistently and can be rolled back safely.

Comment thread kits/offer-negotiator/apps/package.json Outdated
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"tailwindcss": "^3.4.1",

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 | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## package.json\n'
cat -n kits/offer-negotiator/apps/package.json | sed -n '1,220p'

printf '\n## candidate tailwind/postcss files\n'
fd -a -t f 'tailwind.config.*|postcss.config.*|package.json|next.config.mjs|tsconfig.json|.env.example' kits/offer-negotiator/apps

printf '\n## kit guidance mentions\n'
rg -n "Tailwind|tailwindcss|postcss|shadcn|react-hook-form|zod|lucide-react|Next.js 14|Next.js 15|React 18|TypeScript" kits/offer-negotiator -g '!**/node_modules/**' -g '!**/.next/**'

Repository: Lamatic/AgentKit

Length of output: 6539


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## postcss.config.js\n'
cat -n kits/offer-negotiator/apps/postcss.config.js

printf '\n## tailwind.config.js\n'
cat -n kits/offer-negotiator/apps/tailwind.config.js

Repository: Lamatic/AgentKit

Length of output: 1361


Move this kit to Tailwind v4

kits/offer-negotiator/apps/package.json is still on tailwindcss@^3.4.1, and kits/offer-negotiator/apps/postcss.config.js / kits/offer-negotiator/apps/tailwind.config.js are set up for the v3 plugin API. This kit needs the v4 Tailwind setup required by the brief.

🤖 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/offer-negotiator/apps/package.json` at line 25, The offer-negotiator app
is still wired for Tailwind v3, so update the Tailwind setup to the v4
package/API. Adjust the dependency in package.json to the v4 Tailwind release,
then revise the app’s PostCSS and Tailwind config files (postcss.config.js and
tailwind.config.js) to match the v4 plugin/config approach used elsewhere in the
repo. Make sure the app bootstrap and any Tailwind imports or directives in the
app entry points still resolve correctly after the config migration.

Source: Coding guidelines

Address CodeRabbit review on PR Lamatic#181:
- Migrate Tailwind CSS v3 -> v4 (@import "tailwindcss", @tailwindcss/postcss
  plugin, drop the now-unused v3 JS config)
- Rebuild the offer form on react-hook-form + zod validation, replacing
  hand-rolled useState/canSubmit logic
- Add shadcn/ui primitives (form, input, textarea, label, button) styled to
  the existing design system
- Expose required/aria-required on mandatory fields for assistive tech
- Use lucide-react icons in the form and copy buttons
- Pin the lamatic dependency to ^0.3.2 instead of "latest"

@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.

Caution

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

⚠️ Outside diff range comments (1)
kits/offer-negotiator/apps/components/negotiation-brief.tsx (1)

8-31: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Mission accomplished on the copy button — one tripwire to consider.

aria-live="polite" is placed directly on the interactive <Button> whose own text content flips between "Copied" and label. Screen readers can be inconsistent announcing live-region changes on focusable/interactive elements versus a dedicated non-interactive live region (e.g., a visually-hidden <span aria-live="polite">). Given type="button" is explicitly set (good — this self-destructs any accidental form-submit risk), the only remaining loose end is announcement reliability across screen readers.

Consider moving the live announcement to a small visually-hidden status element beside the button rather than on the button itself, for more consistent AT behavior.

🤖 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/offer-negotiator/apps/components/negotiation-brief.tsx` around lines 8 -
31, The CopyButton component uses aria-live on the interactive Button itself,
which can lead to unreliable screen reader announcements when the label changes
to "Copied". Move the live announcement to a separate non-interactive status
element near CopyButton, such as a visually hidden span with aria-live="polite",
and keep the button focused only on the click action and visual label/icon
update.
🤖 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/offer-negotiator/apps/components/negotiation-brief.tsx`:
- Around line 8-31: The CopyButton component uses aria-live on the interactive
Button itself, which can lead to unreliable screen reader announcements when the
label changes to "Copied". Move the live announcement to a separate
non-interactive status element near CopyButton, such as a visually hidden span
with aria-live="polite", and keep the button focused only on the click action
and visual label/icon update.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0669384f-6294-4070-a9e6-60ef0c5e69c7

📥 Commits

Reviewing files that changed from the base of the PR and between a8796f1 and 8a9b78e.

⛔ Files ignored due to path filters (1)
  • kits/offer-negotiator/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • kits/offer-negotiator/apps/app/globals.css
  • kits/offer-negotiator/apps/app/page.tsx
  • kits/offer-negotiator/apps/components/negotiation-brief.tsx
  • kits/offer-negotiator/apps/components/offer-form.tsx
  • kits/offer-negotiator/apps/components/ui/button.tsx
  • kits/offer-negotiator/apps/components/ui/form.tsx
  • kits/offer-negotiator/apps/components/ui/input.tsx
  • kits/offer-negotiator/apps/components/ui/label.tsx
  • kits/offer-negotiator/apps/components/ui/textarea.tsx
  • kits/offer-negotiator/apps/package.json
  • kits/offer-negotiator/apps/postcss.config.js

Move aria-live off the interactive copy Button onto a separate sr-only
status element, so screen readers announce the "copied" change reliably.
Addresses the remaining CodeRabbit accessibility note on PR Lamatic#181.
@Asquarer02

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Asquarer02

Copy link
Copy Markdown
Author

fixed all coderabbit issues

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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