npx skills add https://github.com/adaptationio/skrillz --skill ralph-prompt-single-taskSKILL.md
Ralph Prompt Generator: Single Task
Overview
Generates well-structured prompts optimized for the Ralph Wiggum technique for single, focused tasks. These prompts include clear completion criteria, automatic verification (tests), self-correction loops, and proper <promise> completion tags.
Best For:
- Bug fixes with clear success criteria
- Single feature implementations
- Refactoring tasks
- Adding tests for existing code
- Documentation for specific modules
- Performance optimizations with measurable targets
Ralph Philosophy: This generator embraces the principle that failures are deterministic and fixable. Each iteration learns from the previous one. Don't fear failures—they're expected and provide data for improvement through prompt tuning.
Quick Start
Input Required:
- Task description (what needs to be done)
- Success criteria (how to verify completion)
- Completion promise text (the phrase that signals done)
Generate prompt with:
Generate a Ralph prompt for: [task description]
Success criteria: [how to verify]
Promise: [completion phrase]
Prompt Generation Workflow
Step 1: Analyze the Task
Identify these elements:
- Action: What specific work needs to be done?
- Scope: What files/modules are affected?
- Verification: How can success be automatically verified?
- Edge cases: What could go wrong?
Step 2: Define Completion Criteria
Good completion criteria are:
- Measurable (tests pass, no errors, specific output)
- Verifiable automatically (not subjective)
- Binary (clearly done or not done)
Examples:
| Task Type | Good Criteria | Bad Criteria |
|---|---|---|
| Bug fix | "Tests pass, bug no longer reproducible" | "Bug is fixed" |
| Feature | "All CRUD endpoints return 200, tests pass" | "Feature works" |
| Refactor | "All tests pass, code uses new pattern" | "Code is cleaner" |
Step 3: Structure the Prompt
Use this template:
# Task: [Clear Task Title]
## Objective
[1-2 sentence clear description of what needs to be accomplished]
## Context
[Brief background - what exists, why this is needed]
## Requirements
1. [Specific requirement 1]
2. [Specific requirement 2]
3. [Specific requirement 3]
## Success Criteria
- [ ] [Measurable criterion 1]
- [ ] [Measurable criterion 2]
- [ ] [Measurable criterion 3]
## Verification Steps
1. [How to verify criterion 1]
2. [How to verify criterion 2]
3. [How to verify criterion 3]
## TDD Approach
1. Write/identify failing tests for the requirement
2. Implement the solution
3. Run tests: `[test command]`
4. If tests fail, analyze output and fix
5. Repeat until all tests pass
## Completion
When ALL of the following are true:
- All success criteria met (checklist above)
- All tests passing
- No regressions introduced
Output: <promise>[COMPLETION_PHRASE]</promise>
## If Stuck
After multiple iterations without progress:
- Document what's blocking progress
- List approaches attempted
- Identify specific error or issue
- Do NOT output false promise - continue iterating or wait for max-iterations
Step 4: Add Verification Commands
Include specific commands to verify success:
## Verification Commands
```bash
# Run tests
npm test
# or
pytest tests/
# Check for errors
npm run lint
# or
ruff check .
# Verify specific functionality
curl -X GET http://localhost:3000/api/endpoint
## Example Prompts
### Example 1: Bug Fix
**Input:**
- Task: Fix authentication token refresh race condition
- Verification: Auth tests pass, no 401 errors in logs
- Promise: AUTH_FIX_COMPLETE
**Generated Prompt:**
```markdown
# Task: Fix Authentication Token Refresh Race Condition
## Objective
Fix the race condition in token refresh that causes intermittent 401 errors when multiple requests trigger refresh simultaneously.
## Context
The auth module in `src/auth/` handles JWT token refresh. When a token expires, multiple concurrent requests may all attempt to refresh, causing a race condition where some requests fail with 401.
## Requirements
1. Implement token refresh locking/queuing mechanism
2. Ensure concurrent requests wait for single refresh
3. Maintain backward compatibility with existing auth flow
4. Add tests covering concurrent refresh scenario
## Success Criteria
- [ ] All existing auth tests pass
- [ ] New concurrent refresh test passes
- [ ] No 401 errors in integration test logs
- [ ] Token refresh happens only once per expiration
## Verification Steps
1. Run auth tests: `npm test -- --grep "auth"`
2. Run concurrent refresh test: `npm test -- --grep "concurrent"`
3. Check logs for 401 after integration test
4. Verify single refresh in logs during concurrent requests
## TDD Approach
1. Write test for concurrent token refresh scenario
2. Verify test fails with current implementation
3. Implement locking mechanism
4. Run tests: `npm test`
5. If tests fail, analyze and fix
6. Repeat until all pass
## Completion
When A
...
Repository
adaptationio/skrillzParent repository
Repository Stats
Stars1
Forks0