Workflow: MUST use whenever the scope matches this purpose: Add or modify Laravel API endpoints (controller + routes) while honoring the documented route groups, Sanctum abilities, and client contracts defined by Flutter repositories.
Add or modify Laravel API endpoints (controller + routes) while honoring the documented route groups, Sanctum abilities, and client contracts defined by Flutter repositories.
foundation_documentation/modules/*.md entries covering Laravel routing, middleware, abilities, and the touched contract surface.foundation_documentation/project_constitution.md sections covering project-level inter-module rules, ownership, and systemic invariants affected by the contract change.foundation_documentation/system_roadmap.md entries only when the endpoint creates strategic follow-up, sequencing changes, or cross-stack delivery planning.foundation_documentation/todos/active/mvp_slices/TODO-v1-api-security-hardening.md (canonical security baseline and level semantics).foundation_documentation/endpoints_mvp_contracts.md conventions section (authoritative API shape + security metadata conventions).routes/api/*.php) and controller files.bash delphi-ai/tools/laravel_workflow_scaffold.sh --kind api-endpoint --name <endpoint_name> [--module <module>] [--output <path>] to scaffold the repeatable contract/route/security/test checklist before editing Laravel surfaces.bash delphi-ai/tools/endpoint_performance_review_scaffold.sh --endpoint "<endpoint>" --pattern <exact-lookup|bounded-list|search|aggregation|mutation> [--lookup-key "<key>"] [--index "<index>"] [--output <path>] to make the query/access-path review explicit.bash delphi-ai/tools/exact_lookup_anti_pattern_audit.sh --path <touched-laravel-path> when exact-lookup or repository/controller lookup paths were changed.Operational / Coder with laravel scope, review the relevant project_constitution.md rules first, and note roadmap items only when strategic follow-up is in scope.foundation_documentation/domain_entities.md and the relevant module docs before coding.Strategic / CTO-Tech-Lead for the actual project_constitution.md update.L1 Core for low-risk/public/read-heavy routes.L2 Balanced for most authenticated APIs and non-financial writes (default).L3 High Protection for critical mutations (purchase|reservation|check-in|auth recovery|admin-sensitive writes).foundation_documentation/endpoints_mvp_contracts.md) and in the active tactical TODO decision/task gates./stream companion is required for deltas.rate_limited|soft_blocked|hard_blocked|idempotency_missing|idempotency_replayed|idempotency_expired|idempotency_malformed) plus transport metadata (retry_after, correlation_id, cf_ray_id when present).L3: mandatory Idempotency-Key + replay-window validation on mutating requests.L2: idempotency required for writes that can duplicate side effects.L1: optional unless explicit route risk requires stricter protection.PATCH), default to direct resource-shaped payloads (object/list) and field-presence semantics; do not introduce envelope wrappers (for example paths) unless an explicit contract decision is documented./settings/values/{namespace}), nested fields must be sent as canonical dot-paths (example: default_origin.lat) unless a documented contract decision defines another format.null is explicit clear only for nullable fields; null for non-nullable fields must return .routes/api/)./admin/api/v1/... on tenant domains; tenant‑non‑admin remain /api/v1/..../api/v1/accounts/{account_slug}/... on tenant domains (already admin).landlord, tenant, account) and ability requirements.L1|L2|L3 level and cannot downgrade below global minimum policy./admin/api/v1), enforce domain split explicitly and validate route registration with php artisan route:list.Route::domain('{...}'), controller signatures must include domain params before path params.project_constitution.md when applicable.422exact-lookup|bounded-list|search|aggregation|mutation.slug|id|uuid|code|handle|key, require a direct indexed lookup or dedicated endpoint/contract; do not normalize page-walk or list-scan fallbacks.config/abilities.php when wildcard (*) permissions are expanded into explicit token abilities.Sanctum::actingAs.200) and envelope rejection (422).L2|L3 mutations, add replay/idempotency tests and deterministic rejection contract tests.backend-concurrency-idempotency-validation; prefer real concurrent probes such as 5, 10, and 20 requests instead of relying only on single-request tests.foundation_documentation/system_roadmap.md only when the endpoint change creates or changes strategic follow-up, sequencing, or cross-stack planning.project_constitution.md; do not apply constitution edits directly from Operational / Coder.Partial, migrate that touched legacy scope into the module as part of the same TODO.foundation_documentation/endpoints_mvp_contracts.md.composer test or targeted suites; optionally hit endpoints via Postman/cURL or contract tests.composer run architecture:guardrails) as mandatory static compliance gate.php scripts/architecture_guardrails.php must pass.config/api_security.php misses baseline invariants (L1/L2/L3, route_overrides, observe_mode) or if ApiSecurityHardening/trusted-proxy wiring is missing in bootstrap/app.php.composer run lint, ./vendor/bin/pint --test, composer run static-analysis, or ./vendor/bin/phpstan analyse)../vendor/bin/pint --test <changed-files...>).CF-Ray + correlation_id) in logs/telemetry.php artisan route:list.bash delphi-ai/tools/exact_lookup_anti_pattern_audit.sh --path <touched-path> and classify every finding before delivery.explain, query log, benchmark, or equivalent) instead of relying only on heuristic scan output.