# Task Spec Template

**Task ID:** [auto-generated]
**PRD:** [link to task-XXX-prd.md]
**Created:** [date]

## Architecture Plan

Where this feature plugs into the repo, which layers it touches, expected file paths:

### Files to Create/Modify:

- `src/[path/to/file1.js]` - [purpose]
- `src/[path/to/file2.js]` - [purpose]
- `tests/[path/to/test.js]` - [purpose]

### Integration Points:

- [Existing module/service it connects to]
- [Database schema changes needed]
- [API endpoints affected]

## Constraints

### Naming Conventions:

- Functions: [pattern, e.g., camelCase]
- Files: [pattern, e.g., kebab-case]
- Variables: [pattern, e.g., descriptive names]

### Framework Requirements:

- Must use: [required libraries/patterns]
- Must NOT use: [forbidden libraries/patterns]
- Must follow: [specific patterns, e.g., controllers → services → repository]

### Code Style:

- [Linting rules to follow]
- [Testing patterns required]
- [Documentation requirements]

## Edge Cases

Every scenario I know devs forget when in a rush:

- [Edge case 1: what happens when X fails]
- [Edge case 2: handling of invalid input Y]
- [Edge case 3: performance under load Z]
- [Edge case 4: error recovery scenarios]
- [Edge case 5: security considerations]

## Testing Notes

Expected inputs/outputs, how to validate behavior, what logs/errors should look like:

### Test Cases:

- [Test case 1: normal flow]
- [Test case 2: error conditions]
- [Test case 3: edge cases]

### Validation:

- [How to verify it works correctly]
- [Expected logs/messages]
- [Performance benchmarks]

### Rollback Plan:

- [How to undo changes if something goes wrong]
