@comet/agent-features 9.0.0-beta.5

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 (35) 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-block/SKILL.md +246 -0
  17. package/skills/comet-block/references/admin-patterns.md +192 -0
  18. package/skills/comet-block/references/api-patterns.md +183 -0
  19. package/skills/comet-block/references/block-loader.md +368 -0
  20. package/skills/comet-block/references/block-types.md +210 -0
  21. package/skills/comet-block/references/custom-block-field.md +266 -0
  22. package/skills/comet-block/references/fixtures.md +436 -0
  23. package/skills/comet-block/references/image.md +341 -0
  24. package/skills/comet-block/references/migration.md +597 -0
  25. package/skills/comet-block/references/registration.md +167 -0
  26. package/skills/comet-block/references/response-summary.md +102 -0
  27. package/skills/comet-block/references/rich-text.md +309 -0
  28. package/skills/comet-block/references/select.md +176 -0
  29. package/skills/comet-block/references/site-patterns.md +202 -0
  30. package/skills/comet-mail-react/SKILL.md +541 -0
  31. package/skills/comet-mail-react/references/components-and-theme.md +441 -0
  32. package/skills/comet-mail-react/references/layout-patterns.md +315 -0
  33. package/skills/comet-mail-react/references/styling-and-customization.md +306 -0
  34. package/skills/comet-minor-update/SKILL.md +191 -0
  35. package/skills/dev-pm/SKILL.md +100 -0
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: comet-minor-update
3
+ description: Performs a minor or patch version bump of all @comet/* 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 `@comet/*` 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 `@comet/*` core package in the project, before and after the update:
15
+
16
+ - **Pinned versions only.** Every core `@comet/*` 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 `@comet/*` 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 `@comet/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 `@comet/*` 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 @comet 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 `@comet/site-nextjs` or `@comet/site-react` is a site package.
46
+
47
+ ```bash
48
+ grep -rl --include='package.json' --exclude-dir=node_modules \
49
+ -E '"@comet/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 `@comet/*` entry across the root, `api/`, `admin/`, and each site directory's `package.json`:
55
+
56
+ ```bash
57
+ grep -n '"@comet/' package.json api/package.json admin/package.json \
58
+ <site-dir>/package.json ...
59
+ ```
60
+
61
+ Notes:
62
+
63
+ - Not every `@comet/*` 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 `@comet/cms-api`, `@comet/admin`, `@comet/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 @comet/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 `@comet/*` 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 `@comet/*` 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-`@comet` 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 `@comet/*` line, you can safely edit each file. If there are non-`@comet` matches, edit the `@comet` 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 '"@comet/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 `@comet/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.