-
Notifications
You must be signed in to change notification settings - Fork 93
feat: Add mvp-builder AgentKit #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3ae3c62
ada28ec
628d288
51ad078
0332c56
add3935
ce90dc3
7a29c6e
9a2b43f
98af590
3d64937
5bd5bfe
f089722
e68ce79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: Detect & Sync Lamatic Flows | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '**/lamatic/flows/**' | ||
|
Comment on lines
+7
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mission-critical: Workflow trigger misses the new kit flow path. This workflow watches Proposed patch on:
push:
branches:
- main
paths:
- '**/lamatic/flows/**'
+ - 'kits/**/flows/**'🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| detect-flow-changes: | ||
| environment: main | ||
| runs-on: ubuntu-latest | ||
| if: "!contains(github.event.head_commit.message, '[LAMATIC-COMMIT]')" | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Sync Flows to lamatic | ||
| uses: Lamatic/sync-flows-to-lamatic@v1 | ||
| with: | ||
| lamatic-endpoint: ${{ secrets.LAMATIC_PROJECT_ENDPOINT }} | ||
| api-key: ${{ secrets.LAMATIC_PROJECT_API_KEY }} | ||
| project-id: ${{ secrets.LAMATIC_PROJECT_ID }} | ||
| auto-deploy: ${{ secrets.LAMATIC_AUTO_DEPLOY_PROJECT }} | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mission cleanup: Remove trailing empty line to satisfy YAML lint. Static analysis already flags this as an 🧰 Tools🪛 YAMLlint (1.38.0)[error] 26-26: too many blank lines (1 > 0) (empty-lines) 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||||||||||||||||
| AGENTIC_GENERATE_CONTENT = "YOUR_FLOW_ID" | ||||||||||||||||||||
| LAMATIC_API_URL = "YOUR_API_ENDPOINT" | ||||||||||||||||||||
| LAMATIC_PROJECT_ID = "YOUR_PROJECT_ID" | ||||||||||||||||||||
| LAMATIC_API_KEY = "YOUR_API_KEY" | ||||||||||||||||||||
|
Comment on lines
+1
to
+4
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Spaces around 🔧 Proposed fix-AGENTIC_GENERATE_CONTENT = "YOUR_FLOW_ID"
-LAMATIC_API_URL = "YOUR_API_ENDPOINT"
-LAMATIC_PROJECT_ID = "YOUR_PROJECT_ID"
-LAMATIC_API_KEY = "YOUR_API_KEY"
+AGENTIC_GENERATE_CONTENT="YOUR_FLOW_ID"
+LAMATIC_API_KEY="YOUR_API_KEY"
+LAMATIC_API_URL="YOUR_API_ENDPOINT"
+LAMATIC_PROJECT_ID="YOUR_PROJECT_ID"📝 Committable suggestion
Suggested change
🧰 Tools🪛 dotenv-linter (4.0.0)[warning] 1-1: [SpaceCharacter] The line has spaces around equal sign (SpaceCharacter) [warning] 2-2: [SpaceCharacter] The line has spaces around equal sign (SpaceCharacter) [warning] 3-3: [SpaceCharacter] The line has spaces around equal sign (SpaceCharacter) [warning] 4-4: [EndingBlankLine] No blank line at the end of the file (EndingBlankLine) [warning] 4-4: [SpaceCharacter] The line has spaces around equal sign (SpaceCharacter) [warning] 4-4: [UnorderedKey] The LAMATIC_API_KEY key should go before the LAMATIC_API_URL key (UnorderedKey) |
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # 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* | ||
| !.env.example | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
| .context |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a live demo link to this file? would allow us to view the functionality better, and allow users to see the kit before forking it. otherwise, LGTM. Thanks!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Live link: https://mvp-builder-sigma.vercel.app
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah the link works, just if you could add it to the README.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| # MVP Builder – Idea to Production Plan using Lamatic AgentKit | ||
|
|
||
| Generate a complete MVP blueprint from a single idea using Lamatic flows. | ||
|
|
||
| This project takes a raw product idea and transforms it into a structured plan including: | ||
|
|
||
| - App type classification | ||
| - Core features | ||
| - Database schema | ||
| - API routes | ||
| - Project structure | ||
| - Tech stack | ||
| - Summary | ||
|
|
||
| --- | ||
|
|
||
| ## What This Kit Does | ||
|
|
||
| This kit converts a simple idea into a production-ready MVP plan using a multi-step Lamatic flow. | ||
|
|
||
| Instead of generating everything in one prompt, it uses a **chained agent workflow**: | ||
|
|
||
| 1. Classifies the idea (web app, mobile app, extension, API) | ||
| 2. Generates features | ||
| 3. Designs database schema | ||
| 4. Creates API routes | ||
| 5. Builds project structure | ||
| 6. Suggests tech stack | ||
| 7. Produces a final summary | ||
|
|
||
| Each step builds on previous outputs, ensuring structured and coherent results. | ||
|
|
||
| --- | ||
|
|
||
| ## Demo Flow | ||
|
|
||
| ```txt | ||
| User Input (idea) | ||
| ↓ | ||
| Lamatic Flow (7 nodes) | ||
| ↓ | ||
| Structured JSON (Plan) | ||
| ↓ | ||
| Next.js UI Rendering | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Flow Architecture | ||
|
|
||
| This kit uses a chained Instructor-based architecture: | ||
|
|
||
| 1. Classify idea type | ||
| 2. Generate features | ||
| 3. Generate database schema | ||
| 4. Generate API routes | ||
| 5. Generate project structure | ||
| 6. Generate tech stack | ||
| 7. Generate summary | ||
|
|
||
| --- | ||
|
|
||
| ## Tech Stack | ||
|
|
||
| - **Frontend:** Next.js (App Router) + TailwindCSS | ||
| - **Backend:** Next.js Server Actions | ||
| - **AI Orchestration:** Lamatic AgentKit | ||
| - **Language:** TypeScript | ||
|
|
||
| --- | ||
|
|
||
| ## Folder Structure | ||
|
|
||
| ```txt | ||
| . | ||
| ├── actions/ | ||
| │ └── orchestrate.ts # Calls Lamatic flow | ||
| ├── app/ | ||
| │ ├── page.tsx # Input screen | ||
| │ └── plan/page.tsx # Result screen | ||
| ├── components/ | ||
| │ ├── content.tsx # UI renderer for plan | ||
| │ └── loading.tsx | ||
| ├── flows/ | ||
| │ └── mvp-builder/ # Exported Lamatic flow | ||
| ├── lib/ | ||
| │ └── lamatic-client.ts # SDK client | ||
| ├── orchestrate.js # Flow config | ||
| ├── types/ | ||
| │ └── index.ts # Plan types | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js 18+ | ||
| - pnpm | ||
| - Lamatic account | ||
|
|
||
| --- | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| Create a `.env` file using: | ||
|
|
||
| ```env | ||
| AGENTIC_GENERATE_CONTENT="YOUR_FLOW_ID" | ||
| LAMATIC_API_URL="YOUR_API_ENDPOINT" | ||
| LAMATIC_PROJECT_ID="YOUR_PROJECT_ID" | ||
| LAMATIC_API_KEY="YOUR_API_KEY" | ||
| ``` | ||
|
|
||
| Reference: | ||
|
|
||
| --- | ||
|
Comment on lines
+114
to
+116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete "Reference:" line. Line 116 contains "Reference:" with no content following it. Either add the intended reference or remove this line. |
||
|
|
||
| ## Setup Instructions | ||
|
|
||
| Install dependencies: | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| ``` | ||
|
|
||
| Run development server: | ||
|
|
||
| ```bash | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| What this does: | ||
|
|
||
| - Starts Next.js dev server | ||
| - Enables server actions | ||
| - Connects to Lamatic flow via SDK | ||
|
|
||
| --- | ||
|
|
||
| ## How It Works | ||
|
|
||
| ### 1. User Input | ||
|
|
||
| User enters an idea on `/` | ||
|
|
||
| --- | ||
|
|
||
| ### 2. Server Action | ||
|
|
||
| `actions/orchestrate.ts`: | ||
|
|
||
| - Sends idea to Lamatic | ||
| - Executes flow via SDK | ||
| - Returns structured response | ||
|
|
||
| --- | ||
|
|
||
| ### 3. Lamatic Flow | ||
|
|
||
| Flow consists of multiple Instructor LLM nodes: | ||
|
|
||
| - Each node updates part of the JSON | ||
| - Uses schema enforcement | ||
| - Passes context forward | ||
|
|
||
| --- | ||
|
|
||
| ### 4. UI Rendering | ||
|
|
||
| `components/content.tsx`: | ||
|
|
||
| - Displays: | ||
| - Features | ||
| - Tech stack | ||
| - Database tables | ||
| - API routes | ||
| - Project structure | ||
|
|
||
| --- | ||
|
|
||
| ## Example Output | ||
|
|
||
| ```json | ||
| { | ||
| "type": "web_app", | ||
| "features": [...], | ||
| "database": { "tables": [...] }, | ||
| "api": { "routes": [...] }, | ||
| "structure": {...}, | ||
| "tech_stack": {...}, | ||
| "summary": "..." | ||
| } | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## How to Run Locally | ||
|
|
||
| 1. Clone repo | ||
| 2. Add `.env` | ||
| 3. Run: | ||
|
|
||
| ```bash | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| 4. Open: | ||
|
|
||
| ``` | ||
| http://localhost:3000 | ||
| ``` | ||
|
Comment on lines
+209
to
+211
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language specifier to fenced code block. The code block should specify a language for proper syntax highlighting and linting compliance. 📝 Proposed fix-```
+```txt
http://localhost:3000 |
||
|
|
||
| --- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| 'use server'; | ||
|
|
||
| import { lamaticClient } from '@/lib/lamatic-client'; | ||
| import { config } from '@/orchestrate'; | ||
| import { LamaticResponse } from 'lamatic/dist/types'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if LamaticResponse is exported from the main package entry
fd -t f 'package.json' --exec cat {} \; | jq -r '.main, .types, .exports' 2>/dev/null || echo "package.json not found in repo"
# Search for LamaticResponse usage patterns in the codebase
rg -n "from ['\"]lamatic" --type tsRepository: Lamatic/AgentKit Length of output: 1026 🏁 Script executed: # Search for LamaticResponse definitions and re-exports
rg -n "LamaticResponse" --type ts --type tsx
# Check if there are any type stub files or index files that might re-export it
fd -t f "index\.(ts|d\.ts|js)" --path "*lamatic*"Repository: Lamatic/AgentKit Length of output: 321 🏁 Script executed: # Search for LamaticResponse definitions and re-exports
rg -n "LamaticResponse" --type ts
# Look for type definition files
fd -t f "index" | grep -E "\.(ts|d\.ts)$"
# Check if LamaticResponse might be exported from public api
rg -n "export.*LamaticResponse" --type tsRepository: Lamatic/AgentKit Length of output: 457 🏁 Script executed: # Read the types/index.ts file
cat -n kits/agentic/mvp-builder/types/index.ts
# Search for other LamaticResponse-like response type imports
rg -n "Response.*from" kits/agentic/mvp-builder --type ts
# Check if there are other server action files that might handle responses
fd -t f "action" kits/agentic/mvp-builderRepository: Lamatic/AgentKit Length of output: 1027 🏁 Script executed: # Read the orchestrate.ts file
cat -n kits/agentic/mvp-builder/actions/orchestrate.ts
# Also check if there are any other similar response patterns in related files
rg -n "Promise<" kits/agentic/mvp-builder --type ts -A 2 -B 2Repository: Lamatic/AgentKit Length of output: 1186 🏁 Script executed: # Read the lamatic-client file to see how lamaticClient is typed
cat -n kits/agentic/mvp-builder/lib/lamatic-client.ts
# Search for any .d.ts files that might provide type definitions
fd -t f "\\.d\\.ts$"
# Check if there are any type imports from lamatic at all
rg -n "from.*lamatic.*types" --type tsRepository: Lamatic/AgentKit Length of output: 441 🏁 Script executed: # Search for any 'lamatic/types' imports or references
rg -n "lamatic/types" --type ts
# Check if there's a types export mentioned anywhere in config files
rg -n "lamatic" tsconfig.json package.json 2>/dev/null || true
# Look at how the Lamatic class and its methods are used to understand the return type
rg -n "executeFlow" --type ts -A 3 -B 1Repository: Lamatic/AgentKit Length of output: 7022 Avoid importing from internal Importing from |
||
|
|
||
| export async function generatePlan(idea: string): Promise<LamaticResponse> { | ||
| const flow = config.flows.mvp; | ||
|
|
||
| if (!flow.workflowId) { | ||
| throw new Error('Workflow ID missing'); | ||
| } | ||
|
|
||
| const inputs = { | ||
| idea | ||
| }; | ||
|
Comment on lines
+7
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mission hardening: validate Line 7 accepts untrusted input and Lines 14–18 forward it directly. Client checks can be bypassed; add server-side non-empty and size guards. 🛡️ Proposed fix export async function generatePlan(idea: string): Promise<LamaticResponse> {
+ const normalizedIdea = idea.trim();
+ if (!normalizedIdea) {
+ throw new Error('Idea is required');
+ }
+ if (normalizedIdea.length > 2000) {
+ throw new Error('Idea is too long');
+ }
+
const flow = config.flows.mvp;
@@
const inputs = {
- idea
+ idea: normalizedIdea
};🤖 Prompt for AI Agents |
||
|
|
||
| const res = await lamaticClient.executeFlow(flow.workflowId, inputs); | ||
|
|
||
| if (!res) { | ||
| throw new Error('No output from flow'); | ||
| } | ||
|
|
||
| return res; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed, kindly if you could remove this