---
name: feature-definition
description: Enforce feature right-sizing principle with LLM validation and human override
status: done
parts:
- CLAUDE.md
estimate:
  optimistic: 1 hour
  normal: 2 hours
  pessimistic: 3 hours
---

# Implementation Plan

## Task Summary

| ID | Task | Files |
|----|------|-------|
| T1 | Add Feature Right-Sizing section to CLAUDE.md | `CLAUDE.md` |
| T2 | Update plan.md template with sizing guidelines | `CLAUDE.md` |
| T3 | Document LLM validation workflow for save_features | `CLAUDE.md` |

## Tasks

- [ ] **T1**: Add a new top-level section "Feature Right-Sizing Guidelines" in CLAUDE.md that includes:
  - The principle: each feature must be completable in one context window
  - Examples of right-sized features (DB column, single component, one server action)
  - Examples of too-big features with how to split them
  - The 2-3 sentence rule for individual features

- [ ] **T2**: Update the plan.md template in CLAUDE.md to:
  - Include feature sizing guidelines directly (self-contained, works without CLAUDE.md)
  - Add mandatory checklist item "Feature sizes verified (each describable in 2-3 sentences)"
  - Reference the right-sizing principle

- [ ] **T3**: Update the save_features workflow documentation in CLAUDE.md to:
  - Require agent to evaluate each feature's size BEFORE calling save_features
  - Apply the 2-3 sentence rule to each feature
  - BLOCK saving if any feature is too large
  - Document that ONLY human override can proceed with oversized features
  - Agent cannot bypass this check programmatically

## Testing Considerations

- Verify the new section in CLAUDE.md is clear and actionable
- Verify plan.md template is self-contained
- Test workflow: create a task with an oversized feature and confirm agent blocks

## Feature Sizing Guidelines (to be added)

### Right-Sized Features (can describe in 2-3 sentences)
- Add a database column + migration
- Create a single UI component
- Implement one server action
- Add a filter to an existing list
- Write tests for one module

### Too Big (split these)
- "Build the entire dashboard" → Split into: schema, queries, components, filters
- "Add authentication" → Split into: schema, middleware, login UI, session handling
- "Refactor the API" → Split into one task per endpoint

### Rule
If you can't describe the change in 2-3 sentences, it's too big and must be split.

---

## Estimate

**Senior Developer Profile:** 5+ years experience, familiar with the project's tech stack.

| Scenario | Time |
|----------|------|
| Optimistic | 1 hour |
| Normal | 2 hours |
| Pessimistic | 3 hours |

### Assumptions
- Changes are documentation-only (CLAUDE.md)
- No code changes to save_features - validation is LLM-based in workflow
- Agent will follow documented workflow and block on oversized features
