azcodr 1.5.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 -16
  5. package/.agents/scripts/verify_completion.sh +27 -13
  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 -362
  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 -172
  19. package/.agents/skills/lets-build/references/architecture_interview_matrix.md +115 -115
  20. package/.agents/skills/lets-build/references/hexagonal_bootstrap_scaffolds.md +160 -160
  21. package/.agents/skills/lets-build/references/project_readme_template.md +79 -79
  22. package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +255 -253
  23. package/.agents/skills/product-analyst/SKILL.md +154 -154
  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 -128
  30. package/.agents/skills/relentless-questioner/references/adaptive_question_trees.md +102 -102
  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 -25
  35. package/AGENTS.md +102 -102
  36. package/LICENSE +21 -21
  37. package/README.md +154 -154
  38. package/bin/azcodr.js +228 -228
  39. package/data/.gitkeep +0 -0
  40. package/docs/knowledge/ubiquitous_language.md +18 -18
  41. package/docs/rules/agentic_configuration.md +259 -259
  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 -52
  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 -185
  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 -351
  72. package/memory.md +36 -36
  73. package/package.json +62 -59
  74. package/scripts/test_coverage.js +38 -0
  75. package/scripts/validate.js +246 -0
@@ -1,38 +1,38 @@
1
- # INVEST Checklist & Vertical Slicing Reference
2
-
3
- Use this checklist to evaluate whether a user story is ready for development, adheres to Bill Wake's original INVEST model, and embodies Ron Jeffries' 3 C's.
4
-
5
- ---
6
-
7
- ## 1. The 3 C's Pre-Flight Check
8
-
9
- - [ ] **Card:** Does the physical card or issue title capture the essential intent without drowning in premature implementation details?
10
- - [ ] **Conversation:** Has there been a collaborative discussion between the Product Owner, domain expert, and engineers to co-create details and discover edge cases?
11
- - [ ] **Confirmation:** Are there concrete, executable acceptance criteria (Gherkin scenarios) that prove whether the story is satisfied?
12
-
13
- ---
14
-
15
- ## 2. INVEST Evaluation Matrix
16
-
17
- | Criterion | Evaluation Question | Pass / Fail Check |
18
- |---|---|---|
19
- | **I - Independent** | Can this story be scheduled, implemented, and released independently of parallel stories? Does it avoid tight coupling or circular dependency? | [ ] No blocking dependencies on concurrent in-flight stories. |
20
- | **N - Negotiable** | Does the story focus on the user need and business value rather than prescribing rigid code syntax or immutable UI design? | [ ] Leaves implementation discovery and technical details open to the engineering pair. |
21
- | **V - Valuable** | Is the customer value observable? Does it slice vertically through the "multi-layer cake" (UI, API, Domain, DB)? | [ ] Sliced vertically; delivers usable, working software to the end user. |
22
- | **E - Estimable** | Is the scope sufficiently bounded and understood by the team to gauge complexity? | [ ] Architectural unknowns isolated; time-boxed spike completed if necessary. |
23
- | **S - Small** | Is the slice small enough to be completed within 1–2 development days? | [ ] Not a multi-week epic; decomposed into fine-grained vertical increments. |
24
- | **T - Testable** | Are there unambiguous pass/fail criteria? Are non-functional requirements (NFRs) operationalized as tests? | [ ] Executable Gherkin scenarios defined; verifiable via automated acceptance tests. |
25
-
26
- ---
27
-
28
- ## 3. The Multi-Layer Cake Slicing Test
29
-
30
- When decomposing epics into stories, visualize a multi-layer cake with presentation, business logic, domain entities, and persistence layers.
31
-
32
- ### Slicing Violations (Reject immediately)
33
- - ❌ *"Create database migration and table schema for resources"* (Horizontal layer: Zero customer value).
34
- - ❌ *"Build UI form components for resource review"* (Horizontal layer: Dummy mock with zero persistence).
35
- - ❌ *"Write backend REST controller for submitting actions"* (Horizontal layer: Orphaned API endpoint).
36
-
37
- ### Slicing Success (Accept)
38
- - ✅ *"Self-service resource review and approval execution"* (Vertical slice: User reviews terms in UI ➔ Submits confirmation ➔ API verifies actor ➔ Domain validates state invariants ➔ Record persisted with audit trail ➔ Transactional confirmation notification dispatched).
1
+ # INVEST Checklist & Vertical Slicing Reference
2
+
3
+ Use this checklist to evaluate whether a user story is ready for development, adheres to Bill Wake's original INVEST model, and embodies Ron Jeffries' 3 C's.
4
+
5
+ ---
6
+
7
+ ## 1. The 3 C's Pre-Flight Check
8
+
9
+ - [ ] **Card:** Does the physical card or issue title capture the essential intent without drowning in premature implementation details?
10
+ - [ ] **Conversation:** Has there been a collaborative discussion between the Product Owner, domain expert, and engineers to co-create details and discover edge cases?
11
+ - [ ] **Confirmation:** Are there concrete, executable acceptance criteria (Gherkin scenarios) that prove whether the story is satisfied?
12
+
13
+ ---
14
+
15
+ ## 2. INVEST Evaluation Matrix
16
+
17
+ | Criterion | Evaluation Question | Pass / Fail Check |
18
+ |---|---|---|
19
+ | **I - Independent** | Can this story be scheduled, implemented, and released independently of parallel stories? Does it avoid tight coupling or circular dependency? | [ ] No blocking dependencies on concurrent in-flight stories. |
20
+ | **N - Negotiable** | Does the story focus on the user need and business value rather than prescribing rigid code syntax or immutable UI design? | [ ] Leaves implementation discovery and technical details open to the engineering pair. |
21
+ | **V - Valuable** | Is the customer value observable? Does it slice vertically through the "multi-layer cake" (UI, API, Domain, DB)? | [ ] Sliced vertically; delivers usable, working software to the end user. |
22
+ | **E - Estimable** | Is the scope sufficiently bounded and understood by the team to gauge complexity? | [ ] Architectural unknowns isolated; time-boxed spike completed if necessary. |
23
+ | **S - Small** | Is the slice small enough to be completed within 1–2 development days? | [ ] Not a multi-week epic; decomposed into fine-grained vertical increments. |
24
+ | **T - Testable** | Are there unambiguous pass/fail criteria? Are non-functional requirements (NFRs) operationalized as tests? | [ ] Executable Gherkin scenarios defined; verifiable via automated acceptance tests. |
25
+
26
+ ---
27
+
28
+ ## 3. The Multi-Layer Cake Slicing Test
29
+
30
+ When decomposing epics into stories, visualize a multi-layer cake with presentation, business logic, domain entities, and persistence layers.
31
+
32
+ ### Slicing Violations (Reject immediately)
33
+ - ❌ *"Create database migration and table schema for resources"* (Horizontal layer: Zero customer value).
34
+ - ❌ *"Build UI form components for resource review"* (Horizontal layer: Dummy mock with zero persistence).
35
+ - ❌ *"Write backend REST controller for submitting actions"* (Horizontal layer: Orphaned API endpoint).
36
+
37
+ ### Slicing Success (Accept)
38
+ - ✅ *"Self-service resource review and approval execution"* (Vertical slice: User reviews terms in UI ➔ Submits confirmation ➔ API verifies actor ➔ Domain validates state invariants ➔ Record persisted with audit trail ➔ Transactional confirmation notification dispatched).
@@ -1,76 +1,76 @@
1
- # OKR Alignment & Product Goal Formulation Guide
2
-
3
- > **Core Concept:** Connect high-level business strategy to agile sprint execution using the Objectives and Key Results (OKR) framework (pioneered by Andy Grove at Intel, popularized by John Doerr, and standardized by the OKR Institute).
4
-
5
- ---
6
-
7
- ## 1. The Strategic Hierarchy
8
-
9
- ```
10
- Company Vision & Strategy
11
- │
12
- ▼
13
- Strategic OKRs (Annual / Quarterly)
14
- │
15
- ▼
16
- Product Goal (Long-Term Commitment per Scrum Guide)
17
- │
18
- ▼
19
- Product Backlog Items (Kano / MoSCoW / RICE ordered)
20
- │
21
- ▼
22
- Sprint Goal (Tactical Incremental Commitment)
23
- ```
24
-
25
- ---
26
-
27
- ## 2. Anatomy of an Effective OKR
28
-
29
- ### Objective (O)
30
- - **Definition:** A qualitative, memorable, inspiring, and time-bound statement defining **WHAT** the team wants to achieve.
31
- - **Criteria:**
32
- - Aggressive yet realistic (aiming for 70% achievement on stretch goals).
33
- - Concise and easy for anyone on the team to recite.
34
- - Concrete and action-oriented.
35
- - Free from numeric metrics (numbers belong in Key Results).
36
-
37
- ### Key Results (KRs)
38
- - **Definition:** 2 to 5 quantitative, outcome-driven metrics defining **HOW** progress toward the Objective is measured.
39
- - **Criteria:**
40
- - Must measure **Outcomes** (changes in customer behavior, business performance, or operational velocity), **NEVER Activities or Outputs**.
41
- - Must be measurable with a clear baseline and target (e.g., *from X to Y*).
42
- - Verifiable with objective data.
43
-
44
- ---
45
-
46
- ## 3. The OKR vs. Activity Trap
47
-
48
- | Faulty Activity Key Result (Anti-Pattern) | Outcome-Driven Key Result (Golden Standard) |
49
- |---|---|
50
- | ❌ "Build the digital contract execution feature" | ✅ "Increase contract completion rate from 45% to 85%" |
51
- | ❌ "Deploy payment integration with Stripe" | ✅ "Reduce overdue invoice settlements by 40% through self-service digital payments" |
52
- | ❌ "Write 20 user stories for support tickets" | ✅ "Decrease average time-to-first-response on critical incidents from 24h to 2h" |
53
- | ❌ "Send marketing emails to 5,000 customers" | ✅ "Achieve an 80% self-service portal adoption rate within 30 days of registration" |
54
-
55
- ---
56
-
57
- ## 4. OKRs vs. KPIs
58
-
59
- | Dimension | Key Performance Indicators (KPIs) | Objectives & Key Results (OKRs) |
60
- |---|---|---|
61
- | **Role in Business** | Health monitoring ("Dashboard gauges" / "Vital signs"). | Strategic vehicle for change and transformation. |
62
- | **Question Answered** | *"Are our ongoing systems and processes running smoothly?"* | *"What critical breakthrough must we achieve next?"* |
63
- | **Measurement Target** | Maintain within normal operating limits (e.g., 99.9% uptime, latency < 100ms). | Stretch beyond status quo (e.g., expand into 3 new markets, 2x conversion). |
64
- | **Action on Deficit** | Remedial maintenance / incident response. | Strategic pivot, retrospective root cause analysis. |
65
-
66
- ---
67
-
68
- ## 5. Formulating the Product Goal from Strategic OKRs
69
-
70
- In Scrum, the **Product Goal** describes a future state of the product which can serve as a target for the Scrum Team to plan against. The Product Goal is in the Product Backlog. The rest of the Product Backlog emerges to define "what" will fulfill the Product Goal.
71
-
72
- ### Product Goal Formulation Template
73
- > **"For [target user segment], our product will [core capability / transformation], enabling [measurable business outcome], verified by [primary Key Result]."**
74
-
75
- #### Example:
76
- > *"For enterprise operators and self-service customers, our platform will eliminate manual paper-based onboarding and invoice reconciliation by providing an instant, self-service digital portal, verified by achieving an end-to-end customer activation time of under 24 hours with zero manual administrative overhead."*
1
+ # OKR Alignment & Product Goal Formulation Guide
2
+
3
+ > **Core Concept:** Connect high-level business strategy to agile sprint execution using the Objectives and Key Results (OKR) framework (pioneered by Andy Grove at Intel, popularized by John Doerr, and standardized by the OKR Institute).
4
+
5
+ ---
6
+
7
+ ## 1. The Strategic Hierarchy
8
+
9
+ ```
10
+ Company Vision & Strategy
11
+ │
12
+ ▼
13
+ Strategic OKRs (Annual / Quarterly)
14
+ │
15
+ ▼
16
+ Product Goal (Long-Term Commitment per Scrum Guide)
17
+ │
18
+ ▼
19
+ Product Backlog Items (Kano / MoSCoW / RICE ordered)
20
+ │
21
+ ▼
22
+ Sprint Goal (Tactical Incremental Commitment)
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Anatomy of an Effective OKR
28
+
29
+ ### Objective (O)
30
+ - **Definition:** A qualitative, memorable, inspiring, and time-bound statement defining **WHAT** the team wants to achieve.
31
+ - **Criteria:**
32
+ - Aggressive yet realistic (aiming for 70% achievement on stretch goals).
33
+ - Concise and easy for anyone on the team to recite.
34
+ - Concrete and action-oriented.
35
+ - Free from numeric metrics (numbers belong in Key Results).
36
+
37
+ ### Key Results (KRs)
38
+ - **Definition:** 2 to 5 quantitative, outcome-driven metrics defining **HOW** progress toward the Objective is measured.
39
+ - **Criteria:**
40
+ - Must measure **Outcomes** (changes in customer behavior, business performance, or operational velocity), **NEVER Activities or Outputs**.
41
+ - Must be measurable with a clear baseline and target (e.g., *from X to Y*).
42
+ - Verifiable with objective data.
43
+
44
+ ---
45
+
46
+ ## 3. The OKR vs. Activity Trap
47
+
48
+ | Faulty Activity Key Result (Anti-Pattern) | Outcome-Driven Key Result (Golden Standard) |
49
+ |---|---|
50
+ | ❌ "Build the digital contract execution feature" | ✅ "Increase contract completion rate from 45% to 85%" |
51
+ | ❌ "Deploy payment integration with Stripe" | ✅ "Reduce overdue invoice settlements by 40% through self-service digital payments" |
52
+ | ❌ "Write 20 user stories for support tickets" | ✅ "Decrease average time-to-first-response on critical incidents from 24h to 2h" |
53
+ | ❌ "Send marketing emails to 5,000 customers" | ✅ "Achieve an 80% self-service portal adoption rate within 30 days of registration" |
54
+
55
+ ---
56
+
57
+ ## 4. OKRs vs. KPIs
58
+
59
+ | Dimension | Key Performance Indicators (KPIs) | Objectives & Key Results (OKRs) |
60
+ |---|---|---|
61
+ | **Role in Business** | Health monitoring ("Dashboard gauges" / "Vital signs"). | Strategic vehicle for change and transformation. |
62
+ | **Question Answered** | *"Are our ongoing systems and processes running smoothly?"* | *"What critical breakthrough must we achieve next?"* |
63
+ | **Measurement Target** | Maintain within normal operating limits (e.g., 99.9% uptime, latency < 100ms). | Stretch beyond status quo (e.g., expand into 3 new markets, 2x conversion). |
64
+ | **Action on Deficit** | Remedial maintenance / incident response. | Strategic pivot, retrospective root cause analysis. |
65
+
66
+ ---
67
+
68
+ ## 5. Formulating the Product Goal from Strategic OKRs
69
+
70
+ In Scrum, the **Product Goal** describes a future state of the product which can serve as a target for the Scrum Team to plan against. The Product Goal is in the Product Backlog. The rest of the Product Backlog emerges to define "what" will fulfill the Product Goal.
71
+
72
+ ### Product Goal Formulation Template
73
+ > **"For [target user segment], our product will [core capability / transformation], enabling [measurable business outcome], verified by [primary Key Result]."**
74
+
75
+ #### Example:
76
+ > *"For enterprise operators and self-service customers, our platform will eliminate manual paper-based onboarding and invoice reconciliation by providing an instant, self-service digital portal, verified by achieving an end-to-end customer activation time of under 24 hours with zero manual administrative overhead."*
@@ -1,59 +1,59 @@
1
- # SMART Developer Tasks Reference
2
-
3
- > **Core Concept:** While user stories represent customer-facing value (evaluated via the **INVEST** model), engineering execution requires breaking each story down into technical developer tasks. Apply Bill Wake's **SMART** acronym to ensure tasks are clear, bounded, and actionable.
4
-
5
- ---
6
-
7
- ## 1. The SMART Developer Task Framework
8
-
9
- | Letter | Attribute | Description & Quality Standard | Anti-Pattern to Avoid |
10
- |---|---|---|---|
11
- | **S** | **Specific** | The task scope is crystal clear and bounded. Everyone on the team understands exactly what needs to be created or modified. | Vague tasks like *"Fix auth issues"* or *"Refactor backend"*. |
12
- | **M** | **Measurable** | Answers: *"Can we objectively mark it as done?"* Completion requires working behavior, automated tests passing, clean code, and zero lint/type errors. | Tasks marked "done" when code is written but tests are unwritten or failing. |
13
- | **A** | **Achievable** | The developer or pair has the capability, permissions, and tools to complete it. Team norm: anyone can ask for help immediately without stigma. | Assigning a complex cryptographic or database optimization task without necessary context or pairing support. |
14
- | **R** | **Relevant** | The task directly contributes to delivering the parent user story. Every developer task must be justifiable to the customer's value proposition. | Building gold-plated utility libraries, speculative abstractions, or unrequested features. |
15
- | **T** | **Time-Boxed** | The task has an explicit bounded duration expectation (typically 2–4 hours, never exceeding 1 working day). Exceeding the time-box triggers a pause, task splitting, or pairing. | Open-ended tasks that span multiple days without intermediate commits or observable progress. |
16
-
17
- ---
18
-
19
- ## 2. Example: Decomposing an INVEST Story into SMART Tasks
20
-
21
- ### Parent Story: Customer Digital Agreement Execution
22
- - **Story Description:** *As an approved prospective customer, I want to review my agreement terms and digitally execute the contract in the portal, so that my subscription becomes active immediately.*
23
-
24
- ### Decomposed SMART Tasks:
25
-
26
- #### Task 1: Domain Entity Invariants & Digital Signature Value Object
27
- - **Specific:** Add `Signature` value interface to `Agreement` entity; validate signer name presence and actor ID consistency in `Agreement.sign()`.
28
- - **Measurable:** 100% unit test coverage in `agreement_domain.test.ts` testing valid signatures, empty signer name throws, and unauthorized actor rejection.
29
- - **Achievable:** Developer familiar with TypeScript domain models and Vitest.
30
- - **Relevant:** Core business invariant required to make digital execution legally defensible.
31
- - **Time-Boxed:** 2 hours.
32
-
33
- #### Task 2: Persistence Schema Evolution & Repository Implementation
34
- - **Specific:** Add `termsJson` and `signatureJson` to persistence schema; update repository to serialize/deserialize signature JSON.
35
- - **Measurable:** Database schema sync clean; repository integration tests pass; round-trip serialization verified.
36
- - **Achievable:** Standard persistence repository workflow in monorepo.
37
- - **Relevant:** Persists the legal audit trail in the primary database.
38
- - **Time-Boxed:** 2 hours.
39
-
40
- #### Task 3: Use Case State Transition & Async Event Notification
41
- - **Specific:** Add `signAgreement()` to `AgreementUseCase`; enqueue `agreement.signed` on `JobQueuePort`; register event handler in `EventNotificationDispatcher` to send confirmation notification.
42
- - **Measurable:** Integration test verifies confirmation notification delivery to customer upon signing; tests green.
43
- - **Achievable:** Uses existing `JobQueuePort` and notification adapters.
44
- - **Relevant:** Provides transactional transparency to both customer and operator.
45
- - **Time-Boxed:** 3 hours.
46
-
47
- #### Task 4: REST API Endpoint & Error Handling
48
- - **Specific:** Add `POST /api/v1/agreements/:id/sign` route to HTTP controller; validate request body; return RFC 7807 problem details on failure.
49
- - **Measurable:** API acceptance tests pass; covers 200, 400 (validation), 404 (not found).
50
- - **Achievable:** Standard HTTP controller pattern.
51
- - **Relevant:** Exposes digital signing capability to web clients.
52
- - **Time-Boxed:** 2 hours.
53
-
54
- #### Task 5: Consumer Portal UI Integration & Document Download
55
- - **Specific:** Connect `CustomerAgreementPage.tsx` to TanStack `useMutation`; build terms review section, legal acknowledgment checkbox, typed signature modal, and receipt download.
56
- - **Measurable:** Component builds without TypeScript errors; visual smoke test verifies interactive signing workflow.
57
- - **Achievable:** Uses existing design system and UI primitives.
58
- - **Relevant:** Final customer-facing touchpoint closing the satisfaction gap.
59
- - **Time-Boxed:** 3 hours.
1
+ # SMART Developer Tasks Reference
2
+
3
+ > **Core Concept:** While user stories represent customer-facing value (evaluated via the **INVEST** model), engineering execution requires breaking each story down into technical developer tasks. Apply Bill Wake's **SMART** acronym to ensure tasks are clear, bounded, and actionable.
4
+
5
+ ---
6
+
7
+ ## 1. The SMART Developer Task Framework
8
+
9
+ | Letter | Attribute | Description & Quality Standard | Anti-Pattern to Avoid |
10
+ |---|---|---|---|
11
+ | **S** | **Specific** | The task scope is crystal clear and bounded. Everyone on the team understands exactly what needs to be created or modified. | Vague tasks like *"Fix auth issues"* or *"Refactor backend"*. |
12
+ | **M** | **Measurable** | Answers: *"Can we objectively mark it as done?"* Completion requires working behavior, automated tests passing, clean code, and zero lint/type errors. | Tasks marked "done" when code is written but tests are unwritten or failing. |
13
+ | **A** | **Achievable** | The developer or pair has the capability, permissions, and tools to complete it. Team norm: anyone can ask for help immediately without stigma. | Assigning a complex cryptographic or database optimization task without necessary context or pairing support. |
14
+ | **R** | **Relevant** | The task directly contributes to delivering the parent user story. Every developer task must be justifiable to the customer's value proposition. | Building gold-plated utility libraries, speculative abstractions, or unrequested features. |
15
+ | **T** | **Time-Boxed** | The task has an explicit bounded duration expectation (typically 2–4 hours, never exceeding 1 working day). Exceeding the time-box triggers a pause, task splitting, or pairing. | Open-ended tasks that span multiple days without intermediate commits or observable progress. |
16
+
17
+ ---
18
+
19
+ ## 2. Example: Decomposing an INVEST Story into SMART Tasks
20
+
21
+ ### Parent Story: Customer Digital Agreement Execution
22
+ - **Story Description:** *As an approved prospective customer, I want to review my agreement terms and digitally execute the contract in the portal, so that my subscription becomes active immediately.*
23
+
24
+ ### Decomposed SMART Tasks:
25
+
26
+ #### Task 1: Domain Entity Invariants & Digital Signature Value Object
27
+ - **Specific:** Add `Signature` value interface to `Agreement` entity; validate signer name presence and actor ID consistency in `Agreement.sign()`.
28
+ - **Measurable:** 100% unit test coverage in `agreement_domain.test.ts` testing valid signatures, empty signer name throws, and unauthorized actor rejection.
29
+ - **Achievable:** Developer familiar with TypeScript domain models and Vitest.
30
+ - **Relevant:** Core business invariant required to make digital execution legally defensible.
31
+ - **Time-Boxed:** 2 hours.
32
+
33
+ #### Task 2: Persistence Schema Evolution & Repository Implementation
34
+ - **Specific:** Add `termsJson` and `signatureJson` to persistence schema; update repository to serialize/deserialize signature JSON.
35
+ - **Measurable:** Database schema sync clean; repository integration tests pass; round-trip serialization verified.
36
+ - **Achievable:** Standard persistence repository workflow in monorepo.
37
+ - **Relevant:** Persists the legal audit trail in the primary database.
38
+ - **Time-Boxed:** 2 hours.
39
+
40
+ #### Task 3: Use Case State Transition & Async Event Notification
41
+ - **Specific:** Add `signAgreement()` to `AgreementUseCase`; enqueue `agreement.signed` on `JobQueuePort`; register event handler in `EventNotificationDispatcher` to send confirmation notification.
42
+ - **Measurable:** Integration test verifies confirmation notification delivery to customer upon signing; tests green.
43
+ - **Achievable:** Uses existing `JobQueuePort` and notification adapters.
44
+ - **Relevant:** Provides transactional transparency to both customer and operator.
45
+ - **Time-Boxed:** 3 hours.
46
+
47
+ #### Task 4: REST API Endpoint & Error Handling
48
+ - **Specific:** Add `POST /api/v1/agreements/:id/sign` route to HTTP controller; validate request body; return RFC 7807 problem details on failure.
49
+ - **Measurable:** API acceptance tests pass; covers 200, 400 (validation), 404 (not found).
50
+ - **Achievable:** Standard HTTP controller pattern.
51
+ - **Relevant:** Exposes digital signing capability to web clients.
52
+ - **Time-Boxed:** 2 hours.
53
+
54
+ #### Task 5: Consumer Portal UI Integration & Document Download
55
+ - **Specific:** Connect `CustomerAgreementPage.tsx` to TanStack `useMutation`; build terms review section, legal acknowledgment checkbox, typed signature modal, and receipt download.
56
+ - **Measurable:** Component builds without TypeScript errors; visual smoke test verifies interactive signing workflow.
57
+ - **Achievable:** Uses existing design system and UI primitives.
58
+ - **Relevant:** Final customer-facing touchpoint closing the satisfaction gap.
59
+ - **Time-Boxed:** 3 hours.
@@ -1,128 +1,128 @@
1
- ---
2
- name: relentless-questioner
3
- description: Use when initiating a new feature, complex user story, architectural mutation, or ambiguous task to execute a context-aware relentless questioning loop that dynamically adapts subsequent questions based on user answers before planning or coding. Do not use for routine bug fixes with obvious solutions, minor typo corrections, or running tests.
4
- ---
5
-
6
- # Relentless Questioner: Context-Aware Dynamic Interrogation Skill
7
-
8
- > **Core Purpose:** Eliminate ambiguity, hidden assumptions, and premature coding by executing an interactive, context-aware interrogation loop where every subsequent question directly adapts to the user's previous answers, producing an unambiguous Feature Alignment Specification (FAS) before implementation begins.
9
-
10
- ---
11
-
12
- ## 1. When to Use This Skill
13
-
14
- - When starting any non-trivial feature, API endpoint, or database modification.
15
- - When user requirements are high-level, ambiguous, or open-ended (e.g. *"add webhook support"*, *"create billing integration"*, *"allow users to export reports"*).
16
- - When a task involves conflicting architectural trade-offs (consistency vs latency, synchronous vs asynchronous).
17
- - When explicitly triggered via slash command `/grill-me`, `/interrogate`, or `/relentless-questioning`.
18
- - **Do NOT use for**:
19
- - Routine typo fixes, dependency version bumps, or minor formatting changes.
20
- - Trivial bugs where the defect, root cause, and fix are already verified and obvious.
21
- - Routine test execution or build script maintenance.
22
-
23
- ---
24
-
25
- ## 2. Step-by-Step Execution Workflow
26
-
27
- ```
28
- 1. CLASSIFY (Detect Archetype) ──► 2. ADAPTIVE DRILL-DOWN (Chained Questions) ──► 3. RECONCILE (Rule Invariants) ──► 4. CONVERGE (Signed-Off FAS)
29
- ```
30
-
31
- ---
32
-
33
- ### Phase 1: Intent & Technical Archetype Classification
34
- Upon receiving a user task or feature prompt, classify the functional archetype into one or more categories using [references/adaptive_question_trees.md](./references/adaptive_question_trees.md):
35
- - **Archetype A: State Mutations & Financials** (balances, orders, payments, inventories)
36
- - **Archetype B: Multi-Tenancy & Authorization** (tenant boundaries, custom fields, permissions)
37
- - **Archetype C: Asynchronous & Event Streaming** (background jobs, webhooks, queues, pub/sub)
38
- - **Archetype D: 3rd-Party & External Integrations** (external APIs, payment gateways, mailers)
39
- - **Archetype E: Read Performance & Search** (dashboards, aggregations, high-scale read traffic)
40
- - **Archetype F: User Interface, Experience Duality & Interaction Flows** (personas, app shell, screen journeys, URL synchronization, WCAG accessibility per [`ui_ux_architecture.md`](../../../docs/rules/ui_ux_architecture.md) and [`frontend_architecture.md`](../../../docs/rules/frontend_architecture.md))
41
-
42
- ---
43
-
44
- ### Phase 2: Context-Aware Dynamic Interrogation
45
- Do NOT dump a massive 20-question static checklist. Execute the interview in **dynamic batches of 2–3 questions**:
46
-
47
- 1. **Initial Archetype Branch**: Ask the foundational branching questions for the detected archetype.
48
- 2. **Contextual Chaining (The Adaptive Rule)**:
49
- - Carefully parse the user's response.
50
- - **Every subsequent question MUST build on the previous answer**:
51
- `"Because you specified [Choice A], how should we handle [Specific Consequence / Failure Mode B]?"`
52
- - If the user selects a synchronous API integration, branch into timeouts and circuit breakers; do NOT ask about background queue retries.
53
- - If the user selects an asynchronous queue, branch into at-least-once delivery, idempotency, and dead-letter queues.
54
- 3. **Negative Scope Interrogation**:
55
- - Always ask: *"What is explicitly OUT OF SCOPE for this initial increment (Non-Goals)?"*
56
- 4. **Error Matrix Interrogation**:
57
- - Always ask: *"What are the expected client and server error states and corresponding status codes?"*
58
-
59
- ---
60
-
61
- ### Phase 3: Architectural Friction & Rule Reconciliation
62
- Check the user's proposed answers against the **28 Cohesive Domain Rules** in `docs/rules/`:
63
- - 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)).
64
- - 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)).
65
- - 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)).
66
- - If the user proposes a fullstack feature but ignores user workflows or screens ➔ **Flag the Anemic Core anti-pattern** and mandate Outside-In interaction discovery ([`frontend_architecture.md`](../../../docs/rules/frontend_architecture.md)).
67
- - If the user proposes ad-hoc modal alerts or unstructured page navigation ➔ **Flag UX debt** and enforce the 7-Pillar Design Architecture Triage Gate ([`ui_ux_architecture.md`](../../../docs/rules/ui_ux_architecture.md)).
68
- - Reconcile the conflict collaboratively before proceeding.
69
-
70
- ---
71
-
72
- ### Phase 4: Convergence & Feature Alignment Specification (FAS)
73
- Synthesize the answers into an unambiguous **Feature Alignment Specification (FAS)** using the template in Section 4.
74
- **STOP AND ASK FOR CONFIRMATION**: Present the FAS to the user and obtain explicit sign-off before writing any production code or plans.
75
-
76
- ---
77
-
78
- ## 3. Gotchas & What NOT to Do
79
-
80
- - **DO NOT** use static checklists that ignore user responses. Every question turn must reflect the user's prior answers.
81
- - **DO NOT** ask 10+ questions at once. Keep batches small (2–3 questions) to maintain a collaborative conversation.
82
- - **DO NOT** start coding or planning in parallel while the interrogation is in progress.
83
- - **DO NOT** let the user bypass critical failure branches (e.g. *"we'll handle errors later"*). Insist on defining failure states.
84
- - **DO NOT** compromise on the 28 cohesive domain rules. If a user request introduces an architectural violation, surface it immediately.
85
-
86
- ---
87
-
88
- ## 4. Structured Output Templates
89
-
90
- ### Feature Alignment Specification (FAS) Template
91
- ```markdown
92
- # Feature Alignment Specification (FAS): [Feature Name]
93
-
94
- ## 1. Domain Purpose & Value
95
- - **User Story:** As a [role], I want [capability], so that [benefit].
96
- - **Core Invariant:** [Immutable business rule that must never be violated].
97
-
98
- ## 2. Technical Decisions & Boundaries
99
- - **Interaction Archetype:** [Mutating / Read-Only / Async Event / 3rd-Party]
100
- - **Tenant Isolation Model:** [AST Interceptor / DB RLS / Schema / Instance]
101
- - **Transaction Boundary:** [Isolation level, timeouts, Outbox requirements]
102
- - **Port/Adapter Boundary:** [Project-owned interface for any external dependency]
103
-
104
- ## 3. Negative Scope (Non-Goals)
105
- - [Explicitly excluded feature 1]
106
- - [Explicitly excluded feature 2]
107
-
108
- ## 4. Error & Edge Case Matrix
109
- | Scenario | Error Code | HTTP / RPC Status | Recovery Action |
110
- |---|---|---|---|
111
- | [Scenario 1] | `RESOURCE_CONFLICT` | 409 Conflict | Return latest version |
112
- | [Scenario 2] | `TENANT_NOT_FOUND` | 404 Not Found | Terminate request |
113
-
114
- ## 5. Verification & Acceptance Criteria
115
- - **Outside-In Acceptance Scenario (Gherkin):**
116
- ```gherkin
117
- Scenario: [Name]
118
- Given [Precondition]
119
- When [Action]
120
- Then [Observable Outcome]
121
- ```
122
- - **Test Strategy:** [Contract / Integration / Unit tests required for 100% coverage]
123
- ```
124
-
125
- ---
126
-
127
- ## 5. Subdirectories & Progressive Resources
128
- - [references/adaptive_question_trees.md](./references/adaptive_question_trees.md): Contextual branching trees for state mutations, multi-tenancy, integrations, and caching.
1
+ ---
2
+ name: relentless-questioner
3
+ description: Use when initiating a new feature, complex user story, architectural mutation, or ambiguous task to execute a context-aware relentless questioning loop that dynamically adapts subsequent questions based on user answers before planning or coding. Do not use for routine bug fixes with obvious solutions, minor typo corrections, or running tests.
4
+ ---
5
+
6
+ # Relentless Questioner: Context-Aware Dynamic Interrogation Skill
7
+
8
+ > **Core Purpose:** Eliminate ambiguity, hidden assumptions, and premature coding by executing an interactive, context-aware interrogation loop where every subsequent question directly adapts to the user's previous answers, producing an unambiguous Feature Alignment Specification (FAS) before implementation begins.
9
+
10
+ ---
11
+
12
+ ## 1. When to Use This Skill
13
+
14
+ - When starting any non-trivial feature, API endpoint, or database modification.
15
+ - When user requirements are high-level, ambiguous, or open-ended (e.g. *"add webhook support"*, *"create billing integration"*, *"allow users to export reports"*).
16
+ - When a task involves conflicting architectural trade-offs (consistency vs latency, synchronous vs asynchronous).
17
+ - When explicitly triggered via slash command `/grill-me`, `/interrogate`, or `/relentless-questioning`.
18
+ - **Do NOT use for**:
19
+ - Routine typo fixes, dependency version bumps, or minor formatting changes.
20
+ - Trivial bugs where the defect, root cause, and fix are already verified and obvious.
21
+ - Routine test execution or build script maintenance.
22
+
23
+ ---
24
+
25
+ ## 2. Step-by-Step Execution Workflow
26
+
27
+ ```
28
+ 1. CLASSIFY (Detect Archetype) ──► 2. ADAPTIVE DRILL-DOWN (Chained Questions) ──► 3. RECONCILE (Rule Invariants) ──► 4. CONVERGE (Signed-Off FAS)
29
+ ```
30
+
31
+ ---
32
+
33
+ ### Phase 1: Intent & Technical Archetype Classification
34
+ Upon receiving a user task or feature prompt, classify the functional archetype into one or more categories using [references/adaptive_question_trees.md](./references/adaptive_question_trees.md):
35
+ - **Archetype A: State Mutations & Financials** (balances, orders, payments, inventories)
36
+ - **Archetype B: Multi-Tenancy & Authorization** (tenant boundaries, custom fields, permissions)
37
+ - **Archetype C: Asynchronous & Event Streaming** (background jobs, webhooks, queues, pub/sub)
38
+ - **Archetype D: 3rd-Party & External Integrations** (external APIs, payment gateways, mailers)
39
+ - **Archetype E: Read Performance & Search** (dashboards, aggregations, high-scale read traffic)
40
+ - **Archetype F: User Interface, Experience Duality & Interaction Flows** (personas, app shell, screen journeys, URL synchronization, WCAG accessibility per [`ui_ux_architecture.md`](../../../docs/rules/ui_ux_architecture.md) and [`frontend_architecture.md`](../../../docs/rules/frontend_architecture.md))
41
+
42
+ ---
43
+
44
+ ### Phase 2: Context-Aware Dynamic Interrogation
45
+ Do NOT dump a massive 20-question static checklist. Execute the interview in **dynamic batches of 2–3 questions**:
46
+
47
+ 1. **Initial Archetype Branch**: Ask the foundational branching questions for the detected archetype.
48
+ 2. **Contextual Chaining (The Adaptive Rule)**:
49
+ - Carefully parse the user's response.
50
+ - **Every subsequent question MUST build on the previous answer**:
51
+ `"Because you specified [Choice A], how should we handle [Specific Consequence / Failure Mode B]?"`
52
+ - If the user selects a synchronous API integration, branch into timeouts and circuit breakers; do NOT ask about background queue retries.
53
+ - If the user selects an asynchronous queue, branch into at-least-once delivery, idempotency, and dead-letter queues.
54
+ 3. **Negative Scope Interrogation**:
55
+ - Always ask: *"What is explicitly OUT OF SCOPE for this initial increment (Non-Goals)?"*
56
+ 4. **Error Matrix Interrogation**:
57
+ - Always ask: *"What are the expected client and server error states and corresponding status codes?"*
58
+
59
+ ---
60
+
61
+ ### Phase 3: Architectural Friction & Rule Reconciliation
62
+ Check the user's proposed answers against the **cohesive domain rules** in `docs/rules/`:
63
+ - 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)).
64
+ - 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)).
65
+ - 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)).
66
+ - If the user proposes a fullstack feature but ignores user workflows or screens ➔ **Flag the Anemic Core anti-pattern** and mandate Outside-In interaction discovery ([`frontend_architecture.md`](../../../docs/rules/frontend_architecture.md)).
67
+ - If the user proposes ad-hoc modal alerts or unstructured page navigation ➔ **Flag UX debt** and enforce the 7-Pillar Design Architecture Triage Gate ([`ui_ux_architecture.md`](../../../docs/rules/ui_ux_architecture.md)).
68
+ - Reconcile the conflict collaboratively before proceeding.
69
+
70
+ ---
71
+
72
+ ### Phase 4: Convergence & Feature Alignment Specification (FAS)
73
+ Synthesize the answers into an unambiguous **Feature Alignment Specification (FAS)** using the template in Section 4.
74
+ **STOP AND ASK FOR CONFIRMATION**: Present the FAS to the user and obtain explicit sign-off before writing any production code or plans.
75
+
76
+ ---
77
+
78
+ ## 3. Gotchas & What NOT to Do
79
+
80
+ - **DO NOT** use static checklists that ignore user responses. Every question turn must reflect the user's prior answers.
81
+ - **DO NOT** ask 10+ questions at once. Keep batches small (2–3 questions) to maintain a collaborative conversation.
82
+ - **DO NOT** start coding or planning in parallel while the interrogation is in progress.
83
+ - **DO NOT** let the user bypass critical failure branches (e.g. *"we'll handle errors later"*). Insist on defining failure states.
84
+ - **DO NOT** compromise on the cohesive domain rules. If a user request introduces an architectural violation, surface it immediately.
85
+
86
+ ---
87
+
88
+ ## 4. Structured Output Templates
89
+
90
+ ### Feature Alignment Specification (FAS) Template
91
+ ```markdown
92
+ # Feature Alignment Specification (FAS): [Feature Name]
93
+
94
+ ## 1. Domain Purpose & Value
95
+ - **User Story:** As a [role], I want [capability], so that [benefit].
96
+ - **Core Invariant:** [Immutable business rule that must never be violated].
97
+
98
+ ## 2. Technical Decisions & Boundaries
99
+ - **Interaction Archetype:** [Mutating / Read-Only / Async Event / 3rd-Party]
100
+ - **Tenant Isolation Model:** [AST Interceptor / DB RLS / Schema / Instance]
101
+ - **Transaction Boundary:** [Isolation level, timeouts, Outbox requirements]
102
+ - **Port/Adapter Boundary:** [Project-owned interface for any external dependency]
103
+
104
+ ## 3. Negative Scope (Non-Goals)
105
+ - [Explicitly excluded feature 1]
106
+ - [Explicitly excluded feature 2]
107
+
108
+ ## 4. Error & Edge Case Matrix
109
+ | Scenario | Error Code | HTTP / RPC Status | Recovery Action |
110
+ |---|---|---|---|
111
+ | [Scenario 1] | `RESOURCE_CONFLICT` | 409 Conflict | Return latest version |
112
+ | [Scenario 2] | `TENANT_NOT_FOUND` | 404 Not Found | Terminate request |
113
+
114
+ ## 5. Verification & Acceptance Criteria
115
+ - **Outside-In Acceptance Scenario (Gherkin):**
116
+ ```gherkin
117
+ Scenario: [Name]
118
+ Given [Precondition]
119
+ When [Action]
120
+ Then [Observable Outcome]
121
+ ```
122
+ - **Test Strategy:** [Contract / Integration / Unit tests required for 100% coverage]
123
+ ```
124
+
125
+ ---
126
+
127
+ ## 5. Subdirectories & Progressive Resources
128
+ - [references/adaptive_question_trees.md](./references/adaptive_question_trees.md): Contextual branching trees for state mutations, multi-tenancy, integrations, and caching.