A structured framework for AI-assisted development using Cursor, Claude, and the modern web stack.
| Tool | Purpose |
|---|---|
| Cursor | AI-powered code editor |
| Claude | AI assistant (via Cursor + Claude.ai) |
| Next.js 14+ | React framework with App Router |
| Convex | Real-time serverless database |
| Clerk | Authentication |
| Vercel | Deployment |
| Ref.tools | MCP server for documentation access |
| Exa.ai | AI-powered semantic search |
| Bugbot | AI code review on PRs |
This framework follows Ray Fernando's "vibe coding" methodology:
- Plan before you code β Always generate a PRD and technical plan first
- Teach your AI β Use cursor rules to give Claude context about your project
- Vertical slices β Build features end-to-end in small increments
- Track progress β Use status.md to restore AI context when it forgets
- Review with AI β Let Bugbot catch bugs before merge
your-project/
βββ .cursor/
β βββ rules/ # Project-specific AI rules
β βββ global.mdc # Always-on rules
β βββ nextjs.mdc # Next.js patterns
β βββ convex.mdc # Database patterns
β βββ components.mdc # UI component rules
βββ .github/
β βββ PULL_REQUEST_TEMPLATE.md # PR template
β βββ ISSUE_TEMPLATE/ # Bug & feature templates
βββ docs/
β βββ PRD.md # Product Requirements Document
β βββ TECHNICAL.md # Technical Design Document
β βββ STATUS.md # Progress tracking (AI context restore)
β βββ CHECKLISTS.md # All development checklists
β βββ QUICK-REFERENCE.md # Keyboard shortcuts & commands
β βββ TROUBLESHOOTING.md # Common issues & solutions
β βββ GLOBAL-USER-RULES.md # Copy to Cursor Settings
β βββ SETUP-GUIDE.md # New project setup guide
β βββ templates/ # Blank templates to copy
β βββ playbook/ # AI prompts for common tasks
β βββ decisions/ # Architecture Decision Records
βββ scripts/
β βββ setup.sh # Interactive project setup
βββ src/
β βββ app/ # Next.js App Router
βββ convex/ # Convex schema & functions
βββ BUGBOT.md # Custom rules for Bugbot reviews
βββ .env.local # Environment variables
βββ package.json
# After cloning or using the template
cd my-new-project
chmod +x scripts/setup.sh
./scripts/setup.shThe script will:
- Update project name in files
- Create
.env.localfrom template - Optionally install dependencies
- Optionally initialize Convex
- Open service dashboards
git clone https://github.com/YOUR_USERNAME/cursor-framework.git my-new-project
cd my-new-project
rm -rf .git
git initnpm installClerk (Authentication):
- Go to clerk.com β Create application
- Copy your keys to
.env.local:NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_...
Convex (Database):
- Run
npx convex devβ Follow prompts to create project - Keys are auto-configured
Vercel (Deployment):
- Push to GitHub
- Import to Vercel β Add environment variables
npm run dev # Start Next.js
npx convex dev # Start Convex (in separate terminal)Before writing ANY code, do this in Claude/Cursor Chat:
I want to build [FEATURE]. Before we code anything:
1. Read my PRD at @docs/PRD.md
2. Read my technical spec at @docs/TECHNICAL.md
3. Create a step-by-step implementation plan using vertical slices
4. Show me the plan before we start coding
For each feature:
- Plan Mode: Ask AI to outline what it will do
- Review: You approve or adjust the plan
- Act Mode: AI implements the approved step
- Verify: Test that step works
- Update STATUS.md: Track progress
- Repeat: Move to next step
When Cursor loses context (it will!), run this prompt:
@docs/STATUS.md @docs/PRD.md @docs/TECHNICAL.md
Let's continue where we left off. What was our last completed task
and what's the next step?
Before merging any PR:
- Bugbot runs automatically (if configured)
- Review its findings
- Click "Fix in Cursor" for quick fixes
Copy docs/templates/PRD-TEMPLATE.md to docs/PRD.md and fill it out.
Pro tip: Use this prompt to help generate it:
I want to build [APP IDEA]. Help me create a comprehensive PRD.
Ask me clarifying questions about:
- Target users
- Core features (MVP only)
- User journeys
- Success metrics
Then generate the PRD following the template at @docs/templates/PRD-TEMPLATE.md
After the PRD is done:
Based on @docs/PRD.md, create a technical design document.
Consider:
- Our stack: Next.js 14, Convex, Clerk, Tailwind
- File structure and component breakdown
- Database schema
- API contracts
- Authentication flows
Follow the template at @docs/templates/TECHNICAL-TEMPLATE.md
File: .cursor/rules/global.mdc
These are your baseline coding standards that apply everywhere.
These activate when you're working on matching files:
| Rule | Triggers When |
|---|---|
nextjs.mdc |
Editing src/app/**/*.tsx |
convex.mdc |
Editing convex/**/*.ts |
components.mdc |
Editing src/components/**/* |
- Create a new
.mdcfile in.cursor/rules/ - Add the frontmatter:
--- description: When to use this rule globs: - "src/path/**/*.ts" alwaysApply: false ---
- Write your instructions in markdown below
To enable Ref.tools for documentation access:
- Open Cursor Settings β MCP
- Add this server:
{ "mcpServers": { "ref-tools": { "command": "npx", "args": ["-y", "@anthropic/ref-tools-mcp"] } } }
Now Claude can search documentation for Convex, Next.js, Clerk, etc. without hallucinating!
Edit BUGBOT.md to teach Bugbot your team's rules:
# Bugbot Rules
## Security
- Never commit API keys or secrets
- Always validate user input
## Convex Specific
- All mutations must check authentication
- Use `ctx.auth.getUserIdentity()` for auth checks
## TypeScript
- No `any` types without explicit justification
- Prefer `unknown` over `any`I want to add [FEATURE] to my app.
First, update @docs/STATUS.md with a new task.
Then, create a mini-PRD for this feature.
Finally, give me a step-by-step implementation plan.
I'm getting this error: [ERROR]
1. Search the relevant docs using Ref
2. Check @docs/TECHNICAL.md for our patterns
3. Propose a fix with explanation
Review this code for:
- Security issues
- Performance problems
- Adherence to our patterns in @.cursor/rules/
- TypeScript best practices
I want to refactor [COMPONENT/FUNCTION].
1. First, explain what it currently does
2. Propose improvements
3. Show me the plan before making changes
If you're new to this stack:
- Next.js: nextjs.org/learn
- Convex: docs.convex.dev
- Clerk: clerk.com/docs
- Cursor: cursor.com/docs
- Ray Fernando's Videos: youtube.com/@RayFernando1337
β Use the context recovery prompt with STATUS.md
β Make sure Ref.tools MCP is configured β Tell Claude: "Search the Convex docs for [topic] before answering"
β Check GitHub app is installed β Verify BUGBOT.md exists in repo root
β Run npx convex dev to regenerate types
β Restart TypeScript server (Cmd+Shift+P β "Restart TS Server")
For more solutions, see docs/TROUBLESHOOTING.md
The framework includes comprehensive checklists in docs/CHECKLISTS.md:
- β Pre-Launch Checklist β Everything before going live
- β Code Review Checklist β Self-review before PRs
- β Pull Request Checklist β Before merging
- β Security Checklist β Periodic security review
- β Mobile Testing Checklist β Responsive design
- β Performance Checklist β Speed optimization
Track why you made technical decisions in docs/decisions/:
# Copy template
cp docs/decisions/000-template.md docs/decisions/002-my-decision.md
# Fill it out and commit with your codeThis helps future-you (and others) understand the reasoning behind choices.
MIT β Use freely for your projects!
Built with β€οΈ using the Ray Fernando methodology