azcodr 1.5.1 → 2.0.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 (91) hide show
  1. package/.agents/hooks.json.example +42 -42
  2. package/.agents/scripts/safety_guard.sh +143 -34
  3. package/.agents/scripts/verify_completion.sh +90 -27
  4. package/.agents/skills/agentic-architect/SKILL.md +125 -125
  5. package/.agents/skills/agentic-architect/references/agents_md_template.md +62 -62
  6. package/.agents/skills/agentic-architect/references/refinement_workflow.md +32 -32
  7. package/.agents/skills/agentic-architect/references/skill_architecture_inquiry.md +63 -63
  8. package/.agents/skills/agentic-architect/references/skill_template.md +56 -56
  9. package/.agents/skills/agentic-architect/scripts/validate_agentic_configs.sh +402 -401
  10. package/.agents/skills/clean-code-refactor/SKILL.md +91 -91
  11. package/.agents/skills/clean-code-refactor/references/clean_code_smells.md +27 -27
  12. package/.agents/skills/clean-code-refactor/references/design_patterns_ts.md +65 -65
  13. package/.agents/skills/compliance-audit/SKILL.md +120 -120
  14. package/.agents/skills/compliance-audit/references/owasp_top10_controls.md +16 -16
  15. package/.agents/skills/compliance-audit/references/soc2_iso_controls.md +28 -28
  16. package/.agents/skills/lets-build/SKILL.md +173 -173
  17. package/.agents/skills/lets-build/references/architecture_interview_matrix.md +115 -115
  18. package/.agents/skills/lets-build/references/hexagonal_bootstrap_scaffolds.md +160 -160
  19. package/.agents/skills/lets-build/references/project_readme_template.md +79 -79
  20. package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +419 -255
  21. package/.agents/skills/product-analyst/SKILL.md +154 -154
  22. package/.agents/skills/product-analyst/references/backlog_ordering_techniques.md +107 -107
  23. package/.agents/skills/product-analyst/references/gherkin_patterns.md +46 -46
  24. package/.agents/skills/product-analyst/references/invest_checklist.md +38 -38
  25. package/.agents/skills/product-analyst/references/okr_alignment_guide.md +76 -76
  26. package/.agents/skills/product-analyst/references/smart_tasks.md +59 -59
  27. package/.agents/skills/relentless-questioner/SKILL.md +128 -128
  28. package/.agents/skills/relentless-questioner/references/adaptive_question_trees.md +102 -102
  29. package/.editorconfig +19 -19
  30. package/.github/workflows/ci.yml +167 -56
  31. package/.github/workflows/publish.yml +200 -0
  32. package/.gitignore +40 -25
  33. package/AGENTS.md +103 -102
  34. package/LICENSE +21 -21
  35. package/README.md +168 -154
  36. package/bin/azcodr.js +14 -228
  37. package/docs/knowledge/ubiquitous_language.md +31 -18
  38. package/docs/rules/agentic_configuration.md +259 -259
  39. package/docs/rules/api_architecture.md +179 -179
  40. package/docs/rules/authentication.md +76 -76
  41. package/docs/rules/authorization.md +75 -75
  42. package/docs/rules/caching.md +69 -69
  43. package/docs/rules/clean_code.md +62 -62
  44. package/docs/rules/cloud_native.md +41 -41
  45. package/docs/rules/cqrs.md +203 -203
  46. package/docs/rules/database_design.md +125 -125
  47. package/docs/rules/database_operations.md +69 -69
  48. package/docs/rules/design_patterns.md +98 -98
  49. package/docs/rules/devops_ci_cd.md +76 -76
  50. package/docs/rules/domain_driven_design.md +122 -122
  51. package/docs/rules/error_handling.md +54 -52
  52. package/docs/rules/feature_flags.md +59 -59
  53. package/docs/rules/frontend_architecture.md +157 -157
  54. package/docs/rules/multitenancy_architecture.md +98 -98
  55. package/docs/rules/product_ownership.md +127 -127
  56. package/docs/rules/project_management.md +49 -49
  57. package/docs/rules/relentless_questioning.md +52 -52
  58. package/docs/rules/requirements_engineering.md +98 -98
  59. package/docs/rules/security_compliance.md +53 -53
  60. package/docs/rules/server_driven_ui.md +88 -88
  61. package/docs/rules/test_driven_development.md +185 -185
  62. package/docs/rules/transactional_email.md +27 -27
  63. package/docs/rules/type_safety.md +65 -65
  64. package/docs/rules/ui_ux_architecture.md +150 -150
  65. package/docs/rules/workflow_state_machines.md +117 -117
  66. package/lib/cli-parse.js +51 -0
  67. package/lib/cli-target.js +109 -0
  68. package/lib/cli.js +180 -0
  69. package/lib/errors.js +28 -0
  70. package/lib/git.js +29 -0
  71. package/lib/guards.js +96 -0
  72. package/lib/index.d.ts +199 -134
  73. package/lib/index.js +5 -5
  74. package/lib/links.js +123 -0
  75. package/lib/permissions.js +44 -0
  76. package/lib/repo.js +90 -0
  77. package/lib/scaffold.js +238 -399
  78. package/memory.md +119 -36
  79. package/package.json +65 -62
  80. package/scripts/test_coverage.js +66 -38
  81. package/scripts/validate/adr.js +151 -0
  82. package/scripts/validate/io.js +84 -0
  83. package/scripts/validate/links.js +167 -0
  84. package/scripts/validate/parity.js +124 -0
  85. package/scripts/validate/root.js +184 -0
  86. package/scripts/validate/rules.js +44 -0
  87. package/scripts/validate/skills.js +96 -0
  88. package/scripts/validate/text.js +29 -0
  89. package/scripts/validate-cli.js +13 -0
  90. package/scripts/validate.js +112 -218
  91. package/.github/copilot-instructions.md +0 -1
package/.gitignore CHANGED
@@ -1,25 +1,40 @@
1
- # Node dependencies
2
- node_modules/
3
- npm-debug.log*
4
- yarn-debug.log*
5
- yarn-error.log*
6
- *.log
7
- *.log.*
8
-
9
- # Test coverage
10
- coverage/
11
-
12
- # Pack tarballs
13
- *.tgz
14
-
15
- # OS files
16
- .DS_Store
17
- Thumbs.db
18
-
19
- # Local environment
20
- .env
21
- .env.local
22
- .env.*.local
23
-
24
- # Case-insensitive filesystem parity (agents.md is generated/symlinked on Linux, native on macOS/Windows)
25
- agents.md
1
+ # Node dependencies
2
+ node_modules/
3
+ npm-debug.log*
4
+ yarn-debug.log*
5
+ yarn-error.log*
6
+ *.log
7
+ *.log.*
8
+
9
+ # Test coverage
10
+ coverage/
11
+
12
+ # Pack tarballs
13
+ *.tgz
14
+
15
+ # OS files
16
+ .DS_Store
17
+ Thumbs.db
18
+
19
+ # Local environment
20
+ .env
21
+ .env.local
22
+ .env.*.local
23
+ # npm auto-excludes .npmrc when packing, but git does not: a local
24
+ # .npmrc holding _authToken is committable and would leak a registry credential.
25
+ .npmrc
26
+ .envrc
27
+
28
+ # Local databases (data/ ships in the tarball as a placeholder)
29
+ *.db
30
+ *.db-journal
31
+ *.sqlite
32
+ *.sqlite3
33
+
34
+ # Agent scratch space
35
+ .tmp/
36
+ .tmp-scratch/
37
+ opencode.json
38
+
39
+ # Case-insensitive filesystem parity (agents.md is generated/symlinked on Linux, native on macOS/Windows)
40
+ agents.md
package/AGENTS.md CHANGED
@@ -1,102 +1,103 @@
1
- # AGENTS.md
2
-
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`.
6
- > **Rule Zero:** Assume nothing. Every action must be grounded in verified evidence from this workspace or direct instructions from the user.
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).
9
-
10
- ---
11
-
12
- ## 1. Zero-Assumption Operating Framework
13
- ### Core Principles
14
- 1. **No External Assumptions:** You have no prior knowledge of external setups, hidden tools, libraries, or unverified conventions outside this workspace.
15
- 2. **Ground Truth Only:** A statement is only true if proven by a workspace file, verified command output, or direct user instruction.
16
- 3. **Unknown Until Verified:** If something is not explicitly written in the workspace or stated by the user, treat it as unknown.
17
- 4. **Strict Open Standards:** Standardize on open-source solutions and open specs (Semgrep, Trivy, Gitleaks, OpenTelemetry, OPA, OCI, Wasm, CloudEvents).
18
- 5. **Problem-First & Topology Alignment:** Problem domain and operational constraints (latency budget, GC tolerance, memory, execution environment) strictly dictate the architectural style and toolchain. Never select tools before defining the problem space.
19
- 6. **Evolutionary Architecture & Refactor-Before-Add:** As complexity grows, code must graduate across explicit architectural tipping points. Refactor structure first under existing green tests before implementing new features. Never append code into rotting files.
20
- 7. **True Incremental TDD & Nano-Cycles:** Never dump test suites in batches ("Test-First Waterfall"). Follow Uncle Bob's Three Laws: write one micro-assertion at a time, verify RED failure output, write minimal code to turn GREEN, and refactor under green.
21
- 8. **Systemic Atomicity:** Every skill, rule, database transaction, and refactoring step must be atomic (Single Responsibility, zero side-effects, full rollback).
22
- 9. **Workspace Sovereignty:** Total containment within the local workspace root (`./`). Zero interference from global configs, tools, or sibling projects.
23
- 10. **Continuous Learning:** Ingest all verified defects, lessons, and architectural invariants directly into domain rules and `memory.md`.
24
-
25
- ### The 5 Core Branch Questions
26
- Before acting on any decision branch, answer:
27
- 1. **Current State:** What do workspace files currently show? (Inspect before assuming).
28
- 2. **Target Goal:** Is the goal clear, bounded, and explicit? (Stop & ask if ambiguous).
29
- 3. **Tools & Setup:** Are tools defined in workspace configs? (Never assume commands exist).
30
- 4. **Impact & Risk:** Have all references, callers, and side effects been traced?
31
- 5. **Verification:** How will we prove it works with tests or build commands?
32
-
33
- ### Conflict Resolution & Order of Authority
34
- 1. **User Request (Current Session)** ➔ 2. **Workspace Configurations** (lockfiles, linters, scripts) ➔ 3. **Existing Code Patterns** ➔ 4. **Direct Confirmation (Stop & Ask)**.
35
-
36
- ### Action Boundaries
37
- - **ALWAYS:** Read files before editing; verify commands before running; verify results with evidence.
38
- - **ASK FIRST:** Adding/removing external dependencies; deleting/renaming files; changing DB schemas or build scripts; modifying existing tests.
39
- - **NEVER:** Guess paths, flags, or signatures; silently ignore errors; bypass unresolved questions.
40
- ---
41
-
42
- ## 2. Execution Lifecycle
43
-
44
- Progress all tasks systematically through the unified **Agent Cognitive & Agile Domain Lifecycle**, seamlessly interlocking the 5 agent operational disciplines with the 5-phase domain engineering pipeline:
45
- ```
46
- 1. DISCOVER / REQUIREMENTS ──► Read-only inspection; Problem Space & operational constraints; INVEST stories & Gherkin.
47
- 2. INTERROGATE / DOMAIN ──► Relentless questioning; Ubiquitous Language, Aggregate invariants & state machines.
48
- 3. PLAN / OUTER TDD ──► Minimal blast radius; failing Outer Acceptance Test (UI/API RED).
49
- 4. EXECUTE / INNER TDD ──► Incremental nano-cycles (Uncle Bob's 3 Laws: 1 micro-assertion RED ➔ MINIMAL pass GREEN ➔ REFACTOR).
50
- 5. VERIFY / DoD & PROOF ──► Outer test turns GREEN; boundary smoke tests & 100.00% test coverage.
51
- ```
52
- ---
53
-
54
- ## 3. Progressive Disclosure: Specialized Domain Rules
55
-
56
- To prevent context bloat and keep prompt overhead minimal, detailed engineering and architectural standards are decoupled into dedicated reference files. **Read these files on demand when working in the relevant domain:**
57
-
58
- | Domain | Rule Reference File | When to Consult |
59
- |---|---|---|
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
- | **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 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. |
64
- | **Authentication** | [docs/rules/authentication.md](./docs/rules/authentication.md) | In-memory access tokens, refresh token rotation (RTR), WebAuthn passkeys. |
65
- | **Authorization** | [docs/rules/authorization.md](./docs/rules/authorization.md) | CASL, OPA Rego policy engines, OpenFGA ReBAC, server guards. |
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. |
75
- | **Error Architecture** | [docs/rules/error_handling.md](./docs/rules/error_handling.md) | Fail-fast schema validation, structured OTel/Pino tracing, RFC 7807 envelopes. |
76
- | **Feature Flags** | [docs/rules/feature_flags.md](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches & YAGNI gate. |
77
- | **Transactional Email** | [docs/rules/transactional_email.md](./docs/rules/transactional_email.md) | Declarative templates (MJML/JSON), safe interpolation, SMTP integration testing. |
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. |
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. |
81
- | **Product Ownership** | [docs/rules/product_ownership.md](./docs/rules/product_ownership.md) | Product Backlog Management, OKRs, Kano/MoSCoW/RICE, Product Value, empiricism. |
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. |
87
- | **Relentless Questioning** | [docs/rules/relentless_questioning.md](./docs/rules/relentless_questioning.md) | Dynamic context-aware interrogation loops, adaptive decision trees. |
88
- ---
89
-
90
- ## 4. Agent Configuration & Workspace Architecture
91
- - **Progressive Disclosure Principle:** Never load all documentation upfront. Rely on the table above to pull specialized instructions only when performing relevant tasks.
92
- - **Nested AGENTS.md for Monorepos:** In multi-package workspaces (e.g. `apps/backend`, `apps/frontend`), place package-specific conventions in nested `AGENTS.md` files scoped strictly to those subtrees.
93
- - **Specialized Skills Catalog:** On-demand multi-step workflows are encapsulated under `.agents/skills/`:
94
- - [`agentic-architect`](.agents/skills/agentic-architect/SKILL.md): Authoring, auditing, and modularizing agent configurations and skills.
95
- - [`product-analyst`](.agents/skills/product-analyst/SKILL.md): Aligning OKRs, backlog ordering (Kano/MoSCoW/RICE), INVEST stories, and Gherkin criteria.
96
- - [`compliance-audit`](.agents/skills/compliance-audit/SKILL.md): Conducting SOC 2, ISO 27001, and OWASP audits using open-source scanners.
97
- - [`clean-code-refactor`](.agents/skills/clean-code-refactor/SKILL.md): Refactoring code smells with Clean Code, SOLID, and design patterns.
98
- - [`lets-build`](.agents/skills/lets-build/SKILL.md): Conducting architecture interviews to finalize stack, frameworks, package managers, and bootstrapping projects.
99
- - [`relentless-questioner`](.agents/skills/relentless-questioner/SKILL.md): Dynamic context-aware interrogation loops before planning and coding.
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`.
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.
102
- - **Harness Parity & Symlinks:** `AGENTS.md`, `CLAUDE.md`, `agents.md`, `GEMINI.md`, `.cursorrules`, `.windsurfrules`, and `.github/copilot-instructions.md` must remain identical via filesystem symbolic links to eliminate configuration divergence across different agent harnesses.
1
+ # AGENTS.md
2
+
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 (`>=22.8.0`), npm (`>=10.0.0`) | `npm test` (test runner), `npm run test:coverage` (coverage gate), `npm run lint`, `npm run validate`.
6
+ > **Node floor rationale:** `>=22.8.0` is the first release with the native coverage-threshold flags `scripts/test_coverage.js` requires. Node 18 (EOL 2025-04-30) and 20 (EOL 2026-04-30) no longer receive security patches.
7
+ > **Rule Zero:** Assume nothing. Every action must be grounded in verified evidence from this workspace or direct instructions from the user.
8
+ > **Atomicity Mandate:** All rules, skills, code units, migrations, and transactions must be strictly atomic (indivisible, self-contained, composable with full ACID safety).
9
+ > **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).
10
+
11
+ ---
12
+
13
+ ## 1. Zero-Assumption Operating Framework
14
+ ### Core Principles
15
+ 1. **No External Assumptions:** You have no prior knowledge of external setups, hidden tools, libraries, or unverified conventions outside this workspace.
16
+ 2. **Ground Truth Only:** A statement is only true if proven by a workspace file, verified command output, or direct user instruction.
17
+ 3. **Unknown Until Verified:** If something is not explicitly written in the workspace or stated by the user, treat it as unknown.
18
+ 4. **Strict Open Standards:** Standardize on open-source solutions and open specs (Semgrep, Trivy, Gitleaks, OpenTelemetry, OPA, OCI, Wasm, CloudEvents).
19
+ 5. **Problem-First & Topology Alignment:** Problem domain and operational constraints (latency budget, GC tolerance, memory, execution environment) strictly dictate the architectural style and toolchain. Never select tools before defining the problem space.
20
+ 6. **Evolutionary Architecture & Refactor-Before-Add:** As complexity grows, code must graduate across explicit architectural tipping points. Refactor structure first under existing green tests before implementing new features. Never append code into rotting files.
21
+ 7. **True Incremental TDD & Nano-Cycles:** Never dump test suites in batches ("Test-First Waterfall"). Follow Uncle Bob's Three Laws: write one micro-assertion at a time, verify RED failure output, write minimal code to turn GREEN, and refactor under green.
22
+ 8. **Systemic Atomicity:** Every skill, rule, database transaction, and refactoring step must be atomic (Single Responsibility, zero side-effects, full rollback).
23
+ 9. **Workspace Sovereignty:** Total containment within the local workspace root (`./`). Zero interference from global configs, tools, or sibling projects.
24
+ 10. **Continuous Learning:** Ingest all verified defects, lessons, and architectural invariants directly into domain rules and `memory.md`.
25
+
26
+ ### The 5 Core Branch Questions
27
+ Before acting on any decision branch, answer:
28
+ 1. **Current State:** What do workspace files currently show? (Inspect before assuming).
29
+ 2. **Target Goal:** Is the goal clear, bounded, and explicit? (Stop & ask if ambiguous).
30
+ 3. **Tools & Setup:** Are tools defined in workspace configs? (Never assume commands exist).
31
+ 4. **Impact & Risk:** Have all references, callers, and side effects been traced?
32
+ 5. **Verification:** How will we prove it works with tests or build commands?
33
+
34
+ ### Conflict Resolution & Order of Authority
35
+ 1. **User Request (Current Session)** ➔ 2. **Workspace Configurations** (lockfiles, linters, scripts) ➔ 3. **Existing Code Patterns** ➔ 4. **Direct Confirmation (Stop & Ask)**.
36
+
37
+ ### Action Boundaries
38
+ - **ALWAYS:** Read files before editing; verify commands before running; verify results with evidence.
39
+ - **ASK FIRST:** Adding/removing external dependencies; deleting/renaming files; changing DB schemas or build scripts; modifying existing tests.
40
+ - **NEVER:** Guess paths, flags, or signatures; silently ignore errors; bypass unresolved questions.
41
+ ---
42
+
43
+ ## 2. Execution Lifecycle
44
+
45
+ Progress all tasks systematically through the unified **Agent Cognitive & Agile Domain Lifecycle**, seamlessly interlocking the 5 agent operational disciplines with the 5-phase domain engineering pipeline:
46
+ ```
47
+ 1. DISCOVER / REQUIREMENTS ──► Read-only inspection; Problem Space & operational constraints; INVEST stories & Gherkin.
48
+ 2. INTERROGATE / DOMAIN ──► Relentless questioning; Ubiquitous Language, Aggregate invariants & state machines.
49
+ 3. PLAN / OUTER TDD ──► Minimal blast radius; failing Outer Acceptance Test (UI/API RED).
50
+ 4. EXECUTE / INNER TDD ──► Incremental nano-cycles (Uncle Bob's 3 Laws: 1 micro-assertion RED ➔ MINIMAL pass GREEN ➔ REFACTOR).
51
+ 5. VERIFY / DoD & PROOF ──► Outer test turns GREEN; boundary smoke tests & 100.00% test coverage.
52
+ ```
53
+ ---
54
+
55
+ ## 3. Progressive Disclosure: Specialized Domain Rules
56
+
57
+ To prevent context bloat and keep prompt overhead minimal, detailed engineering and architectural standards are decoupled into dedicated reference files. **Read these files on demand when working in the relevant domain:**
58
+
59
+ | Domain | Rule Reference File | When to Consult |
60
+ |---|---|---|
61
+ | **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. |
62
+ | **Clean Code** | [docs/rules/clean_code.md](./docs/rules/clean_code.md) | Naming, small functions, CQS, SLAP, DRY, DbC, zero side-effects. |
63
+ | **Design Patterns** | [docs/rules/design_patterns.md](./docs/rules/design_patterns.md) | Adapter, Factory, Strategy, Result `<T, E>`, and GoF pattern catalog. |
64
+ | **Type Safety** | [docs/rules/type_safety.md](./docs/rules/type_safety.md) | Compiler strictness, branded nominal types, type discriminators across polyglot languages. |
65
+ | **Authentication** | [docs/rules/authentication.md](./docs/rules/authentication.md) | In-memory access tokens, refresh token rotation (RTR), WebAuthn passkeys. |
66
+ | **Authorization** | [docs/rules/authorization.md](./docs/rules/authorization.md) | CASL, OPA Rego policy engines, OpenFGA ReBAC, server guards. |
67
+ | **Multi-Tenancy** | [docs/rules/multitenancy_architecture.md](./docs/rules/multitenancy_architecture.md) | Tenant context, 4 isolation models, RLS, dynamic schemas, pluggable logic & YAGNI gates. |
68
+ | **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. |
69
+ | **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. |
70
+ | **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. |
71
+ | **Database Operations** | [docs/rules/database_operations.md](./docs/rules/database_operations.md) | Zero-downtime expand-contract migrations, N+1 elimination, DataLoader, indexing, pooling, PITR. |
72
+ | **Caching** | [docs/rules/caching.md](./docs/rules/caching.md) | Cache Port semantics, Cache-Aside, jittered TTLs, XFetch stampede defense & YAGNI gate. |
73
+ | **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. |
74
+ | **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. |
75
+ | **Cloud-Native 12-Factor** | [docs/rules/cloud_native.md](./docs/rules/cloud_native.md) | 12-Factor (2026 Edition), OpenTelemetry (OTel), stateless isolates. |
76
+ | **Error Architecture** | [docs/rules/error_handling.md](./docs/rules/error_handling.md) | Fail-fast schema validation, structured OTel/Pino tracing, RFC 9457 envelopes. |
77
+ | **Feature Flags** | [docs/rules/feature_flags.md](./docs/rules/feature_flags.md) | OpenFeature standard, Flipt/Unleash backends, targeting, kill switches & YAGNI gate. |
78
+ | **Transactional Email** | [docs/rules/transactional_email.md](./docs/rules/transactional_email.md) | Declarative templates (MJML/JSON), safe interpolation, SMTP integration testing. |
79
+ | **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. |
80
+ | **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. |
81
+ | **Requirements Engineering** | [docs/rules/requirements_engineering.md](./docs/rules/requirements_engineering.md) | User stories vs requirements, 3 C's, INVEST vertical cake slicing, Gherkin. |
82
+ | **Product Ownership** | [docs/rules/product_ownership.md](./docs/rules/product_ownership.md) | Product Backlog Management, OKRs, Kano/MoSCoW/RICE, Product Value, empiricism. |
83
+ | **Project Management** | [docs/rules/project_management.md](./docs/rules/project_management.md) | Work-In-Progress limits (WIP = 1), SMART developer tasks, Definition of Done. |
84
+ | **Domain-Driven Design** | [docs/rules/domain_driven_design.md](./docs/rules/domain_driven_design.md) | Ubiquitous Language, Bounded Contexts, Aggregates, Capability Mapping. |
85
+ | **CQRS & Projections** | [docs/rules/cqrs.md](./docs/rules/cqrs.md) | Evolutionary CQRS spectrum, YAGNI defense, read projections, outbox CDC. |
86
+ | **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. |
87
+ | **Agentic Governance** | [docs/rules/agentic_configuration.md](./docs/rules/agentic_configuration.md) | Progressive disclosure, ADR ledger, workspace sovereignty, continuous learning, YAGNI gate triad. |
88
+ | **Relentless Questioning** | [docs/rules/relentless_questioning.md](./docs/rules/relentless_questioning.md) | Dynamic context-aware interrogation loops, adaptive decision trees. |
89
+ ---
90
+
91
+ ## 4. Agent Configuration & Workspace Architecture
92
+ - **Progressive Disclosure Principle:** Never load all documentation upfront. Rely on the table above to pull specialized instructions only when performing relevant tasks.
93
+ - **Nested AGENTS.md for Monorepos:** In multi-package workspaces (e.g. `apps/backend`, `apps/frontend`), place package-specific conventions in nested `AGENTS.md` files scoped strictly to those subtrees.
94
+ - **Specialized Skills Catalog:** On-demand multi-step workflows are encapsulated under `.agents/skills/`:
95
+ - [`agentic-architect`](.agents/skills/agentic-architect/SKILL.md): Authoring, auditing, and modularizing agent configurations and skills.
96
+ - [`product-analyst`](.agents/skills/product-analyst/SKILL.md): Aligning OKRs, backlog ordering (Kano/MoSCoW/RICE), INVEST stories, and Gherkin criteria.
97
+ - [`compliance-audit`](.agents/skills/compliance-audit/SKILL.md): Conducting SOC 2, ISO 27001, and OWASP audits using open-source scanners.
98
+ - [`clean-code-refactor`](.agents/skills/clean-code-refactor/SKILL.md): Refactoring code smells with Clean Code, SOLID, and design patterns.
99
+ - [`lets-build`](.agents/skills/lets-build/SKILL.md): Conducting architecture interviews to finalize stack, frameworks, package managers, and bootstrapping projects.
100
+ - [`relentless-questioner`](.agents/skills/relentless-questioner/SKILL.md): Dynamic context-aware interrogation loops before planning and coding.
101
+ - **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`.
102
+ - **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.
103
+ - **Harness Parity & Symlinks:** `AGENTS.md`, `CLAUDE.md`, `agents.md`, `GEMINI.md`, `.cursorrules`, `.windsurfrules`, and `.github/copilot-instructions.md` must remain identical via filesystem symbolic links to eliminate configuration divergence across different agent harnesses.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Subodh Khanal
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Subodh Khanal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.