azcodr 1.1.0 β†’ 1.2.1

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.
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,7 +1,7 @@
1
1
  {
2
2
  "name": "azcodr",
3
- "version": "1.1.0",
4
- "description": "Enterprise Multi-Tenant Architecture & Agentic Engineering Starter Template",
3
+ "version": "1.2.1",
4
+ "description": "Enterprise Architecture & Agentic Engineering Starter Template",
5
5
  "bin": {
6
6
  "azcodr": "bin/azcodr.js"
7
7
  },