azcodr 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,19 +44,3 @@
44
44
  - `PUT /api/v1/<resources>/:id` or `PATCH`: Update attributes or mutate state machine status.
45
45
  - `DELETE /api/v1/<resources>/:id`: Remove or archive returning `204 No Content`.
46
46
  - **Defensive Route Tolerances for Infrastructure Probes:** Operational probes (`/healthz`, `/readyz`) must defensively support trailing slashes (`/healthz/`) and common typos (`/healtz/`) to prevent reverse proxy routing mismatches between frontend dev servers (e.g. Vite) and ingress gateways.
47
-
48
- ---
49
-
50
- ## 5. Invariants, DO's & DONT's
51
-
52
- ### DO's:
53
- - **DO:** Return standard HTTP status codes (`200 OK`, `201 Created`, `204 No Content`, `400 Bad Request`, `404 Not Found`, `409 Conflict`).
54
- - **DO:** Return RFC 7807 Problem Details envelopes for all `4xx` and `5xx` error responses.
55
- - **DO:** Mask cross-tenant resources with `404 Not Found` (enumeration masking) to avoid leaking existence of foreign records.
56
- - **DO:** Implement full lifecycle CRUD verbs across all primary resources.
57
- - **DO:** Support defensive trailing slashes on health and readiness probes.
58
-
59
- ### DONT's:
60
- - **DONT:** Never return `200 OK` with an error object inside the response body (the anti-pattern of masking errors).
61
- - **DONT:** Never return detailed database stack traces or raw internal errors to client API callers in production.
62
- - **DONT:** Never use singular nouns for collection endpoints (use `/api/v1/users`, not `/api/v1/user`).
@@ -83,24 +83,46 @@ Deviating from this lifecycle introduces catastrophic defects and architectural
83
83
  | **Skipping Outer Acceptance Tests** | In-memory unit tests pass, but user interactions and network routing fail. | "The In-Memory Supertest Illusion": App says "Offline/Connecting" while 100% unit tests pass. |
84
84
  | **Skipping the Refactor Phase** | Technical debt accumulates immediately behind green tests. | Code rot, duplicated logic, bloated monolithic functions (> 30 lines), violated DRY/SLAP. |
85
85
 
86
- ### The Immutable Laws of TDD Execution:
87
- 1. **No Production Code Without a Failing Test:** You are not allowed to write any production code unless it is to make a failing unit or acceptance test pass.
88
- 2. **No Test Without Prior Domain Understanding:** You are not allowed to write a test without knowing the Ubiquitous Language, Aggregate Root, and business invariants it asserts.
89
- 3. **Minimal Code Only:** Write only the minimal amount of code necessary to turn the failing test green. Do not anticipate speculative future requirements.
90
- 4. **Refactor Under Green Only:** Never alter production code structure while tests are red. Refactor only when all existing assertions are green.
91
-
92
- ### DO's:
93
- - **DO:** Strictly adhere to the 5-Phase Agile Domain Lifecycle: Requirements ➔ Domain Analysis ➔ Outer Acceptance Test (RED) ➔ Inner Unit Test (RED-GREEN-REFACTOR) ➔ Outer Verification (GREEN).
94
- - **DO:** Follow Outside-In TDD (London School): Outer acceptance test ➔ collaborator discovery ➔ unit tests with test doubles.
95
- - **DO:** Maintain 100.00% line, branch, statement, and function coverage across all backend, contract, and frontend suites.
96
- - **DO:** Verify cross-package integration boundaries (Vite dev server reverse proxy, real network sockets, HTTP client JSON parsing) with automated full-stack smoke tests (`scripts/smoke_test.sh`).
97
- - **DO:** Keep functions small (under 20–30 lines) adhering to Single Level of Abstraction (SLAP) and Command-Query Separation (CQS).
98
-
99
- ### DONT's:
100
- - **DONT:** Never write a single line of production code without an existing failing test driving it.
101
- - **DONT:** Never write a test without prior domain analysis (Ubiquitous Language and invariant definition). Tests must assert domain invariants, not arbitrary syntax.
102
- - **DONT:** Never mock types you do not own; always wrap third-party dependencies in application-owned adapters.
103
- - **DONT:** Never equate in-memory test double passes (e.g. Supertest against in-memory Express instances) with real network transport, reverse proxying, or end-to-end user connectivity.
104
- - **DONT:** Never skip the Refactor phase under green; technical debt must not accumulate behind green tests.
105
- - **DONT:** Never use arbitrary `setTimeout()` or `sleep()` in tests; use deterministic event polling (`waitFor`).
86
+ ### The Immutable Three Laws of TDD (Uncle Bob & Kent Beck):
87
+ 1. **First Law:** You are not allowed to write any production code unless it is to make a single failing unit or acceptance test pass.
88
+ 2. **Second Law (Strict Incremental Boundary):** You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
89
+ 3. **Third Law (Minimal Production Code):** You are not allowed to write any more production code than is sufficient to pass the one currently failing test.
90
+
91
+ ---
92
+
93
+ ## 4. The Batch-Test Anti-Pattern & The Incremental Nano-Cycle
94
+
95
+ ### The "Test-First Waterfall" Anti-Pattern (BANNED)
96
+ A rampant anti-pattern in AI coding is dumping 10–20 test cases in a single test file, and then writing a 300-line implementation file in one shot so all tests pass simultaneously. **This is strictly prohibited.**
97
+ - **Why It Fails:** Writing all tests upfront is Waterfall in disguise. It forces the AI to hallucinate and lock in speculative method signatures and class structures before any code runs. If test #3 reveals a design flaw, tests #4–20 are broken legacy code before running.
98
+ - **Falsifiability Failure:** When 20 tests fail at once, you never prove that each individual assertion would catch its specific regression. Many batch tests are tautologies that pass by coincidence.
99
+
100
+ ### The Mandatory Incremental Nano-Cycle
101
+ Every collaborator discovered in Phase 4 must progress through micro-cycles of one behavior at a time:
102
+ 1. **RED (Micro-Assertion):** Write **ONE** test asserting a single micro-behavior (e.g. `expect(cart.total()).toBe(0)`).
103
+ 2. **VERIFY RED:** Run the test suite (`npm test`). **Inspect and verify the specific failure message** (e.g. "method not defined" or "expected 0, got undefined"). Never skip running the test while RED.
104
+ 3. **GREEN (Minimal Implementation):** Write the **absolute minimum production code** required to pass the single failing assertion (even hardcoding `return 0` if appropriate).
105
+ 4. **VERIFY GREEN:** Run the test suite. Confirm the test turns green with zero side effects.
106
+ 5. **REFACTOR (Under Green):** Clean up names, eliminate duplication (DRY), enforce SLAP and Clean Code standards while tests remain 100% green.
107
+ 6. **REPEAT:** Move to the next micro-behavior (e.g. `cart with 1 item returns item price`).
108
+
109
+ ---
110
+
111
+ ## 5. Ping-Pong Pair Programming Protocol with AI
112
+
113
+ When pairing with the human developer, operate in true **Ping-Pong TDD**:
114
+ ```
115
+ ┌─────────────────────────────────────────────────────────────┐
116
+ │ PING-PONG PAIR PROGRAMMING │
117
+ │ │
118
+ │ Turn 1 [Partner A]: Writes ONE micro-test assertion (RED) │
119
+ │ Turn 2 [System]: Runs test & displays verified failure │
120
+ │ Turn 3 [Partner B]: Writes MINIMAL code to pass (GREEN) │
121
+ │ Turn 4 [System]: Runs test & displays verified pass │
122
+ │ Turn 5 [Both]: Refactors under green (REFACTOR) │
123
+ │ Turn 6: Roles swap; repeat for next behavior │
124
+ └─────────────────────────────────────────────────────────────┘
125
+ ```
126
+ - **Collaborative Steering**: The human developer can write the test while the AI writes the minimal pass, or the AI can present each micro-test and await confirmation before implementing.
127
+ - **Continuous Alignment**: Design and data structures emerge organically through mutual feedback rather than monolithic code dumps.
106
128
 
@@ -1,20 +1,27 @@
1
1
  # Transactional Email Subsystem
2
2
 
3
- > **Core Mandate:** Enforce declarative email templates, safe variable interpolation, and deterministic local test delivery through Mailpit SMTP routing.
3
+ > **Core Mandate:** Enforce declarative email templates, strict HTML sanitization, decoupled asynchronous dispatch, and deterministic local test delivery through Mailpit SMTP routing.
4
4
 
5
5
  ---
6
6
 
7
7
  ## 1. Declarative & Typed Email Templates
8
8
 
9
9
  - **Declarative Template Definition**: Author transactional email templates using language-agnostic markup formats (such as **MJML - Mailjet Markup Language**) or typed component schemas to ensure cross-client rendering consistency across Outlook, Gmail, and Apple Mail.
10
- - **Safe Variable Interpolation**: Strictly prohibit unescaped raw HTML string concatenation. Always use context-aware template engines that automatically escape HTML special characters to prevent Cross-Site Scripting (XSS) and injection vulnerabilities.
10
+ - **Strict HTML Sanitization & Injection Defense**: Strictly prohibit unescaped raw HTML string concatenation. Centralize variable interpolation through a strict escaping utility neutralizing `&`, `<`, `>`, `"`, and `'` to prevent Cross-Site Scripting (XSS) and template injection vulnerabilities.
11
11
 
12
12
  ---
13
13
 
14
- ## 2. Local Mail Transport & Integration Verification
14
+ ## 2. Decoupled Transport & Background Queues
15
+
16
+ - **Async Queue Decoupling**: Decouple notification delivery from synchronous HTTP request-response cycles via an asynchronous job queue (e.g. BullMQ, Celery, or Transactional Outbox workers). API responses must never block on external network SMTP socket round-trips.
17
+ - **Zero-Dependency Native Sockets**: Prefer socket-based SMTP adapters adhering to RFC 5321 commands over heavy third-party mailer libraries to eliminate supply chain risks and transitive dependencies.
18
+
19
+ ---
20
+
21
+ ## 3. Local Mail Transport & Integration Verification
15
22
 
16
23
  - **Local SMTP via Mailpit**:
17
24
  - Route local and CI SMTP traffic to **Mailpit** (SMTP port 1025 / Web UI port 8025).
18
25
  - Never route emails to public mail transfer agents (MTAs) or external API gateways during automated test runs or local development.
19
26
  - **Deterministic API Assertion Protocol**:
20
- - Assert email delivery in integration tests by querying Mailpit's REST API (`GET /api/v1/messages`) to inspect recipient headers, delivery status, HTML body content, and verification links without timing dependencies.
27
+ - Assert email delivery in integration tests by querying Mailpit's REST API (`GET /api/v1/messages`) or testing against in-memory notification sinks to inspect recipient headers, delivery status, HTML body content, and verification links without timing dependencies.
@@ -139,30 +139,9 @@ Per [`docs/rules/ui_navigation.md`](./ui_navigation.md), all view state that rep
139
139
  4. **Pagination**: `?page=2&pageSize=25`
140
140
  5. **Drawers / Modals**: `?drawer=resource-102` or `?modal=create-order`
141
141
 
142
- ---
142
+ ## 7. Production UI Hygiene & Resilience Standards
143
143
 
144
- ## 7. Invariants, DO's & DONT's
145
-
146
- ### DO:
147
- - **DO** execute the 7-Pillar Design Architecture Triage before writing any UI code.
148
- - **DO** provide a collapsible left sidebar for operators that transitions into a slim 64px icon rail with hover tooltips and persists state in `localStorage`.
149
- - **DO** provide a dedicated, consumer-focused `/portal` layout for Members/Consumers with top and mobile-bottom navigation.
150
- - **DO** provide a public `/catalog` view for unauthenticated visitors to discover resources.
151
- - **DO** isolate developer demo personas into a dedicated dev-only floating toolbar (`import.meta.env.DEV`), completely decoupled from the real sign-in form.
152
- - **DO** enforce route guards on all routes, automatically redirecting users according to their authenticated role.
153
- - **DO** synchronize tabs, search terms, and pagination with URL search parameters.
154
- - **DO** use accessible Radix UI dialogs (`<ConfirmDialog>`) for destructive actions and ARIA live regions for status alerts.
155
- - **DO** synchronize authentication and tenant selection across browser tabs via `window.addEventListener('storage')`, and isolate complex subcomponents or page outlets using accessible `<ErrorBoundary>` components to prevent unhandled render exceptions from crashing the application shell.
156
- - **DO** decouple all technical internal telemetry (API gateway connection states, hexagonal port health, database adapter indicators, and active security roles) from user-facing screens and confine them exclusively to development tools and harnesses gated by `import.meta.env.DEV`.
157
- - **DO** centralize all user interface copy, status labels, error notifications, action titles, and templated messages into configuration constants (`UI_STRINGS`) to eliminate scattered hardcoded strings.
158
-
159
- ### DONT:
160
- - **DONT** build UI views on assumptions without completing the Design Architecture Triage Gate.
161
- - **DONT** embed mock/demo personas inside user-facing login or registration forms.
162
- - **DONT** force Member/Consumer users to navigate the enterprise operator sidebar with disabled buttons.
163
- - **DONT** expose multi-tenant organization switchers or system audit fields to consumer roles.
164
- - **DONT** expose internal architecture jargon (e.g. "ACID ledger", "Hexagonal ports", "API Connected", "Active Role") in production user-facing or administrator views.
165
- - **DONT** hardcode error messages, status labels, or button copy directly in page components; reference centralized configuration constants.
166
- - **DONT** use browser-native `window.alert()` or `window.confirm()` popups.
167
- - **DONT** rely solely on hiding UI buttons to enforce authorization; always wrap routes in `<ProtectedRoute>`.
168
- - **DONT** lose search queries or active tab states upon page reload; always sync to URL search params.
144
+ - **Multi-Tab State Synchronization**: Synchronize authentication and tenant selection across browser tabs using native `window.addEventListener('storage')`.
145
+ - **Fault-Tolerant Error Boundaries**: Wrap complex widgets, charts, and page outlets in accessible `<ErrorBoundary>` components to prevent runtime render exceptions from crashing the persistent application shell.
146
+ - **Strict Decoupling of Diagnostics & Telemetry**: Never expose internal architectural diagnostics (port health, connection badges, active role indicators) in production user-facing screens; gate diagnostic widgets strictly behind `import.meta.env.DEV`.
147
+ - **Centralized UI Copy (`UI_STRINGS`)**: Centralize all user interface copy, status labels, error notifications, and action button labels into configuration constants (`UI_STRINGS`) rather than scattering hardcoded strings across templates.
@@ -51,18 +51,3 @@ Every upstream-bound proposal logged to `changes.md` must follow the standardize
51
51
  - **Description:** Concise summary of the mutation or invariant added.
52
52
  - **Domain Filter Verification:** Verified 100% generic; purged of all project-specific business entities and models.
53
53
  ```
54
-
55
- ---
56
-
57
- ## 4. Invariants, DO's & DONT's
58
-
59
- ### DO's:
60
- - **DO:** Record candidate generic architectural improvements in `changes.md`.
61
- - **DO:** Distill all lessons and post-mortems into generic, domain-agnostic language before logging.
62
- - **DO:** Colocate DOs and DONTs directly inside the relevant atomic rules and skills.
63
- - **DO:** Verify that all entries in `changes.md` are 100% stack- and domain-agnostic.
64
-
65
- ### DONT's:
66
- - **DONT:** Never execute automated upstream git cloning or merge AI workflows during project work.
67
- - **DONT:** Never contaminate `changes.md` with project-specific business logic, schemas, or customer requirements.
68
- - **DONT:** Never leave machine-specific or absolute user paths in scripts or documentation.
@@ -98,21 +98,3 @@ Every state change across any entity or workflow MUST be immutably recorded in a
98
98
  | `reason` | String? | Optional justification or audit comment. |
99
99
  | `metadata` | JSON? | Snapshot of transition context or rule evaluation. |
100
100
  | `createdAt` | DateTime | Immutable timestamp of transition. |
101
-
102
- ---
103
-
104
- ## 4. Invariants (DO's & DONT's)
105
-
106
- ### DO
107
- - **DO** enforce core business invariants inside Aggregate Roots using strongly-typed state transitions.
108
- - **DO** decouple core domain state from operational display stages or tenant-specific sub-statuses.
109
- - **DO** use non-Turing complete expression languages (CEL) to evaluate dynamic transition guards.
110
- - **DO** maintain an immutable transition history table for all status alterations.
111
- - **DO** validate state transition graphs at creation time to prevent dead-end or unreachable states.
112
-
113
- ### DONT
114
- - **DONT** make financial or legal integrity states (e.g., `SETTLED`, `CANCELLED`, `REFUNDED`) freely rewritable by tenant configuration.
115
- - **DONT** expose generic status setters (`entity.setStatus(newStatus)`) on domain models.
116
- - **DONT** execute untrusted scripts or dynamic strings in the host runtime for workflow evaluations.
117
- - **DONT** allow a workflow orchestrator to bypass aggregate invariants by directly updating database columns.
118
- - **DONT** delete historical state transitions; status audit logs must be append-only.
package/memory.md CHANGED
@@ -1,262 +1,128 @@
1
1
  # Workspace Memory, Architecture Decisions & Knowledge Hub
2
2
 
3
- > **Core Purpose:** Authoritative persistent memory ledger for the workspace repository (`./`), maintaining Lightweight Architectural Decision Records (ADRs), system topologies, issue logs, and institutional lessons.
3
+ > **Core Purpose:** Authoritative persistent memory ledger for the workspace repository (`./`), maintaining Lightweight Architectural Decision Records (ADRs), system topologies, and living domain contracts.
4
4
 
5
5
  ---
6
6
 
7
7
  ## 1. Quick Navigation & Knowledge Repositories
8
8
 
9
9
  - 🗺️ **[System Knowledge Graph](./docs/knowledge/knowledge_graph.md)**: Architectural subsystems, Mermaid topologies, entity relationships, and fast-lookup matrices.
10
- - 📋 **[Consolidated DO's & DONT's](./docs/knowledge/dos_and_donts.md)**: High-impact rules, anti-patterns to avoid, and coding invariants.
11
- - 🐛 **[Coding Issue Log](./docs/knowledge/issue_log.md)**: Defect post-mortems, root causes, and synthesized preventing rules.
12
- - 💡 **[Institutional Lessons Learned](./docs/knowledge/lessons_learned.md)**: Strategic engineering takeaways and optimization insights.
10
+ - 📖 **[Living Ubiquitous Language Glossary](./docs/knowledge/ubiquitous_language.md)**: Authoritative, single-name domain vocabulary contract.
11
+ - 📜 **[Lightweight ADR Master Index](#adr-master-index)**: Summary of all architectural decisions and direct links to governing rules.
12
+ - 📝 **[Upstream Changes Ledger](./changes.md)**: Ledger of candidate improvements and generic patterns for upstream azcodr.
13
13
 
14
14
  ---
15
15
 
16
- ## 2. Architectural Decision Records (ADRs)
16
+ ## 2. Consolidated Architectural Decision Records (ADRs)
17
+
18
+ ### ADR Master Index
19
+
20
+ | ID | Title | Date | Status | Governing Rule / Skill |
21
+ |---|---|---|---|---|
22
+ | **ADR-001** | 100% Open-Source Tooling & Framework Mandate | 2026-09-16 | ACCEPTED | [`compliance.md`](./docs/rules/compliance.md), [`devsecops.md`](./docs/rules/devsecops.md) |
23
+ | **ADR-002** | Progressive Disclosure Architecture for Agentic Context | 2026-09-16 | ACCEPTED | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md), [`agentic-architect`](./.agents/skills/agentic-architect/SKILL.md) |
24
+ | **ADR-003** | Dual-Layer Multi-Tenancy Isolation with PostgreSQL RLS | 2026-09-16 | ACCEPTED | [`multitenancy_isolation.md`](./docs/rules/multitenancy_isolation.md) |
25
+ | **ADR-004** | Systemic Atomicity & Pure Single-Responsibility Rule Decomposition | 2026-09-16 | ACCEPTED | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md) |
26
+ | **ADR-005** | Universal Technology, Language, and Stack Agnosticism | 2026-09-18 | ACCEPTED | [`clean_code.md`](./docs/rules/clean_code.md), [`lets-build`](./.agents/skills/lets-build/SKILL.md) |
27
+ | **ADR-006** | Mandatory Full Lifecycle CRUD & Relational FK Selector Pattern | 2026-09-18 | ACCEPTED | [`database_integrity.md`](./docs/rules/database_integrity.md), [`rest_api_conventions.md`](./docs/rules/rest_api_conventions.md), [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md) |
28
+ | **ADR-007** | Decoupling Project Bootstrapping from Domain Analysis | 2026-09-18 | ACCEPTED | [`lets-build`](./.agents/skills/lets-build/SKILL.md), [`product-analyst`](./.agents/skills/product-analyst/SKILL.md) |
29
+ | **ADR-008** | Non-Negotiable 5-Phase Agile Domain Lifecycle & Outside-In TDD | 2026-09-18 | ACCEPTED | [`test_driven_development.md`](./docs/rules/test_driven_development.md), [`test_isolation.md`](./docs/rules/test_isolation.md) |
30
+ | **ADR-009** | Many-to-Many Skill Composability & Orthogonal Pipelines | 2026-09-18 | ACCEPTED | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md), [`agentic-architect`](./.agents/skills/agentic-architect/SKILL.md) |
31
+ | **ADR-011** | Canonical 6 Total Audit Fields Architecture & Modern React Stack | 2026-09-19 | ACCEPTED | [`database_integrity.md`](./docs/rules/database_integrity.md), [`react.md`](./docs/rules/react.md) |
32
+ | **ADR-012** | State Machine Lifecycle Configurability & Ubiquitous Language Contract | 2026-09-19 | ACCEPTED | [`workflow_state_machines.md`](./docs/rules/workflow_state_machines.md), [`domain_driven_design.md`](./docs/rules/domain_driven_design.md) |
33
+ | **ADR-013** | Design Architecture Triage, Persistent Shell & Dev Persona Isolation | 2026-09-20 | ACCEPTED | [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md), [`authentication.md`](./docs/rules/authentication.md) |
34
+ | **ADR-014** | Product Ownership, Prioritization Models, SMART Tasks & INVEST Slicing | 2026-09-21 | ACCEPTED | [`product_ownership.md`](./docs/rules/product_ownership.md), [`requirements_engineering.md`](./docs/rules/requirements_engineering.md), [`project_management.md`](./docs/rules/project_management.md) |
35
+ | **ADR-015** | Problem-First Architecture, Topology Scaffolding, Tipping Points & Nano-TDD | 2026-09-25 | ACCEPTED | [`clean_code.md`](./docs/rules/clean_code.md), [`domain_driven_design.md`](./docs/rules/domain_driven_design.md), [`test_driven_development.md`](./docs/rules/test_driven_development.md), [`lets-build`](./.agents/skills/lets-build/SKILL.md) |
17
36
 
18
- ### ADR-001: 100% Open-Source Tooling & Framework Mandate
37
+ ---
38
+
39
+ ### Lightweight Decision Summaries
40
+
41
+ #### ADR-001: 100% Open-Source Tooling & Framework Mandate
19
42
  - **Date:** 2026-09-16 | **Status:** ACCEPTED
20
43
  - **Context:** Proprietary SaaS dependencies introduce vendor lock-in, recurring operational costs, and black-box security risks.
21
- - **Decision:** Standardize exclusively on open-source solutions across all domains (PostgreSQL, Redis, Trivy, Semgrep, Gitleaks, OpenTelemetry, Vitest, Playwright, Radix UI).
22
- - **Consequences:** Maximizes infrastructure control, auditable security compliance, and zero license encumbrances.
44
+ - **Decision:** Standardize exclusively on open-source solutions across all architectural domains (PostgreSQL, Redis, Trivy, Semgrep, Gitleaks, OpenTelemetry, Vitest, Playwright, Radix UI).
45
+ - **Enforced In:** Root [`AGENTS.md`](./AGENTS.md), [`compliance.md`](./docs/rules/compliance.md), [`devsecops.md`](./docs/rules/devsecops.md).
23
46
 
24
- ### ADR-002: Progressive Disclosure Architecture for Agentic Context
47
+ #### ADR-002: Progressive Disclosure Architecture for Agentic Context
25
48
  - **Date:** 2026-09-16 | **Status:** ACCEPTED
26
- - **Context:** Injecting large monolithic documentation files on every AI prompt exhausts token windows and degrades attention and reasoning.
27
- - **Decision:** Keep root `AGENTS.md` lean (≤ 120 lines), decoupling specialized engineering manuals into modular files under `docs/rules/`.
28
- - **Consequences:** Eliminates prompt token bloat while ensuring deep domain guidance is loaded strictly on demand.
49
+ - **Context:** Injecting large monolithic documentation files on every AI prompt exhausts token windows and degrades model attention.
50
+ - **Decision:** Keep root `AGENTS.md` lean (≤ 120 lines), decoupling specialized engineering manuals into modular files under `docs/rules/` and skills under `.agents/skills/`.
51
+ - **Enforced In:** Root [`AGENTS.md`](./AGENTS.md), [`agentic_configuration.md`](./docs/rules/agentic_configuration.md), [`agentic-architect`](./.agents/skills/agentic-architect/SKILL.md).
29
52
 
30
- ### ADR-003: Dual-Layer Multi-Tenancy Isolation with PostgreSQL RLS
53
+ #### ADR-003: Dual-Layer Multi-Tenancy Isolation with PostgreSQL RLS
31
54
  - **Date:** 2026-09-16 | **Status:** ACCEPTED
32
55
  - **Context:** Application-level `where: { tenantId }` filtering is prone to human error, risking catastrophic cross-tenant data leaks.
33
56
  - **Decision:** Combine application middleware context resolution with database-level PostgreSQL Row-Level Security (RLS) policies as an immutable backstop.
34
- - **Consequences:** Physical isolation at the database layer; prevents cross-tenant data access even if application code forgets a filter.
57
+ - **Enforced In:** [`multitenancy_isolation.md`](./docs/rules/multitenancy_isolation.md).
35
58
 
36
- ### ADR-004: Systemic Atomicity & Pure Single-Responsibility Rule Decomposition
59
+ #### ADR-004: Systemic Atomicity & Pure Single-Responsibility Rule Decomposition
37
60
  - **Date:** 2026-09-16 | **Status:** ACCEPTED
38
61
  - **Context:** Composite rules with conjunction names (`this_and_that.md`) mix disparate technical concerns, creating documentation bloat and ambiguity.
39
62
  - **Decision:** Decompose all rules into strictly atomic, single-topic rule files with zero conjunction names, enforcing Single Responsibility Principle across skills, rules, and database operations.
40
- - **Consequences:** 37 highly modular, composable, and maintainable domain rules with zero cross-leakage.
63
+ - **Enforced In:** Root [`AGENTS.md`](./AGENTS.md), [`agentic_configuration.md`](./docs/rules/agentic_configuration.md).
41
64
 
42
- ### ADR-005: Universal Technology, Language, and Stack Agnosticism
65
+ #### ADR-005: Universal Technology, Language, and Stack Agnosticism
43
66
  - **Date:** 2026-09-18 | **Status:** ACCEPTED
44
- - **Context:** Tightly coupling architecture rules and specifications to a single programming language (TypeScript), runtime (Node.js), ORM (Prisma), or database engine (PostgreSQL) creates technical lock-in and prevents polyglot implementation.
45
- - **Decision:** Adopt a Two-Tier Hexagonal / Ports-and-Adapters model across the entire system. Tier 1 mandates 100% technology-, language-, and stack-agnostic invariant domain capabilities and open standard specifications (Protocol Buffers v3, OpenAPI 3.1, JSON Schema Draft 2020-12, AsyncAPI, CloudEvents, W3C DTCG Design Tokens, CEL, Wasm/WASI, OPA/OpenFGA) with zero language bias or primary reference designation. Tier 2 encapsulates interchangeable polyglot adapters (Go, Rust, Python, Java, TypeScript, etc.).
46
- - **Consequences:** Eliminates language and framework lock-in, enables polyglot microservice implementation, future-proofs the enterprise architecture, and enforces pure boundary decoupling.
67
+ - **Context:** Coupling architecture rules to a single programming language or database creates technical lock-in and prevents polyglot implementation.
68
+ - **Decision:** Adopt a Two-Tier Hexagonal / Ports-and-Adapters model across the entire system: Tier 1 mandates 100% technology-, language-, and stack-agnostic invariant domain capabilities and open standard specifications; Tier 2 encapsulates interchangeable polyglot adapters.
69
+ - **Enforced In:** Root [`AGENTS.md`](./AGENTS.md), [`clean_code.md`](./docs/rules/clean_code.md), [`lets-build`](./.agents/skills/lets-build/SKILL.md).
47
70
 
48
- ### ADR-006: Mandatory Full Lifecycle CRUD and Relational Foreign Key Selector Pattern
71
+ #### ADR-006: Mandatory Full Lifecycle CRUD & Relational Foreign Key Selector Pattern
49
72
  - **Date:** 2026-09-18 | **Status:** ACCEPTED
73
+ - **Context:** Prototypes often provide partial CRUD, leaving entities un-editable or undeletable. Exposing foreign keys as raw text inputs causes severe relational errors.
74
+ - **Decision:** Every feature must implement complete lifecycle CRUD (Create, Read/Detail, Update/Transition, Delete/Archive) with 100.00% test coverage. Foreign keys must never be exposed as raw string inputs; they must be resolved via accessible relational dropdown selectors displaying contextual business metadata.
75
+ - **Enforced In:** [`database_integrity.md`](./docs/rules/database_integrity.md), [`rest_api_conventions.md`](./docs/rules/rest_api_conventions.md), [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md).
50
76
 
51
- #### 1. Context & Problem Statement
52
- Prototypes often provide only partial read and create actions, leaving entities unable to be edited, status-transitioned, or archived/deleted. Furthermore, foreign key associations (such as `parentEntityId`, `resourceId`) are frequently exposed as raw text inputs where users must manually know and type string/UUID identifiers. This creates significant relational failure rates (400 Bad Request, foreign key violations) and breaks standard user experience.
53
-
54
- #### 2. Decision Drivers
55
- - Every feature must support its complete lifecycle CRUD (Create, Read/Detail, Update/Transition, Delete/Archive) before being considered feature-complete.
56
- - Foreign keys must never be exposed as raw text fields in the UI. Relational references must be resolved and selected via structured UI primitives (e.g. `<Select>`) displaying human-readable contextual metadata (e.g. names, titles, codes, labels, and status).
57
- - Domain and use case layers must strictly validate foreign key existence before persisting child entities, returning RFC 7807 problem details if referenced records do not exist.
58
-
59
- #### 3. Decision Outcome & Consequences
60
- - **Chosen Pattern:**
61
- 1. Primary and secondary ports support comprehensive CRUD operations (`update`, `delete`, catalog queries).
62
- 2. Use cases enforce foreign key invariants with parent record existence checks prior to child entity mutation.
63
- 3. Presentation layer replaces all raw identifier text inputs with accessible relational dropdown selectors backed by dynamic API queries.
64
- 4. Test suites maintain 100.00% test coverage gate across all CRUD methods, branches, and error paths.
65
- - **Positive Consequences:**
66
- - Complete elimination of relational integrity errors caused by typos or non-existent IDs.
67
- - Richer user experience displaying contextual business metadata during association.
68
- - Strict compliance with workspace definitions of done and 100.00% coverage gates.
69
-
70
- ### ADR-007: Strict Decoupling of Project Bootstrapping from Domain Analysis and Feature Engineering
77
+ #### ADR-007: Strict Decoupling of Project Bootstrapping from Domain Analysis
71
78
  - **Date:** 2026-09-18 | **Status:** ACCEPTED
79
+ - **Context:** Agents running `/lets-build` frequently fabricate domain entities on sheer assumptions during technical bootstrapping, skipping requirements discovery.
80
+ - **Decision:** Project bootstrapping terminates strictly after technical skeleton creation and health probe verification (`Phase 5`). A mandatory Handover Gate halts coding and directs the agent to initiate Domain Analysis via `product-analyst` and `relentless-questioner` before domain models or schemas are authored.
81
+ - **Enforced In:** [`lets-build`](./.agents/skills/lets-build/SKILL.md), [`product-analyst`](./.agents/skills/product-analyst/SKILL.md), [`requirements_engineering.md`](./docs/rules/requirements_engineering.md), [`domain_driven_design.md`](./docs/rules/domain_driven_design.md).
72
82
 
73
- #### 1. Context & Problem Statement
74
- During initial project execution with `/lets-build`, technical infrastructure bootstrapping (stack selection, monorepo setup, package manifests, build toolchains) is frequently conflated with application domain modeling. Agents tend to fabricate business entities without engaging the user in thorough domain discovery, Ubiquitous Language alignment, Bounded Context mapping, or INVEST user story decomposition. This violates Rule Zero ("Assume nothing") and skips the foundational requirements engineering lifecycle.
75
-
76
- #### 2. Decision Drivers
77
- - Project bootstrapping must be strictly scoped to technical plumbing (workspace configuration, package manifests, ports/adapters skeletons, build commands, Docker/Compose, and a minimal `/healthz` probe).
78
- - Domain modeling and feature engineering must never be assumed or generated by an agent during bootstrapping.
79
- - Domain features must emerge exclusively through structured stakeholder interviews using `product-analyst`, `relentless-questioner`, `docs/rules/domain_driven_design.md`, and `docs/rules/requirements_engineering.md`.
80
-
81
- #### 3. Decision Outcome & Consequences
82
- - **Chosen Pattern:**
83
- 1. `/lets-build` strictly terminates after technical skeleton creation and health probe verification (`Phase 5`).
84
- 2. A mandatory Handover Gate halts further coding and directs the agent to initiate Domain Analysis.
85
- 3. Domain models, database schemas, and API resources are authored iteratively only after user stories and Gherkin criteria are approved.
86
- - **Positive Consequences:**
87
- - Prevents premature code generation and hallucinated domain structures.
88
- - Aligns software design with real stakeholder requirements rather than AI guesses.
89
- - Ensures proper Outside-In Double-Loop TDD execution.
90
-
91
- ### ADR-008: Non-Negotiable 5-Phase Agile Domain Lifecycle & Outside-In TDD Invariant
83
+ #### ADR-008: Non-Negotiable 5-Phase Agile Domain Lifecycle & Outside-In TDD Invariant
92
84
  - **Date:** 2026-09-18 | **Status:** ACCEPTED
85
+ - **Context:** Writing production code before tests or domain understanding leads to brittle code, regressions, and "toy prototypes."
86
+ - **Decision:** Enforce an immutable 5-Phase Agile Domain Lifecycle across all tasks (Requirements ➔ Domain Analysis ➔ Outer Acceptance RED ➔ Inner Unit TDD RED-GREEN-REFACTOR ➔ Outer GREEN & DoD). Writing production code without a failing test is strictly prohibited.
87
+ - **Enforced In:** Root [`AGENTS.md`](./AGENTS.md), [`test_driven_development.md`](./docs/rules/test_driven_development.md), [`test_isolation.md`](./docs/rules/test_isolation.md).
93
88
 
94
- #### 1. Context & Problem Statement
95
- Engineering practices frequently suffer from shortcutting: writing production code before writing tests, writing tests before understanding domain models, and designing domain models without engaging stakeholders. This leads to brittle software, high defect rates, mismatched requirements, and the "toy prototype blunder" where foreign key relationships, validation rules, and proxy transports are improperly implemented.
96
-
97
- #### 2. Decision Drivers
98
- - Need for a mathematically rigorous, repeatable, and non-negotiable software engineering process.
99
- - Guarantee that all production code is justified by an existing, failing automated test (Red-Green-Refactor).
100
- - Guarantee that tests assert real business invariants derived from rigorous domain analysis rather than arbitrary syntax.
101
- - Guarantee that requirements are decomposed into vertically sliced, testable INVEST user stories and Gherkin scenarios.
102
-
103
- #### 3. Decision Outcome & Consequences
104
- - **Chosen Pattern:** Enforce an immutable 5-Phase Agile Domain Lifecycle across all tasks:
105
- 1. **Phase 1: Requirements Engineering** (INVEST user stories + executable Gherkin Given/When/Then scenarios + Negative Scope).
106
- 2. **Phase 2: Tactical Domain Analysis** (Ubiquitous Language definitions + Bounded Contexts + Aggregate Roots with invariants + State Machines).
107
- 3. **Phase 3: Outer-Loop Acceptance Test (RED)** (Failing UI component interaction test via Playwright/React Testing Library, or black-box HTTP route contract test).
108
- 4. **Phase 4: Inner-Loop TDD & Collaborator Discovery (RED-GREEN-REFACTOR)** (Collaborators discovered by outer loop unit-tested in isolation, minimal code written to pass, strict refactoring under green).
109
- 5. **Phase 5: Outer Acceptance Resolution & Definition of Done** (Outer test turns GREEN, cross-package boundary smoke tests pass, 100.00% coverage verified).
110
- - **Zero-Deviation Mandate:**
111
- - Writing production code without a failing test is strictly prohibited.
112
- - Generating domain entities without stakeholder requirements analysis is strictly prohibited.
113
- - Committing code without 100.00% full-stack test coverage and boundary verification is strictly prohibited.
114
- - **Positive Consequences:**
115
- - Eliminates regression bugs and defect escapes to production.
116
- - Ensures clean, maintainable architecture with small functions (< 30 lines) adhering to SLAP, CQS, and DRY.
117
- - Guarantees complete alignment between user intent, domain models, tests, and deployed code.
118
-
119
- ### ADR-009: Many-to-Many Skill Composability & Orthogonal Pipeline Architecture
89
+ #### ADR-009: Many-to-Many Skill Composability & Orthogonal Pipeline Architecture
120
90
  - **Date:** 2026-09-18 | **Status:** ACCEPTED
91
+ - **Context:** Complex engineering tasks require multiple orthogonal skills; coupling skills into monolithic bundles causes context bloat and cross-contamination.
92
+ - **Decision:** Codify Many-to-Many skill composability via three formal patterns: Sequential Pipeline Chaining, Dynamic Skill Stacking, and Multi-Agent Subagent Delegation, with standardized output contracts, pure function semantics, and zero cross-contamination.
93
+ - **Enforced In:** [`agentic_configuration.md`](./docs/rules/agentic_configuration.md), [`agentic-architect`](./.agents/skills/agentic-architect/SKILL.md).
121
94
 
122
- #### 1. Context & Problem Statement
123
- In agentic software engineering, a naive assumption is that a single skill corresponds 1:1 to a single task or development phase. In reality, software development exhibits an explicit Many-to-Many ($M:N$) relationship between coding tasks and agentic capabilities:
124
- 1. A single coding task simultaneously requires multiple specialized skills: domain requirement decomposition, invariant modeling, security compliance auditing, and clean code refactoring.
125
- 2. A single skill (e.g. `clean-code-refactor` or `relentless-questioner`) is orthogonal to any specific domain and must be reused across widely diverse scenarios (database transactions, HTTP middleware, UI components, and background queues).
126
- If skills are designed as monolithic, coupled bundles, agent contexts suffer prompt bloat, cognitive dilution, and cross-contamination.
127
-
128
- #### 2. Decision Drivers
129
- - Need for high reusability and atomic modularity across agent skills without prompt token bloat.
130
- - Need for predictable, deterministic execution when multiple skills are required for a single complex engineering task.
131
- - Need for clean input/output contracts so skills can be piped or composed sequentially, contextually, or across subagents without side effects.
132
- - Strict adherence to Rule Zero ("Assume nothing"), Systemic Atomicity, and the Single Responsibility Principle.
133
-
134
- #### 3. Decision Outcome & Consequences
135
- - **Chosen Pattern:** Codify and enforce the Many-to-Many Skill Composability Architecture across three formal composition patterns:
136
- 1. **Pattern 1: Sequential Pipeline Chaining (Workflow Composition):** Upstream skills produce structured, standardized artifacts (FAS, INVEST stories, Gherkin blocks, OpenAPI contracts) serving as the direct input contract for downstream skills.
137
- 2. **Pattern 2: Dynamic Skill Stacking (Contextual Composition):** An agent dynamically loads multiple orthogonal skills into its working memory based on task needs, adhering to Progressive Disclosure without polluting base prompts.
138
- 3. **Pattern 3: Multi-Agent Subagent Delegation (Division of Labor):** A coordinator agent spawns specialized subagents equipped with specific atomic skills, synthesizing findings into a single coordinated action.
139
- - **Architectural Invariants for Valid Skill Composition:**
140
- - **Standardized Output Contracts:** Every skill emits standardized, machine- and human-readable artifacts.
141
- - **Zero Cross-Contamination:** A skill must never write or mutate code outside its declared functional boundary.
142
- - **Pure Function Semantics:** Analytical, audit, and questioning skills must remain read-only and side-effect free.
143
- - **Positive Consequences:**
144
- - Skills remain strictly atomic, modular, and reusable across unlimited domains and stacks.
145
- - Eliminates prompt bloat by loading only the exact skills needed for the current lifecycle step.
146
- - Supports complex end-to-end workflows through deterministic artifact piping.
147
-
148
- ### ADR-011: The Canonical 6 Total Audit Fields Architecture & Modern React Stack
95
+ #### ADR-011: The Canonical 6 Total Audit Fields Architecture & Modern React Stack
149
96
  - **Date:** 2026-09-19 | **Status:** ACCEPTED
97
+ - **Context:** Inconsistent audit tracking risks SOC 2 / ISO 27001 non-compliance. Frontend `useEffect` fetch loops cause stale states and race conditions.
98
+ - **Decision:** Every mutable stateful table must implement the Canonical 6 Total Audit Fields (`createdAt`, `createdBy`, `updatedAt`, `updatedBy`, `deletedAt`, `deletedBy`), with append-only ledgers omitting update/delete fields. Standardize frontend on TanStack Query, React Hook Form + Zod, and headless Radix primitives.
99
+ - **Enforced In:** [`database_integrity.md`](./docs/rules/database_integrity.md), [`react.md`](./docs/rules/react.md).
150
100
 
151
- #### 1. Context & Problem Statement
152
- Stateful entities across databases and domain models frequently suffer from inconsistent audit accountability—omitting actor attribution (`createdBy`, `updatedBy`) or destructive deletion tracking (`deletedAt`, `deletedBy`). Furthermore, frontend state management often defaults to ad-hoc `useEffect` fetch loops and unvalidated forms without structured caching, automated mutation invalidation, or sound schema contracts.
153
-
154
- #### 2. Decision Drivers
155
- - Universal Total Audit Accountability: Every stateful database table, ORM entity, and domain aggregate must implement **The Canonical 6 Total Audit Fields**: `createdAt`, `createdBy`, `updatedAt`, `updatedBy`, `deletedAt`, and `deletedBy`.
156
- - Strictly Immutable Ledger Invariant: Append-only financial ledgers and event outboxes must enforce strict immutability, prohibiting `updatedAt`, `updatedBy`, `deletedAt`, and `deletedBy`.
157
- - Non-Destructive Soft-Delete: All delete operations must mark `deletedAt` and `deletedBy` with actor attribution, and queries for active records must strictly filter `WHERE deletedAt IS NULL`.
158
- - Modern React Architecture: Standardize on `@tanstack/react-query` for asynchronous server state, caching, and optimistic mutations; standardize on `react-hook-form` / `tanstack-form` + `zod` for type-safe form contracts; mandate accessible headless primitives (`shadcn/ui` + `@radix-ui`) with zero native alerts.
159
-
160
- #### 3. Decision Outcome & Consequences
161
- - Codified Section 5 & 6 in [`docs/rules/database_integrity.md`](./docs/rules/database_integrity.md) mandating the Canonical 6 Total Audit Fields and append-only ledger invariants.
162
- - Authored [`docs/rules/react.md`](./docs/rules/react.md) codifying TanStack Query, React Hook Form + Zod, TanStack Table, and accessible `<ConfirmDialog>` primitives.
163
- - Upgraded `lets-build` architecture interview matrix (Dimensions 6 & 13) to interrogate audit fields and form state management during scaffolding.
164
- - **Positive Consequences:**
165
- - Complete compliance with SOC 2 / ISO 27001 auditability controls.
166
- - Permanent prevention of accidental data loss via soft deletion.
167
- - Predictable, type-safe frontend state management with zero stale cache bugs.
168
-
169
- ### ADR-012: State Machine Lifecycle Configurability & Living Ubiquitous Language Contract
101
+ #### ADR-012: State Machine Lifecycle Configurability & Living Ubiquitous Language Contract
170
102
  - **Date:** 2026-09-19 | **Status:** ACCEPTED
103
+ - **Context:** Unconstrained state configurability causes the "Inner Platform Effect." Linguistic drift between business terms and code identifiers breaks domain models.
104
+ - **Decision:** Bifurcate state into Core Invariant States (Hard FSM in compiled aggregate roots) and Operational Workflow Stages (Soft FSM in declarative JSON state transition matrices evaluated via CEL/Temporal). Maintain a living, single-name Ubiquitous Language Glossary contract.
105
+ - **Enforced In:** [`workflow_state_machines.md`](./docs/rules/workflow_state_machines.md), [`domain_driven_design.md`](./docs/rules/domain_driven_design.md), [`ubiquitous_language.md`](./docs/knowledge/ubiquitous_language.md).
171
106
 
172
- #### 1. Context & Problem Statement
173
- Two recurring systemic questions arise during enterprise architecture evolution:
174
- 1. *State Configurability Paradox:* Should all status fields and business logic be user/tenant-configurable? Unconstrained configurability leads to the "Inner Platform Effect" anti-pattern, where core domain invariants collapse.
175
- 2. *Linguistic Drift & Agreement:* How can domain-code language agreement be maintained deterministically across product requirements, code, tests, and database tables without vocabulary divergence?
176
-
177
- #### 2. Decision Drivers
178
- - Invariant Integrity: Core business invariants (e.g. accounting balance, executed orders) must be non-negotiable and protected inside compiled Aggregate Roots.
179
- - Operational Customization: Multi-tenant platforms require configurable review stages, approval funnels, and sub-statuses.
180
- - Guaranteed Linguistic Alignment: Establish a binding, living contract between business vocabulary and source code identifiers, backed by AST linter rules and branded nominal types.
181
-
182
- #### 3. Decision Outcome & Consequences
183
- - **The Dual-State Architecture ([`docs/rules/workflow_state_machines.md`](./docs/rules/workflow_state_machines.md)):**
184
- - Bifurcated state into:
185
- 1. *Core Invariant States (Hard FSM)*: Enforced strictly inside compiled Aggregate Roots using Discriminated Unions or the GoF State Pattern.
186
- 2. *Operational Workflow Stages (Soft FSM)*: Managed via Declarative State Transition Matrices stored in JSON/metadata, evaluated via Common Expression Language (CEL) or durable workflow engines (Temporal / BPMN 2.0).
187
- - Enforced a mandatory append-only State Transition Log (`transitionId`, `entityType`, `entityId`, `fromState`, `toState`, `actorId`, `event`, `timestamp`).
188
- - **Domain-Code Language Agreement ([`docs/rules/domain_driven_design.md`](./docs/rules/domain_driven_design.md) & [`docs/knowledge/ubiquitous_language.md`](./docs/knowledge/ubiquitous_language.md)):**
189
- - Codified the "Single Name Rule" and zero-tolerance for synonyms.
190
- - Established the living glossary template and AST linter denylist patterns.
191
- - **Upgraded Skills & References:**
192
- - Enhanced `product-analyst` and `lets-build` (Dimensions 19 & 20) to interrogate state taxonomy and verify glossary alignment.
193
- - **Positive Consequences:**
194
- - Complete architectural clarity: aggregate invariants remain inviolate while operational workflows gain full tenant configurability.
195
- - Elimination of linguistic drift across domain models, APIs, and UI layers.
196
-
197
- ### ADR-013: Formal Design Architecture Triage Framework, Persistent Navigation Shell, Dual-Experience Portals, and Strict Isolation of Development Personas from Production Authentication
107
+ #### ADR-013: Design Architecture Triage Framework, Persistent Shell & Dev Persona Isolation
198
108
  - **Date:** 2026-09-20 | **Status:** ACCEPTED
109
+ - **Context:** Conflating developer demo personas with production auth creates toy-like prototypes. Untriaged UI produces layout shifts and broken navigation.
110
+ - **Decision:** Mandate the 7-Pillar Design Architecture Triage Gate before writing UI code; separate Enterprise Operator Workspace (`/`) from Consumer Portal (`/portal`); standardize on a persistent shell with 64px collapsible icon rail and bidirectional URL state sync; strictly isolate developer demo personas into a dev-only floating toolbar (`import.meta.env.DEV`).
111
+ - **Enforced In:** [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md), [`authentication.md`](./docs/rules/authentication.md), [`ui_navigation.md`](./docs/rules/ui_navigation.md).
199
112
 
200
- #### 1. Context & Problem Statement
201
- UI development without upfront design architecture triage creates severe user experience and security failure modes:
202
- 1. Conflating developer demo/mock personas with end-user sign-in flows, producing a toy-like prototype that confuses real users.
203
- 2. Mixing operator-dense navigation with consumer self-service workflows into a single chaotic layout.
204
- 3. Lack of a persistent application shell and collapsible sidebar, causing disruptive layout shifts and broken navigation state on page transitions.
205
- 4. Missing deep-linkable URL synchronization for active tabs, search queries, and drawers.
206
-
207
- #### 2. Decision Drivers
208
- - Need for a mandatory upfront design gate before writing UI code.
209
- - Strict physical separation between developer test harnesses and production authentication.
210
- - Strict architectural duality between enterprise operator workspaces and consumer/member portals.
211
- - Persistent app shell with collapsible 64px icon rail mode, persistent state in `localStorage`, and bidirectional URL search parameter synchronization.
212
-
213
- #### 3. Decision Outcome & Consequences
214
- - **The 7-Pillar Design Architecture Triage Gate ([`docs/rules/ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md)):**
215
- - Mandated 7 triage pillars (Role Triage, Information Architecture, Duality, Wayfinding, URL Sync, Route Guards, Accessibility) before building UI increments.
216
- - **Strict Decoupling of Developer Personas ([`docs/rules/authentication.md`](./docs/rules/authentication.md)):**
217
- - Developer demo personas are completely isolated into a dev-only floating toolbar (`import.meta.env.DEV`), completely excluded from production bundles.
218
- - Production sign-in enforces clean, dedicated forms with Zod schema validation and role-based post-login redirection.
219
- - **Dual-Experience Model & Persistent Shell:**
220
- - Separated Enterprise Operator Workspace (`/`) from Consumer / Member Self-Service Portal (`/portal`).
221
- - Standardized persistent header, contextual breadcrumbs, collapsible sidebar with 64px icon rail, and URL search param state sync.
222
- - **Positive Consequences:**
223
- - Eliminates toy-like demo persona leaks in production.
224
- - Clean separation between dense administrative workflows and consumer self-service.
225
- - Fully accessible, deep-linkable web applications conforming to WCAG 2.2 AA.
226
-
227
- ### ADR-014: Product Ownership, Backlog Prioritization Models, SMART Developer Tasks, and INVEST Slicing
113
+ #### ADR-014: Product Ownership, Backlog Prioritization Models, SMART Developer Tasks & INVEST Slicing
228
114
  - **Date:** 2026-09-21 | **Status:** ACCEPTED
229
-
230
- #### 1. Context & Problem Statement
231
- Agile teams frequently suffer from the "Feature Factory" anti-pattern: measuring output (story points burned, code volume) instead of outcome (customer value realized, satisfaction gap closed). Additional failure modes include:
232
- 1. Conflating user stories with formal requirements rather than treating them as conversational placeholders (the 3 C's) and pidgin language bridges.
233
- 2. Forcing system invariants, security controls, and architectural spikes into artificial `"As a user..."` syntax.
234
- 3. Slicing stories horizontally (e.g. database migration only or UI mock only) delivering zero usable software to customers.
235
- 4. Open-ended developer tasks lacking measurable pass/fail boundaries, leading to multi-day task drift.
236
- 5. Arbitrary backlog prioritization driven by executive gut feeling rather than quantitative value models.
237
-
238
- #### 2. Decision Drivers
239
- - Ground product development in empiricism (Build-Measure-Learn) and clear Product Goals.
240
- - Connect strategic Objectives and Key Results (OKRs) to backlog ordering.
241
- - Standardize objective prioritization frameworks (Kano Model, MoSCoW, RICE, Buy a Feature).
242
- - Mandate Bill Wake's INVEST criteria and vertical cake slicing (UI ➔ API ➔ Domain ➔ DB).
243
- - Standardize Bill Wake's SMART framework for decomposing user stories into bounded developer tasks (2–4 hours).
244
-
245
- #### 3. Decision Outcome & Consequences
246
- - **Dedicated Rule & Skill ([`docs/rules/product_ownership.md`](./docs/rules/product_ownership.md), [`.agents/skills/product-analyst/`](./.agents/skills/product-analyst/)):**
247
- - Codified Product Owner accountabilities, the satisfaction gap, and outcome vs. output discipline.
248
- - Added reference guides for Kano, MoSCoW, RICE scoring, and OKR alignment.
249
- - **Requirements Engineering & Vertical Cake Slicing ([`docs/rules/requirements_engineering.md`](./docs/rules/requirements_engineering.md)):**
250
- - Clarified that user stories are tokens for conversation (Ron Jeffries' 3 C's: Card, Conversation, Confirmation).
251
- - Explicitly decoupled non-story requirements (system invariants, NFRs, architectural spikes) from story syntax.
252
- - Enforced multi-layer cake vertical slicing across all layers.
253
- - **SMART Developer Task Breakdown ([`docs/rules/project_management.md`](./docs/rules/project_management.md)):**
254
- - Required decomposing INVEST stories into Specific, Measurable, Achievable, Relevant, and Time-boxed (2–4h) developer tasks.
255
- - **Positive Consequences:**
256
- - Guarantees working software in every vertical increment.
257
- - Eliminates horizontal stubs and open-ended technical drift.
258
- - Objective backlog ranking minimizes stakeholder friction.
259
-
260
-
261
-
115
+ - **Context:** Teams frequently measure output (lines of code, story points) rather than outcome (customer value), leading to the "Feature Factory" anti-pattern.
116
+ - **Decision:** Ground backlog ordering in quantitative prioritization (Kano, MoSCoW, RICE) aligned with OKRs; decompose epics into vertically sliced INVEST user stories; decompose user stories into bounded SMART developer tasks (2–4 hours).
117
+ - **Enforced In:** [`product_ownership.md`](./docs/rules/product_ownership.md), [`requirements_engineering.md`](./docs/rules/requirements_engineering.md), [`project_management.md`](./docs/rules/project_management.md), [`product-analyst`](./.agents/skills/product-analyst/SKILL.md).
118
+
119
+ #### ADR-015: Problem-First Architecture, Topology Scaffolding, Evolutionary Tipping Points & Incremental Nano-Cycle TDD
120
+ - **Date:** 2026-09-25 | **Status:** ACCEPTED
121
+ - **Context:** Tool-first planning (asking for languages, databases, and microservices upfront) creates accidental complexity and forces non-backend projects (such as Chrome extensions, game engines, or CLIs) into heavy enterprise templates (as observed in `force-dark-light`). Furthermore, AI assistants naturally accelerate architectural drift by appending code without structural evolution, and fake TDD by batch-generating 15 tests and implementations at once.
122
+ - **Decision:**
123
+ 1. Enforce **Problem-First Architecture**: Strictly separate Problem Space from Solution Space (Evans, Vernon, Brooks). Derive tools and runtimes from problem constraints (latency budget, GC tolerance, memory, execution target).
124
+ 2. Implement **Topology-Aware Scaffolding**: Eliminate universal templates. Match architectural styles to system topologies (Platform Scripting for extensions, Data-Oriented Design for game engines, Command Pipeline for CLIs, Hexagonal for enterprise backends).
125
+ 3. Codify **Evolutionary Architecture & Architectural Tipping Points**: Enforce Kent Beck's "Refactor-Before-Add" protocol and 5 explicit tipping points to halt AI-generated code rot.
126
+ 4. Mandate **True Incremental TDD & Nano-Cycles**: Prohibit batch-test dumps ("Test-First Waterfall"); enforce Uncle Bob's Three Laws (especially Law #2) and Ping-Pong pair programming with verified RED failure proofs.
127
+ - **Enforced In:** [`AGENTS.md`](./AGENTS.md), [`clean_code.md`](./docs/rules/clean_code.md), [`domain_driven_design.md`](./docs/rules/domain_driven_design.md), [`test_driven_development.md`](./docs/rules/test_driven_development.md), [`lets-build`](./.agents/skills/lets-build/SKILL.md), [`architecture_interview_matrix.md`](./.agents/skills/lets-build/references/architecture_interview_matrix.md).
262
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azcodr",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Enterprise Multi-Tenant Architecture & Agentic Engineering Starter Template",
5
5
  "bin": {
6
6
  "azcodr": "bin/azcodr.js"