@haposoft/cafekit 0.7.16 → 0.7.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haposoft/cafekit",
3
- "version": "0.7.16",
3
+ "version": "0.7.17",
4
4
  "description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first workflows plus Claude Code hapo: skills.",
5
5
  "author": "Haposoft <nghialt@haposoft.com>",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- # AI Agent Directives
1
+ # CLAUDE.md
2
2
 
3
3
  This document serves as the primary configuration and instruction manual for Claude Code cli (or any AI agent) operating within this codebase.
4
4
 
@@ -93,10 +93,14 @@ flowchart TD
93
93
  E -->|No| F["Ask user 1-2 clarifying questions"]
94
94
  F --> D
95
95
  E -->|Yes| G["Step 2: Scan specs/ for related specs"]
96
- G --> H["Step 3: Assess complexity"]
97
- H --> I{Need scope inquiry?}
98
- I -->|Yes| J["Ask 3 Scope questions user picks level"]
99
- I -->|No| K["Keep default scope"]
96
+ G --> H["Step 3: 5-Dimension Assessment"]
97
+ H --> H1{Risk level?}
98
+ H1 -->|Chaotic| HX["Exitredirect to hapo:hotfix"]
99
+ H1 -->|Complex| H2["Include spike/prototype tasks"]
100
+ H1 -->|Clear/Complicated| H3{Need scope inquiry?}
101
+ H2 --> H3
102
+ H3 -->|Yes| J["Present 5D summary → user picks Expand/Hold/Reduce"]
103
+ H3 -->|No| K["Keep default scope"]
100
104
  J --> L["Step 4: Init — create specs/<feature>/"]
101
105
  K --> L
102
106
  L --> M["Step 5: Requirements — write EARS"]
@@ -140,9 +144,11 @@ Load: `references/cross-spec-dependency.md`
140
144
 
141
145
  ### Step 3: Complexity Assessment & Scope Inquiry
142
146
  Load: `references/scope-inquiry.md`
143
- - Apply when task complexity is medium or higher
144
- - Ask 3 questions: What exists already? What's the minimum change? How complex?
145
- - User picks: Expand / Hold / Reduce
147
+ - Evaluate the request across **5 dimensions**: Semantic Intent, Implementation Hypothesis, Gap Sizing, Risk/Uncertainty (Cynefin), and Blast Radius
148
+ - If Risk = **Chaotic** exit spec workflow, redirect to `hapo:hotfix`
149
+ - If Risk = **Complex** include spike/prototype tasks in the spec
150
+ - If Blast Radius = **Critical Path** → spec MUST include rollback strategy and test coverage requirements
151
+ - User picks scope level: Expand / Hold / Reduce
146
152
  - **Skip if:** trivial task (< 20 words, 1 file, user says "just do it")
147
153
 
148
154
  ### Step 4: Init
@@ -11,22 +11,42 @@ Skip Scope Inquiry when:
11
11
  - Description is under 20 words and unambiguous
12
12
  - User signals urgency ("just do it", "quick", etc.)
13
13
 
14
- ## 3 Core Questions
14
+ ## 5-Dimension Complexity Assessment
15
15
 
16
- ### 1. What already exists?
17
- - Scan codebase for reusable code/patterns
18
- - Check existing utilities, services, patterns
19
- - Warn if spec would rebuild something that already exists
16
+ Evaluate complexity across **5 dimensions** to avoid blind spots. A task may be architecturally small but extremely risky, or seemingly simple but with a huge blast radius.
20
17
 
21
- ### 2. What's the minimum change?
22
- - Identify work that can be deferred without affecting the main goal
23
- - Detect scope creep: nice-to-haves disguised as requirements
24
- - Ruthlessly separate essential from aspirational
18
+ ### Dimension 1: Semantic Intent & Current State
19
+ - What is the core business or technical meaning of the request?
20
+ - How does the system currently behave in this area? What existing patterns, services, or infrastructure can be leveraged?
21
+ - Would this spec rebuild something that already exists? If yes, warn before proceeding.
25
22
 
26
- ### 3. How complex is this?
27
- - If spec affects **> 8 files**: challenge whether fewer files are possible
28
- - If spec adds **> 2 new classes/services**: demand justification for each
29
- - If spec needs **> 3 major tasks**: explore consolidation
23
+ ### Dimension 2: High-Level Implementation Hypothesis
24
+ - Conceptually, how must the architecture adapt to fulfill the semantic intent?
25
+ - Hypothesize the structural impact: Does this require new database models, API contracts, third-party integrations, or is it strictly localized logic/UI changes?
26
+
27
+ ### Dimension 3: Gap Analysis & Sizing
28
+ Evaluate the gap between Current State and Hypothesis:
29
+ - **Small**: No architectural changes. Extending existing patterns, adding UI components, or patching localized logic.
30
+ - **Medium**: Modifying data flows, adding new API endpoints, or bridging two previously unconnected modules.
31
+ - **Large**: New persistence models, security/auth changes, cross-system migrations, or touching core system foundations.
32
+ - **Scope check**: Separate aspirational goals (nice-to-haves) from what is strictly necessary to bridge the core gap.
33
+
34
+ ### Dimension 4: Risk & Uncertainty (Cynefin-inspired)
35
+ Classify the *knowability* of the solution path:
36
+ - **Clear**: Well-understood problem with established patterns and documentation (e.g., CRUD endpoints, standard auth flows). Proceed with confidence.
37
+ - **Complicated**: Solution exists but requires expert analysis or research (e.g., payment gateway integration, complex query optimization). Plan carefully, may need `researcher` subagent.
38
+ - **Complex**: Outcome is uncertain; solution emerges through experimentation (e.g., AI/ML tuning, novel UX interactions, performance bottleneck with unknown root cause). Requires prototyping or spike tasks before committing to a full spec.
39
+ - **Chaotic**: No clear path; urgent stabilization needed first (e.g., production outage, data corruption). Skip spec workflow entirely — use `hapo:hotfix` instead.
40
+
41
+ > **Rule**: If Dimension 4 = Complex or Chaotic, flag this to the user immediately. Complex tasks should include explicit spike/prototype tasks in the spec. Chaotic tasks should exit the spec workflow.
42
+
43
+ ### Dimension 5: Dependency & Blast Radius
44
+ Assess how many other parts of the system are affected if this change breaks or behaves unexpectedly:
45
+ - **Isolated**: Change is self-contained within a single module or feature. No shared interfaces touched.
46
+ - **Moderate**: Change touches shared utilities, common components, or API contracts consumed by 2-3 other modules.
47
+ - **Critical Path**: Change affects core infrastructure (auth, data layer, routing, state management) or shared libraries used system-wide. A bug here cascades everywhere.
48
+
49
+ > **Rule**: If Blast Radius = Critical Path, the spec MUST include rollback strategy and explicit test coverage requirements in the task files.
30
50
 
31
51
  ## Level Selection
32
52
 
@@ -52,8 +72,11 @@ After answering the 3 questions, present via `AskUserQuestion`:
52
72
 
53
73
  ```
54
74
  Scope Inquiry:
55
- - Existing code: [list reusable code/patterns]
56
- - Minimum change: [list essential vs deferrable]
57
- - Complexity: [estimate files, new abstractions, major tasks]
75
+ - Semantic Intent: [Core meaning of request]
76
+ - Hypothesis: [High-level architectural adaptation needed]
77
+ - Gap Size: [Small/Medium/Large] [reason]
78
+ - Risk Level: [Clear/Complicated/Complex/Chaotic] — [reason]
79
+ - Blast Radius: [Isolated/Moderate/Critical Path] — [affected modules]
80
+ - Minimum Change: [Essential gap vs Niceties]
58
81
  - User chose: [Expand / Hold / Reduce]
59
82
  ```