Skip to content

[kit] Add Forge for Freelance Services Agreement & Invoice Generation [mission-possible]#152

Open
cyber-turtle wants to merge 24 commits intoLamatic:mainfrom
cyber-turtle:feat/forge
Open

[kit] Add Forge for Freelance Services Agreement & Invoice Generation [mission-possible]#152
cyber-turtle wants to merge 24 commits intoLamatic:mainfrom
cyber-turtle:feat/forge

Conversation

@cyber-turtle
Copy link
Copy Markdown
Contributor

@cyber-turtle cyber-turtle commented May 1, 2026

What This Kit Does

Forge is a 4-flow autonomous freelance documentation agent designed to protect freelancers by automating professional contracts and invoices in under 60 seconds.

Users submit project details, and the agent triggers a multi-step AI pipeline: first, it performs a Pricing Analysis to suggest market-calibrated rates; second, it runs a Governing Law Tradeoff to recommend the best jurisdiction based on the freelancer's specific concerns (IP, payment, or disputes); and finally, it synthesizes a full 13-section Services Agreement and a matching Professional Invoice.

Both documents are rendered in a premium glassmorphic interface, support digital signatures, and can be exported as perfectly paginated, multi-page PDFs.

Providers & Prerequisites

  • Lamatic.ai: Handles orchestration and the 4-step AI pipeline.
  • OpenRouter / LLM Providers: API keys configured in Lamatic's generic credentials panel (Forge is optimized for Gemini 1.5 Pro and GPT-4o).
  • Vercel: Recommended for deployment (configured for the /apps directory).

How to Run Locally

  1. cd kits/forge/apps
  2. npm install
  3. cp .env.example .env.local and fill in your 4 Lamatic Flow IDs and API Key
  4. npm run dev

Live Preview

image

Live App: https://forge-wheat-one.vercel.app/

Lamatic Flows

  • Pricing Flow ID: 8738b556-9a25-41e9-9233-03091e4e3759
  • Tradeoff Flow ID: 64a8c279-ef27-4632-a5ec-9ec3f752674e
  • Contract Flow ID: 6e5e8e78-c89b-449e-b9ef-6090e72f0564
  • Invoice Flow ID: 5788478d-6490-4107-afb9-470086c8a77d

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • config.json present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified

Copilot AI review requested due to automatic review settings May 1, 2026 19:43
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • agentkit-challenge

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 49e3e6a8-8a40-458f-ae5b-1a7a73b039af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Forge kit to AgentKit: a 4-step Lamatic + Next.js wizard that collects project details, runs pricing + governing-law analysis, and generates a services agreement and invoice with signature + export UI.

Changes:

  • Added 4 Lamatic flow definitions (pricing, tradeoff, contract, invoice) with prompts, constitutions, and model-config placeholders.
  • Added a Next.js (App Router) frontend implementing the 4-step wizard, previews, signature capture, and export.
  • Added kit metadata/docs (lamatic.config.ts, agent.md, README.md) and local env scaffolding.

Reviewed changes

Copilot reviewed 54 out of 58 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
kits/forge/prompts/forge-tradeoff_llmnode-tradeoff_user_1.md Tradeoff flow user prompt template.
kits/forge/prompts/forge-tradeoff_llmnode-tradeoff_system_0.md Tradeoff flow system prompt + JSON output constraints.
kits/forge/prompts/forge-pricing_llmnode-pricing_user_1.md Pricing flow user prompt template.
kits/forge/prompts/forge-pricing_llmnode-pricing_system_0.md Pricing flow system prompt + JSON schema expectations.
kits/forge/prompts/forge-invoice_llmnode-invoice_user_1.md Invoice flow user prompt template.
kits/forge/prompts/forge-invoice_llmnode-invoice_system_0.md Invoice flow system prompt + strict JSON rules.
kits/forge/prompts/forge-contract_llmnode-contract_user_1.md Contract flow user prompt template.
kits/forge/prompts/forge-contract_llmnode-contract_system_0.md Contract flow system prompt describing 13-section contract JSON output.
kits/forge/model-configs/forge-tradeoff_llmnode-tradeoff_generative-model-name.ts Placeholder model-config for tradeoff LLM node.
kits/forge/model-configs/forge-pricing_llmnode-pricing_generative-model-name.ts Placeholder model-config for pricing LLM node.
kits/forge/model-configs/forge-invoice_llmnode-invoice_generative-model-name.ts Placeholder model-config for invoice LLM node.
kits/forge/model-configs/forge-contract_llmnode-contract_generative-model-name.ts Placeholder model-config for contract LLM node.
kits/forge/lamatic.config.ts Kit metadata (name/steps/env keys/links).
kits/forge/flows/forge-tradeoff.ts Lamatic flow graph for governing-law options.
kits/forge/flows/forge-pricing.ts Lamatic flow graph for pricing analysis.
kits/forge/flows/forge-invoice.ts Lamatic flow graph for invoice generation.
kits/forge/flows/forge-contract.ts Lamatic flow graph for contract generation.
kits/forge/constitutions/default.md Kit constitution/guardrails for agent behavior.
kits/forge/apps/tsconfig.json Next.js app TS config.
kits/forge/apps/tailwind.config.js Tailwind theme + content config.
kits/forge/apps/public/forge2.svg App logo asset.
kits/forge/apps/postcss.config.js PostCSS config for Tailwind.
kits/forge/apps/package.json App dependencies/scripts.
kits/forge/apps/orchestrate.js Centralized env-driven flow configuration.
kits/forge/apps/next.config.mjs Next.js config (TS/build/image settings).
kits/forge/apps/lib/utils.ts Tailwind/className helper (cn).
kits/forge/apps/lib/types.ts Shared session + document data types.
kits/forge/apps/lib/storage.ts localStorage session persistence helpers.
kits/forge/apps/lib/lamatic.ts Client helper to call /api/flow.
kits/forge/apps/lib/lamatic-client.ts Server-side Lamatic SDK client init.
kits/forge/apps/components/wizard/StepIndicator.tsx Wizard step indicator UI.
kits/forge/apps/components/wizard/Step4Generate.tsx Step 4: generate contract/invoice and store in session.
kits/forge/apps/components/wizard/Step3GoverningLaw.tsx Step 3: call tradeoff flow + select option.
kits/forge/apps/components/wizard/Step2Pricing.tsx Step 2: call pricing flow + edit line items.
kits/forge/apps/components/wizard/Step1ProjectDetails.tsx Step 1: project details form persisted to session.
kits/forge/apps/components/preview/SignatureCanvas.tsx Signature capture modal/canvas.
kits/forge/apps/components/preview/InvoiceDocument.tsx Invoice rendering component for preview/print.
kits/forge/apps/components/preview/ExportButton.tsx Export action UI (currently print-based).
kits/forge/apps/components/preview/ContractDocument.tsx Contract rendering component for preview/print.
kits/forge/apps/components/Nav.tsx Top navigation with logo.
kits/forge/apps/components/GalaxyButton.tsx Primary CTA button component.
kits/forge/apps/components/ErrorState.tsx Standard error + retry UI.
kits/forge/apps/components/AuroraBackground.tsx Animated background wrapper.
kits/forge/apps/app/preview/invoice/page.tsx Invoice preview page with signing/export actions.
kits/forge/apps/app/preview/contract/page.tsx Contract preview page with signing/export actions.
kits/forge/apps/app/page.tsx Landing page for the kit app.
kits/forge/apps/app/new/page.tsx Wizard container page.
kits/forge/apps/app/layout.tsx Root layout + metadata + nav.
kits/forge/apps/app/icon.svg App icon asset.
kits/forge/apps/app/globals.css Global styling, components, and print CSS.
kits/forge/apps/app/api/flow/route.ts Server proxy route that executes Lamatic workflows via GraphQL.
kits/forge/apps/actions/orchestrate.ts Server action wrapper around Lamatic SDK execution.
kits/forge/apps/.gitignore App-level ignore rules.
kits/forge/apps/.env.example Environment variable template.
kits/forge/agent.md Kit/agent overview and operational notes.
kits/forge/README.md Kit documentation: setup, flows, and usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kits/forge/apps/app/api/flow/route.ts
Comment thread kits/forge/prompts/forge-invoice_llmnode-invoice_system_0.md
Comment thread kits/forge/flows/forge-contract.ts
Comment thread kits/forge/flows/forge-invoice.ts
Comment thread kits/forge/lamatic.config.ts
Comment thread kits/forge/apps/components/wizard/Step4Generate.tsx
Comment thread kits/forge/apps/lib/lamatic-client.ts
Comment thread kits/forge/apps/components/AuroraBackground.tsx
Comment thread kits/forge/apps/next.config.mjs
Comment thread kits/forge/apps/components/wizard/Step4Generate.tsx Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 54 out of 58 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kits/forge/apps/app/api/flow/route.ts
Comment thread kits/forge/apps/app/api/flow/route.ts Outdated
Comment thread kits/forge/apps/components/wizard/Step4Generate.tsx Outdated
Comment thread kits/forge/apps/components/wizard/Step4Generate.tsx Outdated
Comment thread kits/forge/apps/components/wizard/Step4Generate.tsx
Comment thread kits/forge/flows/forge-tradeoff.ts
Comment thread kits/forge/flows/forge-contract.ts
Comment thread kits/forge/flows/forge-invoice.ts
Comment thread kits/forge/README.md Outdated
Comment thread kits/forge/flows/forge-pricing.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants