- Markdown Tables: Always keep column width consistent across rows.
- Language: Default to Taiwan Traditional Chinese (avoid Mainland/HK terms).
- BPM Naming: Always write BPM in uppercase because it is an abbreviation.
- Git Commit Messages: Follow commitlint convention, written in English.
- ClickUp Task Tagging: Use format
#{ID}[COMPLETED]. - Dev Server Usage:
- User launches Dev Server manually by default.
- Only start if explicitly instructed or no valid server found.
- Always confirm before starting; kill after validation.
- Push/Commit Restriction:
- Never commit/push without explicit user instruction.
- Confirmation required every time.
- Atomic Commits: When committing, automatically split changes into multiple granular commits by scope.
- Avoid Excessive Mocks: Focus on actual tasks, not artificial test cases.
- Record Large Tasks: Write progress to project-scoped AGENTS.md.
- Agent Utilization: Use specialized agents via Task tool when appropriate.
- Cleanup Temporary Scripts: Delete debug/experimental files after completion.
- Memory Hygiene: Keep AGENTS.md concise; store transient notes in tasks.md.
- Skill Creation: When asked to create a "skill", it refers to Codex skill.
- Backoffice UI is based on
@mezzanine-ui/react. - Prefer existing Mezzanine components over custom implementations.
- Only build custom components when the behavior cannot be represented by Mezzanine primitives, such as React Flow node and edge renderers.
- Do not use removed Mezzanine APIs such as
ScrollbarorSwitch.
- Do NOT use
anytype. - Every function must declare a return type.
- Comply with project eslint rules.
- Prefer immutable data structures and functional programming:
- Avoid mutation (
push,splice, reassignment). - Use pure functions,
map/reduce/filter. - Prefer
readonlyandconstoverlet.
- Avoid mutation (
- The canonical inventory of every export from every
libs/*package isdocs/api-reference.md. - Maintenance invariant: ANY change under
libs/*/src/**(adding, removing, renaming, or moving a symbol), or any edit to apackage.jsonexportsmap,tsconfig.base.jsonpaths, orlibs/bpm-core-react/vite.config.tsPLANNED_ENTRIESMUST updatedocs/api-reference.mdin the same commit. - Bump the "Last verified against" line at the top of
docs/api-reference.mdto the new version string for each affected package. - Before adding a new export, check the file first — likely something close already exists and can be extended instead.
- After finishing a libs edit, grep your diff against the doc to confirm every new/removed symbol is reflected.
- CI does not enforce this yet; humans and agents are the enforcement. Refusing or forgetting to update this file is a defect, same severity as forgetting a test.
- Project name:
bpm - Internal workspace/path scope:
@bpm - Public package names:
@rytass/bpm-core-shared,@rytass/bpm-core-client,@rytass/bpm-core-nestjs-module,@rytass/bpm-core-react - Monorepo: Nx integrated workspace
- Backend runtime app:
apps/api(NestJS + GraphQL Code-First + TypeORM + PostgreSQL host shell) - Frontend: Next.js App Router + React Flow + Mezzanine UI
- Client runtime app:
apps/client - Shared types live in
libs/sharedand expose workflow, form, condition, identity, organization, and status contracts. - BPM core backend modules live in
libs/bpm-coreand are exposed through@rytass/bpm-core-nestjs-module;@bpm/coreremains an internal TypeScript path alias only. apps/apiis only the host shell. It wires Vault, TypeORM, GraphQL, auth/session endpoints, CORS, validation, exception filters, andBPMRootModule.- Do not put reusable BPM domain behavior in
apps/api; add it tolibs/bpm-core. - Future external NestJS systems should import
@rytass/bpm-core-nestjs-moduleand provide their own auth context factory plusBPM_MEMBER_RESOLVER. - Develop/staging infrastructure now exists. Do not create or change cloud DB, Vault, GKE, GitHub repo, DNS, commits, or pushes without explicit instruction.
- Infrastructure target: Vault paths
bpm_core/developandbpm_core/staging, Cloud SQL databasebpm_core, schemas/usersbpm_core_developandbpm_core_staging, staging DNSbpm-core-staging.rytass.info; develop is DB/Vault only, staging is deployable. - Local development uses Vault-backed develop secrets.
docker composeis not required for the normal dev or verification flow.
- 2026-05-04: M1 W2 Form Builder is complete with reusable
FormRenderer, builder preview integration, unit tests, andpnpm e2e:clientPlaywright coverage. - 2026-05-04: M1 W3 Approval Template foundation is implemented with template/version GraphQL APIs, workflow validation, React Flow designer, version history, and
pnpm e2e:clientPlaywright coverage. - 2026-05-04: M2 W4 Workflow Engine foundation is implemented with instance/token/task/activity entities, submit snapshot flow, advisory-lock processing, activity logging, and API unit coverage.
- 2026-05-06: M2 W5 linear approval execution is implemented with task decision GraphQL APIs, submit/process/approve client flows, inbox/detail pages, API unit coverage, and
pnpm e2e:clientPlaywright coverage. - 2026-05-06: M2 W6 workflow branching runtime is implemented in the engine with structured edge condition evaluation, exclusive gateway routing, multi-outgoing token fork, AND/OR predecessor joins, sibling cancellation for OR joins, and API unit coverage.
- 2026-05-06: Workflow launch entry UI is implemented with a
/instances/newlaunch center, dashboard/inbox/template shortcuts, launchability filtering, and Playwright coverage. - 2026-05-08: W7 1/2 scope completed with CEL-backed policy/condition evaluation, approver resolver support, return/cancel/resubmit instance controls, workflow dry run API/UI, and full lint/typecheck/build/e2e/browser verification.
- 2026-05-09: W9 notification/SLA foundation is implemented for in-app notification storage/API, task-assigned notifications, SLA due calculation/scanning, notification center UI, preference UI, and inbox SLA countdown; email/webhook/timeout actions remain hook + console logging only.
- 2026-05-09: W8 delegation and transfer is implemented with delegation rule CRUD, automatic task assignee resolution, manual task transfer, admin UI, task detail transfer UI, API unit coverage, and Playwright browser coverage.
- 2026-05-09: W7 completed with configurable return resubmit strategy (
RESTART/FROM_RETURN_POINT), richer workflow dry run routing diagnostics, designer UI controls, API regression coverage, and full lint/typecheck/test/build/e2e verification. - 2026-05-10: W10 signature and attachment foundation is implemented with HMAC signature chains, mock timestamp tokens, decision signature integration, local storage via
@rytass/storages-adapter-local, signed download/preview URLs, FormRenderer upload integration, detail page attachment/signature UI, React-PDF preview, API unit coverage, and Playwright e2e coverage; S3/MinIO and encryption-at-rest are intentionally removed from the planned W10 scope. - 2026-05-11: BPM embeddable module boundary is introduced with
BPMRootModule,BPMAuthModule, injectableBPMMemberResolver, and@rytass/bpm-core-nestjs-module. - 2026-05-11:
apps/apiis now the host shell for local/staging runtime. It provides DB-backed test-member login, signed HTTP-only session cookie,/api/auth/me, logout, and GraphQLBPMAuthContextsession mapping. - 2026-05-11: BPM backend domain modules, migrations, tests, and TypeORM helpers now live under
libs/bpm-core;pnpm apiserves theapiproject on port 17603. - 2026-05-11: M1 W1 organization/member interface is implemented with Organization GraphQL filters/summary, org path validation, admin org CRUD UI, member directory detail UI, shared Member/OrgUnit/Position pickers, and unit coverage.
- 2026-05-18:
pnpm demo:reset/pnpm staging:resetare wrapper-app seed commands owned byapps/api/tools/reset-demo-data.ts; they reset the target Vault-backed DB schema and seed a Taiwan manufacturing scenario with org units, positions, DB-backed test members, memberships, manager rules, form definitions, approval templates, instances across states, tasks, notifications, attachments, signatures, and delegations. - 2026-05-19: Documentation reconciliation updated root/package/shared docs, workflow frontend schema docs, CEL maturity, data model fields, embedding auth docs, staging runtime secret guidance, and removed the no-op staging client
API_URL. - 2026-05-13: Workflow task assignment now supports candidate groups through
task_candidates, multi-member direct/position/org resolvers, task candidate GraphQL fields, candidate-aware inbox/detail UI, and fullpnpm e2e:clientcoverage. - 2026-05-14: W6 Edge Condition CEL expression runtime is verified for both actual workflow execution and dry run;
edge.data.conditionnow represents the executable CEL condition, with structured field/operator data kept only as designer/fallback compatibility. - 2026-05-15: W9 notification/SLA is completed with flattened
BPMRootModulenotification config, pending delivery state, SMTP email delivery, signed webhook delivery, Handlebars templates, SLA timeout actions (REMIND/AUTO_APPROVE/ESCALATE/TERMINATE_INSTANCE), and header unread notification entry; full verification includes unit tests andpnpm e2e:client. - 2026-08-12: Form option DataSource Phase 0–6 and P6 gate are complete with host-owned registry fixtures, catalog/preview/runtime GraphQL, server-side submit/resubmit snapshots, Mezzanine renderer controls, builder bindings, deterministic demo seed, and a passing real-Chrome golden path; final repository-wide e2e is 43/43, with legacy edge-data normalization, GraphQL endpoint normalization, and aligned e2e contracts verified.
- 2026-05-15: System audit remediation work is tracked in
tasks.md; each completed fix must include targeted unit/integration coverage pluspnpm e2e:clientverification. - Replace
apps/apiDB-backed simulation accounts with a real@rytass/member-base-nestjs-modulehost module before treating staging login accounts as production-like; BPM core already exposes member-base adapter helpers and does not own seed data.