@danieljvdm/dev-kit 0.13.0 → 0.14.0

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/README.md CHANGED
@@ -179,6 +179,7 @@ tool versions. A project-local process lock also prevents concurrent applies.
179
179
  "include": [
180
180
  "dev-kit",
181
181
  "effect",
182
+ "open-pull-request",
182
183
  "workers-best-practices",
183
184
  "wrangler",
184
185
  "serve-sim",
@@ -198,11 +199,14 @@ tool versions. A project-local process lock also prevents concurrent applies.
198
199
  ```
199
200
 
200
201
  - `dev-kit` installs guidance for operating the toolkit itself.
202
+ - `open-pull-request` provides a conventional, context-complete PR workflow
203
+ with terse English descriptions and verified proof of work.
201
204
  - `effect` expands to the package-guidance `effect-ts` bootstrap, the
202
205
  opinionated `effect-architecture-audit`, `build-effect-apis` for shared HTTP
203
206
  contracts and clients, and `build-effect-clis` for typed command-line
204
- applications. The focused references cover Effect Atom, TanStack Start,
205
- Cloudflare Workers, child processes, runtime entrypoints, and CLI testing.
207
+ applications, one-off scripts, and CI/deploy/build automation. The focused
208
+ references cover Effect Atom, TanStack Start, Cloudflare Workers, child
209
+ processes, runtime entrypoints, and script/CLI testing.
206
210
  - Prefer individual external skills such as `workers-best-practices` and
207
211
  `wrangler`, selected after scanning the project for relevant technologies.
208
212
  - `serve-sim` selects the approved Evan Bacon simulator skill directly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danieljvdm/dev-kit",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "private": false,
5
5
  "description": "Declarative project development toolkit with portable agent skills.",
6
6
  "license": "MIT",
@@ -64,6 +64,28 @@ from another version.
64
64
  runs on Cloudflare Workers or uses `effect-cf`, bindings, Durable Objects,
65
65
  Queues, WebSockets, streaming, or raw byte routes.
66
66
 
67
+ ## Choose typed Schema codecs by default
68
+
69
+ Match the codec to the static type at the call site. When decoding a value that
70
+ is already typed as the schema's `Encoded` type, use `Schema.decodeEffect` or
71
+ the typed `Schema.decodeSync`, `Schema.decodeExit`, `Schema.decodeOption`,
72
+ `Schema.decodeResult`, or `Schema.decodePromise` variant. When encoding a value
73
+ that is already typed as the schema's `Type`, use `Schema.encodeEffect` or the
74
+ corresponding typed `Schema.encodeSync`, `Schema.encodeExit`,
75
+ `Schema.encodeOption`, `Schema.encodeResult`, or `Schema.encodePromise` variant.
76
+
77
+ Reserve `Schema.decodeUnknown*` and `Schema.encodeUnknown*` for genuinely
78
+ untyped boundaries: values from `JSON.parse`, `Response.json`, external
79
+ messages, or persistence APIs whose declared result is actually `unknown`.
80
+ Never choose an unknown codec to bypass a `Schema.Class` or other static type
81
+ mismatch. Map the source value or construct the correct schema `Type` first,
82
+ then use the typed encoder; similarly, establish the correct `Encoded` value
83
+ before using a typed decoder.
84
+
85
+ This rule is toolchain-neutral. A repository may reinforce it with a lint
86
+ warning and a documented local suppression for a justified untyped boundary,
87
+ but the boundary and type reasoning remain the source of truth.
88
+
67
89
  ## Boundary rules
68
90
 
69
91
  - Let schemas own wire validation, encoding, status metadata, and branded IDs.
@@ -11,6 +11,20 @@ test integration and command authority.
11
11
  - Assert each expected error carries the intended HTTP status and body encoding.
12
12
  - Compare or smoke-test generated OpenAPI when the public contract changes.
13
13
 
14
+ ## Unknown codec audit
15
+
16
+ Inventory every `Schema.decodeUnknown*` and `Schema.encodeUnknown*` call in the
17
+ changed scope. Record a concrete untyped-boundary justification for each one,
18
+ such as `JSON.parse`, `Response.json`, an external message, or a persistence API
19
+ whose declared result is actually `unknown`. Replace any call whose input is
20
+ already the schema's `Encoded` or `Type` with the corresponding typed `Effect`,
21
+ `Sync`, `Exit`, `Option`, `Result`, or `Promise` codec.
22
+
23
+ An unknown codec is not a valid workaround for a `Schema.Class` or other static
24
+ type mismatch: map or construct the correct typed value instead. If the
25
+ repository enforces this policy with a lint warning, keep any necessary local
26
+ suppression documented with the same concrete boundary justification.
27
+
14
28
  ## Server tests
15
29
 
16
30
  - Build every changed group and fail the test if an endpoint handler is missing.
@@ -47,4 +61,5 @@ Account for every changed endpoint across these columns:
47
61
  | Params, query, headers, payload, success, errors | Scope, provided services, errors | Identifier, invariants, workflow | Typed call shape, identity, cache/invalidation | Round-trip and boundary behavior |
48
62
 
49
63
  Completion means every changed endpoint has an entry in every applicable
50
- column and the repository's formatter, linter, typechecker, and tests pass.
64
+ column, every unknown codec call has a concrete boundary justification, and the
65
+ repository's formatter, linter, typechecker, and tests pass.
@@ -1,30 +1,61 @@
1
1
  ---
2
2
  name: build-effect-clis
3
- description: Build and maintain command-line applications entirely with Effect. Use when creating or changing CLI commands, arguments, flags, subcommands, prompts, help, JSON output, dry-run or confirmation flows, platform services, child processes, Node/Bun entrypoints, or CLI integration tests.
3
+ description: Write and maintain every executable script and command-line application in an Effect repository as an Effect program. Use when creating or changing any script, one-off automation, CI check, deploy/release/build glue, package-script entrypoint, CLI command, arguments, flags, prompts, child process, filesystem or environment workflow, Node/Bun entrypoint, or integration test—including extending an existing plain-TypeScript script.
4
4
  ---
5
5
 
6
- # Build Effect CLIs
6
+ # Build Effect Scripts and CLIs
7
7
 
8
- Treat a CLI as an Effect application: the `Command` tree owns the user-facing
9
- contract, handlers adapt decoded input into application workflows, services own
10
- capabilities, and the executable entrypoint supplies platform Layers and runs
11
- the program. Do not introduce a separate CLI framework for new command work.
8
+ ## Effect-first scope
9
+
10
+ Every executable script and CLI in an Effect repository is an Effect program.
11
+ This includes one-off scripts, CI checks, deploy/release/build glue, files under
12
+ `scripts/`, package-script targets, migrations, and application entrypoints—not
13
+ only polished command-line tools.
14
+
15
+ Apply this rule when modifying code as well as when creating it. When a task
16
+ touches an existing plain-TypeScript script, convert the whole script to Effect
17
+ in the same change; matching the surrounding file's style or minimizing the
18
+ diff is not a valid exception. Prefer the repository's established Effect
19
+ patterns, including those in sibling scripts, over legacy patterns in the file
20
+ being converted.
21
+
22
+ Leave a script outside Effect only for a good, concrete technical or user
23
+ constraint that makes Effect unsuitable. Explicitly state that reason before
24
+ proceeding and in the final handoff, and keep the exception as narrow as
25
+ possible. Convenience, one-off status, and existing plain-TypeScript style are
26
+ not sufficient reasons.
27
+
28
+ Use Effect platform services for filesystem, path, environment, terminal, and
29
+ child-process work. Raw `node:*` or Bun runtime imports, `process.env`, `fs`,
30
+ `path`, `child_process`, and synchronous helpers such as `execFileSync` do not
31
+ belong in script workflows. If the installed Effect platform has no required
32
+ capability, isolate the runtime call in an explicit boundary adapter whose API
33
+ returns an Effect with typed errors, and document why that adapter is required.
34
+
35
+ Treat each executable as an Effect application. For a CLI, the `Command` tree
36
+ owns the user-facing contract, handlers adapt decoded input into application
37
+ workflows, services own capabilities, and the executable entrypoint supplies
38
+ platform Layers and runs the program. A fixed automation script with no public
39
+ arguments may export an Effect workflow directly instead of inventing a
40
+ `Command` tree. Do not introduce a separate CLI framework for command work.
12
41
 
13
42
  Effect CLI and process APIs are version-sensitive. Read the target repository's
14
43
  `node_modules/effect/AGENTS.md` completely, follow its CLI and child-process
15
44
  references, and confirm exact signatures from the installed declarations before
16
45
  editing.
17
46
 
18
- ## Build the command boundary
47
+ ## Build the executable boundary
19
48
 
20
49
  1. Inventory the existing executable entrypoints, package scripts, command
21
50
  tree, shared flags, prompts, application services, platform Layers, output
22
51
  modes, and subprocess helpers. Finish when every way to invoke and test the
23
- CLI is known.
24
- 2. Read [command-design.md](references/command-design.md). Define arguments and
25
- flags with `Argument` and `Flag`, compose commands with `Command`, and give
26
- every public input useful help. Use `Effect.fn` handlers and yield the root
27
- command when a subcommand needs shared parent input.
52
+ affected scripts or CLI is known, including sibling Effect scripts whose
53
+ patterns should replace legacy plain-TypeScript style.
54
+ 2. When the executable accepts public arguments or flags, read
55
+ [command-design.md](references/command-design.md). Define arguments and flags
56
+ with `Argument` and `Flag`, compose commands with `Command`, and give every
57
+ public input useful help. Use `Effect.fn` handlers and yield the root command
58
+ when a subcommand needs shared parent input.
28
59
  3. Keep handlers thin. Decode user and file input at the boundary, enforce
29
60
  cross-input invariants, then call an application service. Keep persistence,
30
61
  network calls, orchestration, retries, and transactions in services.
@@ -32,15 +63,15 @@ editing.
32
63
  platform failures into application-owned errors near the adapter that knows
33
64
  what the operation means. Let defects remain defects.
34
65
  5. Read [entrypoints-and-testing.md](references/entrypoints-and-testing.md).
35
- Export the command tree without running it, wire one Node or Bun entrypoint,
36
- and verify help, parsing, successful execution, expected failure, JSON
37
- output, and every dry-run or confirmation path.
66
+ Export the command tree or fixed script workflow without running it, wire
67
+ one Node or Bun entrypoint, and verify the applicable success, expected
68
+ failure, help, parsing, JSON, dry-run, and confirmation paths.
38
69
 
39
70
  ## Optional branches
40
71
 
41
72
  - Read [processes-and-platform.md](references/processes-and-platform.md) when a
42
- command reads files, inspects the environment, starts child processes,
43
- streams their output, or differs between Node and Bun.
73
+ script or command reads files, inspects the environment, starts child
74
+ processes, streams their output, or differs between Node and Bun.
44
75
  - Use `Prompt` only for an intentionally interactive path. Keep required inputs
45
76
  expressible as arguments or flags so automation never depends on a terminal.
46
77
  - Add `--dry-run` for commands that mutate important state and `--yes` for
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "Build Effect CLIs"
3
- short_description: "Build typed Effect command-line applications"
4
- default_prompt: "Use $build-effect-clis to build a typed Effect CLI with clear commands, platform boundaries, and tests."
2
+ display_name: "Build Effect Scripts and CLIs"
3
+ short_description: "Write every script and CLI with Effect"
4
+ default_prompt: "Use $build-effect-clis to write or modify this script or CLI as an Effect program with explicit platform boundaries and tests."
@@ -4,6 +4,11 @@ Separate command definition from execution. Importing a command module in a test
4
4
  or another program must not parse `process.argv`, start fibers, or terminate the
5
5
  process.
6
6
 
7
+ For a fixed CI or automation script with no public command syntax, export its
8
+ Effect workflow and provide platform Layers only in a thin executable module;
9
+ it does not need an artificial `Command` tree. Use the same `runMain` boundary,
10
+ typed failures, platform services, and import-safety rules shown below.
11
+
7
12
  ```ts
8
13
  // src/cli/command.ts
9
14
  export const command = root.pipe(Command.withSubcommands([deploy, status]));
@@ -1,8 +1,9 @@
1
1
  # Processes and platform services
2
2
 
3
3
  Use Effect platform services inside CLI workflows. Keep direct `node:*`, Bun
4
- globals, `process`, filesystem calls, and shell execution at explicit adapters
5
- or the executable boundary.
4
+ globals, `process`, filesystem calls, and shell execution inside explicit
5
+ boundary adapters. The executable boundary itself should use Effect platform
6
+ runtime and service APIs.
6
7
 
7
8
  ## Own subprocess behavior in a service
8
9
 
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: open-pull-request
3
+ description: Open pull requests with conventional commits, terse context-complete English descriptions, and verified proof of work. Use whenever preparing or opening a pull request, including checking commit history, drafting the title or body, and attaching screenshots or other evidence.
4
+ ---
5
+
6
+ # Open a Pull Request
7
+
8
+ Produce a PR that a reviewer can understand and trust without access to the
9
+ task conversation.
10
+
11
+ ## Prepare the branch
12
+
13
+ 1. Read the repository's contribution instructions and PR template. Identify
14
+ the intended base branch, then inspect the full commit range, diff, and
15
+ working tree. Finish when the PR scope contains no accidental changes and
16
+ the description will cover the branch as it exists, not merely the latest
17
+ task.
18
+ 2. Use Conventional Commits for every commit you create and for the PR title:
19
+ `type(scope): imperative summary`. Follow repository-specific types and
20
+ scopes, and omit the scope when it adds no useful context. Otherwise use a
21
+ precise standard type such as `feat`, `fix`, `refactor`, `docs`, `test`,
22
+ `build`, `ci`, or `chore`. Keep each commit to one logical concern. Rewrite
23
+ only commits you created and know are unshared; get approval before
24
+ rewriting user-authored or published history.
25
+ 3. Run the repository's required validation on the final branch state. Record
26
+ the exact commands and results, then collect the strongest available proof
27
+ of the changed behavior. Finish when every claim in the PR can be traced to
28
+ the diff, a check result, or an artifact.
29
+
30
+ ## Write for the reviewer
31
+
32
+ Write terse, plain English for someone with little context. Lead with the
33
+ observable outcome and add only the minimum reason needed to understand it.
34
+ Prefer short bullets and concrete nouns. Expand uncommon acronyms. Describe
35
+ behavior and impact rather than narrating files, implementation steps, or the
36
+ task conversation.
37
+
38
+ Use the repository's required template when present. Otherwise use this small
39
+ shape and omit empty sections:
40
+
41
+ ```md
42
+ ## Summary
43
+
44
+ - <What changes for a user, operator, or developer>
45
+ - <Why it matters, only when the first bullet does not make that clear>
46
+
47
+ ## Proof
48
+
49
+ - `<validation command>` — passed
50
+ - <Screenshot, sample output, or other verified artifact>
51
+ ```
52
+
53
+ Keep the summary to one to three bullets. Make the title specific enough to
54
+ stand alone in release notes and conventional enough to become the squash
55
+ commit without editing.
56
+
57
+ ## Show proof of work
58
+
59
+ Proof is something the reviewer can inspect, not an assertion that the change
60
+ works.
61
+
62
+ - For a runnable UI or visual feature, capture and attach a screenshot or short
63
+ recording of the actual final state. Use a representative viewport, add a
64
+ short caption, and check the artifact for secrets or personal data.
65
+ - For CLI, API, or automation behavior, include concise terminal output, a
66
+ request/response example, generated artifact, or execution log when it proves
67
+ more than the validation command alone.
68
+ - For a bug fix or behavior change, prefer before/after evidence when it is
69
+ practical and materially clarifies the result.
70
+ - For internal-only changes, exact passing validation commands may be the most
71
+ useful proof.
72
+
73
+ Include only evidence that was actually produced and verified. When expected
74
+ visual proof cannot be produced, state the concrete reason briefly instead of
75
+ silently substituting a claim. Preserve terse descriptions by choosing the
76
+ smallest set of evidence that proves the outcome.
77
+
78
+ ## Open and verify
79
+
80
+ Open the PR against the intended base with the conventional title and prepared
81
+ body. Then read back the rendered PR and verify the base/head branches, title,
82
+ description, links, screenshots, and check results. Finish only when the PR is
83
+ reviewable as rendered and return its URL.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Open Pull Request"
3
+ short_description: "Open clear, evidence-backed pull requests"
4
+ default_prompt: "Use $open-pull-request to prepare and open a clear pull request with conventional commits and proof of work."