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
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.git
.github
**/.DS_Store
**/.env
**/.next
**/node_modules
**/coverage
**/dist
**/build
**/.turbo
**/.vercel
docs/plans
dogfood-output
content
113 changes: 113 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI

on:
pull_request:
push:
branches:
- main
workflow_dispatch:
inputs:
kit_path:
description: Optional kit path to validate with Docker.
required: false
default: kits/agentic/code-review

jobs:
detect-kits:
runs-on: ubuntu-latest
outputs:
kits: ${{ steps.detect.outputs.kits }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed kits
id: detect
shell: bash
run: |
set -euo pipefail

if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch origin "${{ github.base_ref }}" --depth=1
changed_files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD)
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
changed_files=$(git ls-files)
elif [ "${{ github.event.before }}" = "0000000000000000000000000000000000000000" ]; then
changed_files=$(git ls-files)
else
changed_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}")
fi

kits_json=$(
printf '%s\n' "$changed_files" \
| awk -F/ '/^kits\/[^/]+\/[^/]+\// { print $1 "/" $2 "/" $3 }' \
| sort -u \
| while IFS= read -r dir; do
[ -f "$dir/package.json" ] && printf '%s\n' "$dir"
done \
| jq -R -s -c 'split("\n") | map(select(length > 0))'
)

echo "kits=${kits_json:-[]}" >> "$GITHUB_OUTPUT"

build-kits:
runs-on: ubuntu-latest
needs: detect-kits
if: needs.detect-kits.outputs.kits != '[]'
strategy:
fail-fast: false
matrix:
kit: ${{ fromJson(needs.detect-kits.outputs.kits) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ${{ matrix.kit }}/package-lock.json

- name: Install dependencies
working-directory: ${{ matrix.kit }}
run: npm ci

- name: Lint
working-directory: ${{ matrix.kit }}
run: npm run lint --if-present

- name: Build
working-directory: ${{ matrix.kit }}
run: npm run build --if-present

validate-docker:
runs-on: ubuntu-latest
needs: detect-kits
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Choose Docker target
id: target
shell: bash
run: |
set -euo pipefail

if [ -n "${{ github.event.inputs.kit_path }}" ]; then
kit_path="${{ github.event.inputs.kit_path }}"
elif [ "${{ needs.detect-kits.outputs.kits }}" != "[]" ]; then
kit_path=$(printf '%s' '${{ needs.detect-kits.outputs.kits }}' | jq -r '.[0]')
else
kit_path="kits/agentic/code-review"
fi

echo "kit_path=$kit_path" >> "$GITHUB_OUTPUT"

- name: Build Docker image
run: |
docker build \
--build-arg KIT_PATH=${{ steps.target.outputs.kit_path }} \
-t agentkit-ci .
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
**/.DS_Store

.env
.env
.agents/
.claude/
.crush/
.omx/
.openhands/
.serena/
.pi/
.playwright-mcp/
dogfood-output/
docs/plans/
task_plan.md
findings.md
progress.md
content/
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1.7

ARG NODE_VERSION=20
ARG KIT_PATH=kits/agentic/code-review

FROM node:${NODE_VERSION}-alpine AS deps
ARG KIT_PATH
WORKDIR /app
COPY ${KIT_PATH}/package*.json ./
RUN npm ci

FROM node:${NODE_VERSION}-alpine AS builder
ARG KIT_PATH
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY ${KIT_PATH}/ ./
RUN npm run build
RUN npm prune --omit=dev

FROM node:${NODE_VERSION}-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=builder /app ./
EXPOSE 3000
CMD ["npm", "run", "start"]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ Each kit includes configuration instructions, environment variables/lamatic-conf
| **🧠 Agentic Kits** | Advanced self-directed, reasoning agents for goal-driven operations | | | [`/kits/agentic`](./kits/agentic) |
| **Deep Search Agent** | A Next.js starter kit for goal-driven reasoning agents using Lamatic Flows. | Available | [![Live Demo](https://img.shields.io/badge/Live%20Demo-black?style=for-the-badge)](https://agent-kit-reasoning.vercel.app) | [`/kits/agentic/deep-search`](./kits/agentic/deep-search) |
| **Generation Agent** | A Next.js starter kit for generating text/json/image content using Lamatic Flows. | Available | [![Live Demo](https://img.shields.io/badge/Live%20Demo-black?style=for-the-badge)](https://agent-kit-generation.vercel.app) | [`/kits/agentic/generation`](./kits/agentic/generation) |
| **Code Review Agent** | Reviews public GitHub PRs for bugs, security issues, and style risks using Lamatic flows. | Available | [![Live Demo](https://img.shields.io/badge/Live%20Demo-black?style=for-the-badge)](https://agent-kit-stk.vercel.app) | [`/kits/agentic/code-review`](./kits/agentic/code-review) |
||
| **🤖 Automation Kits** | Automate complex business processes with robust and flexible agent workflows | | | [`/kits/automation`](./kits/automation) |
| **Hiring Automation** | A Next.js starter kit for hiring automation using Lamatic Flows. | Available | [![Live Demo](https://img.shields.io/badge/Live%20Demo-black?style=for-the-badge)](https://agent-kit-hiring.vercel.app) | [`/kits/automation/hiring`](./kits/automation/hiring) |
| **Blog Writing Automation** | Generates, optimizes, and publishes blog posts from webhook or scheduler triggers. | Available | | [`/kits/automation/blog-automation`](./kits/automation/blog-automation) |
||
| **🧑‍💼 Assistant Kits** | Create context-aware helpers for users, customers, and team members | | | [`/kits/assistant`](./kits/assistant) |
| **Grammar Assistant** | A chrome extension to check grammar corrections across your selection. | Available | | [`/kits/assistant/grammar-extension`](./kits/assistant/grammar-extension) |
Expand Down Expand Up @@ -150,6 +152,7 @@ Each kit includes configuration instructions, environment variables/lamatic-conf
- [AgentKit Overview](https://lamatic.ai/templates/agentkits)
- [Lamatic Guides](https://lamatic.ai/guides)
- [API Reference](https://lamatic.ai/api)
- [Docker Deployment Guide](./docs/deployment.md)
- [Community Support](https://github.com/Lamatic/AgentKit/discussions)

***
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
agentkit:
build:
context: .
dockerfile: Dockerfile
args:
KIT_PATH: ${KIT_PATH:-kits/agentic/code-review}
NODE_VERSION: ${NODE_VERSION:-20}
env_file:
- ${KIT_ENV_FILE:-.env}
environment:
NODE_ENV: production
PORT: ${PORT:-3000}
ports:
- "${PORT:-3000}:3000"
57 changes: 57 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Deployment Guide

This repo is a collection of individual kits, not one root application. The Docker and CI setup in this repo is designed to build one kit at a time by pointing at a kit directory that already contains a `package.json`.

## Build a Kit Image

From the repo root:

```bash
docker build \
--build-arg KIT_PATH=kits/agentic/code-review \
-t agentkit-code-review .
```

Change `KIT_PATH` to any runnable kit, for example:

- `kits/agentic/code-review`
- `kits/automation/blog-automation`
- `kits/embed/chat`

## Run a Kit Container

Pass the environment file for the selected kit at runtime:

```bash
docker run --rm \
-p 3000:3000 \
--env-file kits/agentic/code-review/.env \
agentkit-code-review
```

## Run with Docker Compose

`docker-compose.yml` lets you switch kits without editing the file:

```bash
KIT_PATH=kits/agentic/code-review \
KIT_ENV_FILE=kits/agentic/code-review/.env \
docker compose up --build
```

The same pattern works for any other runnable kit in the repo.

## CI Behavior

`.github/workflows/ci.yml` does 2 things:

1. Detects which kits changed in the current push or pull request.
2. Runs `npm ci`, `npm run lint`, and `npm run build` for each changed kit that has a `package.json`.

It also validates the generic Dockerfile by building the first changed kit, or `kits/agentic/code-review` when no changed kit can be inferred.

## Limits

- Templates and flow-only bundles do not produce runnable Docker images from this root Dockerfile.
- Each kit still needs its own Lamatic environment variables.
- Docker validation could not be executed locally in this environment because Docker is not installed here.
3 changes: 2 additions & 1 deletion kits/agentic/code-review/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
.next-dev*.log

# env files
.env
Expand All @@ -27,4 +28,4 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts
next-env.d.ts
Empty file.
16 changes: 0 additions & 16 deletions kits/agentic/code-review/.next-dev-3001.log

This file was deleted.

14 changes: 10 additions & 4 deletions kits/agentic/code-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ Results are returned as structured JSON and rendered in a premium dark-themed UI

Create a `.env` file in the kit root:

---
```bash
AGENTIC_GENERATE_CONTENT="your-deployed-flow-id"
LAMATIC_API_URL="https://your-org.lamatic.dev"
LAMATIC_PROJECT_ID="your-project-id"
LAMATIC_API_KEY="your-api-key"
```

## Lamatic Flow Setup

Expand All @@ -72,7 +77,7 @@ Generate JSON — Final Merge (summary)
API Response
```

Import the exported flow from the `flows/` directory into your Lamatic project, then update the `workflowId` in `app/api/review/route.ts` with your deployed flow ID.
Import the exported flow from the `flows/` directory into your Lamatic project, deploy it, then copy the deployed flow id into `AGENTIC_GENERATE_CONTENT`.

---

Expand All @@ -85,7 +90,7 @@ npm install

# 2. Set up environment variables
cp .env.example .env
# Fill in your LAMATIC_API_KEY
# Fill in all Lamatic values from your project

# 3. Start the dev server
npm run dev
Expand Down Expand Up @@ -172,7 +177,8 @@ Deploy to Vercel in one click:
2. Import to [vercel.com](https://vercel.com)
3. Set Root Directory to `kits/agentic/code-review`
4. Add environment variable: `LAMATIC_API_KEY`
5. Deploy
5. Add `LAMATIC_API_URL`, `LAMATIC_PROJECT_ID`, and `AGENTIC_GENERATE_CONTENT`
6. Deploy

---

Expand Down
Loading
Loading