azcodr 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.agents/hooks.json +42 -0
  2. package/.agents/hooks.json.example +42 -42
  3. package/.agents/mcp_config.json.example +6 -1
  4. package/.agents/scripts/safety_guard.sh +34 -0
  5. package/.agents/scripts/verify_completion.sh +27 -0
  6. package/.agents/skills/agentic-architect/SKILL.md +125 -125
  7. package/.agents/skills/agentic-architect/references/agents_md_template.md +62 -62
  8. package/.agents/skills/agentic-architect/references/refinement_workflow.md +32 -32
  9. package/.agents/skills/agentic-architect/references/skill_architecture_inquiry.md +63 -63
  10. package/.agents/skills/agentic-architect/references/skill_template.md +56 -56
  11. package/.agents/skills/agentic-architect/scripts/validate_agentic_configs.sh +401 -331
  12. package/.agents/skills/clean-code-refactor/SKILL.md +91 -91
  13. package/.agents/skills/clean-code-refactor/references/clean_code_smells.md +27 -27
  14. package/.agents/skills/clean-code-refactor/references/design_patterns_ts.md +65 -65
  15. package/.agents/skills/compliance-audit/SKILL.md +120 -120
  16. package/.agents/skills/compliance-audit/references/owasp_top10_controls.md +16 -16
  17. package/.agents/skills/compliance-audit/references/soc2_iso_controls.md +28 -28
  18. package/.agents/skills/lets-build/SKILL.md +173 -165
  19. package/.agents/skills/lets-build/references/architecture_interview_matrix.md +115 -109
  20. package/.agents/skills/lets-build/references/hexagonal_bootstrap_scaffolds.md +160 -113
  21. package/.agents/skills/lets-build/references/project_readme_template.md +79 -79
  22. package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +255 -136
  23. package/.agents/skills/product-analyst/SKILL.md +154 -143
  24. package/.agents/skills/product-analyst/references/backlog_ordering_techniques.md +107 -107
  25. package/.agents/skills/product-analyst/references/gherkin_patterns.md +46 -46
  26. package/.agents/skills/product-analyst/references/invest_checklist.md +38 -38
  27. package/.agents/skills/product-analyst/references/okr_alignment_guide.md +76 -76
  28. package/.agents/skills/product-analyst/references/smart_tasks.md +59 -59
  29. package/.agents/skills/relentless-questioner/SKILL.md +128 -125
  30. package/.agents/skills/relentless-questioner/references/adaptive_question_trees.md +102 -84
  31. package/.editorconfig +19 -19
  32. package/.github/copilot-instructions.md +1 -0
  33. package/.github/workflows/ci.yml +56 -0
  34. package/.gitignore +25 -23
  35. package/AGENTS.md +102 -102
  36. package/LICENSE +21 -21
  37. package/README.md +154 -154
  38. package/bin/azcodr.js +228 -223
  39. package/data/.gitkeep +0 -0
  40. package/docs/knowledge/ubiquitous_language.md +18 -18
  41. package/docs/rules/agentic_configuration.md +259 -256
  42. package/docs/rules/api_architecture.md +179 -179
  43. package/docs/rules/authentication.md +76 -76
  44. package/docs/rules/authorization.md +75 -75
  45. package/docs/rules/caching.md +69 -69
  46. package/docs/rules/clean_code.md +62 -62
  47. package/docs/rules/cloud_native.md +41 -41
  48. package/docs/rules/cqrs.md +203 -203
  49. package/docs/rules/database_design.md +125 -125
  50. package/docs/rules/database_operations.md +69 -69
  51. package/docs/rules/design_patterns.md +98 -98
  52. package/docs/rules/devops_ci_cd.md +76 -76
  53. package/docs/rules/domain_driven_design.md +122 -122
  54. package/docs/rules/error_handling.md +52 -52
  55. package/docs/rules/feature_flags.md +59 -59
  56. package/docs/rules/frontend_architecture.md +157 -157
  57. package/docs/rules/multitenancy_architecture.md +98 -98
  58. package/docs/rules/product_ownership.md +127 -127
  59. package/docs/rules/project_management.md +49 -49
  60. package/docs/rules/relentless_questioning.md +52 -48
  61. package/docs/rules/requirements_engineering.md +98 -98
  62. package/docs/rules/security_compliance.md +53 -53
  63. package/docs/rules/server_driven_ui.md +88 -88
  64. package/docs/rules/test_driven_development.md +185 -184
  65. package/docs/rules/transactional_email.md +27 -27
  66. package/docs/rules/type_safety.md +65 -65
  67. package/docs/rules/ui_ux_architecture.md +150 -150
  68. package/docs/rules/workflow_state_machines.md +117 -117
  69. package/lib/index.d.ts +134 -123
  70. package/lib/index.js +5 -5
  71. package/lib/scaffold.js +399 -248
  72. package/memory.md +36 -289
  73. package/package.json +62 -59
  74. package/scripts/test_coverage.js +38 -0
  75. package/scripts/validate.js +246 -0
@@ -1,127 +1,127 @@
1
- # Product Ownership, Backlog Management & OKRs
2
-
3
- > **Core Mandate:** Maximize product value through empiricism (Build-Measure-Learn), clear Product Goals, strategic OKR alignment, outcome-driven value measurement, and disciplined backlog ordering.
4
-
5
- ---
6
-
7
- ## 1. The Product Owner Accountability & Empiricism
8
-
9
- The Product Owner (PO) is accountable for maximizing the value of the product resulting from the work of the development team. This accountability is grounded in **empiricism**: making decisions based on observation, experimentation, and evidence rather than speculation.
10
-
11
- ### Core Accountabilities
12
- 1. **Developing & Communicating the Product Goal:** Formulating a singular, long-term target that provides direction and a measurable commitment for the Product Backlog.
13
- 2. **Creating & Communicating Product Backlog Items (PBIs):** Translating stakeholder needs and strategic objectives into transparent, well-understood backlog items.
14
- 3. **Ordering the Product Backlog:** Ranking items to optimize value, address critical risks, and sequence dependencies.
15
- 4. **Deciding What NOT to Do:** The hallmark of effective product ownership is saying "no" to low-impact, out-of-scope, or speculative requests to preserve focus.
16
- 5. **Ensuring Backlog Transparency:** Maintaining a single, accessible, and visible source of truth for the team and stakeholders.
17
- 6. **Measuring Delivered Value:** Continuously gathering feedback from customers and stakeholders, calculating return on investment (ROI), and closing the satisfaction gap.
18
-
19
- ---
20
-
21
- ## 2. Product Value & Outcome vs. Output
22
-
23
- ### Defining Product Value
24
- Product value is the benefit a product provides to customers (by meeting needs and increasing satisfaction) and to the organization (monetary return, business longevity, brand reputation).
25
-
26
- ### The Satisfaction Gap
27
- Value creation focuses on closing the **Satisfaction Gap**:
28
- $$\text{Satisfaction Gap} = \text{Desired Customer Experience} - \text{Current Customer Experience}$$
29
-
30
- ### Avoiding the "Feature Factory" (Output vs. Outcome)
31
- - **Output:** The sheer volume of work completed (e.g., number of features shipped, story points burned, code commits). Output alone does NOT equal value.
32
- - **Outcome:** The measurable positive change in customer behavior, satisfaction, operational efficiency, or business performance resulting from the product increment.
33
- - Shipping 10 features that users ignore is pure waste. Shipping 1 vertical slice that solves a critical pain point is high value.
34
-
35
- ### The Product Increment & Definition of Done
36
- The only vehicle through which a team delivers actual product value is a usable, high-quality **Product Increment** that fully satisfies the **Definition of Done (DoD)**. Work that is not done delivers zero value and accumulates technical debt.
37
-
38
- ---
39
-
40
- ## 3. Strategic Alignment via OKRs (Objectives and Key Results)
41
-
42
- The OKR framework connects overarching strategic vision to sprint execution and product backlog ordering.
43
-
44
- ```mermaid
45
- flowchart TD
46
- V["Company Vision & Strategy"] --> OKR["Strategic OKRs (Annual / Quarterly)"]
47
- OKR --> PG["Product Goal (Long-Term Commitment)"]
48
- PG --> PB["Product Backlog (Emergent, Ordered PBIs)"]
49
- PB --> SG["Sprint Goal (Tactical Increment)"]
50
- ```
51
-
52
- ### Anatomy of an OKR
53
- - **Objective (O):** Qualitative, aspirational, inspiring, and time-bound statement defining **WHAT** must be achieved.
54
- - *Example:* "Establish our digital self-service portal as the fastest and most frictionless onboarding experience in the industry."
55
- - **Key Results (KRs):** 2 to 5 quantitative, outcome-focused metrics defining **HOW** progress toward the Objective is measured.
56
- - *Rule:* KRs must measure outcomes or impact, never activities or tasks (e.g., "Conduct 5 meetings" is an activity; "Increase onboarding conversion from 40% to 75%" is an outcome).
57
- - *Example KRs:*
58
- 1. Reduce average time from application approval to active service from 72 hours to under 4 hours.
59
- 2. Achieve a 95% digital self-service execution completion rate without customer support escalations.
60
- 3. Decrease manual operator review processing time by 60%.
61
-
62
- ### OKRs vs. KPIs
63
- | Dimension | Key Performance Indicators (KPIs) | Objectives & Key Results (OKRs) |
64
- |---|---|---|
65
- | **Purpose** | Measure ongoing operational health and business-as-usual baseline metrics ("vital signs"). | Drive deliberate, time-bound, aspirational transformation and change. |
66
- | **Cadence** | Continuous / evergreen monitoring (e.g., server uptime, customer churn rate). | Typically quarterly or cyclical (e.g., Q1, Q2) with retrospective scoring. |
67
- | **Mindset** | "Keep the lights on and within acceptable thresholds." | "Move the needle on strategic priorities and break new ground." |
68
-
69
- ---
70
-
71
- ## 4. Product Backlog Ordering & Prioritization Techniques
72
-
73
- Never prioritize a backlog solely on "gut feeling" or the loudest voice. Utilize established open-standard prioritization models:
74
-
75
- ### 1. The Kano Model (Customer Delight vs. Investment)
76
- Categorizes features based on how customer satisfaction correlates with implementation completeness:
77
- - **Must-be (Basic / Expected):** Table stakes. Absence causes extreme dissatisfaction; presence is taken for granted (e.g., secure password reset, data isolation).
78
- - **Performance (One-dimensional):** Linear satisfaction. The more, the better (e.g., search speed, export volume, page load time).
79
- - **Attractive (Delighters / Excitement):** Unexpected innovations. Absence causes no dissatisfaction, but presence triggers high customer delight (e.g., instant one-click self-service onboarding).
80
- - **Indifferent:** Features customers do not care about. Eliminate immediately.
81
- - **Reverse:** Features that cause dissatisfaction if added (e.g., excessive mandatory onboarding popups).
82
-
83
- ### 2. MoSCoW Prioritization
84
- - **Must Have (M):** Non-negotiable core invariants; without them, the increment cannot be released or is illegal/insecure.
85
- - **Should Have (S):** Important capabilities that add substantial value, but a workaround exists for this release.
86
- - **Could Have (C):** Desirable enhancements implemented only if time and capacity permit.
87
- - **Won't Have This Time (W):** Explicitly agreed out-of-scope items for the current planning cycle, protecting the team from scope creep.
88
-
89
- ### 3. RICE Scoring
90
- Calculates a numerical score to rank candidate backlog items objectively:
91
- $$\text{RICE Score} = \frac{\text{Reach} \times \text{Impact} \times \text{Confidence}}{\text{Effort}}$$
92
- - **Reach:** Number of users or transactions impacted over a fixed period.
93
- - **Impact:** Degree of benefit per user (e.g., $3 = \text{massive}$, $2 = \text{high}$, $1 = \text{medium}$, $0.5 = \text{low}$, $0.25 = \text{minimal}$).
94
- - **Confidence:** Percentage reflecting data backing your estimate ($100\% = \text{high evidence}$, $80\% = \text{medium}$, $50\% = \text{speculative}$).
95
- - **Effort:** Total person-weeks or person-sprints required to deliver the vertical slice.
96
-
97
- ### 4. Buy a Feature
98
- A collaborative prioritization exercise where stakeholders are allocated a constrained budget of fictitious currency to "buy" features priced according to their engineering effort. Reveals true customer value by forcing trade-offs under scarcity.
99
-
100
- ---
101
-
102
- ## 5. Product Backlog Granularity & Progressive Elaboration
103
-
104
- Following Gunther Verheyen's backlog topology, the Product Backlog serves as an **emergent, living roadmap**:
105
-
106
- ```mermaid
107
- flowchart TD
108
- subgraph Top["Finer Granularity (Top of Backlog)"]
109
- P1["PBI 1: Sprintable, vertically sliced, clear DoD & Gherkin"]
110
- P2["PBI 2: High priority, well-understood, estimated"]
111
- P3["PBI 3: Actionable, small, customer value clear"]
112
- end
113
- subgraph Middle["Medium Granularity (Middle)"]
114
- P4["PBI 4: Candidate for next period, coarse slice"]
115
- P5["PBI 5: Alternative approach under evaluation"]
116
- end
117
- subgraph Bottom["Coarser Granularity (Bottom)"]
118
- P6["PBI 6: Long-term idea, future capability"]
119
- P7["PBI 7: Raw thought, exploratory concept"]
120
- end
121
- Top --> Middle --> Bottom
122
- ```
123
-
124
- ### Rules of Progressive Elaboration
125
- 1. **Single & Ordered:** Exactly one backlog exists per product.
126
- 2. **Dynamic Splitting:** As coarse items approach the top of the backlog, they must be split into fine, sprintable INVEST slices.
127
- 3. **Continuous Pruning:** Items may be reordered, added, split, or permanently deleted at any time based on empirical learning. If an item lingers at the bottom of the backlog for months without business justification, remove it.
1
+ # Product Ownership, Backlog Management & OKRs
2
+
3
+ > **Core Mandate:** Maximize product value through empiricism (Build-Measure-Learn), clear Product Goals, strategic OKR alignment, outcome-driven value measurement, and disciplined backlog ordering.
4
+
5
+ ---
6
+
7
+ ## 1. The Product Owner Accountability & Empiricism
8
+
9
+ The Product Owner (PO) is accountable for maximizing the value of the product resulting from the work of the development team. This accountability is grounded in **empiricism**: making decisions based on observation, experimentation, and evidence rather than speculation.
10
+
11
+ ### Core Accountabilities
12
+ 1. **Developing & Communicating the Product Goal:** Formulating a singular, long-term target that provides direction and a measurable commitment for the Product Backlog.
13
+ 2. **Creating & Communicating Product Backlog Items (PBIs):** Translating stakeholder needs and strategic objectives into transparent, well-understood backlog items.
14
+ 3. **Ordering the Product Backlog:** Ranking items to optimize value, address critical risks, and sequence dependencies.
15
+ 4. **Deciding What NOT to Do:** The hallmark of effective product ownership is saying "no" to low-impact, out-of-scope, or speculative requests to preserve focus.
16
+ 5. **Ensuring Backlog Transparency:** Maintaining a single, accessible, and visible source of truth for the team and stakeholders.
17
+ 6. **Measuring Delivered Value:** Continuously gathering feedback from customers and stakeholders, calculating return on investment (ROI), and closing the satisfaction gap.
18
+
19
+ ---
20
+
21
+ ## 2. Product Value & Outcome vs. Output
22
+
23
+ ### Defining Product Value
24
+ Product value is the benefit a product provides to customers (by meeting needs and increasing satisfaction) and to the organization (monetary return, business longevity, brand reputation).
25
+
26
+ ### The Satisfaction Gap
27
+ Value creation focuses on closing the **Satisfaction Gap**:
28
+ $$\text{Satisfaction Gap} = \text{Desired Customer Experience} - \text{Current Customer Experience}$$
29
+
30
+ ### Avoiding the "Feature Factory" (Output vs. Outcome)
31
+ - **Output:** The sheer volume of work completed (e.g., number of features shipped, story points burned, code commits). Output alone does NOT equal value.
32
+ - **Outcome:** The measurable positive change in customer behavior, satisfaction, operational efficiency, or business performance resulting from the product increment.
33
+ - Shipping 10 features that users ignore is pure waste. Shipping 1 vertical slice that solves a critical pain point is high value.
34
+
35
+ ### The Product Increment & Definition of Done
36
+ The only vehicle through which a team delivers actual product value is a usable, high-quality **Product Increment** that fully satisfies the **Definition of Done (DoD)**. Work that is not done delivers zero value and accumulates technical debt.
37
+
38
+ ---
39
+
40
+ ## 3. Strategic Alignment via OKRs (Objectives and Key Results)
41
+
42
+ The OKR framework connects overarching strategic vision to sprint execution and product backlog ordering.
43
+
44
+ ```mermaid
45
+ flowchart TD
46
+ V["Company Vision & Strategy"] --> OKR["Strategic OKRs (Annual / Quarterly)"]
47
+ OKR --> PG["Product Goal (Long-Term Commitment)"]
48
+ PG --> PB["Product Backlog (Emergent, Ordered PBIs)"]
49
+ PB --> SG["Sprint Goal (Tactical Increment)"]
50
+ ```
51
+
52
+ ### Anatomy of an OKR
53
+ - **Objective (O):** Qualitative, aspirational, inspiring, and time-bound statement defining **WHAT** must be achieved.
54
+ - *Example:* "Establish our digital self-service portal as the fastest and most frictionless onboarding experience in the industry."
55
+ - **Key Results (KRs):** 2 to 5 quantitative, outcome-focused metrics defining **HOW** progress toward the Objective is measured.
56
+ - *Rule:* KRs must measure outcomes or impact, never activities or tasks (e.g., "Conduct 5 meetings" is an activity; "Increase onboarding conversion from 40% to 75%" is an outcome).
57
+ - *Example KRs:*
58
+ 1. Reduce average time from application approval to active service from 72 hours to under 4 hours.
59
+ 2. Achieve a 95% digital self-service execution completion rate without customer support escalations.
60
+ 3. Decrease manual operator review processing time by 60%.
61
+
62
+ ### OKRs vs. KPIs
63
+ | Dimension | Key Performance Indicators (KPIs) | Objectives & Key Results (OKRs) |
64
+ |---|---|---|
65
+ | **Purpose** | Measure ongoing operational health and business-as-usual baseline metrics ("vital signs"). | Drive deliberate, time-bound, aspirational transformation and change. |
66
+ | **Cadence** | Continuous / evergreen monitoring (e.g., server uptime, customer churn rate). | Typically quarterly or cyclical (e.g., Q1, Q2) with retrospective scoring. |
67
+ | **Mindset** | "Keep the lights on and within acceptable thresholds." | "Move the needle on strategic priorities and break new ground." |
68
+
69
+ ---
70
+
71
+ ## 4. Product Backlog Ordering & Prioritization Techniques
72
+
73
+ Never prioritize a backlog solely on "gut feeling" or the loudest voice. Utilize established open-standard prioritization models:
74
+
75
+ ### 1. The Kano Model (Customer Delight vs. Investment)
76
+ Categorizes features based on how customer satisfaction correlates with implementation completeness:
77
+ - **Must-be (Basic / Expected):** Table stakes. Absence causes extreme dissatisfaction; presence is taken for granted (e.g., secure password reset, data isolation).
78
+ - **Performance (One-dimensional):** Linear satisfaction. The more, the better (e.g., search speed, export volume, page load time).
79
+ - **Attractive (Delighters / Excitement):** Unexpected innovations. Absence causes no dissatisfaction, but presence triggers high customer delight (e.g., instant one-click self-service onboarding).
80
+ - **Indifferent:** Features customers do not care about. Eliminate immediately.
81
+ - **Reverse:** Features that cause dissatisfaction if added (e.g., excessive mandatory onboarding popups).
82
+
83
+ ### 2. MoSCoW Prioritization
84
+ - **Must Have (M):** Non-negotiable core invariants; without them, the increment cannot be released or is illegal/insecure.
85
+ - **Should Have (S):** Important capabilities that add substantial value, but a workaround exists for this release.
86
+ - **Could Have (C):** Desirable enhancements implemented only if time and capacity permit.
87
+ - **Won't Have This Time (W):** Explicitly agreed out-of-scope items for the current planning cycle, protecting the team from scope creep.
88
+
89
+ ### 3. RICE Scoring
90
+ Calculates a numerical score to rank candidate backlog items objectively:
91
+ $$\text{RICE Score} = \frac{\text{Reach} \times \text{Impact} \times \text{Confidence}}{\text{Effort}}$$
92
+ - **Reach:** Number of users or transactions impacted over a fixed period.
93
+ - **Impact:** Degree of benefit per user (e.g., $3 = \text{massive}$, $2 = \text{high}$, $1 = \text{medium}$, $0.5 = \text{low}$, $0.25 = \text{minimal}$).
94
+ - **Confidence:** Percentage reflecting data backing your estimate ($100\% = \text{high evidence}$, $80\% = \text{medium}$, $50\% = \text{speculative}$).
95
+ - **Effort:** Total person-weeks or person-sprints required to deliver the vertical slice.
96
+
97
+ ### 4. Buy a Feature
98
+ A collaborative prioritization exercise where stakeholders are allocated a constrained budget of fictitious currency to "buy" features priced according to their engineering effort. Reveals true customer value by forcing trade-offs under scarcity.
99
+
100
+ ---
101
+
102
+ ## 5. Product Backlog Granularity & Progressive Elaboration
103
+
104
+ Following Gunther Verheyen's backlog topology, the Product Backlog serves as an **emergent, living roadmap**:
105
+
106
+ ```mermaid
107
+ flowchart TD
108
+ subgraph Top["Finer Granularity (Top of Backlog)"]
109
+ P1["PBI 1: Sprintable, vertically sliced, clear DoD & Gherkin"]
110
+ P2["PBI 2: High priority, well-understood, estimated"]
111
+ P3["PBI 3: Actionable, small, customer value clear"]
112
+ end
113
+ subgraph Middle["Medium Granularity (Middle)"]
114
+ P4["PBI 4: Candidate for next period, coarse slice"]
115
+ P5["PBI 5: Alternative approach under evaluation"]
116
+ end
117
+ subgraph Bottom["Coarser Granularity (Bottom)"]
118
+ P6["PBI 6: Long-term idea, future capability"]
119
+ P7["PBI 7: Raw thought, exploratory concept"]
120
+ end
121
+ Top --> Middle --> Bottom
122
+ ```
123
+
124
+ ### Rules of Progressive Elaboration
125
+ 1. **Single & Ordered:** Exactly one backlog exists per product.
126
+ 2. **Dynamic Splitting:** As coarse items approach the top of the backlog, they must be split into fine, sprintable INVEST slices.
127
+ 3. **Continuous Pruning:** Items may be reordered, added, split, or permanently deleted at any time based on empirical learning. If an item lingers at the bottom of the backlog for months without business justification, remove it.
@@ -1,49 +1,49 @@
1
- # Project Management, Work-In-Progress Limits & Definition of Done
2
-
3
- > **Core Mandate:** Enforce strict Work-In-Progress (WIP) limits, vertical task slicing, SMART developer task decomposition, explicit task lifecycle states, and an uncompromising Definition of Done (DoD).
4
-
5
- ---
6
-
7
- ## 1. Task Lifecycle & WIP Limits
8
-
9
- - **Task States**: Every operational task must progress through explicit states:
10
- ```
11
- BACKLOG ──► TODO ──► IN_PROGRESS ──► REVIEW ──► DONE
12
- ```
13
- - **Strict WIP Limit**: Maintain a Work-In-Progress (WIP) limit of **exactly 1 atomic task** at any given time. Never begin a new task while a previous task is incomplete or failing tests.
14
- - **Vertical Task Slicing**: Stories must deliver full-stack value across UI, API, Domain, and DB layers (no horizontal layers like "create migration only").
15
-
16
- ---
17
-
18
- ## 2. Decomposing Stories into SMART Developer Tasks
19
-
20
- While user stories represent customer-facing value (governed by the INVEST model), engineering execution requires decomposing each story into technical developer tasks. Apply Bill Wake's **SMART** criteria to all developer tasks:
21
-
22
- - **S - Specific:** The task scope is clearly defined so every team member understands what is involved. Avoids overlapping with concurrent work and ensures all tasks aggregate into the complete story.
23
- - **M - Measurable:** Defined by the question: *"Can we objectively mark it as done?"* Completion requires that:
24
- 1. The code fulfills its intended behavior.
25
- 2. Automated tests are written and passing.
26
- 3. Clean code principles and refactoring have been applied.
27
- - **A - Achievable:** The task owner has the skills and context to complete it. Establish a psychological safety norm: anyone can ask for help immediately if a task encounters unexpected obstacles.
28
- - **R - Relevant:** Every developer task directly contributes to delivering the parent user story. Technical infrastructure tasks must be justified by the business capability they unlock.
29
- - **T - Time-Boxed:** Each task has a bounded duration expectation (typically 2–4 hours, never exceeding 1 day). Exceeding the time-box acts as an automatic trigger to pause, split the task, pair with a peer, or adjust the plan.
30
-
31
- ---
32
-
33
- ## 3. Definition of Done (DoD)
34
-
35
- A user story or task is only marked `DONE` when all of the following verifiable criteria are met:
36
- - [ ] **Lifecycle Provenance**: Code developed strictly via the 5-Phase Agile Domain Lifecycle (Requirements ➔ Domain Analysis ➔ Outer Acceptance RED ➔ Inner Unit RED-GREEN-REFACTOR ➔ Outer GREEN). Zero production code written before tests.
37
- - [ ] **Tests Green**: 100.00% full-stack test coverage maintained across statement, branch, function, and line metrics (`npm test` / `pnpm test`).
38
- - [ ] **Boundary Verified**: Cross-package boundary smoke tests passed against live running servers (`scripts/smoke_test.sh`).
39
- - [ ] **Zero Lints & Types**: 0 ESLint warnings and 0 TypeScript compilation errors (`npm run lint && npm run typecheck`).
40
- - [ ] **No Unverified Assumptions**: All behavior backed by tests, schema invariants, or verified command evidence.
41
- - [ ] **ADR Logged**: An Architectural Decision Record is logged in `memory.md` if architectural trade-offs were made.
42
- - [ ] **Documentation Clean**: Zero broken markdown links across workspace files and relevant knowledge documents updated.
43
-
44
- ---
45
-
46
- ## 4. Blocker Escalation & Risk Management
47
-
48
- - If a blocker or ambiguity arises, immediately transition the task to `BLOCKED`, halt execution, and interrogate the root cause.
49
- - Never guess or write speculative code to bypass an unresolved requirement.
1
+ # Project Management, Work-In-Progress Limits & Definition of Done
2
+
3
+ > **Core Mandate:** Enforce strict Work-In-Progress (WIP) limits, vertical task slicing, SMART developer task decomposition, explicit task lifecycle states, and an uncompromising Definition of Done (DoD).
4
+
5
+ ---
6
+
7
+ ## 1. Task Lifecycle & WIP Limits
8
+
9
+ - **Task States**: Every operational task must progress through explicit states:
10
+ ```
11
+ BACKLOG ──► TODO ──► IN_PROGRESS ──► REVIEW ──► DONE
12
+ ```
13
+ - **Strict WIP Limit**: Maintain a Work-In-Progress (WIP) limit of **exactly 1 atomic task** at any given time. Never begin a new task while a previous task is incomplete or failing tests.
14
+ - **Vertical Task Slicing**: Stories must deliver full-stack value across UI, API, Domain, and DB layers (no horizontal layers like "create migration only").
15
+
16
+ ---
17
+
18
+ ## 2. Decomposing Stories into SMART Developer Tasks
19
+
20
+ While user stories represent customer-facing value (governed by the INVEST model), engineering execution requires decomposing each story into technical developer tasks. Apply Bill Wake's **SMART** criteria to all developer tasks:
21
+
22
+ - **S - Specific:** The task scope is clearly defined so every team member understands what is involved. Avoids overlapping with concurrent work and ensures all tasks aggregate into the complete story.
23
+ - **M - Measurable:** Defined by the question: *"Can we objectively mark it as done?"* Completion requires that:
24
+ 1. The code fulfills its intended behavior.
25
+ 2. Automated tests are written and passing.
26
+ 3. Clean code principles and refactoring have been applied.
27
+ - **A - Achievable:** The task owner has the skills and context to complete it. Establish a psychological safety norm: anyone can ask for help immediately if a task encounters unexpected obstacles.
28
+ - **R - Relevant:** Every developer task directly contributes to delivering the parent user story. Technical infrastructure tasks must be justified by the business capability they unlock.
29
+ - **T - Time-Boxed:** Each task has a bounded duration expectation (typically 2–4 hours, never exceeding 1 day). Exceeding the time-box acts as an automatic trigger to pause, split the task, pair with a peer, or adjust the plan.
30
+
31
+ ---
32
+
33
+ ## 3. Definition of Done (DoD)
34
+
35
+ A user story or task is only marked `DONE` when all of the following verifiable criteria are met:
36
+ - [ ] **Lifecycle Provenance**: Code developed strictly via the 5-Phase Agile Domain Lifecycle (Requirements ➔ Domain Analysis ➔ Outer Acceptance RED ➔ Inner Unit RED-GREEN-REFACTOR ➔ Outer GREEN). Zero production code written before tests.
37
+ - [ ] **Tests Green**: 100.00% full-stack test coverage maintained across statement, branch, function, and line metrics (`npm test` / `pnpm test`).
38
+ - [ ] **Boundary Verified**: Cross-package boundary smoke tests passed against live running servers (`scripts/smoke_test.sh`).
39
+ - [ ] **Zero Lints & Types**: 0 ESLint warnings and 0 TypeScript compilation errors (`npm run lint && npm run typecheck`).
40
+ - [ ] **No Unverified Assumptions**: All behavior backed by tests, schema invariants, or verified command evidence.
41
+ - [ ] **ADR Logged**: An Architectural Decision Record is logged in `memory.md` if architectural trade-offs were made.
42
+ - [ ] **Documentation Clean**: Zero broken markdown links across workspace files and relevant knowledge documents updated.
43
+
44
+ ---
45
+
46
+ ## 4. Blocker Escalation & Risk Management
47
+
48
+ - If a blocker or ambiguity arises, immediately transition the task to `BLOCKED`, halt execution, and interrogate the root cause.
49
+ - Never guess or write speculative code to bypass an unresolved requirement.
@@ -1,48 +1,52 @@
1
- # Relentless Questioning Loop & Dynamic Interrogation Protocol
2
-
3
- > **Core Mandate:** Enforce context-aware, adaptive interrogation of requirements, technical constraints, and failure modes before code authoring, dynamically branching questions based on previous answers to eliminate all hidden assumptions.
4
-
5
- ---
6
-
7
- ## 1. The Context-Aware Interrogation Lifecycle
8
-
9
- Never write speculative code or draft implementation plans based on underspecified user prompts. Every non-trivial feature, database modification, or architectural task must pass through the **4-Stage Relentless Questioning Loop**:
10
-
11
- ```
12
- 1. CLASSIFY (Detect Archetype) ──► 2. ADAPTIVE BRANCHING (Context Questions) ──► 3. TENSION RECONCILIATION (Rule Conflicts) ──► 4. CONVERGENCE (Signed-Off Spec)
13
- ```
14
-
15
- 1. **Stage 1: Intent & Archetype Classification**: Analyze the incoming prompt to identify core domains (e.g. Financial/Ledger, Multi-Tenant Mutation, Async/Event-Driven, External Integration, Public API, or Read-Heavy Analytics).
16
- 2. **Stage 2: Context-Aware Adaptive Branching**: Ask targeted questions in digestible batches (2–4 questions per turn). **Question $N+1$ must directly incorporate the answer to Question $N$**, exploring deep technical trade-offs rather than reciting generic checklists.
17
- 3. **Stage 3: Architectural Tension Reconciliation**: If the user's proposed approach violates an existing workspace rule (e.g. dual-writes without an outbox, sparse nullable columns, or missing tenant isolation), immediately highlight the architectural conflict and propose compliant alternatives.
18
- 4. **Stage 4: Convergence & Feature Alignment Specification (FAS)**: Lock down the scope with an unambiguous summary covering Invariants, Negative Scope (Non-Goals), Error Matrix, and Test Verification Strategy.
19
-
20
- ---
21
-
22
- ## 2. Adaptive Contextual Decision Branches
23
-
24
- Questions must dynamically pivot depending on the technical archetype:
25
-
26
- ### Branch A: State Mutations & Financial Transactions
27
- *Trigger:* The feature involves balances, orders, payments, inventories, or status transitions.
28
- - *Adaptive Inquiries:* What isolation level is required (`REPEATABLE READ` vs `SERIALIZABLE`)? What is the idempotency key TTL? In the event of a downstream gateway failure, how is the compensating rollback (Saga) triggered? How is concurrent mutation race condition prevented (Optimistic Concurrency Control vs row lock)?
29
-
30
- ### Branch B: Multi-Tenancy & Data Boundaries
31
- *Trigger:* The feature touches tenant-scoped entities or custom fields.
32
- - *Adaptive Inquiries:* How is the tenant context resolved if accessed via background workers? Which isolation model applies (AST interceptor, database RLS, or schema namespace)? If custom fields are needed, does the tenant's JSON Schema govern validation?
33
-
34
- ### Branch C: Asynchronous Tasks & Event Streaming
35
- *Trigger:* The feature processes background jobs, emails, webhooks, or messaging.
36
- - *Adaptive Inquiries:* Is message delivery at-least-once or exactly-once? How are dual-writes prevented (Transactional Outbox)? How are poison pills and retries handled (Dead-Letter Queue with exponential backoff)?
37
-
38
- ### Branch D: External Integrations & 3rd-Party APIs
39
- *Trigger:* The feature interacts with external SaaS, webhooks, or cloud services.
40
- - *Adaptive Inquiries:* What is the project-owned Port/Adapter boundary interface? What are the rate-limiting and circuit-breaking parameters? How are mock test doubles constructed without mocking third-party types directly?
41
-
42
- ---
43
-
44
- ## 3. Anti-Assumption Guardrails
45
-
46
- - **Zero Implicit Defaults**: If the user does not specify a behavior (e.g. timeout duration, error status code, rollback behavior), treat it as strictly unknown and ask.
47
- - **Explicit Non-Goals (Negative Scope)**: Every inquiry must establish what the feature will **NOT** do, preventing scope creep and unrequested architectural bloat.
48
- - **Mandatory User Confirmation**: Never transition from interrogation to code generation without an explicit confirmation from the user on the synthesized alignment specification.
1
+ # Relentless Questioning Loop & Dynamic Interrogation Protocol
2
+
3
+ > **Core Mandate:** Enforce context-aware, adaptive interrogation of requirements, technical constraints, and failure modes before code authoring, dynamically branching questions based on previous answers to eliminate all hidden assumptions.
4
+
5
+ ---
6
+
7
+ ## 1. The Context-Aware Interrogation Lifecycle
8
+
9
+ Never write speculative code or draft implementation plans based on underspecified user prompts. Every non-trivial feature, database modification, or architectural task must pass through the **4-Stage Relentless Questioning Loop**:
10
+
11
+ ```
12
+ 1. CLASSIFY (Detect Archetype) ──► 2. ADAPTIVE BRANCHING (Context Questions) ──► 3. TENSION RECONCILIATION (Rule Conflicts) ──► 4. CONVERGENCE (Signed-Off Spec)
13
+ ```
14
+
15
+ 1. **Stage 1: Intent & Archetype Classification**: Analyze the incoming prompt to identify core domains (e.g. Financial/Ledger, Multi-Tenant Mutation, Async/Event-Driven, External Integration, Public API, or Read-Heavy Analytics).
16
+ 2. **Stage 2: Context-Aware Adaptive Branching**: Ask targeted questions in digestible batches (2–4 questions per turn). **Question $N+1$ must directly incorporate the answer to Question $N$**, exploring deep technical trade-offs rather than reciting generic checklists.
17
+ 3. **Stage 3: Architectural Tension Reconciliation**: If the user's proposed approach violates an existing workspace rule (e.g. dual-writes without an outbox, sparse nullable columns, or missing tenant isolation), immediately highlight the architectural conflict and propose compliant alternatives.
18
+ 4. **Stage 4: Convergence & Feature Alignment Specification (FAS)**: Lock down the scope with an unambiguous summary covering Invariants, Negative Scope (Non-Goals), Error Matrix, and Test Verification Strategy.
19
+
20
+ ---
21
+
22
+ ## 2. Adaptive Contextual Decision Branches
23
+
24
+ Questions must dynamically pivot depending on the technical archetype:
25
+
26
+ ### Branch A: State Mutations & Financial Transactions
27
+ *Trigger:* The feature involves balances, orders, payments, inventories, or status transitions.
28
+ - *Adaptive Inquiries:* What isolation level is required (`REPEATABLE READ` vs `SERIALIZABLE`)? What is the idempotency key TTL? In the event of a downstream gateway failure, how is the compensating rollback (Saga) triggered? How is concurrent mutation race condition prevented (Optimistic Concurrency Control vs row lock)?
29
+
30
+ ### Branch B: Multi-Tenancy & Data Boundaries
31
+ *Trigger:* The feature touches tenant-scoped entities or custom fields.
32
+ - *Adaptive Inquiries:* How is the tenant context resolved if accessed via background workers? Which isolation model applies (AST interceptor, database RLS, or schema namespace)? If custom fields are needed, does the tenant's JSON Schema govern validation?
33
+
34
+ ### Branch C: Asynchronous Tasks & Event Streaming
35
+ *Trigger:* The feature processes background jobs, emails, webhooks, or messaging.
36
+ - *Adaptive Inquiries:* Is message delivery at-least-once or exactly-once? How are dual-writes prevented (Transactional Outbox)? How are poison pills and retries handled (Dead-Letter Queue with exponential backoff)?
37
+
38
+ ### Branch D: External Integrations & 3rd-Party APIs
39
+ *Trigger:* The feature interacts with external SaaS, webhooks, or cloud services.
40
+ - *Adaptive Inquiries:* What is the project-owned Port/Adapter boundary interface? What are the rate-limiting and circuit-breaking parameters? How are mock test doubles constructed without mocking third-party types directly?
41
+
42
+ ### Branch E: User Interface, Experience Duality & Interaction Flows
43
+ *Trigger:* The feature introduces or modifies user interfaces, web pages, screen layouts, form mutations, or navigation.
44
+ - *Adaptive Inquiries:* Who is the target user persona (Operator/Admin dense workspace vs Consumer/Member portal)? How does the view fit into the Persistent App Shell (collapsible sidebar, global header) vs Dynamic Canvas? What is the URL state synchronization strategy (`useSearchParams` for `?tab=`, `?q=`, `?page=`, `?modal=`)? What server-state cache manager synchronizes data (TanStack Query)? How are validation feedback and errors displayed (RFC 7807 inline/toast alerts, WCAG 2.2 live regions, zero native `window.alert()`)?
45
+
46
+ ---
47
+
48
+ ## 3. Anti-Assumption Guardrails
49
+
50
+ - **Zero Implicit Defaults**: If the user does not specify a behavior (e.g. timeout duration, error status code, rollback behavior), treat it as strictly unknown and ask.
51
+ - **Explicit Non-Goals (Negative Scope)**: Every inquiry must establish what the feature will **NOT** do, preventing scope creep and unrequested architectural bloat.
52
+ - **Mandatory User Confirmation**: Never transition from interrogation to code generation without an explicit confirmation from the user on the synthesized alignment specification.