@punks/cli 3.1.11 → 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.
- package/dist/BASELINE_CHANGELOG.md +28 -0
- package/dist/CHANGELOG.md +27 -0
- package/dist/index.js +6 -6
- package/dist/skills/agnostic/docs/writing-beats/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/docs/writing-fragments/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/docs/writing-shape/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +24 -42
- package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +1 -1
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +51 -78
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +89 -212
- package/dist/skills/agnostic/generic/handoff/LICENSE +21 -0
- package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/quality/codebase-design/LICENSE +21 -0
- package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/quality/review/LICENSE +21 -0
- package/dist/skills/agnostic/quality/review/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/quality/tdd/LICENSE +21 -0
- package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +21 -0
- package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +11 -0
- package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
- package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
- package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
- package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
- package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
- package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
- package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +199 -0
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +31 -0
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +4 -0
- package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +622 -0
- package/dist/skills/phases/review-phase/SKILL.md +9 -36
- package/dist/skills/phases/review-phase/phases/prepare-review.md +105 -0
- package/dist/skills/phases/review-phase/phases/retain-report.md +113 -0
- package/dist/skills/phases/review-phase/phases/return-route.md +95 -0
- package/dist/skills/phases/review-phase/phases/router.md +78 -0
- package/dist/skills/phases/review-phase/phases/run-review.md +128 -0
- package/dist/skills/phases/review-phase/references/durable-report.md +11 -30
- package/dist/skills/phases/review-phase/references/runtime-handoff.md +138 -0
- package/package.json +63 -9
- package/dist/skills/phases/review-phase/REFERENCE.md +0 -85
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Goal
|
|
4
4
|
|
|
5
|
-
Organize frontend code
|
|
5
|
+
Organize frontend code around stable responsibility owners. Frameworks choose entrypoint names and
|
|
6
|
+
rendering mechanics; the ownership and dependency rules here stay the same.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
A common shape is:
|
|
8
9
|
|
|
9
10
|
```text
|
|
10
11
|
src/
|
|
@@ -13,245 +14,121 @@ src/
|
|
|
13
14
|
modules/
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
- **Framework composition** owns routes, screens, layouts, navigation shells, loading and error
|
|
18
|
+
boundaries, metadata, and application assembly.
|
|
19
|
+
- **Features** own coherent user-facing capabilities and workflows.
|
|
20
|
+
- **Modules** own reusable app-local capabilities, integrations, foundations, and app-wide wiring.
|
|
21
|
+
- **Shared libraries** own domains or primitives whose reuse boundary genuinely spans applications or
|
|
22
|
+
surfaces.
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `features/*`
|
|
21
|
-
Domain containers for user-visible product logic and page- or screen-facing slices.
|
|
22
|
-
- `modules/*`
|
|
23
|
-
Domain containers for reusable app-local support building blocks, integrations, and root-level dependencies reused by multiple features.
|
|
24
|
-
- shared libraries
|
|
25
|
-
Cross-app or cross-surface domains, primitives, tokens, utilities, and presentation helpers.
|
|
24
|
+
These labels may differ between projects. Preserve the responsibilities rather than imposing the
|
|
25
|
+
example names.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## Invariant Owner Classifier
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Start with the **invariant owner**: the smallest stable domain responsible for the behavior, its rules,
|
|
30
|
+
and the changes that must remain coherent. A route name, visual region, file type, or reuse count alone
|
|
31
|
+
does not establish ownership.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
Classify in this order:
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
1. Framework-mandated lifecycle or composition belongs to the framework composition layer.
|
|
36
|
+
2. A user-facing capability with its own workflow, policy, state transitions, or language belongs to a
|
|
37
|
+
feature domain.
|
|
38
|
+
3. An app-local capability serving several features, without owning a user-facing workflow, belongs to
|
|
39
|
+
a module domain.
|
|
40
|
+
4. A capability or primitive with real consumers across application or surface boundaries belongs to a
|
|
41
|
+
shared library or package.
|
|
42
|
+
5. A detail with no independent invariant stays with its current owner.
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
Prefer the deepest honest owner. Move code upward only when the broader owner truly governs it.
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
## Domain-Worthiness Classifier
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
Before creating a feature, module, package, or nested domain, **scan the siblings**. Look for the same
|
|
49
|
+
invariant owner, product language, workflow, change cadence, and consumers. Extend or rename an existing
|
|
50
|
+
owner when it already covers the responsibility.
|
|
40
51
|
|
|
41
|
-
|
|
52
|
+
A new domain is worthy when it gives a coherent responsibility a stable name and at least one real
|
|
53
|
+
boundary, such as independent policy, lifecycle, state, workflow, consumer contract, or reuse scope.
|
|
54
|
+
Several tightly related files may form one worthy domain; one substantial public boundary may also be
|
|
55
|
+
enough. File count is not the classifier.
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
- resistance to feature leakage across the app
|
|
57
|
+
Keep implementation with its current owner when the proposed split is only navigational. In particular,
|
|
58
|
+
reject a cosmetic micro-feature or micro-module named after a panel, button, page fragment, file type, or
|
|
59
|
+
temporary layout. Keep a one-file folder folded into its owner until that folder expresses a deliberate
|
|
60
|
+
public or semantic boundary. This prevents directory depth from masquerading as architecture.
|
|
48
61
|
|
|
49
|
-
##
|
|
62
|
+
## Layer Responsibilities
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
### Framework Composition
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Put it in a feature domain under `features/*`.
|
|
57
|
-
3. Is this reusable inside the app but not itself a page- or screen-facing product slice?
|
|
58
|
-
Put it in a module domain under `modules/*`.
|
|
59
|
-
4. Is this generic enough to reuse across apps, packages, or surfaces?
|
|
60
|
-
Put it in a shared library or shared package.
|
|
66
|
+
Keep entrypoints thin: translate framework lifecycle into domain calls, assemble higher-level pieces,
|
|
67
|
+
and map domain results to framework output. Product policy, long workflows, reusable product sections,
|
|
68
|
+
and scattered client setup belong to their invariant owners.
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
### Features
|
|
63
71
|
|
|
64
|
-
|
|
72
|
+
A feature owns a coherent user-visible capability: its workflow, policy, state, data interaction,
|
|
73
|
+
presentation, and feature-local helpers. Examples include authentication, checkout, account settings,
|
|
74
|
+
or a dashboard capability when each name identifies real product behavior.
|
|
65
75
|
|
|
66
|
-
###
|
|
76
|
+
### Modules
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- route files
|
|
73
|
-
- screen entrypoint files
|
|
74
|
-
- layouts and navigation shells
|
|
75
|
-
- loading, error, empty, and not-found boundaries
|
|
76
|
-
- route or screen metadata
|
|
77
|
-
- tiny composition wrappers
|
|
78
|
-
|
|
79
|
-
Bad fits:
|
|
80
|
-
|
|
81
|
-
- domain logic
|
|
82
|
-
- long form flows
|
|
83
|
-
- reusable product sections
|
|
84
|
-
- app client setup scattered across many entrypoints
|
|
85
|
-
- business state orchestration
|
|
86
|
-
|
|
87
|
-
The entrypoint should mostly assemble higher-level pieces.
|
|
88
|
-
|
|
89
|
-
### `features/*`
|
|
90
|
-
|
|
91
|
-
Use features for meaningful user-facing domains.
|
|
92
|
-
|
|
93
|
-
Good fits:
|
|
94
|
-
|
|
95
|
-
- authentication screens and flows
|
|
96
|
-
- dashboard sections
|
|
97
|
-
- account settings areas
|
|
98
|
-
- navigation experiences
|
|
99
|
-
- user-facing forms and workflows
|
|
100
|
-
- domain-specific business state and orchestration
|
|
101
|
-
|
|
102
|
-
A feature domain may contain local UI, state, data access, config, helpers, and sub-sections.
|
|
103
|
-
|
|
104
|
-
Do not create a feature for every tiny component. A feature should represent a coherent user-facing capability.
|
|
105
|
-
|
|
106
|
-
### `modules/*`
|
|
107
|
-
|
|
108
|
-
Use modules for reusable app-local support domains.
|
|
109
|
-
|
|
110
|
-
Good fits:
|
|
111
|
-
|
|
112
|
-
- auth client setup
|
|
113
|
-
- API client wiring
|
|
114
|
-
- providers
|
|
115
|
-
- routes or navigation configuration
|
|
116
|
-
- metadata helpers
|
|
117
|
-
- form foundations reused across several features
|
|
118
|
-
- domain service adapters used by many features
|
|
119
|
-
- UI library domains
|
|
120
|
-
- framework integration layers
|
|
121
|
-
- root-level dependencies shared by several features
|
|
122
|
-
|
|
123
|
-
Modules are reusable inside the app, but they are not page-facing product slices.
|
|
124
|
-
|
|
125
|
-
A `modules/ui` domain is valid when it is effectively the app's local UI library: primitives, brand-styled abstractions, UI behavior, and UI-specific logic reused across many features.
|
|
78
|
+
A module owns an app-local capability reused by multiple features: client setup, application providers,
|
|
79
|
+
navigation configuration, form foundations, service adapters, metadata mechanics, or an app-local UI
|
|
80
|
+
system. Modules support product flows without owning those flows.
|
|
126
81
|
|
|
127
82
|
### Shared Libraries
|
|
128
83
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- shared domain abstractions
|
|
134
|
-
- UI primitives
|
|
135
|
-
- design tokens
|
|
136
|
-
- framework-neutral helpers
|
|
137
|
-
- icons
|
|
138
|
-
- styling foundations
|
|
139
|
-
- generic presentation helpers
|
|
140
|
-
|
|
141
|
-
Bad fits:
|
|
142
|
-
|
|
143
|
-
- page sections
|
|
144
|
-
- product workflows
|
|
145
|
-
- app-specific domain widgets
|
|
146
|
-
- route- or screen-specific logic
|
|
147
|
-
|
|
148
|
-
If the code is only reusable within one app, keep it inside that app, usually in `modules/*`.
|
|
149
|
-
|
|
150
|
-
In a monorepo, shared packages should still be domain-based internally.
|
|
151
|
-
|
|
152
|
-
Good package patterns:
|
|
153
|
-
|
|
154
|
-
- a package that is itself one coherent shared domain
|
|
155
|
-
- a package with a small number of clearly separated internal domains
|
|
156
|
-
|
|
157
|
-
Examples:
|
|
158
|
-
|
|
159
|
-
- `<shared-ui-root>/src/primitives/*`
|
|
160
|
-
- `<shared-ui-root>/src/brand/*`
|
|
161
|
-
- `<auth-package-root>/src/client/*`
|
|
162
|
-
- `<auth-package-root>/src/server/*`
|
|
163
|
-
- `<forms-package-root>/src/fields/*`
|
|
164
|
-
|
|
165
|
-
Bad package patterns:
|
|
166
|
-
|
|
167
|
-
- a giant `<shared-ui-root>/src/components` folder holding unrelated concerns
|
|
168
|
-
- `<shared-foundation-root>/src/utils` growing without domain ownership
|
|
169
|
-
- a single package collecting every reusable concern just because it is shared
|
|
170
|
-
|
|
171
|
-
If a package contains several unrelated concerns, split the package or introduce internal domain folders.
|
|
172
|
-
|
|
173
|
-
## Import Boundaries
|
|
174
|
-
|
|
175
|
-
Keep dependencies flowing downward.
|
|
176
|
-
|
|
177
|
-
- framework composition layer may import:
|
|
178
|
-
- `features/*`
|
|
179
|
-
- `modules/*`
|
|
180
|
-
- bootstrapping helpers
|
|
181
|
-
- `features/*` may import:
|
|
182
|
-
- sibling files in the same feature
|
|
183
|
-
- `modules/*`
|
|
184
|
-
- shared libraries
|
|
185
|
-
- `modules/*` may import:
|
|
186
|
-
- sibling files in the same module
|
|
187
|
-
- shared libraries
|
|
188
|
-
- external libraries
|
|
189
|
-
- shared packages may import:
|
|
190
|
-
- sibling files inside the same package domain
|
|
191
|
-
- lower-level shared utilities inside that package
|
|
192
|
-
- external libraries
|
|
193
|
-
|
|
194
|
-
Avoid these inversions:
|
|
195
|
-
|
|
196
|
-
- `modules/*` importing `features/*`
|
|
197
|
-
- shared libraries importing app-local code
|
|
198
|
-
- one shared package domain importing unrelated package domains without a clear boundary
|
|
199
|
-
- framework entrypoints importing many low-level helpers instead of a feature-level entrypoint
|
|
200
|
-
|
|
201
|
-
## Refactoring Guide
|
|
202
|
-
|
|
203
|
-
When migrating from flat buckets like `components`, `hooks`, `lib`, and `utils`:
|
|
204
|
-
|
|
205
|
-
- move framework-facing composition into the framework composition layer
|
|
206
|
-
- group page- or screen-facing workflows under domain folders in `features/*`
|
|
207
|
-
- group reusable app-local support code under domain folders in `modules/*`
|
|
208
|
-
- move only truly shared code into shared libraries or shared packages
|
|
209
|
-
|
|
210
|
-
Name folders by domain or responsibility, not by file type.
|
|
84
|
+
A shared library owns code reused across application or surface boundaries: domain abstractions, design
|
|
85
|
+
tokens, primitives, framework-neutral helpers, or a coherent presentation system. Keep app-specific
|
|
86
|
+
widgets and workflows with the app that owns them. Inside a shared package, apply the same
|
|
87
|
+
domain-worthiness test; shared code is still organized by responsibility.
|
|
211
88
|
|
|
212
|
-
|
|
89
|
+
## Recursive Semantic Internals
|
|
213
90
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
- `modules/providers`
|
|
219
|
-
- `modules/api`
|
|
220
|
-
- `modules/ui`
|
|
91
|
+
The ownership rule is recursive at every directory and package depth. Within a feature, module, or
|
|
92
|
+
shared package, group semantic subdomains before adding technical folders. Introduce local folders such
|
|
93
|
+
as `state/`, `api/`, `models/`, or `presentation/` only when several related internals benefit from that
|
|
94
|
+
secondary grouping.
|
|
221
95
|
|
|
222
|
-
|
|
96
|
+
For example, a billing feature may contain semantic `invoices/` and `payment-methods/` subdomains. Each
|
|
97
|
+
subdomain follows the same invariant-owner, sibling-scan, public-boundary, and acyclic-dependency rules.
|
|
98
|
+
A flat technical bucket remains a poor substitute for semantic ownership even when nested.
|
|
223
99
|
|
|
224
|
-
|
|
225
|
-
- `<shared-ui-root>/src/brand`
|
|
226
|
-
- `<auth-package-root>/src/client`
|
|
227
|
-
- `<auth-package-root>/src/server`
|
|
228
|
-
- `<table-package-root>/src/hooks`
|
|
100
|
+
## Public Entrypoints and Dependencies
|
|
229
101
|
|
|
230
|
-
|
|
102
|
+
Give every cross-domain dependency a **deliberate public entrypoint**. Export only the contracts,
|
|
103
|
+
views, operations, and types the domain intentionally offers. Imports within a domain may reach its
|
|
104
|
+
private internals; consumers use its public entrypoint.
|
|
231
105
|
|
|
232
|
-
-
|
|
233
|
-
- `features/auth/state`
|
|
234
|
-
- `features/auth/api`
|
|
235
|
-
- `modules/auth/config`
|
|
236
|
-
- `modules/api/lib`
|
|
237
|
-
- `<auth-package-root>/src/client`
|
|
238
|
-
- `<shared-ui-root>/src/brand/components`
|
|
106
|
+
Keep the graph one-way and acyclic:
|
|
239
107
|
|
|
240
|
-
|
|
108
|
+
- framework composition imports feature and module entrypoints;
|
|
109
|
+
- features import modules and shared-library entrypoints;
|
|
110
|
+
- modules import shared-library entrypoints and external libraries;
|
|
111
|
+
- shared libraries remain independent of app-local code;
|
|
112
|
+
- cross-domain deep imports and cycles are rejected;
|
|
113
|
+
- lazy loading, re-export chains, and path aliases preserve these boundaries rather than conceal cycles.
|
|
241
114
|
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
|
|
245
|
-
|
|
115
|
+
Peer-feature imports are highly discouraged. Permit one only when the dependency is justified as a real
|
|
116
|
+
one-way, acyclic relationship and it passes through the imported feature's public entrypoint. When both
|
|
117
|
+
features own part of the contract, move the common invariant to the nearest honest module or shared
|
|
118
|
+
domain. A reverse import or deep import invalidates the exception.
|
|
246
119
|
|
|
247
|
-
|
|
120
|
+
## Migration and Review
|
|
248
121
|
|
|
249
|
-
|
|
122
|
+
When migrating flat `views`, `state`, `lib`, or `utils` buckets:
|
|
250
123
|
|
|
251
|
-
|
|
124
|
+
1. Inventory behavior and identify each invariant owner.
|
|
125
|
+
2. Scan existing sibling domains before proposing new ones.
|
|
126
|
+
3. Move framework composition, feature behavior, app-local capabilities, and application- or
|
|
127
|
+
surface-spanning code to their honest owners.
|
|
128
|
+
4. Create public entrypoints and update consumers before making internals private.
|
|
129
|
+
5. Repeat the classifier recursively inside each changed domain.
|
|
130
|
+
6. Validate changed behavior and dependency direction with the narrowest checks the project already
|
|
131
|
+
supports.
|
|
252
132
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
- Is reusable app-local logic living in a module instead of scattered buckets?
|
|
256
|
-
- Is truly shared code kept out of app-local layers?
|
|
257
|
-
- Are shared packages internally domain-based instead of flat dumping grounds?
|
|
133
|
+
The review is complete when every changed responsibility has one honest owner, every new domain passes
|
|
134
|
+
the worthiness classifier, and every affected cross-domain edge is public, one-way, and acyclic.
|
|
@@ -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/productivity/handoff) 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 keeps the compact redacted continuation handoff and adapts the surrounding repository conventions.
|
|
@@ -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.
|
|
@@ -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,
|
|
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
|
-
-
|
|
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
|
|
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
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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.
|
|
57
|
-
Client.Service,
|
|
51
|
+
Layer.unwrap(
|
|
58
52
|
Config.unwrap(config).pipe(
|
|
59
|
-
Effect.
|
|
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
|
|
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.
|