@danieljvdm/dev-kit 0.2.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.
Files changed (47) hide show
  1. package/README.md +290 -0
  2. package/bin/dev-kit.mjs +3 -0
  3. package/dev-kit.example.jsonc +13 -0
  4. package/package.json +69 -0
  5. package/schema/dev-kit.schema.json +128 -0
  6. package/schema/skill-sources.schema.json +83 -0
  7. package/skill-sources.jsonc +55 -0
  8. package/skill-sources.lock.json +136 -0
  9. package/skills/dev-kit/SKILL.md +145 -0
  10. package/skills/dev-kit/agents/openai.yaml +4 -0
  11. package/skills/effect-ts/SKILL.md +242 -0
  12. package/skills/effect-ts/UPSTREAM.md +28 -0
  13. package/skills/effect-ts/agents/openai.yaml +5 -0
  14. package/skills/effect-ts/references/audit-services.md +144 -0
  15. package/skills/effect-ts/references/features.md +525 -0
  16. package/skills/effect-ts/references/guide-cli.md +106 -0
  17. package/skills/effect-ts/references/guide-effect.md +453 -0
  18. package/skills/effect-ts/references/guide-error-handling.md +574 -0
  19. package/skills/effect-ts/references/guide-http-boundaries.md +55 -0
  20. package/skills/effect-ts/references/guide-layers.md +1017 -0
  21. package/skills/effect-ts/references/guide-observability.md +771 -0
  22. package/skills/effect-ts/references/guide-retries.md +446 -0
  23. package/skills/effect-ts/references/guide-schedule.md +357 -0
  24. package/skills/effect-ts/references/guide-schema.md +671 -0
  25. package/skills/effect-ts/references/guide-sql.md +539 -0
  26. package/skills/effect-ts/references/guide-testing.md +534 -0
  27. package/skills/effect-ts/references/guide-type-safety-and-boundaries.md +131 -0
  28. package/skills/effect-ts/references/version-and-source.md +87 -0
  29. package/src/bin/dev-kit.ts +372 -0
  30. package/src/catalog-manager.ts +345 -0
  31. package/src/catalog.ts +246 -0
  32. package/src/cli-ui.ts +110 -0
  33. package/src/effect-source.ts +325 -0
  34. package/src/effect-tsgo.ts +256 -0
  35. package/src/gitignore.ts +212 -0
  36. package/src/index.ts +98 -0
  37. package/src/manifest.ts +133 -0
  38. package/src/node-symbolic-link.ts +31 -0
  39. package/src/path-digest.ts +140 -0
  40. package/src/project-process-lock.ts +76 -0
  41. package/src/project-state.ts +67 -0
  42. package/src/skill-manager.ts +326 -0
  43. package/src/source-manifest.ts +51 -0
  44. package/src/sync.ts +900 -0
  45. package/src/tool-metadata.ts +3 -0
  46. package/src/typescript-package-name.ts +5 -0
  47. package/src/vendor.ts +848 -0
@@ -0,0 +1,136 @@
1
+ {
2
+ "version": 1,
3
+ "sources": [
4
+ {
5
+ "id": "emilkowalski-skills",
6
+ "repository": "https://github.com/emilkowalski/skills.git",
7
+ "ref": "main",
8
+ "resolved": "70744e3816f1d93eafb697161a8b880a7384c5ff",
9
+ "skillsPath": "skills",
10
+ "include": [
11
+ "animation-vocabulary",
12
+ "apple-design",
13
+ "emil-design-eng",
14
+ "find-animation-opportunities",
15
+ "improve-animations",
16
+ "pick-ui-library",
17
+ "prototype",
18
+ "review-animations"
19
+ ],
20
+ "skills": [
21
+ "animation-vocabulary",
22
+ "apple-design",
23
+ "emil-design-eng",
24
+ "find-animation-opportunities",
25
+ "improve-animations",
26
+ "pick-ui-library",
27
+ "prototype",
28
+ "review-animations"
29
+ ],
30
+ "descriptions": {
31
+ "animation-vocabulary": "Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term (\"the bouncy thing when a popover opens\" → Pop in; \"the iOS rubber-band scroll\" → Rubber-banding). Use when the user asks \"what's it called when…\", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.",
32
+ "apple-design": "Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.",
33
+ "emil-design-eng": "This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.",
34
+ "find-animation-opportunities": "Search a codebase or UI for places that don't animate but should, and reject everything that shouldn't. Read-only; it proposes motion with exact values, it does not implement it. Use when the user asks \"what could be animated here?\" or wants to \"make this feel more alive\". For fixing existing animations, use improve-animations or review-animations instead.",
35
+ "improve-animations": "Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to \"improve the animations\", \"audit the motion\", \"make this app feel better\", or wants a roadmap of animation fixes rather than a review of a single diff.",
36
+ "pick-ui-library": "Pick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, toasts, state, styling, and more. Only runs when explicitly invoked; it does not trigger on its own.",
37
+ "prototype": "Build multiple genuinely different versions of a UI piece you describe, rendered behind a visual picker so you can flip through them live and promote the one that feels right. Only runs when explicitly invoked; it does not trigger on its own.",
38
+ "review-animations": "Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned."
39
+ },
40
+ "digests": {
41
+ "animation-vocabulary": "sha256:d270769a8a19c8ff48489c118e19d5f86113c6acfdd0e981116ffd74b01b9e6b",
42
+ "apple-design": "sha256:dabc421a391bd6b2ba0d004a8f4d4a1b632fc003a45d4676ab9f2ade8099fc7b",
43
+ "emil-design-eng": "sha256:cedac6e0b7ff8ca471d5d2b35dc7d91f13b57ff57c4395822e677f0df7ecebc8",
44
+ "find-animation-opportunities": "sha256:0c6f5d397c01cb02b4fc06f45836825d5cb576c006e1a4d6eaa721f9f126835e",
45
+ "improve-animations": "sha256:b02183838b096282eef43bbcbdb85fd76cf0687dac188eff5174a3010f2b86ba",
46
+ "pick-ui-library": "sha256:f507c1caaff077d6c7f0aedf56a888ea0248894ad80b5bac4f279924db5f44a3",
47
+ "prototype": "sha256:564efd1ce0ee72520058eccb5f47d2f77b1ece27ae9b399edb7c121c8f9f2dd5",
48
+ "review-animations": "sha256:d78c312f4102c0243fb524f85d1fd999e8c413a5afbef9ac3c7fe054fbb84570"
49
+ },
50
+ "licensePath": "LICENSE",
51
+ "stripFrontmatter": [
52
+ "disable-model-invocation"
53
+ ]
54
+ },
55
+ {
56
+ "id": "cloudflare-skills",
57
+ "repository": "https://github.com/cloudflare/skills.git",
58
+ "ref": "main",
59
+ "resolved": "30553f89ae1ef1e3c2917cd09d72dac992bb4e9a",
60
+ "skillsPath": "skills",
61
+ "include": [
62
+ "agents-sdk",
63
+ "cloudflare",
64
+ "cloudflare-email-service",
65
+ "cloudflare-one",
66
+ "cloudflare-one-migrations",
67
+ "durable-objects",
68
+ "sandbox-sdk",
69
+ "turnstile-spin",
70
+ "web-perf",
71
+ "workers-best-practices",
72
+ "wrangler"
73
+ ],
74
+ "skills": [
75
+ "agents-sdk",
76
+ "cloudflare",
77
+ "cloudflare-email-service",
78
+ "cloudflare-one",
79
+ "cloudflare-one-migrations",
80
+ "durable-objects",
81
+ "sandbox-sdk",
82
+ "turnstile-spin",
83
+ "web-perf",
84
+ "workers-best-practices",
85
+ "wrangler"
86
+ ],
87
+ "descriptions": {
88
+ "agents-sdk": "Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, chat applications, voice agents, or browser automation. Covers Agent class, state management, callable RPC, Workflows, durable execution, queues, retries, observability, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",
89
+ "cloudflare": "Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",
90
+ "cloudflare-email-service": "Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing). Use when building email sending (Workers binding or REST API), email routing, Agents SDK email handling, or integrating email into any app — Workers, Node.js, Python, Go, etc. Also use for email deliverability, SPF/DKIM/DMARC, wrangler email setup, MCP email tools, or when a coding agent needs to send emails. Even for simple requests like \"add email to my Worker\" — this skill has critical config details.",
91
+ "cloudflare-one": "Guides Cloudflare One Zero Trust and SASE work across Access, Gateway, WARP, Tunnel, Cloudflare WAN, DLP, CASB, device posture, and identity. Use when designing, configuring, troubleshooting, or reviewing Cloudflare One deployments. Retrieval-first: use current Cloudflare docs/API schemas instead of embedded product docs.",
92
+ "cloudflare-one-migrations": "Plans migrations from Zscaler ZIA/ZPA, Palo Alto, legacy VPN, SWG, or SASE stacks to Cloudflare One. Use for migration assessments, policy mapping, rollout plans, and parity/gap analysis.",
93
+ "durable-objects": "Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",
94
+ "sandbox-sdk": "Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",
95
+ "turnstile-spin": "Set up Cloudflare Turnstile end-to-end in a project. Scan the codebase, create the widget via the Cloudflare API, embed it where user requests need bot verification (form submissions, SPA actions, API endpoints, download links, comment or vote submissions, etc.), wire canonical server-side siteverify in the customer's existing backend, validate, and persist the skill. Load this when a user asks to add Turnstile, set up CAPTCHA, protect a form or endpoint from bots, or fix a Turnstile integration. Mirrors developers.cloudflare.com/turnstile/spin.",
96
+ "web-perf": "Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.",
97
+ "workers-best-practices": "Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",
98
+ "wrangler": "Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge."
99
+ },
100
+ "digests": {
101
+ "agents-sdk": "sha256:721bd3f54bf45ce35827d90a1886ed92d644fe2bfff2e80c21bcd1777079dc54",
102
+ "cloudflare": "sha256:dfc92bac99350aa358617e0b8edd61fd7115cbf1a873ba01d32f93d967b9822e",
103
+ "cloudflare-email-service": "sha256:c74226f6ce9226640193a30142a2d5348cc276baefb91913db9dc44e97d971c0",
104
+ "cloudflare-one": "sha256:44c1455ac02448fab391795a7d84205387c3cdae457e3d17d5549207ff466bfa",
105
+ "cloudflare-one-migrations": "sha256:9b1e197c3cf33fd7061d5f7c2e654a9b72257ed2169d57b704bca4122a51febc",
106
+ "durable-objects": "sha256:533bfa75d2074cf6ac30ab77854a665465318dd0540ff4bdbb9c5f4ef8acfb38",
107
+ "sandbox-sdk": "sha256:e1ec676cfa5e9638f62673097850ec0e8e7f7e42dfd0606cc217b5854df0132b",
108
+ "turnstile-spin": "sha256:c6095261a7f69b2321729604a8f57b36456146fa6e544bfc54d764d206c1037a",
109
+ "web-perf": "sha256:4d6d66e3d36bee3f592a8ac76ec633c6a96c688c0c9767ef26c164f2509726a8",
110
+ "workers-best-practices": "sha256:f8925cccde1682df5e6c9aba8e3ee125355fc73761ba6581107d88adb8b44f47",
111
+ "wrangler": "sha256:217184cf167933b565466cf0d846e8085e8a985d6b7ff828316757d3fc4932cb"
112
+ },
113
+ "licensePath": "LICENSE"
114
+ },
115
+ {
116
+ "id": "evanbacon-serve-sim",
117
+ "repository": "https://github.com/EvanBacon/serve-sim.git",
118
+ "ref": "main",
119
+ "resolved": "14ad57ff922551bf7be81e907ddfcfa6191e64f2",
120
+ "skillsPath": "skills",
121
+ "include": [
122
+ "serve-sim"
123
+ ],
124
+ "skills": [
125
+ "serve-sim"
126
+ ],
127
+ "descriptions": {
128
+ "serve-sim": "Control and stream a running iOS, iPad, or Apple Watch Simulator with npx serve-sim. Use for simulator preview, taps, gestures, hardware buttons, rotation, camera injection, permissions, accessibility, and CoreAnimation debug."
129
+ },
130
+ "digests": {
131
+ "serve-sim": "sha256:782f41d4d79100d5bfc9ec1211e5d4766e978299bbb93fd8e34c6f8d2ecf2114"
132
+ },
133
+ "licensePath": "LICENSE"
134
+ }
135
+ ]
136
+ }
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: dev-kit
3
+ description: Dev-kit operations for projects that configure dev-kit.jsonc, sync portable skills, run plan/apply or locked postinstalls, maintain dev-kit.lock.json, resolve ownership conflicts, patch managed ignores, or enable Effect TypeScript-Go.
4
+ ---
5
+
6
+ # Dev Kit
7
+
8
+ Treat `dev-kit.jsonc` as desired state, `dev-kit.lock.json` as the committed
9
+ resolution, and `.dev-kit/state.json` as local ownership receipts.
10
+
11
+ Use the high-level commands for routine changes: `dev-kit init`, `dev-kit add
12
+ <skill...>`, `dev-kit remove <skill...>`, `dev-kit list --all`, `dev-kit search
13
+ <words...>`, and `dev-kit info <skill>`. Add and remove apply immediately unless
14
+ passed `--no-apply`; `dev-kit sync` applies an already-edited manifest.
15
+
16
+ For distro maintenance, use `dev-kit catalog add <repository>` to inspect and
17
+ approve upstream skills, `catalog list`/`catalog info` to review provenance,
18
+ `catalog remove <source-or-skill>` to revoke approval, and `catalog verify` in
19
+ CI. Pass repeated `--skill` flags or `--all` outside a terminal. Approval always
20
+ stores explicit skill names and exact commit/content digests.
21
+
22
+ ## Apply loop
23
+
24
+ 1. Establish the Git root. Read `dev-kit.jsonc`, `dev-kit.lock.json` when
25
+ present, `package.json`, and the configured target paths. Finish with the
26
+ intended skill selection, targets, and setup tasks identified.
27
+ 2. Update `dev-kit.jsonc`. Preserve JSONC comments and validate against the
28
+ package schema. Finish when every desired resource is represented once.
29
+ 3. Run `dev-kit plan`. Use `--manifest`, `--project-dir`, or `--lockfile` when
30
+ the project overrides their defaults. Planning is read-only; inspect every
31
+ create, update, remove, adoption, and conflict before proceeding. Finish
32
+ when the plan contains only intended actions and understood conflicts.
33
+ 4. Resolve conflicts, then run `dev-kit apply`. Commit the manifest and
34
+ regenerated `dev-kit.lock.json`; keep `.dev-kit/` local. Finish when a second
35
+ plan reports only unchanged resources and setup tasks.
36
+ 5. Use `dev-kit apply --locked` in CI and the package lifecycle. Finish when a
37
+ clean install converges from the committed manifest and lock.
38
+
39
+ ## Manifest
40
+
41
+ Use skill names or family names in `include`; subtract selections with
42
+ `exclude`. Include this skill as `dev-kit` when project agents should carry the
43
+ toolkit procedure.
44
+
45
+ ```jsonc
46
+ {
47
+ "$schema": "./node_modules/@danieljvdm/dev-kit/schema/dev-kit.schema.json",
48
+ "include": ["dev-kit", "effect"],
49
+ "exclude": [],
50
+ "targets": {
51
+ "agents": { "enabled": true, "mode": "copy" },
52
+ "claude": { "enabled": true, "mode": "symlink" },
53
+ "opencode": { "enabled": false, "mode": "symlink" }
54
+ }
55
+ }
56
+ ```
57
+
58
+ Prefer a copied `.agents/skills` target as the project-local source of truth;
59
+ use symlinks for additional harness discovery paths. Keep every target path
60
+ project-relative and separate from the manifest, lock, state, and process-lock
61
+ paths.
62
+
63
+ ## Ownership and conflicts
64
+
65
+ Dev-kit adopts an existing destination only when its digest exactly matches a
66
+ committed lock entry. Local receipts authorize later updates and cleanup only
67
+ while the managed output still matches its recorded digest.
68
+
69
+ Preserve a conflicting path and inspect it:
70
+
71
+ - For an unknown destination, choose a different target or deliberately move
72
+ the user-owned content before applying.
73
+ - For a modified managed destination, reconcile the local edits or restore its
74
+ recorded content before applying.
75
+ - For a locked-plan mismatch, run an unlocked apply only when intentionally
76
+ updating desired state, review the new lock, and commit it.
77
+
78
+ Retain `.dev-kit/state.json` across routine applies and branch changes so its
79
+ receipts can update or remove previously applied outputs safely.
80
+
81
+ ## Project plumbing
82
+
83
+ Run `dev-kit gitignore` to add `.repos/` and `.dev-kit/` additively. Preview with
84
+ `dev-kit gitignore --dry-run`. Treat `.repos/<source-id>` as the reserved source
85
+ checkout root.
86
+
87
+ For one lifecycle entry point, configure:
88
+
89
+ ```jsonc
90
+ {
91
+ "scripts": {
92
+ "postinstall": "dev-kit apply --locked"
93
+ }
94
+ }
95
+ ```
96
+
97
+ ## Effect source checkout
98
+
99
+ Enable the source task when agents should have canonical source matching the
100
+ installed Effect package:
101
+
102
+ ```jsonc
103
+ {
104
+ "setup": {
105
+ "effectSource": { "enabled": true }
106
+ }
107
+ }
108
+ ```
109
+
110
+ The task reads the exact installed `effect` version and converges the ignored
111
+ `.repos/effect` checkout on the corresponding `effect@<version>` tag. It skips
112
+ CI, preserves a dirty or unrelated destination, and never deletes the checkout
113
+ when disabled. Use `dev-kit effect sync --dry-run` for focused diagnosis.
114
+
115
+ Override `packageName`, `path`, or `repository` only for a compatible Effect
116
+ distribution or a deliberate mirror.
117
+
118
+ ## Effect TypeScript-Go
119
+
120
+ Enable the setup task in the same manifest:
121
+
122
+ ```jsonc
123
+ {
124
+ "setup": {
125
+ "effectTsgo": { "enabled": true }
126
+ }
127
+ }
128
+ ```
129
+
130
+ Install the exact `@effect/tsgo` and native `typescript` versions required by
131
+ the installed dev-kit. Point `tsconfig.json` at
132
+ `./node_modules/@effect/tsgo/schema.json` and configure the
133
+ `@effect/language-service` compiler plugin. `dev-kit plan` validates these local
134
+ dependencies; `dev-kit apply` patches once and then converges.
135
+
136
+ Use `dev-kit tsgo patch --dry-run` for focused diagnosis. Use `--force` only
137
+ after the user accepts a potentially commit-incompatible TypeScript binary.
138
+
139
+ ## Current boundary
140
+
141
+ Manage skill outputs, the `setup.effectSource` checkout, and the explicit
142
+ `setup.effectTsgo` task. Edit shared `package.json` and `tsconfig.json`
143
+ contributions deliberately. Treat named bundles, Oxlint/Oxfmt presets, and
144
+ broader setup tasks as future manifest capabilities until the installed CLI
145
+ exposes them.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Dev Kit"
3
+ short_description: "Configure and apply portable project tooling"
4
+ default_prompt: "Use $dev-kit to configure and safely apply this project's development toolkit."
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: effect-ts
3
+ description: Use this skill whenever working in a repository that uses Effect, even if the current task is in a new file or the user does not explicitly ask for Effect help. Apply it to Effect patterns, services, layers, schemas, streams, runtimes, typed errors, observability, testing, HTTP, SQL, command-line scripts, project automation, and supporting tooling.
4
+ ---
5
+
6
+ # Effect Expert
7
+
8
+ Expert guidance for programming with the Effect library, covering error handling, dependency injection, composability, and testing patterns.
9
+
10
+ ## Version Baseline
11
+
12
+ This skill targets Effect v4. The guidance was last reviewed against
13
+ `effect@4.0.0-beta.102` and the matching `@effect/*` v4 packages.
14
+
15
+ Before changing code, determine the version installed by the target repository.
16
+ The target repository's manifest and lockfile are authoritative. Do not migrate
17
+ or upgrade it merely to match this review baseline.
18
+
19
+ Read `./references/version-and-source.md` before installing packages, resolving
20
+ version-sensitive APIs, or using upstream source as evidence.
21
+
22
+ ## Research Strategy
23
+
24
+ Effect has many ways to accomplish the same task. Proactively research best practices when working with Effect patterns, especially for moderate to high complexity tasks.
25
+
26
+ Use the local guides in `./references/` first. They are the preferred source for best practices, conventions, and common implementation patterns.
27
+
28
+ Only go directly to the canonical Effect source when:
29
+
30
+ - the guides do not cover the question
31
+ - you need exact API details or signatures
32
+ - you need deeper implementation details
33
+ - you need to verify a behavior against the source
34
+
35
+ ### Research Sources
36
+
37
+ 1. Local skill guides first. Start with the relevant files in `./references/`
38
+ before doing deeper research.
39
+ 2. Codebase patterns second. Examine similar patterns in the current project
40
+ before implementing. If Effect patterns already exist, follow them for
41
+ consistency unless they conflict with an explicit local policy in this
42
+ skill.
43
+ 3. Installed package source third. Use the target repository's resolved
44
+ `effect` and `@effect/*` packages for exact exports, declarations, and API
45
+ signatures.
46
+ 4. Version-matched upstream source last. For gaps in the guides, complex type
47
+ errors, unclear behavior, or implementation details, inspect the canonical
48
+ `Effect-TS/effect` source at the tag or commit matching the installed
49
+ version. A project-local source checkout is optional, never a prerequisite.
50
+
51
+ ### When To Research
52
+
53
+ - Always research for services, layers, or complex dependency injection.
54
+ - Always research for error handling with multiple error types or complex error hierarchies.
55
+ - Always research for stream-based operations and reactive patterns.
56
+ - Always research for resource management with scoped effects and cleanup.
57
+ - Always research for concurrent or performance-critical code.
58
+ - Always research for unfamiliar testing patterns.
59
+ - Research when needed for complex refactors from promises or try/catch into Effect.
60
+ - Research when needed for new service dependencies or layer restructuring.
61
+ - Research when needed for custom error types or extensions of existing error hierarchies.
62
+ - Research when needed for integrations with external systems such as databases, APIs, or third-party services.
63
+
64
+ ### Research Approach
65
+
66
+ - Focus on canonical, readable, and maintainable solutions rather than clever optimizations.
67
+ - Verify suggested approaches against existing codebase patterns when those
68
+ patterns exist.
69
+ - When multiple approaches are possible, prefer the most idiomatic Effect
70
+ solution supported by the codebase, these local policies, and version-matched
71
+ Effect source.
72
+
73
+ ### Codebase Pattern Discovery
74
+
75
+ When working in a project that uses Effect, check for existing patterns before implementing new code:
76
+
77
+ 1. Search for Effect imports and existing module usage to understand current conventions.
78
+ 2. Identify how services and layers are structured in the project.
79
+ 3. Note how errors are defined and propagated.
80
+ 4. Examine how Effect code is tested in the project.
81
+
82
+ If no Effect patterns exist in the codebase, proceed using these guides and
83
+ canonical patterns from version-matched Effect source and examples. Do not
84
+ block on missing codebase patterns or a missing source checkout.
85
+
86
+ ### Feature Discovery
87
+
88
+ When you need to discover available Effect modules, packages, or capabilities, search `./references/features.md` first.
89
+
90
+ - Use it to identify the right package or module for a task.
91
+ - Treat listed repo paths as discovery hints. Confirm them against the target
92
+ repository's installed version before relying on exact names or signatures.
93
+ - Use it before inventing custom abstractions when Effect may already provide the functionality.
94
+
95
+ ### Guide Discovery
96
+
97
+ When the task touches one of these areas, consult the matching guide before implementing:
98
+
99
+ - `./references/guide-effect.md` for core `Effect` usage patterns, common constructors, composition, provisioning, and runtime boundaries
100
+ - `./references/guide-error-handling.md` for defining errors, schema-based errors, failure handling, defects, and interrupts
101
+ - `./references/guide-layers.md` for service ownership, service design, layer
102
+ construction, dependency visibility, composition, and provisioning
103
+ - `./references/guide-observability.md` for `Effect.fn`, spans, structured
104
+ logging, metrics, annotations, and telemetry wiring
105
+ - `./references/guide-retries.md` for retry policies, retry conditions, fallback strategies, and `ExecutionPlan`
106
+ - `./references/guide-schedule.md` for retries, repeats, backoff, polling, cron, and schedule composition
107
+ - `./references/guide-schema.md` for schema-first application modeling,
108
+ service contracts, transformations, unions, recursion, and branded types
109
+ - `./references/guide-sql.md` for Effect SQL usage, transactions, resolvers, schema-aware SQL, and migrations
110
+ - `./references/guide-testing.md` for `@effect/vitest`, deterministic testing,
111
+ honest test Layers, property tests, and protocol round trips
112
+ - `./references/guide-cli.md` for Effect-powered command-line scripts and
113
+ project automation
114
+ - `./references/guide-http-boundaries.md` for `HttpApi` contracts, handlers,
115
+ DTOs, transport errors, and route boundaries
116
+ - `./references/audit-services.md` for a complete service and type-boundary
117
+ audit workflow
118
+ - `./references/guide-type-safety-and-boundaries.md` for `unknown`, assertions,
119
+ runtime shape checks, external decoding, and boundary ownership
120
+
121
+ Treat each topic guide as the single authority for that topic. Do not skip the
122
+ guides and jump straight to source unless source-level confirmation is needed
123
+ or the guides do not answer the question.
124
+
125
+ ## Effect Principles
126
+
127
+ Apply these core principles when writing Effect code.
128
+
129
+ ## Installation
130
+
131
+ When installing Effect v4 packages in a user repository:
132
+
133
+ - use the current `effect@beta` version only for a new v4 installation
134
+ - preserve the repository's resolved v4 beta for existing installations unless
135
+ the user asks for an upgrade
136
+ - keep `effect` and all v4 `@effect/*` packages on the exact same beta version
137
+ - install only the packages needed for the user's runtime and actual task
138
+
139
+ ### Version Rules
140
+
141
+ - `effect@latest` is still the v3 release line; use `effect@beta` when creating
142
+ a new v4 repository.
143
+ - Resolve the beta tag at installation time. Do not assume the review baseline
144
+ is still current.
145
+ - If you install any v4 `@effect/*` package, make sure it and `effect` use the
146
+ same exact beta version.
147
+ - Do not mix v3 integration packages with Effect v4 packages.
148
+
149
+ ### Package Selection
150
+
151
+ Choose packages based on the runtime and the work being done.
152
+
153
+ - core library: `effect@beta`
154
+ - Node.js runtime needs: install the matching `@effect/platform-node@beta`
155
+ - browser runtime needs: install the matching `@effect/platform-browser@beta`
156
+ - Bun runtime needs: install the matching `@effect/platform-bun@beta`
157
+ - Vitest integration needs: install the matching `@effect/vitest@beta`
158
+ - OpenTelemetry integration needs: install the matching
159
+ `@effect/opentelemetry@beta`
160
+
161
+ Install additional `@effect/*` packages only when the user task actually needs them.
162
+
163
+ ### Practical Rule
164
+
165
+ - start with the current resolved `effect@beta`
166
+ - add matching v4 `@effect/*` packages only as needed by runtime and features
167
+ - pin the full installed Effect v4 package set to the same exact beta
168
+
169
+ ### Error Handling
170
+
171
+ - Use Effect's typed error system instead of throwing exceptions.
172
+ - Define descriptive error types with proper error propagation.
173
+ - Prefer `Schema.TaggedErrorClass` when the error can be schema-defined.
174
+ - Use `Effect.fail`, `Effect.catchTag`, and `Effect.catch` for error control flow.
175
+
176
+ ### Dependency Injection
177
+
178
+ - Implement dependency injection using services and layers.
179
+ - Define services with `Context.Service`.
180
+ - Compose layers with `Layer.merge` and `Layer.provide`.
181
+ - Use `Effect.provide` to inject dependencies at the edge, avoid providing locally.
182
+ - Keep services encapsulated; avoid exporting trivial accessor wrappers that only forward to one service method.
183
+
184
+ ### Composability
185
+
186
+ - Leverage Effect composability for complex operations.
187
+ - Use appropriate constructors such as `Effect.succeed`, `Effect.fail`, `Effect.tryPromise`, `Effect.try`, and `Effect.sync`.
188
+ - Apply proper resource management with scoped effects.
189
+ - Chain operations with `Effect.flatMap`, `Effect.map`, and `Effect.tap`.
190
+
191
+ ### Business Logic Functions
192
+
193
+ - Prefer `Effect.fn` for reusable business-logic functions that return `Effect`.
194
+ - Prefer `Effect.fn` over raw `Effect.gen` definitions even when the function takes no arguments.
195
+ - If you do not want an explicit named span, use `Effect.fn` without a span name.
196
+ - Do not use `Effect.fnUntraced` as the default.
197
+ - Use `Effect.fnUntraced` only for edge cases with a concrete low-level reason, such as measured hot-path overhead.
198
+
199
+ ### TypeScript Preferences
200
+
201
+ - Do not use `any` in Effect application, service, or workflow code.
202
+ - Decode external values instead of asserting their shape.
203
+ - Isolate unavoidable compiler or framework adapter assertions at the
204
+ narrowest boundary and document the contract they bridge.
205
+ - Do not use `namespace` to hide services, layers, or mutable state.
206
+ - Prefer correct typing, schema-driven decoding, narrowing, and proper generic constraints instead of forcing types.
207
+ - If a value comes from an external boundary, validate or decode it instead of asserting its type.
208
+ - If a type is hard to express, simplify the design or introduce a properly typed helper instead of using unsafe TypeScript.
209
+ - For layers, do not hide them inside `namespace` blocks. Prefer either `static` members on the service class or plain exported layer constants.
210
+
211
+ ### Code Quality
212
+
213
+ - Write type-safe code that leverages Effect's type system.
214
+ - Use `Effect.gen` for readable sequential code.
215
+ - Implement proper testing patterns using Effect testing utilities.
216
+ - Prefer existing Effect primitives before introducing custom helpers.
217
+ - Prefer `Schema.Class` / `Schema.TaggedClass` variants over plain `Schema.Struct` for named reusable schemas when possible.
218
+
219
+ ### Explaining Solutions
220
+
221
+ When providing solutions, explain the Effect concepts being used and why they
222
+ fit the specific use case. If you encounter patterns not covered in local
223
+ references, prefer consistency with the codebase when possible and otherwise
224
+ rely on installed declarations and version-matched canonical Effect source.
225
+
226
+ ## References
227
+
228
+ - `./references/features.md`
229
+ - `./references/guide-effect.md`
230
+ - `./references/guide-error-handling.md`
231
+ - `./references/guide-layers.md`
232
+ - `./references/guide-observability.md`
233
+ - `./references/guide-retries.md`
234
+ - `./references/guide-schedule.md`
235
+ - `./references/guide-schema.md`
236
+ - `./references/guide-sql.md`
237
+ - `./references/guide-testing.md`
238
+ - `./references/guide-cli.md`
239
+ - `./references/guide-http-boundaries.md`
240
+ - `./references/audit-services.md`
241
+ - `./references/guide-type-safety-and-boundaries.md`
242
+ - `./references/version-and-source.md`
@@ -0,0 +1,28 @@
1
+ # Upstream Baseline
2
+
3
+ The general Effect guides in this skill were adapted from
4
+ [`Effect-TS/skills`](https://github.com/Effect-TS/skills) at commit
5
+ `a8b6bb40d1d4d550b49c0ff7a624b5e6da500a24`.
6
+
7
+ They have been modified to:
8
+
9
+ - remove the mandatory `.repos/effect` checkout
10
+ - target the current canonical `Effect-TS/effect` v4 source
11
+ - update version-sensitive guidance from the upstream beta.66 snapshot to
12
+ beta.102
13
+ - preserve this repository's service ownership, layer construction,
14
+ schema-first modeling, type-boundary, HTTP, testing, logging, audit, and CLI
15
+ conventions
16
+
17
+ ## Local Authoring Checkout
18
+
19
+ This repository keeps an ignored, version-matched Effect checkout for
20
+ validating source paths and beta-sensitive APIs. `vp i` runs the equivalent
21
+ dev-kit setup automatically; it can also be invoked directly:
22
+
23
+ ```bash
24
+ ./bin/dev-kit.mjs effect sync
25
+ ```
26
+
27
+ Update the checkout, package dependencies, review baseline, feature index, and
28
+ stale-API tests together when moving to a newer Effect beta.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Effect Expert"
3
+ short_description: "Apply current Effect v4 patterns and tooling"
4
+ default_prompt: "Use $effect-ts to apply the relevant Effect architecture, schema, service, error, testing, HTTP, SQL, observability, or CLI guidance."
5
+