Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kits/agentic/deep-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"input-otp": "1.4.1",
"lamatic": "^0.3.2",
"lucide-react": "^0.454.0",
"next": "15.2.4",
"next": "15.2.8",
"next-themes": "^0.4.6",
"react": "^18.3.1",
"react-day-picker": "9.8.0",
Expand Down
4 changes: 2 additions & 2 deletions kits/agentic/generation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"input-otp": "1.4.1",
"lamatic": "latest",
"lucide-react": "^0.454.0",
"next": "16.0.0",
"next": "16.0.10",
"next-themes": "^0.4.6",
"react": "19.2.0",
"react-day-picker": "9.8.0",
Expand All @@ -77,4 +77,4 @@
"tw-animate-css": "1.3.3",
"typescript": "^5"
}
}
}
3,910 changes: 3,909 additions & 1 deletion kits/agentic/generation/pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions kits/agentic/resumeFit/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RESUME_FIT_FLOW="AGENTIC_GENERATE_CONTENT Flow ID"
LAMATIC_API_URL="LAMATIC_API_URL"
LAMATIC_PROJECT_ID="LAMATIC_PROJECT_ID"
LAMATIC_API_KEY="LAMATIC_API_KEY"
28 changes: 28 additions & 0 deletions kits/agentic/resumeFit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# next.js
/.next/
/out/

# production
/build

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files
.env*
!.env.example

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
106 changes: 106 additions & 0 deletions kits/agentic/resumeFit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Agent Kit Generation by Lamatic.ai

<p align="center">
<a href="https://agent-kit-generation.vercel.app" target="_blank">
<img src="https://img.shields.io/badge/Live%20Demo-black?style=for-the-badge" alt="Live Demo" />
</a>
</p>


**Agent Kit Generation** is an AI-powered content generation system built with [Lamatic.ai](https://lamatic.ai). It uses intelligent workflows to generate text, images, and JSON content through a modern Next.js interface with markdown rendering support.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Lamatic/AgentKit&root-directory=kits/agentic/generation&env=AGENTIC_GENERATE_CONTENT,LAMATIC_API_URL,LAMATIC_PROJECT_ID,LAMATIC_API_KEY&envDescription=Your%20Lamatic%20Generation%20keys%20are%20required.&envLink=https://lamatic.ai/templates/agentkits/agentic/agent-kit-generation)
Comment on lines +1 to +12
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.

⚠️ Potential issue | 🟠 Major

Agent, your cover story doesn't match your mission β€” this is a template from another operation!

This README describes "Agent Kit Generation" but you're deploying "Resume Fit". The deploy button on line 12 points to kits/agentic/generation instead of kits/agentic/resumeFit. The live demo link references the wrong application. This documentation will mislead operatives attempting to deploy.

Update all references:

  • Title: "Agent Kit Generation" β†’ "Resume Fit Agent"
  • Deploy URL root-directory: kits/agentic/generation β†’ kits/agentic/resumeFit
  • Live demo link: Update to the correct resumeFit preview URL
  • Line 24: "Generation" agent kit β†’ "Resume Fit" agent kit
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/README.md` around lines 1 - 12, The README currently
references the wrong kit (Agent Kit Generation) and wrong deploy/demo links;
update the title text to "Resume Fit Agent", change the live demo anchor href to
the correct resumeFit preview URL, update the Deploy with Vercel button's
root-directory query param from kits/agentic/generation to
kits/agentic/resumeFit, and replace the "Generation" kit mentions (e.g., the
phrase on line 24) with "Resume Fit" so all displayed labels and URLs
consistently point to the Resume Fit agent.


---

## Lamatic Setup (Pre and Post)

Before running this project, you must build and deploy the flow in Lamatic, then wire its config into this codebase.

Pre: Build in Lamatic
1. Sign in or sign up at https://lamatic.ai
2. Create a project (if you don’t have one yet)
3. Click β€œ+ New Flow” and select "Templates"
4. Select the 'Generation' agent kit
5. Configure providers/tools/inputs as prompted
6. Deploy the kit in Lamatic and obtain your .env keys
7. Copy the keys from your studio

Post: Wire into this repo
1. Create a .env file and set the keys
2. Install and run locally:
- npm install
- npm run dev
3. Deploy (Vercel recommended):
- Import your repo, set the project's Root Directory (if applicable)
- Add env vars in Vercel (same as your .env)
- Deploy and test your live URL

Notes
- Coming soon: single-click export and "Connect Git" in Lamatic to push config directly to your repo.

---

## πŸ”‘ Setup
## Required Keys and Config
Comment on lines +44 to +45
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.

⚠️ Potential issue | 🟑 Minor

Minor formatting issues flagged by static analysis.

Lines 44-45 need blank lines around headings. Line 74 needs a blank line after the fenced code block. Line 79's code block should specify a language (e.g., plaintext or text).

Also applies to: 74-75, 79-79

🧰 Tools
πŸͺ› markdownlint-cli2 (0.22.0)

[warning] 44-44: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 45-45: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/README.md` around lines 44 - 45, Add proper blank
lines around the headings "## πŸ”‘ Setup" and "## Required Keys and Config"
(ensure a blank line before and after each heading), insert a blank line
immediately after the fenced code block near line 74 so the next content is
separated, and update the standalone fenced code block at line 79 to include a
language specifier (e.g., ```plaintext or ```text) to satisfy the linter's
requirement.


You’ll need these things to run this project locally:

1. **.env Keys** β†’ get it from your [Lamatic account](https://lamatic.ai) post kit deployment.


| Item | Purpose | Where to Get It |
| ----------------- | -------------------------------------------- | ----------------------------------------------- |
| .env Key | Authentication for Lamatic AI APIs and Orchestration | [lamatic.ai](https://lamatic.ai) |

### 1. Environment Variables

Create `.env.local` with:

```bash
# Lamatic
AGENTIC_GENERATE_CONTENT = "AGENTIC_GENERATE_CONTENT Flow ID"
LAMATIC_API_URL = "LAMATIC_API_URL"
LAMATIC_PROJECT_ID = "LAMATIC_PROJECT_ID"
LAMATIC_API_KEY = "LAMATIC_API_KEY"
```
Comment on lines +60 to +66
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.

⚠️ Potential issue | 🟠 Major

Environment variable mismatch between documentation and configuration.

The README documents AGENTIC_GENERATE_CONTENT as the flow ID variable, but config.json specifies envKey: "RESUME_FIT_FLOW". These must align for successful mission execution.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/README.md` around lines 60 - 66, The README documents
AGENTIC_GENERATE_CONTENT but config.json uses envKey "RESUME_FIT_FLOW", causing
a mismatch; fix by making the env var name consistent across both places β€”
either update README to document RESUME_FIT_FLOW or change config.json envKey to
"AGENTIC_GENERATE_CONTENT" (and update any code that reads
process.env.RESUME_FIT_FLOW or process.env.AGENTIC_GENERATE_CONTENT
accordingly), then verify all references (e.g., in the resumeFit flow
initialization and any deployment scripts) use the chosen symbol consistently.


### 2. Install & Run

```bash
npm install
npm run dev
# Open http://localhost:3000
```
---

## πŸ“‚ Repo Structure

```
/actions
└── orchestrate.ts # Lamatic workflow orchestration
/app
└── page.tsx # Main generation form UI
/components
β”œβ”€β”€ header.tsx # Header component with navigation
└── ui # shadcn/ui components
/lib
└── lamatic-client.ts # Lamatic SDK client
/public
└── lamatic-logo.png # Lamatic branding
/flows
└── ... # Lamatic Flows
/package.json # Dependencies & scripts
```

---

## 🀝 Contributing

We welcome contributions! Open an issue or PR in this repo.

---

## πŸ“œ License

MIT License – see [LICENSE](../../../LICENSE).
12 changes: 12 additions & 0 deletions kits/agentic/resumeFit/actions/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const config = {
flows: {
resumeFit: {
name: "Resume Fit Flow",
workflowId: process.env.AGENTIC_GENERATE_CONTENT,
inputSchema: {
instructions: "string",
mode: "string"
}
}
}
}
Comment on lines +1 to +12
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.

🧹 Nitpick | πŸ”΅ Trivial

Agent, your config needs alignment with mission naming conventions.

Two observations:

  1. Environment variable naming: AGENTIC_GENERATE_CONTENT is generic and doesn't align with the flow name resumeFit. Consider RESUME_FIT_FLOW or RESUME_FIT_WORKFLOW_ID for clarity. (This ties to the mismatch flagged in .env.example.)

  2. Input schema format: The inputSchema uses plain string literals ("string") rather than a proper schema definition (e.g., Zod schema or JSON Schema). If this is consumed by validation logic, ensure the downstream code handles this format.

♻️ Suggested naming alignment
 export const config = {
   flows: {
     resumeFit: {
       name: "Resume Fit Flow",
-      workflowId: process.env.AGENTIC_GENERATE_CONTENT,
+      workflowId: process.env.RESUME_FIT_FLOW,
       inputSchema: {
         instructions: "string",
         mode: "string"
       }
     }
   }
 }

As per coding guidelines: "Kit server action files must call Lamatic flows via the SDK and read flow IDs from environment variables."

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/actions/config.ts` around lines 1 - 12, The config
object (config.flows.resumeFit) uses a poorly named env var and an invalid
inputSchema format: rename the workflowId env var from AGENTIC_GENERATE_CONTENT
to a descriptive name like RESUME_FIT_FLOW or RESUME_FIT_WORKFLOW_ID and update
.env/.env.example accordingly, and replace the string-literal inputSchema with a
proper schema object consumed by your validation layer (e.g., a Zod schema or a
JSON Schema) so flows.resumeFit.inputSchema is a real schema the SDK/validation
logic can use; ensure the code that calls the Lamatic flow reads
process.env.RESUME_FIT_FLOW (or chosen name) and that the new schema shape
matches the downstream validator.

128 changes: 128 additions & 0 deletions kits/agentic/resumeFit/actions/orchestrate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
"use server"

import { lamaticClient } from "../lib/lamatic-client"
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.

πŸ› οΈ Refactor suggestion | 🟠 Major

Agent, we have an unused asset in the field.

The lamaticClient is imported but never deployed in this operation. Per our intelligence briefings, kit server actions must call Lamatic flows via the SDK. Your current approach uses raw fetch instead.

This message will self-destruct if you choose to accept this refactor:

πŸ”§ Proposed mission parameters
-import { lamaticClient } from "../lib/lamatic-client"
+// If SDK is required per guidelines, use lamaticClient here
+// Otherwise, remove this unused import

Based on learnings: "Kit server action files (e.g., actions/orchestrate.ts) must call Lamatic flows via the SDK and read flow IDs from environment variables"

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/actions/orchestrate.ts` at line 3, The file imports
lamaticClient but still uses raw fetch to start flows; replace the fetch call in
the orchestrate function with a call to the Lamatic SDK using lamaticClient
(e.g., lamaticClient.runFlow / invokeFlow or the SDK method your project
exposes), read the target flow ID from an environment variable (e.g.,
process.env.RESUME_FIT_FLOW_ID) and pass the same payload/inputs, then handle
the SDK response and errors the same way you previously handled fetch results;
update any tests or callers to expect the SDK response shape.

import { config } from "./config"

type InputType = "text" | "image" | "json"

export async function evaluateResume(
inputType: InputType,
instructions: string,
): Promise<{
success: boolean
data?: any
error?: string
}> {
try {
console.log("[v0] Generating content with:", { inputType, instructions })

// Get the first workflow from the config
const flows = config.flows
const firstFlowKey = Object.keys(flows)[0]

if (!firstFlowKey) {
throw new Error("No workflows found in configuration")
}

// Fix: Add index signature to make TypeScript happy about accessing flows[firstFlowKey]
const flow = flows[firstFlowKey as keyof typeof flows] as (typeof flows)[keyof typeof flows];
console.log("[v0] Using workflow:", flow.name, flow.workflowId);

// Prepare inputs based on the flow's input schema
const inputs: Record<string, any> = {
mode: inputType,
instructions,
}

// Map to schema if needed
for (const inputKey of Object.keys(flow.inputSchema || {})) {
if (inputKey === "inputType" || inputKey === "type") {
inputs[inputKey] = inputType
} else if (inputKey === "instructions" || inputKey === "query") {
inputs[inputKey] = instructions
}
}

console.log("[v0] Sending inputs:", inputs)

if(!flow.workflowId){
throw Error("Workflow not found in config.")
}
const res = await fetch(process.env.LAMATIC_API_URL!, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
"x-project-id": process.env.LAMATIC_PROJECT_ID!,
},
Comment on lines +51 to +57
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.

⚠️ Potential issue | 🟠 Major

Critical intel gap detected, agent.

You're accessing environment variables with non-null assertions (!) without prior validation. If these variables are missing, your mission will crash at runtime with cryptic errors.

πŸ›‘οΈ Secure the perimeter
+  const apiUrl = process.env.LAMATIC_API_URL
+  const apiKey = process.env.LAMATIC_API_KEY
+  const projectId = process.env.LAMATIC_PROJECT_ID
+
+  if (!apiUrl || !apiKey || !projectId) {
+    throw new Error("Missing required environment variables: LAMATIC_API_URL, LAMATIC_API_KEY, or LAMATIC_PROJECT_ID")
+  }
+
-const res = await fetch(process.env.LAMATIC_API_URL!, {
+const res = await fetch(apiUrl, {
   method: "POST",
   headers: {
     "Content-Type": "application/json",
-    "Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
-    "x-project-id": process.env.LAMATIC_PROJECT_ID!,
+    "Authorization": `Bearer ${apiKey}`,
+    "x-project-id": projectId,
   },
πŸ“ 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
const res = await fetch(process.env.LAMATIC_API_URL!, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
"x-project-id": process.env.LAMATIC_PROJECT_ID!,
},
const apiUrl = process.env.LAMATIC_API_URL
const apiKey = process.env.LAMATIC_API_KEY
const projectId = process.env.LAMATIC_PROJECT_ID
if (!apiUrl || !apiKey || !projectId) {
throw new Error("Missing required environment variables: LAMATIC_API_URL, LAMATIC_API_KEY, or LAMATIC_PROJECT_ID")
}
const res = await fetch(apiUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`,
"x-project-id": projectId,
},
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/actions/orchestrate.ts` around lines 51 - 57, The
fetch call in orchestrate.ts uses non-null assertions on
process.env.LAMATIC_API_URL!, LAMATIC_API_KEY and LAMATIC_PROJECT_ID without
validation; replace those inline assertions by first reading and validating each
env var into constants (e.g., lamaticUrl, lamaticKey, lamaticProjectId) and if
any is missing throw or return a clear, descriptive error before calling fetch
(or use a helper like ensureEnvVar). Update the block around the fetch call (the
res = await fetch(...) usage) to use the validated constants so runtime crashes
are avoided and error messages explicitly name which env var is absent.

body: JSON.stringify({
query: `
query ExecuteWorkflow($workflowId: String!, $payload: JSON!) {
executeWorkflow(workflowId: $workflowId, payload: $payload) {
status
result
}
}
`,
variables: {
workflowId: flow.workflowId,
payload: {
chatMessage: instructions, // πŸ‘ˆ map your input here
mode: inputType, // optional depending on your flow
},
},
}),
})

console.log("STATUS:", res.status)
console.log("CONTENT TYPE:", res.headers.get("content-type"))

const resData = await res.json()
console.log("FULL RESPONSE:", JSON.stringify(resData, null, 2))
Comment on lines +77 to +81
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.

🧹 Nitpick | πŸ”΅ Trivial

Agent, your communications are compromised.

These console.log statements expose operational details (status codes, full response payloads) in production. Consider using a proper logging framework with appropriate log levels, or remove these debug statements before deployment.

πŸ•΅οΈ Stealth mode recommended
-console.log("STATUS:", res.status)
-console.log("CONTENT TYPE:", res.headers.get("content-type"))
-
-  const resData = await res.json()
-console.log("FULL RESPONSE:", JSON.stringify(resData, null, 2))
+  const resData = await res.json()
+  // Consider structured logging for production observability
πŸ“ 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
console.log("STATUS:", res.status)
console.log("CONTENT TYPE:", res.headers.get("content-type"))
const resData = await res.json()
console.log("FULL RESPONSE:", JSON.stringify(resData, null, 2))
const resData = await res.json()
// Consider structured logging for production observability
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/actions/orchestrate.ts` around lines 77 - 81, Remove
the three debug console.log statements that print res.status,
res.headers.get("content-type"), and the entire JSON payload in orchestrate.ts;
instead either delete them or replace with calls to the project's structured
logger at an appropriate debug level (e.g., logger.debug) and ensure any logged
response body is redacted or limited (avoid JSON.stringify of full resData) so
no sensitive operational data is emitted in production; update the code paths
that reference res.status/res.headers/get/res.json to use the logger (or no-op)
accordingly.

Comment on lines +80 to +81
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.

⚠️ Potential issue | 🟑 Minor

Mission abort condition not handled, agent.

The fetch response status is logged but not validated. A non-2xx response will still proceed to res.json(), potentially causing parsing failures or masking server errors.

🎯 Tactical improvement
+if (!res.ok) {
+  throw new Error(`API request failed with status ${res.status}`)
+}
+
 const resData = await res.json()
-console.log("FULL RESPONSE:", JSON.stringify(resData, null, 2))
πŸ“ 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
const resData = await res.json()
console.log("FULL RESPONSE:", JSON.stringify(resData, null, 2))
if (!res.ok) {
throw new Error(`API request failed with status ${res.status}`)
}
const resData = await res.json()
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/agentic/resumeFit/actions/orchestrate.ts` around lines 80 - 81, The code
calls res.json() unconditionally and logs the parsed body, which will fail or
hide errors for non-2xx responses; update the fetch handling in orchestrate.ts
to check res.ok (or res.status) before calling res.json(), and on non-ok
responses log the status, statusText and response text (or throw an error)
instead of proceeding to use resData β€” specifically adjust the block that
references res, res.json() and resData to validate the response and either
return/throw early or handle the error path cleanly.


// Parse the answer from resData?.output.answer

const exec = resData?.data?.executeWorkflow

if (!exec) {
throw new Error("Invalid response structure")
}

if (exec.status !== "success") {
throw new Error("Workflow execution failed")
}

// βœ… FIX: extract content instead of answer
const answer =
exec?.result?.content ||
exec?.result?.answer || // fallback if structure changes
exec?.result

if (!answer) {
throw new Error("No answer found in response")
}

return {
success: true,
data: answer,
}
} catch (error) {
console.error("[v0] Generation error:", error)

let errorMessage = "Unknown error occurred"
if (error instanceof Error) {
errorMessage = error.message
if (error.message.includes("fetch failed")) {
errorMessage =
"Network error: Unable to connect to the service. Please check your internet connection and try again."
} else if (error.message.includes("API key")) {
errorMessage = "Authentication error: Please check your API configuration."
}
}

return {
success: false,
error: errorMessage,
}
}
}
Loading