Skip to main content

Page Structure Rule

Place new pages, page-local code, shared components, services, and utilities according to the page structure coding standard

Source: .agents/rules/page-structure.mdc

Metadata

  • name: page-structure
  • alwaysApply: true

Content

Page Structure Rule

  • For new pages, substantial page refactors, shared component extraction, service/API contract work, shared utilities, or large coordinated changes, follow:
    • .agents/references/coding-standard/page-structure.md
  • Check for existing components, services, hooks, utilities, types, and page helpers before creating new files.
  • Prefer:
    • New pages: src/pages/{specific-page}/index.page.tsx
    • Page-local components: src/pages/{specific-page}/components/
    • Page-local shared files: src/pages/{specific-page}/constants.ts, types.ts, utils.ts
    • Shared components: src/components/
    • API contracts and service modules: src/services/
    • Shared utilities: src/utility/
  • This rule applies to new and substantially changed work. Do not perform broad legacy migrations unless explicitly requested.