azcodr 1.2.2 → 1.4.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.
Files changed (69) hide show
  1. package/.agents/hooks.json.example +42 -0
  2. package/.agents/mcp_config.json.example +24 -0
  3. package/.agents/skills/agentic-architect/SKILL.md +14 -7
  4. package/.agents/skills/agentic-architect/references/agents_md_template.md +6 -3
  5. package/.agents/skills/agentic-architect/references/skill_architecture_inquiry.md +1 -1
  6. package/.agents/skills/agentic-architect/references/skill_template.md +2 -1
  7. package/.agents/skills/agentic-architect/scripts/validate_agentic_configs.sh +156 -4
  8. package/.agents/skills/clean-code-refactor/SKILL.md +6 -6
  9. package/.agents/skills/compliance-audit/SKILL.md +1 -1
  10. package/.agents/skills/lets-build/SKILL.md +12 -4
  11. package/.agents/skills/lets-build/references/hexagonal_bootstrap_scaffolds.md +1 -1
  12. package/.agents/skills/lets-build/references/project_readme_template.md +4 -4
  13. package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +63 -35
  14. package/.agents/skills/relentless-questioner/SKILL.md +10 -5
  15. package/AGENTS.md +25 -41
  16. package/README.md +27 -43
  17. package/bin/azcodr.js +3 -82
  18. package/docs/knowledge/ubiquitous_language.md +1 -6
  19. package/docs/rules/agentic_configuration.md +120 -32
  20. package/docs/rules/api_architecture.md +179 -0
  21. package/docs/rules/caching.md +30 -13
  22. package/docs/rules/cloud_native.md +10 -12
  23. package/docs/rules/cqrs.md +203 -0
  24. package/docs/rules/database_design.md +125 -0
  25. package/docs/rules/database_operations.md +56 -14
  26. package/docs/rules/design_patterns.md +18 -11
  27. package/docs/rules/devops_ci_cd.md +76 -0
  28. package/docs/rules/domain_driven_design.md +17 -13
  29. package/docs/rules/feature_flags.md +21 -4
  30. package/docs/rules/frontend_architecture.md +157 -0
  31. package/docs/rules/multitenancy_architecture.md +98 -0
  32. package/docs/rules/product_ownership.md +22 -27
  33. package/docs/rules/requirements_engineering.md +16 -14
  34. package/docs/rules/security_compliance.md +53 -0
  35. package/docs/rules/server_driven_ui.md +20 -3
  36. package/docs/rules/test_driven_development.md +118 -62
  37. package/docs/rules/type_safety.md +65 -0
  38. package/docs/rules/ui_ux_architecture.md +33 -30
  39. package/docs/rules/workflow_state_machines.md +20 -3
  40. package/lib/index.d.ts +0 -30
  41. package/lib/scaffold.js +9 -46
  42. package/memory.md +158 -14
  43. package/package.json +2 -3
  44. package/changes.md +0 -79
  45. package/docs/rules/accessibility.md +0 -31
  46. package/docs/rules/advanced_api_patterns.md +0 -104
  47. package/docs/rules/api_versioning.md +0 -113
  48. package/docs/rules/application_security.md +0 -23
  49. package/docs/rules/architecture_decision_records.md +0 -42
  50. package/docs/rules/compliance.md +0 -25
  51. package/docs/rules/container_infrastructure.md +0 -32
  52. package/docs/rules/continuous_deployment.md +0 -24
  53. package/docs/rules/continuous_integration.md +0 -20
  54. package/docs/rules/continuous_learning.md +0 -29
  55. package/docs/rules/database_integrity.md +0 -80
  56. package/docs/rules/database_migrations.md +0 -41
  57. package/docs/rules/database_performance.md +0 -44
  58. package/docs/rules/database_transactions.md +0 -81
  59. package/docs/rules/devsecops.md +0 -33
  60. package/docs/rules/multitenancy_isolation.md +0 -88
  61. package/docs/rules/react.md +0 -78
  62. package/docs/rules/rest_api_conventions.md +0 -46
  63. package/docs/rules/tenant_dynamic_schemas.md +0 -88
  64. package/docs/rules/tenant_pluggable_logic.md +0 -59
  65. package/docs/rules/test_isolation.md +0 -26
  66. package/docs/rules/typescript.md +0 -55
  67. package/docs/rules/ui_navigation.md +0 -20
  68. package/docs/rules/upstream_synchronization.md +0 -53
  69. package/docs/rules/workspace_isolation.md +0 -25
@@ -0,0 +1,42 @@
1
+ {
2
+ "safety-guard": {
3
+ "enabled": false,
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "run_command",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "./scripts/safety_guard.sh",
11
+ "timeout": 15
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ },
17
+ "post-tool-lint": {
18
+ "enabled": false,
19
+ "PostToolUse": [
20
+ {
21
+ "matcher": "run_command",
22
+ "hooks": [
23
+ {
24
+ "type": "command",
25
+ "command": "npm run lint",
26
+ "timeout": 30
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ },
32
+ "stop-verifier": {
33
+ "enabled": false,
34
+ "Stop": [
35
+ {
36
+ "type": "command",
37
+ "command": "./scripts/verify_completion.sh",
38
+ "timeout": 15
39
+ }
40
+ ]
41
+ }
42
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "mcpServers": {
3
+ "sqlite": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@modelcontextprotocol/server-sqlite",
8
+ "--db-path",
9
+ "./data/app.db"
10
+ ]
11
+ },
12
+ "filesystem": {
13
+ "command": "npx",
14
+ "args": [
15
+ "-y",
16
+ "@modelcontextprotocol/server-filesystem",
17
+ "./docs"
18
+ ]
19
+ },
20
+ "remote-service": {
21
+ "serverUrl": "https://mcp.example.com/sse"
22
+ }
23
+ }
24
+ }
@@ -23,7 +23,7 @@ description: Use when creating, modularizing, auditing, or updating agentic conf
23
23
  ### Step 1: Relentless Skill Architecture Inquiry (Question Everything)
24
24
  Before writing a single line of a skill or rule, execute the **7 Core Inquiry Branches**:
25
25
  1. **Placement & Scope:** Does this belong in root `AGENTS.md` (all prompts), nested `AGENTS.md` (one package), a continuous rule in `docs/rules/`, or an on-demand skill in `.agents/skills/`?
26
- 2. **Trigger Boundaries:** What is the exact user intent? What is the explicit imperative trigger (`Use when...`) and the anti-triggers (`Do NOT use for...`)?
26
+ 2. **Trigger Boundaries & YAGNI Gate:** What is the explicit imperative trigger (`Use when...`), the anti-triggers (`Do NOT use for...`), and the empirical tipping points that justify unlocking this capability?
27
27
  3. **Domain Ground Truth:** Have all generic textbook tutorials been purged? Is this grounded in verified codebase evidence?
28
28
  4. **Gotchas & Anti-Patterns:** What exact mistakes has the AI repeatedly made in this domain that must be forbidden?
29
29
  5. **Determinism vs. LLM:** Can brittle tasks be converted into deterministic scripts under `scripts/`?
@@ -43,8 +43,8 @@ Inspect current agent files and measure their token and line footprint:
43
43
  Extract continuous technical requirements into dedicated markdown files under `docs/rules/`:
44
44
  - `docs/rules/clean_code.md` (Clean Code, Pragmatic Programmer, CQS, SLAP)
45
45
  - `docs/rules/cloud_native.md` (12-Factor 2026, OpenTelemetry, API-first)
46
- - `docs/rules/compliance.md` (SOC 2 Type II, ISO 27001, GDPR)
47
- - `docs/rules/continuous_integration.md` (Shift-left pipelines, trunk-based CI)
46
+ - `docs/rules/security_compliance.md` (SOC 2 Type II, ISO 27001, GDPR)
47
+ - `docs/rules/devops_ci_cd.md` (Shift-left pipelines, trunk-based CI, OCI distroless)
48
48
  - `docs/rules/requirements_engineering.md` (INVEST user stories, Gherkin criteria)
49
49
 
50
50
  ### Step 4: Streamline Root AGENTS.md
@@ -65,15 +65,19 @@ When a task is complex, multi-step, or specialized, encapsulate it into `.agents
65
65
  - Include a mandatory **"Gotchas & What NOT to Do"** section.
66
66
  - Provide structured output templates.
67
67
  3. **Progressive Subdirectories:**
68
- - `references/`: Reference docs loaded only on demand.
68
+ - `references/`: Reference manuals loaded only on demand.
69
69
  - `scripts/`: Deterministic code (bash/node) to prevent stochastic AI divergence.
70
- - `assets/`: Static templates, lookup tables, and schemas.
70
+ - `resources/`: Static templates, lookup tables, and schemas.
71
+ - `examples/`: Reference implementations and code patterns.
71
72
 
72
73
  ### Step 6: Enforce Harness Parity via Symlinks
73
- Prevent divergence between Claude Code, standard AGENTS.md, and legacy tooling:
74
+ Prevent divergence across Claude Code, Google Antigravity, Cursor, Windsurf, and standard AGENTS.md:
74
75
  ```bash
75
76
  ln -sf AGENTS.md CLAUDE.md
76
77
  ln -sf AGENTS.md agents.md
78
+ ln -sf AGENTS.md GEMINI.md
79
+ ln -sf AGENTS.md .cursorrules
80
+ ln -sf AGENTS.md .windsurfrules
77
81
  ```
78
82
 
79
83
  ### Step 7: Apply the Continuous Refinement Loop
@@ -87,6 +91,8 @@ ln -sf AGENTS.md agents.md
87
91
  ## 3. Gotchas & What NOT to Do
88
92
 
89
93
  - **DO NOT** guess what a skill should do. Run the Relentless Skill Architecture Inquiry first.
94
+ - **DO NOT** author architectural rules or skills without a YAGNI Gate (Simple Baseline, Anti-Triggers, Empirical Tipping Point).
95
+ - **DO NOT** confuse battle-tested open-source libraries (shadcn, Tailwind, Zod, Lombok) with speculative custom over-engineering.
90
96
  - **DO NOT** let root `AGENTS.md` exceed 120–150 lines. Every extra token degrades LLM attention.
91
97
  - **DO NOT** write passive skill descriptions like `"Tanstack query documentation"`. Use `"Use when implementing Tanstack Query caches..."`.
92
98
  - **DO NOT** include human "Getting Started" guides. Agents already have the workspace open.
@@ -100,13 +106,14 @@ ln -sf AGENTS.md agents.md
100
106
 
101
107
  Before finalizing any agent configuration update, verify:
102
108
  - [ ] Relentless Skill Architecture Inquiry completed for all 7 branches.
109
+ - [ ] Architectural pattern rules and skills enforce the YAGNI Gate Triad (Baseline, Anti-Triggers, Tipping Point).
103
110
  - [ ] Root `AGENTS.md` is under 120 lines and loads within minimal tokens.
104
111
  - [ ] Specialized domain instructions are decoupled into `docs/rules/`.
105
112
  - [ ] Progressive disclosure table in `AGENTS.md` contains valid, clickable markdown links.
106
113
  - [ ] All skills have front matter with `name` and imperative `description` starting with `Use when...`.
107
114
  - [ ] All skills are under 500 lines or offload sub-content to `references/`.
108
115
  - [ ] Every skill contains a "Gotchas & What NOT to Do" section.
109
- - [ ] Symlinks (`CLAUDE.md`, `agents.md`) resolve to `AGENTS.md`.
116
+ - [ ] Symlinks (`CLAUDE.md`, `agents.md`, `GEMINI.md`, `.cursorrules`, `.windsurfrules`) resolve to `AGENTS.md`.
110
117
 
111
118
  ---
112
119
 
@@ -45,15 +45,18 @@ Read these specialized rule files on demand when performing relevant tasks:
45
45
  | Domain | Rule Reference File | When to Consult |
46
46
  |---|---|---|
47
47
  | **Testing** | [docs/rules/test_driven_development.md](../../../../docs/rules/test_driven_development.md) | Writing acceptance/unit tests, coverage checks. |
48
- | **Multi-Tenancy** | [docs/rules/multitenancy_isolation.md](../../../../docs/rules/multitenancy_isolation.md) | Tenant context resolution, PostgreSQL RLS. |
49
- | **Database** | [docs/rules/database_transactions.md](../../../../docs/rules/database_transactions.md) | ACID transactions, outbox pattern, atomicity. |
48
+ | **Multi-Tenancy** | [docs/rules/multitenancy_architecture.md](../../../../docs/rules/multitenancy_architecture.md) | Tenant context resolution, PostgreSQL RLS. |
49
+ | **Database** | [docs/rules/database_design.md](../../../../docs/rules/database_design.md) | Relational integrity, ACID transactions, outbox pattern. |
50
50
 
51
51
  ---
52
52
 
53
53
  ## 4. Harness Parity
54
- Keep `AGENTS.md`, `CLAUDE.md`, and `agents.md` in sync via filesystem symlinks:
54
+ Keep `AGENTS.md`, `CLAUDE.md`, `agents.md`, `GEMINI.md`, `.cursorrules`, and `.windsurfrules` in sync via filesystem symlinks:
55
55
  ```bash
56
56
  ln -sf AGENTS.md CLAUDE.md
57
57
  ln -sf AGENTS.md agents.md
58
+ ln -sf AGENTS.md GEMINI.md
59
+ ln -sf AGENTS.md .cursorrules
60
+ ln -sf AGENTS.md .windsurfrules
58
61
  ```
59
62
  ```
@@ -41,7 +41,7 @@
41
41
  [Branch 6: Progressive Disclosure (< 500 Lines)]
42
42
  ├─ Is SKILL.md under 500 lines?
43
43
  ├─ Are deep manuals offloaded to references/?
44
- └─ Are static schemas or templates offloaded to assets/?
44
+ └─ Are static schemas or templates offloaded to resources/?
45
45
  │
46
46
  ▼
47
47
  [Branch 7: Verification & Feedback Loop]
@@ -51,5 +51,6 @@ Provide consistent formatting for results:
51
51
  ## 5. Subdirectories & Progressive Resources
52
52
  - Deep reference documentation: `references/`
53
53
  - Deterministic helper scripts: `scripts/`
54
- - Static schemas or mock assets: `assets/`
54
+ - Static schemas, templates, or mock data: `resources/`
55
+ - Reference implementations and patterns: `examples/`
55
56
  ```
@@ -36,16 +36,29 @@ else
36
36
  fi
37
37
  fi
38
38
 
39
+ # Helper to check if symlink target resolves to AGENTS.md
40
+ is_valid_agents_target() {
41
+ local target="$1"
42
+ [[ "${target}" == "AGENTS.md" || "${target}" == "./AGENTS.md" || "${target}" == "${WORKSPACE_ROOT}/AGENTS.md" ]]
43
+ }
44
+
45
+ is_valid_text_pointer() {
46
+ local file="$1"
47
+ local content
48
+ content=$(< "${file}")
49
+ [[ "${content}" == "AGENTS.md" || "${content}" == "./AGENTS.md" || "${content}" == "${WORKSPACE_ROOT}/AGENTS.md" ]]
50
+ }
51
+
39
52
  # Check CLAUDE.md symlink
40
53
  CLAUDE_FILE="${WORKSPACE_ROOT}/CLAUDE.md"
41
54
  if [[ -L "${CLAUDE_FILE}" ]]; then
42
55
  TARGET=$(readlink "${CLAUDE_FILE}")
43
- if [[ "${TARGET}" == "AGENTS.md" ]]; then
56
+ if is_valid_agents_target "${TARGET}"; then
44
57
  log_pass "CLAUDE.md is a valid symlink to AGENTS.md."
45
58
  else
46
59
  log_fail "CLAUDE.md points to '${TARGET}' instead of 'AGENTS.md'."
47
60
  fi
48
- elif [[ -f "${CLAUDE_FILE}" ]] && [[ "$(< "${CLAUDE_FILE}")" == "AGENTS.md" ]]; then
61
+ elif [[ -f "${CLAUDE_FILE}" ]] && is_valid_text_pointer "${CLAUDE_FILE}"; then
49
62
  log_pass "CLAUDE.md is a text pointer to AGENTS.md (symlink fallback)."
50
63
  else
51
64
  log_fail "CLAUDE.md is not a symbolic link."
@@ -68,7 +81,7 @@ else
68
81
  fi
69
82
  if [[ -L "${AGENTS_LOWER}" ]]; then
70
83
  TARGET=$(readlink "${AGENTS_LOWER}")
71
- if [[ "${TARGET}" == "AGENTS.md" ]]; then
84
+ if is_valid_agents_target "${TARGET}"; then
72
85
  log_pass "agents.md is a valid symlink to AGENTS.md."
73
86
  else
74
87
  log_fail "agents.md points to '${TARGET}' instead of 'AGENTS.md'."
@@ -78,6 +91,68 @@ else
78
91
  fi
79
92
  fi
80
93
 
94
+ # Check GEMINI.md symlink
95
+ GEMINI_FILE="${WORKSPACE_ROOT}/GEMINI.md"
96
+ if [[ -L "${GEMINI_FILE}" ]]; then
97
+ TARGET=$(readlink "${GEMINI_FILE}")
98
+ if is_valid_agents_target "${TARGET}"; then
99
+ log_pass "GEMINI.md is a valid symlink to AGENTS.md."
100
+ else
101
+ log_fail "GEMINI.md points to '${TARGET}' instead of 'AGENTS.md'."
102
+ fi
103
+ elif [[ -f "${GEMINI_FILE}" ]] && is_valid_text_pointer "${GEMINI_FILE}"; then
104
+ log_pass "GEMINI.md is a text pointer to AGENTS.md (symlink fallback)."
105
+ else
106
+ log_fail "GEMINI.md is not a symbolic link."
107
+ fi
108
+
109
+ # Check .cursorrules symlink
110
+ CURSOR_FILE="${WORKSPACE_ROOT}/.cursorrules"
111
+ if [[ -L "${CURSOR_FILE}" ]]; then
112
+ TARGET=$(readlink "${CURSOR_FILE}")
113
+ if is_valid_agents_target "${TARGET}"; then
114
+ log_pass ".cursorrules is a valid symlink to AGENTS.md."
115
+ else
116
+ log_fail ".cursorrules points to '${TARGET}' instead of 'AGENTS.md'."
117
+ fi
118
+ elif [[ -f "${CURSOR_FILE}" ]] && is_valid_text_pointer "${CURSOR_FILE}"; then
119
+ log_pass ".cursorrules is a text pointer to AGENTS.md (symlink fallback)."
120
+ else
121
+ log_fail ".cursorrules is not a symbolic link."
122
+ fi
123
+
124
+ # Check .windsurfrules symlink
125
+ WINDSURF_FILE="${WORKSPACE_ROOT}/.windsurfrules"
126
+ if [[ -L "${WINDSURF_FILE}" ]]; then
127
+ TARGET=$(readlink "${WINDSURF_FILE}")
128
+ if is_valid_agents_target "${TARGET}"; then
129
+ log_pass ".windsurfrules is a valid symlink to AGENTS.md."
130
+ else
131
+ log_fail ".windsurfrules points to '${TARGET}' instead of 'AGENTS.md'."
132
+ fi
133
+ elif [[ -f "${WINDSURF_FILE}" ]] && is_valid_text_pointer "${WINDSURF_FILE}"; then
134
+ log_pass ".windsurfrules is a text pointer to AGENTS.md (symlink fallback)."
135
+ else
136
+ log_fail ".windsurfrules is not a symbolic link."
137
+ fi
138
+
139
+ # Check .github/copilot-instructions.md symlink (if .github directory exists)
140
+ COPILOT_FILE="${WORKSPACE_ROOT}/.github/copilot-instructions.md"
141
+ if [[ -d "${WORKSPACE_ROOT}/.github" ]]; then
142
+ if [[ -L "${COPILOT_FILE}" ]]; then
143
+ TARGET=$(readlink "${COPILOT_FILE}")
144
+ if [[ "${TARGET}" == "../AGENTS.md" || "${TARGET}" == "${WORKSPACE_ROOT}/AGENTS.md" || "${TARGET}" == "AGENTS.md" ]]; then
145
+ log_pass ".github/copilot-instructions.md is a valid symlink to AGENTS.md."
146
+ else
147
+ log_fail ".github/copilot-instructions.md points to '${TARGET}' instead of '../AGENTS.md'."
148
+ fi
149
+ elif [[ -f "${COPILOT_FILE}" ]] && [[ "$(< "${COPILOT_FILE}")" == *"AGENTS.md"* ]]; then
150
+ log_pass ".github/copilot-instructions.md references AGENTS.md (symlink fallback)."
151
+ elif [[ -f "${COPILOT_FILE}" ]]; then
152
+ log_warn ".github/copilot-instructions.md exists but is neither a symlink to ../AGENTS.md nor references AGENTS.md."
153
+ fi
154
+ fi
155
+
81
156
  # 2. Checking Progressive Disclosure Rules (docs/rules)
82
157
  echo ""
83
158
  echo "2. Checking Progressive Disclosure Rules..."
@@ -128,6 +203,11 @@ else
128
203
  log_fail "Skill '${SKILL_NAME}' missing opening front matter delimiter (---)"
129
204
  continue
130
205
  fi
206
+
207
+ # Check closing front matter delimiter
208
+ if ! awk 'NR > 1 && /^---[[:space:]]*$/ { found=1; exit } END { exit !found }' "${SKILL_FILE}"; then
209
+ log_fail "Skill '${SKILL_NAME}' missing closing front matter delimiter (---)"
210
+ fi
131
211
 
132
212
  # Check name field in front matter
133
213
  if ! grep -E "^name:[[:space:]]*${SKILL_NAME}" "${SKILL_FILE}" > /dev/null; then
@@ -143,6 +223,11 @@ else
143
223
  if [[ ! "${DESC}" =~ ^Use[[:space:]]when ]]; then
144
224
  log_warn "Skill '${SKILL_NAME}' description should start with imperative 'Use when...'"
145
225
  fi
226
+
227
+ # Check negative boundary phrasing (Do not use / Do NOT use)
228
+ if ! echo "${DESC}" | grep -qiE "(do not use|do NOT use)"; then
229
+ log_warn "Skill '${SKILL_NAME}' description should specify negative boundaries ('Do not use for...')"
230
+ fi
146
231
 
147
232
  # Check character length (< 1024)
148
233
  CHAR_LEN=${#DESC}
@@ -167,7 +252,74 @@ else
167
252
  log_pass "Validated ${SKILL_COUNT} skills in .agents/skills/."
168
253
  fi
169
254
 
170
- # 4. Summary Output
255
+ # 4. Checking Markdown Internal Links & Cross-References
256
+ echo ""
257
+ echo "4. Checking Markdown Internal Links & Cross-References..."
258
+ LINK_CHECK_RAW=$(node -e '
259
+ const fs = require("fs");
260
+ const path = require("path");
261
+
262
+ const root = process.argv[1];
263
+ const broken = [];
264
+ let totalLinks = 0;
265
+
266
+ function walk(dir) {
267
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
268
+ for (const entry of entries) {
269
+ if (entry.name === ".git" || entry.name === "node_modules") continue;
270
+ const full = path.join(dir, entry.name);
271
+ if (entry.isDirectory()) {
272
+ walk(full);
273
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
274
+ checkFile(full);
275
+ }
276
+ }
277
+ }
278
+
279
+ function checkFile(filePath) {
280
+ const content = fs.readFileSync(filePath, "utf8");
281
+ const dir = path.dirname(filePath);
282
+ const regex = /\[([^\]]+)\]\(([^)]+)\)/g;
283
+ let match;
284
+ while ((match = regex.exec(content)) !== null) {
285
+ const target = match[2].trim();
286
+ if (target.startsWith("http://") || target.startsWith("https://") || target.startsWith("mailto:") || target.startsWith("#") || target.startsWith("conversation://") || target.startsWith("file://")) {
287
+ continue;
288
+ }
289
+ const cleanTarget = target.split("#")[0];
290
+ if (!cleanTarget) continue;
291
+ totalLinks++;
292
+ const resolved = path.normalize(path.join(dir, cleanTarget));
293
+ if (!fs.existsSync(resolved)) {
294
+ broken.push(`${path.relative(root, filePath)} -> ${target}`);
295
+ }
296
+ }
297
+ }
298
+
299
+ walk(root);
300
+ if (broken.length > 0) {
301
+ console.log("BROKEN:" + broken.join("|"));
302
+ process.exit(1);
303
+ } else {
304
+ console.log("OK:" + totalLinks);
305
+ process.exit(0);
306
+ }
307
+ ' "${WORKSPACE_ROOT}" 2>&1) || true
308
+
309
+ if [[ "${LINK_CHECK_RAW}" =~ ^OK:([0-9]+) ]]; then
310
+ TOTAL_LINKS="${BASH_REMATCH[1]}"
311
+ log_pass "Validated ${TOTAL_LINKS} internal links across workspace (0 broken links)."
312
+ elif [[ "${LINK_CHECK_RAW}" =~ ^BROKEN:(.*) ]]; then
313
+ BROKEN_LIST="${BASH_REMATCH[1]}"
314
+ IFS='|' read -ra BROKEN_ITEMS <<< "${BROKEN_LIST}"
315
+ for item in "${BROKEN_ITEMS[@]}"; do
316
+ log_fail "Broken markdown link: ${item}"
317
+ done
318
+ else
319
+ log_fail "Markdown link validation failed unexpectedly: ${LINK_CHECK_RAW}"
320
+ fi
321
+
322
+ # 5. Summary Output
171
323
  echo ""
172
324
  echo "--------------------------------------------------------------"
173
325
  if [[ ${ERRORS} -eq 0 ]]; then
@@ -5,7 +5,7 @@ description: Use when refactoring existing code to comply with Clean Code, SOLID
5
5
 
6
6
  # Clean Code & Design Patterns Refactoring Skill
7
7
 
8
- > **Core Purpose:** Transform messy, coupled, or rigid code into clean, expressive, and maintainable TypeScript implementations adhering to Robert C. Martin's Clean Code, The Pragmatic Programmer, and modern Gang of Four patterns without altering external behavior.
8
+ > **Core Purpose:** Transform messy, coupled, or rigid code into clean, expressive, and maintainable implementations adhering to Robert C. Martin's Clean Code, The Pragmatic Programmer, and modern Gang of Four patterns without altering external behavior.
9
9
 
10
10
  ---
11
11
 
@@ -27,7 +27,7 @@ description: Use when refactoring existing code to comply with Clean Code, SOLID
27
27
 
28
28
  ### Step 1: Establish the Test Safety Net
29
29
  - Never refactor without passing tests.
30
- - Confirm all existing unit and acceptance tests pass: `npm run test` or `npm run coverage`.
30
+ - Confirm all existing unit and acceptance tests pass: workspace test command (e.g. `npm test`, `cargo test`, `go test ./...`, `pytest`).
31
31
  - If coverage is missing or incomplete, write tests *before* touching production code.
32
32
 
33
33
  ### Step 2: Identify Specific Code Smells
@@ -45,8 +45,8 @@ Target concrete flaws:
45
45
 
46
46
  ### Step 4: Execute Atomic Surgical Edits
47
47
  - Make one micro-refactor at a time (e.g. rename a method, extract a class).
48
- - Maintain existing naming conventions and strict TypeScript types.
49
- - Ensure zero lint or type errors: `npm run lint && npm run typecheck`.
48
+ - Maintain existing naming conventions and idiomatic type safety.
49
+ - Ensure zero lint or type errors: workspace linter and compiler (e.g. `npm run lint && npm run typecheck`, `cargo clippy`, `golangci-lint`, `mypy`).
50
50
 
51
51
  ### Step 5: Verify Continuous Green State
52
52
  - Run tests after every single atomic change: `npm run coverage`.
@@ -81,11 +81,11 @@ Target concrete flaws:
81
81
  3. **Verification Evidence**:
82
82
  - Tests Status: PASS (100.00% statement, branch, and function coverage preserved)
83
83
  - Linter Status: PASS (0 ESLint warnings)
84
- - Typecheck: PASS (0 TypeScript errors)
84
+ - Typecheck / Compiler: PASS (0 errors)
85
85
  ```
86
86
 
87
87
  ---
88
88
 
89
89
  ## 5. Subdirectories & Progressive Resources
90
90
  - [references/clean_code_smells.md](./references/clean_code_smells.md): Catalog of code smells and their refactoring cures.
91
- - [references/design_patterns_ts.md](./references/design_patterns_ts.md): Production TypeScript implementations of Adapter, Strategy, and Result patterns.
91
+ - [references/design_patterns_ts.md](./references/design_patterns_ts.md): Reference implementations of Adapter, Strategy, and Result patterns (illustrated in TypeScript).
@@ -102,7 +102,7 @@ Audit architectural implementation against compliance baselines:
102
102
  ## 3. Compliance Control Evaluation Matrix
103
103
  | Framework | Control ID | Control Description | Status | Evidence / Notes |
104
104
  |---|---|---|---|---|
105
- | **SOC 2** | CC6.1 | Least-privilege RBAC & tenant isolation | PASS | Scoped queries in Prisma |
105
+ | **SOC 2** | CC6.1 | Least-privilege RBAC & tenant isolation | PASS | Scoped database queries / RLS |
106
106
  | **SOC 2** | CC7.2 | Tamper-evident mutation audit logging | PASS | Audit table with actor tracing |
107
107
  | **ISO 27001** | A.10.1 | Cryptographic controls (AES-256, TLS 1.3) | PASS | TLS 1.3 configured, Argon2id auth |
108
108
  | **OWASP** | A01 | Broken Access Control checks | PASS | Server-side guards on all routes |
@@ -13,7 +13,7 @@ description: Use when initializing or bootstrapping a new project from this temp
13
13
 
14
14
  - When the user starts a fresh project by copying this workspace into a new directory.
15
15
  - When the user explicitly invokes `/lets-build` or asks to initialize/scaffold a new application.
16
- - When transforming or re-architecting an existing project to adhere to the 41 atomic domain rules.
16
+ - When transforming or re-architecting an existing project to adhere to the 28 cohesive domain rules.
17
17
  - **Do NOT use for**:
18
18
  - Routine bug fixes or minor edits on an already bootstrapped codebase.
19
19
  - Adding a single endpoint or modifying an existing domain model.
@@ -79,7 +79,7 @@ Inquire *only* into the dimensions relevant to the selected topology:
79
79
 
80
80
  ### Phase 3: Synthesize (Architecture Blueprint & User Sign-Off)
81
81
  1. Consolidate the user's answers into a formal **Consolidated Architectural Blueprint** (using Section 4 template).
82
- 2. Author an Architectural Decision Record in `memory.md` (e.g. `ADR-006: Target Technology Stack & Scaffolding Baseline`).
82
+ 2. Author an Architectural Decision Record in `memory.md` (e.g. `ADR-025: Target Technology Stack & Scaffolding Baseline` or next sequential ADR).
83
83
  3. **STOP AND ASK FOR EXPLICIT CONFIRMATION**: Present the blueprint and ADR to the user. Do NOT write scaffolding code until the user approves the blueprint.
84
84
 
85
85
  ---
@@ -90,14 +90,14 @@ Upon user confirmation:
90
90
  ```bash
91
91
  bash .agents/skills/lets-build/scripts/bootstrap_workspace.sh . <topology> <language>
92
92
  ```
93
- 2. Generate base infrastructure strictly for the selected topology (zero speculative bloat):
93
+ 2. Generate base infrastructure strictly for the selected topology (zero speculative bloat) using layouts from [references/hexagonal_bootstrap_scaffolds.md](./references/hexagonal_bootstrap_scaffolds.md):
94
94
  - *Backend:* `specs/openapi/v1/openapi.yaml`, `specs/tokens/tokens.json`, `deploy/docker`, `deploy/compose`.
95
95
  - *Extension:* `manifest.json`, `src/background/index.ts`, `src/content/index.ts`, `src/popup/index.html`.
96
96
  - *Game / Engine:* `src/core/`, `src/ecs/`, asset manifest, frame loop entrypoint.
97
97
  - *CLI:* `src/cmd/`, `src/core/`, CLI entrypoint with exit code handling.
98
98
  3. Generate build manifests (`Cargo.toml`, `package.json`, `go.mod`, `pyproject.toml`), linter configurations, and boundary smoke test (`scripts/smoke_test.sh`).
99
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.
100
+ Generate a clean, project-specific `README.md` using [references/project_readme_template.md](./references/project_readme_template.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
 
@@ -155,3 +155,11 @@ Upon user confirmation:
155
155
  - **Code Health Gates:** 100.00% test coverage gate, zero lint errors
156
156
  - **DevSecOps:** <Semgrep / Trivy / Gitleaks / None>
157
157
  ```
158
+
159
+ ---
160
+
161
+ ## 5. Subdirectories & Progressive Resources
162
+ - [references/architecture_interview_matrix.md](./references/architecture_interview_matrix.md): Exhaustive 5-tier problem-first architecture interview questions and branch logic.
163
+ - [references/hexagonal_bootstrap_scaffolds.md](./references/hexagonal_bootstrap_scaffolds.md): Standardized directory trees and foundational templates across Go, Rust, Python, and TypeScript.
164
+ - [references/project_readme_template.md](./references/project_readme_template.md): Boilerplate template for replacing starter documentation with project-specific README.
165
+ - [scripts/bootstrap_workspace.sh](./scripts/bootstrap_workspace.sh): Topology-aware deterministic workspace initialization script.
@@ -13,7 +13,7 @@ Regardless of language, all bootstrapped projects must follow this high-level se
13
13
  ├── .agents/skills/ # Specialized agentic workflows (carried from azcodr template)
14
14
  ├── docs/
15
15
  │ ├── knowledge/ # Domain knowledge & living ubiquitous language glossary
16
- │ └── rules/ # 41 atomic single-responsibility domain rules
16
+ │ └── rules/ # 28 cohesive single-responsibility domain rules
17
17
  ├── specs/ # Canonical contract specifications
18
18
  │ ├── protobuf/ # gRPC service definitions (*.proto)
19
19
  │ ├── openapi/ # OpenAPI 3.1 REST specifications (*.yaml)
@@ -37,7 +37,7 @@
37
37
  │ ├── contracts/ # Consumer contract tests (Pact)
38
38
  │ └── acceptance/ # BDD Gherkin / Cucumber features
39
39
  ├── deploy/ # OCI Distroless Dockerfiles & Compose manifests
40
- ├── docs/rules/ # 41 atomic single-responsibility architectural rules
40
+ ├── docs/rules/ # 28 cohesive single-responsibility architectural rules
41
41
  ├── memory.md # Master memory hub & Lightweight ADR ledger
42
42
  └── AGENTS.md # Lean agentic directives (< 120 lines)
43
43
  ```
@@ -74,6 +74,6 @@ cp .env.example .env
74
74
 
75
75
  ## 🏛️ Architecture Governance & Decisions
76
76
 
77
- This project is governed by the **41 Atomic Domain Rules** located in [`docs/rules/`](./docs/rules/) and Architectural Decision Records in [`memory.md`](./memory.md):
78
- - **ADR Ledger:** See [`memory.md`](./memory.md) for ADR-001 through ADR-006.
79
- - **Architectural Rules:** See [`docs/rules/`](./docs/rules/) for TDD, Clean Code, Multi-Tenancy, Database Integrity, and DevSecOps directives.
77
+ This project is governed by the **28 Cohesive Domain Rules** located in `docs/rules/` and Architectural Decision Records in `memory.md`:
78
+ - **ADR Ledger:** See `memory.md` for project-specific Architectural Decision Records.
79
+ - **Architectural Rules:** See `docs/rules/` for TDD, Clean Code, Multi-Tenancy, Database Design, and DevSecOps directives.