This file provides guidance to coding agents like Claude Code (claude.ai/code) when working with code in this repository.
Always commit and push changes after completing a task. Follow these rules:
- After making code changes, always commit with a descriptive message
- Push commits to the current feature branch
- NEVER push directly to
main- always use feature branches and PRs
Branch from main:
git checkout main && git pull origin main && git checkout -b <branch-name>After pushing changes, create a PR against main:
gh pr create --base mainpnpm install # Install dependencies
pnpm dev # Start Trigger.dev dev mode
pnpm run deploy:trigger-prod # Deploy to production- Trigger.dev v4 background task workers
src/tasks/- Trigger.dev task definitionssrc/recoup/- Recoup API client functionssrc/schemas/- Zod schemas for validationsrc/artists/- Artist-related utilitiessrc/socials/- Social media utilitiessrc/polling/- Polling utilities for async operations
- SRP (Single Responsibility Principle): One exported function per file
- DRY (Don't Repeat Yourself): Extract shared logic into reusable utilities
- Use Zod for schema validation
- Use
loggerfrom@trigger.dev/sdk/v3for logging
- TDD (Red-Green-Refactor): Follow test-driven development for all changes
- Red: Write a failing test first that reproduces the bug or describes the new behavior
- Green: Write the minimum code to make the test pass
- Refactor: Clean up while keeping tests green
- When fixing a bug from production logs, write the test case from the exact error message BEFORE writing the fix
- Run tests with
pnpm test(vitest)
- Use v4 SDK:
task(),schemaTask(),schedules.task() - Never use deprecated
client.defineJob triggerAndWait()returnsResultobject - checkresult.okbeforeresult.output- Never wrap
triggerAndWaitorwaitcalls inPromise.all
- Recoup Chat:
https://chat.recoupable.com/api - Recoup API:
https://recoup-api.vercel.app/api