The prompt.md (for Amp) and CLAUDE.md (for Claude Code) files contain the instructions given to each fresh AI instance. Customizing these for your project is critical for success.
# If you copied Ralph to your projectscripts/ralph/prompt.md # For Ampscripts/ralph/CLAUDE.md # For Claude Code# Or in your global config~/.config/amp/skills/ralph/prompt.md~/.claude/skills/ralph/CLAUDE.md
Update section 6 to match your project’s checksDefault:
6. Run quality checks (e.g., typecheck, lint, test - use whatever your project requires)
Customized for Next.js:
6. Run quality checks in this order: - `npm run typecheck` - Must pass with zero errors - `npm run lint` - Must pass or auto-fix - `npm test -- --passWithNoTests` - Run relevant tests
Customized for Python:
6. Run quality checks in this order: - `mypy .` - Type checking must pass - `ruff check .` - Linting must pass - `pytest tests/` - All tests must pass
2
Project conventions
Add a section for codebase-specific patterns
## Project Conventions- All database queries use the `db.query()` pattern, never raw SQL- UI components go in `src/components/` with co-located styles- Server actions must be in files named `actions.ts`- Always export TypeScript types from action files for UI imports- Use `sql<number>` template tags for aggregation queries
3
Common gotchas
Document things that AI (and humans) commonly get wrong
## Common Gotchas- Always use `IF NOT EXISTS` in migrations - we run them in dev and prod- When adding a new API route, update `src/lib/api-routes.ts` registry- The settings panel is in `app/settings/components/SettingsPanel.tsx`- Environment variables must be added to both `.env.example` and Vercel- Use `revalidatePath()` after mutations to refresh Server Components
4
File structure updates
Tell Ralph where to update AGENTS.md or CLAUDE.md filesFor Amp users (using AGENTS.md):
## Update AGENTS.md FilesBefore committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:1. **Identify directories with edited files** - Look at which directories you modified2. **Check for existing AGENTS.md** - Look in those directories or parent directories3. **Add valuable learnings** - Document patterns, gotchas, and conventionsKey AGENTS.md locations:- `src/app/AGENTS.md` - Frontend patterns- `src/lib/AGENTS.md` - Shared utilities- `src/server/AGENTS.md` - Backend patterns
For Claude Code users (using CLAUDE.md):
## Update CLAUDE.md FilesBefore committing, check if any edited files have learnings worth preserving in nearby CLAUDE.md files.Key CLAUDE.md locations:- `src/app/CLAUDE.md` - Frontend patterns- `src/lib/CLAUDE.md` - Shared utilities - `src/server/CLAUDE.md` - Backend patterns
Here’s a customized prompt for a Next.js + PostgreSQL project:
View full customized prompt.md
# Ralph Agent InstructionsYou are an autonomous coding agent working on a Next.js 14 app with PostgreSQL.## Your Task1. Read the PRD at `prd.json`2. Read the progress log at `progress.txt` (check Codebase Patterns section first)3. Check you're on the correct branch from PRD `branchName`4. Pick the **highest priority** user story where `passes: false`5. Implement that single user story6. Run quality checks: - `npm run typecheck` - Must pass with zero errors - `npm run lint` - Must pass (auto-fix if possible) - `npm test -- --passWithNoTests` - Run tests for changed files7. Update AGENTS.md files if you discover reusable patterns8. If checks pass, commit ALL changes: `feat: [Story ID] - [Story Title]`9. Update the PRD to set `passes: true` for the completed story10. Append your progress to `progress.txt`## Project Conventions- **Database**: Use Drizzle ORM, never raw SQL. Queries go in `src/db/queries/`- **Server Actions**: Must be in `actions.ts` files with `"use server"` directive- **Components**: - Client components: `"use client"` at top - Server components: default, no directive - Shared UI: `src/components/ui/` (shadcn)- **Styling**: Tailwind utility classes, no custom CSS- **Types**: Export from `actions.ts` for UI components to import## Common Gotchas- Migrations need `IF NOT EXISTS` - we run them multiple times- After mutations, call `revalidatePath("/path")` to refresh UI- The dev server must be running on PORT 3000 for browser tests- Never commit `.env` - add new vars to `.env.example` only- Settings panel is at `app/settings/components/SettingsPanel.tsx`## Quality Requirements- Typecheck must pass with **zero** errors- Keep changes minimal and focused- Follow existing patterns in nearby files- Do NOT commit broken code## Browser Testing (Required for UI Stories)For any story that changes UI:1. Load the `dev-browser` skill2. Navigate to the page (usually http://localhost:3000/...)3. Verify the changes work4. Take a screenshot for the progress log## Progress Report FormatAPPEND to progress.txt: