Skip to content

Customizing Prompts

Ralph uses a built-in-first architecture: all prompts, roles, and methodology content live in ralph’s package code and are used directly at runtime. They are never copied into your project. When you upgrade ralph, you automatically get the latest prompts.

To customize ralph’s behavior, you create optional extension files in docs/prompts/. These files contain only your additions — they are appended to the built-in content, not replacements for it. If no extension files exist, ralph works with zero configuration.

FileExtendsPurpose
docs/prompts/system.mdBuilt-in system promptAdditional system-level instructions
docs/prompts/boot.mdBuilt-in boot promptAdditional boot-level content
docs/prompts/methodology.mdBuilt-in methodologyAdditional methodology guidance
docs/prompts/roles.mdBuilt-in role definitionsRole overrides, additions, and disables
docs/prompts/rules.md(standalone)Project-specific rules — the one file ralph init creates

Extension content is appended after the corresponding built-in content, separated by a --- Project Extensions --- marker. Your extensions are never overwritten by any ralph command.

Located at docs/prompts/rules.md, this file contains project-specific constraints that apply to every task:

- All code goes under `src/myapp/`
- Tests go in `__tests__/` directories
- Use kebab-case for file names
- Do not use library X — we had issues with it in production
- All API endpoints must validate input with zod

Rules are injected as {{project.rules}} in the boot prompt. This is the only prompt-related file that ralph init creates — edit it to add conventions, restrictions, or guidance specific to your project.

Use This FileFor This Purpose
rules.mdProject-specific conventions and constraints
system.mdAdditional system-level methodology instructions
boot.mdAdditional task-level guidance or context
methodology.mdMethodology adjustments or additions
roles.mdRole overrides, additions, or disables

Rules are for “what” constraints (file naming, library restrictions). Extension files are for “how” methodology (TDD adjustments, role customization, additional instructions).

Create docs/prompts/system.md:

When writing TypeScript, always use explicit return types on exported functions.
All monetary values must use integer cents, never floating-point dollars.

This content is appended after ralph’s built-in system prompt. Run ralph show system-prompt to see the merged result.

Create docs/prompts/roles.md:

## Override: SDET
In this project, the SDET focuses on integration testing with real database connections.
All tests must hit the actual PostgreSQL instance, not mocks.

Run ralph show roles to verify the override is applied — the SDET role will show [overridden].

Add to docs/prompts/roles.md:

## Add: Compliance Officer
- **Focus**: Regulatory compliance
- **Responsibility**: Reviews all data handling for GDPR/HIPAA compliance. Validates that PII is encrypted at rest and in transit. Checks audit logging for sensitive operations.
- **Participates**: Boot, Verify

The new role appears alongside the 9 built-in roles. Run ralph show roles to confirm.

Add to docs/prompts/roles.md:

## Disable: UX/UI Designer
This is a headless API project with no user-facing surface.

Extension files support the same {{variable}} syntax as built-in templates:

This project uses {{config.language}} with {{config.packageManager}}.
The quality check command is `{{config.qualityCheck}}`.

See the Prompts page for the full variable reference.

Use ralph show to inspect the merged result of built-in content plus your extensions:

Terminal window
ralph show system-prompt # Effective system prompt
ralph show boot-prompt # Effective boot prompt template
ralph show roles # Active roles with source annotations
ralph show methodology # Effective methodology
ralph show rules # Project rules
ralph show task T-042 # What the agent receives for a specific task

Use --built-in-only to see just ralph’s built-in content without your extensions, which is useful for understanding what you’re extending.