@danieljvdm/dev-kit 0.18.0 → 1.0.1

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 (45) hide show
  1. package/README.md +148 -659
  2. package/package.json +8 -62
  3. package/skill-sources.jsonc +1 -0
  4. package/skill-sources.lock.json +5 -1
  5. package/skills/dev-kit/SKILL.md +42 -212
  6. package/skills/dev-kit/agents/openai.yaml +2 -2
  7. package/skills/dev-kit/references/cloudflare-worker-api.md +37 -0
  8. package/skills/dev-kit/references/default-typescript-repository.md +43 -0
  9. package/skills/dev-kit/references/legacy-eject.md +46 -0
  10. package/skills/dev-kit/references/repository-setup.md +53 -0
  11. package/skills/dev-kit/references/skills.md +35 -0
  12. package/src/bin/dev-kit.ts +142 -127
  13. package/src/eject.ts +715 -0
  14. package/src/legacy-project.ts +67 -0
  15. package/src/oxfmt.ts +1 -4
  16. package/src/oxlint.ts +5 -10
  17. package/src/path-digest.ts +60 -0
  18. package/src/project-skills.ts +722 -0
  19. package/src/tool-metadata.ts +0 -2
  20. package/src/vendor.ts +0 -5
  21. package/src/vite-plus.ts +1 -3
  22. package/dev-kit.example.jsonc +0 -22
  23. package/schema/dev-kit.schema.json +0 -218
  24. package/schema/skill-sources.schema.json +0 -83
  25. package/scripts/sync-anti-slop-runtime.mjs +0 -19
  26. package/src/index.ts +0 -125
  27. package/src/manifest.ts +0 -224
  28. package/src/oxfmt.js +0 -23
  29. package/src/oxlint-plugin-anti-slop/runtime.d.ts +0 -22
  30. package/src/oxlint-plugin-effect.d.ts +0 -19
  31. package/src/oxlint-plugin-style.d.ts +0 -8
  32. package/src/oxlint.js +0 -113
  33. package/src/project-state.ts +0 -122
  34. package/src/scaffold.ts +0 -79
  35. package/src/skill-manager.ts +0 -527
  36. package/src/sync.ts +0 -1935
  37. package/src/tool-ignore-patterns.js +0 -9
  38. package/src/vite-plus-dependency.ts +0 -69
  39. package/src/vite-plus-hooks.ts +0 -175
  40. package/src/vite-plus-workflow.ts +0 -82
  41. package/src/vite-plus.js +0 -88
  42. package/src/worktrunk-config.ts +0 -88
  43. package/templates/AGENTS.md +0 -11
  44. package/templates/vite-plus/github-actions-check.yml +0 -51
  45. package/templates/worktrunk/wt.toml +0 -27
package/README.md CHANGED
@@ -1,737 +1,226 @@
1
1
  # Dev Kit
2
2
 
3
- Portable agent skills and reproducible project setup, managed from one manifest.
3
+ Agent-led TypeScript repository setup and a curated catalog of portable coding
4
+ skills.
4
5
 
5
- Dev Kit gives every project the same development conventions without requiring a
6
- collection of unrelated postinstall scripts. It can:
6
+ Dev Kit is a transient toolbox. It copies guidance into a repository, helps an
7
+ agent build the requested setup against the repository's real constraints, and
8
+ then gets out of the way. Generated source, configuration, workflows, scripts,
9
+ and skills belong to the repository that receives them.
7
10
 
8
- - install selected skills for Codex, Claude, and OpenCode;
9
- - run explicit setup tasks such as version-matched Effect source checkout and
10
- Effect TypeScript-Go patching;
11
- - preview changes before writing them;
12
- - lock resolved outputs for reproducible installs; and
13
- - detect ownership conflicts without overwriting user files.
11
+ The finished repository has no Dev Kit dependency, manifest, lock, ownership
12
+ state, postinstall manager, or CI reconciliation step.
14
13
 
15
- ## Quick start
14
+ The package intentionally exposes no importable JavaScript API. Its public
15
+ surface is the transient executable and the guidance or skills it copies.
16
16
 
17
- Install the published Dev Kit package:
17
+ ## Set up a repository
18
18
 
19
- ```bash
20
- bun add -d @danieljvdm/dev-kit
21
- ```
22
-
23
- Dev Kit requires Bun 1.3 or newer. Its published executable runs TypeScript
24
- natively with Bun and rejects direct Node.js execution.
25
-
26
- Initialize the project, browse available built-in, approved Git, and installed
27
- package skills, then add the ones you want:
19
+ From a new or existing repository, copy the Dev Kit setup skill:
28
20
 
29
21
  ```bash
30
- bun x dev-kit init
31
- bun x dev-kit list --all
32
- bun x dev-kit add dev-kit effect
22
+ bunx @danieljvdm/dev-kit@latest setup
33
23
  ```
34
24
 
35
- Before adding external skills, have the agent inspect repository instructions,
36
- workspace dependencies, framework and tool configuration, representative
37
- source boundaries, and CI workflows. It should compare that concrete capability
38
- inventory with catalog descriptions and select the narrowest useful set. Broad
39
- umbrella skills and source families belong only when their full breadth is
40
- intentional; explicit creative or advisory requests remain valid even without a
41
- mechanical dependency signal. Treat lazy reference folders inside one skill as
42
- progressive-disclosure content, not as separately triggered skills; a repository
43
- using several covered products may reasonably select that umbrella while still
44
- excluding unrelated top-level skills.
25
+ This writes `.agents/skills/dev-kit` and a small origin receipt inside that skill.
26
+ It does not edit `package.json` or create project-wide Dev Kit metadata.
45
27
 
46
- Search and inspect candidates, then add the matching skills individually:
28
+ Then ask the coding agent for the outcome:
47
29
 
48
- ```bash
49
- bun x dev-kit search cloudflare
50
- bun x dev-kit info workers-best-practices
51
- bun x dev-kit add workers-best-practices wrangler
52
- ```
30
+ > Use $dev-kit to set up this repository as a Vite+ TypeScript monorepo with an
31
+ > Effect-based Cloudflare Worker API and a web application.
53
32
 
54
- `add` updates `dev-kit.jsonc` and applies the selection immediately. The
55
- resulting manifest is ordinary JSONC:
56
-
57
- In an interactive terminal, `dev-kit add` and `dev-kit remove` with no names
58
- open a multi-select picker. Pass several names to change them in one command,
59
- or use `--no-apply` to edit the manifest without syncing yet.
60
-
61
- ```jsonc
62
- {
63
- "$schema": "./node_modules/@danieljvdm/dev-kit/schema/dev-kit.schema.json",
64
- "include": ["dev-kit", "effect"],
65
- "targets": {
66
- "agents": { "enabled": true, "mode": "copy" },
67
- "claude": { "enabled": true, "mode": "symlink" },
68
- },
69
- }
70
- ```
33
+ The skill inventories the repository, loads only the applicable setup references,
34
+ resolves material product decisions, implements ordinary repo-owned files, and
35
+ validates through the resulting repository's own commands.
71
36
 
72
- For review-first workflows, edit the manifest or pass `--no-apply`, then:
37
+ For an empty directory, the agent establishes the package and toolchain foundation
38
+ before consulting documentation shipped by the installed dependencies. For an
39
+ existing repository, it integrates with established package boundaries, scripts,
40
+ configuration, and CI instead of replacing them with a fixed template.
73
41
 
74
- ```bash
75
- bun x dev-kit plan
76
- bun x dev-kit apply
77
- ```
42
+ ## The ownership contract
78
43
 
79
- Commit the generated `dev-kit.lock.json`, then let the package lifecycle
80
- converge owned outputs automatically when installed packages change:
44
+ Dev Kit commands are transactions, not reconciliation:
81
45
 
82
- ```jsonc
83
- {
84
- "scripts": {
85
- "postinstall": "dev-kit apply",
86
- },
87
- }
88
- ```
46
+ - `setup` copies the agent-led setup skill once.
47
+ - `skills add` copies selected skills once.
48
+ - `skills update` refreshes an unchanged tracked skill when requested.
49
+ - `eject` releases projects created by the legacy managed model.
50
+ - toolbox commands perform an explicit diagnostic or mechanical operation.
89
51
 
90
- That single postinstall applies every task enabled in `dev-kit.jsonc` and
91
- regenerates `dev-kit.lock.json` when an intentional package upgrade changes a
92
- bundled or package-provided skill. Ownership and conflict checks still prevent
93
- unreviewed overwrites.
52
+ Git records the resulting project state. Dev Kit does not remember the desired
53
+ shape of the repository and does not silently rewrite configuration after setup.
94
54
 
95
- Keep strict verification in CI. Either install with lifecycle scripts disabled
96
- before running locked mode:
55
+ ## Commands
97
56
 
98
- ```bash
99
- bun install --ignore-scripts
100
- bun ./node_modules/@danieljvdm/dev-kit/bin/dev-kit.mjs apply --locked
101
- ```
57
+ | Command | Purpose |
58
+ | ---------------------------------------------- | ------------------------------------------------------------------ |
59
+ | `dev-kit setup` | Copy the agent-led Dev Kit skill into `.agents/skills`. |
60
+ | `dev-kit skills list --all` | Browse built-in, approved Git, and installed-package skills. |
61
+ | `dev-kit skills search <words...>` | Search skill names, descriptions, and sources. |
62
+ | `dev-kit skills info <skill>` | Show one skill's description and provenance. |
63
+ | `dev-kit skills add <skill...>` | Copy repo-owned skills without a manifest. |
64
+ | `dev-kit skills status` | Compare tracked copies with their approved upstream content. |
65
+ | `dev-kit skills update [skill...]` | Fast-forward tracked skills that have no local edits. |
66
+ | `dev-kit skills diff <skill>` | Diff a repository copy against the latest approved upstream. |
67
+ | `dev-kit skills update <skill> --accept-local` | Keep an agent-merged copy and advance its upstream base. |
68
+ | `dev-kit skills detach <skill...>` | Remove origin receipts while preserving local content. |
69
+ | `dev-kit eject [--dry-run]` | Release a legacy managed project into repo ownership. |
70
+ | `dev-kit effect sync` | Explicitly sync an Effect source checkout to an installed version. |
71
+ | `dev-kit tsgo patch` | Explicitly patch the installed Effect TypeScript-Go compiler. |
72
+ | `dev-kit cache prune` | Remove stale machine-global catalog checkouts. |
102
73
 
103
- Or allow the normal postinstall and fail CI when it leaves tracked changes.
104
- Do not run an unlocked apply before a locked verification because that would
105
- regenerate the drift being checked.
106
- The package-qualified path cannot be shadowed by a consumer script named
107
- `dev-kit`.
74
+ Commands that write project skills accept `--project-dir`, `--target`, and
75
+ `--dry-run`. The default target is `.agents/skills`.
108
76
 
109
- This repository dogfoods the same flow with its committed `dev-kit.jsonc` and
110
- `dev-kit.lock.json`. From this source checkout, invoke the local CLI with:
77
+ Run any command with `--help` for its complete flags.
111
78
 
112
- ```bash
113
- bun run dev-kit plan
114
- bun run dev-kit apply --locked
115
- ```
79
+ ## Skills
116
80
 
117
- `bun x dev-kit` is for consuming projects where installation has created the
118
- `node_modules/.bin/dev-kit` link; package managers do not create that link for
119
- the root package itself.
81
+ Dev Kit combines three sources:
120
82
 
121
- ## Commands
83
+ - skills bundled with this package;
84
+ - exact commits from an approved external Git catalog; and
85
+ - skills discovered in direct project dependencies that expose compatible
86
+ package metadata.
122
87
 
123
- | Command | Purpose |
124
- | ------------------------------------------ | --------------------------------------------------------- |
125
- | `dev-kit` | Show selected skills and the four common next actions. |
126
- | `dev-kit init` | Create a minimal `dev-kit.jsonc`. |
127
- | `dev-kit add <skill...>` | Select and immediately install skills. |
128
- | `dev-kit remove <skill...>` | Deselect and uninstall skills safely. |
129
- | `dev-kit list [--all]` | List selected skills or browse the catalog. |
130
- | `dev-kit search <words...>` | Search names and descriptions. |
131
- | `dev-kit info <skill>` | Show description and Git or installed-package provenance. |
132
- | `dev-kit status` | Check whether the project matches its selection. |
133
- | `dev-kit sync` | Apply the current manifest. |
134
- | `dev-kit plan` | Preview project changes without writing files. |
135
- | `dev-kit apply` | Apply the manifest and update `dev-kit.lock.json`. |
136
- | `dev-kit apply --locked` | Reproduce the committed lock or fail on drift. |
137
- | `dev-kit gitignore` | Add `.repos/` and `.dev-kit/` to `.gitignore`. |
138
- | `dev-kit effect sync` | Sync `.repos/effect` to the installed Effect version. |
139
- | `dev-kit tsgo patch` | Validate and patch Effect TypeScript-Go directly. |
140
- | `dev-kit cache prune` | Evict stale machine-global cache content (`--all` wipes). |
141
- | `dev-kit catalog refresh` | Maintainer command to approve current upstream refs. |
142
- | `dev-kit catalog add <repository>` | Inspect a repository and approve selected skills. |
143
- | `dev-kit catalog remove <source-or-skill>` | Revoke an approval (`--yes` outside a terminal). |
144
- | `dev-kit catalog list` | List approved upstream repositories. |
145
- | `dev-kit catalog info <source>` | Show a source, commit, and approved skills. |
146
- | `dev-kit catalog verify` | Verify the committed snapshot without advancing refs. |
147
-
148
- Options vary by command and include `--dry-run`, `--manifest`, `--lockfile`,
149
- and `--project-dir`. Run any command with `--help` for its complete usage.
150
-
151
- ## How it works
152
-
153
- Dev Kit uses three project-local files:
154
-
155
- | Path | Role | Commit it? |
156
- | --------------------- | ------------------------------------------------------- | ---------- |
157
- | `dev-kit.jsonc` | Desired skills, targets, and setup tasks. | Yes |
158
- | `dev-kit.lock.json` | Resolved content digests and setup-tool versions. | Yes |
159
- | `.dev-kit/state.json` | Local ownership receipts used during apply and cleanup. | No |
160
-
161
- Skills are copied into `.agents/skills` by default. Other harness targets can
162
- copy or symlink those project-local skills.
163
-
164
- Dev Kit only changes paths represented by the manifest. Existing unknown files,
165
- modified managed files, and unsafe symlink paths are reported as conflicts and
166
- left untouched. Cleanup removes only unchanged outputs with a matching local
167
- ownership receipt.
168
-
169
- Locked mode rejects changes to the manifest, packaged skill content, or setup
170
- tool versions. A project-local process lock also prevents concurrent applies.
171
-
172
- ## Manifest
173
-
174
- `include` accepts static skill names, skill families, and explicit
175
- `<package>#<skill>` selectors:
176
-
177
- ```jsonc
178
- {
179
- "$schema": "./node_modules/@danieljvdm/dev-kit/schema/dev-kit.schema.json",
180
- "include": [
181
- "dev-kit",
182
- "effect",
183
- "open-pull-request",
184
- "workers-best-practices",
185
- "wrangler",
186
- "serve-sim",
187
- "@tanstack/ai#ai-core",
188
- ],
189
- "exclude": ["animation-vocabulary"],
190
- "setup": {
191
- "agentInstructions": { "enabled": true },
192
- "claudeInstructions": { "enabled": true },
193
- },
194
- "targets": {
195
- "agents": { "enabled": true, "mode": "copy" },
196
- "claude": { "enabled": true, "mode": "symlink" },
197
- "opencode": { "enabled": false, "mode": "symlink" },
198
- },
199
- }
200
- ```
88
+ Search the catalog before copying:
201
89
 
202
- - `dev-kit` installs guidance for operating the toolkit itself.
203
- - `effect` is a built-in family: the `effect-ts` bootstrap,
204
- `effect-architecture-audit`, `build-effect-apis`, `effect-atom-state`, and
205
- `build-effect-clis`.
206
- - External Git skills (`workers-best-practices`, `serve-sim`, …) are selected
207
- individually after scanning the project for relevant technologies. An
208
- approved source ID selects every skill from that source; use it only when
209
- the scan confirms that every member applies.
210
- - `@tanstack/ai#ai-core` explicitly selects a skill discovered in that direct
211
- project dependency; discovery alone never selects it.
212
-
213
- Dev Kit reserves `.repos/<source-id>` for project-local source checkouts. Run
214
- `dev-kit gitignore` to add `.repos/` and `.dev-kit/` to the project ignore file.
215
- The patch is idempotent, preserves existing lines, and refuses symlinked
216
- `.gitignore` files.
217
-
218
- ## Agent instructions
219
-
220
- Enable managed project-root instruction sections and a portable Claude Code
221
- bridge in the manifest:
222
-
223
- ```jsonc
224
- {
225
- "include": ["dev-kit"],
226
- "setup": {
227
- "agentInstructions": { "enabled": true },
228
- "claudeInstructions": { "enabled": true },
229
- },
230
- }
90
+ ```bash
91
+ bunx @danieljvdm/dev-kit@latest skills search cloudflare
92
+ bunx @danieljvdm/dev-kit@latest skills info workers-best-practices
93
+ bunx @danieljvdm/dev-kit@latest skills add workers-best-practices wrangler
231
94
  ```
232
95
 
233
- `setup.agentInstructions` manages marked sections in the project-root
234
- `AGENTS.md`, preserving handwritten project guidance around them. The Dev Kit
235
- section contains a short description and a pointer to the installed `dev-kit`
236
- skill. When the root `package.json` declares `vite-plus` directly, Dev Kit
237
- renders its own repository-specific Vite+ guidance — toolchain overview, help
238
- and documentation entry points, `vp env doctor` troubleshooting — rather than
239
- importing Vite+'s generic `AGENTS.md`, which can contradict the repository's
240
- exact commands; transitive installations do not opt a project in. Ambiguous or
241
- malformed managed markers fail closed.
242
-
243
- The Dev Kit section also renders an opinionated project command policy. A
244
- direct Vite+ dependency makes `vp` the only supported front door: built-in
245
- format, lint, and test commands use `vp`, while repository tasks and package
246
- scripts use `vp run`. When the manifest enables the Vite+ workflow scaffold,
247
- the canonical full validation and typecheck commands are `vp run check` and
248
- `vp run typecheck`; `vp check` alone is only the Vite+ static-check command.
249
- Without Vite+, Bun is the required package-script runner and Dev Kit lists only
250
- quality scripts the root package actually declares. The package manager named
251
- by `package.json#packageManager`, or inferred from a single recognized root
252
- lockfile, is used only for dependency-install guidance. The policy forbids
253
- switching script runners or bypassing project entry points with raw `tsc`,
254
- test-runner, linter, or formatter commands.
255
-
256
- `setup.claudeInstructions` manages `CLAUDE.md` as the relative symlink
257
- `CLAUDE.md → AGENTS.md`. It can link to the section-managed file in the same apply,
258
- or retain the older behavior of linking to an existing regular `AGENTS.md` when
259
- the section task is disabled. Both outputs are recorded independently in the
260
- lockfile and local ownership state. Disabling agent instructions removes only
261
- unchanged managed sections and deletes `AGENTS.md` only when no handwritten
262
- content remains.
263
-
264
- ## Vite+ Git hooks
265
-
266
- Enable Vite+'s project-local Git hook dispatcher in the manifest:
267
-
268
- ```jsonc
269
- {
270
- "include": ["dev-kit"],
271
- "setup": {
272
- "vitePlus": { "hooks": { "enabled": true } },
273
- },
274
- }
275
- ```
96
+ Source families select every approved skill from one source and are intentionally
97
+ broad. Prefer individual skills unless every family member applies.
276
98
 
277
- `dev-kit apply` requires `vite-plus` as an installed direct dependency and runs
278
- its project-local `vp config --no-agent` command when hook setup is missing. The
279
- generated `.vite-hooks/_` dispatcher is ignored by Git, so every linked
280
- worktree converges its own copy during install while the project-owned
281
- `.vite-hooks/pre-commit` hook remains portable. Dev Kit preserves an unrelated
282
- `core.hooksPath` instead of replacing another hook manager. Set
283
- `VITE_GIT_HOOKS=0` (or `HUSKY=0`) to skip the task for that invocation.
284
-
285
- ## Vite+ quality setup
286
-
287
- The repository always owns `vite.config.ts`. Compose Dev Kit's quality defaults
288
- from that project-owned config, then opt into the scaffolded GitHub Actions
289
- workflow independently:
290
-
291
- ```ts
292
- import { createRecommendedVitePlusConfig } from "@danieljvdm/dev-kit/vite-plus";
293
- import { defineConfig } from "vite-plus";
294
-
295
- const recommended = createRecommendedVitePlusConfig({
296
- ignorePatterns: ["apps/api/worker-configuration.d.ts", "apps/web/src/routeTree.gen.ts"],
297
- });
298
-
299
- export default defineConfig({
300
- ...recommended,
301
- // Project-owned Vite, test, build, and framework options stay local.
302
- server: { port: 5173 },
303
- });
304
- ```
99
+ Package skills use the exact `<package>#<skill>` selector:
305
100
 
306
- Spread the returned top-level config before local options. When overriding a
307
- `fmt`, `lint`, `run`, or `staged` block, spread that returned block as well so
308
- its defaults remain composed. Merge nested collections too; for example, a
309
- local lint rule block starts with `...recommended.lint.rules` before adding
310
- repository-specific rules.
311
-
312
- The factory configures `vp staged`, matching Oxlint/Oxfmt ignores for Dev Kit's
313
- tool-owned paths, and separate `vp run check` and pure `vp run typecheck` tasks.
314
- Project and framework-generated paths belong in `ignorePatterns` as shown;
315
- custom harness target paths belong there too. Dev Kit does not grow a global
316
- framework ignore list.
317
-
318
- ```jsonc
319
- {
320
- "include": ["dev-kit", "effect"],
321
- "setup": {
322
- "effectTsgo": { "enabled": true },
323
- "vitePlus": {
324
- "hooks": { "enabled": true },
325
- "workflow": { "enabled": true },
326
- },
327
- },
328
- }
101
+ ```bash
102
+ bunx @danieljvdm/dev-kit@latest skills add @tanstack/ai#ai-core
329
103
  ```
330
104
 
331
- `setup.vitePlus.workflow` scaffolds `.github/workflows/check.yml` and never
332
- reads, rewrites, adopts, or removes `vite.config.ts`. Scaffolds are
333
- create-only: the file is written only when missing, never recorded in
334
- `dev-kit.lock.json`, and never touched again — the repository owns it from
335
- creation, and disabling the task leaves it in place. Edit the YAML directly
336
- for repository-specific preparation steps or a custom typecheck command; when
337
- the shipped template improves, compare against the installed copy under
338
- `node_modules/@danieljvdm/dev-kit/templates/` and merge what fits.
339
- Scaffolding requires direct `@danieljvdm/dev-kit`, `vite-plus`, `effect`,
340
- `@effect/tsgo`, and native TypeScript dependencies with
341
- `setup.effectTsgo.enabled`, and the installed Vite+ must satisfy Dev Kit's
342
- peer range.
343
-
344
- Workspaces select bounded, dependency-ordered typechecking in their config:
345
-
346
- ```ts
347
- export default defineConfig(
348
- createRecommendedVitePlusConfig({
349
- typecheck: {
350
- strategy: "workspace",
351
- concurrency: 4,
352
- packages: ["apps/web", "packages/core"],
353
- },
354
- }),
355
- );
356
- ```
105
+ The package must already be a direct, installed dependency. Dev Kit never
106
+ downloads a missing package or executes package-provided discovery code.
357
107
 
358
- Each listed package must expose a pure `typecheck` script.
359
-
360
- The scaffolded workflow performs one frozen, script-suppressed install, runs
361
- `dev-kit apply --locked`, and only then runs formatting, linting, tests, and
362
- `vp run typecheck`. See the primary
363
- [`setup-vp` versioning guidance](https://github.com/voidzero-dev/setup-vp#versioning),
364
- [Vite+ install guide](https://viteplus.dev/guide/install), and
365
- [Vite Task run guide](https://viteplus.dev/guide/run) when maintaining the
366
- templates.
367
-
368
- ### Absolute (path-alias) imports
369
-
370
- Opt into enforcing path-alias imports for selected app sources. The factory
371
- appends an Oxlint override that errors on `../` imports inside the given
372
- globs, so those files import through tsconfig path aliases such as `@/*`:
373
-
374
- ```ts
375
- export default defineConfig(
376
- createRecommendedVitePlusConfig({
377
- absoluteImports: {
378
- files: ["apps/app/src/**/*.{ts,tsx}", "apps/mobile/src/**/*.{ts,tsx}"],
379
- },
380
- }),
381
- );
382
- ```
108
+ ### Origin receipts
383
109
 
384
- The lint rule only forbids relative parent imports; each covered app must map
385
- the alias itself. Add the `paths` entry to the app's `tsconfig.json`:
110
+ Each copied skill contains `.dev-kit-origin.json`:
386
111
 
387
- ```jsonc
388
- {
389
- "compilerOptions": {
390
- "paths": { "@/*": ["./src/*"] },
391
- },
392
- }
112
+ ```text
113
+ .agents/skills/workers-best-practices/
114
+ ├── SKILL.md
115
+ ├── references/
116
+ └── .dev-kit-origin.json
393
117
  ```
394
118
 
395
- Vite-built apps also resolve the alias from the same tsconfig by setting
396
- `resolve: { tsconfigPaths: true }` in the app's Vite config. Expo apps need no
397
- Metro configuration: Expo SDK 49+ resolves tsconfig `paths` by default.
398
-
399
- Standalone Oxlint projects compose the same override directly:
119
+ The receipt identifies that artifact's selector, approved source, and base
120
+ digest. It does not enumerate other skills, express desired project state, or
121
+ run automatically.
400
122
 
401
- ```ts
402
- // oxlint.config.ts
403
- import {
404
- createAbsoluteImportsOxlintOverride,
405
- recommendedOxlintConfig,
406
- } from "@danieljvdm/dev-kit/oxlint";
407
- import { defineConfig } from "oxlint";
123
+ An unmodified tracked skill can fast-forward safely:
408
124
 
409
- export default defineConfig({
410
- extends: [recommendedOxlintConfig],
411
- overrides: [createAbsoluteImportsOxlintOverride({ files: ["src/**/*.{ts,tsx}"] })],
412
- });
125
+ ```bash
126
+ bunx @danieljvdm/dev-kit@latest skills status
127
+ bunx @danieljvdm/dev-kit@latest skills update
413
128
  ```
414
129
 
415
- ## Worktrunk project config
130
+ When both the repository and upstream changed, Dev Kit preserves the local copy:
416
131
 
417
- Enable a scaffolded default [Worktrunk](https://worktrunk.dev) project config
418
- in the manifest:
419
-
420
- ```jsonc
421
- {
422
- "include": ["dev-kit"],
423
- "setup": {
424
- "worktrunk": { "config": { "enabled": true } },
425
- },
426
- }
132
+ ```bash
133
+ bunx @danieljvdm/dev-kit@latest skills diff workers-best-practices
427
134
  ```
428
135
 
429
- `setup.worktrunk.config` scaffolds `.config/wt.toml` with the portable hooks an
430
- app repository wants in every worktree: a `pre-start` pipeline that copies
431
- gitignored files matched by `.worktreeinclude` (a no-op without that file) and
432
- then installs dependencies, plus a `pre-merge` full-validation hook. Hook
433
- commands render for the repository's command runner: a direct `vite-plus`
434
- dependency selects `vp install` and `vp run check`; otherwise Dev Kit requires
435
- a declared root `check` package script, runs it through `bun run check`, and
436
- takes the install command from the detected package manager. Repositories with
437
- neither fail the plan instead of shipping a broken hook.
438
-
439
- The config follows the same create-only scaffold semantics as the check
440
- workflow above: created once, never locked or touched again, owned by the
441
- repository. Edit hooks freely after creation.
442
-
443
- The config intentionally carries no worktree-path template or other user
444
- preferences—those belong in each user's `~/.config/worktrunk/config.toml`. A
445
- commented `post-start` block shows how to run a per-worktree dev server on a
446
- stable branch-derived port (`{{ branch | hash_port }}`) under `wt step tether`;
447
- point it at the repository's dev entrypoint and uncomment to opt in. Worktrunk
448
- never runs project hooks until each user approves them with
449
- `wt config approvals add`.
450
-
451
- ## Effect source checkout
452
-
453
- Enable a local checkout of the exact installed Effect release in the manifest:
454
-
455
- ```jsonc
456
- {
457
- "include": ["effect"],
458
- "setup": {
459
- "effectSource": { "enabled": true },
460
- },
461
- }
462
- ```
136
+ Ask the agent to merge applicable upstream intent. After reviewing the merged
137
+ skill, advance its recorded base without overwriting it:
463
138
 
464
- `dev-kit apply` reads `node_modules/effect/package.json`, then shallow-clones or
465
- updates `.repos/effect` to the detached `effect@<version>` tag. Tag fetches go
466
- through a shared clone in the machine-global cache, so a new worktree or
467
- project reuses tags already cached on the machine and only contacts the
468
- network for a tag the cache has never seen. It skips the checkout in CI,
469
- leaves the repository in place when the task is disabled, and refuses to
470
- switch a checkout with local changes or an unexpected origin.
471
-
472
- The path, package name, and repository URL may be overridden for compatible
473
- Effect package layouts. Use `dev-kit effect sync --dry-run` to inspect this
474
- task directly.
475
-
476
- ## Effect TypeScript-Go
477
-
478
- Enable Effect TypeScript-Go in the same manifest:
479
-
480
- ```jsonc
481
- {
482
- "include": ["effect"],
483
- "setup": {
484
- "effectSource": { "enabled": true },
485
- "effectTsgo": { "enabled": true },
486
- },
487
- }
139
+ ```bash
140
+ bunx @danieljvdm/dev-kit@latest skills update workers-best-practices --accept-local
488
141
  ```
489
142
 
490
- Pin the compatible packages in the consuming project:
143
+ To sever the upstream relationship entirely:
491
144
 
492
- ```jsonc
493
- {
494
- "devDependencies": {
495
- "@danieljvdm/dev-kit": "^0.2.0",
496
- "@effect/tsgo": "0.36.4",
497
- "typescript": "7.0.2",
498
- },
499
- }
500
- ```
501
-
502
- ```jsonc
503
- {
504
- "$schema": "./node_modules/@effect/tsgo/schema.json",
505
- "compilerOptions": {
506
- "plugins": [
507
- {
508
- "name": "@effect/language-service",
509
- "diagnosticSeverity": {
510
- "anyUnknownInErrorContext": "warning",
511
- "instanceOfSchema": "suggestion",
512
- "nestedEffectGenYield": "suggestion",
513
- "newSchemaClass": "suggestion",
514
- "preferSchemaTypeProperty": "suggestion",
515
- "unsafeEffectTypeAssertion": "warning",
516
- },
517
- "overrides": [
518
- {
519
- "include": ["src/**/*.ts"],
520
- "options": {
521
- "diagnosticSeverity": {
522
- "nodeBuiltinImport": "warning",
523
- "preferSchemaOverJson": "suggestion",
524
- },
525
- },
526
- },
527
- ],
528
- },
529
- ],
530
- },
531
- }
145
+ ```bash
146
+ bunx @danieljvdm/dev-kit@latest skills detach workers-best-practices
532
147
  ```
533
148
 
534
- `dev-kit apply` validates both exact version pins and patches the project-local
535
- native TypeScript compiler. It does not download dependencies and skips an
536
- installation that is already patched. Use `dev-kit tsgo patch --dry-run` when
537
- troubleshooting the task directly.
149
+ Only the receipt is removed. The skill remains ordinary repository content.
538
150
 
539
- The same typed object is exported as `recommendedEffectTsgoPlugin` for
540
- programmatic configuration tooling. Dependency and `tsconfig.json` edits remain
541
- explicit. In a monorepo, put the plugin in the shared root config and ensure
542
- every workspace extends it without redeclaring `compilerOptions.plugins`:
543
- TypeScript replaces that array in child configs rather than merging it. Adjust
544
- the `src/**/*.ts` override to the source layout seen from each config file.
151
+ ## Eject a legacy managed project
545
152
 
546
- ## Installed package skills
153
+ Projects from the previous Dev Kit model may contain:
547
154
 
548
- Dev Kit generically discovers agent skills bundled by the project's installed
549
- JavaScript packages. It reads the project's direct dependencies, checks the
550
- package's Intent v1 discovery metadata (or Intent's repository-metadata
551
- fallback), then looks for the layout
552
- `node_modules/<package>/skills/<skill>/SKILL.md`.
553
- TanStack is one publisher of this layout; no TanStack package names or skill
554
- paths are hard-coded into Dev Kit.
155
+ - `dev-kit.jsonc`;
156
+ - `dev-kit.lock.json`;
157
+ - `.dev-kit/state.json`;
158
+ - managed sections in `AGENTS.md`;
159
+ - `dev-kit apply` lifecycle or CI commands; and
160
+ - runtime imports such as `@danieljvdm/dev-kit/vite-plus`.
555
161
 
556
- Discovery is browse-only. These commands show an installed package skill but do
557
- not select, copy, symlink, lock, or otherwise install it:
162
+ Preview the migration directly:
558
163
 
559
164
  ```bash
560
- bun x dev-kit list --all
561
- bun x dev-kit search tanstack
562
- bun x dev-kit info @tanstack/ai#ai-core
165
+ bunx @danieljvdm/dev-kit@latest eject --dry-run
563
166
  ```
564
167
 
565
- Selection is explicit and package-qualified:
168
+ Dry-run reports recurring behaviors that still need repo-owned replacements.
169
+ Typical examples are local Vite+/Oxlint/Oxfmt configuration, Effect compiler
170
+ patching, source checkouts, and Git hook generation.
566
171
 
567
- ```bash
568
- bun x dev-kit add @tanstack/ai#ai-core
569
- ```
570
-
571
- That writes `@tanstack/ai#ai-core` to `dev-kit.jsonc` and, unless
572
- `--no-apply` is passed, installs it through the normal ownership-safe sync
573
- path. The qualifier prevents ambiguity when two dependencies publish the same
574
- skill name, and the installed output carries it: the copied directory flattens
575
- the package name and appends the skill name (`@tanstack/ai#ai-core` →
576
- `tanstack-ai-ai-core`), and the copied `SKILL.md` frontmatter `name:` is
577
- rewritten to match because harnesses identify a skill by its directory name.
578
- Symlink-mode targets link straight into `node_modules`, so only the link
579
- carries the qualified name. Two selections that would write the same
580
- destination are rejected before any output changes.
581
-
582
- The compatibility boundary is intentionally small and deterministic: only the
583
- root project's direct dependencies are scanned, package code is never imported
584
- or executed, npm-style and pnpm/workspace symlinks are supported (Yarn
585
- Plug'n'Play and transitive traversal are not), and only immediate
586
- `skills/<name>/SKILL.md` roots are listed — nested topic skills and references
587
- are copied as part of their root.
588
-
589
- The project `dev-kit.lock.json` records the selected package name, installed
590
- version, original bare skill name, and the `node_modules` content digest.
591
- `apply --locked` therefore rejects package-version or skill-content drift.
592
- Dev Kit never downloads a missing package or substitutes a registry version.
593
-
594
- See TanStack's
595
- [Agent Skills documentation](https://tanstack.com/ai/latest/docs/getting-started/agent-skills)
596
- for a real package suite that uses this convention.
597
-
598
- ## Approved external Git skills
599
-
600
- This repository remains an opinionated catalog for Git-hosted skills.
601
- `skill-sources.jsonc` contains only reviewed Git sources:
602
-
603
- ```jsonc
604
- {
605
- "$schema": "./schema/skill-sources.schema.json",
606
- "sources": [
607
- {
608
- "id": "emilkowalski-skills",
609
- "repository": "https://github.com/emilkowalski/skills.git",
610
- "ref": "main",
611
- "skillsPath": "skills",
612
- "include": ["*"],
613
- "licensePath": "LICENSE",
614
- },
615
- ],
616
- }
617
- ```
618
-
619
- Maintainers approve a new upstream snapshot with:
172
+ After the agent materializes those behaviors, run:
620
173
 
621
174
  ```bash
622
- bun run catalog:refresh
623
- bun run catalog:check
175
+ bunx @danieljvdm/dev-kit@latest eject
624
176
  ```
625
177
 
626
- Adding a Git source does not require editing JSONC:
178
+ The command:
627
179
 
628
- ```bash
629
- dev-kit catalog add https://github.com/owner/repository
630
- dev-kit catalog add https://github.com/owner/repository \
631
- --skill one --skill two
632
- dev-kit catalog add https://github.com/owner/repository --all
633
- ```
634
-
635
- GitHub tree URLs are accepted. `--all` expands to the skills found at that
636
- exact snapshot; it never writes a wildcard that could silently approve a future
637
- upstream addition. Catalog refresh resolves refs to exact commits, validates
638
- names and paths, rejects symlinks and collisions, extracts descriptions, and
639
- updates `skill-sources.lock.json`.
640
-
641
- When a project selects one of these Git-backed skills, Dev Kit fetches the
642
- approved commit into a machine-global cache and installs it through the same
643
- ownership-safe sync path. Cache entries are keyed by resolved commit SHA, so
644
- every project and git worktree on the machine shares one download; a warm
645
- `dev-kit plan` or `dev-kit apply` performs no network operations. The cache
646
- lives in `$XDG_CACHE_HOME/dev-kit` (falling back to `~/Library/Caches/dev-kit`
647
- on macOS and `~/.cache/dev-kit` elsewhere) and may be overridden with
648
- `DEV_KIT_CACHE_DIR`; it is safe to delete at any time. Populating this
649
- immutable commit-keyed cache is not project state, so planning and `--locked`
650
- verification use it too. Only a reviewed catalog refresh changes the approved
651
- Git content.
652
-
653
- The cache does not grow without bounds: every use refreshes a recency stamp,
654
- and `dev-kit apply` sweeps content unused for 30 days at most once a day.
655
- Shared Effect repositories drop unused tags individually and are removed whole
656
- once empty. Run `dev-kit cache prune` to sweep on demand (`--max-age-days` to
657
- tune the threshold, `--all` to clear the cache entirely); an evicted entry is
658
- simply fetched again the next time a project needs it.
659
-
660
- ## Oxlint and Oxfmt configurations
661
-
662
- Dev Kit exports typed Oxlint/Oxfmt presets for standalone Oxc projects. The
663
- Vite+ factory composes both presets and keeps their tool-path ignores aligned:
664
-
665
- ```ts
666
- import { createRecommendedVitePlusConfig } from "@danieljvdm/dev-kit/vite-plus";
667
- import { defineConfig } from "vite-plus";
668
-
669
- export default defineConfig(createRecommendedVitePlusConfig());
670
- ```
671
-
672
- The shared lint preset enables `typeAware` for semantic lint rules but leaves
673
- `typeCheck` disabled. Effect TypeScript-Go projects run:
674
-
675
- ```sh
676
- vp fmt --check
677
- vp lint
678
- vp test
679
- vp run typecheck
680
- ```
180
+ - preserves and releases managed agent instructions;
181
+ - converts safe legacy skill outputs into repo-owned copies with origin receipts;
182
+ - removes the Dev Kit dependency and pure apply scripts;
183
+ - removes the known legacy CI verification step; and
184
+ - deletes the manifest, lock, and local ownership receipt.
681
185
 
682
- Standalone projects import the same objects from their native config files:
186
+ It stops before writing when a managed setup task, runtime import, ambiguous
187
+ script, modified destination, unsafe path, or malformed marker still needs human
188
+ or agent judgment. Regenerate the package-manager lockfile and run the full
189
+ repository validation after ejection.
683
190
 
684
- ```ts
685
- // oxlint.config.ts
686
- import { recommendedOxlintConfig } from "@danieljvdm/dev-kit/oxlint";
687
- import { defineConfig } from "oxlint";
191
+ ## Approved catalog maintenance
688
192
 
689
- export default defineConfig({
690
- extends: [recommendedOxlintConfig],
691
- });
692
- ```
693
-
694
- ```ts
695
- // oxfmt.config.ts
696
- import { recommendedOxfmtConfig } from "@danieljvdm/dev-kit/oxfmt";
697
- import { defineConfig } from "oxfmt";
193
+ External skill sources are authored in `skill-sources.jsonc` and approved as
194
+ exact commits in `skill-sources.lock.json`. These are package-maintainer files,
195
+ not consumer project state.
698
196
 
699
- export default defineConfig({
700
- ...recommendedOxfmtConfig,
701
- });
702
- ```
197
+ | Command | Purpose |
198
+ | ------------------------------------------ | ----------------------------------------------------- |
199
+ | `dev-kit catalog add <repository>` | Inspect a repository and approve selected skills. |
200
+ | `dev-kit catalog remove <source-or-skill>` | Revoke an approval. |
201
+ | `dev-kit catalog list` | List approved sources. |
202
+ | `dev-kit catalog info <source>` | Show one source's commit and skills. |
203
+ | `dev-kit catalog refresh` | Advance approved refs and regenerate the snapshot. |
204
+ | `dev-kit catalog verify` | Verify the committed snapshot without advancing refs. |
703
205
 
704
- The Oxlint preset vendors and enables every rule from
705
- [dmmulroy/anti-slop](https://github.com/dmmulroy/anti-slop) at upstream commit
706
- `9b80d9a5c317d3af94d88a577bdbde4d9a45f7be`. These opinionated rules reject
707
- low-evidence patterns such as broad `unknown` contracts, runtime `typeof`
708
- narrowing, module mocking, chained assertions, and assertions without a
709
- nearby `SAFETY:` justification. The package also exports the plugin from
710
- `@danieljvdm/dev-kit/oxlint-plugin-anti-slop`. Its vendored MIT license is
711
- retained beside the source.
712
-
713
- The TypeScript files under `src/oxlint-plugin-anti-slop/` are canonical. After
714
- updating them, run `vp run anti-slop:bundle` to regenerate the package-loadable
715
- JavaScript entry point without cleaning canonical source.
716
-
717
- The preset also enables `stylistic/padding-line-between-statements`: adjacent
718
- variable declarations remain grouped, while the next logical statement and
719
- all `return` statements require a separating blank line. The rule is fixable,
720
- so `vp lint --fix` repairs missing spacing automatically. With the matching
721
- Oxlint 1.78 peer installed, Vite+ 0.2.6 executes the preset's JavaScript-plugin
722
- rules through the normal `vp lint` command.
723
-
724
- The preset also registers the shared `effect` JavaScript plugin. Effect
725
- projects opt into its rules in path-specific overrides, for example
726
- `effect/no-effect-run`, `effect/no-unsafe-promise`, and
727
- `effect/no-untyped-throw`. The package exports the plugin directly from
728
- `@danieljvdm/dev-kit/oxlint-plugin-effect` for configurations that do not
729
- extend the recommended preset. Strict workflow, Atom, and boundary rules remain
730
- consumer-scoped because application and host boundaries differ by repository.
206
+ Resolved external content is cached machine-wide by immutable commit. Project
207
+ skill copies remain independent of that cache.
731
208
 
732
209
  ## Development
733
210
 
211
+ This repository uses Vite+ as its command authority:
212
+
734
213
  ```bash
735
214
  vp install
736
215
  vp run check
737
216
  ```
217
+
218
+ The package's own `prepare` script explicitly syncs its Effect source checkout,
219
+ patches Effect TypeScript-Go, and configures Vite+ Git hooks. Those are local
220
+ development operations for Dev Kit itself, not a consumer management model.
221
+
222
+ The v1 decoder exists only behind `eject`. Repository-setup behavior belongs in
223
+ `skills/dev-kit` as concise agent instructions and progressively disclosed
224
+ references. Deterministic CLI code is reserved for catalog, provenance,
225
+ migration, validation, and other mechanics where a free-form agent edit would
226
+ be unsafe.