.claude/skills/plan-ralphex/SKILL.md
Create comprehensive implementation plans for features using the ralphex format. Plans include research, documentation, tests, and step-by-step tasks.
npx skillsauth add Aidbox/aidbox-hl7v2-example plan-ralphexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are creating a comprehensive implementation plan for a software feature. The plan will be executed by Claude Code agents via ralphex, so it must be detailed, unambiguous, and self-contained.
Write the plan to: ai/tickets/
Use descriptive filenames: YYYY-MM-DD-feature-name.md (e.g., 2026-01-26-user-authentication.md)
# Plan: [Feature Name]
## Overview
[2-4 sentences describing what will be implemented and why]
## Context
[Information gathered during codebase exploration]
- Files involved: [list key files that will be modified]
- Dependencies: [external libraries, APIs, services needed]
- Related code: [existing patterns to follow or extend]
## Development Approach
- **Testing approach**: TDD - write tests first
- Complete each task fully before moving to the next
- Make small, focused changes
- **CRITICAL: every task MUST include new/updated tests**
- **CRITICAL: all tests must pass before starting next task**
- **CRITICAL: update this plan file when scope changes**
## Validation Commands
- `[test command]`
- `[lint command]`
- `[build command]`
### Task 1: [Task Name]
- [ ] [Specific action item]
- [ ] [Another action item]
- [ ] Write/update tests for this task
- [ ] Run `[validation command]` - must pass before next task
### Task 2: [Task Name]
...
## Technical Details
[Code examples, data structures, API contracts, diagrams]
## Edge Cases and Error Handling
[Document corner cases and how they should be handled]
## Post-Completion Verification
[Manual verification steps after all tasks complete]
Before exploring code, ensure you understand WHAT to build. If the user's request is already clear and specific, skip to Phase 2.
Ask only questions that affect what you'll search for:
Keep it minimal. Don't ask abstract questions - ask only what genuinely blocks your ability to explore effectively. Many questions are better asked in Phase 3 when you have codebase context.
Thoroughly explore the codebase to build context:
Use the Explore agent for comprehensive codebase analysis. This exploration informs what questions to ask.
Before asking questions, briefly summarize your findings to the user:
This gives the user context for your questions.
Now ask questions about HOW to build, grounded in what you discovered:
Use the AskUserQuestion tool. Ask focused questions based on actual findings. Reference specific files, patterns, or constraints you discovered.
Based on exploration and user answers:
Create the plan document with:
### Task 3: Implement user validation middleware
- [ ] Create `src/middleware/validate-user.ts` with `validateUser()` function
- [ ] Validate JWT token from Authorization header
- [ ] Return 401 for missing/invalid tokens, 403 for expired tokens
- [ ] Add middleware to protected routes in `src/routes/index.ts`
- [ ] Write unit tests in `src/middleware/validate-user.test.ts`
- [ ] Write integration test for protected endpoint
- [ ] Run `bun test:all` and `bun run typecheck` - must pass before next task
### Task 3: Add auth
- [ ] Implement authentication
- [ ] Add tests
Each checkbox should be:
Include checkboxes for:
Every task MUST include testing checkboxes:
- [ ] Write unit tests for [specific function/module]
- [ ] Write integration tests for [specific flow]
- [ ] Add test cases for edge cases: [list them]
- [ ] Run `[test command]` - must pass before next task
Test coverage should include:
The final task should always update documentation. Example:
### Task N: [Final] Update documentation
- [ ] Update README.md with new feature description
- [ ] Update CLAUDE.md with new patterns/conventions
- [ ] Add inline documentation for complex functions
- [ ] Update API documentation
Include concrete specifications. Example:
## Technical Details
### Data Types
```typescript
interface UserSession {
userId: string;
token: string;
expiresAt: Date;
permissions: string[];
}
| Method | Path | Request | Response |
|--------|------|---------|----------|
| POST | /api/login | {email, password} | {token, expiresAt} |
| POST | /api/logout | - | {success: true} |
| Code | Meaning | Action | |------|---------|--------| | 401 | Unauthorized | Redirect to login | | 403 | Forbidden | Show access denied |
Explicitly document corner cases. Example:
## Edge Cases and Error Handling
### Authentication Edge Cases
- **Expired token during request**: Return 401, client should refresh
- **Concurrent logout**: Invalidate all sessions, not just current
- **Invalid refresh token**: Clear all tokens, force re-login
### Data Validation Edge Cases
- **Empty string vs null**: Treat empty strings as missing values
- **Unicode in usernames**: Allow, but normalize for comparison
- **Extremely long inputs**: Truncate at 1000 chars with warning
Always include commands that verify correctness:
## Validation Commands
- `bun test:all` # Run all tests
- `bun run typecheck` # Type checking
- `bun run lint` # Linting
- `bun run build` # Verify build succeeds
Before presenting the plan to the user, verify:
development
Create detailed implementation plan from an approved design. Converts design document and prototype placeholders into step-by-step tasks for execution by Claude Code agents.
documentation
Create a design document with prototype placeholders for a feature. Includes agent review loop before user approval. Resumable - can commit and continue later.
documentation
Research a topic to make a comprehensive guide for the user.
tools
Implement a feature or fix a bug following a plan, using iterative work.