mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
2.4 KiB
2.4 KiB
Feature Design Guidance
Guidance for writing feature design docs. Think of these as proto-user-facing docs — the API surface spec plus the state/store context needed for implementation.
When to Use
- New internal APIs or store features
- Architectural decisions in your area
- Design patterns you're introducing
- Extensibility mechanisms
Templates
| Template | Use For |
|---|---|
templates/feature-single.md |
Straightforward designs with one concept |
templates/feature-multi.md |
Designs that benefit from a separate file for debated decisions |
Structure
Single-file: Problem → Solution → Quick Start → API Surface → State & Store → Behavior → Open Questions
Multi-file:
index.md— Problem, API surface, state requirements, behaviordecisions.md— Only when decisions are raised and debated
No separate implementation log — temporary mechanics go in .agents/plans/. Keep minimal contract examples in the main record.
State & Store
Every feature design should document its store integration:
- What slice/feature does it define? What's the state shape?
- What selectors or derived state does it expose?
- What requests/actions does it handle?
- Dependencies on other features/slices?
- Any side effects on connect/disconnect?
Tips
- Start with the problem — Why does this feature exist?
- API surface is the core — What does the consumer interact with?
- State shape is critical — Document what state this introduces
- Keep examples in the doc — No separate examples file needed
- Decisions only when debated — Don't scaffold
decisions.mdupfront; add it when real trade-offs are discussed - Let code talk — Implementation details live in the code, not the design doc
Prior Art
Research prior art before drafting:
- HTMLMediaElement spec — What the native platform provides. Start here for any media-related feature.
- Player libraries (Media Chrome, Vidstack, Video.js v8, Plyr) — Not for API patterns, but for edge cases, feature requirements, platform quirks, and context about the problem space. How did they solve this? What edge cases did they hit?
See existing Design Docs in internal/design/ for examples of good prior art research (e.g., ui/controls-design.md, ui/playback-rate-button.md).