Tool implementation structure policy
Decision
- Use
src/pages/tools/[category]/[tool-slug]/index.astroas the page entry structure for individual tools. - Follow the existing i18n URL strategy by adding
src/pages/[lang]/tools/[category]/[tool-slug]/index.astrowhen localized routes are required. - Keep page files thin and move actual implementation into
src/features/tools/[tool-slug]/. - Keep only shared concerns under
src/features/tools/root, such as catalog loading, slug/category helpers, shared UI, and shared types. - Store tool-specific copy in
src/features/tools/[tool-slug]/i18n/{lang}.json. - Keep
src/i18nfor site-wide shared copy only. - Promote strings to
src/i18nonly when the same wording is reused by two or more tools or by non-tool pages. - Require
SoftwareApplicationJSON-LD on every tool page. - Require a visible breadcrumb trail on every tool page and emit matching
BreadcrumbListJSON-LD.
Context
The tools catalog is already managed centrally, while individual tools require independent UI and behavior. We needed a consistent structure that keeps each tool self-contained, avoids a bloated global i18n file, and still preserves shared ownership where appropriate.
Options
- Option A: Put all tool copy in
src/i18n. - Option B: Put all tool copy in each tool directory only.
- Option C: Hybrid ownership (chosen), where tool-local copy is local by default and only truly shared copy is centralized.
Rationale
- Keeping implementation and copy inside each tool improves locality and reduces coupling.
- Keeping global i18n focused on site-level copy prevents uncontrolled growth and merge conflicts.
- The hybrid rule gives a clear migration path for shared text without premature centralization.
- Thin page-entry files match existing feature/page separation and simplify maintenance.
Consequences
- Each new tool should include
src/features/tools/[tool-slug]/with implementation and its owni18n/{lang}.json. - Page route files under
src/pages/.../tools/...should primarily wire params to feature components. - Catalog metadata (
titleanddescriptionfor listing cards) remains indocs/tools/*.yamlas defined by the existing tools-catalog ADR. - Teams must follow the promotion rule for shared strings to keep boundaries clear.
- Tool page acceptance criteria now include both
SoftwareApplicationstructured data and visible breadcrumbs withBreadcrumbListstructured data.
hsb.horse