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/bugpilot-ai/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.lamatic/
node_modules/
.env
.env.local
179 changes: 179 additions & 0 deletions kits/bugpilot-ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# bugpilot-debugger

BugPilot Debugger is an AI-powered debugging assistant built using Lamatic AgentKit and Next.js.

The application helps developers analyze runtime errors and code issues by generating:

- Root cause analysis
- Beginner-friendly explanations
- Severity assessment
- Step-by-step fixes
- Corrected code examples
- Prevention tips

The project integrates a custom frontend with a Lamatic AI workflow using GraphQL APIs.

---

# Features

- AI-powered bug analysis
- Multi-language debugging support
- Clean developer-focused UI
- Real-time debugging responses
- Lamatic workflow integration
- GraphQL API communication
- Error handling for provider failures and quota limits
- Responsive frontend built with Tailwind CSS

---

# Tech Stack

## Frontend

- Next.js 16
- React
- TypeScript
- Tailwind CSS

## Backend

- Next.js Route Handlers
- GraphQL API Integration

## AI Workflow

- Lamatic AgentKit
- Groq / Gemini models

---

# Project Structure

```bash
bugpilot-debugger/
├── apps/
│ ├── src/
│ │ ├── app/
│ │ │ ├── api/
│ │ │ │ └── analyze/
│ │ │ │ └── route.ts
│ │ │ └── page.tsx
├── flows/
├── prompts/
├── model-configs/
├── constitutions/
├── agent.md
└── README.md
```

Prerequisites

Before running the project, ensure you have:

Node.js installed
npm installed
Lamatic account
Lamatic API Key
Lamatic deployed workflow

Setup Instructions

1. Clone Repository
git clone <your-repository-url>
cd bugpilot-debugger/apps
2. Install Dependencies
npm install
3. Configure Environment Variables

Create a .env.local file inside the app directory.

LAMATIC_API_KEY=your_api_key
LAMATIC_PROJECT_ID=your_project_id
LAMATIC_API_URL=your_api_url
BUGPILOT_DEBUGGER_FLOW_ID=your_flow_id

4. Start Development Server
npm run dev

Open:

http://localhost:3000

Usage Example

Input
Programming Language: JavaScript
Error Message: Cannot read properties of undefined (reading 'map')
Code Snippet: const items = data.map(item => item.name)

Expected Output

The AI assistant returns:

Root cause analysis
Beginner-friendly explanation
Severity level
Step-by-step fix
Corrected code example
Prevention recommendations
Lamatic Workflow

The workflow contains:

1. API Request Node

Receives frontend payload.

2. Generate Text Node

Analyzes bug details using AI.

3. API Response Node

Returns debugging analysis to frontend.

API Flow

Frontend → Next.js API Route → Lamatic GraphQL API → AI Model → Frontend Response

Error Handling

The app gracefully handles:

AI provider overload
API failures
Invalid responses
Missing fields
Quota exceeded errors

Example fallback message:

AI provider is currently busy. Please retry in a few seconds.
Deployment
Frontend

Deploy using:

Vercel

Root directory:

kits/bugpilot-debugger/apps
Lamatic Workflow

Deploy through Lamatic Studio.

Future Improvements
Authentication
Markdown rendering
Syntax highlighting
Chat history
File upload support
Multi-agent debugging
Export debugging reports

Author: Aman Kumar
63 changes: 63 additions & 0 deletions kits/bugpilot-ai/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# bugpilot-debugger

## Agent Overview

BugPilot Debugger is an AI-powered debugging assistant designed to help developers quickly identify, understand, and fix programming errors.

The agent accepts:

- Programming language
- Error message / stack trace
- Code snippet

and returns:

- Root cause analysis
- Beginner-friendly explanation
- Severity assessment
- Step-by-step debugging solution
- Corrected code example
- Prevention tips

The system is built using:

- Lamatic AI workflows
- Next.js frontend
- GraphQL API integration
- Groq / Gemini language models

---

# Purpose

The goal of BugPilot Debugger is to reduce debugging time for developers by providing fast, accurate, and educational bug analysis.

The agent is intended for:

- Students
- Junior developers
- Full-stack developers
- Backend engineers
- Frontend engineers
- Interview preparation
- Learning debugging best practices

---

# Flow Description

The project uses a Lamatic workflow consisting of three main nodes.

## 1. API Request Node

Receives incoming payload data from the frontend application.

Expected payload:

```json
{
"language": "JavaScript",
"error": "Cannot read properties of undefined",
"codeSnippet": "const items = data.map(item => item.name)"
}
```
41 changes: 41 additions & 0 deletions kits/bugpilot-ai/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
36 changes: 36 additions & 0 deletions kits/bugpilot-ai/apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

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

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

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

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) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
18 changes: 18 additions & 0 deletions kits/bugpilot-ai/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/bugpilot-ai/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
Loading