@punks/cli 3.1.3 → 3.1.4

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 (177) hide show
  1. package/dist/BASELINE_CHANGELOG.md +21 -0
  2. package/dist/CHANGELOG.md +40 -0
  3. package/dist/baseline/scaffold-baseline/baseline.json +4 -4
  4. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +23 -3
  5. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +26 -2
  6. package/dist/baseline/scaffold-baseline/data/subagents/manifest.mjs +3 -1
  7. package/dist/baseline/scaffold-baseline/data/subagents/manifest.test.ts +20 -0
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +4 -3
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +3 -1
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/LICENSE +21 -0
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/SKILL-MECHANICS.md +22 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/SKILL.md +81 -0
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/UPSTREAM.md +9 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +27 -15
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/backlog-sync.md +19 -32
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +14 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +5 -1
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/stop-conditions.md +2 -1
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +51 -105
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +26 -57
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -3
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +41 -0
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +15 -6
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +3 -3
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +21 -54
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -4
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +13 -15
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +7 -4
  30. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
  31. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +9 -35
  32. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/wayfinder/SKILL.md +11 -8
  33. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -3
  34. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +25 -73
  35. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +54 -305
  36. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +46 -55
  37. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +33 -119
  38. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +24 -14
  39. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +53 -11
  40. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +48 -26
  41. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +53 -12
  42. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +49 -33
  43. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +20 -0
  44. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/SKILL.md +14 -2
  45. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/LICENSE +21 -0
  46. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/LOGIC.md +57 -21
  47. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/SKILL.md +17 -15
  48. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/UI.md +12 -5
  49. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/UPSTREAM.md +11 -0
  50. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/SKILL.md +5 -12
  51. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  52. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  53. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  54. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  55. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  56. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  57. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/LICENSE +21 -0
  58. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/SKILL.md +124 -0
  59. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/references/AUDIT.md +98 -0
  60. package/dist/baseline/scaffold-baseline/skills/misc/wait-what/LICENSE +21 -0
  61. package/dist/baseline/scaffold-baseline/skills/misc/wait-what/SKILL.md +7 -0
  62. package/dist/baseline/scaffold-baseline/skills/misc/wait-what/UPSTREAM.md +9 -0
  63. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +4 -3
  64. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/backlog.md +31 -0
  65. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +5 -4
  66. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +6 -4
  67. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +16 -14
  68. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +9 -5
  69. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +9 -2
  70. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/backlog.md +4 -4
  71. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/prototype.md +1 -1
  72. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/private-internal.md +3 -1
  73. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/learning-artifacts.md +8 -1
  74. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +24 -24
  75. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/agents/openai.yaml +1 -1
  76. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/convergence.md +39 -0
  77. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/frontier-lifecycle.md +22 -16
  78. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/root-routing.md +3 -2
  79. package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/SKILL.md +34 -0
  80. package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/VERDICT-TEMPLATE.md +16 -0
  81. package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/agents/openai.yaml +2 -0
  82. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +14 -57
  83. package/dist/baseline/scaffold-baseline.json +4 -4
  84. package/dist/baseline/scaffold-baseline.tgz +0 -0
  85. package/dist/data/subagents/manifest.mjs +3 -1
  86. package/dist/index.js +148 -185
  87. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +4 -3
  88. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  89. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +3 -1
  90. package/dist/skills/agnostic/docs/writing-for-agents/LICENSE +21 -0
  91. package/dist/skills/agnostic/docs/writing-for-agents/SKILL-MECHANICS.md +22 -0
  92. package/dist/skills/agnostic/docs/writing-for-agents/SKILL.md +81 -0
  93. package/dist/skills/agnostic/docs/writing-for-agents/UPSTREAM.md +9 -0
  94. package/dist/skills/agnostic/planning/create-plan/SKILL.md +27 -15
  95. package/dist/skills/agnostic/planning/create-plan/references/backlog-sync.md +19 -32
  96. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +14 -0
  97. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +5 -1
  98. package/dist/skills/agnostic/planning/create-plan/references/stop-conditions.md +2 -1
  99. package/dist/skills/agnostic/planning/create-spec/SKILL.md +51 -105
  100. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +26 -57
  101. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -3
  102. package/dist/skills/agnostic/planning/create-spec/references/readiness.md +41 -0
  103. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +15 -6
  104. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +3 -3
  105. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +21 -54
  106. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -4
  107. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +13 -15
  108. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +7 -4
  109. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
  110. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +9 -35
  111. package/dist/skills/agnostic/planning/wayfinder/SKILL.md +11 -8
  112. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -3
  113. package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +25 -73
  114. package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +54 -305
  115. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +46 -55
  116. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +33 -119
  117. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +24 -14
  118. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +53 -11
  119. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +48 -26
  120. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +53 -12
  121. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +49 -33
  122. package/dist/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +20 -0
  123. package/dist/skills/agnostic/research/parallel-research/SKILL.md +14 -2
  124. package/dist/skills/agnostic/research/prototype/LICENSE +21 -0
  125. package/dist/skills/agnostic/research/prototype/LOGIC.md +57 -21
  126. package/dist/skills/agnostic/research/prototype/SKILL.md +17 -15
  127. package/dist/skills/agnostic/research/prototype/UI.md +12 -5
  128. package/dist/skills/agnostic/research/prototype/UPSTREAM.md +11 -0
  129. package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
  130. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  131. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  132. package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  133. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  134. package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  135. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  136. package/dist/skills/frameworks/effect/effect-service-design/LICENSE +21 -0
  137. package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +124 -0
  138. package/dist/skills/frameworks/effect/effect-service-design/references/AUDIT.md +98 -0
  139. package/dist/skills/misc/wait-what/LICENSE +21 -0
  140. package/dist/skills/misc/wait-what/SKILL.md +7 -0
  141. package/dist/skills/misc/wait-what/UPSTREAM.md +9 -0
  142. package/dist/skills/phases/delivery-phase/SKILL.md +4 -3
  143. package/dist/skills/phases/delivery-phase/phases/backlog.md +31 -0
  144. package/dist/skills/phases/delivery-phase/phases/implement.md +5 -4
  145. package/dist/skills/phases/delivery-phase/phases/plan.md +6 -4
  146. package/dist/skills/phases/delivery-phase/phases/router.md +16 -14
  147. package/dist/skills/phases/delivery-phase/phases/spec.md +9 -5
  148. package/dist/skills/phases/delivery-phase/references/artifact-state.md +9 -2
  149. package/dist/skills/phases/design-phase/phases/backlog.md +4 -4
  150. package/dist/skills/phases/design-phase/phases/prototype.md +1 -1
  151. package/dist/skills/phases/docs-ingest-phase/phases/private-internal.md +3 -1
  152. package/dist/skills/phases/docs-ingest-phase/references/learning-artifacts.md +8 -1
  153. package/dist/skills/phases/finder-phase/SKILL.md +24 -24
  154. package/dist/skills/phases/finder-phase/agents/openai.yaml +1 -1
  155. package/dist/skills/phases/finder-phase/references/convergence.md +39 -0
  156. package/dist/skills/phases/finder-phase/references/frontier-lifecycle.md +22 -16
  157. package/dist/skills/phases/finder-phase/references/root-routing.md +3 -2
  158. package/dist/skills/phases/prototype-phase/SKILL.md +34 -0
  159. package/dist/skills/phases/prototype-phase/VERDICT-TEMPLATE.md +16 -0
  160. package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
  161. package/dist/skills/phases/requirements-phase/SKILL.md +14 -57
  162. package/dist/tsconfig.tsbuildinfo +1 -1
  163. package/package.json +1 -1
  164. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
  165. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -61
  166. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/backlog-sync.md +0 -49
  167. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/discovery.md +0 -54
  168. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/grill-phase.md +0 -42
  169. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/questioning.md +0 -51
  170. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/sequential.md +0 -48
  171. package/dist/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
  172. package/dist/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -61
  173. package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +0 -49
  174. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +0 -54
  175. package/dist/skills/agnostic/planning/create-spec/references/grill-phase.md +0 -42
  176. package/dist/skills/agnostic/planning/create-spec/references/questioning.md +0 -51
  177. package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +0 -48
@@ -1,31 +1,33 @@
1
1
  ---
2
2
  name: prototype
3
- description: Build a throwaway prototype to answer a design question: a terminal app for logic or state, or several UI variations on one route.
3
+ description: Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  # Prototype
8
8
 
9
- A prototype is throwaway code that answers a question. The question decides the shape.
9
+ A prototype is **throwaway code that answers a question**. The question decides the shape.
10
10
 
11
- ## Pick A Branch
11
+ ## Pick a branch
12
12
 
13
- Identify which question is being answered from the user's prompt, surrounding code, or by asking if the user is around:
13
+ Identify which question is being answered — from the user's prompt, the surrounding code, or by asking if the user is around:
14
14
 
15
- - **Does this logic or state model feel right?** Read [LOGIC.md](LOGIC.md). Build a tiny interactive terminal app that pushes the state machine through cases that are hard to reason about on paper.
16
- - **What should this look like?** Read [UI.md](UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
15
+ - **"Does this logic / state model feel right?"** → [LOGIC.md](LOGIC.md). Build a single shareable HTML file — free-play buttons plus tabbed guided walkthroughs — that pushes the state machine through cases that are hard to reason about on paper, and that a non-developer can drive.
16
+ - **"What should this look like?"** → [UI.md](UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
17
17
 
18
- The two branches produce different artifacts. If the question is genuinely ambiguous and the user is not reachable, default to whichever branch better matches the surrounding code: backend module means logic; page or component means UI. State the assumption at the top of the prototype.
18
+ The two branches produce very different artifacts — getting this wrong wastes the whole prototype. If the question is genuinely ambiguous and the user isn't reachable, default to whichever branch better matches the surrounding code (a backend module → logic; a page or component → UI) and state the assumption at the top of the prototype.
19
19
 
20
- ## Rules
20
+ ## Rules that apply to both
21
21
 
22
- 1. Mark it as throwaway from day one. Locate the prototype near the module or page it explores, and name it so a reader can see it is not production.
23
- 2. Provide one command to run. Use the project's existing task runner.
24
- 3. Use in-memory state by default. If persistence is the question, use a scratch DB or local file clearly named as prototype data.
25
- 4. Skip polish. No tests, no production abstractions, and no error handling beyond what makes the prototype runnable.
26
- 5. Surface the relevant state after every action or variant switch.
27
- 6. Delete or absorb the prototype when it has answered the question.
22
+ 1. **Throwaway from day one, and clearly marked as such.** Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious — but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
23
+ 2. **Trivial to run.** A UI prototype starts from one command in the project's task runner — `pnpm <name>`, `python <path>`, `bun <path>`, etc. A logic demo is a single HTML file the user double-clicks. Either way, no thinking required to start it.
24
+ 3. **No persistence by default.** State lives in memory. Persistence is the thing the prototype is _checking_, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE — wipe me" name.
25
+ 4. **Skip the polish.** No tests, no error handling beyond what makes the prototype _runnable_, no abstractions. The point is to learn something fast.
26
+ 5. **Surface the state.** After every action (logic) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
27
+ 6. **Capture it when done.** Fold any validated decision into the real code, then capture the prototype itself as a **primary source** on a throwaway branch named `prototype/<slug>`, out of main. Commit the runnable artifact before requesting a verdict; prototype code is never merged into production unchanged.
28
+ 7. **Retain it remotely.** Push `prototype/<slug>` to the configured remote, or use an explicit durable retention mechanism when remote branches are forbidden. Verify the remote ref contains the evidence commit before returning the immutable commit SHA and path.
29
+ 8. **Leave a context pointer.** Link the retained branch or ref from the implementation issue. Capture the answer — the verdict and the question it settled — in the issue or a commit. The main branch keeps only the validated decision.
28
30
 
29
31
  ## Done
30
32
 
31
- Capture the answer somewhere durable, along with the question it answered. If the user is around, capture it in conversation. If not, leave a `NOTES.md` next to the prototype so the verdict can be filled in before deletion.
33
+ Return the run instruction, branch, immutable commit SHA, artifact path, remote retention reference, and the question still awaiting a human verdict. A caller such as `prototype-phase` owns accept, iterate, or reject and records `PROTOTYPE-VERDICT.md` beside the artifact on the throwaway branch.
@@ -15,15 +15,22 @@ Prefer sub-shape A.
15
15
 
16
16
  1. State the question and variant count. Default to three variants and cap at five.
17
17
  2. Generate radically different variants. They should differ in layout, information hierarchy, and primary affordance, not only color or copy.
18
- 3. Wire variants through a single route switcher keyed by `?variant=`.
19
- 4. Build a floating bottom-center switcher with previous and next arrows, current variant label, URL updates, and left/right keyboard shortcuts.
18
+ 3. Wire variants through a single route switcher keyed by `?variant=`. The URL
19
+ is shareable and the selected variant survives reload.
20
+ 4. Build a floating bottom-center switcher with previous and next arrows,
21
+ current variant label, URL updates, and left/right keyboard shortcuts. Ignore
22
+ shortcuts while focus is in `input`, `textarea`, `select`, or
23
+ `[contenteditable]`.
20
24
  5. Hide the switcher from production builds.
21
- 6. Share the URL and variant keys with the user.
22
- 7. Capture the winning direction, then delete losing variants and the switcher or promote the winner into real code.
25
+ 6. Stub mutations at the UI boundary. Never write production data from a
26
+ prototype variant.
27
+ 7. Share the URL and variant keys with the user.
28
+ 8. Capture the winning direction. Promotion means rewriting the accepted design
29
+ as production code; never merge prototype variants unchanged.
23
30
 
24
31
  ## Anti-Patterns
25
32
 
26
33
  - Variants that differ only in color or copy.
27
34
  - Sharing so much layout code that variants cannot disagree structurally.
28
- - Wiring variants to real mutations.
35
+ - Wiring variants to real mutations instead of stubbed mutations.
29
36
  - Promoting prototype code directly to production without rewriting it properly.
@@ -0,0 +1,11 @@
1
+ # Upstream provenance
2
+
3
+ Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/2ffb184ffbb752faa664c0b204f3c9241b1428e9/skills/engineering/prototype) at v1.2.0 commit:
4
+
5
+ ```text
6
+ 2ffb184ffbb752faa664c0b204f3c9241b1428e9
7
+ ```
8
+
9
+ The adjacent `LICENSE` is the upstream MIT license retained with this skill.
10
+
11
+ Devpunks keeps the upstream single-file HTML logic demo and adds the local `prototype/<slug>` branch, remote-retention verification, immutable-SHA handoff, and `prototype-phase` verdict contract.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: effect
3
3
  description: |
4
- Opinionated guide for building production TypeScript applications with Effect v4. Use when implementing Effect workflows, services, layers, schemas, configuration, schedules, caches, streams, HTTP clients, or tests.
4
+ Opinionated guide for building production TypeScript applications with Effect v4 outside service design. Use when implementing Effect workflows, schemas, configuration, schedules, caches, streams, HTTP clients, Effect Atom, observability, scoped background work, or deterministic tests. Use effect-service-design alongside it for Effect services and Layers.
5
5
  license: MIT
6
6
  compatibility: Requires Effect v4. Examples are reviewed against the version documented in this repository.
7
7
  ---
@@ -23,13 +23,14 @@ Check these before guessing:
23
23
  Read only the branch references that match the task.
24
24
 
25
25
  - Data models, schemas, brands, variants, optional keys, or decoders: read `references/SCHEMA.md`.
26
- - Services, module surfaces, layers, runtime wiring, errors, `Effect.fn`, or test services: read `references/SERVICES_LAYERS.md`.
26
+ - Service qualification, contracts, construction, Layers, requirement propagation, test substitutes, or service audits: use `$effect-service-design`.
27
+ - Module namespace surfaces, scoped long-lived work, whole-function `Effect.fn` transforms, or operation error helpers: read `references/SERVICES_LAYERS.md`.
27
28
  - Runtime config, env variables, `ConfigProvider`, or `layerConfig`: read `references/CONFIG.md`.
28
29
  - Retry, repeat, polling, backoff, jitter, rate-limit-aware policies, or pass loops: read `references/SCHEDULING.md`.
29
30
  - Memoization, per-key TTL caches, deduplicating concurrent lookups, or request batching: read `references/CACHING.md`.
30
31
  - Streams, event sources, async iterables, queues/pubsubs, pagination, backpressure, or stream consumers: read `references/STREAMS.md`.
31
32
  - Outgoing HTTP calls, Effect HttpClient, status handling, or HTTP rate limiting: read `references/HTTP_CLIENTS.md`.
32
- - Effect tests, time, sleeps, concurrency synchronization, or fakes: read `references/TESTING.md`.
33
+ - Effect tests, time, sleeps, or concurrency synchronization: read `references/TESTING.md`.
33
34
  - Effect-Atom data fetching, mutations, or React server state: read `references/EFFECT_ATOM.md`.
34
35
  - Effect logging, tracing, spans, or observability: read `references/OBSERVABILITY.md`.
35
36
 
@@ -38,17 +39,14 @@ If a task spans several branches, read all matching files before editing.
38
39
  ## Core Defaults
39
40
 
40
41
  - Compose workflows with `Effect.gen(function* () { ... })`.
41
- - Define public service methods and non-trivial internal service methods with `Effect.fn("Domain.operation")`.
42
42
  - Use `Effect.fnUntraced` only for internal helpers where stack-frame/span metadata is intentionally unnecessary.
43
- - Prefer `Context.Service` for application services when the codebase has not standardized on another current service-tag style.
44
- - Build real service implementations with `Layer.effect(Service, Effect.gen(...))` and return `Service.of({ ... })`.
45
43
  - Model records with `Schema.Struct(...)` plus a same-name `interface`.
46
44
  - Model typed Effect errors with `Schema.TaggedErrorClass`.
47
45
  - Read runtime config through `Config`, not direct `process.env` access in application logic.
48
46
  - Use `Schedule` for retry, repeat, polling, pacing, and backoff policies.
49
47
  - Use `Stream` for effectful sources that emit many values over time and need pull, backpressure, interruption, or transformation.
50
48
  - Prefer Effect HTTP client modules for outgoing HTTP in Effect applications when their typed errors, layers, and client transforms are useful.
51
- - Prefer Effect-aware tests, explicit layers, and deterministic synchronization over sleeps.
49
+ - Prefer Effect-aware tests and deterministic synchronization over sleeps.
52
50
  - Prefer decoders and `schema.makeEffect(...)` at untrusted boundaries; reserve throwing `schema.make(...)` for trusted construction, and never use casts to skip validation.
53
51
 
54
52
  ## Quick Selection Guide
@@ -61,8 +59,6 @@ If a task spans several branches, read all matching files before editing.
61
59
  - External/custom discriminator such as `type`: `Schema.Struct({ type: Schema.tag("variant"), ... })` plus `Schema.toTaggedUnion("type")` when union helpers are needed.
62
60
  - Expected typed failure: `Schema.TaggedErrorClass`.
63
61
  - Unknown boundary payload: `Schema.decodeUnknownEffect(...)`.
64
- - Service boundary: `Context.Service<Service, Interface>()(...)` plus `Layer.effect(...)` plus `Service.of(...)`.
65
- - Public or non-trivial internal service method: `Effect.fn("Domain.operation")`.
66
62
  - Runtime configuration: `Config` recipes read in layers; override with `ConfigProvider` in tests.
67
63
  - Event source: `Stream` consumed with `Stream.runForEach(...)` and forked with `Effect.forkScoped` in the owning layer.
68
64
  - Queue-backed event source: `Queue` for the producer boundary, `Stream.fromQueue(...)` for consumers.
@@ -80,7 +76,6 @@ If a task spans several branches, read all matching files before editing.
80
76
  ## Boundary Rules
81
77
 
82
78
  - Keep HTTP handlers thin: decode input, read context, call services, map typed errors to transport responses.
83
- - Keep business rules in services or domain functions, not transport handlers.
84
79
  - Wrap HTTP clients, SDKs, CLIs, and external integrations in named effects at adapter boundaries.
85
80
  - Decode persisted rows with Schema or SQL-specific helpers when values are not trivially trusted.
86
81
  - Keep provider/network calls outside authoritative database transactions.
@@ -94,7 +89,5 @@ If a task spans several branches, read all matching files before editing.
94
89
  - Do not introduce `Schema.Class` or `Schema.TaggedClass` as default app data-modeling patterns.
95
90
  - Do not hand-roll `_tag` error classes when `Schema.TaggedErrorClass` fits.
96
91
  - Do not use cause-level recovery when typed-error recovery is enough.
97
- - Do not use `Layer.mergeAll(...)` or `provideMerge(...)` as blind make-it-compile tools.
98
- - Do not hide required application authority, credentials, persistence, transports, or external services behind `Context.Reference` defaults.
99
92
  - Do not add arbitrary `Effect.sleep(...)` to tests when a deterministic synchronization primitive is available.
100
93
  - Do not hand-roll Map/TTL/prune caches or in-flight dedupe when `effect/Cache` fits.
@@ -10,18 +10,13 @@ export const dataDirectoryConfig = Config.schema(
10
10
  "APP_DATA_DIR",
11
11
  )
12
12
 
13
- export const layerFromEnvironment = Layer.effect(
14
- Configuration.Service,
15
- Effect.gen(function* () {
16
- const apiKey = yield* Config.redacted("API_KEY")
17
- const optionalModel = yield* Config.option(Config.string("MODEL"))
18
- const enabled = yield* Config.boolean("FEATURE_ENABLED").pipe(
19
- Config.withDefault(false),
20
- )
21
-
22
- return Configuration.Service.of({ apiKey, optionalModel, enabled })
23
- }),
24
- )
13
+ export const appConfig = Config.all({
14
+ apiKey: Config.redacted("API_KEY"),
15
+ optionalModel: Config.option(Config.string("MODEL")),
16
+ enabled: Config.boolean("FEATURE_ENABLED").pipe(
17
+ Config.withDefault(false),
18
+ ),
19
+ })
25
20
  ```
26
21
 
27
22
  ## Config Recipes
@@ -53,15 +48,11 @@ Library-style layers often expose both concrete `layer(options)` and config-back
53
48
  export const layerConfig = (
54
49
  config: Config.Wrap<ClientOptions>,
55
50
  ) =>
56
- Layer.effect(
57
- Client.Service,
51
+ Layer.unwrap(
58
52
  Config.unwrap(config).pipe(
59
- Effect.flatMap(makeClient),
60
- Effect.map((client) => Client.Service.of(client)),
53
+ Effect.map(layer),
61
54
  ),
62
55
  )
63
56
  ```
64
57
 
65
- Use this pattern when a service naturally supports runtime config while still allowing tests to pass concrete values.
66
-
67
- Use `Layer.succeed(AppConfiguration.Service, testConfig)` when the app already wraps environment config in an application service and the test does not need to exercise Config decoding itself.
58
+ Use this pattern when a Layer naturally supports runtime config while still allowing callers to pass concrete values.
@@ -1,42 +1,10 @@
1
- # Services, Layers, And Modules
1
+ # Module Surfaces, Scoped Work, And Operation Helpers
2
2
 
3
- Use this when defining service tags, module surfaces, layer implementations, runtime wiring, typed errors, or `Effect.fn` operation boundaries.
3
+ Use this for the local module namespace convention, scoped long-lived work, whole-function `Effect.fn` transforms, and operation error helpers. Use `$effect-service-design` for service qualification, service module construction, Layer composition, requirement propagation, test Layers, and audits.
4
4
 
5
5
  ## Module Surface
6
6
 
7
- One opinionated application-module style uses file-local role names and one canonical ES module namespace projection. Follow the existing codebase's module style when it has one; this convention is not required by Effect.
8
-
9
- ```ts
10
- export interface Interface {
11
- readonly get: (id: UserId) => Effect.Effect<User, NotFound | PersistenceError>
12
- }
13
-
14
- export class Service extends Context.Service<Service, Interface>()(
15
- "@app/UserRepo",
16
- ) {}
17
-
18
- export const layer = Layer.effect(
19
- Service,
20
- Effect.gen(function* () {
21
- const sql = yield* SqlClient.SqlClient
22
-
23
- const get = Effect.fn("UserRepo.get")(function* (id: UserId) {
24
- // ...
25
- })
26
-
27
- return Service.of({ get })
28
- }),
29
- )
30
-
31
- export class NotFound extends Schema.TaggedErrorClass<NotFound>()(
32
- "UserRepo.NotFound",
33
- { id: UserId },
34
- ) {}
35
-
36
- export * as UserRepo from "./user-repo.js"
37
- ```
38
-
39
- Consumers use the module namespace.
7
+ One opinionated application-module style uses file-local role names and one canonical ES module namespace projection. Follow the existing codebase's module style when it has one; this convention is not required by Effect. Consumers use the module namespace.
40
8
 
41
9
  ```ts
42
10
  import { UserRepo } from "./user-repo.js"
@@ -66,25 +34,6 @@ Guidance:
66
34
  - The resulting `UserRepo.UserRepo === UserRepo` self-reference is unusual. Use this pattern only where the runtime and toolchain support it; otherwise use named exports or a separate barrel.
67
35
  - Export only intentional surface; keep local schemas, row codecs, helpers, and implementation details unexported.
68
36
  - Do not introduce TypeScript `namespace` declarations for organization.
69
- - Use a named service class such as `class UserRepo extends Context.Service...` when an external library or existing codebase does not use module namespace style.
70
-
71
- ## Layer Constructors
72
-
73
- Choose the layer constructor that matches the thing produced.
74
-
75
- ```ts
76
- Layer.succeed(Service, impl) // already-built service
77
- Layer.sync(Service, () => impl) // lazy synchronous service
78
- Layer.effect(Service, makeEffect) // effectful service acquisition
79
- ```
80
-
81
- Guidance:
82
-
83
- - Default real implementations to `Layer.effect(Service, Effect.gen(...))`.
84
- - Use `Layer.effectContext(...)` when one acquisition intentionally supplies multiple services, especially first-class test stubs or one client backing several service tags.
85
- - Use `Layer.unwrap(...)` when config or runtime discovery chooses/builds the layer.
86
- - Use `Layer.fresh(...)` or `Effect.provide(layer, { local: true })` only when a test or operation needs isolated acquisition.
87
- - Use `Context.Reference` rarely, only for ambient/defaultable runtime references where a safe default is real.
88
37
 
89
38
  ## Long-Lived Work
90
39
 
@@ -109,15 +58,6 @@ Guidance:
109
58
  - Do not run forever work inline during layer acquisition.
110
59
  - Do not expose public `start` methods unless the domain explicitly needs manual lifecycle control.
111
60
 
112
- ## Runtime Wiring
113
-
114
- - Use `Layer.provide(...)` to hide an implementation dependency.
115
- - Use `Layer.provideMerge(...)` only when the dependency should remain exposed for downstream consumers.
116
- - Use `Layer.mergeAll(...)` for independent exposed layers.
117
- - Prefer flat, topologically sorted runtime layer values with named subgraphs.
118
- - Avoid using `provideMerge` as a blind make-it-compile tool.
119
- - Avoid hiding important authority or lifecycle dependencies behind broad invisible provisioning.
120
-
121
61
  ## Effect.fn
122
62
 
123
63
  Use extra `Effect.fn(...)` arguments for wrappers that apply to the whole function call. Each transform receives `(effect, ...originalArgs)`.
@@ -1,27 +1,17 @@
1
1
  # Testing
2
2
 
3
- Use this when writing Effect tests, tests involving time, retry, schedules, concurrency, workers, services, fakes, or config.
3
+ Use this when writing Effect tests involving time, retry, schedules, concurrency, workers, or config. Use `$effect-service-design` for service test substitutes and reusable test Layers.
4
4
 
5
5
  ## Defaults
6
6
 
7
7
  - Use `it.effect` by default.
8
8
  - Use `it.live` only when real time or live runtime services are the behavior under test.
9
- - Use test layers and `ConfigProvider` rather than global mutation.
9
+ - Use `ConfigProvider` rather than global mutation for configuration tests.
10
10
  - Use `TestClock.setTime` / `TestClock.adjust` for sleeps, schedules, retries, leases, and timeouts.
11
11
  - Fork sleeping effects before advancing `TestClock`.
12
12
  - Avoid arbitrary `Effect.sleep(...)` in tests; it usually makes tests slow and flaky.
13
13
  - Assert typed failures, rollback, interruption, finalization, retry bounds, idempotency, concurrency laws, and malformed persistence where relevant.
14
14
 
15
- ```ts
16
- it.effect("finds a user", () =>
17
- Effect.gen(function* () {
18
- const users = yield* UserRepo.Service
19
- const result = yield* users.find(UserId.make("u1"))
20
- expect(Option.isSome(result)).toBe(true)
21
- }).pipe(Effect.provide(UserRepo.testLayer)),
22
- )
23
- ```
24
-
25
15
  ## Synchronization Instead Of Sleeps
26
16
 
27
17
  - Use `Deferred` for one-shot readiness/completion signals.
@@ -53,66 +43,6 @@ it.effect("publishes exactly once", () =>
53
43
  )
54
44
  ```
55
45
 
56
- ## First-Class App Test Stubs
57
-
58
- Use `TestInterface extends Interface`, `TestService`, and `testLayer` for reusable/stateful fakes.
59
-
60
- ```ts
61
- export interface Interface {
62
- readonly send: (message: Message) => Effect.Effect<void, SendError>
63
- }
64
-
65
- export class Service extends Context.Service<Service, Interface>()(
66
- "@app/Notifier",
67
- ) {}
68
-
69
- export interface TestInterface extends Interface {
70
- readonly sentMessages: () => Effect.Effect<ReadonlyArray<Message>>
71
- readonly failNextSend: (error: SendError) => Effect.Effect<void>
72
- }
73
-
74
- export class TestService extends Context.Service<TestService, TestInterface>()(
75
- "@app/Notifier/Test",
76
- ) {}
77
-
78
- export const testLayer = Layer.effectContext(
79
- Effect.gen(function* () {
80
- const sent = yield* Ref.make<ReadonlyArray<Message>>([])
81
- const nextFailure = yield* Ref.make<Option.Option<SendError>>(Option.none())
82
-
83
- const service = TestService.of({
84
- send: Effect.fn("Notifier.Test.send")(function* (message) {
85
- const failure = yield* Ref.getAndSet(nextFailure, Option.none())
86
- if (Option.isSome(failure)) return yield* Effect.fail(failure.value)
87
- yield* Ref.update(sent, (messages) => [...messages, message])
88
- }),
89
- sentMessages: Effect.fn("Notifier.Test.sentMessages")(function* () {
90
- return yield* Ref.get(sent)
91
- }),
92
- failNextSend: Effect.fn("Notifier.Test.failNextSend")(function* (error) {
93
- yield* Ref.set(nextFailure, Option.some(error))
94
- }),
95
- })
96
-
97
- return Context.empty().pipe(
98
- Context.add(Service, service),
99
- Context.add(TestService, service),
100
- )
101
- }),
102
- )
103
- ```
104
-
105
- Guidance:
106
-
107
- - The same object should back both the real `Service` tag and `TestService` tag.
108
- - Production code depends only on the real service tag.
109
- - Tests use `TestService` for control and inspection.
110
- - Use function-valued service members, including zero-argument operations, so `Effect.fn` fits naturally.
111
- - Use `Layer.succeed` for complete dead-simple static test implementations.
112
- - Use `Layer.mock` only for tiny local partial mocks where omitted members should fail loudly if used.
113
-
114
46
  ## Config In Tests
115
47
 
116
48
  Use `ConfigProvider.layer(ConfigProvider.fromUnknown(...))` when the test should exercise Config decoding.
117
-
118
- Use `Layer.succeed(AppConfiguration.Service, config)` when the app wraps decoded config in its own service and the test does not need to exercise env decoding.
@@ -2,17 +2,16 @@
2
2
  name: effect-backend-structure
3
3
  description: |
4
4
  Apply Effect-specific backend structure on top of backend-domain-structure.
5
- Use when creating or changing Effect services, layers, actions, repositories,
6
- transport adapters, DB integrations, test layers, or backend boilerplate in any
7
- Effect backend root. Enforces visible Effect requirements, layer-provided
8
- implementations, effect-solutions plus opensrc source lookup, and @effect/vitest
9
- testing conventions.
5
+ Use when creating or changing Effect actions, repositories, transport adapters,
6
+ DB integrations, test placement, or backend boilerplate in any Effect backend
7
+ root. Enforces actions-own-orchestration, integration dependency direction,
8
+ effect-solutions plus opensrc source lookup, and @effect/vitest conventions.
10
9
  compatibility: Requires Effect v4. Examples are reviewed against the version documented in this repository.
11
10
  ---
12
11
 
13
12
  # Effect Backend Structure
14
13
 
15
- Use this skill with `$backend-domain-structure` and `$effect` for Effect backend code. `$effect` owns Effect v4 API guidance.
14
+ Use this skill with `$backend-domain-structure` and `$effect` for Effect backend code. `$effect` owns Effect v4 API guidance. Use `$effect-service-design` for service qualification, service modules, Layers, requirements, test substitutes, and service audits.
16
15
 
17
16
  The agnostic skill owns the layer model:
18
17
 
@@ -21,24 +20,23 @@ The agnostic skill owns the layer model:
21
20
  - `features/*`
22
21
  - shared libraries and packages
23
22
 
24
- This skill adds Effect-specific services, layers, dependency visibility, source lookup, and testing rules.
23
+ This skill adds Effect-specific backend topology, action ownership, source lookup, and test placement rules.
25
24
 
26
25
  ## Workflow
27
26
 
28
27
  1. Identify the backend root from the current repo; do not assume a monorepo path.
29
28
  2. Read the nearest relevant `AGENTS.md` files.
30
- 3. Read `$backend-domain-structure`, `$effect`, and `references/layout.md`.
29
+ 3. Read `$backend-domain-structure`, `$effect`, `$effect-service-design` when services or Layers are in scope, and `references/layout.md`.
31
30
  4. Run the relevant `effect-solutions` guides before coding.
32
31
  5. Check local `opensrc` Effect sources when docs are vague or an API surface is unfamiliar.
33
32
  6. Place code using the agnostic backend layers plus the Effect rules below.
34
33
  7. Keep transport thin and run business logic through Effects.
35
- 8. Add or update colocated `@effect/vitest` tests with test layers for unit coverage and live layers for integration coverage.
34
+ 8. Add or update colocated `@effect/vitest` tests for unit and integration coverage.
36
35
 
37
36
  ## Required Source Lookup
38
37
 
39
38
  Always consult `effect-solutions` first. Use the smallest relevant set:
40
39
 
41
- - `effect-solutions show services-and-layers`
42
40
  - `effect-solutions show config`
43
41
  - `effect-solutions show data-modeling`
44
42
  - `effect-solutions show error-handling`
@@ -51,20 +49,9 @@ Use `opensrc` next when the guide is not enough:
51
49
 
52
50
  For non-Effect libraries, run `opensrc path <package>` or `opensrc path owner/repo`.
53
51
 
54
- ## Services and Layers
55
-
56
- - Define business services, repositories, and reusable capability interfaces with `Context.Service`.
57
- - Build implementations with layers and return values through `Service.of(...)`.
58
- - Let actions consume services/repositories through Effect accessors or `yield* Service`.
59
- - Keep action requirements visible until a feature, app, runner, or test layer provides them.
60
- - Compose feature dependencies in `features/<domain>/layer.ts` or the local equivalent.
61
- - Compose cross-feature and infrastructure dependencies in `platform/`.
62
- - Use `Layer.mergeAll` for same-level composition and shallow `Layer.provide` / `Layer.provideMerge` for wiring levels together.
63
- - Avoid `Effect.provide` inside actions, services, repositories, and transport adapters except at the final runner/test boundary.
64
-
65
52
  ## Effect Coding Rules
66
53
 
67
- - Use `Effect.fn("Domain.action")` for actions and service methods.
54
+ - Use `Effect.fn("Domain.action")` for actions.
68
55
  - Use `Schema.TaggedError` for domain failures.
69
56
  - Use branded IDs and Effect Schema for domain models.
70
57
  - Use `Config.*` instead of reading `process.env` inside Effect code.
@@ -75,19 +62,15 @@ For non-Effect libraries, run `opensrc path <package>` or `opensrc path owner/re
75
62
 
76
63
  - Keep tests inside the owning feature or module.
77
64
  - Use `@effect/vitest`.
78
- - Unit tests provide fake leaf services/repos via test layers.
79
- - Integration tests use live layers and public action or transport boundaries.
80
- - Expose assertions through test-state tags in `tests/support`.
81
- - Do not add test-only methods to production services.
82
- - Do not use module mocks for Effect services; provide a replacement `Layer`.
65
+ - Unit tests cover action and guard behavior.
66
+ - Integration tests use public action or transport boundaries.
67
+ - Apply `$effect-service-design` when tests replace or control a service.
83
68
 
84
69
  ## Output Checklist
85
70
 
86
71
  - `$backend-domain-structure` was applied
87
72
  - relevant `effect-solutions` guides were checked
88
73
  - `opensrc` sources were checked when needed
89
- - dependencies stay visible as Effect requirements or service dependencies
90
- - implementations are supplied by layers, not hidden imports or module mocks
91
74
  - code landed in the correct backend layer
92
75
  - actions own orchestration
93
76
  - services are only reusable mechanics
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Effect Backend Structure"
3
3
  short_description: "Effect backend architecture"
4
- default_prompt: "Use $backend-domain-structure alongside $effect-backend-structure to shape or bootstrap Effect backend code in any backend root; first apply agnostic backend layers, then apply Effect-specific services, layers, and testing rules."
4
+ default_prompt: "Use $backend-domain-structure alongside $effect-backend-structure to shape Effect backend topology and action boundaries; add $effect-service-design when services or Layers are in scope."
@@ -34,14 +34,14 @@ Dependency direction:
34
34
  - features may depend on other features only when the domain relationship is explicit and stable
35
35
  - integrations do not import features
36
36
 
37
- Layer ownership:
37
+ Composition file placement:
38
38
 
39
- - `platform/effect/app.ts` or local equivalent composes the app-wide live layer and provides infrastructure once
40
- - `platform/effect/request.ts` or local equivalent builds request-scoped services and runtime context only
41
- - `features/<domain>/layer.ts` composes that domain's action/repository/service requirements
42
- - `features/<domain>/tests/support/layer.ts` provides fake leaf layers and test-state tags for unit tests
39
+ - `platform/effect/app.ts` or local equivalent is the app-wide composition root
40
+ - `platform/effect/request.ts` or local equivalent owns request-scoped runtime context
41
+ - `features/<domain>/layer.ts` is the domain composition root
42
+ - `features/<domain>/tests/support/` owns feature-local reusable test support
43
43
 
44
- Keep dependency requirements visible until one of these layer files provides them. Do not import live implementations directly inside actions, services, repositories, or transport adapters.
44
+ Do not import live implementations directly inside actions, services, repositories, or transport adapters.
45
45
 
46
46
  Test layout:
47
47
 
@@ -59,10 +59,10 @@ Test layout:
59
59
  Testing split:
60
60
 
61
61
  - `tests/support`
62
- fake leaf layers plus state tags for assertions
62
+ feature-local reusable test support
63
63
  - `tests/unit`
64
- action and guard behavior on fake layers
64
+ action and guard behavior
65
65
  - `tests/integration`
66
- live router/app behavior on real layers
66
+ live router/app behavior
67
67
 
68
68
  Do not recreate a package-root `tests/` folder unless the current repo already requires that convention.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.