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
4 changes: 4 additions & 0 deletions kits/research-paper-analyzer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
LAMATIC_API_URL="https://your-project.lamatic.ai"
LAMATIC_PROJECT_ID="your-project-id"
LAMATIC_API_KEY="your-api-key"
Comment on lines +1 to +4

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 | ⚡ Quick win

Field report: Unnecessary quote characters detected in .env template.

Agent, your environment variable values are wrapped in quotes. Most .env parsers read these literally—meaning your actual runtime values will include the quote characters themselves. This can cause authentication failures or unexpected string matching issues.

Mission directive: Remove quotes for clean parsing.

🔧 Suggested correction
-RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
-LAMATIC_API_URL="https://your-project.lamatic.ai"
-LAMATIC_PROJECT_ID="your-project-id"
-LAMATIC_API_KEY="your-api-key"
+RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id
+LAMATIC_API_URL=https://your-project.lamatic.ai
+LAMATIC_PROJECT_ID=your-project-id
+LAMATIC_API_KEY=your-api-key
📝 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
RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
LAMATIC_API_URL="https://your-project.lamatic.ai"
LAMATIC_PROJECT_ID="your-project-id"
LAMATIC_API_KEY="your-api-key"
RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id
LAMATIC_API_URL=https://your-project.lamatic.ai
LAMATIC_PROJECT_ID=your-project-id
LAMATIC_API_KEY=your-api-key
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 1-1: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 2-2: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 2-2: [UnorderedKey] The LAMATIC_API_URL key should go before the RESEARCH_PAPER_ANALYZER_FLOW_ID key

(UnorderedKey)


[warning] 3-3: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 3-3: [UnorderedKey] The LAMATIC_PROJECT_ID key should go before the RESEARCH_PAPER_ANALYZER_FLOW_ID key

(UnorderedKey)


[warning] 4-4: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 4-4: [UnorderedKey] The LAMATIC_API_KEY key should go before the LAMATIC_API_URL key

(UnorderedKey)

🤖 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/research-paper-analyzer/.env.example` around lines 1 - 4, The .env
template wraps variable values in quotes which many parsers treat as literal
characters; remove the surrounding double quotes for
RESEARCH_PAPER_ANALYZER_FLOW_ID, LAMATIC_API_URL, LAMATIC_PROJECT_ID, and
LAMATIC_API_KEY so the lines read as bare values (e.g.,
RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id) to ensure the runtime values do
not include quote characters.

5 changes: 5 additions & 0 deletions kits/research-paper-analyzer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.env.local
apps/node_modules
apps/.next
apps/.vercel
127 changes: 127 additions & 0 deletions kits/research-paper-analyzer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Research Paper Analyzer

An AI-powered kit that takes any academic PDF URL and returns a structured breakdown:

- **Problem Statement** — what the research is trying to solve and why it matters
- **Methodology** — how the study was conducted
- **Key Findings** — the main results and conclusions
- **Limitations** — acknowledged weaknesses or gaps
- **Plain English Summary** — jargon-free explanation for non-specialists
- **Follow-up Questions** — ideas for future research directions

Built on [Lamatic.ai](https://lamatic.ai) with a **FastAPI** backend and a **React + Vite** frontend (JavaScript/JSX).

---

## Architecture

```
React (Vite/JSX) → FastAPI (Python) → Lamatic Flow → LLM
frontend backend orchestration
localhost:5173 localhost:8000
```

Comment on lines +18 to +23

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 | ⚡ Quick win

Mission brief: neutralize markdownlint blockers before merge.

At Line 18 and Line 52, fenced blocks are missing language tags (MD040). Around Line 52, Line 91, and Line 96, add blank lines around fenced blocks (MD031) to satisfy the validator.

Proposed patch
 ## Architecture
 
-```
+```text
 React (Vite/JSX)  →  FastAPI (Python)  →  Lamatic Flow  →  LLM
    frontend              backend            orchestration
  localhost:5173       localhost:8000

@@
.env values to fill in:
- + +env
RESEARCH_PAPER_ANALYZER_FLOW_ID=
LAMATIC_API_URL=
LAMATIC_PROJECT_ID=
LAMATIC_API_KEY=

@@
### `POST /analyze`

**Request:**
+
```json
{ "pdf_url": "https://arxiv.org/pdf/2303.08774.pdf" }

Response:
+

{
  "success": true,

Also applies to: 52-57, 91-93, 96-111

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 18-18: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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/research-paper-analyzer/README.md` around lines 18 - 23, Several fenced
code blocks in the README (e.g., the ASCII diagram starting "React (Vite/JSX)  →
FastAPI (Python)  →  Lamatic Flow  →  LLM", the `.env` block beginning with
RESEARCH_PAPER_ANALYZER_FLOW_ID, and the JSON examples used under "POST
/analyze") are missing language tags (MD040) and lack surrounding blank lines
(MD031); update each fenced block to include the appropriate language tag (e.g.,
```text, ```env, ```json) and ensure there is a blank line before and after
every fenced block so the validator passes, targeting the blocks that contain
the ASCII diagram, the `.env` variables, and the request/response JSON examples.

---

## Quick Start

### 1. Deploy the Flow in Lamatic Studio

1. Go to [studio.lamatic.ai](https://studio.lamatic.ai) → New Project → New Flow
2. Add nodes in this order:
- **API Trigger** — input schema: `{ pdf_url: string }`
- **Extract From File** — file URL: `{{trigger.pdf_url}}`
- **LLM Node** — use prompt from `prompts/analyze-paper.md`, structured JSON output
- **API Response** — output: `{{LLMNode.output}}`
Comment on lines +33 to +35
3. Deploy the flow and copy the **Flow ID** from Settings

### 2. Start the FastAPI Backend

```bash
cd apps/backend
cp .env.example .env
# Fill in your Flow ID and Lamatic credentials in .env
pip install -r requirements.txt
uvicorn main:app --reload
```

Backend runs at [http://localhost:8000](http://localhost:8000).
Check [http://localhost:8000/docs](http://localhost:8000/docs) for the auto-generated API docs.

`.env` values to fill in:
```
RESEARCH_PAPER_ANALYZER_FLOW_ID=<your-flow-id>
LAMATIC_API_URL=<from Lamatic Settings>
LAMATIC_PROJECT_ID=<from Lamatic Settings>
LAMATIC_API_KEY=<from Lamatic Settings>
```

### 3. Start the React Frontend

```bash
cd apps/frontend
npm install
npm run dev
```

Frontend runs at [http://localhost:5173](http://localhost:5173).
Vite proxies `/analyze` → FastAPI automatically, so no CORS issues in dev.

---

## Usage

1. Paste any publicly accessible PDF URL (e.g., an arXiv paper)
2. Click **Analyze Paper**
3. Browse the structured breakdown — expand/collapse each section
4. Click **JSON** to copy the raw JSON output

### Example URLs to try

- `https://arxiv.org/pdf/2303.08774.pdf` — GPT-4 Technical Report
- `https://arxiv.org/pdf/1706.03762.pdf` — Attention Is All You Need

---

## API Reference

### `POST /analyze`

**Request:**
```json
{ "pdf_url": "https://arxiv.org/pdf/2303.08774.pdf" }
```

**Response:**
```json
{
"success": true,
"data": {
"title": "...",
"authors": ["..."],
"year": 2023,
"problem_statement": "...",
"methodology": "...",
"key_findings": ["..."],
"limitations": ["..."],
"plain_english_summary": "...",
"follow_up_questions": ["..."]
}
}
```

---

## Tech Stack

- **Backend**: FastAPI, Python, httpx, Pydantic, python-dotenv
- **Frontend**: React.js, Vite, JavaScript/JSX, Tailwind CSS, Lucide React
- **AI Orchestration**: Lamatic.ai flows

---

## Requirements

- Python 3.10+
- Node.js 18+, npm 9+
- Lamatic.ai account ([sign up free](https://lamatic.ai))
44 changes: 44 additions & 0 deletions kits/research-paper-analyzer/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Research Paper Analyzer Agent

## Identity

You are an expert academic research analyst. Your role is to read scientific papers and produce clear, structured analyses that help researchers, students, and professionals quickly understand complex academic work.

## Capabilities

- Extract and articulate the core research problem and motivation
- Identify and explain the methodology used
- Summarize key findings and results objectively
- Surface limitations and potential gaps in the research
- Translate academic language into plain English for non-specialists
- Generate thoughtful follow-up research questions

## Behavior Guidelines

- Always base your analysis strictly on the paper content — do not hallucinate facts
- Be objective; do not editorialize beyond what the paper states
- If a section of the paper is unclear or missing, state that explicitly
- Keep the plain-English summary accessible to a smart non-expert
- Format all output as structured JSON matching the defined schema

## Output Schema

```json
{
"title": "string",
"authors": ["string"],
"year": "number | null",
"problem_statement": "string",
"methodology": "string",
"key_findings": ["string"],
"limitations": ["string"],
"plain_english_summary": "string",
"follow_up_questions": ["string"]
}
```

## Constraints

- Never invent citations, statistics, or claims not present in the paper
- Refuse requests to misrepresent or plagiarize research
- If the uploaded file is not an academic paper, respond with a clear error message
4 changes: 4 additions & 0 deletions kits/research-paper-analyzer/apps/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
LAMATIC_API_URL="https://your-project.lamatic.ai"
LAMATIC_PROJECT_ID="your-project-id"
LAMATIC_API_KEY="your-api-key"
Comment on lines +1 to +4

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 | ⚡ Quick win

Surveillance confirms: Identical quote character issue in apps/.env.example.

This template mirrors the same vulnerability as the root .env.example. Remove the quotes to ensure clean environment variable parsing and prevent authentication token corruption.

🔧 Suggested correction
-RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
-LAMATIC_API_URL="https://your-project.lamatic.ai"
-LAMATIC_PROJECT_ID="your-project-id"
-LAMATIC_API_KEY="your-api-key"
+RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id
+LAMATIC_API_URL=https://your-project.lamatic.ai
+LAMATIC_PROJECT_ID=your-project-id
+LAMATIC_API_KEY=your-api-key
📝 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
RESEARCH_PAPER_ANALYZER_FLOW_ID="your-flow-id"
LAMATIC_API_URL="https://your-project.lamatic.ai"
LAMATIC_PROJECT_ID="your-project-id"
LAMATIC_API_KEY="your-api-key"
RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id
LAMATIC_API_URL=https://your-project.lamatic.ai
LAMATIC_PROJECT_ID=your-project-id
LAMATIC_API_KEY=your-api-key
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 1-1: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 2-2: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 2-2: [UnorderedKey] The LAMATIC_API_URL key should go before the RESEARCH_PAPER_ANALYZER_FLOW_ID key

(UnorderedKey)


[warning] 3-3: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 3-3: [UnorderedKey] The LAMATIC_PROJECT_ID key should go before the RESEARCH_PAPER_ANALYZER_FLOW_ID key

(UnorderedKey)


[warning] 4-4: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 4-4: [UnorderedKey] The LAMATIC_API_KEY key should go before the LAMATIC_API_URL key

(UnorderedKey)

🤖 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/research-paper-analyzer/apps/.env.example` around lines 1 - 4, The env
template uses quoted values which can corrupt tokens; remove the surrounding
double-quotes from the variables RESEARCH_PAPER_ANALYZER_FLOW_ID,
LAMATIC_API_URL, LAMATIC_PROJECT_ID, and LAMATIC_API_KEY so each line is
VAR=value (e.g., RESEARCH_PAPER_ANALYZER_FLOW_ID=your-flow-id) to ensure clean
environment variable parsing and valid API keys.

35 changes: 35 additions & 0 deletions kits/research-paper-analyzer/apps/actions/analyze.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use server";

import { lamaticClient } from "@/lib/lamatic-client";

export interface PaperAnalysis {
title: string;
authors: string[];
year: number;
problem_statement: string;
methodology: string;
key_findings: string[];
limitations: string[];
plain_english_summary: string;
follow_up_questions: string[];
}

export async function analyzePaper(
pdfUrl: string
): Promise<{ success: boolean; data?: PaperAnalysis; error?: string }> {
try {
const flowId = process.env.RESEARCH_PAPER_ANALYZER_FLOW_ID;
if (!flowId) throw new Error("RESEARCH_PAPER_ANALYZER_FLOW_ID is not set.");
Comment on lines +17 to +22

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 | 🔴 Critical | ⚡ Quick win

Mission briefing: Critical security gap detected in parameter validation.

Agent, your function accepts a pdfUrl parameter from the client with zero validation. An adversary could transmit empty strings, malformed URLs, or potentially malicious payloads. Server actions must never trust client input.

Recommended defensive protocol:

🛡️ Suggested validation enhancement
 export async function analyzePaper(
   pdfUrl: string
 ): Promise<{ success: boolean; data?: PaperAnalysis; error?: string }> {
   try {
+    // Validate input
+    if (!pdfUrl || !pdfUrl.trim()) {
+      throw new Error("PDF URL is required.");
+    }
+    
+    // Validate URL format
+    try {
+      new URL(pdfUrl);
+    } catch {
+      throw new Error("Invalid PDF URL format.");
+    }
+
     const flowId = process.env.RESEARCH_PAPER_ANALYZER_FLOW_ID;
     if (!flowId) throw new Error("RESEARCH_PAPER_ANALYZER_FLOW_ID is not set.");
📝 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
export async function analyzePaper(
pdfUrl: string
): Promise<{ success: boolean; data?: PaperAnalysis; error?: string }> {
try {
const flowId = process.env.RESEARCH_PAPER_ANALYZER_FLOW_ID;
if (!flowId) throw new Error("RESEARCH_PAPER_ANALYZER_FLOW_ID is not set.");
export async function analyzePaper(
pdfUrl: string
): Promise<{ success: boolean; data?: PaperAnalysis; error?: string }> {
try {
// Validate input
if (!pdfUrl || !pdfUrl.trim()) {
throw new Error("PDF URL is required.");
}
// Validate URL format
try {
new URL(pdfUrl);
} catch {
throw new Error("Invalid PDF URL format.");
}
const flowId = process.env.RESEARCH_PAPER_ANALYZER_FLOW_ID;
if (!flowId) throw new Error("RESEARCH_PAPER_ANALYZER_FLOW_ID is not set.");
🤖 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/research-paper-analyzer/apps/actions/analyze.ts` around lines 17 - 22,
analyzePaper currently trusts the client-provided pdfUrl with no validation; add
defensive validation at the start of analyzePaper to ensure pdfUrl is a
non-empty string and a well-formed HTTP/HTTPS URL (use the URL constructor or a
strict regex to parse and verify protocol), reject or return { success: false,
error: "..."} for invalid inputs, and sanitize/normalize the URL before further
use; keep the existing flowId check and reference pdfUrl and analyzePaper when
adding this validation and error handling so malformed, empty, or non-http(s)
values are explicitly blocked.


const resData = await lamaticClient.executeFlow(flowId, { pdf_url: pdfUrl });
const result = resData?.result ?? resData?.output ?? resData;

if (!result) throw new Error("No result returned from the flow.");

return { success: true, data: result as PaperAnalysis };
Comment on lines +24 to +29

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 | ⚡ Quick win

Intelligence report: Type assertion without runtime validation detected.

Your mission uses an unchecked type cast at line 29 (as PaperAnalysis). If the Lamatic flow returns a different structure—missing fields, wrong types, or partial data—the type system won't protect you. The UI will encounter runtime failures when accessing non-existent properties.

Recommended validation protocol:

🔍 Suggested runtime validation
     const resData = await lamaticClient.executeFlow(flowId, { pdf_url: pdfUrl });
     const result = resData?.result ?? resData?.output ?? resData;

-    if (!result) throw new Error("No result returned from the flow.");
+    // Validate response structure
+    if (!result || typeof result !== "object") {
+      throw new Error("No valid result returned from the flow.");
+    }
+    
+    // Validate required fields
+    const required = ["title", "authors", "year", "problem_statement", "methodology", 
+                      "key_findings", "limitations", "plain_english_summary", "follow_up_questions"];
+    const missing = required.filter(field => !(field in result));
+    if (missing.length > 0) {
+      throw new Error(`Flow response missing required fields: ${missing.join(", ")}`);
+    }

-    return { success: true, data: result as PaperAnalysis };
+    return { success: true, data: result as PaperAnalysis };
📝 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 lamaticClient.executeFlow(flowId, { pdf_url: pdfUrl });
const result = resData?.result ?? resData?.output ?? resData;
if (!result) throw new Error("No result returned from the flow.");
return { success: true, data: result as PaperAnalysis };
const resData = await lamaticClient.executeFlow(flowId, { pdf_url: pdfUrl });
const result = resData?.result ?? resData?.output ?? resData;
// Validate response structure
if (!result || typeof result !== "object") {
throw new Error("No valid result returned from the flow.");
}
// Validate required fields
const required = ["title", "authors", "year", "problem_statement", "methodology",
"key_findings", "limitations", "plain_english_summary", "follow_up_questions"];
const missing = required.filter(field => !(field in result));
if (missing.length > 0) {
throw new Error(`Flow response missing required fields: ${missing.join(", ")}`);
}
return { success: true, data: result as PaperAnalysis };
🤖 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/research-paper-analyzer/apps/actions/analyze.ts` around lines 24 - 29,
The code blindly asserts result as PaperAnalysis after calling
lamaticClient.executeFlow; add runtime validation before the cast by
implementing and calling a type guard or schema validator (e.g.,
isPaperAnalysis(obj) or a Zod/Joi schema) that checks required fields and types
on result, throw a descriptive error if validation fails, and only then return {
success: true, data: result as PaperAnalysis }; reference the variables/methods
lamaticClient.executeFlow, flowId, pdfUrl and the PaperAnalysis type when
locating where to add the validation.

} catch (error) {
const message =
error instanceof Error ? error.message : "Unknown error occurred.";
return { success: false, error: message };
}
}
1 change: 1 addition & 0 deletions kits/research-paper-analyzer/apps/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'tailwindcss';

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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether other kits in this repo use explicit postcss.config.js with Tailwind v4

fd -t f '^postcss\.config\.(js|mjs)$' kits/ --exec echo "Found: {}"

Repository: Lamatic/AgentKit

Length of output: 915


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Check whether this specific kit has an explicit postcss config
fd -t f '^postcss\.config\.(js|mjs)$' kits/research-paper-analyzer --exec echo "Found in research-paper-analyzer: {}" || true

# 2) Find all occurrences of Tailwind v4 import style and show nearby context (and whether a postcss config exists per kit)
rg -n "`@import` 'tailwindcss';" kits --glob='*.css' --glob='*.pcss' | head -n 50

# 3) Locate package.json files for the research-paper-analyzer app and print dependency versions for next/tailwind/postcss (small extraction)
#    (Use jq if present; otherwise grep.)
find kits/research-paper-analyzer -maxdepth 4 -name package.json -print | head -n 20

# Try to extract relevant deps from any found package.json under the app
find kits/research-paper-analyzer -maxdepth 6 -name package.json -print0 | \
python3 - <<'PY'
import json,sys,os,glob
paths = [p for p in glob.glob('kits/research-paper-analyzer/**/package.json', recursive=True)]
for p in paths:
    try:
        with open(p,'r',encoding='utf-8') as f:
            data=json.load(f)
        deps={}
        for k in ['dependencies','devDependencies','peerDependencies']:
            deps.update(data.get(k,{}))
        keys=['next','tailwindcss','postcss']
        got={k:deps.get(k) for k in keys if k in deps}
        if got:
            print(p)
            for k,v in got.items():
                print(f"  {k}: {v}")
    except Exception as e:
        pass
PY

# 4) Inspect one representative PostCSS config from another kit to see wiring pattern
#    Pick hiring-copilot-agent since it was mentioned in the original comment's example area.
if [ -f kits/hiring-copilot-agent/apps/postcss.config.mjs ]; then
  echo "---- hiring-copilot-agent/apps/postcss.config.mjs ----"
  sed -n '1,120p' kits/hiring-copilot-agent/apps/postcss.config.mjs
fi

Repository: Lamatic/AgentKit

Length of output: 1193


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Does research-paper-analyzer define an explicit PostCSS config?
echo "== postcss.config.* under kits/research-paper-analyzer =="
fd -t f '^postcss\.config\.(js|mjs)$' kits/research-paper-analyzer --exec echo "Found: {}" || true

# 2) Show the tailwind/postcss/next parts of its package.json
echo
echo "== kits/research-paper-analyzer/apps/package.json (relevant deps) =="
cat kits/research-paper-analyzer/apps/package.json | rg -n '"(next|tailwindcss|postcss)"\s*:' -n

# 3) Show one PostCSS config from another kit that uses Tailwind v4 import
echo
echo "== Example postcss.config from a sibling kit =="
if [ -f kits/hiring-copilot-agent/apps/postcss.config.mjs ]; then
  sed -n '1,160p' kits/hiring-copilot-agent/apps/postcss.config.mjs
else
  # fallback: pick the first postcss.config.* found under kits/
  cfg="$(fd -t f '^postcss\.config\.(js|mjs)$' kits --exec echo {} | head -n 1)"
  echo "Using: $cfg"
  sed -n '1,160p' "$cfg"
fi

Repository: Lamatic/AgentKit

Length of output: 414


🌐 Web query:

Next.js 15 Tailwind CSS v4 @import'tailwindcss' postcss.config not required@tailwindcss/postcss auto-detect

💡 Result:

In Next.js 15, while Tailwind CSS v4 features automatic content detection [1][2][3], a postcss.config.mjs file remains a required integration point to hook the Tailwind engine into the Next.js build pipeline [4][2][3]. The setup for Tailwind CSS v4 in Next.js 15 follows these core requirements: 1. PostCSS Configuration: You must create a postcss.config.mjs (or postcss.config.js) file that explicitly includes the @tailwindcss/postcss plugin [5][6][4]. This is the required adapter for Tailwind v4 [4][2][3]. postcss.config.mjs export default { plugins: { "@tailwindcss/postcss": {}, }, }; 2. CSS Import: Replace the legacy v3 @tailwind directives (base, components, utilities) with a single import in your global CSS file (typically app/globals.css) [5][1][3]: @import "tailwindcss"; 3. Automatic Content Detection: Tailwind v4 handles content scanning automatically using its new Oxide engine, eliminating the need for a tailwind.config.js file for content paths [1][3]. If you have legacy customizations, they should be migrated to CSS variables within a @theme block in your CSS file rather than a JavaScript config file [7][1][3]. While some modern frontend frameworks (like Vite) offer a "zero-config" experience for Tailwind v4, Next.js 15 still requires the PostCSS plugin adapter to maintain compatibility with the Next.js build and compilation process [4][3].

Citations:


Wire Tailwind v4 PostCSS adapter for research-paper-analyzer

Agent, your mission depends on Tailwind v4 actually running in the Next build pipeline: apps/app/globals.css uses @import 'tailwindcss';, but this kit has no apps/postcss.config.(js|mjs) to include the required @tailwindcss/postcss plugin. Add kits/research-paper-analyzer/apps/postcss.config.mjs:

Add
const config = {
  plugins: {
    "`@tailwindcss/postcss`": {},
  },
};

export default config;
🧰 Tools
🪛 Stylelint (17.12.0)

[error] 1-2: 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/research-paper-analyzer/apps/app/globals.css` at line 1, Create a
PostCSS config module to enable Tailwind v4 processing: add a new module named
postcss.config.mjs in the app to export a config object with a plugins map that
registers the "`@tailwindcss/postcss`" plugin (so the existing `@import`
'tailwindcss' in globals.css is actually processed). Ensure the file exports the
config as the default export and that the plugin key is exactly
"`@tailwindcss/postcss`".

22 changes: 22 additions & 0 deletions kits/research-paper-analyzer/apps/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Metadata } from "next";
import { Analytics } from "@vercel/analytics/next";
import "./globals.css";

export const metadata: Metadata = {
title: "Research Paper Analyzer",
description:
"Upload any academic PDF and get a structured breakdown: problem statement, methodology, key findings, limitations, plain-English summary, and follow-up research questions.",
};

export default function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en">
<body className="antialiased">
{children}
<Analytics />
</body>
</html>
);
}
5 changes: 5 additions & 0 deletions kits/research-paper-analyzer/apps/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Analyzer } from "@/components/analyzer";

export default function Home() {
return <Analyzer />;
}
Loading
Loading