First-Task Prompt Templates

Ralph Workflow lands coding-agent work directly on main, automatically, with no pull requests. It is a free and open-source CLI that runs the coding agent you already use, on your own machine.

PROMPT.md is the spec. With no pull request afterwards, the spec is where you decide what is acceptable: what done means and how to check it, written before any code exists. These templates give you a starting shape.

Today the push runs without checks. Your agent is asked to run the checks in your spec, but nothing enforces them, and your CI runs after the push. The gate that will run your suite on the exact commit before every push has not shipped yet. Write checks you can also run yourself after the run.

How to use these templates

  1. Pick the template closest to your real task.

  2. Replace the placeholders with details from your repository.

  3. Name the test command that proves the work, if the template does not already.

  4. Keep the scope narrow enough that you can check the result in one sitting.

  5. Run ralph, then check what landed on main against the spec. If it is wrong, git revert it.

The same five templates ship with Ralph Workflow. In a repository with no PROMPT.md yet, ralph --init <name> writes one of them for you. The names are feature-spec, guardrail (or bug-fix), refactor, test-coverage and docs. The file starts with a starter marker comment: delete it once you have filled in the template, because Ralph Workflow refuses to run while it is there.

If you are not sure your task is a good fit, read Choose Your First Ralph Workflow Task first.

Template 1: Small feature slice

ralph --init feature-spec. Use this when you want to add one focused behavior to an existing app.

# Goal

Add <feature> to <surface>. Keep the rest of the flow unchanged.

## Acceptance criteria

- <user action> now produces <expected result>
- Existing behavior for <adjacent flow> stays unchanged
- Tests cover the new behavior
- Documentation or help text is updated if user-visible behavior changed

Good fits:

  • add a /health endpoint

  • add an empty-state UI for a list page

  • add a CLI flag with clear output

Template 2: Validation or guardrail

ralph --init guardrail. Use this when the task is preventing bad input or unsafe behavior.

# Goal

Reject or block <invalid input / unsafe action> before <bad outcome> happens.
Keep the normal success path unchanged.

## Acceptance criteria

- <invalid input> fails with a clear error or message
- <bad side effect> does not happen for invalid input
- Existing valid behavior stays unchanged
- Tests cover the new validation or guardrail

Good fits:

  • reject empty project names

  • block invalid config values

  • stop destructive commands unless a flag is present

Template 3: Bounded refactor with tests

ralph --init refactor. Use this when the code already works and has tests, and needs cleanup you can check.

# Goal

Refactor <module / component / command> to improve <maintainability / duplication / structure>
without changing external behavior.

## Acceptance criteria

- Behavior stays the same for existing supported inputs
- The targeted duplication or structural problem is reduced
- Existing tests still pass
- New or updated tests cover the area if needed to lock behavior in place

Good fits:

  • extract repeated parsing logic

  • split a large function into smaller helpers

  • simplify conditionals in one module

Template 4: Test coverage pass

ralph --init test-coverage. Use this when you want stronger tests around code that already exists.

# Goal

Add or improve automated tests for <feature / module / workflow>.
Do not change production behavior unless a small testability fix is required.

## Acceptance criteria

- Tests cover the key success path for <feature>
- Tests cover at least one important failure or edge case
- Production changes stay minimal and scoped to testability if needed
- The relevant test command passes

Good fits:

  • add tests around a CLI command

  • cover a serialization edge case

  • add regression coverage for a fixed bug

This is also a useful first task for later: once the gate ships, it will run your suite before every push, so a stronger suite is what will stand between a bad commit and main.

Template 5: Docs or onboarding improvement

ralph --init docs. Use this when the task is making the project easier for people to understand or use.

# Goal

Improve <doc / README / onboarding page> so a new user can complete <specific outcome>
without guessing.

## Acceptance criteria

- The doc clearly explains <specific concept or setup path>
- Steps are ordered and runnable
- Ambiguous wording or missing prerequisites are removed
- The updated doc matches current behavior in the codebase

Good fits:

  • improve install docs

  • add a troubleshooting section

  • clarify configuration steps for first-time users

Keep the first run honest

A strong first Ralph Workflow task is:

  • real enough to matter

  • narrow enough to check quickly

  • easy to verify with checks you can run yourself

  • cheap to git revert if it misses

A weak first task is:

  • vague product exploration

  • risky production changes

  • a broad migration with no clear stopping point

  • anything where nobody agrees what done means

Next step