Files
agentic-dev/packages/core-api/AGENTS.md
Danijel Martinek f77e6ea881 chore(template): clean-slate template snapshot from bb4a0c7
Curated, product-agnostic snapshot of the post-story-04 tree: demo
content deleted, auth-only reference feature, web-next shell, all gates
green. Product-specific docs, ADRs 027-029, PRDs/epics/archive, editor
library traces, and product naming are curated out; generic template
repairs (coverage provider devDeps, root test:coverage script, live
lint fixes, root-only release-please) are kept. See TEMPLATE.md for
provenance, curation list, and usage.

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

52 lines
1.6 KiB
Markdown

# AGENTS.md — core-api
**Tag:** core-composition
**Composition-only package** that aggregates feature tRPC routers into a single root `appRouter`. It does not define procedures; instead, it imports them from feature packages.
## Responsibilities
- **Compose tRPC appRouter** — merges feature routers into `t.router({ ... })`
- **Type export** — exports `AppRouter` type for frontend type safety
- **No procedure definitions** — all routers owned by their respective features (`@repo/auth`, `@repo/blog`, etc.)
- **No business logic** — purely structural assembly
## Allowed imports
- **`@repo/<feature>/api`** subpath exports only (to get tRPC routers)
- e.g., `import { authRouter } from "@repo/auth/api"`
- e.g., `import { blogRouter } from "@repo/blog/api"`
- `@repo/core-shared/trpc/init` — for `t.router()` builder
## Must NOT import
- Any feature's root package or other subpaths (e.g., NOT `@repo/blog/di`, NOT `@repo/blog/entities`)
- Any app package
- `@repo/core-cms`, `@repo/core-trpc`, `@repo/core-ui`
## Public exports
From `package.json`:
- `.``appRouter` and `AppRouter` type
Example usage:
```typescript
import { appRouter, type AppRouter } from "@repo/core-api";
```
## Test conventions
- No unit tests (composition layer)
- Verify at app boot: `pnpm dev --filter @repo/web-next` succeeds and tRPC client fetches data
- Run router health check: `pnpm typecheck` confirms `AppRouter` type is valid
## Structure
```
src/
root.ts # t.router({ ... }) aggregating all feature routers
index.ts # re-exports appRouter + type
```