AI-Assisted Development: How We Built SET Game Together

A TLDR Guide to Human-AI Collaboration with Cursor Rules

๐ŸŽฏ The Big Idea (30 Seconds)

Traditional coding: You write everything yourself, manually test, fix bugs later.

Our method:

  1. โœ… Write 14 cursor rules files that teach AI your project context
  2. โœ… AI writes tests FIRST (TDD mandatory)
  3. โœ… AI implements features following your rules
  4. โœ… You review & guide, AI executes

Result: 4-5ร— faster development, 94% test coverage, consistent code quality.

๐Ÿ“ The Cursor Rules Method

What Are Cursor Rules?

Project-specific instruction files that teach Cursor AI about your:

  • Architecture decisions
  • Coding standards
  • Testing requirements
  • Domain knowledge
  • Workflow expectations

Our 14 Rules Files

.cursorrules-*
โ”œโ”€โ”€ ๐Ÿงช Methodology
โ”‚   โ”œโ”€โ”€ tdd                  # Test-first mandatory
โ”‚   โ”œโ”€โ”€ testing              # Coverage targets
โ”‚   โ””โ”€โ”€ local-execution      # How to run/test
โ”‚
โ”œโ”€โ”€ ๐Ÿ—๏ธ Architecture
โ”‚   โ”œโ”€โ”€ architecture         # System design
โ”‚   โ”œโ”€โ”€ frontend            # React patterns
โ”‚   โ”œโ”€โ”€ backend             # Node.js patterns
โ”‚   โ”œโ”€โ”€ realtime            # WebSocket sync
โ”‚   โ””โ”€โ”€ design-system       # UI standards
โ”‚
โ”œโ”€โ”€ ๐ŸŽฎ Domain
โ”‚   โ”œโ”€โ”€ game-logic          # SET rules
โ”‚   โ”œโ”€โ”€ mobile-ui           # Mobile-first
โ”‚   โ””โ”€โ”€ product             # Requirements
โ”‚
โ””โ”€โ”€ ๐Ÿ”’ Infrastructure
    โ”œโ”€โ”€ security            # Auth patterns
    โ”œโ”€โ”€ deployment          # CI/CD
    โ””โ”€โ”€ pwa                 # Progressive web app

Example Rule: TDD

# .cursorrules-tdd

## Core Directive
All business logic MUST use Test-Driven Development.

## Workflow for Cursor AI
1. Write failing test first
2. Confirm it fails (Red)
3. Write minimal implementation
4. Confirm it passes (Green)
5. Refactor if needed

Why this works: AI follows the same patterns every time, no shortcuts.

๐Ÿ”„ The TDD Workflow

Traditional Way (Without AI)

Developer writes test โ†’ Developer implements โ†’ Developer refactors
โฑ๏ธ Time: 30-60 minutes per feature

Our Way (With AI + Cursor Rules)

Developer: "Add hint button that checks if SET exists"
    โ†“
AI: Writes test first
    โ†“
Developer: Reviews test
    โ†“
AI: Implements feature
    โ†“
Test passes โœ…
โฑ๏ธ Time: 5-15 minutes per feature

Real Example

Developer Request:

"Refill cards TO 12 after SET found, not BY 3"

AI Response (follows .cursorrules-tdd):

// Step 1: AI writes test FIRST
it('refills TO 12 cards after SET found', () => {
  room.board.length = 15; // Start with 15
  gameService.submitSet(gameCode, playerId, validSet);
  expect(room.board.length).toBe(12); // Should be 12, not 18
});

// Step 2: Test fails โŒ (good!)

// Step 3: AI implements
submitSet(gameCode, playerId, cardIds) {
  room.board = room.board.filter(c => !cardIds.includes(c.id));
  
  // Refill TO 12, not BY 3
  while (room.board.length < 12 && room.deck.length > 0) {
    room.board.push(room.deck.shift());
  }
}

// Step 4: Test passes โœ…

๐Ÿ’ฌ How We Communicate

โŒ Bad Prompts

"Add authentication"
"Make it mobile responsive"
"Fix the bug"

โœ… Good Prompts

"Implement session auth following .cursorrules-security:
- JWT in HTTP-only cookies
- No passwords, just name + avatar
Write tests first."

"The card grid overflows on iPhone SE (375px).
Use .cursorrules-mobile-ui responsive rules."

"Players disconnect on iOS tab switch.
Check .cursorrules-realtime for reconnection pattern."

Key: Reference specific cursor rules files so AI knows which context to use.

๐Ÿ“Š Real Results

Speed Comparison

Feature Traditional With AI Speedup
SET validation logic 4 hours 45 min 5.3ร—
WebSocket reconnect 6 hours 1.5 hours 4ร—
Mobile responsive grid 8 hours 2 hours 4ร—
Complete feature 2-3 days 4-6 hours 4-6ร—

Average: 4-5ร— faster development

Quality Metrics

Before AI:

  • 40-60% test coverage
  • 15-20 bugs/month
  • 3-4 review iterations

With AI + Cursor Rules:

  • 94% test coverage
  • 3-5 bugs/month
  • 1-2 review iterations
  • 100% style consistency

๐ŸŽฏ The 3 Key Principles

1. AI Never Writes Code Without Tests

Enforced by .cursorrules-tdd:

  • Test first = no exceptions
  • Red-Green-Refactor cycle
  • AI can't skip this

Result: Caught bugs before they existed

2. Mobile-First Always

Enforced by .cursorrules-mobile-ui:

  • Design for 375px width (iPhone SE)
  • No scrolling on game board
  • 44ร—44px touch targets minimum

Result: AI never suggested desktop-first solutions

3. Rules Are Project Memory

Problem: New AI chats "forget" previous decisions

Solution: Cursor rules = permanent memory

  • Architecture decisions documented
  • Patterns automatically followed
  • Zero "why did we do this?" moments

๐Ÿš€ Real Development Example

Feature: "Add Card" Button

Day 1 - Traditional Dev (4-6 hours):

  1. Google how to implement
  2. Write implementation
  3. Manually test
  4. Find bugs
  5. Write tests (maybe)
  6. Fix bugs
  7. Code review reveals issues
  8. Fix and repeat

Same Day - With AI (45 minutes):

  1. Developer: "Add button to add 1 card. Block if 15+ cards AND set exists. Follow .cursorrules-game-logic"

  2. AI: Writes test first โœ…

    it('blocks card addition when 15+ cards and SET exists')
    it('allows addition when 15+ cards but NO set')
    
  3. AI: Implements

    if (room.board.length >= 15 && hasValidSet(room.board)) {
      return { success: false, message: "SET exists!" };
    }
    
  4. Tests pass โœ…

  5. AI: Adds WebSocket event, frontend button, updates docs

  6. Done ๐ŸŽ‰

๐ŸŽ“ Lessons Learned

โœ… What Worked Amazingly

  1. Front-loading rules (2-3 days) โ†’ Paid off on every feature
  2. TDD discipline โ†’ AI caught bugs before they existed
  3. Mobile-first constraints โ†’ Zero responsive issues
  4. Separation of concerns โ†’ 14 specialized files > 1 huge file
  5. Domain rules โ†’ AI understood SET game logic perfectly

โš ๏ธ What We'd Improve

  1. Version control rules โ†’ Track rule changes over time
  2. Visual examples โ†’ Some UI concepts need screenshots
  3. Performance budgets โ†’ Add bundle size limits to rules
  4. Test rules earlier โ†’ Some rules initially contradicted

๐Ÿ› Challenges & Solutions

Challenge: AI invented APIs that didn't exist

Solution: Added "Available Libraries" section with exact versions

Challenge: AI over-engineered simple features

Solution: Added "MVP Constraints" and "Out of Scope" sections

Challenge: Long chats lost context

Solution: Break features into smaller chunks, reference rules explicitly

๐Ÿ’ก How to Adopt This

For Your Next Project

Week 1: Create cursor rules (before writing code!)

.cursorrules-architecture    # System design
.cursorrules-tdd            # Testing workflow
.cursorrules-style          # Coding standards

Week 2+: Develop with AI

  1. Describe feature in natural language
  2. AI writes test first
  3. You review
  4. AI implements
  5. Repeat

ROI: ~1,400% in first month

  • 2-3 days creating rules = $2,400
  • Saves 2+ months development = $32,000+

Starter Template

# .cursorrules-tdd

## Core Rules
- [ ] All logic requires tests first
- [ ] Red-Green-Refactor cycle mandatory
- [ ] No shortcuts allowed

## Workflow
1. Describe feature
2. AI writes failing test
3. Confirm test fails
4. AI implements
5. Confirm test passes

๐ŸŽฏ Key Takeaways

For Solo Developers

๐Ÿš€ 4-5ร— faster development
๐Ÿงช Much higher test coverage
๐Ÿ“š Built-in documentation
๐ŸŽฏ Consistent code quality

For Teams

๐Ÿ“ Same patterns across all devs
๐ŸŽ“ Instant onboarding (read rules + ask AI)
๐Ÿ” Automatic code review (AI enforces rules)
๐Ÿ’ฌ Living docs (rules evolve with code)

The Future

๐Ÿค– AI implements, human architects
๐Ÿ“ Tests written automatically
๐ŸŽจ Focus on product, not syntax
โšก Ship faster without sacrificing quality

๐Ÿ“ˆ By The Numbers

Our SET Game Project:

  • โฑ๏ธ 1 month to MVP (vs. 3-4 typical)
  • ๐Ÿ“ 12,000 lines of code
  • ๐Ÿงช 94% test coverage
  • ๐Ÿ› 3-5 bugs/month (vs. 18-25)
  • ๐Ÿ“ 14 cursor rules files
  • โšก 4-5ร— faster than traditional

Investment:

  • 3 days writing rules
  • $20/month Cursor Pro

Returns:

  • Saved 2+ months
  • Higher quality code
  • Easier maintenance
  • Better team velocity

๐ŸŽฌ Summary: The Method

1. ๐Ÿ“ Write cursor rules FIRST
   โ†“
2. ๐Ÿงช Enforce TDD via rules
   โ†“
3. ๐Ÿค– Use AI as pair programmer
   โ†“
4. ๐Ÿ‘จโ€๐Ÿ’ป You architect, AI implements
   โ†“
5. โœ… Review & iterate
   โ†“
6. ๐Ÿš€ Ship faster & better

The Secret Sauce

Structure + AI = Superpowers

Invest in rules upfront, reap rewards forever.

๐Ÿ™ Questions?

Want to learn more?

  • Full presentation: PRESENTATION.md
  • All cursor rules: /docs/.cursorrules-*
  • Code: [GitHub repo]

Topics we can discuss:

  • How to write cursor rules for your domain?
  • Handling AI limitations?
  • Cost-benefit for your use case?
  • TDD workflow in detail?

๐ŸŽ‰ Final Thought

The future of development isn't:

  • โŒ AI replacing developers
  • โŒ Developers working alone

It's:

  • โœ… Structured Human-AI collaboration
  • โœ… Humans guide, AI executes
  • โœ… Quality goes up, time goes down

You can do this too. Start with 3 cursor rules files and grow from there.

Built with ๐Ÿง  human creativity + ๐Ÿค– AI implementation + ๐Ÿ“ structured methodology

Thank you! ๐Ÿš€