@punks/cli 3.1.10 → 3.1.12

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 (76) hide show
  1. package/dist/BASELINE_CHANGELOG.md +61 -0
  2. package/dist/CHANGELOG.md +57 -0
  3. package/dist/data/subagents/manifest.mjs +11 -6
  4. package/dist/index.js +28 -28
  5. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -0
  6. package/dist/skills/agnostic/docs/writing-beats/LICENSE +21 -0
  7. package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +11 -0
  8. package/dist/skills/agnostic/docs/writing-fragments/LICENSE +21 -0
  9. package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +11 -0
  10. package/dist/skills/agnostic/docs/writing-shape/LICENSE +21 -0
  11. package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +11 -0
  12. package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +24 -42
  13. package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +1 -1
  14. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +51 -78
  15. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +89 -212
  16. package/dist/skills/agnostic/generic/handoff/LICENSE +21 -0
  17. package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +11 -0
  18. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +1 -1
  19. package/dist/skills/agnostic/planning/create-plan/SKILL.md +19 -7
  20. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +19 -0
  21. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +27 -10
  22. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -2
  23. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +22 -6
  24. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +12 -0
  25. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +10 -2
  26. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +10 -1
  27. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +2 -0
  28. package/dist/skills/agnostic/quality/autoreview/SKILL.md +11 -2
  29. package/dist/skills/agnostic/quality/codebase-design/LICENSE +21 -0
  30. package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +11 -0
  31. package/dist/skills/agnostic/quality/review/LICENSE +21 -0
  32. package/dist/skills/agnostic/quality/review/SKILL.md +16 -11
  33. package/dist/skills/agnostic/quality/review/UPSTREAM.md +11 -0
  34. package/dist/skills/agnostic/quality/tdd/LICENSE +21 -0
  35. package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +11 -0
  36. package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +21 -0
  37. package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +11 -0
  38. package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
  39. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  40. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  41. package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  42. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  43. package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  44. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  45. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +199 -0
  46. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +31 -0
  47. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +4 -0
  48. package/dist/skills/languages/python/python-backend-structure/SKILL.md +91 -0
  49. package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +4 -0
  50. package/dist/skills/languages/python/python-design-patterns/SKILL.md +93 -69
  51. package/dist/skills/languages/python/python-project-structure/SKILL.md +4 -247
  52. package/dist/skills/phases/delivery-phase/SKILL.md +13 -4
  53. package/dist/skills/phases/delivery-phase/phases/closeout.md +3 -0
  54. package/dist/skills/phases/delivery-phase/phases/debug.md +8 -1
  55. package/dist/skills/phases/delivery-phase/phases/implement.md +11 -2
  56. package/dist/skills/phases/delivery-phase/phases/review.md +50 -29
  57. package/dist/skills/phases/delivery-phase/phases/router.md +56 -36
  58. package/dist/skills/phases/delivery-phase/references/artifact-state.md +8 -2
  59. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +60 -10
  60. package/dist/skills/phases/finder-phase/references/root-routing.md +6 -1
  61. package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
  62. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +622 -0
  63. package/dist/skills/phases/review-phase/SKILL.md +11 -42
  64. package/dist/skills/phases/review-phase/agents/openai.yaml +2 -0
  65. package/dist/skills/phases/review-phase/phases/prepare-review.md +105 -0
  66. package/dist/skills/phases/review-phase/phases/retain-report.md +113 -0
  67. package/dist/skills/phases/review-phase/phases/return-route.md +95 -0
  68. package/dist/skills/phases/review-phase/phases/router.md +78 -0
  69. package/dist/skills/phases/review-phase/phases/run-review.md +128 -0
  70. package/dist/skills/phases/review-phase/references/durable-report.md +153 -0
  71. package/dist/skills/phases/review-phase/references/runtime-handoff.md +138 -0
  72. package/dist/skills/phases/review-phase/references/state-graph.md +69 -0
  73. package/dist/skills/phases/review-phase/references/targets.md +156 -0
  74. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +819 -0
  75. package/package.json +56 -2
  76. package/dist/skills/phases/review-phase/REFERENCE.md +0 -147
@@ -58,6 +58,9 @@ Use [../assets/IMPLEMENTATION-NOTES-TEMPLATE.md](../assets/IMPLEMENTATION-NOTES-
58
58
  - Keep it current during the run, not only at the end.
59
59
  - For UI implementation changes, load [ui-screenshot-evidence.md](ui-screenshot-evidence.md) and keep `## UI Evidence Links` current.
60
60
  - For tasks with `runtime_validation: required`, load [runtime-product-validation.md](runtime-product-validation.md) and keep `## Runtime Validation Evidence` current.
61
+ - Seed `## Skill Application Evidence` from every task's
62
+ `implementation_skill_guidance`. Preserve each guidance item unchanged and
63
+ create exactly one evidence row for it.
61
64
 
62
65
  ## 5. Prepare the tech-debt ledger
63
66
 
@@ -104,6 +107,9 @@ Do not create the file when nothing durable must survive the run.
104
107
  - Accept missing RED/GREEN evidence only when the task has an explicit `reason_not_testable` or `tdd_status: not_applicable`.
105
108
  - Do not accept `reason_not_testable` for forgotten RED. If code came first, recover by writing the public-result RED test, recording failure, patching to pass, and marking `tdd_status: recovered`.
106
109
  - Treat every `review_mode` as required validation routing, never optional metadata.
110
+ - Forward every `implementation_skill_guidance` item unchanged to its worker.
111
+ Completion requires exactly one evidence record per guidance entry and no
112
+ unmatched record.
107
113
  - Treat `runtime_validation`, `runtime_target`, `runtime_evidence`, and `runtime_cleanup` as a task completion contract orthogonal to `review_mode`.
108
114
  - When `runtime_validation: required`, do not mark the task complete until the supported runtime has conclusive public-entrypoint-first evidence recorded under `## Runtime Validation Evidence`.
109
115
  - An exact runtime blocker is an honest blocked result, not completion. Record it and keep the affected task and acceptance criterion blocked.
@@ -124,6 +130,9 @@ After each completed wave:
124
130
  - record touched files in `PLAN.md`
125
131
  - fill `red_evidence` and `green_evidence`, or the accepted non-testable reason, before marking behavior-changing work complete
126
132
  - fill or reconcile `codebase_design_notes` when module shape, seam placement, adapters, or test surface changed
133
+ - reconcile `## Skill Application Evidence`: verify each skill identity, allowed
134
+ status, and how/where pointer against changed artifacts; for
135
+ `not_applicable`, verify why and where the guidance was assessed
127
136
  - update `IMPLEMENTATION-NOTES.md` with non-obvious decisions, surprises, or deviations
128
137
  - for UI implementation changes, record durable before/after screenshot asset links in `IMPLEMENTATION-NOTES.md`
129
138
  - for required runtime validation, record the scenario, public action, correlation or provenance ids, observed result, durable evidence, cleanup, and status or exact blocker in `IMPLEMENTATION-NOTES.md`
@@ -197,6 +206,9 @@ Before reporting back:
197
206
  - ensure **UI Evidence Links** has durable before/after asset links for UI implementation changes, or an explicit reason no pair was possible
198
207
  - ensure **Runtime Validation Evidence** contains conclusive proof for every required task, or an exact blocker with the task and acceptance criterion still marked blocked
199
208
  - ensure **Manual Review Checklist** has at least one concrete row, or one explicit non-applicability row
209
+ - ensure **Skill Application Evidence** has exact one-to-one cardinality with
210
+ plan guidance; allowed statuses are `loaded`, `applied`, and
211
+ `not_applicable`
200
212
  - ensure **Remaining work** matches any unmet or blocked criteria
201
213
  - ensure no in-goal debt remains as TODO, follow-up cleanup, or vague later-work text
202
214
  - ensure every tech-debt ledger entry has exact blocker/decision/owner/next action
@@ -30,6 +30,8 @@ For each task, extract:
30
30
  - acceptance criteria
31
31
  - validation
32
32
  - `tdd_target`
33
+ - `assigned_skills`
34
+ - `implementation_skill_guidance`
33
35
  - `review_mode`
34
36
  - `runtime_validation`
35
37
  - `runtime_target`
@@ -66,6 +68,7 @@ For each unblocked task:
66
68
  - use the worker-brief contract from [parallel-worker-brief.md](parallel-worker-brief.md)
67
69
  - assign the task's owned paths
68
70
  - assign its validation gates
71
+ - forward each `implementation_skill_guidance` item unchanged
69
72
 
70
73
  ## Step 5: Review and validate the wave
71
74
 
@@ -74,8 +77,11 @@ After the workers return:
74
77
  1. inspect their outputs for correctness and completeness
75
78
  2. compare the result against the task validation contract
76
79
  3. ensure the task log and touched files were written back into `PLAN.md`
77
- 4. ensure non-obvious deviations or surprises were written into `IMPLEMENTATION-NOTES.md`
78
- 5. retry or escalate failed work instead of quietly advancing
80
+ 4. ensure `IMPLEMENTATION-NOTES.md` has exactly one evidence record per guidance
81
+ entry and no unmatched record
82
+ 5. verify each record against the worker result and changed artifacts
83
+ 6. ensure non-obvious deviations or surprises were written into `IMPLEMENTATION-NOTES.md`
84
+ 7. retry or escalate failed work instead of quietly advancing
79
85
 
80
86
  Move to the next wave only after the current wave is validated and logged.
81
87
 
@@ -100,6 +106,8 @@ A task is complete only when all of the following are true:
100
106
  - `PLAN.md` reflects the completed status and execution log
101
107
  - touched files are recorded
102
108
  - any non-obvious deviations are reflected in `IMPLEMENTATION-NOTES.md`
109
+ - skill-application evidence has exact one-to-one cardinality with forwarded
110
+ guidance
103
111
 
104
112
  If any of these are missing, the task is not done yet.
105
113
 
@@ -24,6 +24,8 @@ Every worker brief should include:
24
24
  - `expected_red_failure`
25
25
  - `green_command`
26
26
  - `reason_not_testable`
27
+ - `assigned_skills` as planning provenance
28
+ - every `implementation_skill_guidance` item, unchanged
27
29
  - `review_mode`
28
30
  - `runtime_validation`
29
31
  - `runtime_target`
@@ -53,7 +55,12 @@ Each worker brief should require:
53
55
  14. stopping for parent clarification when a debt item requires a product/scope decision outside the assigned task
54
56
  15. capturing and linking durable before/after screenshot evidence when the task changes UI
55
57
  16. updating the plan entry with status, log, touched files, and gotchas before handoff closes
56
- 17. refusing completion for required runtime validation without conclusive recorded evidence; returning an exact blocker leaves the task blocked
58
+ 17. loading every forwarded skill and applying its stated behavior where the
59
+ task evidence supports it
60
+ 18. returning exactly one evidence record per guidance entry with skill,
61
+ `loaded`, `applied`, or `not_applicable` status, and a how/where pointer;
62
+ `not_applicable` also states why and where it was assessed
63
+ 19. refusing completion for required runtime validation without conclusive recorded evidence; returning an exact blocker leaves the task blocked
57
64
 
58
65
  ## Worker output contract
59
66
 
@@ -67,6 +74,8 @@ Require the worker to return:
67
74
  - durable UI before/after screenshot links when UI changed
68
75
  - required runtime-validation scenario, observed evidence, cleanup result, or exact blocker
69
76
  - validation intentionally deferred
77
+ - one skill-application evidence record for every forwarded guidance item,
78
+ preserving the exact skill identity
70
79
  - anything blocked or risky, with exact reason and required decision
71
80
 
72
81
  ## Scope rule
@@ -18,6 +18,8 @@ unblocked. Keep the wave boundary and parent validation.
18
18
  - post-wave review of worker outputs
19
19
  - acceptance-criteria coverage plus RED -> GREEN evidence, or explicit non-testable verification
20
20
  - task completion only after validation and plan/log updates
21
+ - unchanged guidance forwarding and exactly one verified skill-application
22
+ evidence record per guidance entry
21
23
  - clear reporting of retries, issues, or blockers
22
24
 
23
25
  ## Loop rule
@@ -22,8 +22,9 @@ Use when:
22
22
  - Read dependency docs/source/types when the finding depends on external behavior.
23
23
  - Reject unrealistic edge cases, speculative risks, broad rewrites, and fixes that over-complicate the codebase.
24
24
  - Prefer small fixes at the right ownership boundary; no refactor unless it clearly improves the bug class.
25
- - Keep going until structured review returns no accepted/actionable findings.
26
- - If a review-triggered fix changes code, rerun focused tests and rerun the structured review helper.
25
+ - Outside `review-phase`, keep going until structured review returns no
26
+ accepted/actionable findings. If a review-triggered fix changes code, rerun
27
+ focused tests and the structured review helper.
27
28
  - For security-audit suppression changes, verify accepted findings remain auditable: suppressed findings stay in structured output, active output keeps an unsuppressible suppression notice, and aggregate findings cannot hide unrelated active risk.
28
29
  - Never switch or override the requested review engine/model. If the review hits model capacity, retry the same command a few times with the same engine/model.
29
30
  - Be patient with large bundles. Structured review can take up to 30 minutes while the model call is active, especially with Codex tools or web search.
@@ -42,6 +43,14 @@ Use when:
42
43
  - If Gitcrawl reports a portable manifest mismatch, source/runtime DB health error, or stale portable-store checkout, run `gitcrawl doctor --json` and inspect `source_db_health`, `runtime_db_health`, and `portable_store_status` before falling back to live GitHub.
43
44
  - Do not push just to review. Push only when the user requested push/ship/PR update.
44
45
 
46
+ ## Bounded Review-Phase Call
47
+
48
+ When `review-phase` supplies a frozen normalized target, run this helper exactly
49
+ once as advisory candidate generation for that snapshot. Return its structured
50
+ candidates to the parent for verification. ClawPatch, when present, stays inside
51
+ this invocation. Do not repair findings or rerun the helper in this bounded
52
+ call; delivery owns later repair epochs and review passes.
53
+
45
54
  ## Pick Target
46
55
 
47
56
  Dirty local work:
@@ -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.
@@ -0,0 +1,11 @@
1
+ # Upstream provenance
2
+
3
+ Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/221ffca96736afefdc08ca7cf0b3965e9ea83f41/skills/engineering/codebase-design) at commit:
4
+
5
+ ```text
6
+ 221ffca96736afefdc08ca7cf0b3965e9ea83f41
7
+ ```
8
+
9
+ The adjacent `LICENSE` is the upstream MIT license retained with this skill.
10
+
11
+ Devpunks retains the upstream deep-module, seam, adapter, leverage, and locality vocabulary and adapts its design prompts to the shared skill library.
@@ -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.
@@ -1,26 +1,31 @@
1
1
  ---
2
2
  name: review
3
- description: Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
3
+ description: Review a frozen Git change or standalone plan, spec, or documentation bundle along separate Standards and Spec axes. Runs both checks in parallel and reports them side by side. Use for branch, PR, work-in-progress, or artifact review.
4
4
  ---
5
5
 
6
- Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
6
+ Two-axis review of either a frozen Git/diff target or a deterministic standalone
7
+ plan, spec, or documentation bundle:
7
8
 
8
9
  - **Standards** — does the code conform to this repo's documented coding standards?
9
10
  - **Spec** — does the code faithfully implement the originating issue / PRD / spec?
10
11
 
11
- Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
12
-
13
- The issue tracker should have been provided to you — run `/setup-matt-pocock-skills` if `docs/agents/issue-tracker.md` is missing.
12
+ Both axes run as **parallel sub-agents** so they do not pollute each other's
13
+ context. Keep their outcomes separate.
14
14
 
15
15
  ## Process
16
16
 
17
- ### 1. Pin the fixed point
17
+ ### 1. Freeze the target
18
18
 
19
- Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it.
19
+ When the caller supplies a normalized target, use it unchanged. Otherwise:
20
20
 
21
- Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
21
+ - For Git work, resolve the supplied commit, branch, tag, or actual PR base.
22
+ Capture `git diff <fixed-point>...HEAD` and
23
+ `git log <fixed-point>..HEAD --oneline` once.
24
+ - For a standalone plan, spec, or documentation review, sort the selected file
25
+ identities deterministically and use the caller's frozen ordered bundle.
22
26
 
23
- Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.
27
+ Before continuing, verify the fixed point or bundle identity and non-empty
28
+ inclusive scope. Fail invalid targets before dispatch.
24
29
 
25
30
  ### 2. Identify the spec source
26
31
 
@@ -61,13 +66,13 @@ Send a single message with two `Agent` tool calls. Use the `general-purpose` sub
61
66
 
62
67
  **Standards sub-agent prompt** — include:
63
68
 
64
- - The full diff command and commit list.
69
+ - The frozen target identity and the command or ordered file bundle used.
65
70
  - The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full — the sub-agent has no other access to it.
66
71
  - The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
67
72
 
68
73
  **Spec sub-agent prompt** — include:
69
74
 
70
- - The diff command and commit list.
75
+ - The frozen target identity and the command or ordered file bundle used.
71
76
  - The path or fetched contents of the spec.
72
77
  - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
73
78
 
@@ -0,0 +1,11 @@
1
+ # Upstream provenance
2
+
3
+ Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/801dca688564c529fa84f247f64472520d9ebe28/skills/in-progress/review) at commit:
4
+
5
+ ```text
6
+ 801dca688564c529fa84f247f64472520d9ebe28
7
+ ```
8
+
9
+ The adjacent `LICENSE` is the upstream MIT license retained with this skill.
10
+
11
+ Devpunks keeps the upstream two-axis Standards-versus-Spec review frame and adapts its execution to the shared review-phase and autoreview contracts.
@@ -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.
@@ -0,0 +1,11 @@
1
+ # Upstream provenance
2
+
3
+ Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/62f43a18177be6ec82da242e59ffbc490a4c22ea/skills/engineering/tdd) at snapshot commit:
4
+
5
+ ```text
6
+ 62f43a18177be6ec82da242e59ffbc490a4c22ea
7
+ ```
8
+
9
+ The adjacent `LICENSE` is the upstream MIT license retained with this skill.
10
+
11
+ Devpunks keeps the upstream vertical red-green loop and co-located testing references, then adds the hard RED gate, high-signal assertion guidance, and durable RED/GREEN evidence fields.
@@ -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.
@@ -0,0 +1,11 @@
1
+ # Upstream provenance
2
+
3
+ Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/62f43a18177be6ec82da242e59ffbc490a4c22ea/skills/engineering/improve-codebase-architecture) at snapshot commit:
4
+
5
+ ```text
6
+ 62f43a18177be6ec82da242e59ffbc490a4c22ea
7
+ ```
8
+
9
+ The adjacent `LICENSE` is the upstream MIT license retained with this skill.
10
+
11
+ Devpunks retains the upstream deepening/deletion-test framing and adapts the workflow to the shared requirements, wiki, and phase contracts.
@@ -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)`.