Files
agentic-dev/apps/cms/AGENTS.md
Danijel Martinek 48bf4da4cd refactor(navigation)!: delete navigation demo feature
Veect retrofit (ADR-027): fifth and final slice of the demo-content
removal. Deletes packages/navigation whole and prunes every composition
edge in one commit: core-api router mount + dep + router test, core-cms
header-global composition + dep + regenerated Payload types (globals
now empty), web-next bindAll (prod + dev-seed) + tests + Tailwind
source + transpilePackages + dep, cms/core-cms payload config test
assertions, home e2e nav assertion, tsconfig paths, fallow
ignoreDependencies entry, anchor-guard FEATURES list, generator e2e
strip lists + reference-feature comments (navigation -> auth, incl.
feature templates + scaffolding guide), lockfile prune, and
feature-list doc trims (CLAUDE.md, AGENTS.md, glossary, app/feature
AGENTS.md). Compliance YAML regeneration produced no churn (navigation
declared no PII).

Cycle break: navigation's UI hooks were the last edge closing the
committed core-trpc -> core-api -> navigation -> core-trpc package
cycle. With it gone, the lint turbo task graph builds for the first
time and every package's ESLint executes; the epic's lint waiver
expires here. Latent findings: 3 errors, all mechanical, fixed
in-slice - require() import in turbo/generators/config.ts
(no-require-imports), literal type assertion in auth's
authentication.service.ts (prefer-as-const), and next-env.d.ts
triple-slash in apps/cms (rule scoped off for that generated file,
mirroring web-next's existing override). 99 warn-severity findings
remain across 5 packages (pii-declaration-must-be-complete on test
fixtures, turbo/no-undeclared-env-vars on test env keys) - all
warn-by-design, non-gating.

core-trpc keeps a consumer (apps/web-next providers) and stays per
ADR-027. Its unused @trpc/react-query dependency, surfaced by the
post-deletion fallow audit, is removed rather than ignore-listed -
core-trpc's hooks use @trpc/tanstack-react-query. Remaining fallow
warn (auth validateSession "unused member") is a false positive: the
method implements IAuthenticationService and is exercised in
container.test.ts; auth stays untouched as the regression canary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
2026-07-12 19:34:54 +02:00

3.4 KiB

AGENTS.md — apps/cms

Thin shell hosting the Payload CMS admin panel via Next.js. All CMS configuration (collections, globals, hooks, access control, payload.config.ts) lives in @repo/core-cms, which aggregates collections from feature packages.

Purpose

This app exists solely to serve the Payload Admin UI. It contains no custom CMS code beyond Next.js routing boilerplate. All business knowledge lives in feature packages (@repo/auth, etc.), which export their collections/globals via subpath exports (.../cms). @repo/core-cms composes them into a single Payload config.

Port: 3001

docker compose up -d postgres    # Start PostgreSQL on port 5432
pnpm dev --filter @repo/cms      # http://localhost:3001/admin

Key Files

File Purpose
next.config.mjs Minimal config wrapped with withPayload() from @payloadcms/next
tsconfig.json TypeScript config with @payload-config path alias
src/app/(payload)/layout.tsx Auto-generated Payload root layout (DO NOT MODIFY)
src/app/(payload)/admin/[[...segments]]/page.tsx Auto-generated catch-all admin page (DO NOT MODIFY)
src/app/(payload)/importMap.js Auto-generated Payload import map (DO NOT MODIFY)

Hard Rules

  • NEVER add collections, globals, or hooks in this app — put them in feature packages
  • NEVER create custom CMS logic here — use @repo/core-cms
  • NEVER modify auto-generated files under src/app/(payload)/
  • All Payload config changes go in packages/core-cms/src/payload.config.ts

@payload-config Alias

The tsconfig.json points to @repo/core-cms:

{
  "compilerOptions": {
    "paths": {
      "@payload-config": ["../../packages/core-cms/src/payload.config.ts"]
    }
  }
}

When Payload imports @payload-config, it resolves to the composed config from @repo/core-cms, which in turn imports feature collections.

Composition flow

Feature (@repo/auth)
  └─ src/integrations/cms/collections/users.ts
      └─ exported as ./cms

Core CMS (@repo/core-cms)
  └─ src/payload.config.ts
      imports all feature /cms exports
      calls buildConfig({ collections, globals })

This app (@repo/cms)
  └─ src/app/(payload)/layout.tsx
      loads config from @payload-config
      Payload CLI auto-generates admin routes

Type Generation

After adding/modifying collections in any feature's /cms folder:

cd apps/cms && pnpm generate:types
# Regenerates packages/core-cms/src/generated-types.ts

Dependencies

Dependency Purpose
@repo/core-cms Payload config + buildConfig
@payloadcms/next Next.js integration for Payload
payload Payload CMS core
next Next.js 15 framework
sharp Image processing

Cross-References

  • Feature collections: each feature's src/integrations/cms/ folder
  • CMS composition: packages/core-cms/AGENTS.md