.claude/skills/ticket-plan/SKILL.md
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.
npx skillsauth add Aidbox/aidbox-hl7v2-example ticket-planInstall 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 detailed implementation plan from an approved design document. The plan will be executed by Claude Code agents via ralphex, so it must be detailed, unambiguous, and self-contained.
Before starting, verify that an approved design exists:
ai/tickets/YYYY-MM-DD-feature-name.mdstatus: approvedIf no approved design exists:
No approved design found for this feature.
Run /ticket-design first to create and approve a design, or specify the design file path.
If design exists but not approved:
Design exists but status is '[current-status]', not 'approved'.
Run /ticket-design to continue the design process.
Write the plan inside the existing design document: ai/tickets/YYYY-MM-DD-feature-name.md
Add a new section # Implementation Plan at the end of the design document (after # Context).
Add the following section to the design document:
# Implementation Plan
## Overview
[2-4 sentences describing what will be implemented and why - derived from Problem Statement]
## Development Approach
- Complete each task fully before moving to the next
- Make small, focused changes
- **CRITICAL: all tests must pass before starting next task**
- **CRITICAL: update this plan when scope changes**
## Validation Commands
- `[test command]` - Run tests
- `[typecheck command]` - Type checking
- `[lint command]` - Linting (if applicable)
---
## Task 1: [Task Name]
- [ ] [Specific action item]
- [ ] [Another action item]
- [ ] Write/update tests for this task
- [ ] Run `[validation command]` - must pass before next task
- [ ] Stop and request user feedback before proceeding
---
## Task 2: [Task Name]
...
---
## Task [N-1]: Update documentation
- [ ] Update CLAUDE.md with new patterns/conventions (if applicable)
- [ ] Add inline documentation for complex functions
- [ ] Update API documentation (if applicable)
---
## Task [Final]: Cleanup design artifacts
- [ ] Remove all `DESIGN PROTOTYPE: YYYY-MM-DD-feature-name.md` comments from codebase
- [ ] Delete any empty scaffold files that were replaced
- [ ] Update design document status to `implemented`
- [ ] Verify no prototype markers remain: `grep -r "DESIGN PROTOTYPE: YYYY-MM-DD-feature-name" src/`
- [ ] Run `bun test:all` and `bun run typecheck` - final verification
---
## Post-Completion Verification
1. **Functional test**: [Describe how to manually test the feature]
2. **Edge case test**: [Test a specific edge case manually]
3. **Integration check**: [Verify integration with existing features]
4. **No regressions**: All existing tests pass
5. **Cleanup verified**: No DESIGN PROTOTYPE comments remain
prototype-files frontmatterFor each file with DESIGN PROTOTYPE: <design-file> markers:
Read .claude/code-style.md before planning any file/module structure. The style guide governs:
Every task that creates or restructures files must comply with the code style guide. If the plan calls for a "shared helpers" file, verify each helper belongs together by responsibility — don't create dump files that mix unrelated concerns.
You cannot write a good plan from the design document alone. You must understand the actual code that will be modified or extended.
Use Task agents (subagent_type=Explore) to explore in parallel:
This exploration directly informs task granularity. Without it, you'll write vague tasks that bundle unrelated work.
Convert the design into discrete, ordered tasks.
The #1 rule: each task = one reviewable concern. A task should do ONE thing that a reviewer can evaluate in isolation. If you find yourself writing a task with 3 unrelated bullet points, split it.
Splitting heuristics:
Task sizing target: 3-7 checkboxes per task. If you have 8+, try to look for a split point.
It is normal for large features to have 15-30 tasks. Do not try to compress into fewer tasks. Small, focused tasks are easier to review and easier to implement correctly.
Task ordering principles:
Add # Implementation Plan section to ai/tickets/YYYY-MM-DD-feature-name.md with:
Critically and thoroughly review the plan before presenting to user:
# Implementation PlanChange the design document status to planned.
### Task 5: Implement JWT token validation
- [ ] Create `src/middleware/validate-jwt.ts` with `validateJWT()` function
- [ ] Validate token signature and expiration from Authorization header
- [ ] Return structured error with 401 for missing/invalid, 403 for expired
- [ ] Write unit tests: valid token, expired token, malformed token, missing header
- [ ] Run `bun test:all` and `bun run typecheck` - must pass before next task
- [ ] Stop and request user feedback before proceeding
### Task 6: Wire JWT middleware into protected routes
- [ ] Add `validateJWT` middleware to protected routes in `src/routes/index.ts`
- [ ] Write integration test for protected endpoint (valid token → 200, no token → 401)
- [ ] Run `bun test:all` and `bun run typecheck` - must pass before next task
- [ ] Stop and request user feedback before proceeding
### Task 3: Add auth
- [ ] Implement authentication
- [ ] Add tests
### Task 3: Implement auth middleware, session management, and route protection
- [ ] Create JWT validation function
- [ ] Create session store with Redis
- [ ] Add login/logout endpoints
- [ ] Wire middleware into routes
- [ ] Write 15 unit tests covering all scenarios
- [ ] Write integration 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:
Prototype:
// ═══════════════════════════════════════════════════════════════════════════
// DESIGN PROTOTYPE: 2026-01-28-feature.md
// ═══════════════════════════════════════════════════════════════════════════
//
// export interface UserSession { ... }
// export function createSession(userId: string): UserSession
// export function validateSession(token: string): boolean
Task:
### Task 2: Implement session management module
- [ ] Replace prototype scaffold in `src/session/manager.ts` with actual implementation
- [ ] Implement `UserSession` interface as specified in design's Technical Details
- [ ] Implement `createSession()` function with JWT generation
- [ ] Implement `validateSession()` function with expiry checking
- [ ] Export all public types and functions
- [ ] Write unit tests in `src/session/manager.test.ts`
- [ ] Run `bun test:all` and `bun run typecheck` - must pass before next task
Prototype:
// DESIGN PROTOTYPE: 2026-01-28-feature.md
// Add parameter → mappingType: MappingTypeName = "loinc"
export function generateConceptMapId(sender: SenderContext): string {
Task:
### Task 4: Update generateConceptMapId for multiple mapping types
- [ ] Add `mappingType: MappingTypeName = "loinc"` parameter to `generateConceptMapId()`
- [ ] Import `MappingTypeName` from `src/code-mapping/mapping-types.ts`
- [ ] Use `MAPPING_TYPES[mappingType].conceptMapSuffix` instead of hardcoded `-to-loinc`
- [ ] Update all existing call sites (should work with default parameter)
- [ ] Add unit tests for new parameter with different mapping types
- [ ] Run `bun test:all` and `bun run typecheck` - must pass before next task
Always include commands that verify correctness. Get these from the project's CLAUDE.md or package.json:
## Validation Commands
- `bun test:all` - Run all tests
- `bun run typecheck` - Type checking
- `bun run lint` - Linting (if applicable)
- `bun run build` - Verify build succeeds (if applicable)
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.
development
Create comprehensive implementation plans for features using the ralphex format. Plans include research, documentation, tests, and step-by-step tasks.
tools
Implement a feature or fix a bug following a plan, using iterative work.