shapeup-sdlc 1.6.2

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 (135) hide show
  1. package/.claude/settings.local.example.json +20 -0
  2. package/.claude-plugin/marketplace.json +16 -0
  3. package/.claude-plugin/plugin.json +18 -0
  4. package/.env.shapeup.example +14 -0
  5. package/AGENTS.md +133 -0
  6. package/LICENSE +21 -0
  7. package/README.md +362 -0
  8. package/SECURITY.md +72 -0
  9. package/bin/init.mjs +329 -0
  10. package/commands/build.md +14 -0
  11. package/commands/eval.md +15 -0
  12. package/commands/hammer.md +12 -0
  13. package/commands/orient.md +11 -0
  14. package/commands/qa.md +12 -0
  15. package/commands/retro.md +13 -0
  16. package/commands/scopes.md +14 -0
  17. package/commands/shape.md +12 -0
  18. package/commands/ship.md +53 -0
  19. package/commands/wire.md +11 -0
  20. package/hooks/anti-rationalization.mjs +244 -0
  21. package/hooks/compact-snapshot.mjs +47 -0
  22. package/hooks/gate-deadline.mjs +151 -0
  23. package/hooks/gate-intake.mjs +110 -0
  24. package/hooks/gate-l2.mjs +161 -0
  25. package/hooks/gate-zerowork.mjs +264 -0
  26. package/hooks/hooks.json +118 -0
  27. package/hooks/lib/decision.mjs +183 -0
  28. package/hooks/safety-spine.mjs +296 -0
  29. package/hooks/sandbox-guard.mjs +172 -0
  30. package/hooks/session-rehydrate.mjs +109 -0
  31. package/hooks/slop-cleaner.mjs +176 -0
  32. package/oracles/_shared.mjs +46 -0
  33. package/oracles/http-oracle.mjs +155 -0
  34. package/oracles/index.mjs +36 -0
  35. package/oracles/process-oracle.mjs +146 -0
  36. package/oracles/snapshot-oracle.mjs +119 -0
  37. package/oracles/test-oracle.mjs +138 -0
  38. package/package.json +49 -0
  39. package/skills/advisor-protocol/SKILL.md +171 -0
  40. package/skills/ba-pitch-analyzer/SKILL.md +175 -0
  41. package/skills/ba-pitch-analyzer/assets/templates/_index.tmpl.md +84 -0
  42. package/skills/ba-pitch-analyzer/assets/templates/api-feasibility.tmpl.md +65 -0
  43. package/skills/ba-pitch-analyzer/assets/templates/assess-report.tmpl.md +127 -0
  44. package/skills/ba-pitch-analyzer/assets/templates/contracts/be-service.contract.tmpl.md +62 -0
  45. package/skills/ba-pitch-analyzer/assets/templates/contracts/offline-storage.contract.tmpl.md +92 -0
  46. package/skills/ba-pitch-analyzer/assets/templates/contracts/third-party-api.contract.tmpl.md +66 -0
  47. package/skills/ba-pitch-analyzer/assets/templates/cross-context/context-map.tmpl.md +64 -0
  48. package/skills/ba-pitch-analyzer/assets/templates/cross-context/event-choreography.tmpl.md +77 -0
  49. package/skills/ba-pitch-analyzer/assets/templates/cross-context/migration-plan.tmpl.md +104 -0
  50. package/skills/ba-pitch-analyzer/assets/templates/cross-context/team-handoff.tmpl.md +79 -0
  51. package/skills/ba-pitch-analyzer/assets/templates/domain-model.tmpl.md +79 -0
  52. package/skills/ba-pitch-analyzer/assets/templates/feedback.tmpl.md +87 -0
  53. package/skills/ba-pitch-analyzer/assets/templates/integration.tmpl.md +64 -0
  54. package/skills/ba-pitch-analyzer/assets/templates/run-state.tmpl.md +77 -0
  55. package/skills/ba-pitch-analyzer/assets/templates/scope-summary.tmpl.md +105 -0
  56. package/skills/ba-pitch-analyzer/assets/templates/synthesis.tmpl.md +215 -0
  57. package/skills/ba-pitch-analyzer/assets/templates/task-board.tmpl.md +35 -0
  58. package/skills/ba-pitch-analyzer/assets/templates/task-spike.tmpl.md +86 -0
  59. package/skills/ba-pitch-analyzer/assets/templates/task.tmpl.md +84 -0
  60. package/skills/ba-pitch-analyzer/assets/templates/usecase.tmpl.md +105 -0
  61. package/skills/ba-pitch-analyzer/assets/templates/ux-behavior.tmpl.md +65 -0
  62. package/skills/ba-pitch-analyzer/references/contract-patterns.md +152 -0
  63. package/skills/ba-pitch-analyzer/references/ddd-patterns.md +173 -0
  64. package/skills/ba-pitch-analyzer/references/doc-schemas.md +275 -0
  65. package/skills/ba-pitch-analyzer/references/integration-analysis.md +152 -0
  66. package/skills/ba-pitch-analyzer/references/task-generation.md +623 -0
  67. package/skills/ba-pitch-analyzer/references/test-surface.md +102 -0
  68. package/skills/ba-pitch-analyzer/references/ux-behavior-patterns.md +269 -0
  69. package/skills/ba-pitch-analyzer/scripts/board-derive.mjs +241 -0
  70. package/skills/ba-pitch-analyzer/scripts/spec-lint.mjs +239 -0
  71. package/skills/coach/SKILL.md +202 -0
  72. package/skills/orient/SKILL.md +262 -0
  73. package/skills/qa-edge-hunter/SKILL.md +369 -0
  74. package/skills/scope-architect/SKILL.md +111 -0
  75. package/skills/scope-hammer/SKILL.md +186 -0
  76. package/skills/shapeup/SKILL.md +403 -0
  77. package/skills/shapeup/resources/breadboard-reflection.md +88 -0
  78. package/skills/shapeup/resources/breadboarding.md +334 -0
  79. package/skills/shapeup/resources/context-compaction.md +240 -0
  80. package/skills/shapeup/resources/framing-doc.md +92 -0
  81. package/skills/shapeup/resources/kickoff-doc.md +95 -0
  82. package/skills/shapeup/resources/shaping.md +194 -0
  83. package/skills/shapeup/resources/spike.md +86 -0
  84. package/skills/solution-architect/SKILL.md +129 -0
  85. package/skills/spec-evaluator/README.md +93 -0
  86. package/skills/spec-evaluator/SKILL.md +213 -0
  87. package/skills/spec-evaluator/references/anti-leniency.md +50 -0
  88. package/skills/spec-evaluator/references/dimension-contract.md +126 -0
  89. package/skills/spec-evaluator/references/dimensions/_registry.md +40 -0
  90. package/skills/spec-evaluator/references/dimensions/completeness.md +102 -0
  91. package/skills/spec-evaluator/references/dimensions/integration.md +129 -0
  92. package/skills/spec-evaluator/references/dimensions/performance.md +48 -0
  93. package/skills/spec-evaluator/references/dimensions/security.md +60 -0
  94. package/skills/spec-evaluator/references/dimensions/spec-conformance.md +134 -0
  95. package/skills/spec-evaluator/references/dimensions/tdd-surface.md +110 -0
  96. package/skills/spec-evaluator/references/dimensions/test-surface-conformance.md +100 -0
  97. package/skills/spec-evaluator/references/probing.md +177 -0
  98. package/skills/spec-evaluator/references/report-schema.md +101 -0
  99. package/skills/spec-evaluator/references/verdict-ledger.md +92 -0
  100. package/skills/spec-evaluator/scripts/verdict-ledger.mjs +166 -0
  101. package/skills/task-executor/SKILL.md +194 -0
  102. package/skills/tech-lead/README.md +71 -0
  103. package/skills/tech-lead/SKILL.md +459 -0
  104. package/skills/tech-lead/references/delegation.md +254 -0
  105. package/skills/tech-lead/references/gates.md +379 -0
  106. package/skills/tech-lead/references/invocation.md +45 -0
  107. package/skills/tech-lead/references/ledger-schema.md +214 -0
  108. package/skills/tech-lead/references/round-protocol.md +184 -0
  109. package/skills/tech-lead/references/state-model.md +66 -0
  110. package/skills/tech-lead/references/tiny-lane.md +52 -0
  111. package/skills/tech-lead/schemas/domain.schema.json +2294 -0
  112. package/skills/tech-lead/schemas/gate-answers.schema.json +92 -0
  113. package/skills/tech-lead/schemas/work-order.schema.json +21 -0
  114. package/skills/tech-lead/schemas/work-result.schema.json +40 -0
  115. package/skills/tech-lead/scripts/aegis-digest.mjs +124 -0
  116. package/skills/tech-lead/scripts/budget-check.mjs +156 -0
  117. package/skills/tech-lead/scripts/compile-order.mjs +518 -0
  118. package/skills/tech-lead/scripts/fit-check.mjs +196 -0
  119. package/skills/tech-lead/scripts/gate-answers.mjs +338 -0
  120. package/skills/tech-lead/scripts/ingest-result.mjs +270 -0
  121. package/skills/tech-lead/scripts/init-run.mjs +326 -0
  122. package/skills/tech-lead/scripts/lib/argv.mjs +224 -0
  123. package/skills/tech-lead/scripts/lib/contract-md.mjs +481 -0
  124. package/skills/tech-lead/scripts/lib/is-main.mjs +82 -0
  125. package/skills/tech-lead/scripts/lib/paths.mjs +278 -0
  126. package/skills/tech-lead/scripts/lib/ratchet-tree.mjs +112 -0
  127. package/skills/tech-lead/scripts/run-snapshot.mjs +269 -0
  128. package/skills/tech-lead/scripts/ship-report.mjs +275 -0
  129. package/skills/tech-lead/scripts/stats.mjs +423 -0
  130. package/skills/tech-lead/scripts/t0-verify.mjs +470 -0
  131. package/skills/tech-lead/scripts/trace-lint.mjs +367 -0
  132. package/skills/tech-lead/scripts/validate-envelope.mjs +283 -0
  133. package/skills/translator/README.md +66 -0
  134. package/skills/translator/SKILL.md +258 -0
  135. package/skills/translator/references/preservation-rules.md +102 -0
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: pitch
3
+ feature: FEATURE_SLUG
4
+ appetite: "X weeks"
5
+ status: draft
6
+ bounded_context: CONTEXT
7
+ entities: []
8
+ tags: []
9
+ skill_version: "2.5"
10
+ audit_rules_version: "2.5"
11
+ ---
12
+
13
+ # Pitch: FEATURE TITLE
14
+
15
+ ## Problem
16
+ <!-- 2-3 sentences: what user pain or opportunity drives this feature -->
17
+
18
+ ## Appetite
19
+ **X weeks** — if scope grows beyond this, cut features, do not extend timeline.
20
+
21
+ ## Boundaries
22
+
23
+ ### In Scope
24
+ - ...
25
+
26
+ ### Non-Go
27
+ - ...
28
+
29
+ ## Solution Elements
30
+
31
+ ### Breadboarding
32
+ <!-- Text-based flow showing the key interaction path, no images needed -->
33
+ ```
34
+ [Screen A] ──action──► [Screen B] ──action──► [Outcome]
35
+
36
+ context/data
37
+ ```
38
+
39
+ ### Key Interactions
40
+ <!-- Fat marker level — major UI moments, not detailed specs -->
41
+ 1. ...
42
+ 2. ...
43
+
44
+ ## Rabbit Holes (Risks)
45
+
46
+ | Risk | Likelihood | Mitigation |
47
+ |------|-----------|------------|
48
+ | ... | high/med/low | ... |
49
+
50
+ ## Document Map
51
+
52
+ | Document | Type | Status |
53
+ |----------|------|--------|
54
+ | [[assess-report]] | Assess Report | ⬜ draft |
55
+ | [[domain-model]] | DDD Model | ⬜ draft |
56
+ | [[ux-behavior]] | UX Spec | ⬜ draft |
57
+ | [[usecases/_index]] | Use Cases | ⬜ draft |
58
+ | [[integration]] | Integration Map | ⬜ draft |
59
+ | [[scope-summary]] | Scope Summary | ⬜ draft |
60
+ | [[synthesis]] | Health Dashboard + Traceability + Risk + Dependency | ⬜ draft |
61
+ | [[feedback]] | Post-Sprint Feedback | ⬜ pending |
62
+
63
+ ---
64
+
65
+ ## Audit Report
66
+
67
+ *Generated from spec-lint.mjs output — do not edit manually.*
68
+ *skill_version: 2.1 | audit_rules_version: 2.1*
69
+
70
+ ### Score Summary
71
+
72
+ | Layer | Weight | Raw Score | Weighted |
73
+ |-------|--------|-----------|---------|
74
+ | L0 Input Quality | 10% | —/100 | — |
75
+ | L1 Generation Complete | 20% | —/100 | — |
76
+ | L2 Document Quality | 30% | —/100 | — |
77
+ | L3 Execution Readiness | 40% | —/100 | — |
78
+ | **TOTAL** | | | **—/100** |
79
+
80
+ ### Execution Gate
81
+ ⬜ *Pending audit*
82
+
83
+ ### Issues Found
84
+ ⬜ *Pending audit*
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: api-feasibility
3
+ feature: "[feature-slug]"
4
+ status: draft
5
+ skill_version: "2.3"
6
+ ---
7
+
8
+ # API Feasibility Report — [feature-slug]
9
+
10
+ *Generated by Phase 1b. Each investigation block must be resolved before its
11
+ dependent implementation tasks can proceed.*
12
+
13
+ ---
14
+
15
+ ## Detected Third-Party Dependencies
16
+
17
+ | # | Service | Capability Claimed | Status | SPIKE Task |
18
+ |---|---------|-------------------|--------|------------|
19
+ | API-01 | [ServiceName] | [What pitch claims this API can do] | ❓ UNVERIFIED | [[TASK-001-spike-[api]]] |
20
+
21
+ ---
22
+
23
+ ## Investigations Required
24
+
25
+ ### [API-01] [ServiceName] — [Capability Summary]
26
+
27
+ **Capability Claimed:**
28
+ Pitch assumes [ServiceName] API/SDK can [specific operation].
29
+ Specifically: [quote or paraphrase relevant pitch sentence].
30
+
31
+ **Questions to Answer:**
32
+ - [ ] Does [ServiceName] support [operation] via REST API or SDK?
33
+ - [ ] What is the exact input format accepted? (HTML, JSON, design tokens?)
34
+ - [ ] What does the response body look like on success? (field names, types)
35
+ - [ ] What auth model is required? (API Key, OAuth, Service Account, Bearer JWT)
36
+ - [ ] Is there a sandbox / staging environment for testing without billing?
37
+ - [ ] What are the rate limits and pricing implications?
38
+ - [ ] Are there known breaking changes or deprecation notices?
39
+
40
+ **Verification Sources:**
41
+ - Primary (official): [URL — to be found during SPIKE]
42
+ - Secondary (community): GitHub issues / Discord / forum threads for [ServiceName]
43
+
44
+ **Fallback Scope Impact:**
45
+
46
+ | Scenario | Scope Change | Effort Delta |
47
+ |----------|-------------|--------------|
48
+ | Fully supported | No change | — |
49
+ | Partially supported | [Describe workaround] | +[N]h |
50
+ | Not supported | [Describe alternative or de-scope] | [TBD with PO] |
51
+
52
+ **Dependent Tasks:**
53
+ <!-- List all tasks blocked until this investigation is complete -->
54
+ - [[TASK-NNN]] — [reason blocked]
55
+ - [[TASK-NNN]] — [reason blocked]
56
+
57
+ **Decision Gate:**
58
+ - All questions answered + capability confirmed → update `contracts/[repo].contract.md`, remove ⏳ TBD fields, notify SPIKE complete
59
+ - Not answerable within SPIKE time_box → escalate to PO with fallback options above
60
+
61
+ **Resolution:** *(filled post-SPIKE)*
62
+ > Status: [CONFIRMED / PARTIAL / NOT SUPPORTED]
63
+ > Source: [URL with section]
64
+ > Date resolved: [YYYY-MM-DD]
65
+ > Resolved by: [Dev name / handle]
@@ -0,0 +1,127 @@
1
+ ---
2
+ type: assess-report
3
+ feature: FEATURE_SLUG
4
+ generated_at: YYYY-MM-DD
5
+ pitch_hash: HASH
6
+ skill_version: "2.5"
7
+ l0_preview_score: 0
8
+ codebase_confidence: 0
9
+ recommended_lens: lite | standard
10
+ proceed: go | go+fix | no-go
11
+ multi_context_detected: false
12
+ ---
13
+
14
+ # Assess Report: FEATURE TITLE
15
+
16
+ > **Read Decision Summary only — open sections below if you need to know why.**
17
+
18
+ ---
19
+
20
+ ## ⚡ Decision Summary
21
+
22
+ ```
23
+ Recommended lens : LENS
24
+ Estimated tokens : ~MIN–MAX tokens
25
+ Estimated cost : ~$MIN–$MAX
26
+ Input quality : SCORE/100
27
+ Codebase fit : CONFIDENCE%
28
+ Proceed? : PROCEED_STATUS
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Input Quality (L0 Preview)
34
+
35
+ Score: SCORE/100 — STATUS
36
+
37
+ | Check | Result | Note |
38
+ |-------|--------|------|
39
+ | Appetite stated | ✅ / ❌ | value |
40
+ | In-scope boundaries (≥ 2) | ✅ / ❌ | count found |
41
+ | Non-go list (≥ 1) | ✅ / ❌ | count found |
42
+ | Rabbit hole identified | ✅ / ❌ | — |
43
+ | Rabbit hole has mitigation | ✅ / ❌ | — |
44
+ | Third-party declared (if any) | ✅ / ❌ / N/A | — |
45
+
46
+ **Fix list** *(only present when proceed = go+fix or no-go):*
47
+ - [ ] [issue] — [actionable suggestion]
48
+ - [ ] [issue] — [actionable suggestion]
49
+
50
+ ---
51
+
52
+ ## Codebase Fit
53
+
54
+ Confidence: CONFIDENCE%
55
+
56
+ | Signal | Found | Weight |
57
+ |--------|-------|--------|
58
+ | CLAUDE.md readable | ✅ / ❌ | +25 |
59
+ | Schema pattern (*.schema.ts) | ✅ / ❌ | +25 |
60
+ | Repository layer | ✅ / ❌ | +25 |
61
+ | Monorepo structure clear | ✅ / ❌ | +15 |
62
+ | Test pattern consistent | ✅ / ❌ | +10 |
63
+
64
+ **Warnings** *(if any):*
65
+ - ⚠️ [what was not found] → [recommendation]
66
+
67
+ ---
68
+
69
+ ## Estimated Output
70
+
71
+ ```
72
+ Lens : LENS
73
+ Documents : N files
74
+ Use Cases : ~N UCs (estimated)
75
+ Tasks : ~N–N tasks
76
+ SPIKE tasks : N (third-party APIs detected: [list])
77
+ ```
78
+
79
+ <!-- MULTI-CONTEXT BLOCK — include only when multi_context_detected: true -->
80
+ ## ⚠️ Multi-Context Detected
81
+
82
+ This pitch touches N bounded contexts: [context-a], [context-b], [context-c]
83
+
84
+ **Option A — Single standard run** *(faster, boundaries may be blurry)*
85
+ ```bash
86
+ /ba-pitch-analyzer --lens standard docs/pitch.md
87
+ ```
88
+ Estimated tokens: ~N tokens
89
+
90
+ **Option B — Split + cross-context** *(slower, precise boundaries)*
91
+ ```bash
92
+ /ba-pitch-analyzer --lens standard docs/pitch-[context-a].md
93
+ /ba-pitch-analyzer --lens standard docs/pitch-[context-b].md
94
+ /ba-pitch-analyzer --cross-context FEATURE_SLUG \
95
+ shapeup/[context-a]/spec/ \
96
+ shapeup/[context-b]/spec/
97
+ ```
98
+ Estimated tokens: ~N total (reusable per context)
99
+
100
+ Choose: **[A]** or **[B]**
101
+ <!-- END MULTI-CONTEXT BLOCK -->
102
+
103
+ ---
104
+
105
+ ## Lens Options
106
+
107
+ | Lens | Tokens | Cost | Recommended |
108
+ |------|--------|------|-------------|
109
+ | `--lens lite` | ~6,000–8,000 | ~$0.03–$0.04 | [✅ if applicable] |
110
+ | `--lens standard` | ~14,000–22,000 | ~$0.07–$0.11 | [✅ if applicable] |
111
+ | `--cross-context` | ~N | ~$N | [✅ if applicable] |
112
+
113
+ ---
114
+
115
+ ## Next Steps
116
+
117
+ ```bash
118
+ # Proceed with recommended lens
119
+ /ba-pitch-analyzer --lens LENS docs/pitch.md
120
+
121
+ # Override lens
122
+ /ba-pitch-analyzer --lens lite docs/pitch.md
123
+ /ba-pitch-analyzer --lens standard docs/pitch.md
124
+
125
+ # Skip assess on next run (pitch already reviewed)
126
+ /ba-pitch-analyzer --lens LENS --skip-assess docs/pitch.md
127
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ type: repository-contract
3
+ source_type: be-service
4
+ feature: "[feature-slug]"
5
+ repository: "[RepoName]"
6
+ service: "[internal service name]"
7
+ status: confirmed # be-service contracts are verifiable from codebase
8
+ skill_version: "2.3"
9
+ ---
10
+
11
+ # Repository Contract — [RepoName]
12
+
13
+ ## Source Type: `be-service`
14
+ ## Endpoint Base: `[apps/api or service URL base]`
15
+ ## Auth: `[Bearer JWT (session) / API Key / Service-to-service mTLS]`
16
+
17
+ ---
18
+
19
+ ## Method: [methodName]
20
+
21
+ ### HTTP Request
22
+
23
+ ```
24
+ [POST/GET/PUT/PATCH/DELETE] [/api/v1/path/:param]
25
+ Content-Type: application/json
26
+ Authorization: Bearer [session JWT]
27
+ ```
28
+
29
+ ### Request Body
30
+
31
+ | Field | Type | Validation | Source | Notes |
32
+ |-------|------|-----------|--------|-------|
33
+ | [field1] | string | required, max 255 | UC-[Name].input.[field] | |
34
+ | [field2] | uuid | required | UC-[Name].input.[field] | FK to [Entity] |
35
+ | [field3] | number | min 0 | UC-[Name].input.[field] | VND — integer only, no float |
36
+
37
+ ### Response `201 Created` / `200 OK`
38
+
39
+ | Field | Type | Invariant | Used By |
40
+ |-------|------|-----------|---------|
41
+ | id | uuid | non-null, server-generated | subsequent requests |
42
+ | [field1] | string | | UX: [state/display] |
43
+ | createdAt | ISO8601 | UTC | UX: timestamp display |
44
+
45
+ ### Error Responses
46
+
47
+ | HTTP Status | Code | Meaning | UX Action |
48
+ |-------------|------|---------|-----------|
49
+ | 400 | VALIDATION_ERROR | Field-level validation failed | Show per-field inline errors |
50
+ | 401 | UNAUTHORIZED | Session expired or missing | Redirect to login |
51
+ | 403 | FORBIDDEN | Caller lacks [ROLE] permission | Show permission error |
52
+ | 404 | NOT_FOUND | Resource [Entity] not found | Show 404 state |
53
+ | 409 | CONFLICT | [Describe conflict condition] | Show conflict message |
54
+ | 413 | PAYLOAD_TOO_LARGE | Request body exceeds [N]kb | Show size error |
55
+ | 422 | BUSINESS_RULE_VIOLATION | [Describe invariant] | Show business error |
56
+ | 5xx | INTERNAL_ERROR | Server error | Generic error + retry |
57
+
58
+ ---
59
+
60
+ ## Method: [methodName2]
61
+
62
+ *(repeat block per method)*
@@ -0,0 +1,92 @@
1
+ ---
2
+ type: repository-contract
3
+ source_type: offline-storage
4
+ feature: "[feature-slug]"
5
+ repository: "[RepoName]"
6
+ engine: "[SQLite via Drizzle / AsyncStorage / MMKV / FileSystem]"
7
+ schema_ref: "[[domain-model#[EntityName]]]"
8
+ migration_version: "v[NNN]"
9
+ status: confirmed
10
+ skill_version: "2.3"
11
+ ---
12
+
13
+ # Repository Contract — [RepoName]
14
+
15
+ ## Source Type: `offline-storage`
16
+ ## Engine: [SQLite via Drizzle ORM / AsyncStorage / MMKV / FileSystem]
17
+ ## Schema Ref: [[domain-model#[EntityName]]]
18
+ ## Migration Version: `v[NNN]` — must match domain-model schema version
19
+
20
+ ---
21
+
22
+ ## Storage Schema
23
+
24
+ ### Table / Key: `[table_name or storage_key]`
25
+
26
+ | Column / Key | Type | Constraint | Migration | Notes |
27
+ |-------------|------|-----------|-----------|-------|
28
+ | id | uuid | PK, NOT NULL | v001_initial | |
29
+ | [field1] | text | NOT NULL | v001_initial | |
30
+ | [field2] | integer | NOT NULL, default 0 | v001_initial | VND — integer only |
31
+ | [field3] | text? | NULL | v002_add_[field] | nullable until [condition] |
32
+ | createdAt | text | NOT NULL, ISO8601 | v001_initial | stored as UTC string |
33
+ | updatedAt | text | NOT NULL | v001_initial | update trigger or app-managed |
34
+
35
+ ---
36
+
37
+ ## Method: [methodName] (Write)
38
+
39
+ ### Write Input
40
+
41
+ | Field | Type | Required | Source |
42
+ |-------|------|----------|--------|
43
+ | [field1] | string | ✓ | UC-[Name].input.[field] |
44
+ | [field2] | number | ✓ | domain.[Entity].[field] |
45
+
46
+ ### Write Output
47
+
48
+ | Field | Type | Invariant |
49
+ |-------|------|-----------|
50
+ | id | uuid | server-generated, non-null |
51
+ | [field1] | string | mirrors input |
52
+
53
+ ### Error Cases
54
+
55
+ | Condition | Error Type | Recovery |
56
+ |-----------|-----------|---------|
57
+ | Disk full | StorageError(QUOTA_EXCEEDED) | Prompt user to free space |
58
+ | Schema mismatch | MigrationError | Run pending migrations |
59
+ | Concurrent write | ConflictError | [last-write-wins / merge strategy] |
60
+
61
+ ---
62
+
63
+ ## Method: [methodName2] (Read)
64
+
65
+ ### Read Output
66
+
67
+ | Field | Type | Null Behavior |
68
+ |-------|------|--------------|
69
+ | [field1] | string \| null | null when [condition] — caller must handle |
70
+ | [field2] | [Entity][] | empty array [] when no rows — never null |
71
+
72
+ ### Error Cases
73
+
74
+ | Condition | Error Type | Recovery |
75
+ |-----------|-----------|---------|
76
+ | Record not found | returns `null` — never throws | Caller checks null |
77
+ | DB locked | StorageError(LOCKED) | Retry with backoff |
78
+
79
+ ---
80
+
81
+ ## Conflict Strategy: `[last-write-wins / merge / reject]`
82
+
83
+ *Describe: when two writes happen concurrently, what is the resolution?*
84
+
85
+ ## Migration Runbook
86
+
87
+ ```sql
88
+ -- v[NNN]: [description]
89
+ ALTER TABLE [table] ADD COLUMN [col] [type] [constraint];
90
+ ```
91
+
92
+ Rollback: `[rollback SQL or "destructive — no rollback"]`
@@ -0,0 +1,66 @@
1
+ ---
2
+ type: repository-contract
3
+ source_type: third-party-api
4
+ feature: "[feature-slug]"
5
+ repository: "[RepoName]"
6
+ service: "[ServiceName]"
7
+ feasibility_ref: "API-[NN]"
8
+ spike_task: "[[TASK-NNN-spike-[api]]]"
9
+ status: speculative # → confirmed after SPIKE done
10
+ skill_version: "2.3"
11
+ ---
12
+
13
+ # Repository Contract — [RepoName]
14
+
15
+ ## Source Type: `third-party-api`
16
+ ## Service: [ServiceName] ([REST API / SDK])
17
+ ## Feasibility: ⏳ UNVERIFIED → see [[api-feasibility#API-NN]] + [[TASK-NNN-spike-[api]]]
18
+
19
+ ---
20
+
21
+ > ⚠️ **SPECULATIVE CONTRACT**
22
+ > Fields marked `⏳ TBD` are derived from pitch assumptions and community references.
23
+ > All `⏳ TBD` entries MUST be confirmed and replaced during [[TASK-NNN-spike-[api]]].
24
+ > Implementation tasks depending on this repository are **blocked** until no `⏳ TBD` remains.
25
+
26
+ ---
27
+
28
+ ## Method: [methodName]
29
+
30
+ ### Request
31
+
32
+ | Field | Type | Required | Source | Notes |
33
+ |-------|------|----------|--------|-------|
34
+ | [field1] | string | ✓ | UC-[Name].input.[field] | ⏳ TBD — field name unverified |
35
+ | [field2] | string | ✓ | env.[ENV_VAR_NAME] | ⏳ TBD — confirm param name |
36
+ | [field3] | string? | — | session.[claim] | ⏳ TBD — may not be required |
37
+
38
+ ### Response (Success)
39
+
40
+ | Field | Type | Invariant | Used By | Notes |
41
+ |-------|------|-----------|---------|-------|
42
+ | [field1] | string | ⏳ TBD | [method2].request.[field] | ⏳ TBD — confirm field name |
43
+ | [field2] | enum | ⏳ TBD | UX: [badge/state name] | ⏳ TBD — confirm possible values |
44
+
45
+ ### Error Cases
46
+
47
+ | Code | HTTP/SDK Error | Retryable | UX Action | Notes |
48
+ |------|---------------|-----------|-----------|-------|
49
+ | UNAUTHORIZED | 401 / AuthError | false | Show: "API key invalid" | ⏳ TBD — confirm error shape |
50
+ | QUOTA_EXCEEDED | 429 / RateLimitError | true | Queue + retry | ⏳ TBD — confirm retry-after header |
51
+ | INVALID_INPUT | 400 / ValidationError | false | Show field error | ⏳ TBD — confirm error body |
52
+ | UNKNOWN | 5xx / NetworkError | true | Generic error + retry | |
53
+
54
+ ---
55
+
56
+ ## Method: [methodName2]
57
+
58
+ *(repeat block per method)*
59
+
60
+ ---
61
+
62
+ ## Post-SPIKE Update Log
63
+
64
+ | Field | Old Value | Confirmed Value | Source URL | Updated By | Date |
65
+ |-------|-----------|----------------|------------|------------|------|
66
+ | | | | | | |
@@ -0,0 +1,64 @@
1
+ ---
2
+ type: context-map
3
+ feature: FEATURE_SLUG
4
+ skill_version: "2.5"
5
+ contexts: []
6
+ relationships: []
7
+ tags: [cross-context, ddd]
8
+ depends_on: []
9
+ status: draft
10
+ ---
11
+
12
+ # Context Map: FEATURE TITLE
13
+
14
+ > Maps relationships between bounded contexts involved in this feature.
15
+ > Relationship types follow Evans DDD vocabulary.
16
+
17
+ ---
18
+
19
+ ## Context Diagram
20
+
21
+ ```
22
+ [Context A] ──publishes──► EventName ──────────────► [Context B]
23
+
24
+ [Context C] ──provides──► EntityName ─────────────► [Context A]
25
+
26
+ [Context D] ◄──subscribes── EventName │
27
+ │ │
28
+ └──publishes──► EventName2 ──────────────────► [Context A]
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Relationship Register
34
+
35
+ | From Context | To Context | Type | Contract |
36
+ |-------------|-----------|------|----------|
37
+ | [Context A] | [Context B] | Customer/Supplier | [[contracts/[repo].contract.md]] |
38
+ | [Context B] | [Context C] | Conformist | [Context C] sets schema |
39
+ | [Context D] | External | Anti-corruption | [[api-feasibility#API-01]] |
40
+
41
+ **Relationship types:**
42
+ - **Customer/Supplier** — downstream depends on upstream; upstream team sets contract
43
+ - **Conformist** — downstream conforms to upstream schema with no negotiation
44
+ - **Anti-corruption Layer** — downstream wraps upstream behind its own abstraction
45
+ - **Shared Kernel** — both contexts share a subset of domain model (use sparingly)
46
+ - **Published Language** — upstream publishes a well-defined schema; downstream consumes
47
+
48
+ ---
49
+
50
+ ## Context Responsibilities
51
+
52
+ | Context | Owns | Does NOT Own |
53
+ |---------|------|-------------|
54
+ | [Context A] | [entity list] | [boundary note] |
55
+ | [Context B] | [entity list] | [boundary note] |
56
+
57
+ ---
58
+
59
+ ## Integration Points
60
+
61
+ | Event / Data | Producer | Consumer(s) | Coupling Risk |
62
+ |-------------|---------|------------|--------------|
63
+ | `EventName` | [Context A] | [Context B], [Context C] | 🔴 high — 2 consumers |
64
+ | `EntityName` | [Context C] | [Context A] | 🟡 medium |
@@ -0,0 +1,77 @@
1
+ ---
2
+ type: event-choreography
3
+ feature: FEATURE_SLUG
4
+ skill_version: "2.5"
5
+ contexts: []
6
+ events: []
7
+ tags: [cross-context, events]
8
+ depends_on: ["[[_cross-context/context-map]]"]
9
+ status: draft
10
+ ---
11
+
12
+ # Event Choreography: FEATURE TITLE
13
+
14
+ > Sequence of domain events flowing across bounded contexts.
15
+ > Includes dead-letter and timeout scenarios.
16
+
17
+ ---
18
+
19
+ ## Happy Path Sequence
20
+
21
+ ```
22
+ UC-[Name] triggers:
23
+
24
+ [Context A] [Context B] [Context C]
25
+ │ │ │
26
+ │──EventName1──────────►│ │
27
+ │ │──EventName2──────────►│
28
+ │ │ │──SideEffect
29
+ │◄─────────────────────│ │
30
+ │──EventName3 │ │
31
+ │ │ │
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Event Register
37
+
38
+ | Event | Emitted By | Consumed By | Payload Fields | Schema Ref |
39
+ |-------|-----------|------------|---------------|-----------|
40
+ | `EventName1` | [Context A] :: UC-Name | [Context B] | id, field1, field2 | [[domain-model#Events]] |
41
+ | `EventName2` | [Context B] | [Context C] | id, field1 | [[context-b/domain-model#Events]] |
42
+
43
+ ---
44
+
45
+ ## Failure Scenarios
46
+
47
+ | Scenario | Trigger | Impact | Recovery Strategy |
48
+ |----------|---------|--------|------------------|
49
+ | `EventName2` never arrives | [Context B] crash | [Context C] stuck in pending | Timeout N min → auto-cancel + emit `EventName2Timeout` |
50
+ | [Context C] rejects `EventName2` | schema mismatch | silent failure | Dead-letter queue → alert → manual replay |
51
+ | Duplicate `EventName1` | retry storm | double-process | Idempotency key on `EventName1.id` |
52
+
53
+ ---
54
+
55
+ ## Timeout Register
56
+
57
+ | Event | Timeout | Owner Context | Action on Timeout |
58
+ |-------|---------|--------------|------------------|
59
+ | `EventName1` → `EventName2` | N minutes | [Context A] | emit `CancelRequested` |
60
+ | `EventName2` → SideEffect | N minutes | [Context B] | retry × 3 → dead-letter |
61
+
62
+ ---
63
+
64
+ ## Dead-Letter Strategy
65
+
66
+ ```
67
+ Dead-letter queue: [queue-name]
68
+
69
+ On failure:
70
+ 1. Log event payload + error + context
71
+ 2. Retry: N times with exponential backoff (base: Ns, max: Ns)
72
+ 3. After max retries: move to DLQ
73
+ 4. Alert: [channel/mechanism]
74
+ 5. Manual replay: [command or runbook reference]
75
+
76
+ User impact: [none / degraded / blocked — describe]
77
+ ```