Chronos Atlas is built on a Feature-Sliced Architecture where each feature (Entities, Maps, Timeline, Writing, Linguistics, WorldBible, Graph, Shell, etc.) owns its internal layers —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Fixius50/WorlBuilding-Writting-App/llms.txt
Use this file to discover all available pages before exploring further.
application, components, hooks, pages, domain, and store — and communicates outward only through its public index.ts. Without automated enforcement, the boundaries between these slices erode over time: one feature imports directly into another feature’s internals, or utility code in the Shared kernel quietly accumulates business logic. The architecture guardrail script (frontend/scripts/architecture-check.mjs) catches these violations mechanically, before they become technical debt.
Running the check
Both commands run from thefrontend/ directory. They scan every .ts and .tsx file under src/ and write a machine-readable report to frontend/reports/architecture-guard-report.json.
CROSS_FEATURE_DEEP_IMPORT, SHARED_KERNEL_DEPENDS_ON_FEATURE) in the summary line before the process exits.
What the script checks
The script enforces two distinct boundary rules:Rule 1 — Cross-feature deep imports
Violation kind:CROSS_FEATURE_DEEP_IMPORT
A cross-feature deep import occurs when code in one feature reaches past another feature’s public index.ts and directly imports from its internal sub-folders:
@features/App/store/useAppStore— the global app store used across all features@features/Shell/store/useRightPanelStore— the right-panel store used by shell-level layout features
Maps/ importing from @features/Maps/hooks/...) are always allowed.
Rule 2 — Business logic in Shared outside adapters
Violation kind:SHARED_KERNEL_DEPENDS_ON_FEATURE
The Shared kernel (src/features/Shared/) is a transversal collection of UI primitives, layout components, and utilities — not a container for business logic. If a file inside Shared/ imports from any @features/<BusinessFeature> path that is not itself @features/Shared/..., the script raises a violation:
src/features/Shared/adapters/ are exempt from this rule because adapters exist precisely to bridge the Shared kernel with specific business features in a declared, visible way.
Critical architectural rules
These rules are derived fromDocs/01_Estrategia_Tecnica.md and represent the full set of structural contracts the codebase is held to.
Violating any of these rules — even in ways the automated script cannot currently detect — constitutes architectural debt. When in doubt, consult
Docs/01_Estrategia_Tecnica.md (the canonical source for placement decisions) before writing new code.- Screen-only hooks belong in
pages/alongside the view component that uses them, not in the feature’shooks/folder. If a hook is only ever used by one page, it should live next to that page. - Reusable hooks within a feature belong in
hooks/— hooks that are consumed by multiple components or pages inside the same feature go in the feature’shooks/sub-folder. index.tsat the feature root is the public API — every feature must expose a root-levelindex.ts. This is the only entry point other features are allowed to import from.- No global legacy layers — do not reintroduce
src/application/,src/store/,src/domain/, orsrc/presentation/as transversal logic hubs. All logic is scoped to its feature. - All SQL access goes through
src/infrastructure/localDB/repositories/— never writesqlocalor raw SQL calls inside components, hooks, or application cases directly. Import from@repositories/*instead. - No deep cross-feature imports — use
@features/<FeatureName>(the public API) only. Never import from@features/<OtherFeature>/components,/hooks,/pages,/application,/domain, or/storedirectly. - Shared kernel must not import business features —
src/features/Shared/*must remain free of business-feature dependencies. Integrations that genuinely need to reach a business feature must be declared explicitly insrc/features/Shared/adapters/.
Reading the report
The report atfrontend/reports/architecture-guard-report.json is overwritten on every run. Its structure is:
violations array contains one object per offending import:
| Field | Description |
|---|---|
kind | The rule that was broken — CROSS_FEATURE_DEEP_IMPORT or SHARED_KERNEL_DEPENDS_ON_FEATURE |
file | The file containing the offending import, relative to the frontend/ root |
importerFeature | The feature the offending file belongs to (or null for files outside src/features/) |
importedPath | The exact import string that triggered the violation |
message | A human-readable description of the required fix |
CROSS_FEATURE_DEEP_IMPORT violation, locate the export in the target feature’s index.ts (or add it there if missing) and update the import path to @features/<FeatureName>. To resolve a SHARED_KERNEL_DEPENDS_ON_FEATURE violation, move the integration logic into a new or existing file under src/features/Shared/adapters/.