docs/superpowers/handoffs/2026-05-14-monorepo-architecture-reorg.md
This handoff is the coordination entrypoint for the Reactive Resume architecture reorganization. It intentionally references the implementation plan instead of duplicating it.
docs/superpowers/plans/2026-05-14-monorepo-architecture-reorg.mddocs/superpowers/worklogs/2026-05-14-monorepo-architecture-reorg.mdfeat/explore-hono-orpc-migrationapps/server/package.jsonpackage.jsonpackages/api/package.jsonpackages/env/package.jsonpackages/utils/package.jsonpnpm-lock.yamlgit reset --hard or destructive checkout commands.AGENTS.md as the final normative architecture source of truth.subagent-driven-development for executing one task slice with review gates.executing-plans for sequential execution from the plan.documentation-writer for AGENTS.md, ADR, and public architecture docs.handoff when pausing or delegating a task outside Codex.turborepo when editing turbo.json, package tags, or task graph rules.context7-mcp if checking current docs for library/framework behavior.External agents should be handed exactly one task from the plan plus this handoff path. They should report:
DONE, DONE_WITH_CONCERNS, BLOCKED, or NEEDS_CONTEXT@reactive-resume/schema is Zod/types only.@reactive-resume/resume owns pure resume-domain behavior.@reactive-resume/ai owns model contracts, not DB-backed agent runtime.packages/api/features/agent.RouterClient.@reactive-resume/pdf owns PDF generation helpers but not PDF.js viewer UI.apps/web uses domain-first features and generic-only src/components.packages/db remains centralized.@reactive-resume/resume with source-consumed exports:
@reactive-resume/resume/patch@reactive-resume/resume/icons@reactive-resume/utils.packages/ai, packages/api, packages/db, packages/import, and apps/web../resume/patch and ./network-icons.fast-json-patch from @reactive-resume/utils and @reactive-resume/ai; it now belongs to @reactive-resume/resume.@reactive-resume/schema from @reactive-resume/utils after moving DOCX code into @reactive-resume/docx.@reactive-resume/docx with source-consumed root export @reactive-resume/docx.packages/utils/src/resume/docx to packages/docx/src.@reactive-resume/docx.@reactive-resume/utils/resume/docx export and removed docx plus @reactive-resume/schema from @reactive-resume/utils.@reactive-resume/docx tests/typecheck, @reactive-resume/utils typecheck, web typecheck, focused web export test command, and focused Biome check.@reactive-resume/pdf/browser and @reactive-resume/pdf/server exports.createResumePdfBlob({ data, template, resolveSectionTitle }) delegates to pdf(<ResumeDocument ... />).toBlob().createResumePdfFile({ data, filename, template, resolveSectionTitle }) delegates to renderToBuffer(<ResumeDocument ... />) and preserves the existing File response body shape.apps/web/src/features/resume/export; those wrappers resolve section titles and pass resolveSectionTitle into the package helpers.apps/web/src/features/resume/preview/preview.browser.tsx now calls the web-local blob wrapper instead of importing @react-pdf/renderer directly.@reactive-resume/pdf/server through packages/api/src/features/resume/export.ts; apps/server consumes the explicit API feature export instead of owning PDF rendering logic directly.@reactive-resume/pdf tests/typecheck, web typecheck, server typecheck, focused web PDF export/viewer tests, and focused Biome check.@reactive-resume/mcp with source-consumed exports for the compact public surface plus direct subpaths for server card, tool names, tools, prompts, and resources.apps/web/src/routes/mcp/-helpers to packages/mcp/src.apps/server/src/mcp/handler.ts and apps/server/src/openapi/metadata.ts now import from @reactive-resume/mcp; server-side MCP execution still uses the injected in-process oRPC RouterClient.read_resume replaces the old get-resume tool name, and apply_resume_patch replaces the old patch tool name. No reactive_resume_* aliases remain.@reactive-resume/ai/tools/resume-tool-contracts and reused its JSON Patch operations schema from MCP while keeping MCP-specific id context in the MCP input schema.@reactive-resume/mcp tests/typecheck, server typecheck, @reactive-resume/ai typecheck, focused Biome check, and the app-to-app import scan.packages/api/src is now organized by feature/capability under packages/api/src/features.packages/api/src/routers/index.ts, but it imports feature routers from features/*/router.features/agent, with separate procedure modules for threads, messages, attachments, and actions; run-state lives in runs.ts, tool construction in tools.ts, and the remaining shared orchestration stays in service.ts.features/resume, with capability procedure modules for CRUD, tags, statistics, analysis, events, sharing, and export. Access helpers and resume update events are feature-owned.packages/api/src/features/resume/export.ts and calls @reactive-resume/pdf/server.@reactive-resume/api no longer exports ./services/* or ./helpers/*; explicit exports now cover routers, context, flags type, resume runtime/export, and storage runtime.apps/server imports storage and the PDF procedure from explicit API feature exports. apps/web API imports remain type-only.features/agent/service.ts and features/resume/service.ts are still large DB-backed facades. They are feature-owned now, but further splitting should be handled as behavior-preserving follow-up work with targeted tests around run lifecycle, patch transactions, notifications, and storage cleanup.apps/server/src now reads as a runtime adapter app:
http: route composition, auth/health HTTP handlers, common header/cookie helpersrpc: oRPC fetch handler and request-locale extractionmcp: MCP auth, per-request server setup, and streamable HTTP transport handleropenapi: OpenAPI handler plus OAuth/OpenID/MCP well-known metadatastatic: upload serving, /schema.json, and apps/web/dist static/SPA fallback servingstartup: database migrations and local-storage path checksapps/server/src/index.ts now only re-exports createApp, runs startup checks, computes the port, and starts the Hono server.index.ts were preserved, including /api/rpc, /api/openapi, /api/auth/*, /api/health, /uploads/*, /schema.json, /auth/oauth, /mcp, /.well-known/*, and the web-dist fallback.@reactive-resume/api/services/* or apps/web/src imports were introduced.apps/web/src/features/resume:
builder/draft.ts owns the builder resume draft store/hooks.preview/* owns the builder preview shell, PDF.js canvas renderer, shared preview helpers/tests, and dashboard thumbnail PDF rendering helpers.export/pdf-document*.tsx owns web-local PDF document/blob/file wrappers around @reactive-resume/pdf.public/* owns the public resume view, public PDF.js viewer, CSS, and tests.pdfjs-dist imports are expected only under apps/web/src/features/resume; do not move them into packages/pdf.ssr: "data-only", and lazy-loads @/features/resume/public/public-resume.ssr: false and lazy-loads the preview page composition.components/routes. Task 8 still owns dialog registry decomposition beyond import updates caused by the draft-store move.apps/web/src/features/command-palette owns the command palette implementation and tests.apps/web/src/features/theme owns the theme provider, combobox, toggle button, and tests.apps/web/src/features/locale owns the locale combobox and tests.apps/web/src/features/user owns the user dropdown.apps/web/src/features/auth; route files under apps/web/src/routes/auth keep redirects/search validation and compose the feature pages.apps/web/src/features/settings; route files under apps/web/src/routes/dashboard/settings keep dashboard header composition and redirects. job-search.tsx remains route-only because it is already just a redirect shim.@/components/{command-palette,theme,locale,user} import paths should not be reintroduced; current consumers import from @/features/*.apps/web/src/components now contains remaining generic primitive/screen folders only.apps/web/src/dialogs/store.ts remains the single global dialog runtime and still exports useDialogStore plus DialogProps<T> for existing callers.apps/web/src/dialogs/schemas.ts from domain-owned schema entries in dialogs/auth/schema.ts, dialogs/api-key/schema.ts, and dialogs/resume/schema.ts.apps/web/src/dialogs/renderers.tsx from domain-owned renderer registries in dialogs/auth/registry.tsx, dialogs/api-key/registry.tsx, and dialogs/resume/registry.tsx.apps/web/src/dialogs/manager.tsx only imports the dialog shell, renderDialog, and the global store; it no longer imports every dialog implementation directly.turbo.json now has executable boundaries config:
web and server, preventing package-to-app and app-to-app dependency edges.implicitDependencies: vitest, @testing-library/jest-dom, @testing-library/react, and @testing-library/user-event.turbo.json files now exist for both apps and every package. Each extends root config with extends: ["//"] and declares tags used by the root boundaries.vitest.config.ts keeps its legitimate root shared config import with // @boundaries-ignore root shared Vitest config immediately above import { createVitestProjectConfig } from "../../vitest.shared";.biome.json now enables style.noRestrictedImports for forbidden cross-workspace source/path imports:
@reactive-resume/*/src/**apps/**packages/**biome.json also registers tooling/grit/no-cross-workspace-src-imports.grit, which flags import/export/dynamic import sources that reach into another workspace's src tree.apps/web/tsconfig.json no longer maps @reactive-resume/ui/* directly to ../../packages/ui/src/*; the web app uses @reactive-resume/ui package exports instead.turbo.jsonapps/*/turbo.jsonpackages/*/turbo.jsonbiome.jsontooling/grit/no-cross-workspace-src-imports.gritapps/web/tsconfig.jsonapps/server/vitest.config.tsapps/web/vitest.config.tspackages/*/vitest.config.tsdocs/superpowers/worklogs/2026-05-14-monorepo-architecture-reorg.mddocs/superpowers/handoffs/2026-05-14-monorepo-architecture-reorg.mdpnpm exec turbo boundariespnpm exec biome check biome.json turbo.json tooling/grit/no-cross-workspace-src-imports.grit apps/web/tsconfig.json apps/server/turbo.json apps/web/turbo.json packages/*/turbo.jsonpnpm --filter web typecheckpnpm --filter @reactive-resume/api typecheckpnpm --filter server typecheckAGENTS.md is now the operational source of truth for package roles, runtime tags, import rules, placement decisions, and validation commands.docs/contributing/architecture.mdx is now a public contributor overview of the current monorepo layout instead of the removed single-src architecture.docs/adr/0001-workspace-boundaries.md records the rationale for domain-first packages, explicit export maps, turbo boundaries, and Biome/Grit import enforcement.read_resume and apply_resume_patch; no Task 10 changes were needed there.apps/server Hono adapter shape, current Node/pnpm prerequisites, Base UI wording, provider-native web research behavior, and the current env schema.ORPCClient diagram labels.package.json.pnpm knip:
apps/server/package.json and apps/web/package.json.apps/web/src/features/resume/export/pdf-document.server.tsx.pdfExportRateLimit to packages/api/src/features/resume/export.ts.pnpm install --lockfile-onlypnpm installpnpm exec biome check .pnpm exec turbo boundariespnpm knippnpm typecheckpnpm testpnpm buildpnpm knip still prints a non-failing configuration hint: src/server.ts apps/web knip.json Refine entry pattern (no matches).AGENTS.md, docs/contributing/architecture.mdx, docs/adr/0001-workspace-boundaries.md.turbo.json, workspace turbo.json files, biome.json, tooling/grit/no-cross-workspace-src-imports.grit.packages/api/src/features.apps/server/src/{http,rpc,mcp,openapi,static,startup}.apps/web/src/features.