Skip to content

Latest commit

 

History

History
214 lines (139 loc) · 6.81 KB

setup-guide.md

File metadata and controls

214 lines (139 loc) · 6.81 KB

Setup Guide

A detailed guide for getting started with the AI Product Development Template.

Overview

This template gives you a fully automated development workflow:

  1. You fork the repo and run an AI-powered setup wizard
  2. The wizard configures everything — architecture guidelines, issue skills, README
  3. You file GitHub issues describing what you want built
  4. An AI agent implements them and opens pull requests automatically

The entire project follows Domain-Driven Design (DDD) principles, enforced through a generated CLAUDE.md that the agent reads before every task.


Prerequisites

Before starting, make sure you have:


Step 1: Fork the Repository

Fork this template repository on GitHub. You can do this via the GitHub UI (click Fork) or with the CLI:

gh repo fork TEMPLATE-OWNER/TEMPLATE-REPO --clone

Step 2: Set Up Your Cursor API Key

The GitHub Actions workflow uses the Cursor API to run the agent in CI. Store your API key as a repository secret:

gh secret set CURSOR_API_KEY --repo YOUR-ORG/YOUR-REPO --body "your-api-key"

This key is only used by the GitHub Actions workflow — it never appears in code or logs.


Step 3: Run the Setup Wizard

Open your forked repository in Cursor and tell the AI:

"Set up my project"

The wizard will guide you through four steps:

3a. Product Identity

The wizard asks for:

  • Product name — e.g. "InventoryHub", "PayrollPro"
  • One-line description — what the product does
  • GitHub repo — owner/repo for issue creation (e.g. "acme/inventory-hub")

3b. Domain Discovery

You describe what your product does in plain language. The wizard uses this to propose bounded contexts — the major areas of your domain. For example:

  • An e-commerce platform might get: Orders, Inventory, Customers, Products, Payments, Shipping, Returns
  • An HR system might get: Employees, Payroll, Leave, Recruitment, Performance, Benefits
  • A project management tool might get: Projects, Tasks, Teams, Time Tracking, Reporting

You can accept the suggestions, add more, remove some, or rename them. The wizard iterates until you're happy.

3c. Tech Stack

The wizard asks about your preferred tech stack with sensible defaults:

Choice Default Options
Backend Python + FastAPI Python + Typer (CLI), TypeScript + NestJS, Go, Other
Frontend React None (backend-only), Other
Backend type App server (HTTP API) CLI tool

3d. File Generation

The wizard generates three files based on your answers:

  1. CLAUDE.md — DDD architecture guidelines with your product name, bounded contexts, tech stack, and project structure
  2. .cursor/skills/create-issue/SKILL.md — a Cursor skill for creating well-structured issues with your repo reference and domain scope
  3. README.md — updated with your product name, description, and tech stack

It also:

  • Removes the setup wizard skill (its job is done)
  • Creates GitHub labels (feature, bug, deployment) in your repo if they don't exist

After setup, your repo will look like this:

.github/workflows/cursor-agent.yml   # CI workflow — auto-implements issues
.cursor/skills/create-issue/SKILL.md  # Cursor skill for filing issues
CLAUDE.md                              # DDD architecture guidelines (generated by wizard)
README.md                              # Updated with your product info
docs/setup-guide.md                    # This file
src/                                   # Your code (created as issues are implemented)

Step 4: Create Issue Labels

The wizard attempts to create labels automatically. If it can't (e.g. permissions), create them manually:

gh label create feature --description "New feature or enhancement" --color 0E8A16 --repo YOUR-ORG/YOUR-REPO
gh label create bug --description "Something is broken" --color D73A4A --repo YOUR-ORG/YOUR-REPO
gh label create deployment --description "Infrastructure, CI/CD, or release task" --color 1D76DB --repo YOUR-ORG/YOUR-REPO

Add domain-specific labels as needed (e.g. finance, hr, frontend).


Step 5: Verify Everything Works

Run through this checklist:

  • CURSOR_API_KEY secret is set in your GitHub repo settings
  • Labels exist in the repo (feature, bug, deployment)
  • CLAUDE.md contains your product name and bounded contexts
  • .cursor/skills/create-issue/SKILL.md references your repo
  • .github/workflows/cursor-agent.yml exists on the default branch

Test the end-to-end flow

Create a test issue to verify everything works:

gh issue create --title "Add a health check endpoint" --body "## Summary
Add a simple health check endpoint that returns the service status.

## Details
- Create a GET /health endpoint
- Return { \"status\": \"ok\" } with a 200 response

## Scope
API layer" --label feature --repo YOUR-ORG/YOUR-REPO

Watch the GitHub Actions tab — the agent should pick up the issue and start working.


How the Automation Works

Issue Flow

New issue opened (or comment added)
         |
         v
GitHub Actions workflow triggers
         |
         v
Cursor Agent reads:
  - Issue title, body, labels
  - Full conversation thread
  - CLAUDE.md (architecture guidelines)
         |
         v
Agent decides:
  - In scope? If not, closes with comment
  - Clear enough? If not, asks questions
  - Ready to implement? Creates branch, codes, opens PR

Branch Naming

The agent creates branches named cursor/issue-{number}. If a branch already exists from a prior attempt, it reuses it and adds new commits.

Clarification Flow

If requirements are ambiguous, the agent posts a comment asking specific questions. When you reply, the workflow re-triggers. The agent reads the full thread and continues with your clarifications.

Failure Handling

If the agent fails (timeout, error, etc.), it posts a comment on the issue with a link to the failed workflow run so you can debug.


Customization

Adding a label gate

Only run the agent on issues with a specific label:

Add this to the workflow job's if condition:

contains(github.event.issue.labels.*.name, 'agent')

Changing the scope guard

Edit the agent prompt in .github/workflows/cursor-agent.yml to adjust what's considered "in scope" for your product.

Supporting multiple products

Each product gets its own repo with its own CLAUDE.md and workflow. The Cursor skill can be made personal (~/.cursor/skills/) to work across all projects.

Adjusting the agent timeout

The default timeout is 30 minutes. Change the timeout-minutes value in the workflow.