Init Pattern Selection
Status: ✅ Complete · Priority: High · Created: 2025-11-03 · Tags: ux, init, v0.2.0
Let users choose folder pattern during
lean-spec init
Overview
Currently when running lean-spec init, users can only choose a template (minimal/standard/enterprise). The folder pattern is set by the template and users must manually edit .lean-spec/config.json to change it.
Issue: No way to choose folder pattern during initialization.
Solution: Add pattern selection step to init wizard.
Design
Enhance the lean-spec init wizard to offer pattern choices:
Current flow:
- Choose template (minimal/standard/enterprise)
- Confirm → Done
New flow:
- Choose template (minimal/standard/enterprise)
- Choose folder pattern:
{YYYYMMDD}/{NNN}-{name}/(Date-grouped - recommended for teams){YYYYMMDD}-{NNN}-{name}/(Flat with date prefix){NNN}-{name}/(Simple sequential)- Custom (enter your own)
- Confirm → Done
UI mockup:
$ lean-spec init
? Select a template:
❯ standard
minimal
enterprise
? Select folder pattern:
❯ Date-grouped: 20251103/001-my-spec/ (recommended for teams)
Flat with date: 20251103-001-my-spec/
Simple: 001-my-spec/
Custom pattern
Implementation:
- Add pattern selection prompt to
init.ts - Override template's
folderPatternin generated config - Provide sensible descriptions for each pattern
- Default to date-grouped (current best practice)
Plan
Status (2025-11-04): Ready to implement - part of Phase 2 UX improvements for v0.2.0
- Add pattern selection to init wizard
- Update init command to handle pattern choice
- Add pattern override logic
- Update documentation
- Add tests for pattern selection
Implementation Notes:
- Straightforward UX enhancement to init flow
- Improves onboarding by eliminating manual config edits
- Part of spec 043 launch preparation
- Estimated: 3-4 hours implementation
- No blocking dependencies
Testing Priority:
- Pattern selection UI is intuitive
- Selected pattern correctly overrides template default
- Custom pattern validation works
- Backward compatibility maintained
Test
- Init wizard offers pattern choices
- Selected pattern overrides template default
- Custom pattern option works
- Default pattern is date-grouped
- Backward compatibility (skip pattern selection if not needed)
Notes
Related to spec 20251103/002-folder-structure-improvements - this is a polish issue split out for focused tracking.
This improves onboarding by letting users choose the right pattern upfront instead of requiring manual config edits.