3.3 KiB
3.3 KiB
Feature-Local Guidance
This file is a navigation layer for feature slices under src/features/.
Before changing a feature slice, read:
Use local references:
src/features/recent-projects- full cross-process referencesrc/features/member-work-sync- full feature with a root public barrelsrc/features/member-log-stream- full feature withmain/application/src/features/agent-graph- thincore/domainplusrendererreference
Default location for new feature work:
src/features/<feature-name>/
Before adding a medium or large feature:
- decide whether the feature is full, thin, or process-limited
- start with the layer set the feature actually owns; do not add placeholder folders just to match the full template
- create explicit public entrypoints for every layer production callers need
- put shared DTOs, channel names, and API fragments in
contracts/ - keep business policy in
core/domainand use-case orchestration incore/application - keep Electron, IPC, HTTP, file system, process, and provider specifics outside
core/ - wire runtime dependencies from
main/composition/when the feature owns main process behavior - expose preload bridges through
preload/index.tsand renderer surfaces throughrenderer/index.ts - add focused tests for the layers that carry behavior
When modifying an existing feature:
- preserve the feature's current shape unless the change introduces a real new boundary
- route app shell and cross-feature imports through public entrypoints
- move duplicated rules toward
core/domainbefore adding another adapter copy - keep transport validation and normalization close to the boundary that receives the data
- update the feature README or local notes when the public surface or intended shape changes
- keep local README examples concrete and file-based; link back to the standard for architecture rules instead of restating them
Public entrypoint expectations:
contracts/index.tsexports only browser-safe contracts, constants, and normalizers intended for cross-process usemain/index.tsexports composition and registration surfaces for main-process callerspreload/index.tsexports bridge creation onlyrenderer/index.tsexports reusable renderer components, hooks, or utilities that are intentionally consumed outside the feature- root
index.tsis optional; use it only when the feature deliberately owns a stable public barrel
Testing expectations:
- test pure domain rules directly and keep those tests independent of runtime services
- test application use cases with ports or fakes, not Electron or real provider processes
- test adapter mapping, boundary normalization, and renderer utilities where they can regress user-visible behavior
- prefer
test/features/<feature>/...for cross-layer coverage; feature-local__tests__are fine when the surrounding feature already uses that pattern - for docs-only changes, verify links and examples instead of running broad test suites
Do not duplicate architecture rules here. Keep architecture rules centralized in ../../docs/FEATURE_ARCHITECTURE_STANDARD.md.