azcodr 1.3.0 → 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.
- package/.agents/hooks.json.example +42 -0
- package/.agents/mcp_config.json.example +24 -0
- package/.agents/skills/agentic-architect/SKILL.md +14 -7
- package/.agents/skills/agentic-architect/references/agents_md_template.md +6 -3
- package/.agents/skills/agentic-architect/references/skill_architecture_inquiry.md +1 -1
- package/.agents/skills/agentic-architect/references/skill_template.md +2 -1
- package/.agents/skills/agentic-architect/scripts/validate_agentic_configs.sh +156 -4
- package/.agents/skills/clean-code-refactor/SKILL.md +6 -6
- package/.agents/skills/compliance-audit/SKILL.md +1 -1
- package/.agents/skills/lets-build/SKILL.md +12 -4
- package/.agents/skills/lets-build/references/hexagonal_bootstrap_scaffolds.md +1 -1
- package/.agents/skills/lets-build/references/project_readme_template.md +4 -4
- package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +63 -35
- package/.agents/skills/relentless-questioner/SKILL.md +10 -5
- package/AGENTS.md +25 -40
- package/README.md +27 -40
- package/bin/azcodr.js +1 -1
- package/docs/rules/agentic_configuration.md +120 -32
- package/docs/rules/api_architecture.md +179 -0
- package/docs/rules/caching.md +30 -13
- package/docs/rules/cloud_native.md +10 -12
- package/docs/rules/cqrs.md +203 -0
- package/docs/rules/database_design.md +125 -0
- package/docs/rules/database_operations.md +56 -14
- package/docs/rules/design_patterns.md +18 -11
- package/docs/rules/devops_ci_cd.md +76 -0
- package/docs/rules/domain_driven_design.md +17 -13
- package/docs/rules/feature_flags.md +21 -4
- package/docs/rules/frontend_architecture.md +157 -0
- package/docs/rules/multitenancy_architecture.md +98 -0
- package/docs/rules/product_ownership.md +22 -27
- package/docs/rules/requirements_engineering.md +16 -14
- package/docs/rules/security_compliance.md +53 -0
- package/docs/rules/server_driven_ui.md +20 -3
- package/docs/rules/test_driven_development.md +118 -62
- package/docs/rules/type_safety.md +65 -0
- package/docs/rules/ui_ux_architecture.md +33 -30
- package/docs/rules/workflow_state_machines.md +20 -3
- package/lib/scaffold.js +9 -0
- package/memory.md +149 -15
- package/package.json +2 -2
- package/docs/rules/accessibility.md +0 -31
- package/docs/rules/advanced_api_patterns.md +0 -104
- package/docs/rules/api_versioning.md +0 -113
- package/docs/rules/application_security.md +0 -23
- package/docs/rules/architecture_decision_records.md +0 -42
- package/docs/rules/compliance.md +0 -25
- package/docs/rules/container_infrastructure.md +0 -32
- package/docs/rules/continuous_deployment.md +0 -24
- package/docs/rules/continuous_integration.md +0 -20
- package/docs/rules/continuous_learning.md +0 -29
- package/docs/rules/database_integrity.md +0 -80
- package/docs/rules/database_migrations.md +0 -41
- package/docs/rules/database_performance.md +0 -44
- package/docs/rules/database_transactions.md +0 -81
- package/docs/rules/devsecops.md +0 -33
- package/docs/rules/multitenancy_isolation.md +0 -88
- package/docs/rules/react.md +0 -78
- package/docs/rules/rest_api_conventions.md +0 -46
- package/docs/rules/tenant_dynamic_schemas.md +0 -88
- package/docs/rules/tenant_pluggable_logic.md +0 -59
- package/docs/rules/test_isolation.md +0 -26
- package/docs/rules/typescript.md +0 -55
- package/docs/rules/ui_navigation.md +0 -20
- package/docs/rules/workspace_isolation.md +0 -25
|
@@ -15,66 +15,75 @@ echo "🏗️ Target Topology: ${TOPOLOGY}"
|
|
|
15
15
|
echo "📦 Target Language Profile: ${LANGUAGE}"
|
|
16
16
|
echo "--------------------------------------------------------------"
|
|
17
17
|
|
|
18
|
+
# Helper to create leaf directory with .gitkeep to ensure Git tracks empty structures
|
|
19
|
+
create_leaf() {
|
|
20
|
+
local dir="$1"
|
|
21
|
+
mkdir -p "${dir}"
|
|
22
|
+
if [[ -z "$(ls -A "${dir}" 2>/dev/null)" ]]; then
|
|
23
|
+
touch "${dir}/.gitkeep"
|
|
24
|
+
fi
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
case "${TOPOLOGY}" in
|
|
19
28
|
extension)
|
|
20
29
|
echo "1. Scaffolding Browser Extension Source Tree (src/)..."
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
create_leaf "${WORKSPACE_ROOT}/src/background"
|
|
31
|
+
create_leaf "${WORKSPACE_ROOT}/src/content"
|
|
32
|
+
create_leaf "${WORKSPACE_ROOT}/src/popup"
|
|
33
|
+
create_leaf "${WORKSPACE_ROOT}/src/shared"
|
|
34
|
+
create_leaf "${WORKSPACE_ROOT}/public"
|
|
26
35
|
|
|
27
36
|
echo "2. Scaffolding Extension Test Suites (tests/)..."
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
create_leaf "${WORKSPACE_ROOT}/tests/unit"
|
|
38
|
+
create_leaf "${WORKSPACE_ROOT}/tests/e2e"
|
|
30
39
|
;;
|
|
31
40
|
|
|
32
41
|
game|engine)
|
|
33
42
|
echo "1. Scaffolding Game/Engine Source Tree (src/)..."
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
create_leaf "${WORKSPACE_ROOT}/src/core"
|
|
44
|
+
create_leaf "${WORKSPACE_ROOT}/src/ecs"
|
|
45
|
+
create_leaf "${WORKSPACE_ROOT}/src/renderer"
|
|
46
|
+
create_leaf "${WORKSPACE_ROOT}/src/assets"
|
|
38
47
|
|
|
39
48
|
echo "2. Scaffolding Game/Engine Test Suites (tests/)..."
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
create_leaf "${WORKSPACE_ROOT}/tests/unit"
|
|
50
|
+
create_leaf "${WORKSPACE_ROOT}/tests/benchmarks"
|
|
42
51
|
;;
|
|
43
52
|
|
|
44
53
|
cli)
|
|
45
54
|
echo "1. Scaffolding CLI Source Tree (src/)..."
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
create_leaf "${WORKSPACE_ROOT}/src/cmd"
|
|
56
|
+
create_leaf "${WORKSPACE_ROOT}/src/core"
|
|
57
|
+
create_leaf "${WORKSPACE_ROOT}/src/io"
|
|
49
58
|
|
|
50
59
|
echo "2. Scaffolding CLI Test Suites (tests/)..."
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
create_leaf "${WORKSPACE_ROOT}/tests/unit"
|
|
61
|
+
create_leaf "${WORKSPACE_ROOT}/tests/integration"
|
|
53
62
|
;;
|
|
54
63
|
|
|
55
64
|
backend|web|saas)
|
|
56
65
|
echo "1. Scaffolding Backend / Enterprise Source Tree (src/)..."
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
create_leaf "${WORKSPACE_ROOT}/src/domain/entities"
|
|
67
|
+
create_leaf "${WORKSPACE_ROOT}/src/domain/value_objects"
|
|
68
|
+
create_leaf "${WORKSPACE_ROOT}/src/domain/services"
|
|
69
|
+
create_leaf "${WORKSPACE_ROOT}/src/ports/primary"
|
|
70
|
+
create_leaf "${WORKSPACE_ROOT}/src/ports/secondary"
|
|
71
|
+
create_leaf "${WORKSPACE_ROOT}/src/adapters/primary"
|
|
72
|
+
create_leaf "${WORKSPACE_ROOT}/src/adapters/secondary"
|
|
64
73
|
|
|
65
74
|
echo "2. Scaffolding Specifications (specs/)..."
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
create_leaf "${WORKSPACE_ROOT}/specs/openapi"
|
|
76
|
+
create_leaf "${WORKSPACE_ROOT}/specs/tokens"
|
|
68
77
|
|
|
69
78
|
echo "3. Scaffolding Backend Test Suites (tests/)..."
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
create_leaf "${WORKSPACE_ROOT}/tests/unit"
|
|
80
|
+
create_leaf "${WORKSPACE_ROOT}/tests/integration"
|
|
81
|
+
create_leaf "${WORKSPACE_ROOT}/tests/contracts"
|
|
82
|
+
create_leaf "${WORKSPACE_ROOT}/tests/acceptance"
|
|
74
83
|
|
|
75
84
|
echo "4. Scaffolding Deployment Infrastructure (deploy/)..."
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
create_leaf "${WORKSPACE_ROOT}/deploy/docker"
|
|
86
|
+
create_leaf "${WORKSPACE_ROOT}/deploy/compose"
|
|
78
87
|
|
|
79
88
|
TOKEN_SPEC="${WORKSPACE_ROOT}/specs/tokens/tokens.json"
|
|
80
89
|
if [[ ! -f "${TOKEN_SPEC}" ]]; then
|
|
@@ -99,10 +108,29 @@ EOF
|
|
|
99
108
|
|
|
100
109
|
*)
|
|
101
110
|
echo "1. Scaffolding Generic / Library Source Tree (src/)..."
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
create_leaf "${WORKSPACE_ROOT}/src"
|
|
112
|
+
create_leaf "${WORKSPACE_ROOT}/tests/unit"
|
|
104
113
|
;;
|
|
105
114
|
esac
|
|
106
115
|
|
|
116
|
+
# Deterministically generate boundary verification smoke test script (Phase 5 requirement)
|
|
117
|
+
SMOKE_TEST="${WORKSPACE_ROOT}/scripts/smoke_test.sh"
|
|
118
|
+
if [[ ! -f "${SMOKE_TEST}" ]]; then
|
|
119
|
+
echo "5. Generating boundary smoke test verification script (scripts/smoke_test.sh)..."
|
|
120
|
+
mkdir -p "${WORKSPACE_ROOT}/scripts"
|
|
121
|
+
cat << 'EOF' > "${SMOKE_TEST}"
|
|
122
|
+
#!/usr/bin/env bash
|
|
123
|
+
# ==============================================================================
|
|
124
|
+
# Boundary Verification Smoke Test (Phase 5 Verification Gate)
|
|
125
|
+
# ==============================================================================
|
|
126
|
+
set -euo pipefail
|
|
127
|
+
|
|
128
|
+
echo "Running boundary smoke verification..."
|
|
129
|
+
# Extend with project-specific runtime health checks (e.g. ping health endpoint, CLI --help)
|
|
130
|
+
echo "✅ Boundary smoke verification passed!"
|
|
131
|
+
EOF
|
|
132
|
+
chmod +x "${SMOKE_TEST}"
|
|
133
|
+
fi
|
|
134
|
+
|
|
107
135
|
echo "--------------------------------------------------------------"
|
|
108
136
|
echo "✅ Topology '${TOPOLOGY}' scaffolded with strict YAGNI (0 speculative folders)!"
|
|
@@ -58,10 +58,10 @@ Do NOT dump a massive 20-question static checklist. Execute the interview in **d
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
60
|
### Phase 3: Architectural Friction & Rule Reconciliation
|
|
61
|
-
Check the user's proposed answers against the **
|
|
62
|
-
- If the user proposes writing to the database and publishing an event sequentially ➔ **Flag the dual-write anti-pattern** and mandate the Transactional Outbox pattern ([`
|
|
63
|
-
- If the user proposes storing tenant data without an isolation mechanism ➔ **Flag the tenant leak risk** and mandate an isolation model ([`
|
|
64
|
-
- If the user proposes arbitrary untrusted script execution ➔ **Flag the host security vulnerability** and mandate Wasm sandboxing ([`
|
|
61
|
+
Check the user's proposed answers against the **28 Cohesive Domain Rules** in `docs/rules/`:
|
|
62
|
+
- If the user proposes writing to the database and publishing an event sequentially ➔ **Flag the dual-write anti-pattern** and mandate the Transactional Outbox pattern ([`database_design.md`](../../../docs/rules/database_design.md)).
|
|
63
|
+
- If the user proposes storing tenant data without an isolation mechanism ➔ **Flag the tenant leak risk** and mandate an isolation model ([`multitenancy_architecture.md`](../../../docs/rules/multitenancy_architecture.md)).
|
|
64
|
+
- If the user proposes arbitrary untrusted script execution ➔ **Flag the host security vulnerability** and mandate Wasm sandboxing ([`multitenancy_architecture.md`](../../../docs/rules/multitenancy_architecture.md)).
|
|
65
65
|
- Reconcile the conflict collaboratively before proceeding.
|
|
66
66
|
|
|
67
67
|
---
|
|
@@ -78,7 +78,7 @@ Synthesize the answers into an unambiguous **Feature Alignment Specification (FA
|
|
|
78
78
|
- **DO NOT** ask 10+ questions at once. Keep batches small (2–3 questions) to maintain a collaborative conversation.
|
|
79
79
|
- **DO NOT** start coding or planning in parallel while the interrogation is in progress.
|
|
80
80
|
- **DO NOT** let the user bypass critical failure branches (e.g. *"we'll handle errors later"*). Insist on defining failure states.
|
|
81
|
-
- **DO NOT** compromise on the
|
|
81
|
+
- **DO NOT** compromise on the 28 cohesive domain rules. If a user request introduces an architectural violation, surface it immediately.
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
@@ -118,3 +118,8 @@ Synthesize the answers into an unambiguous **Feature Alignment Specification (FA
|
|
|
118
118
|
```
|
|
119
119
|
- **Test Strategy:** [Contract / Integration / Unit tests required for 100% coverage]
|
|
120
120
|
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 5. Subdirectories & Progressive Resources
|
|
125
|
+
- [references/adaptive_question_trees.md](./references/adaptive_question_trees.md): Contextual branching trees for state mutations, multi-tenancy, integrations, and caching.
|
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **azcodr: Enterprise Architecture & Agentic Engineering Starter Template**
|
|
4
|
+
> **Workspace Mission:** Problem-first, topology-aligned production architectures governed by strict systemic atomicity, 100% open-source standards, true incremental TDD nano-cycles, and zero speculative bloat.
|
|
5
|
+
> **Runtime & Tools:** Node.js (`>=18.0.0`), npm (`>=10.0.0`) | `npm test` (test runner), `npm run test:coverage` (100% gate), `npm run lint`, `npm run validate`.
|
|
4
6
|
> **Rule Zero:** Assume nothing. Every action must be grounded in verified evidence from this workspace or direct instructions from the user.
|
|
5
|
-
> **
|
|
6
|
-
> **
|
|
7
|
-
> **Architecture Mandate:** Architecture emerges strictly from problem constraints and execution targets (Problem-First; zero tool/platform bias). Match architectural style to problem topology (Hexagonal for enterprise backends, Platform Scripting for extensions, Data-Oriented Design for game engines, Command Pipeline for CLIs, Game Loop for canvas games). Never force premature abstractions or universal templates.
|
|
7
|
+
> **Atomicity Mandate:** All rules, skills, code units, migrations, and transactions must be strictly atomic (indivisible, self-contained, composable with full ACID safety).
|
|
8
|
+
> **Architecture Mandate:** Architecture emerges strictly from problem constraints and execution targets (Problem-First; zero tool/platform bias). Match architectural style to problem topology (Hexagonal for backends, Platform Scripting for extensions, Data-Oriented Design for game engines, Command Pipeline for CLIs, Game Loop for canvas games).
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
@@ -56,50 +57,34 @@ To prevent context bloat and keep prompt overhead minimal, detailed engineering
|
|
|
56
57
|
|
|
57
58
|
| Domain | Rule Reference File | When to Consult |
|
|
58
59
|
|---|---|---|
|
|
59
|
-
| **TDD
|
|
60
|
-
| **Test Coverage & Isolation** | [docs/rules/test_isolation.md](./docs/rules/test_isolation.md) | 100.00% full-stack coverage, status codes, transactional DB rollback. |
|
|
60
|
+
| **TDD & Isolation** | [docs/rules/test_driven_development.md](./docs/rules/test_driven_development.md) | Outside-In TDD, Uncle Bob's 3 Laws, 100% coverage, test isolation & DB rollback. |
|
|
61
61
|
| **Clean Code** | [docs/rules/clean_code.md](./docs/rules/clean_code.md) | Naming, small functions, CQS, SLAP, DRY, DbC, zero side-effects. |
|
|
62
|
-
| **Design Patterns** | [docs/rules/design_patterns.md](./docs/rules/design_patterns.md) | Adapter, Factory, Strategy, Result `<T, E>`, and
|
|
63
|
-
| **Type Safety** | [docs/rules/
|
|
64
|
-
| **ADRs** | [docs/rules/architecture_decision_records.md](./docs/rules/architecture_decision_records.md) | Authoring Lightweight Architectural Decision Records in `memory.md`. |
|
|
62
|
+
| **Design Patterns** | [docs/rules/design_patterns.md](./docs/rules/design_patterns.md) | Adapter, Factory, Strategy, Result `<T, E>`, and GoF pattern catalog. |
|
|
63
|
+
| **Type Safety** | [docs/rules/type_safety.md](./docs/rules/type_safety.md) | Compiler strictness, branded nominal types, type discriminators across polyglot languages. |
|
|
65
64
|
| **Authentication** | [docs/rules/authentication.md](./docs/rules/authentication.md) | In-memory access tokens, refresh token rotation (RTR), WebAuthn passkeys. |
|
|
66
65
|
| **Authorization** | [docs/rules/authorization.md](./docs/rules/authorization.md) | CASL, OPA Rego policy engines, OpenFGA ReBAC, server guards. |
|
|
67
|
-
| **Multi-Tenancy
|
|
68
|
-
| **
|
|
69
|
-
| **
|
|
70
|
-
| **
|
|
71
|
-
| **
|
|
72
|
-
| **
|
|
73
|
-
| **
|
|
74
|
-
| **
|
|
75
|
-
| **
|
|
76
|
-
| **Database Integrity** | [docs/rules/database_integrity.md](./docs/rules/database_integrity.md) | Foreign keys, domain CHECK constraints, interval EXCLUDE, soft-delete indexes. |
|
|
77
|
-
| **Database Operations** | [docs/rules/database_operations.md](./docs/rules/database_operations.md) | Continuous PITR, autovacuum/defrag tuning, connection pooling, role separation. |
|
|
78
|
-
| **Database Performance** | [docs/rules/database_performance.md](./docs/rules/database_performance.md) | Eliminating N+1 queries, DataLoader batching, composite tenant indexes. |
|
|
79
|
-
| **Caching** | [docs/rules/caching.md](./docs/rules/caching.md) | Cache Port semantics, Cache-Aside, jittered TTLs, XFetch stampede defense. |
|
|
80
|
-
| **Application Security** | [docs/rules/application_security.md](./docs/rules/application_security.md) | OWASP Top 10 defenses, cryptographic rigor, token bucket rate limiting. |
|
|
81
|
-
| **Regulatory Compliance** | [docs/rules/compliance.md](./docs/rules/compliance.md) | SOC 2 Type II controls, ISO/IEC 27001 ISMS, GDPR data erasure rights. |
|
|
82
|
-
| **DevSecOps** | [docs/rules/devsecops.md](./docs/rules/devsecops.md) | Secretlint pre-commit gating, CycloneDX SBOM generation, Trivy/Grype scanning. |
|
|
66
|
+
| **Multi-Tenancy** | [docs/rules/multitenancy_architecture.md](./docs/rules/multitenancy_architecture.md) | Tenant context, 4 isolation models, RLS, dynamic schemas, pluggable logic & YAGNI gates. |
|
|
67
|
+
| **API Architecture** | [docs/rules/api_architecture.md](./docs/rules/api_architecture.md) | HTTP status codes, sync vs async (202), `_actions`, idempotency keys, cursor pagination, OCC, versioning. |
|
|
68
|
+
| **Server-Driven UI** | [docs/rules/server_driven_ui.md](./docs/rules/server_driven_ui.md) | Backend-driven layout schemas, multi-renderer component registries, DTCG tokens & YAGNI gate. |
|
|
69
|
+
| **Database Design** | [docs/rules/database_design.md](./docs/rules/database_design.md) | Relational integrity, FKs, CHECK constraints, Canonical 6 audit fields, ACID transactions, Outbox CDC. |
|
|
70
|
+
| **Database Operations** | [docs/rules/database_operations.md](./docs/rules/database_operations.md) | Zero-downtime expand-contract migrations, N+1 elimination, DataLoader, indexing, pooling, PITR. |
|
|
71
|
+
| **Caching** | [docs/rules/caching.md](./docs/rules/caching.md) | Cache Port semantics, Cache-Aside, jittered TTLs, XFetch stampede defense & YAGNI gate. |
|
|
72
|
+
| **Security & Compliance** | [docs/rules/security_compliance.md](./docs/rules/security_compliance.md) | OWASP Top 10 defenses, rate limiting, crypto, SOC 2 Type II, ISO 27001, GDPR data erasure. |
|
|
73
|
+
| **DevOps & CI/CD** | [docs/rules/devops_ci_cd.md](./docs/rules/devops_ci_cd.md) | Shift-left trunk-based CI, OCI distroless containers, Secretlint/Trivy DevSecOps, zero-downtime CD. |
|
|
74
|
+
| **Cloud-Native 12-Factor** | [docs/rules/cloud_native.md](./docs/rules/cloud_native.md) | 12-Factor (2026 Edition), OpenTelemetry (OTel), stateless isolates. |
|
|
83
75
|
| **Error Architecture** | [docs/rules/error_handling.md](./docs/rules/error_handling.md) | Fail-fast schema validation, structured OTel/Pino tracing, RFC 7807 envelopes. |
|
|
84
|
-
| **Feature Flags** | [docs/rules/feature_flags.md](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches. |
|
|
85
|
-
| **Continuous Integration** | [docs/rules/continuous_integration.md](./docs/rules/continuous_integration.md) | Shift-left automated pipelines, trunk-based development, build caching. |
|
|
86
|
-
| **Continuous Deployment** | [docs/rules/continuous_deployment.md](./docs/rules/continuous_deployment.md) | Zero-downtime rollouts, Cosign container signing, container minimization. |
|
|
87
|
-
| **Container Infrastructure** | [docs/rules/container_infrastructure.md](./docs/rules/container_infrastructure.md) | Unified gateway, minimal OCI distroless/scratch containers, non-root user security. |
|
|
76
|
+
| **Feature Flags** | [docs/rules/feature_flags.md](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches & YAGNI gate. |
|
|
88
77
|
| **Transactional Email** | [docs/rules/transactional_email.md](./docs/rules/transactional_email.md) | Declarative templates (MJML/JSON), safe interpolation, SMTP integration testing. |
|
|
89
|
-
| **
|
|
90
|
-
| **
|
|
91
|
-
| **UI/UX Architecture** | [docs/rules/ui_ux_architecture.md](./docs/rules/ui_ux_architecture.md) | Design triage, persistent app shell, collapsible sidebar, dual-experience portals. |
|
|
92
|
-
| **React & Frontend** | [docs/rules/react.md](./docs/rules/react.md) | Modern React, shadcn/ui, TanStack Query, React Hook Form, and Zod validation. |
|
|
78
|
+
| **UI/UX Architecture** | [docs/rules/ui_ux_architecture.md](./docs/rules/ui_ux_architecture.md) | Design triage gate, persistent app shell, collapsible sidebar, dual-experience portals, dev persona. |
|
|
79
|
+
| **Frontend Architecture** | [docs/rules/frontend_architecture.md](./docs/rules/frontend_architecture.md) | Accessible headless primitives, WCAG 2.2 AA, server cache sync, form validation, 5-tier state, URL navigation. |
|
|
93
80
|
| **Requirements Engineering** | [docs/rules/requirements_engineering.md](./docs/rules/requirements_engineering.md) | User stories vs requirements, 3 C's, INVEST vertical cake slicing, Gherkin. |
|
|
94
81
|
| **Product Ownership** | [docs/rules/product_ownership.md](./docs/rules/product_ownership.md) | Product Backlog Management, OKRs, Kano/MoSCoW/RICE, Product Value, empiricism. |
|
|
95
|
-
| **Domain-Driven Design** | [docs/rules/domain_driven_design.md](./docs/rules/domain_driven_design.md) | Ubiquitous Language, Bounded Contexts, Aggregates, Capability Mapping. |
|
|
96
|
-
| **Workflow State Machines** | [docs/rules/workflow_state_machines.md](./docs/rules/workflow_state_machines.md) | Configurable workflows, in-aggregate invariant FSMs, transition guards & audit logs. |
|
|
97
|
-
| **Cloud-Native 12-Factor** | [docs/rules/cloud_native.md](./docs/rules/cloud_native.md) | 12-Factor (2026 Edition), OpenTelemetry (OTel), stateless isolates. |
|
|
98
|
-
| **Agentic Config & Skills** | [docs/rules/agentic_configuration.md](./docs/rules/agentic_configuration.md) | Progressive disclosure architecture, skill inquiry branches, refinement loop. |
|
|
99
82
|
| **Project Management** | [docs/rules/project_management.md](./docs/rules/project_management.md) | Work-In-Progress limits (WIP = 1), SMART developer tasks, Definition of Done. |
|
|
83
|
+
| **Domain-Driven Design** | [docs/rules/domain_driven_design.md](./docs/rules/domain_driven_design.md) | Ubiquitous Language, Bounded Contexts, Aggregates, Capability Mapping. |
|
|
84
|
+
| **CQRS & Projections** | [docs/rules/cqrs.md](./docs/rules/cqrs.md) | Evolutionary CQRS spectrum, YAGNI defense, read projections, outbox CDC. |
|
|
85
|
+
| **Workflow State Machines** | [docs/rules/workflow_state_machines.md](./docs/rules/workflow_state_machines.md) | Configurable workflows, in-aggregate invariant FSMs, transition guards & audit logs & YAGNI gate. |
|
|
86
|
+
| **Agentic Governance** | [docs/rules/agentic_configuration.md](./docs/rules/agentic_configuration.md) | Progressive disclosure, ADR ledger, workspace sovereignty, continuous learning, YAGNI gate triad. |
|
|
100
87
|
| **Relentless Questioning** | [docs/rules/relentless_questioning.md](./docs/rules/relentless_questioning.md) | Dynamic context-aware interrogation loops, adaptive decision trees. |
|
|
101
|
-
| **Workspace Isolation** | [docs/rules/workspace_isolation.md](./docs/rules/workspace_isolation.md) | Strict workspace sovereignty, zero global contamination, local ground truth. |
|
|
102
|
-
| **Continuous Learning** | [docs/rules/continuous_learning.md](./docs/rules/continuous_learning.md) | Direct rule ingestion, root-cause analysis, dynamic invariant updates. |
|
|
103
88
|
---
|
|
104
89
|
|
|
105
90
|
## 4. Agent Configuration & Workspace Architecture
|
|
@@ -114,4 +99,4 @@ To prevent context bloat and keep prompt overhead minimal, detailed engineering
|
|
|
114
99
|
- [`relentless-questioner`](.agents/skills/relentless-questioner/SKILL.md): Dynamic context-aware interrogation loops before planning and coding.
|
|
115
100
|
- **Relentless Skill Architecture Inquiry:** Never author or update skills on assumptions. Interrogate all 7 inquiry branches (placement, trigger intent, domain truth, gotchas/anti-patterns, determinism, progressive bloat, verification loop) defined in [docs/rules/agentic_configuration.md](./docs/rules/agentic_configuration.md) before writing `SKILL.md`.
|
|
116
101
|
- **Workspace Memory & Knowledge Hub:** Consult [`memory.md`](./memory.md) for ADRs, and [`docs/knowledge/ubiquitous_language.md`](./docs/knowledge/ubiquitous_language.md) for domain glossaries.
|
|
117
|
-
- **Harness Parity & Symlinks:** `AGENTS.md`, `CLAUDE.md`,
|
|
102
|
+
- **Harness Parity & Symlinks:** `AGENTS.md`, `CLAUDE.md`, `agents.md`, `GEMINI.md`, `.cursorrules`, and `.windsurfrules` must remain identical via filesystem symbolic links to eliminate configuration divergence across different agent harnesses.
|
package/README.md
CHANGED
|
@@ -38,10 +38,13 @@
|
|
|
38
38
|
├── docs/
|
|
39
39
|
│ ├── knowledge/ # Institutional knowledge & domain contracts
|
|
40
40
|
│ │ └── ubiquitous_language.md # Living Ubiquitous Language glossary template
|
|
41
|
-
│ └── rules/ #
|
|
41
|
+
│ └── rules/ # 28 cohesive single-responsibility domain rules
|
|
42
42
|
├── AGENTS.md # Lean root agentic configuration (< 120 lines)
|
|
43
|
-
├── CLAUDE.md -> AGENTS.md # Filesystem symlink for harness parity
|
|
44
|
-
├── agents.md -> AGENTS.md # Filesystem symlink for harness parity
|
|
43
|
+
├── CLAUDE.md -> AGENTS.md # Filesystem symlink for harness parity (Claude Code)
|
|
44
|
+
├── agents.md -> AGENTS.md # Filesystem symlink for harness parity (Codex / Standard)
|
|
45
|
+
├── GEMINI.md -> AGENTS.md # Filesystem symlink for harness parity (Antigravity / Gemini)
|
|
46
|
+
├── .cursorrules -> AGENTS.md # Filesystem symlink for harness parity (Cursor)
|
|
47
|
+
├── .windsurfrules -> AGENTS.md # Filesystem symlink for harness parity (Windsurf)
|
|
45
48
|
├── memory.md # Master memory hub & Lightweight ADR ledger
|
|
46
49
|
└── README.md # Project documentation
|
|
47
50
|
```
|
|
@@ -50,54 +53,38 @@
|
|
|
50
53
|
|
|
51
54
|
## 📋 Progressive Disclosure Rules Catalog (`docs/rules/`)
|
|
52
55
|
|
|
53
|
-
The architecture enforces
|
|
56
|
+
The architecture enforces 28 cohesive, single-responsibility domain rules. Read on demand to prevent prompt context bloat:
|
|
54
57
|
|
|
55
58
|
| Domain | Rule Reference File | Key Focus & Invariants |
|
|
56
59
|
|---|---|---|
|
|
57
|
-
| **TDD
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **Type Safety** | [`typescript.md`](./docs/rules/typescript.md) | Compiler strictness, branded nominal types, type safety, static sound invariants. |
|
|
62
|
-
| **ADRs** | [`architecture_decision_records.md`](./docs/rules/architecture_decision_records.md) | Authoring Lightweight Architectural Decision Records in `memory.md`. |
|
|
60
|
+
| **TDD & Isolation** | [`test_driven_development.md`](./docs/rules/test_driven_development.md) | Outside-In TDD, Uncle Bob's 3 Laws, 100% coverage, test isolation & DB rollback. |
|
|
61
|
+
| **Clean Code** | [`clean_code.md`](./docs/rules/clean_code.md) | Naming, small functions, CQS, SLAP, DRY, DbC, zero side-effects. |
|
|
62
|
+
| **Design Patterns** | [`design_patterns.md`](./docs/rules/design_patterns.md) | Adapter, Factory, Strategy, Result `<T, E>`, and GoF pattern catalog. |
|
|
63
|
+
| **Type Safety** | [`type_safety.md`](./docs/rules/type_safety.md) | Compiler strictness, branded nominal types, type discriminators across polyglot languages. |
|
|
63
64
|
| **Authentication** | [`authentication.md`](./docs/rules/authentication.md) | In-memory access tokens, refresh token rotation (RTR), WebAuthn passkeys. |
|
|
64
65
|
| **Authorization** | [`authorization.md`](./docs/rules/authorization.md) | CASL, OPA Rego policy engines, OpenFGA ReBAC, server guards. |
|
|
65
|
-
| **Multi-Tenancy
|
|
66
|
-
| **
|
|
67
|
-
| **
|
|
68
|
-
| **
|
|
69
|
-
| **
|
|
70
|
-
| **
|
|
71
|
-
| **
|
|
72
|
-
| **
|
|
73
|
-
| **
|
|
74
|
-
| **Database Integrity** | [`database_integrity.md`](./docs/rules/database_integrity.md) | Foreign keys, domain CHECK constraints, interval EXCLUDE, soft-delete indexes. |
|
|
75
|
-
| **Database Operations** | [`database_operations.md`](./docs/rules/database_operations.md) | Continuous PITR, autovacuum/defrag tuning, connection pooling, role separation. |
|
|
76
|
-
| **Database Performance** | [`database_performance.md`](./docs/rules/database_performance.md) | Eliminating N+1 queries, DataLoader batching, composite tenant indexes. |
|
|
77
|
-
| **Caching** | [`caching.md`](./docs/rules/caching.md) | Cache Port semantics, Cache-Aside, jittered TTLs, XFetch stampede defense. |
|
|
78
|
-
| **Application Security** | [`application_security.md`](./docs/rules/application_security.md) | OWASP Top 10 defenses, cryptographic rigor, token bucket rate limiting. |
|
|
79
|
-
| **Regulatory Compliance** | [`compliance.md`](./docs/rules/compliance.md) | SOC 2 Type II controls, ISO/IEC 27001 ISMS, GDPR data erasure rights. |
|
|
80
|
-
| **DevSecOps** | [`devsecops.md`](./docs/rules/devsecops.md) | Secretlint pre-commit gating, CycloneDX SBOM generation, Trivy/Grype scanning. |
|
|
66
|
+
| **Multi-Tenancy** | [`multitenancy_architecture.md`](./docs/rules/multitenancy_architecture.md) | Tenant context, 4 isolation models, RLS, dynamic schemas, pluggable logic & YAGNI gates. |
|
|
67
|
+
| **API Architecture** | [`api_architecture.md`](./docs/rules/api_architecture.md) | HTTP status codes, sync vs async (202), `_actions`, idempotency keys, cursor pagination, OCC, versioning. |
|
|
68
|
+
| **Server-Driven UI** | [`server_driven_ui.md`](./docs/rules/server_driven_ui.md) | Backend-driven layout schemas, multi-renderer component registries, DTCG tokens & YAGNI gate. |
|
|
69
|
+
| **Database Design** | [`database_design.md`](./docs/rules/database_design.md) | Relational integrity, FKs, CHECK constraints, Canonical 6 audit fields, ACID transactions, Outbox CDC. |
|
|
70
|
+
| **Database Operations** | [`database_operations.md`](./docs/rules/database_operations.md) | Zero-downtime expand-contract migrations, N+1 elimination, DataLoader, indexing, pooling, PITR. |
|
|
71
|
+
| **Caching** | [`caching.md`](./docs/rules/caching.md) | Cache Port semantics, Cache-Aside, jittered TTLs, XFetch stampede defense & YAGNI gate. |
|
|
72
|
+
| **Security & Compliance** | [`security_compliance.md`](./docs/rules/security_compliance.md) | OWASP Top 10 defenses, rate limiting, crypto, SOC 2 Type II, ISO 27001, GDPR data erasure. |
|
|
73
|
+
| **DevOps & CI/CD** | [`devops_ci_cd.md`](./docs/rules/devops_ci_cd.md) | Shift-left trunk-based CI, OCI distroless containers, Secretlint/Trivy DevSecOps, zero-downtime CD. |
|
|
74
|
+
| **Cloud-Native 12-Factor** | [`cloud_native.md`](./docs/rules/cloud_native.md) | 12-Factor (2026 Edition), OpenTelemetry (OTel), stateless isolates. |
|
|
81
75
|
| **Error Architecture** | [`error_handling.md`](./docs/rules/error_handling.md) | Fail-fast schema validation, structured OTel/Pino tracing, RFC 7807 envelopes. |
|
|
82
|
-
| **Feature Flags** | [`feature_flags.md`](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches. |
|
|
83
|
-
| **Continuous Integration** | [`continuous_integration.md`](./docs/rules/continuous_integration.md) | Shift-left automated pipelines, trunk-based development, build caching. |
|
|
84
|
-
| **Continuous Deployment** | [`continuous_deployment.md`](./docs/rules/continuous_deployment.md) | Zero-downtime rollouts, Cosign container signing, container minimization. |
|
|
85
|
-
| **Container Infrastructure** | [`container_infrastructure.md`](./docs/rules/container_infrastructure.md) | Unified gateway, minimal OCI distroless/scratch containers, non-root user security. |
|
|
76
|
+
| **Feature Flags** | [`feature_flags.md`](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches & YAGNI gate. |
|
|
86
77
|
| **Transactional Email** | [`transactional_email.md`](./docs/rules/transactional_email.md) | Declarative templates (MJML/JSON), safe interpolation, SMTP integration testing. |
|
|
87
|
-
| **
|
|
88
|
-
| **
|
|
89
|
-
| **UI/UX Architecture** | [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md) | Design triage, persistent app shell, collapsible sidebar, dual-experience portals. |
|
|
90
|
-
| **React & Frontend** | [`react.md`](./docs/rules/react.md) | Modern React, shadcn/ui, TanStack Query, React Hook Form, and Zod validation. |
|
|
78
|
+
| **UI/UX Architecture** | [`ui_ux_architecture.md`](./docs/rules/ui_ux_architecture.md) | Design triage gate, persistent app shell, collapsible sidebar, dual-experience portals, dev persona. |
|
|
79
|
+
| **Frontend Architecture** | [`frontend_architecture.md`](./docs/rules/frontend_architecture.md) | Accessible headless primitives, WCAG 2.2 AA, server cache sync, form validation, 5-tier state, URL navigation. |
|
|
91
80
|
| **Requirements Engineering** | [`requirements_engineering.md`](./docs/rules/requirements_engineering.md) | User stories vs requirements, 3 C's, INVEST vertical cake slicing, Gherkin. |
|
|
92
81
|
| **Product Ownership** | [`product_ownership.md`](./docs/rules/product_ownership.md) | Product Backlog Management, OKRs, Kano/MoSCoW/RICE, Product Value, empiricism. |
|
|
93
|
-
| **Domain-Driven Design** | [`domain_driven_design.md`](./docs/rules/domain_driven_design.md) | Problem vs Solution Space, Ubiquitous Language, Aggregates, Capability Mapping. |
|
|
94
|
-
| **Workflow State Machines** | [`workflow_state_machines.md`](./docs/rules/workflow_state_machines.md) | Configurable workflows, in-aggregate invariant FSMs, transition guards & audit logs. |
|
|
95
|
-
| **Cloud-Native 12-Factor** | [`cloud_native.md`](./docs/rules/cloud_native.md) | 12-Factor (2026 Edition), OpenTelemetry (OTel), stateless isolates. |
|
|
96
|
-
| **Agentic Config & Skills** | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md) | Progressive disclosure architecture, skill inquiry branches, refinement loop. |
|
|
97
82
|
| **Project Management** | [`project_management.md`](./docs/rules/project_management.md) | Work-In-Progress limits (WIP = 1), SMART developer tasks, Definition of Done. |
|
|
83
|
+
| **Domain-Driven Design** | [`domain_driven_design.md`](./docs/rules/domain_driven_design.md) | Ubiquitous Language, Bounded Contexts, Aggregates, Capability Mapping. |
|
|
84
|
+
| **CQRS & Projections** | [`cqrs.md`](./docs/rules/cqrs.md) | Evolutionary CQRS spectrum, YAGNI defense, read projections, outbox CDC. |
|
|
85
|
+
| **Workflow State Machines** | [`workflow_state_machines.md`](./docs/rules/workflow_state_machines.md) | Configurable workflows, in-aggregate invariant FSMs, transition guards & audit logs & YAGNI gate. |
|
|
86
|
+
| **Agentic Governance** | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md) | Progressive disclosure, ADR ledger, workspace sovereignty, continuous learning, YAGNI gate triad. |
|
|
98
87
|
| **Relentless Questioning** | [`relentless_questioning.md`](./docs/rules/relentless_questioning.md) | Dynamic context-aware interrogation loops, adaptive decision trees. |
|
|
99
|
-
| **Workspace Isolation** | [`workspace_isolation.md`](./docs/rules/workspace_isolation.md) | Strict workspace sovereignty, zero global contamination, local ground truth. |
|
|
100
|
-
| **Continuous Learning** | [`continuous_learning.md`](./docs/rules/continuous_learning.md) | Direct 4-step rule ingestion, root-cause analysis, dynamic invariant updates. |
|
|
101
88
|
|
|
102
89
|
---
|
|
103
90
|
|
package/bin/azcodr.js
CHANGED
|
@@ -181,7 +181,7 @@ async function runCli(rawArgs = process.argv.slice(2), io = {}) {
|
|
|
181
181
|
out(' ✅ Workspace knowledge hub and ADR ledger copied (docs/knowledge/, memory.md)');
|
|
182
182
|
out(' ✅ Specialized agentic skills copied (.agents/skills/)');
|
|
183
183
|
out(' ✅ Editor formatting standards initialized (.editorconfig)');
|
|
184
|
-
out(' ✅ Agent directives and harness symlinks established (AGENTS.md, CLAUDE.md, agents.md)');
|
|
184
|
+
out(' ✅ Agent directives and harness symlinks established (AGENTS.md, CLAUDE.md, agents.md, GEMINI.md, .cursorrules, .windsurfrules)');
|
|
185
185
|
if (result.gitInitialized) {
|
|
186
186
|
out(' ✅ Git repository initialized');
|
|
187
187
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Agentic Configuration,
|
|
1
|
+
# Agentic Configuration, Governance & Harness Standards
|
|
2
2
|
|
|
3
|
-
> **Core Mandate:**
|
|
3
|
+
> **Core Mandate:** Enforce progressive disclosure across agent entrypoints, strict skill front matter standards, workspace sovereignty, continuous learning via the direct rule ingestion loop, and immutable Architectural Decision Records (ADRs).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -37,14 +37,26 @@ Different AI agents and IDE harnesses look for different configuration filenames
|
|
|
37
37
|
- Standard: `AGENTS.md`
|
|
38
38
|
- Lowercase: `agents.md`
|
|
39
39
|
- Anthropic Claude Code: `CLAUDE.md`
|
|
40
|
+
- Google Antigravity & Gemini CLI: `GEMINI.md`
|
|
41
|
+
- Cursor: `.cursorrules`
|
|
42
|
+
- Windsurf: `.windsurfrules`
|
|
40
43
|
|
|
41
44
|
**Standard:** Maintain identical configuration across all harnesses by establishing filesystem symbolic links:
|
|
42
45
|
```bash
|
|
43
46
|
ln -sf AGENTS.md agents.md
|
|
44
47
|
ln -sf AGENTS.md CLAUDE.md
|
|
48
|
+
ln -sf AGENTS.md GEMINI.md
|
|
49
|
+
ln -sf AGENTS.md .cursorrules
|
|
50
|
+
ln -sf AGENTS.md .windsurfrules
|
|
45
51
|
```
|
|
46
52
|
Never duplicate content into separate files.
|
|
47
53
|
|
|
54
|
+
### Context Budget & Token Economy Directives
|
|
55
|
+
To prevent LLM context exhaustion, attention dilution, and model degradation:
|
|
56
|
+
- **Per-File Rule Size Cap (24 KB / 24,000 bytes):** Every rule file in `docs/rules/` must strictly stay under 24,000 bytes. Files exceeding this ceiling risk truncation across agent runtimes.
|
|
57
|
+
- **Aggregate Rules Token Budget (20,000 tokens):** Continuous and directory-scoped rules share an aggregate budget. Over-budget rules are demoted to file-pointer references. Always use concise, actionable directives rather than prose tutorials.
|
|
58
|
+
- **Progressive Offloading:** Offload deep specifications, schemas, or large lookup matrices to dedicated reference files loaded on demand.
|
|
59
|
+
|
|
48
60
|
---
|
|
49
61
|
|
|
50
62
|
## 4. Skills Architecture (`.agents/skills/<skill-name>/`)
|
|
@@ -71,9 +83,34 @@ description: <Imperative trigger description under 1024 characters. MUST start w
|
|
|
71
83
|
- Include structured response templates and self-validation checklists for deterministic output.
|
|
72
84
|
|
|
73
85
|
### Progressive Disclosure Subdirectories
|
|
74
|
-
|
|
86
|
+
Adhere strictly to the standard agent skills folder taxonomy:
|
|
75
87
|
- `scripts/`: Deterministic executable scripts (bash, node, python) for tasks where LLMs produce non-deterministic drift.
|
|
76
|
-
- `
|
|
88
|
+
- `references/`: Detailed sub-domain markdown manuals loaded on demand by the skill.
|
|
89
|
+
- `resources/`: Static templates, lookup tables, JSON schemas, or mock artifacts.
|
|
90
|
+
- `examples/`: Reference implementations and concrete code patterns.
|
|
91
|
+
|
|
92
|
+
### Deterministic Lifecycle Hooks (`.agents/hooks.json`)
|
|
93
|
+
To enforce non-negotiable safety guardrails and automated verification without stochastic agent failure:
|
|
94
|
+
- **`PreToolUse`**: Intercept destructive or dangerous CLI commands (`rm -rf`, DROP DATABASE, git push --force) and force explicit confirmation (`decision: ask`).
|
|
95
|
+
- **`PostToolUse`**: Automatically trigger fast linters (`npm run lint`), formatters, or unit test verification after tool runs.
|
|
96
|
+
- **`Stop`**: Intercept premature agent termination when background tasks are running or tests remain failing (`decision: continue`).
|
|
97
|
+
|
|
98
|
+
### Model Context Protocol (MCP) Integration (`.agents/mcp_config.json`)
|
|
99
|
+
When external tool capabilities are required (database introspectors, cloud telemetry, documentation search):
|
|
100
|
+
- Standardize on vendor-neutral **Model Context Protocol (MCP)** specifications.
|
|
101
|
+
- Declare local or containerized MCP tool servers in `.agents/mcp_config.json`.
|
|
102
|
+
- Treat MCP tools as secondary adapter driving ports, keeping domain logic decoupled from proprietary platform APIs.
|
|
103
|
+
|
|
104
|
+
### Explicit Prohibition: The "Library-as-a-Skill" Anti-Pattern
|
|
105
|
+
Never author or dynamically generate skills for commodity open-source packages or libraries (e.g. `react`, `tanstack`, `shadcn`, `zustand`, `testing-library`, `vitest`):
|
|
106
|
+
- **Prompt Bloat & Re-Explanation Tax:** Skill descriptions are continuously loaded into the agent's `<skills>` context. Proliferating skills for every library in a stack floods the prompt with thousands of redundant tokens and degrades model reasoning.
|
|
107
|
+
- **Parametric Redundancy:** Frontier LLMs already possess extensive parametric knowledge of open-source library APIs. Re-explaining basic imports and function signatures in a skill wastes context and creates documentation rot.
|
|
108
|
+
- **Trigger Collision & Agent Paralysis:** When a prompt touches UI, form validation, and data fetching, having 5 library skills triggers semantic collision, causing the agent to waste execution turns resolving which sub-skill to run.
|
|
109
|
+
- **The 4-Layer Resolution Standard:** Always resolve library stack knowledge through the **4-Layer Resolution Model**:
|
|
110
|
+
1. *Layer 1 (Manifest Ground Truth):* Read `package.json`, `components.json`, or `tsconfig.json`.
|
|
111
|
+
2. *Layer 2 (Stack Contract in `AGENTS.md`):* 3–5 line declaration in project entrypoint stamped by `/lets-build`.
|
|
112
|
+
3. *Layer 3 (Universal Domain Rules):* Enforce architectural invariants (`frontend_architecture.md`, `test_driven_development.md`) rather than library syntax.
|
|
113
|
+
4. *Layer 4 (Tool & CLI Execution):* Direct execution of official CLIs (`npx shadcn@latest add ...`) or local component inspection.
|
|
77
114
|
|
|
78
115
|
---
|
|
79
116
|
|
|
@@ -111,38 +148,40 @@ Coding tasks and agentic skills exhibit an explicit **Many-to-Many ($M:N$) Relat
|
|
|
111
148
|
- **Zero Cross-Contamination:** No skill may write code or modify files outside its declared functional boundary.
|
|
112
149
|
- **Pure Function Semantics:** Analysis skills must remain read-only and side-effect free.
|
|
113
150
|
|
|
151
|
+
## 6. The Mandatory YAGNI Gate Triad (Rules & Skills)
|
|
152
|
+
|
|
153
|
+
LLM coding agents have a natural statistical bias toward **Instruction Creep** and **Eager Pattern Application**: when provided with a rule explaining an advanced pattern, agents reflexively apply it everywhere, causing severe architectural bloat.
|
|
154
|
+
|
|
155
|
+
To prevent premature abstraction, every architectural pattern rule and skill must enforce the **YAGNI Gate Triad**:
|
|
156
|
+
|
|
157
|
+
1. **The Simple Baseline (Day 1 Default):**
|
|
158
|
+
- The zero-overhead, default implementation that solves the immediate requirement without indirection (e.g. single database model before CQRS, relational indexes before Redis, standard React components before Server-Driven UI).
|
|
159
|
+
2. **The Anti-Triggers (Strictly Forbidden Scenarios):**
|
|
160
|
+
- Explicit, negative conditions where applying the pattern or skill is forbidden as premature over-engineering (e.g. no caching for low-throughput queries, no state machines for 2-state boolean flags, no skills for routine typo fixes).
|
|
161
|
+
3. **The Empirical Tipping Point (Graduation Threshold):**
|
|
162
|
+
- Measurable, verified criteria that MUST be breached before graduating to the pattern (e.g. p99 latency > 200ms after indexing, 3+ non-linear lifecycle states with transition guards, untrusted third-party user scripts).
|
|
163
|
+
|
|
164
|
+
### Foundational Leverage vs. Speculative Over-Engineering
|
|
165
|
+
A common misunderstanding is that YAGNI forbids using external libraries. **This is completely false**:
|
|
166
|
+
- **YAGNI Attacks:** Speculative custom code, home-grown frameworks, custom wheel reinvention, and premature multi-tier distributed architectures.
|
|
167
|
+
- **YAGNI Mandates:** Adopting battle-tested, open-source building blocks (`shadcn/ui`, `Tailwind CSS`, `Zod`, `TanStack Query`, `Lombok`) to solve concrete, present requirements with the minimum amount of custom code (preventing Not-Invented-Here / NIH syndrome).
|
|
168
|
+
|
|
114
169
|
---
|
|
115
170
|
|
|
116
|
-
##
|
|
171
|
+
## 7. The Relentless Skill Architecture Inquiry
|
|
117
172
|
|
|
118
173
|
Never architect or modify a skill based on assumptions. Before authoring any `SKILL.md`, run the **7 Core Skill Inquiry Branches**:
|
|
119
174
|
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
[Branch
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
[Branch
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
[Branch 3: Domain Ground Truth] ─ Have generic textbook tutorials been purged?
|
|
131
|
-
│
|
|
132
|
-
▼
|
|
133
|
-
[Branch 4: Gotchas & Anti-Patterns] What specific AI mistakes MUST be forbidden?
|
|
134
|
-
│
|
|
135
|
-
▼
|
|
136
|
-
[Branch 5: Determinism vs LLM] ── Should deterministic steps be scripts in scripts/?
|
|
137
|
-
│
|
|
138
|
-
▼
|
|
139
|
-
[Branch 6: Progressive Bloat] ─── Is SKILL.md < 500 lines with sub-docs in references/?
|
|
140
|
-
│
|
|
141
|
-
▼
|
|
142
|
-
[Branch 7: Verification Loop] ─── Are there output templates and self-checklists?
|
|
143
|
-
│
|
|
144
|
-
▼
|
|
145
|
-
[Ready to Author / Update Skill]
|
|
175
|
+
```mermaid
|
|
176
|
+
flowchart TD
|
|
177
|
+
Req["New Skill / Rule Request"] --> B1["Branch 1: Placement<br/>AGENTS.md, Rule, or Skill?"]
|
|
178
|
+
B1 --> B2["Branch 2: Trigger Boundaries<br/>Exact 'Use when...' & 'Do NOT use for...'?"]
|
|
179
|
+
B2 --> B3["Branch 3: Domain Ground Truth<br/>Generic textbook tutorials purged?"]
|
|
180
|
+
B3 --> B4["Branch 4: Gotchas & Anti-Patterns<br/>What AI mistakes MUST be forbidden?"]
|
|
181
|
+
B4 --> B5["Branch 5: Determinism vs LLM<br/>Deterministic steps scripted in scripts/?"]
|
|
182
|
+
B5 --> B6["Branch 6: Progressive Bloat<br/>SKILL.md < 500 lines with sub-docs in references/?"]
|
|
183
|
+
B6 --> B7["Branch 7: Verification Loop<br/>Output templates & self-checklists present?"]
|
|
184
|
+
B7 --> Ready["Ready to Author / Update Skill"]
|
|
146
185
|
```
|
|
147
186
|
|
|
148
187
|
### The 7 Core Inquiry Branches
|
|
@@ -159,10 +198,59 @@ Never architect or modify a skill based on assumptions. Before authoring any `SK
|
|
|
159
198
|
|
|
160
199
|
---
|
|
161
200
|
|
|
162
|
-
##
|
|
201
|
+
## 8. The Continuous Refinement Loop
|
|
163
202
|
|
|
164
203
|
When an AI produces suboptimal code or documentation:
|
|
165
204
|
1. Preserve the original AI output draft.
|
|
166
205
|
2. Make manual corrections to produce the desired gold-standard output.
|
|
167
206
|
3. Diff the original draft against the corrected version to identify specific gaps.
|
|
168
207
|
4. Update the relevant skill's "What NOT to do" or guideline section to prevent repeating that mistake.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 9. Workspace Sovereignty & Zero Global Interference
|
|
212
|
+
|
|
213
|
+
Enforce strict workspace containment within the workspace root (`./`):
|
|
214
|
+
- **Ground Truth Boundary**: Only files, dependencies, configuration files (`package.json`, `tsconfig.json`, `docker-compose.yml`), and verified command executions within the local workspace (`./`) constitute project truth.
|
|
215
|
+
- **Zero Global Contamination**: Never import, execute, or assume tools, environment variables, or conventions from global system directories (e.g. `~/.config`, `/tmp`, `~/.gemini/antigravity-cli`, or parent directories) unless explicitly defined within local workspace configuration.
|
|
216
|
+
- **Sibling Project Isolation**: Strictly ignore external or legacy projects. Do not read from or write to directories outside the local repository (`./`).
|
|
217
|
+
- **Subagent Context Sandboxing**: When spawning subagents or executing commands, ensure working directories are anchored strictly to `./`.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 10. Continuous Learning & The Direct Rule Ingestion Loop
|
|
222
|
+
|
|
223
|
+
Whenever an error, test failure, build friction, or architectural anti-pattern occurs during development, immediately execute the 4-step loop:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
1. Capture Defect ──► 2. Root Cause Analysis ──► 3. Synthesize Invariant ──► 4. Update Rule / Skill
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
1. **Capture Defect**: Record the failure symptoms, stack trace, and failing test case.
|
|
230
|
+
2. **Root Cause Analysis**: Identify the fundamental architectural or operational gap (not just the surface symptom).
|
|
231
|
+
3. **Synthesize Invariant**: Formulate a concrete, positive architectural invariant and code example showing the correct implementation.
|
|
232
|
+
4. **Update Rule / Skill**:
|
|
233
|
+
- Update the governing domain rule in `docs/rules/<domain>.md` or specialized skill in `.agents/skills/` directly.
|
|
234
|
+
- If the lesson introduces an architectural trade-off or paradigm shift, record a lightweight ADR in [`memory.md`](../../memory.md).
|
|
235
|
+
- Run verification (`npm test && npm run validate`) to ensure 100% integrity.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 11. Architectural Decision Records (ADR) Standards
|
|
240
|
+
|
|
241
|
+
Significant architectural, technical stack, or invariant decisions must be captured in [`memory.md`](../../memory.md):
|
|
242
|
+
|
|
243
|
+
### Required ADR Envelope:
|
|
244
|
+
```markdown
|
|
245
|
+
#### ADR-XXX: <Imperative Action-Oriented Title>
|
|
246
|
+
- **Date:** YYYY-MM-DD | **Status:** PROPOSED | ACCEPTED | SUPERSEDED | DEPRECATED
|
|
247
|
+
- **Context:** The specific operational or technical problem, constraint, or trade-off requiring a decision.
|
|
248
|
+
- **Decision:** Concrete, unambiguous architecture choice and positive invariants.
|
|
249
|
+
- **Consequences:** Direct benefits and deliberate operational trade-offs accepted.
|
|
250
|
+
- **Enforced In:** Links to specific rule files in `docs/rules/` or code paths.
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Numbering & Immutability:
|
|
254
|
+
- ADR numbers are monotonically increasing (`ADR-001`, `ADR-002`, ...).
|
|
255
|
+
- ADR entries are **immutable history**. Never edit past accepted ADRs to represent new decisions; author a new ADR that explicitly supersedes the former.
|
|
256
|
+
|