This document outlines the collaboration workflow between Claude Code and Cursor agents working on the Rate platform.
- Primary: UI/UX implementation with React/Next.js
- Components: Shadcn/ui, TailwindCSS styling
- Features: User-facing features, responsive design
- Testing: Frontend E2E tests with Playwright
- Primary: Strapi API development
- Database: PostgreSQL schema, migrations
- Services: Business logic, data validation
- Performance: Query optimization, caching
1. Define feature requirements
2. Design API contract in packages/shared-data
3. Create feature branches: feat/<area>-<feature>
4. Assign ownership via CODEOWNERS
Backend (Cursor): Frontend (Claude):
1. Create Strapi content type 1. Create UI structure
2. Implement services/controllers 2. Build components
3. Define API endpoints 3. Integrate with API client
4. Add validation 4. Add error handling
- Owner: Both (Backend leads changes)
- Purpose: API contracts, types, schemas
- Process: Backend defines → Frontend consumes
Example:
// Frontend imports and uses
import { FeatureSchema } from "@repo/shared-data"
// Backend adds new schema
export const FeatureSchema = z.object({
id: z.string(),
name: z.string(),
// ...
})feat/<area>-<short-description>
fix/<area>-<issue-number>
chore/<area>-<task>
Examples:
feat/ui-user-profilefeat/api-authenticationfix/ui-responsive-layout
<type>(<scope>): <subject>
<body>
<footer>
Examples:
feat(ui): add user profile page
fix(api): resolve N+1 query in listings
chore(shared): update Zod schemas
- Create PR using template in
.github/pull_request_template.md - Label appropriately:
area:frontendorarea:backendfeature:<name>breaking:apiif applicable
- Cross-review:
- Claude reviews backend DX/API design
- Cursor reviews frontend performance/patterns
- Merge strategy: Squash and merge
Claude Code: Cursor:
apps/web/src/** apps/strapi/src/api/**
Modules/Extension/** apps/strapi/config/**
Modules/Importer/**
Modules/Validator/**
packages/shared-data/- Discuss schema changes- Root config files - Announce changes in PR
- Documentation - Update collaboratively
// packages/shared-data/CHANGELOG.md
## [1.1.0] - 2025-01-23
### Added
- New UserPreferences schema
### Breaking
- Renamed User.name to User.displayName## Feature: User Authentication
### Backend Complete ✓
- [x] JWT implementation
- [x] Refresh token logic
- [x] Rate limiting
### Frontend TODO
- [ ] Login/Register forms
- [ ] Token management
- [ ] Protected routes# Create feature branch
git checkout -b feat/ui-dashboard
# Run only your area
yarn dev --filter=@repo/web # Claude
yarn dev --filter=@repo/strapi # Cursor
# Test your changes
yarn build --filter=@repo/web
yarn type-check --filter=@repo/strapi
# Sync with main
git fetch origin
git rebase origin/main# Claude's env
DATABASE_URL=postgresql://JOY@localhost/rate_db?schema=claude
# Cursor's env
DATABASE_URL=postgresql://JOY@localhost/rate_db?schema=cursor- Pull latest from main
- Resolve in feature branch
- Test both frontend and backend
- Request review from other agent
- Check
packages/shared-dataversion - Rebuild packages:
yarn build --filter=@repo/shared-data - Restart dev servers
- Regenerate types:
yarn strapi ts:generate-types - Update shared-data exports
- Clear TypeScript cache:
rm -rf node_modules/.cache
- Small PRs: Keep changes focused and reviewable
- Frequent Syncs: Merge main daily to avoid conflicts
- Clear Communication: Use PR descriptions and comments
- Test Integration: Always test frontend with backend
- Document Changes: Update relevant README files
// packages/shared-data/src/schemas/product-review.schema.ts
export const ProductReviewSchema = z.object({
id: z.string(),
productId: z.string(),
rating: z.number().min(1).max(5),
comment: z.string(),
})// apps/strapi/src/api/product-review/
;-content -
types / product -
review / schema.json -
controllers / product -
review.ts -
services / product -
review.ts -
routes / product -
review.ts// apps/web/src/app/(features)/reviews/
;-components / ReviewList.tsx -
components / ReviewForm.tsx -
hooks / useReviews.ts -
page.tsx# Both agents test together
yarn dev
# Create review via UI
# Verify in Strapi admin
# Check API response- Technical issues: Create GitHub issue
- Process questions: Update this document
- Urgent blocks: Comment in PR for quick resolution