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/codebase-onboarding-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.lamatic/
node_modules/
.env
.env.local
44 changes: 44 additions & 0 deletions kits/codebase-onboarding-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Codebase Onboarding Agent (repo-analyzer)

This AgentKit provides a powerful Codebase Onboarding Agent that analyzes a GitHub repository and generates onboarding materials tailored to specific developer roles using [Lamatic](https://lamatic.dev).

## Architecture

This kit contains a Next.js application (located in the `apps` directory) which provides a user interface for submitting repository details to the Lamatic execution engine.

## Setup Instructions

### Prerequisites

You will need to configure environment variables for Lamatic integration. Create a `.env.local` or `.env` file in the `apps` directory:

```env
LAMATIC_PROJECT_API_KEY=your_lamatic_api_key_here
LAMATIC_API_URL=your_lamatic_endpoint_here
LAMATIC_PROJECT_ID=your_project_id_here
LAMATIC_FLOW_ID=your_flow_id_here
```

### Running the Application

1. Navigate to the `apps` directory:
```bash
cd apps
```
2. Install dependencies:
```bash
npm install
```
3. Run the development server:
```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the application.

## Usage

1. Enter a public GitHub repository URL.
2. Specify the target developer role (e.g., "Frontend Engineer", "Backend Developer").
3. Submit the form to trigger the Lamatic workflow.
4. Wait for the asynchronous analysis to complete and view the generated onboarding materials.
28 changes: 28 additions & 0 deletions kits/codebase-onboarding-agent/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Codebase Onboarding Agent (repo-analyzer)

## Agent Overview
The Codebase Onboarding Agent is an AI-powered tool designed to analyze public GitHub repositories and automatically generate comprehensive, role-specific onboarding materials. By leveraging the Lamatic execution engine, it parses the target codebase and constructs documentation, architectural overviews, and getting-started guides tailored to the user's specific developer role (e.g., Frontend Engineer, Backend Developer, DevOps).

## Purpose
The primary goal of this agent is to drastically reduce the time it takes for a new developer to understand an unfamiliar codebase. Instead of manually sifting through thousands of lines of code and fragmented documentation, the agent provides a synthesized, focused summary of the most relevant parts of the repository based on the developer's responsibilities.

## Flow Descriptions
1. **Input Collection**: The user provides a valid public GitHub repository URL and specifies their target developer role through the Next.js frontend interface.
2. **Request Initialization**: The application validates the inputs and dispatches an asynchronous request to the Lamatic execution engine using the provided Lamatic Flow ID and Project API Key.
3. **Repository Analysis**: The Lamatic-hosted agent fetches the repository, analyzes its file structure, reads key files, and uses LLMs to synthesize the information.
4. **Polling & Retrieval**: The frontend asynchronously polls the Lamatic API (using the `requestId`) until the flow completes.
5. **Result Presentation**: Once completed, the tailored onboarding documentation is unwrapped and displayed to the user in the frontend.

## Guardrails
- **Public Repositories Only**: The agent currently only supports public GitHub repositories.
- **URL Validation**: The provided repository URL is normalized and strictly validated to ensure it points to a valid `github.com` domain.
- **Role Specificity**: A developer role must be provided to ensure the generated documentation is focused and actionable, preventing overly broad or generic analysis.
- **Error Handling**: The integration includes robust timeout and error handling, ensuring that if the Lamatic flow fails or takes too long, the user is notified with a clear error message rather than a hanging state.

## Integration Reference
To successfully integrate and run this agent, the host application requires the following environment variables to be configured in `.env.local`:

- `LAMATIC_PROJECT_API_KEY`: The API key used to authenticate with Lamatic.
- `LAMATIC_PROJECT_ID`: The ID of the Lamatic project hosting the agent.
- `LAMATIC_FLOW_ID`: The ID of the specific workflow that executes the repository analysis.
- `LAMATIC_API_URL`: The endpoint URL for the Lamatic service.
41 changes: 41 additions & 0 deletions kits/codebase-onboarding-agent/apps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions kits/codebase-onboarding-agent/apps/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->
1 change: 1 addition & 0 deletions kits/codebase-onboarding-agent/apps/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
47 changes: 47 additions & 0 deletions kits/codebase-onboarding-agent/apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Codebase Onboarding Agent

This is a [Next.js](https://nextjs.org) project bootstrapped with `create-next-app`, designed to analyze a GitHub repository and provide onboarding materials for specific developer roles using [Lamatic](https://lamatic.dev).

## Getting Started

### Prerequisites

You will need a `.env.local` file in the root of your project with the following environment variables configured for Lamatic integration:

```env
LAMATIC_PROJECT_API_KEY=your_lamatic_api_key_here
LAMATIC_API_URL=your_lamatic_endpoint_here
LAMATIC_PROJECT_ID=your_project_id_here
LAMATIC_FLOW_ID=your_flow_id_here
```


### Running the Development Server

First, install dependencies:

```bash
npm install
# or yarn install / pnpm install
```

Then, run the development server:

```bash
npm run dev
# or yarn dev / pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the application.

## Features

- **Asynchronous Lamatic Flows**: Submits repository and developer role details to Lamatic's execution engine. It properly handles asynchronous flow responses by polling for completion.
- **Responsive UI**: Uses modern Tailwind v4 configurations for responsive and beautiful design.
- **Form Handling**: Integrated with `react-hook-form` and `zod` for robust client and server-side validation.

## Deployment

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme).

Remember to add the `LAMATIC_PROJECT_API_KEY` to your deployment's environment variables.
22 changes: 22 additions & 0 deletions kits/codebase-onboarding-agent/apps/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"css": "src/styles.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {}
}
18 changes: 18 additions & 0 deletions kits/codebase-onboarding-agent/apps/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);

export default eslintConfig;
7 changes: 7 additions & 0 deletions kits/codebase-onboarding-agent/apps/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
Loading