Mandatory guardrails for backend work in the BPM repository. Use for any backend change in this project, including adding or changing modules, entities, use cases, services, endpoints, validations, SQLAlchemy persistence, SQL queries, migrations, tenancy behavior, CLI, worker, scheduler, bootstrap wiring, or backend tests. Enforce layered and module boundaries, scalable data access, clarification when requirements are incomplete, explicit rejection of architecture-breaking shortcuts, and verification before claiming success.
D:\GitHub\Mantis\BPM, even if the request sounds small.D:\GitHub\Mantis\BPM, incluso si el pedido parece pequeno.references/module-rules.md when the change touches module shape, entities, use cases, endpoints, persistence, migrations, CLI, worker, scheduler, or bootstrap.references/data-validation-rules.md when the change touches request validation, domain rules, SQLAlchemy queries, SQL, filtering, pagination, uniqueness, or performance.references/verification-checklist.md before claiming the work is complete.src/bpm_platform/bootstrap/module_registry.py, relevant entrypoints, tests, and migration trees before proposing code.control_db, tenant_db, or both.application and domain, framework edges in interfaces, and data access in infrastructure.Ask these only when the answer cannot be inferred safely from local context:
control_db, tenant_db, or both?domain must not import FastAPI, SQLAlchemy, JWT libraries, request objects, response objects, or transport concerns.application orchestrates use cases and depends on domain plus explicit ports, not concrete infrastructure.infrastructure owns ORM models, repositories, SQL, and external adapters.interfaces/http owns request schemas, response schemas, routers, and wiring.entrypoints assemble runtime processes only.bootstrap registers modules and composition.platform is only for truly cross-cutting concerns.domain and application must not import another module's infrastructure.control_db and tenant_db are separate boundaries.session.get(...) or select(...).where(...).SELECT * when only part of the row is required.get_all() and filtering later.services.py, helpers.py, or utils.py files with mixed responsibilities.When the user asks for an architecture-breaking or non-scalable shortcut:
src/bpm_platform/modules/identity, src/bpm_platform/modules/jobs, and src/bpm_platform/modules/audit.src/bpm_platform/bootstrap/module_registry.py.src/bpm_platform/entrypoints/api/dependencies.py and module-level interfaces/http/wiring.py.tests/architecture/test_layer_dependencies.py and tests/architecture/test_module_isolation.py.brainstorming before creative or behavior-changing work when the repo workflow requires design first.test-driven-development before feature or bugfix implementation when applicable.systematic-debugging when dealing with bugs, failures, or unexpected behavior.verification-before-completion before claiming the work is complete.Do not call a backend change done until all of these are true: