# AGENTS.md — workspaces Feature package scaffolded by `turbo gen feature`. Provides domain logic, repositories, use cases, controllers and the tRPC router for `Workspace`. ## Overview `@repo/workspaces` owns: the `Workspace` domain model, feature-scoped errors, the `IWorkspaceRepository` interface, one use case (`getWorkspaceUseCase`), one controller, a real Payload-backed repository (stub body — fill in once the Payload collection is added), an in-memory mock repository, and the tRPC `workspacesRouter`. ## Layer responsibilities | Layer | Key files | | ---------------------------------- | ------------------------------------------------------------------------------------------------------ | | **entities/models** | `workspace.ts` — `Workspace` Zod schema + type | | **entities/errors** | `workspace.ts` (WorkspaceNotFoundError), `common.ts` (InputParseError) | | **application/use-cases** | `get-workspace.use-case.ts` — factory function + exported schemas | | **application/repositories** | `workspace.repository.interface.ts` — `IWorkspaceRepository` | | **infrastructure/repositories** | `workspace.repository.ts` (real Payload-backed; stub body), `workspace.repository.mock.ts` (in-memory) | | **interface-adapters/controllers** | `get-workspace.controller.ts` — one file per use case | | **di** | `symbols.ts`, `module.ts`, `container.ts`, `bind-production.ts`, `bind-dev-seed.ts` | | **integrations/api** | `procedures.ts` (workspacesProcedure), `router.ts` (workspacesRouter) | ## Public exports | Subpath | Contents | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `.` | `Workspace` type; `WorkspaceNotFoundError`, `InputParseError`; `getWorkspaceInputSchema`, `getWorkspaceOutputSchema`, `GetWorkspaceInput`, `GetWorkspaceOutput`, `IGetWorkspaceUseCase`; `IGetWorkspaceController` type alias; `WorkspacesRouter` type | | `./api` | `workspacesRouter` (tRPC router) | | `./di/bind-production` | `bindProductionWorkspaces(config, tracer, logger)` | | `./di/bind-dev-seed` | `bindDevSeedWorkspaces(tracer, logger)` | | `./ui` | (reserved — empty barrel) | ## Tests ```bash pnpm test --filter @repo/workspaces ``` ## What it must NOT import - Any other feature package - Any app package - `@repo/core-api`, `@repo/core-cms`, `@repo/core-trpc`, `@repo/core-ui` directly; only `@repo/core-shared`