@dextinity/agent-features 2.0.0-canary-20260729062014

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 (39) hide show
  1. package/LICENSE +24 -0
  2. package/package.json +19 -0
  3. package/rules/coding-guidelines/api-nestjs.instructions.md +107 -0
  4. package/rules/coding-guidelines/cdn.instructions.md +24 -0
  5. package/rules/coding-guidelines/general.instructions.md +30 -0
  6. package/rules/coding-guidelines/git.instructions.md +37 -0
  7. package/rules/coding-guidelines/kubernetes.instructions.md +59 -0
  8. package/rules/coding-guidelines/libraries.instructions.md +34 -0
  9. package/rules/coding-guidelines/naming.instructions.md +39 -0
  10. package/rules/coding-guidelines/postgresql.instructions.md +40 -0
  11. package/rules/coding-guidelines/react.instructions.md +102 -0
  12. package/rules/coding-guidelines/security.instructions.md +44 -0
  13. package/rules/coding-guidelines/styling.instructions.md +50 -0
  14. package/rules/coding-guidelines/typescript.instructions.md +50 -0
  15. package/skills/.gitkeep +0 -0
  16. package/skills/comet-admin-ui/SKILL.md +492 -0
  17. package/skills/comet-block/SKILL.md +252 -0
  18. package/skills/comet-block/references/admin-patterns.md +192 -0
  19. package/skills/comet-block/references/api-patterns.md +183 -0
  20. package/skills/comet-block/references/block-loader.md +368 -0
  21. package/skills/comet-block/references/block-types.md +210 -0
  22. package/skills/comet-block/references/custom-block-field.md +266 -0
  23. package/skills/comet-block/references/fixtures.md +436 -0
  24. package/skills/comet-block/references/image.md +341 -0
  25. package/skills/comet-block/references/migration.md +597 -0
  26. package/skills/comet-block/references/registration.md +167 -0
  27. package/skills/comet-block/references/response-summary.md +102 -0
  28. package/skills/comet-block/references/rich-text.md +309 -0
  29. package/skills/comet-block/references/select.md +176 -0
  30. package/skills/comet-block/references/site-patterns.md +202 -0
  31. package/skills/comet-core-admin-component-authoring/SKILL.md +92 -0
  32. package/skills/comet-mail-react/SKILL.md +621 -0
  33. package/skills/comet-mail-react/references/components-and-theme.md +431 -0
  34. package/skills/comet-mail-react/references/layout-patterns.md +315 -0
  35. package/skills/comet-mail-react/references/styling-and-customization.md +306 -0
  36. package/skills/comet-major-migration/SKILL.md +161 -0
  37. package/skills/comet-major-migration/references/migration-smoke-test.md +196 -0
  38. package/skills/comet-minor-update/SKILL.md +191 -0
  39. package/skills/dev-pm/SKILL.md +100 -0
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: comet-major-migration
3
+ description: Migrates a Comet project across a major version (e.g. v4 → v5, v5 → v6). Use when the user asks to upgrade Comet, follow a Comet migration guide, or bump @dextinity/* packages to a new major.
4
+ ---
5
+
6
+ # Major Comet Version Migration Skill
7
+
8
+ ## When to use
9
+
10
+ Upgrading `@dextinity/*` packages across a major version in a project (root, API, Admin, Site). A Comet major typically bundles breaking changes across React / Next.js / MUI X and may require updating peer/third-party packages.
11
+
12
+ Do NOT use for minor or patch upgrades, or for ongoing feature work on a project already on the target major.
13
+
14
+ ## Locate the migration guide
15
+
16
+ 1. **Find out the target major** from the user if not specified.
17
+ 2. **Browse the index:** https://github.com/vivid-planet/comet/tree/main/docs/docs/7-migration-guide — use a GitHub MCP tool if available, otherwise `WebFetch`.
18
+ 3. **Download the raw Markdown** so all content is in context:
19
+ ```
20
+ https://raw.githubusercontent.com/vivid-planet/comet/refs/heads/main/docs/docs/7-migration-guide/migration-from-v{N}-to-v{N+1}.md
21
+ ```
22
+ 4. **If no guide exists** for the target version, stop and tell the user. Don't migrate without an official guide.
23
+
24
+ ## Choose the target version
25
+
26
+ When bumping the `@dextinity/*` packages, **do not pin to `{N+1}.0.0`.** The `.0.0` release is rarely what you want — the new major accumulates bug fixes and patches after release. Bump to the **newest minor/patch release within the new major** instead.
27
+
28
+ Find it with `npm view` (filter to the new major, drop pre-releases like `-canary`/`-beta`/`-rc`):
29
+
30
+ ```bash
31
+ npm view @dextinity/cms-api versions --json | \
32
+ python3 -c "import json,sys; v=json.load(sys.stdin); \
33
+ stable=[x for x in v if x.startswith('{N+1}.') and '-' not in x]; \
34
+ print(stable[-1])"
35
+ ```
36
+
37
+ Substitute `{N+1}.` with the target major (e.g. `9.`). Pin every core `@dextinity/*` package to that exact version — no caret or tilde. The migration guide's own examples may show `{N+1}.0.0`; treat those as illustrative and use the newest release instead.
38
+
39
+ ## Detect the project shape
40
+
41
+ Before starting, figure out what's in this project. Comet projects vary — **anywhere between 0 and N sites is possible**:
42
+
43
+ - **0 sites** — admin-only/headless. **Skip every site step in the guide** (package.json edits, codemods, config, verification). Don't treat the missing site as an error.
44
+ - **1 site** — run the site section once.
45
+ - **2+ sites** — **run the site section once per site.** Each site has its own `package.json`, etc. Skipping the duplicates is the most common multi-site migration miss.
46
+
47
+ **Check whether the project has a page tree** (e.g. grep the admin source for its page-tree page like `PagesPage`, or the API for `PageTreeModule`). Skip page-tree-specific steps if it's absent.
48
+
49
+ Sites can live under `site/`, `sites/<tenant>/`, or any custom path. Discover them by scanning `package.json` files for `@dextinity/site-nextjs`:
50
+
51
+ ```bash
52
+ grep -l '"@dextinity/site-nextjs"' $(find . -name package.json -not -path '*/node_modules/*' -not -path '*/.next/*')
53
+ ```
54
+
55
+ Record the resolved site list durably (e.g. a note on the first `TaskCreate` task) so every site-section pass references the same list. If empty, write "no site package — skip site sections".
56
+
57
+ ## Workflow
58
+
59
+ 1. **Read the guide end-to-end first.** Note every section, code change, codemod, and verification command. Breaking changes hide in sub-bullets.
60
+ 2. **Create tasks** with `TaskCreate` — one per major section. For the site section, create **one task per resolved site**, or skip site tasks if none. Mark `in_progress`/`completed` as you go.
61
+ 3. **Ensure a clean working tree.** Confirm with the user if not.
62
+ 4. **Work through the guide section-by-section, in order.**
63
+ - Apply every change in the section.
64
+ - **Site section: repeat every step once per resolved site.** Skip entirely if no site package.
65
+ - Run any codemods the section prescribes — they catch edge cases hand-fixing misses.
66
+ - Run any verification commands.
67
+ - **A green build is not proof a section is complete.** Hand-written types can mask a missing runtime change — a type that no longer matches a value's real shape (e.g. a synchronous type over what is now a `Promise`) lets `tsc` pass while the code breaks at runtime. When a guide step makes an API async or is otherwise runtime-only, scan **every** affected file in **every** site by hand instead of trusting `tsc`/lint to flag them.
68
+ - After each section: `npm run lint` (and `npm run test` if present) in the affected package. Multi-site: lint each site after its pass.
69
+ - **Commit after each section** with a message naming the section. For multi-site, either commit per-site or bundle the site section — pick one and be consistent.
70
+ 5. **Do not combine sections.** Keep commits separate to make bisecting trivial.
71
+
72
+ ## When the guide is unclear
73
+
74
+ If a step is ambiguous or doesn't match the project, consult before guessing:
75
+
76
+ - **https://github.com/vivid-planet/comet** — the monorepo. Check the source of the package the guide discusses for the new public API shape.
77
+ - **https://github.com/vivid-planet/comet-starter** — the canonical reference project, always kept on the current major. Use it for questions like "how should `tsconfig.json` look after this migration?"
78
+
79
+ Prefer the GitHub MCP; fall back to `WebFetch` on `raw.githubusercontent.com`. If still unclear, ask the user — don't guess.
80
+
81
+ ## When to stop and ask the human
82
+
83
+ Stop immediately — don't work around — in any of these cases:
84
+
85
+ - **`npm install` fails** (auth, peer-deps, sandbox-write, etc.). Hand the user the exact command and wait.
86
+ - **A codemod fails** (panic, missing binary, transform error). Hand off the command.
87
+ - **A shell command is blocked by the sandbox.** Hand off.
88
+ - **A migration step references a file or symbol that doesn't exist.** Ask for clarification.
89
+
90
+ **Commit signing failures are not a blocker.** If `git commit` fails with a signing error (1Password socket, GPG unavailable), retry with `--no-gpg-sign` and continue.
91
+
92
+ After the user confirms, resume from the same step.
93
+
94
+ ## Final verification via clean subagent
95
+
96
+ After the full migration is committed:
97
+
98
+ 1. Dispatch a fresh subagent (`Agent` tool, `general-purpose` or `Explore`) with no session context.
99
+ 2. Give it the migration guide URL and `git log main..HEAD`.
100
+ 3. Ask it to cross-reference: for every section/step, does a commit implement it? Report gaps or deviations.
101
+ 4. Review findings with the user and resolve.
102
+
103
+ Example prompt:
104
+
105
+ ```
106
+ The branch <branch> migrates this project from Comet v{N} to v{N+1}.
107
+ The migration guide is at <raw-md-url>.
108
+
109
+ For every section and sub-bullet in the guide, verify that a commit in
110
+ `git log main..<branch>` implements the required change. Report every
111
+ gap, skipped step, or deviation with the relevant file path and a
112
+ quote from the guide. Report in under 300 words.
113
+ ```
114
+
115
+ Running this fresh keeps the audit independent of the session that produced the changes.
116
+
117
+ ## Offer a smoke test
118
+
119
+ Once committed and audited, **offer the user a smoke test**. Lint/tsc green is necessary but not sufficient — React/Next/MUI majors introduce dev-only warnings, hydration mismatches, silent routing breakage, and broken embedded webcomponents that only surface in the browser.
120
+
121
+ Before starting, tell the user:
122
+
123
+ - The smoke test drives admin and site(s) in a real browser via **Playwright MCP** (`browser_*` tools). Confirm MCP is available.
124
+ - The **app must be running** — admin, api, codegens, and **every site service** all `Running` per `dev-pm status`. Multi-site projects run each site on its own port. Ask them to start whatever isn't running.
125
+
126
+ The project shape was already detected (see [Detect the project shape](#detect-the-project-shape)). **Pass it to the subagent** rather than making it re-run discovery.
127
+
128
+ If the user agrees and prerequisites are met, **dispatch the smoke test in a fresh subagent** (`Agent` tool, `general-purpose`) — the procedure walks dozens of routes per site and would burn the main session's context inline. The subagent gets the Playwright MCP tools automatically.
129
+
130
+ Two things to substitute in the prompt:
131
+
132
+ - The **absolute path** to `references/migration-smoke-test.md` inside this skill. The skill lives wherever Claude Code installed it (typically `~/.claude/skills/comet-major-migration/` or `<project>/.claude/skills/comet-major-migration/`). Resolve `references/migration-smoke-test.md` relative to the SKILL.md you're reading.
133
+ - The **detected site list** with dev URLs, and **whether the project has a page tree** (see [Detect the project shape](#detect-the-project-shape)).
134
+
135
+ ```
136
+ Run the smoke-test procedure defined in
137
+ `<absolute path to references/migration-smoke-test.md within this skill>`
138
+ against this project end-to-end. Read that file first, then execute the
139
+ procedure (prerequisites, inventory, admin pass, site pass per site,
140
+ triage).
141
+
142
+ Sites (already detected — do NOT re-run the discovery grep):
143
+ <e.g. "none — no site package, skip site pass" |
144
+ "1 site at site/, dev URL http://localhost:3000" |
145
+ "2 sites: sites/de/ at http://localhost:3000, sites/at/ at http://localhost:3001">
146
+
147
+ Page tree: <present | not present>.
148
+
149
+ Apply the site pass once per listed site (or skip if none).
150
+ Run page-tree CRUD only if the page tree is present.
151
+
152
+ Write findings to `test-report.md` at the repo root as you go — that
153
+ file is the deliverable. When done, reply with a <200 word summary:
154
+ how many routes/URLs you covered (per site if multi-site), the top 3-5
155
+ findings by user impact, and whether anything blocked you. Don't paste
156
+ the full report back; I'll read test-report.md directly.
157
+ ```
158
+
159
+ When the subagent returns, read `test-report.md` and walk the top findings with the user.
160
+
161
+ If the user declines, skip — the migration is otherwise complete.
@@ -0,0 +1,196 @@
1
+ # Migration Smoke-Test
2
+
3
+ Run after a major migration finishes (lint/tsc green, all commits pushed) to catch runtime regressions that lint and tsc can't see.
4
+
5
+ ## Project shape
6
+
7
+ The dispatching prompt should tell you the project shape — the list of sites with their dev URLs/ports. **Use what's in the prompt; don't re-run discovery `grep`.**
8
+
9
+ The dispatching prompt states the site list and whether a page tree is present. Decide each pass on its own signal:
10
+
11
+ | Pass | Run it when... |
12
+ | -------------- | -------------------------------------------- |
13
+ | Admin pass | always |
14
+ | Page-tree CRUD | the prompt says a page tree is present |
15
+ | Site pass | one or more sites are listed (once per site) |
16
+
17
+ For multi-site projects, the site pass runs **once per site** — each has its own sitemap and regression surface. A Next.js major can break one site while leaving another working.
18
+
19
+ Note the shape (verbatim from the prompt) at the top of `test-report.md` so the reader knows what was and wasn't covered.
20
+
21
+ **Fallback if the prompt is missing this info:** scan `package.json` files for `@dextinity/site-nextjs` and flag the gap in your summary.
22
+
23
+ ```bash
24
+ grep -l '"@dextinity/site-nextjs"' $(find . -name package.json -not -path '*/node_modules/*' -not -path '*/.next/*')
25
+ ```
26
+
27
+ ## Prerequisites
28
+
29
+ 1. **Services running.** `dev-pm status`; admin, api, and codegens must be `Running`. Site only matters if `@dextinity/site-nextjs` exists. Restart any that aren't.
30
+ 2. **Fixtures loaded.** `npm --prefix api run fixtures` — for projects with a page tree, this seeds the sitemap URLs. Re-run if the migration changed seed/slug logic.
31
+ 3. **Drive via Playwright MCP** (`browser_*` tools) so console errors are captured. `curl` is fine for HTTP-status sweeps but won't see hydration/DOM-prop errors.
32
+ 4. **Fresh repo-root `test-report.md` ready to write to.** Append findings as you go.
33
+
34
+ ## Inventory the surface
35
+
36
+ Skip if the project already has an authoritative inventory file. Otherwise:
37
+
38
+ - **Admin routes:** read `admin/src/common/MasterMenu.tsx` (or equivalent), list every `path:` entry, group by section.
39
+ - **Admin grids/forms:** for each route, identify writable entities (Add/Edit/Delete) — those need a full CRUD pass.
40
+ - **Site URL buckets** _(skip if no site package)_: fetch the site's `sitemap.xml` (find the dev URL/port it listens on via `dev-pm status`). Parse `<loc>` entries, classify into buckets by URL pattern.
41
+
42
+ Keep inventory in scratch; don't write to `test-report.md` yet.
43
+
44
+ ## Admin pass
45
+
46
+ For each admin route:
47
+
48
+ 1. `browser_navigate` to it.
49
+ 2. `browser_snapshot` to confirm rendering — `<main>` with content vs empty/error fallback.
50
+ 3. `browser_console_messages level=error` and `level=warning`. Record error/warning counts and one-line excerpts (~120 chars).
51
+ 4. For writable entities, run CRUD:
52
+ - **Add:** open form, fill required fields with `playwright-smoke-<timestamp>`. Save.
53
+ - **Edit:** change one field, save.
54
+ - **Delete:** remove the record. If no delete control, verify the underlying mutation works via console `fetch('/api/graphql', ...)` before declaring the API broken.
55
+ - If Save fails, capture the error and skip Edit/Delete to avoid half-state.
56
+
57
+ ### Page Tree CRUD is mandatory (when a page tree is present)
58
+
59
+ **Skip if the project has no page tree** (the dispatching prompt says whether it does).
60
+
61
+ Otherwise: the page tree exercises the most upstream code paths (block editor, RTE, file picker, page-tree GraphQL, route-tab navigation). Run a full Add → Edit → Delete on at least one page-tree category:
62
+
63
+ 1. Open the page tree in the admin (find it via the menu). Pick any category.
64
+ 2. **Add:** create a page, fill the required fields, save. Confirm the row appears and the URL is clean.
65
+ 3. **Edit:** open the page. **Walk every tab the page-edit view exposes.** Capture console after each tab switch. Change one field, save, reload, verify it persisted.
66
+ 4. **Delete:** remove the page and confirm the row is gone.
67
+
68
+ If any step fails, that's a blocker for the PR.
69
+
70
+ After the run, delete any test records (or note them in `test-report.md`).
71
+
72
+ ### Baseline errors
73
+
74
+ A project may have a few errors that fire on _every_ admin page. Identify these once and call them "baseline" — count per-route errors _above_ baseline rather than reporting baseline N times.
75
+
76
+ ## Site pass
77
+
78
+ **Skip this section entirely if no `@dextinity/site-nextjs` package.** Note "no site package, site pass skipped" in `test-report.md` and stop here.
79
+
80
+ **For multi-site projects, run once per site.** Each has its own sitemap, routes, and regression surface. Sites typically expose themselves:
81
+
82
+ - Each site config declares its `domains` (a main domain plus any additional ones). Locally these resolve to `localhost`, usually as distinct subdomains (e.g. `<site>.localhost:<port>`); check the site configs and `dev-pm status` for each site's dev URL.
83
+ - Hit a specific site with its dev URL.
84
+
85
+ Write per-site results under their own subheading (e.g. `### Site: <site-name> (<dev-url>)`).
86
+
87
+ 1. Fetch `sitemap.xml`, parse `<loc>` entries.
88
+ 2. **Bucket URLs** by pattern (locale-prefixed, fixture/scaffold, normal pages, ...). Some buckets need sampling; small ones can be exhausted.
89
+ 3. **Pick a seeded sample.** Common shape: 20 normal + all of any small bucket the user cares about. Use a deterministic shuffle for reproducible runs.
90
+ 4. For each picked URL: navigate, snapshot, collect errors/warnings.
91
+ 5. For high-volume buckets, **bulk-fetch HTTP status first**: `curl -s -o /dev/null -w "%{http_code}"` catches blanket 404s in seconds. Browser-walk 200s plus a handful of 404s to see the error page.
92
+ 6. **Bytes-check sitemap URLs with special characters.** If a `<loc>` contains `:`, `?`, `#`, `&`, or other RFC 3986 sub-delims, verify it resolves. Use `od -c` to confirm a colon is real, not a `&#58;` artifact.
93
+
94
+ ### Embedded webcomponents (high-risk)
95
+
96
+ If the site embeds third-party **webcomponents** / micro-frontends — a block that loads an external `<script>` mounting a widget owned by another team — treat every page that renders one as high-risk and test each webcomponent **individually in the browser**.
97
+
98
+ Webcomponents can crash at runtime while lint, `tsc`, and the build all pass.
99
+
100
+ 1. **Detect:** `grep -rnE "customElements|next/script|<script" site/src`, plus any block whose job is to embed an external widget.
101
+ 2. **Browser-test each webcomponent type** (not just each page): navigate to a page that renders it, confirm it actually **mounts and is interactive** — a 200 status or a rendered page shell is not enough — and capture console errors.
102
+ 3. A crash here is a **production blocker**, not a warning.
103
+ 4. Call out every webcomponent and its result explicitly in `test-report.md`, and tell the user to verify each one on staging **before deploying to production**.
104
+
105
+ ### Side effect of 404s
106
+
107
+ Any URL that falls through to not-found may produce _additional_ errors from the not-found page itself. Don't count these against the per-URL budget — they're a single not-found bug surfacing N times.
108
+
109
+ ## Triage findings
110
+
111
+ Apply one of three labels _while_ walking, not after:
112
+
113
+ 1. **Project-fixable** — broken code is under `admin/src`, `site/src`, `api/src`. Belongs in the migration PR or a follow-up.
114
+ 2. **Comet upstream** — broken code is under `node_modules/@dextinity/*`. Surface to the user; don't workaround.
115
+ 3. **Pre-existing / out-of-scope** — same warning pre-existed the migration. Note once at the bottom; don't itemize per-route.
116
+
117
+ If you can't tell which bucket, grep for the symbol in the project source — if absent, it's upstream or a transitive dep.
118
+
119
+ ## Output: `test-report.md`
120
+
121
+ Write findings to `test-report.md` at the repo root as you go. The file is the deliverable.
122
+
123
+ ```markdown
124
+ # Smoke-test findings — <date>
125
+
126
+ Tool: Playwright MCP (Chromium). Branch: `<branch>`.
127
+ Sites detected: <none | list of site dirs + dev URLs>.
128
+ Page tree: <present | absent>.
129
+ Scope: <admin route count> admin routes; per site, <URL count> sampled from <total>.
130
+
131
+ ## TL;DR — biggest problems first
132
+
133
+ <5–8 numbered bullets, ordered by user impact, each with file path or error excerpt>
134
+
135
+ ## Session-global console errors (every admin page)
136
+
137
+ <the 0–2 baseline errors, called out once>
138
+
139
+ ## Admin
140
+
141
+ ### <route>
142
+
143
+ - **Screen**: clean | "<visible error>"
144
+ - **Console**: <n> errors, <m> warnings (above baseline)
145
+ - <one-line excerpt of each>
146
+ - **CRUD** (if applicable): create/edit/delete: ok | failed (<why>)
147
+
148
+ ## Sites
149
+
150
+ (One block per site. Skip the section entirely if no sites.)
151
+
152
+ ### Site: <site-name> (<dev-url>)
153
+
154
+ #### Sampling
155
+
156
+ - Sitemap total: <n> URLs in <bucket-count> buckets.
157
+ - Sample: <breakdown by bucket>.
158
+
159
+ #### Per-URL results
160
+
161
+ <grouped by error class, e.g. "0 errors", "1 error — <error string>">
162
+
163
+ ## Hand off to Comet upstream
164
+
165
+ <numbered list of upstream bugs with @dextinity/\* module paths>
166
+
167
+ ## Numbers
168
+
169
+ - Admin routes visited: <n>. Broken: <n>. With extra console errors: <n>.
170
+ - Site URLs sampled: <n total>. HTTP 200: <n>. HTTP 404: <n>.
171
+
172
+ ## Cleanup
173
+
174
+ - Test records left in DB: <list or "none">.
175
+ ```
176
+
177
+ Avoid one heading per URL when most look the same — group by failure mode. Five URLs with the same console warning are one finding with five examples.
178
+
179
+ ## Re-verify after fixes
180
+
181
+ After the engineer fixes project-fixable findings:
182
+
183
+ 1. **Re-run failing scenarios in the browser** — not just the unit test. Green `tsc` doesn't tell you if the URL resolves.
184
+ 2. **For each "Fixed" item**: load a previously-broken URL, capture console, confirm the specific error string is gone. A different error could have replaced it.
185
+ 3. **Re-run fixtures if the migration changed seed/slug logic** before re-checking site URLs.
186
+ 4. **Bytes-check the sitemap** for previously-broken patterns (use `od -c`, not just `grep`).
187
+ 5. **Update `test-report.md`** with a "Fixed in this branch" section. Keep upstream/out-of-scope findings in place.
188
+
189
+ Useful pattern: ask "commit each fix atomically?" before starting — answer is almost always yes — and re-run the smoke test after to confirm hooks didn't revert anything.
190
+
191
+ ## When to stop and ask the human
192
+
193
+ - **Hundreds of URLs in a bucket all 404.** Route-group regression, not N bugs. Stop after the first 5–10 confirm the pattern.
194
+ - **A console error mentions a file you can't locate** under `src/` or `node_modules/@dextinity/*`. Ask, don't guess.
195
+ - **CRUD test fails with a 500 suggesting data corruption** (FK violation, dangling reference). Stop before continuing; test data may be polluting subsequent runs.
196
+ - **Playwright MCP can't reach the dev server** (timeouts, ECONNREFUSED). Check `dev-pm status`; if everything is `Running` but unreachable, surface the discrepancy before random restart commands.
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: comet-minor-update
3
+ description: Performs a minor or patch version bump of all @dextinity/* packages across a Comet project (root, api, admin, and any site packages — zero, one, or many) to the newest version within the current major from npm, then installs. Use when the user asks to update Comet, bump Comet packages, do a minor Comet update, or upgrade Comet to the latest patch/minor of the current major.
4
+ ---
5
+
6
+ # Comet Minor/Patch Update Skill
7
+
8
+ A Comet project is not an npm workspace — the repo root, `api/`, `admin/`, and any site packages (zero, one, or many) each have their own `package.json` and `package-lock.json`. A minor or patch Comet update therefore means updating every occurrence of every `@dextinity/*` dependency across those files to the same new version, then running `npm install` in each directory so each lockfile picks up the new version.
9
+
10
+ This skill covers **minor and patch** updates within the current major only (e.g. `8.20.4 → 8.21.0`). Major upgrades (e.g. `8.x → 9.x`) are different — they typically ship breaking changes, codemods, and migration guides, and are out of scope here.
11
+
12
+ ## Invariants
13
+
14
+ Two rules hold across every `@dextinity/*` core package in the project, before and after the update:
15
+
16
+ - **Pinned versions only.** Every core `@dextinity/*` entry must be an exact version (e.g. `8.21.0`), never a range (`^8.21.0`, `~8.21.0`, `>=…`). If you see a caret or tilde on a core package, the project is in a broken state — stop and tell the user.
17
+ - **All core packages on the same version.** Every core `@dextinity/*` package in the project must be pinned to the same version across every `package.json`. There is no supported mix-and-match.
18
+
19
+ These rules apply only to the core set (packages released together from the Comet monorepo). Satellite packages like `@comet/dev-process-manager` are out of scope — see Step 1.
20
+
21
+ ## When to use
22
+
23
+ - "Do a minor comet update"
24
+ - "Update comet" / "bump comet" / "update all comet packages"
25
+ - "Upgrade to the latest patch of the current major"
26
+ - "Update `@dextinity/cms-api` and friends to the newest 8.x"
27
+
28
+ If the user asks for a **major** bump (crossing major versions), stop and tell them this skill only covers minor/patch updates.
29
+
30
+ ---
31
+
32
+ ## Workflow
33
+
34
+ 1. [Find all `@dextinity/*` dependencies and their current version](#step-1--find-all-comet-dependencies)
35
+ 2. [Find the newest version in the current major on npm](#step-2--find-the-newest-version-in-the-current-major)
36
+ 3. [Update every `package.json`](#step-3--update-every-packagejson)
37
+ 4. [Install](#step-4--install)
38
+ 5. [Verify](#step-5--verify)
39
+ 6. [Report the result](#step-6--report-the-result)
40
+
41
+ ---
42
+
43
+ ## Step 1 — Find all @dextinity dependencies
44
+
45
+ The repo root, `api/`, and `admin/` always have a `package.json`. Site packages are variable: a project may have none (api/admin only), a single site at `site/`, or several sites — often under `sites/`, though the location is not guaranteed. Discover them by content rather than path — any `package.json` outside `node_modules` that depends on `@dextinity/site-nextjs` or `@dextinity/site-react` is a site package.
46
+
47
+ ```bash
48
+ grep -rl --include='package.json' --exclude-dir=node_modules \
49
+ -E '"@dextinity/site-(nextjs|react)"' . | xargs -n1 dirname
50
+ ```
51
+
52
+ Save the resulting list of site directories — Steps 3, 4, and 5 reuse it. **A project with no site packages is valid** — the grep returns nothing and the rest of the workflow only touches the root, `api/`, and `admin/`. Don't treat the empty result as an error.
53
+
54
+ Then collect every `@dextinity/*` entry across the root, `api/`, `admin/`, and each site directory's `package.json`:
55
+
56
+ ```bash
57
+ grep -n '"@dextinity/' package.json api/package.json admin/package.json \
58
+ <site-dir>/package.json ...
59
+ ```
60
+
61
+ Notes:
62
+
63
+ - Not every `@dextinity/*` package follows the core release cadence. Packages that live outside the core monorepo (for example `@comet/dev-process-manager`) may use a different versioning scheme (often `^x.y.z`). **Only** bump packages whose current version matches the core Comet version (the one shared by `@dextinity/cms-api`, `@dextinity/admin`, `@dextinity/site-nextjs`, etc.). Leave the others untouched.
64
+ - Use the invariants to tell core from satellite: core packages are all pinned to the same exact version, with no caret or tilde. Anything with a range or a different version is not core — verify before touching it.
65
+ - If you find core packages on different versions, or any core package using a range (`^`, `~`), the project violates the invariants. Stop and tell the user — don't paper over it by bumping.
66
+
67
+ Confirm the **current major** from the version string (e.g. `8.20.4` → major `8`).
68
+
69
+ ---
70
+
71
+ ## Step 2 — Find the newest version in the current major
72
+
73
+ Use `npm view` on any single core package to list versions, then filter to the current major and drop pre-releases (anything containing `-canary`, `-beta`, `-rc`, etc.):
74
+
75
+ ```bash
76
+ npm view @dextinity/cms-api versions --json | \
77
+ python3 -c "import json,sys; v=json.load(sys.stdin); \
78
+ stable=[x for x in v if x.startswith('8.') and '-' not in x]; \
79
+ print(stable[-1])"
80
+ ```
81
+
82
+ Substitute `8.` with whatever the current major is. The last entry in the filtered list is the target version.
83
+
84
+ Sanity check: the target must be **greater than or equal to** the current version. If it is lower or equal, there is nothing to do — tell the user and stop.
85
+
86
+ Core `@dextinity/*` packages are always released together at the same version, so checking any single one is enough — no need to verify the target version for each package individually.
87
+
88
+ ---
89
+
90
+ ## Step 3 — Update every package.json
91
+
92
+ Update every occurrence of the current version to the new version inside `@dextinity/*` entries across every `package.json` from Step 1 (the root, `api/`, `admin/`, and each site directory). Write the new version **pinned** (e.g. `8.21.0`) — never add a caret or tilde, even if one was present before. Every core package must end up on the same target version (see Invariants).
93
+
94
+ Before editing, do a quick check that the old version string doesn't appear elsewhere in those files (i.e. on non-`@dextinity` packages pinned to the same version by coincidence):
95
+
96
+ ```bash
97
+ grep -n '<OLD_VERSION>' package.json api/package.json admin/package.json \
98
+ <site-dir>/package.json ...
99
+ ```
100
+
101
+ If every match is a `@dextinity/*` line, you can safely edit each file. If there are non-`@dextinity` matches, edit the `@dextinity` lines individually.
102
+
103
+ **Do not touch** packages like `@comet/dev-process-manager` that don't share the core version — see Step 1.
104
+
105
+ ---
106
+
107
+ ## Step 4 — Install
108
+
109
+ Install in the root first, then in each sub-package. In a sandboxed environment you may not be able to run the sub-installs in parallel (`&` can fail) — run them sequentially if parallel fails.
110
+
111
+ ```bash
112
+ npm install
113
+ npm --prefix api install
114
+ npm --prefix admin install
115
+ # Then, for each site directory discovered in Step 1:
116
+ npm --prefix <site-dir> install
117
+ ```
118
+
119
+ What a successful run looks like:
120
+
121
+ - npm prints `changed N packages` or `up to date` (both are fine — "up to date" means the lockfile was already correct for the new version range).
122
+ - No `ERESOLVE`, `EBADENGINE`, `404`, or `EACCES` errors.
123
+ - Harmless warnings you can ignore:
124
+ - `npm warn tar TAR_ENTRY_ERROR ENOENT …` during extraction
125
+ - `npm fund` / `npm audit` summaries
126
+ - Deprecation warnings on transitive deps
127
+
128
+ After each install, verify the lockfile actually moved:
129
+
130
+ ```bash
131
+ grep '"@dextinity/cms-api":' api/package-lock.json | head -3
132
+ ```
133
+
134
+ The direct-dependency line should show the new version.
135
+
136
+ ### If install fails
137
+
138
+ If any install fails because of the **sandbox** (no network access to the npm registry, read-only filesystem on `node_modules`, EPERM/EACCES on a lockfile, etc.): **stop and ask the user to run the installs themselves**. Do not try to work around it by retrying with different flags or disabling the sandbox — this is an environment problem, not a dependency problem. The `package.json` files are already edited, so the user just needs to run the `npm install` commands from Step 4.
139
+
140
+ If any install fails with a real error (peer-dependency conflict, missing version, registry auth, etc.): **stop immediately and tell the user**. Do not attempt `--force`, `--legacy-peer-deps`, manual lockfile edits, or destructive resets — the user needs to diagnose the failure, often because it indicates a broader incompatibility (e.g. a peer dep that also needs bumping, or a transitive regression).
141
+
142
+ In either case, report: which directory failed, the exact error lines, and the state of the `package.json` files (they have already been edited — mention this so the user knows).
143
+
144
+ ---
145
+
146
+ ## Step 5 — Verify
147
+
148
+ Run lint and tests in each sub-package that defines them, and report the results. Do **not** start the dev server — that's the user's job (see Step 6 for why).
149
+
150
+ For each of `api/`, `admin/`, and every site directory discovered in Step 1, check the `package.json` `scripts` block and run whatever is defined:
151
+
152
+ ```bash
153
+ npm --prefix <dir> run lint --if-present
154
+ npm --prefix <dir> test --if-present
155
+ ```
156
+
157
+ `--if-present` makes npm exit 0 silently when the script is missing, so you can run the full set without first checking which scripts exist.
158
+
159
+ If a project has a top-level lint/test script in the root `package.json`, run that too.
160
+
161
+ What to do with the output:
162
+
163
+ - **All green:** mention it briefly in the report.
164
+ - **Failures:** report the failing command, the directory, and the first few error lines. Do not attempt to fix lint/test failures — they may indicate a real regression in the new Comet version, or pre-existing issues unrelated to the bump. The user decides.
165
+ - **Type errors specifically:** these often come from stale generated files (`block-meta.json`, GraphQL schema) that only refresh when the app boots. Flag this possibility in the report so the user knows to start the dev server before assuming the bump broke types.
166
+
167
+ ---
168
+
169
+ ## Step 6 — Report the result
170
+
171
+ Tell the user:
172
+
173
+ - The old version → the new version
174
+ - Which `package.json` files were touched
175
+ - That each lockfile was updated and install succeeded
176
+ - The verify results (lint/tests green, or which ones failed and where)
177
+ - Anything suspicious you noticed (e.g. "the api/ install emitted a peer-dep warning about X — probably benign but worth a look")
178
+ - **Remind the user to start the app once** (`npm run dev`). A minor Comet release can ship changes to generated artifacts like `block-meta.json` or the GraphQL schema, which are only regenerated when the app boots. Without this step, stale generated files can cause confusing type errors or runtime mismatches.
179
+
180
+ ---
181
+
182
+ ## Common pitfalls
183
+
184
+ | Pitfall | How to avoid |
185
+ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
186
+ | Picking a canary/beta as "newest" | Filter out any version containing `-` in Step 2. |
187
+ | Bumping `@comet/dev-process-manager` (or similar) by accident | Only bump packages pinned to the shared core version — see Step 1. |
188
+ | Forgetting the root `package.json` | The repo root has its own `package.json` with `@dextinity/cli`. Always include it in the grep. |
189
+ | Assuming "up to date" means the install did nothing | It means the lockfile already satisfies the new range. Verify with `grep` against the lockfile. |
190
+ | Running installs in parallel in a sandbox | If `&` backgrounding fails, just run the installs sequentially. Takes a bit longer, works reliably. |
191
+ | Crossing a major version | This skill is minor/patch only. Stop and warn the user. |
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: dev-pm
3
+ description: Run, restart, stop, and inspect logs/status of long-running development processes via dev-pm (dev-process-manager). Use when starting/stopping/restarting services, tailing logs of those processes, or checking which services are running. Do not use for one-off scripts (`npm run X` is fine for those) — dev-pm is for processes that stay alive.
4
+ ---
5
+
6
+ # dev-pm Skill
7
+
8
+ `dev-pm` (`@comet/dev-process-manager`) supervises long-running dev processes (servers, watchers, codegen, storybook, docker, …). Available scripts and groups are defined in `dev-pm.config.ts` at the repo root — read it to discover what can be started.
9
+
10
+ ## Critical rules
11
+
12
+ 1. **Always invoke through the package manager:** `npm exec -- dev-pm <command>`. Never call `dev-pm` directly. If `pnpm` is the active package manager for the project (e.g. a `pnpm-lock.yaml` is present), use `pnpm exec -- dev-pm <command>` instead.
13
+ 2. **Never use streaming flags from a tool call — they hang.** `logs` requires `-n` / `--lines <N>`; `status` must not get `--interval`; `start` / `restart` must not get `--follow`.
14
+ 3. **Services may already be running.** dev-pm runs as a daemon across sessions — check `status` before starting things again. Same applies to build watchers ("the build watcher is running" means dev-pm is supervising a `build:watch` script); if absent, build the affected package manually.
15
+ 4. **dev-pm owns _all_ long-running tasks — including docker.** If a project uses dev-pm, assume every long-lived process (servers, watchers, codegen, **and** `docker compose up`) is wired into `dev-pm.config.ts`. Don't reach for `docker compose up` / `docker compose down` directly — start/stop the corresponding dev-pm script (commonly named `docker`). Exceptions exist; only treat something as outside scope after confirming it's not in `dev-pm.config.ts`.
16
+
17
+ ## Commands
18
+
19
+ Script/group names below are placeholders; the authoritative list is `dev-pm.config.ts`.
20
+
21
+ ### `start [patterns...]`
22
+
23
+ ```bash
24
+ npm exec -- dev-pm start <script> # one script
25
+ npm exec -- dev-pm start @<group> # a group
26
+ npm exec -- dev-pm start <a> <b> # multiple patterns
27
+ ```
28
+
29
+ - `@`-prefix → group name (from `group: [...]` in the config). Bare → script `name`. Globs (minimatch) work too, e.g. `api-*`.
30
+ - Already-running scripts are a no-op — safe to call again. To force a restart, use `restart`.
31
+
32
+ ### `status` / `list`
33
+
34
+ ```bash
35
+ npm exec -- dev-pm status # all scripts
36
+ npm exec -- dev-pm status <pattern> # filter
37
+ ```
38
+
39
+ First stop when troubleshooting "is X running?".
40
+
41
+ **Reading the output:**
42
+
43
+ - **Status:**
44
+ - `Running` — script is up.
45
+ - `Waiting` — `waitOn` condition unmet (e.g. api waiting for the database, site waiting for the api). Will start when the dependency is ready; if it stays here, the dependency failed — check its logs.
46
+ - `Backoff` — process crashed; dev-pm is sleeping before respawn. Wait grows as `min(1.3 ^ restartCount, 10)` seconds, capped at 10s. Flapping `Backoff` means broken — read logs and fix the cause; restarting won't help.
47
+ - `Stopped` — not running (never started or manually stopped).
48
+ - **Restarts:** healthy scripts sit at `0`. Anything `> 0` means dev-pm respawned a crash — pull logs (`logs --lines 300 <name>`).
49
+
50
+ ### `logs` / `log`
51
+
52
+ ```bash
53
+ npm exec -- dev-pm logs --lines 200 <script>
54
+ npm exec -- dev-pm log -n 500 <pattern>
55
+ ```
56
+
57
+ Pick a line count for the question — 100–200 for a quick check, 500+ for startup/error history.
58
+
59
+ ### `restart [patterns...]`
60
+
61
+ ```bash
62
+ npm exec -- dev-pm restart <script>
63
+ npm exec -- dev-pm restart @<group>
64
+ ```
65
+
66
+ Use after rebuilding a package whose consumers cache the old build, or after editing config the running process loaded at startup.
67
+
68
+ ### `stop [patterns...]`
69
+
70
+ ```bash
71
+ npm exec -- dev-pm stop <script>
72
+ npm exec -- dev-pm stop @<group>
73
+ ```
74
+
75
+ Stops the matched scripts; the daemon stays alive.
76
+
77
+ ### `shutdown` / `halt`
78
+
79
+ ```bash
80
+ npm exec -- dev-pm shutdown
81
+ ```
82
+
83
+ Stops everything and shuts down the daemon. Only when the user explicitly asks to "stop everything" / "kill dev-pm". Don't use as a "reset state" hammer — prefer `restart <pattern>`.
84
+
85
+ ## Discovering scripts and groups
86
+
87
+ `dev-pm.config.ts` exports a `scripts` array. Each entry has:
88
+
89
+ - `name` — identifier for start/stop/logs.
90
+ - `group` — group names usable with the `@` prefix.
91
+ - `script` — underlying shell command (informational; don't run directly).
92
+ - `waitOn` — files / TCP ports the script waits for (explains startup ordering).
93
+
94
+ When the user names a service vaguely ("the api"), grep `dev-pm.config.ts` for the matching `name` rather than guessing.
95
+
96
+ ## Common workflows
97
+
98
+ - **"Why isn't service X responding?"** → `status` → `logs --lines 200 <name>` → `restart <name>` after fixing the cause.
99
+ - **"Edited a package, running service isn't picking it up"** → confirm the package's build watcher is in `status`; if not, build the package or start its watcher; then `restart` the consumer.
100
+ - **"Verify service X still boots"** → `start <name>`, poll `logs --lines N` until the ready line or an error appears.