azcodr 1.0.1 → 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.
- package/.agents/skills/agentic-architect/scripts/validate_agentic_configs.sh +24 -8
- package/.agents/skills/lets-build/SKILL.md +71 -78
- package/.agents/skills/lets-build/references/architecture_interview_matrix.md +78 -157
- package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +75 -35
- package/.editorconfig +19 -0
- package/.gitignore +3 -0
- package/AGENTS.md +12 -10
- package/README.md +3 -8
- package/bin/azcodr.js +170 -97
- package/changes.md +26 -0
- package/docs/rules/api_versioning.md +0 -15
- package/docs/rules/clean_code.md +37 -0
- package/docs/rules/continuous_learning.md +14 -13
- package/docs/rules/database_integrity.md +9 -17
- package/docs/rules/design_patterns.md +1 -0
- package/docs/rules/domain_driven_design.md +31 -21
- package/docs/rules/error_handling.md +14 -1
- package/docs/rules/multitenancy_isolation.md +2 -0
- package/docs/rules/product_ownership.md +0 -18
- package/docs/rules/project_management.md +0 -17
- package/docs/rules/react.md +4 -14
- package/docs/rules/requirements_engineering.md +0 -17
- package/docs/rules/rest_api_conventions.md +0 -16
- package/docs/rules/test_driven_development.md +42 -20
- package/docs/rules/transactional_email.md +11 -4
- package/docs/rules/ui_ux_architecture.md +5 -26
- package/docs/rules/upstream_synchronization.md +0 -15
- package/docs/rules/workflow_state_machines.md +0 -18
- package/lib/index.d.ts +153 -0
- package/lib/scaffold.js +86 -24
- package/memory.md +85 -219
- package/package.json +14 -4
- package/docs/knowledge/dos_and_donts.md +0 -540
- package/docs/knowledge/issue_log.md +0 -25
- package/docs/knowledge/lessons_learned.md +0 -107
|
@@ -45,21 +45,37 @@ if [[ -L "${CLAUDE_FILE}" ]]; then
|
|
|
45
45
|
else
|
|
46
46
|
log_fail "CLAUDE.md points to '${TARGET}' instead of 'AGENTS.md'."
|
|
47
47
|
fi
|
|
48
|
+
elif [[ -f "${CLAUDE_FILE}" ]] && [[ "$(< "${CLAUDE_FILE}")" == "AGENTS.md" ]]; then
|
|
49
|
+
log_pass "CLAUDE.md is a text pointer to AGENTS.md (symlink fallback)."
|
|
48
50
|
else
|
|
49
51
|
log_fail "CLAUDE.md is not a symbolic link."
|
|
50
52
|
fi
|
|
51
53
|
|
|
52
|
-
# Check agents.md symlink
|
|
54
|
+
# Check agents.md symlink (case-insensitive filesystem aware)
|
|
53
55
|
AGENTS_LOWER="${WORKSPACE_ROOT}/agents.md"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
IS_CASE_INSENSITIVE=false
|
|
57
|
+
if [[ "$(uname -s)" == "Darwin" ]] || [[ "$(uname -s)" =~ (MINGW|MSYS|CYGWIN) ]]; then
|
|
58
|
+
IS_CASE_INSENSITIVE=true
|
|
59
|
+
elif [[ -f "${AGENTS_FILE}" ]] && [[ -f "${AGENTS_LOWER}" ]] && [[ ! -L "${AGENTS_LOWER}" ]]; then
|
|
60
|
+
IS_CASE_INSENSITIVE=true
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if [[ "${IS_CASE_INSENSITIVE}" == "true" ]]; then
|
|
64
|
+
log_pass "agents.md is satisfied natively by AGENTS.md (case-insensitive filesystem)."
|
|
65
|
+
else
|
|
66
|
+
if [[ ! -L "${AGENTS_LOWER}" ]] && [[ ! -e "${AGENTS_LOWER}" ]] && [[ -f "${AGENTS_FILE}" ]]; then
|
|
67
|
+
ln -sf "AGENTS.md" "${AGENTS_LOWER}"
|
|
68
|
+
fi
|
|
69
|
+
if [[ -L "${AGENTS_LOWER}" ]]; then
|
|
70
|
+
TARGET=$(readlink "${AGENTS_LOWER}")
|
|
71
|
+
if [[ "${TARGET}" == "AGENTS.md" ]]; then
|
|
72
|
+
log_pass "agents.md is a valid symlink to AGENTS.md."
|
|
73
|
+
else
|
|
74
|
+
log_fail "agents.md points to '${TARGET}' instead of 'AGENTS.md'."
|
|
75
|
+
fi
|
|
58
76
|
else
|
|
59
|
-
log_fail "agents.md
|
|
77
|
+
log_fail "agents.md is not a symbolic link."
|
|
60
78
|
fi
|
|
61
|
-
else
|
|
62
|
-
log_fail "agents.md is not a symbolic link."
|
|
63
79
|
fi
|
|
64
80
|
|
|
65
81
|
# 2. Checking Progressive Disclosure Rules (docs/rules)
|
|
@@ -3,9 +3,9 @@ name: lets-build
|
|
|
3
3
|
description: Use when initializing or bootstrapping a new project from this template workspace, or when the user invokes '/lets-build' to conduct deep research and relentless questioning across language, stack, frameworks, package managers, databases, and architectural layers, followed by scaffolding the finalized project. Do not use for routine bug fixing, editing existing code features, or auditing already bootstrapped projects.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Let's Build:
|
|
6
|
+
# Let's Build: Problem-First Architecture Research & Project Bootstrapper
|
|
7
7
|
|
|
8
|
-
> **Core Purpose:** Conduct an exhaustive,
|
|
8
|
+
> **Core Purpose:** Conduct an exhaustive, problem-first architectural interview across domain essence, physical constraints, and system topology to derive technical choices (language, runtime, frameworks, build tools, architectural style) with zero assumptions, synthesize an approved ADR, and bootstrap a lean, strictly YAGNI project foundation.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -27,50 +27,53 @@ description: Use when initializing or bootstrapping a new project from this temp
|
|
|
27
27
|
Progress through five mandatory stages:
|
|
28
28
|
|
|
29
29
|
```
|
|
30
|
-
1. DISCOVER (Toolchain & Root) ──► 2. INTERROGATE (
|
|
30
|
+
1. DISCOVER (Toolchain & Root) ──► 2. INTERROGATE (Problem-First Interview) ──► 3. SYNTHESIZE (ADR & Blueprint) ──► 4. BOOTSTRAP (Topology Scaffolding) ──► 5. VERIFY (Prove Health)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
35
|
### Phase 1: Discover (Toolchain & Workspace Inspection)
|
|
36
36
|
1. Inspect the workspace root: confirm whether this is a fresh copy or an existing codebase.
|
|
37
|
-
2. Check for pre-installed development runtimes and CLI tools (`go`, `rustc`/`cargo`, `python3`/`uv`, `node`/`pnpm`, `docker`, `
|
|
37
|
+
2. Check for pre-installed development runtimes and CLI tools (`go`, `rustc`/`cargo`, `python3`/`uv`, `node`/`pnpm`, `docker`, `semgrep`).
|
|
38
38
|
3. Verify that `AGENTS.md`, `memory.md`, and `docs/rules/` exist and remain intact.
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
-
### Phase 2: Interrogate (The
|
|
42
|
+
### Phase 2: Interrogate (The Problem-First Architecture Interview)
|
|
43
43
|
Do NOT guess or assume any technology or stack choice. Execute the relentless interrogation using [references/architecture_interview_matrix.md](./references/architecture_interview_matrix.md). Group questions logically into digestible batches:
|
|
44
44
|
|
|
45
|
-
#### Batch 1:
|
|
46
|
-
1. **Domain & Problem Statement:** What
|
|
47
|
-
2. **
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
#### Batch
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
#### Batch 1: Problem Space & System Topology
|
|
46
|
+
1. **Domain & Problem Statement:** What real-world problem or capability does this system solve? What data moves, and what transformations occur?
|
|
47
|
+
2. **System Topology Classification:** Which topology best matches the execution target?
|
|
48
|
+
- Topology A: Web SaaS / Cloud Microservices
|
|
49
|
+
- Topology B: Browser Extension (Manifest V3)
|
|
50
|
+
- Topology C: Game Engine / High-Performance Simulator (Bare metal, GPU)
|
|
51
|
+
- Topology D: Browser / Canvas Game (HTML5 Canvas / WebGL / WebGPU)
|
|
52
|
+
- Topology E: Desktop Application / CLI Utility (Native POSIX/Windows)
|
|
53
|
+
- Topology F: Embedded / Systems Library
|
|
54
|
+
|
|
55
|
+
#### Batch 2: Operational & Physical Constraints (The Machine Reality)
|
|
56
|
+
3. **Latency & Time Budget:** Hard real-time (<16.6ms / <7ms frame loop), interactive low-latency (<10ms keystroke), soft service API (<200ms p99), or batch?
|
|
57
|
+
4. **Memory Management & GC Tolerance:** Zero-GC pause tolerance (demands C/C++/Rust/Zig), managed throughput GC (Go, Java 21+, C# .NET 9), or single-threaded event loop (JS/TS)?
|
|
58
|
+
5. **Concurrency & Execution Model:** Single-threaded event loop, multi-threaded worker pools with work stealing, SIMD compute shaders, or distributed actors?
|
|
59
|
+
6. **Persistence & Connectivity:** Zero persistence (in-memory only), local flat/binary files, embedded SQLite, client-side browser storage, or enterprise RDBMS (Postgres)? Zero network, WebSockets, UDP, or HTTP/REST/gRPC?
|
|
60
|
+
|
|
61
|
+
#### Batch 3: Architectural Style & Emergent Toolchain
|
|
62
|
+
7. **Architectural Style Derivation:**
|
|
63
|
+
- Web SaaS ➔ Modular Monolith / Hexagonal (Ports & Adapters)
|
|
64
|
+
- Browser Extension ➔ Platform Scripting (`background`, `content`, `popup`, `storage`)
|
|
65
|
+
- Game Engine ➔ Data-Oriented Design (DOD / ECS / Cache-friendly contiguous memory)
|
|
66
|
+
- Canvas Game ➔ Game Loop (`Input ➔ Update ➔ Render`)
|
|
67
|
+
- Desktop CLI ➔ Command Pipeline (`Arg Parser ➔ Handler ➔ Stream I/O`)
|
|
68
|
+
8. **Primary Programming Language & Runtime:** Derived strictly from the constraints above (C, Rust, TypeScript, Go, Java, C#, Python).
|
|
69
|
+
9. **Package Manager & Toolchain:** Specific package manager (`cargo`, `pnpm`, `uv`, `go modules`) and build task runner.
|
|
70
|
+
|
|
71
|
+
#### Batch 4: Targeted Invariants (Topology-Scoped, 100% YAGNI)
|
|
72
|
+
Inquire *only* into the dimensions relevant to the selected topology:
|
|
73
|
+
- *If Web SaaS / Backend:* API protocol (REST/gRPC), DB migration engine (Atlas/Flyway), tenancy isolation model, authentication, and OCI distroless containers.
|
|
74
|
+
- *If Browser Extension:* MV3 content script isolation (IIFE bundle), `chrome.storage.sync` flow, permissions. (Zero Docker/K8s/OpenAPI!).
|
|
75
|
+
- *If Game Engine:* Graphics backend (Vulkan/DirectX/wgpu), memory allocators (arena/frame), ECS archetype model. (Zero Docker/SQL!).
|
|
76
|
+
- *If CLI:* Arg parsing library, POSIX exit codes, streaming I/O, `--json` formatting. (Zero Docker/SQL!).
|
|
74
77
|
|
|
75
78
|
---
|
|
76
79
|
|
|
@@ -81,23 +84,20 @@ Do NOT guess or assume any technology or stack choice. Execute the relentless in
|
|
|
81
84
|
|
|
82
85
|
---
|
|
83
86
|
|
|
84
|
-
### Phase 4: Bootstrap (Deterministic
|
|
87
|
+
### Phase 4: Bootstrap (Deterministic Topology Scaffolding)
|
|
85
88
|
Upon user confirmation:
|
|
86
|
-
1. Run the
|
|
89
|
+
1. Run the topology-aware workspace initialization script:
|
|
87
90
|
```bash
|
|
88
|
-
bash .agents/skills/lets-build/scripts/bootstrap_workspace.sh . <language>
|
|
91
|
+
bash .agents/skills/lets-build/scripts/bootstrap_workspace.sh . <topology> <language>
|
|
89
92
|
```
|
|
90
|
-
2. Generate base infrastructure
|
|
91
|
-
- `specs/openapi/v1/openapi.yaml`
|
|
92
|
-
- `
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
5. Scaffold initial test runner and boundary verification smoke test (`scripts/smoke_test.sh`).
|
|
99
|
-
6. **Replace Starter README with Project-Specific README**:
|
|
100
|
-
Generate a clean, project-specific `README.md` using [references/project_readme_template.md](./references/project_readme_template.md), completely replacing the starter/meta-template content with the project's actual name, mission, stack highlights, quickstart commands, directory tree, and links to `docs/rules/`.
|
|
93
|
+
2. Generate base infrastructure strictly for the selected topology (zero speculative bloat):
|
|
94
|
+
- *Backend:* `specs/openapi/v1/openapi.yaml`, `specs/tokens/tokens.json`, `deploy/docker`, `deploy/compose`.
|
|
95
|
+
- *Extension:* `manifest.json`, `src/background/index.ts`, `src/content/index.ts`, `src/popup/index.html`.
|
|
96
|
+
- *Game / Engine:* `src/core/`, `src/ecs/`, asset manifest, frame loop entrypoint.
|
|
97
|
+
- *CLI:* `src/cmd/`, `src/core/`, CLI entrypoint with exit code handling.
|
|
98
|
+
3. Generate build manifests (`Cargo.toml`, `package.json`, `go.mod`, `pyproject.toml`), linter configurations, and boundary smoke test (`scripts/smoke_test.sh`).
|
|
99
|
+
4. **Replace Starter README with Project-Specific README**:
|
|
100
|
+
Generate a clean, project-specific `README.md` completely replacing meta-template content with the project's actual name, mission, stack highlights, quickstart commands, and directory tree.
|
|
101
101
|
|
|
102
102
|
---
|
|
103
103
|
|
|
@@ -106,9 +106,9 @@ Upon user confirmation:
|
|
|
106
106
|
```bash
|
|
107
107
|
bash .agents/skills/agentic-architect/scripts/validate_agentic_configs.sh
|
|
108
108
|
```
|
|
109
|
-
2. Execute toolchain dependency checks, build commands, and health
|
|
109
|
+
2. Execute toolchain dependency checks, build commands, and health/smoke tests:
|
|
110
110
|
- Compile code and verify zero compiler or lint errors.
|
|
111
|
-
- Verify
|
|
111
|
+
- Verify boundary verification smoke test (`scripts/smoke_test.sh`).
|
|
112
112
|
3. **Mandatory Handover to Domain Analysis (STOP & PIVOT):**
|
|
113
113
|
- **`lets-build` IS NOW COMPLETE.** Do NOT proceed to write domain business entities, repositories, or application features.
|
|
114
114
|
- Present the bootstrapped technical skeleton to the user.
|
|
@@ -120,11 +120,11 @@ Upon user confirmation:
|
|
|
120
120
|
|
|
121
121
|
- **MAJOR DONT: DO NOT invent, assume, or scaffold application domain entities, business logic, or feature pages during `/lets-build`.** The `lets-build` skill is strictly an infrastructure and technical stack bootstrapper. Fabricating business domain features without dedicated domain analysis and relentless questioning of the user is a fatal architectural defect.
|
|
122
122
|
- **DO NOT** assume the stack. Never start writing Go, Rust, Python, or TypeScript before asking the user.
|
|
123
|
-
- **DO NOT** scaffold
|
|
124
|
-
- **DO NOT**
|
|
123
|
+
- **DO NOT** scaffold universal web boilerplate (Docker, Kubernetes, OpenAPI, Postgres migrations) for non-backend projects (Browser Extensions, CLIs, Game Engines, Desktop apps).
|
|
124
|
+
- **DO NOT** force Hexagonal Architecture onto platforms where the application IS the platform integration (e.g. Browser Extensions). Match architecture to topology.
|
|
125
125
|
- **DO NOT** proceed to code generation without presenting the blueprint and receiving explicit user approval.
|
|
126
|
-
- **DO NOT** skip or delete the
|
|
127
|
-
- **DO NOT** create monolithic files (>
|
|
126
|
+
- **DO NOT** skip or delete the atomic domain rules in `docs/rules/` during bootstrapping. The rules govern the ongoing lifecycle of the newly bootstrapped project.
|
|
127
|
+
- **DO NOT** create monolithic files (> 250 lines) or large functions (> 30 lines). Maintain strict Clean Code standards.
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
|
@@ -134,31 +134,24 @@ Upon user confirmation:
|
|
|
134
134
|
```markdown
|
|
135
135
|
# Architectural Specification & Technology Blueprint
|
|
136
136
|
|
|
137
|
-
## 1.
|
|
137
|
+
## 1. Problem Space & Topology
|
|
138
138
|
- **Project Domain:** <domain>
|
|
139
|
+
- **System Topology:** <Web SaaS / Browser Extension / Game Engine / Canvas Game / CLI / Library>
|
|
140
|
+
- **Architectural Style:** <Hexagonal / Platform Scripting / Data-Oriented Design / Game Loop / Command Pipeline>
|
|
141
|
+
|
|
142
|
+
## 2. Core Profile & Constraints
|
|
139
143
|
- **Primary Language & Runtime:** <language / version>
|
|
140
144
|
- **Package Manager & Build Tool:** <tool>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- **
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
- **
|
|
151
|
-
- **
|
|
152
|
-
|
|
153
|
-
## 4. Logic, Workflows & Identity
|
|
154
|
-
- **Dynamic Logic:** <Common Expression Language / Wasm Extism>
|
|
155
|
-
- **Workflows:** <Temporal / Camunda / Statecharts>
|
|
156
|
-
- **Authentication:** <OIDC / WebAuthn Passkeys / PASETO>
|
|
157
|
-
- **Authorization:** <OPA Rego / OpenFGA ReBAC>
|
|
158
|
-
|
|
159
|
-
## 5. Operations & Quality
|
|
160
|
-
- **Caching & Streams:** <Cache Engine / Broker>
|
|
161
|
-
- **Observability:** <OpenTelemetry OTLP>
|
|
162
|
-
- **DevSecOps:** <Semgrep / Trivy / Gitleaks / Syft>
|
|
163
|
-
- **Testing:** Outside-In TDD (100.00% coverage gate)
|
|
145
|
+
- **Latency / Performance Target:** <Hard real-time / Interactive / Service / Batch>
|
|
146
|
+
- **Memory & Concurrency Model:** <Zero GC / Managed GC / Single-threaded event loop>
|
|
147
|
+
|
|
148
|
+
## 3. Interfaces & Storage
|
|
149
|
+
- **Protocols / Transports:** <REST / gRPC / WebSockets / CLI stdin-stdout / None>
|
|
150
|
+
- **Storage / Persistence:** <PostgreSQL / SQLite / chrome.storage / Flat file / In-memory>
|
|
151
|
+
- **Specifications:** <OpenAPI 3.1 / Manifest V3 / Protobuf / None>
|
|
152
|
+
|
|
153
|
+
## 4. Quality & Verification
|
|
154
|
+
- **Testing Strategy:** Outside-In TDD with Nano-Cycles (Uncle Bob's 3 Laws)
|
|
155
|
+
- **Code Health Gates:** 100.00% test coverage gate, zero lint errors
|
|
156
|
+
- **DevSecOps:** <Semgrep / Trivy / Gitleaks / None>
|
|
164
157
|
```
|
|
@@ -1,188 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Problem-First Architecture Interview Matrix
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Core Philosophy:** Software architecture must be derived from problem constraints, domain invariants, and execution targets—never from preemptive tool selection. Tools, runtimes, and databases are emergent outputs of the Problem Space.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
- **System Topology:** Modular Monolith (Modulith), Event-Driven Architecture (EDA), Service-Oriented (SOA), or Microservices?
|
|
9
|
-
- **Domain Decoupling:** Hexagonal Ports & Adapters, Clean Architecture, Onion Architecture, or Pragmatic Layered?
|
|
10
|
-
- **Language Bias:** Zero language bias; pure business domain core decoupled from infrastructure adapters.
|
|
7
|
+
## Tier 1: Problem Space Definition & System Topology
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- **
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- Data / ML / Scripting: Python 3.12+ or Elixir (BEAM concurrency)
|
|
20
|
-
- **Language Invariants:** Strict static sound typing; zero unhandled exceptions at domain boundaries.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Dimension 3: Package Managers, Workspaces & Monorepo Tooling
|
|
25
|
-
- **Package Manager:**
|
|
26
|
-
- Node/TS: `pnpm` (with strict isolated node_modules), `bun`, or `yarn` (Berry)
|
|
27
|
-
- Rust: `cargo` (with cargo workspaces)
|
|
28
|
-
- Go: Go Modules (with multi-module workspaces)
|
|
29
|
-
- Python: `uv`, `poetry`, or `pixi`
|
|
30
|
-
- **Monorepo Build Orchestration:** Turborepo, Nx, or Bazel/Buck2 with remote caching?
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Dimension 4: Containerization, Base OS & Cloud-Native Runtime
|
|
35
|
-
- **Container Strategy:**
|
|
36
|
-
- Zero-cve distroless (`gcr.io/distroless/*`) or `scratch` base images?
|
|
37
|
-
- Rootless container execution (`USER nonroot:nonroot`)?
|
|
38
|
-
- Multi-stage Dockerfiles with build caching?
|
|
39
|
-
- **Cloud-Native Invariants:** 12-Factor (2026 Edition); stateless runtime isolates; graceful `SIGTERM` draining.
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Dimension 5: API Protocols, Transports & Network Contracts
|
|
44
|
-
- **Primary Transport:**
|
|
45
|
-
- RESTful HTTP/JSON (RFC 7807 problem details + OpenAPI 3.1)
|
|
46
|
-
- gRPC / Protocol Buffers (v3 / Buf CLI)
|
|
47
|
-
- GraphQL (Apollo / GraphQL-Yoga with code-first or schema-first SDL)
|
|
48
|
-
- WebSockets / Server-Sent Events (SSE) for real-time push
|
|
49
|
-
- **API Versioning Strategy:** URI Path (`/v1/`), Request Header, or Media Type negotiation?
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Dimension 6: Database & Persistence Engine
|
|
54
|
-
- **Primary Storage Engine:**
|
|
55
|
-
- Relational: PostgreSQL, MySQL / MariaDB, SQLite, CockroachDB, or TiDB
|
|
56
|
-
- Document / NoSQL: MongoDB, DynamoDB, or Cassandra
|
|
57
|
-
- Multi-Model / Hybrid: Relational core with document extension
|
|
58
|
-
- **Persistence Pattern:** Repository Pattern with raw SQL / query builders (e.g. `sqlx`, `pgx`, `Kysely`, `jOOQ`) vs ORM (e.g. Prisma, SQLAlchemy, GORM, Hibernate)?
|
|
59
|
-
- **Mandatory Universal Audit Columns:**
|
|
60
|
-
- Standardize on **The Canonical 6 Total Audit Fields** (`createdAt`, `createdBy`, `updatedAt`, `updatedBy`, `deletedAt`, `deletedBy`) across all mutable relational entities?
|
|
61
|
-
- Strictly immutable append-only ledgers (`createdAt`, `createdBy` only; updates/deletions prohibited)?
|
|
62
|
-
|
|
63
|
-
---
|
|
9
|
+
### Dimension 1: The Core Problem & Domain Essence
|
|
10
|
+
- **Problem Statement:** What real-world problem or capability does this system address? What data moves, and what transformations occur?
|
|
11
|
+
- **Domain Invariants:** What core business, legal, mathematical, or physical rules must never be violated?
|
|
12
|
+
- **Domain Subdivisions:** Identify subdomains:
|
|
13
|
+
- *Core Subdomain:* The unique differentiator (e.g. proprietary physics simulation, smart filter inversion, bidding algorithm).
|
|
14
|
+
- *Supporting Subdomain:* Necessary domain-specific capabilities (e.g. user preferences, level editor).
|
|
15
|
+
- *Generic Subdomain:* Solved industry utilities (e.g. authentication, logging).
|
|
64
16
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
17
|
+
### Dimension 2: System Topology Classification
|
|
18
|
+
Classify the system into its primary operational topology:
|
|
19
|
+
1. **Topology A — Web SaaS / Cloud Microservices:** Network-facing HTTP/gRPC services with multi-tenant data persistence and web/mobile clients.
|
|
20
|
+
2. **Topology B — Browser Extension:** Client-side sandboxed extension (Chrome/Firefox MV3) orchestrating content scripts, background service workers, and popup UI.
|
|
21
|
+
3. **Topology C — Game Engine / High-Performance Simulator:** Low-level, frame-budgeted application directly interfacing with GPU APIs (Vulkan, DirectX, Metal) and system memory.
|
|
22
|
+
4. **Topology D — Browser / Canvas Game:** Sandboxed web game running inside the browser DOM/Canvas via Canvas2D, WebGL, or WebGPU.
|
|
23
|
+
5. **Topology E — Desktop Application / CLI Utility:** Standalone OS binary (POSIX/Windows) executed locally via terminal arguments or native desktop UI.
|
|
24
|
+
6. **Topology F — Systems / Embedded / Cryptographic Library:** Headless shared library or crate compiled for specific hardware targets or WASM runtimes.
|
|
68
25
|
|
|
69
26
|
---
|
|
70
27
|
|
|
71
|
-
##
|
|
72
|
-
- **Isolation Strategy:**
|
|
73
|
-
1. **Model A: Universal AST Query Interceptor** (Tenant column + automatic SQL/query AST rewriting)
|
|
74
|
-
2. **Model B: Database Row-Level Security (RLS)** (Session-scoped `set_config` / session variables)
|
|
75
|
-
3. **Model C: Schema-per-Tenant** (Dedicated database schema namespace per tenant)
|
|
76
|
-
4. **Model D: Database-per-Tenant** (Physical instance routing via connection pool manager)
|
|
77
|
-
5. **Model E: Storage Proxy** (Envoy / ProxySQL / Vitess)
|
|
28
|
+
## Tier 2: Physical & Operational Constraints
|
|
78
29
|
|
|
79
|
-
|
|
30
|
+
### Dimension 3: Latency & Time Budgets
|
|
31
|
+
- **Hard Real-Time:** Frame budget enforced (e.g. 16.6ms for 60 FPS, 6.94ms for 144 FPS). Any jitter causes dropped frames.
|
|
32
|
+
- **Interactive Low-Latency:** Sub-10ms response for user inputs (e.g. keystrokes in a code editor, real-time audio DSP).
|
|
33
|
+
- **Service Request-Response:** Soft latency (e.g. p99 < 200ms for web APIs; p95 < 50ms for internal RPC).
|
|
34
|
+
- **Asynchronous / Batch:** Throughput-optimized batch or event stream processing (seconds to minutes).
|
|
80
35
|
|
|
81
|
-
|
|
82
|
-
- **
|
|
83
|
-
- **
|
|
36
|
+
### Dimension 4: Memory Management & Garbage Collection Tolerance
|
|
37
|
+
- **Zero GC Pause Tolerance:** Latency spikes or unpredictable GC pauses are unacceptable. Demands deterministic, manual, or compile-time memory management (C, C++, Rust, Zig).
|
|
38
|
+
- **High-Throughput Managed GC:** GC pauses (< 10ms) are completely imperceptible within network I/O latency. Managed runtimes maximize developer velocity (Go, Java 21+ with Loom, C# .NET 9).
|
|
39
|
+
- **Single-Threaded Event Loop:** JavaScript / TypeScript runtime in browser sandbox or Node/Bun.
|
|
84
40
|
|
|
85
|
-
|
|
41
|
+
### Dimension 5: Concurrency & Execution Topology
|
|
42
|
+
- **Single-Threaded Cooperative:** Event loop with non-blocking async I/O (browser JS, Node.js).
|
|
43
|
+
- **Multi-Threaded Work-Stealing:** Parallel pipelines across CPU cores (physics, rendering, audio) requiring data-race safety.
|
|
44
|
+
- **Data-Parallel / SIMD:** Vectorized computation over contiguous arrays or GPU compute shaders.
|
|
45
|
+
- **Distributed Shared-Nothing:** Clustered actor nodes or horizontal stateless containers.
|
|
86
46
|
|
|
87
|
-
|
|
88
|
-
- **
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
47
|
+
### Dimension 6: Persistence & Connectivity Demands
|
|
48
|
+
- **Zero Persistence:** In-memory state only (e.g. real-time canvas game, transient CLI filter).
|
|
49
|
+
- **Local Embedded / Flat Storage:** Local binary files, JSON configuration, or embedded SQLite.
|
|
50
|
+
- **Client-Side Platform Storage:** Browser `chrome.storage.local` / `sync`, `localStorage`, or IndexedDB.
|
|
51
|
+
- **Enterprise Relational / Document RDBMS:** PostgreSQL, MySQL, MongoDB, CockroachDB with ACID transactions.
|
|
52
|
+
- **Network Interface:** Pure local IPC/pipes (zero network), WebSockets, UDP packets, or HTTP/REST/gRPC.
|
|
91
53
|
|
|
92
54
|
---
|
|
93
55
|
|
|
94
|
-
##
|
|
95
|
-
- **Protocols:** OpenID Connect (OIDC), OAuth 2.1 with PKCE, SAML 2.0 federation, or local credentials?
|
|
96
|
-
- **Passkeys / Passwordless:** W3C / FIDO2 WebAuthn passkey support?
|
|
97
|
-
- **Token Format:** PASETO (Platform-Agnostic Security Tokens) vs RFC 7519 JWT with JWKS asymmetric key rotation?
|
|
98
|
-
- **Token Rotation:** Cryptographic Refresh Token Rotation (RTR) with family invalidation on replay detection?
|
|
56
|
+
## Tier 3: Architectural Style Derivation (Topology Alignment)
|
|
99
57
|
|
|
100
|
-
|
|
58
|
+
Match the architectural style strictly to the system topology:
|
|
101
59
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
60
|
+
| Topology | Mandatory Architectural Style | Rationale | Anti-Pattern to Ban |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| **Web SaaS / Backend** | **Hexagonal (Ports & Adapters) / Clean** | Decouples business rules from databases, HTTP frameworks, and external APIs. | Fat controllers with inline SQL; leaky abstractions. |
|
|
63
|
+
| **Browser Extension** | **Platform Scripting Architecture** | Direct, lean coordination of `background`, `content`, `popup`, and browser storage APIs. | Forcing Hexagonal ports, use-case classes, or `/healthz` probes. |
|
|
64
|
+
| **Game Engine** | **Data-Oriented Design (DOD / ECS)** | Cache-friendly contiguous memory layout (dense component arrays) for SIMD vectorization. | Deep OOP inheritance hierarchies; GC-managed wrappers. |
|
|
65
|
+
| **Canvas Game** | **Game Loop Architecture** | Structured `Input ➔ Update ➔ Render` loop driven by `requestAnimationFrame`. | Enterprise repository and layered CRUD ceremony. |
|
|
66
|
+
| **Desktop CLI** | **Command Pipeline Architecture** | Streamlined `Arg Parser ➔ Command Handler ➔ Stream I/O`. | Embedding REST servers, microservices, or Docker containers. |
|
|
108
67
|
|
|
109
68
|
---
|
|
110
69
|
|
|
111
|
-
##
|
|
112
|
-
- **Frontend Framework & Architecture:**
|
|
113
|
-
- Web: React, Vue, Svelte, Solid, Angular, or Web Components?
|
|
114
|
-
- Mobile: Flutter, React Native, iOS SwiftUI, or Android Jetpack Compose?
|
|
115
|
-
- Hypermedia / SSR: HTMX / HTML-over-the-wire?
|
|
116
|
-
- Server-Driven UI (SDUI): Declarative JSON layout schemas rendered by client registries?
|
|
117
|
-
- **UI Component Primitives & Styling:**
|
|
118
|
-
- Standardize on `shadcn/ui` with `@radix-ui` headless primitives + Tailwind CSS?
|
|
119
|
-
- Accessible dialogs, focus trapping, and zero native alerts per `accessibility.md`?
|
|
120
|
-
- **Server-State Caching & Data Synchronization:**
|
|
121
|
-
- **TanStack Query (`@tanstack/react-query`)** with query keys, stale-while-revalidate, and automatic mutation invalidation vs SWR vs raw fetch?
|
|
122
|
-
- **Form State Management & Validation:**
|
|
123
|
-
- **React Hook Form (`react-hook-form` + `@hookform/resolvers/zod`)** or **TanStack Form (`@tanstack/react-form`)** with **Zod** schema contracts?
|
|
124
|
-
- **Data Grids & Table Virtualization:**
|
|
125
|
-
- **TanStack Table (`@tanstack/react-table`)** for headless sorting, filtering, and pagination?
|
|
126
|
-
- **Client Stores & Global State:**
|
|
127
|
-
- **Zustand** vs Jotai vs Redux Toolkit for shared client-only state?
|
|
128
|
-
- **Design Tokens:** W3C Design Tokens Community Group (DTCG) `tokens.json` processed via Style Dictionary?
|
|
70
|
+
## Tier 4: Emergent Toolchain & Language Derivation
|
|
129
71
|
|
|
130
|
-
|
|
72
|
+
Derive the programming language, runtime, and package manager strictly from the constraints established above:
|
|
131
73
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
74
|
+
| Language Profile | Optimal Fit | Primary Trade-Off |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| **C (C99 / C11)** | Game engines, embedded systems, OS kernels. | Raw pointer control, instant compile times; manual memory management. |
|
|
77
|
+
| **Rust** | Game engines, code editors, CLI tools, systems services. | Zero GC, compile-time memory safety, fearless concurrency; steeper learning curve, slower builds. |
|
|
78
|
+
| **TypeScript / JS** | Browser extensions, canvas games, web frontends, fullstack apps. | Instant browser compatibility, rich UI ecosystem; single-threaded event loop, runtime typing. |
|
|
79
|
+
| **Go** | Cloud microservices, CLI tools, network proxies. | Fast startup, simple concurrency (goroutines); basic GC, limited generics. |
|
|
80
|
+
| **Java 21+ / C# (.NET 9)** | Enterprise transaction platforms, high-throughput microservices. | Massive enterprise ecosystem, virtual threads; higher memory footprint. |
|
|
81
|
+
| **Python** | Data analysis, ML pipelines, quick automation scripts. | Expressive syntax, unmatched ML libraries; slower execution, GIL constraints. |
|
|
136
82
|
|
|
137
83
|
---
|
|
138
84
|
|
|
139
|
-
##
|
|
140
|
-
- **Message Broker:** Apache Kafka / Redpanda, NATS JetStream, RabbitMQ, AWS SQS, or Redis Streams?
|
|
141
|
-
- **Event Specification:** CNCF CloudEvents v1.0.2 format?
|
|
142
|
-
- **Transactional Outbox:** Polling relay (`FOR UPDATE SKIP LOCKED`) or Change Data Capture (CDC via Debezium)?
|
|
143
|
-
|
|
144
|
-
---
|
|
85
|
+
## Tier 5: Targeted Invariants (Strictly Topology-Scoped, 100% YAGNI)
|
|
145
86
|
|
|
146
|
-
|
|
147
|
-
- **Standard:** 100% CNCF OpenTelemetry (OTel) with OTLP export over gRPC/HTTP?
|
|
148
|
-
- **Tracing:** W3C Trace Context (`traceparent`, `tracestate`)?
|
|
149
|
-
- **Logging Format:** Structured JSON conforming to Elastic Common Schema (ECS) or OpenTelemetry Resource Schema?
|
|
87
|
+
Inquire *only* into the dimensions relevant to the selected topology. **Never ask non-backend projects about databases, containers, or API versioning!**
|
|
150
88
|
|
|
151
|
-
|
|
89
|
+
### For Web SaaS & Enterprise Backends ONLY:
|
|
90
|
+
- **API Protocols:** REST (OpenAPI 3.1) vs gRPC (Protobuf v3 via Buf) vs GraphQL.
|
|
91
|
+
- **Database Migrations:** Declarative (Atlas) vs Versioned SQL (Flyway, Goose).
|
|
92
|
+
- **Multi-Tenancy Isolation:** AST Query Interceptor vs Database RLS vs Schema-per-tenant.
|
|
93
|
+
- **Authentication & AuthZ:** OIDC, OAuth 2.1, PASETO, OPA Rego, or OpenFGA ReBAC.
|
|
94
|
+
- **Container Infrastructure:** Minimal Distroless/Scratch OCI containers and Docker Compose.
|
|
152
95
|
|
|
153
|
-
|
|
154
|
-
- **
|
|
155
|
-
- **
|
|
156
|
-
- **
|
|
157
|
-
- **
|
|
96
|
+
### For Browser Extensions ONLY:
|
|
97
|
+
- **Manifest Version:** Chrome/Firefox Manifest V3.
|
|
98
|
+
- **Script Isolation & Bundling:** Self-contained IIFE for content scripts (zero external ES module chunk imports).
|
|
99
|
+
- **State Synchronization:** `chrome.storage.sync` with local fallback and unidirectional event application.
|
|
100
|
+
- **Permissions:** Principle of least privilege for `manifest.json`.
|
|
158
101
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
- **
|
|
163
|
-
- **BDD Acceptance:** Executable Cucumber / Gherkin `.feature` criteria?
|
|
164
|
-
- **Contract Testing:** Consumer-Driven Contract testing via Pact?
|
|
165
|
-
- **Property-Based Testing:** Schemathesis OpenAPI / GraphQL automated fuzzing?
|
|
166
|
-
- **Coverage Gate:** Mandatory 100.00% coverage thresholds across all suites?
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Dimension 19: State Machines, Workflows & Lifecycle Configurability
|
|
171
|
-
- **State Taxonomy & Invariant Separation:**
|
|
172
|
-
- **Core Invariant States (Hard FSM):** Enforced strictly inside compiled Domain Aggregate Roots? (Financial/legal integrity states like `SETTLED`, `CANCELLED` cannot be user-rewritten).
|
|
173
|
-
- **Operational Workflow Stages (Soft FSM):** Tenant-configurable review funnels, approval tiers, or sub-statuses managed via Declarative State Transition Matrices?
|
|
174
|
-
- **Transition Guards & Rule Evaluation:**
|
|
175
|
-
- Standardize on Common Expression Language (CEL) or embedded Wasm sandboxing for tenant-defined guards?
|
|
176
|
-
- **Workflow Orchestration:**
|
|
177
|
-
- Durable workflow engine (Temporal.io, Camunda 8 / Zeebe BPMN 2.0) for multi-step distributed sagas?
|
|
178
|
-
- **Transition Audit Trail:**
|
|
179
|
-
- Mandatory append-only state transition log (`transitionId`, `entityType`, `entityId`, `fromState`, `toState`, `event`, `actorId`, `createdAt`)?
|
|
180
|
-
|
|
181
|
-
---
|
|
102
|
+
### For Game Engines & High-Performance Simulators ONLY:
|
|
103
|
+
- **Graphics Backend:** Native Vulkan, DirectX 12, Metal, or portable `wgpu`.
|
|
104
|
+
- **Memory Allocation Strategy:** Linear allocators, frame allocators, arena allocators, or pool allocators.
|
|
105
|
+
- **Entity Model:** Archetype ECS (e.g. `bevy_ecs`, `hecs`, `EnTT`) vs dense component arrays.
|
|
182
106
|
|
|
183
|
-
|
|
184
|
-
- **
|
|
185
|
-
- **
|
|
186
|
-
- Mechanical AST / Linter rules (ESLint `id-denylist`) prohibiting banned synonyms?
|
|
187
|
-
- Branded nominal types (`type UserId = string & { readonly __brand: unique symbol }`) preventing primitive obsession and cross-domain identifier confusion?
|
|
188
|
-
- **Anti-Corruption Layer (ACL):** Adapters at system perimeters converting external vendor terminology into the canonical Ubiquitous Language?
|
|
107
|
+
### For Desktop CLIs ONLY:
|
|
108
|
+
- **CLI Framework:** Zero-dependency argument parser vs battle-tested CLI library (e.g. `clap` for Rust, `cobra` for Go).
|
|
109
|
+
- **I/O Protocols:** Standard POSIX streams (`stdin`, `stdout`, `stderr`), exit codes (0 for success, non-zero for error), JSON output flags (`--json`).
|