You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ef5112c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agents/skills/add-block/SKILL.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1018,13 +1018,15 @@ When adding or changing `sunset.replacedBy`, run `bun run generate:block-success
1018
1018
map to resolve legacy and current block IDs consistently without importing the executable registry.
1019
1019
Verify it with `bun run check:block-successors`.
1020
1020
1021
+
A new block type also needs `bun run generate:sdk-names` (commit the new `apps/sim/blocks/sdk-names/<type>.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts`; names are add-only, and a merge conflict in the generated module is resolved by rerunning the generator) so workflow source gets a typed builder for it; `check:sdk-names` fails CI until it runs.
1022
+
1021
1023
Adding a block on its own needs no **tool metadata** regeneration — a block references existing
1022
1024
tool IDs through `tools.access` and does not change any tool's shape.
1023
1025
1024
1026
But if the same change also adds, edits **or removes** a tool, run `bun run generate:tool-metadata` and commit the result, or CI fails on stale artifacts. That matters here because a block's `outputs` are authored to match its tools' outputs, and the UI reads those from the generated metadata, not the executable registry — an unregenerated tool change makes the block's outputs disagree with what the panel renders. See `.agents/skills/tool-registry-boundary/SKILL.md`.
1025
1027
1026
1028
A visible integration block does require the generated integration catalog and docs to be refreshed:
1027
-
`bun run generate:tool-metadata` (only when a tool changed), `bun run scripts/generate-docs.ts`,
1029
+
`bun run generate:tool-metadata` (only when a tool changed), `bun run generate:docs`,
1028
1030
`bun run generate:deployment-config`, then `bun run check:audits`. Also run
1029
1031
`bun run apps/sim/scripts/check-block-registry.ts origin/staging` (CI runs it outside `check:audits`). Commit the
1030
1032
full generator output. For what each check verifies, see the `validate-integration` skill →
Then run `bun run generate:sdk-names` and commit the new `apps/sim/blocks/sdk-names/<type>.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts` (names are add-only: never edit or delete an existing entry; on a merge conflict in the generated module, rerun the generator), so workflow source gets a typed builder for the new block (`check:sdk-names` fails CI until it runs).
375
+
374
376
### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist
375
377
376
378
```typescript
@@ -436,7 +438,7 @@ a resolvable capability must fail validation; an independent service account use
436
438
437
439
## Step 8: Generate and Validate the Catalog
438
440
439
-
Run `bun run generate:tool-metadata`, `bun run scripts/generate-docs.ts`,
441
+
Run `bun run generate:tool-metadata`, `bun run generate:docs`,
440
442
`bun run generate:deployment-config`, then `bun run check:audits` (see the `validate-integration`
441
443
skill → Regenerate Derived Artifacts for the full list and what each check verifies).
442
444
@@ -462,7 +464,7 @@ In Sim, the {Service} block lets your agents {concrete workflow uses}.
462
464
463
465
Group the bullets by what the user gets done, not one bullet per tool. Only describe operations the
464
466
block actually ships. Follow `.claude/rules/constitution.md` for voice. Re-run
465
-
`bun run scripts/generate-docs.ts` afterwards and confirm the section survived unchanged.
467
+
`bun run generate:docs` afterwards and confirm the section survived unchanged.
466
468
467
469
The docs generator refreshes `packages/deployment-config/src/integrations.json`, and the deployment
468
470
config generator projects service-account provider IDs from that catalog plus the canonical OAuth
@@ -580,7 +582,7 @@ If creating V2 versions (API-aligned outputs):
580
582
-[ ] Registered all triggers in `triggers/registry.ts`
581
583
582
584
### Docs and deployment metadata
583
-
-[ ] Ran `bun run scripts/generate-docs.ts`
585
+
-[ ] Ran `bun run generate:docs`
584
586
-[ ] Ran `bun run generate:deployment-config` for OAuth or service-account changes
585
587
-[ ] Verified docs file created
586
588
-[ ] Wrote the `{/* MANUAL-CONTENT-START:intro */}` section under `<BlockInfoCard />` and confirmed it survives a regenerate
Copy file name to clipboardExpand all lines: .agents/skills/db-migrate/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ The lint flags risky *shapes*; it cannot know whether a given drop is *safe righ
83
83
```
84
84
The reason must be specific and name the PR/version that removed the dependency. An empty reason fails the lint.
85
85
-**Warnings** (`data-backfill`): non-blocking, but confirm the batching/idempotency before merging.
86
-
4. Regenerate the test schema mock: `bun run scripts/generate-schema-mock.ts` (`check:schema-mock`in`check:audits` fails after any `schema.ts` change until you do).
86
+
4. Regenerate the test schema mock: `bun run generate:schema-mock` (`check:schema-mock`in`check:audits` fails after any `schema.ts` change until you do).
87
87
5. Re-run `(cd packages/db && bunx drizzle-kit generate)` once your migration is written: it must report no schema changes and write no new file, or CI fails on the schema and migrations disagreeing.
88
88
6. Verify locally: `cd packages/db && bun run db:migrate` against a dev DB.
Copy file name to clipboardExpand all lines: .agents/skills/ship/SKILL.md
+7-12Lines changed: 7 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,24 +47,19 @@ When the user runs `/ship`:
47
47
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
48
48
- `(cd packages/db && bunx drizzle-kit generate && git status --porcelain ./migrations)` must print nothing (CI's schema/migration sync step).
49
49
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
50
-
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exitcodes, so both phases below explicitly collect each job's status and abort ship if any failed.
50
+
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases abort ship if any generator or audit fails: their runners (`scripts/generate-all.ts`, `scripts/run-audits.ts`) collect each job's exit code and exit non-zero, so never replace them with a backgrounded loop and a bare `wait`, which swallows child exit codes.
51
51
52
-
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `generate:agent-stream-docs` (derives from the provider model registry), `generate:docs-manifest` (derives from docs page paths), `generate:tool-metadata` (derives from the tool registry), and `skills:sync` (derives from `.agents/skills/**`). They write disjoint outputs (`apps/docs/…/agent.mdx`, `apps/sim/lib/mothership/generated/docs-manifest.ts`, `apps/sim/tools/generated/*`, and `.claude/skills` links), so they parallelize safely, and each is idempotent (a no-op when already in sync):
52
+
**Phase A — regenerate the always-in-repo committed artifacts, then let step 7 stage whatever changed.** Run the umbrella generator. It derives its list from package.json (every `generate:<x>` that has a matching `check:<x>`, plus `skills:sync`; see the header of `scripts/generate-all.ts`), so it covers every repo-local generator an ordinary code change can drift (a `models.ts` edit drifts `agent-stream-docs` and the SDK fixture catalog, a tool change drifts `tool-metadata`), runs them in the order their inputs require, and each is idempotent (a no-op when already in sync):
53
53
```bash
54
-
rm -f /tmp/ship-gen-results
55
-
for g in generate:agent-stream-docs generate:docs-manifest generate:tool-metadata skills:sync; do
56
-
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
57
-
done
58
-
wait
59
-
# any non-zero line is a FAILED generator — read /tmp/ship-gen-<name>.log and fix before shipping;
60
-
# a silently-failed generate leaves a stale artifact that Phase B / CI then rejects. Keep the
61
-
# `exit 1`: it is what makes the block's own status non-zero so a caller actually stops.
62
-
if grep -vE '^0 ' /tmp/ship-gen-results;thenecho"❌ generator(s) failed — do not ship";exit 1;fi
54
+
# A non-zero exit means a generator FAILED: the summary names it and its output is above. Fix it
55
+
# before shipping; a silently-failed generate leaves a stale artifact that Phase B / CI then
56
+
# rejects. Keep the `exit 1`: it makes the block's own status non-zero so a caller actually stops.
57
+
bun run generate || { echo"❌ generator(s) failed — do not ship";exit 1; }
63
58
echo"✅ artifacts regenerated"
64
59
```
65
60
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
66
61
67
-
**Do NOT blanket-run the domain generators here.** `mship:generate` (`generate-mship-contracts.ts`) is an **umbrella** that drives all nine mothership contract generators (`mship-contracts`, `billing-protocol-contract`, `mship-tools`, the four `trace-*`, `metrics-contract`, `vfs-snapshot-contract`) and biome-formats `apps/sim/lib/mothership/generated/` — never run it *and* its constituents (they write the same files and corrupt each other in parallel), and never run it on an ordinary ship: it reads an **external** copilot-contract source that isn't checked out in most worktrees, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. `scripts/generate-docs.ts` rewrites the integration docs and client-safe catalog; run it when this PR changes their block/icon/landing-content inputs or when `check:integration-catalog` reports drift, then review its broad generated diff. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (`bun run mship:check` / the individual `*:check`) — with the external source present.
62
+
**Do NOT blanket-run the domain generators here.** `mship-tools:generate` merges Sim's tool contracts into the base tool catalog in the **external** Mothership worker checkout (`<mothership>/worker/packages/contracts/tool-catalog-v1.json`), which most worktrees lack, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. The other mothership contracts in `apps/sim/lib/mothership/generated/` are copied in by the worker's `contracts:sync`, never generated here. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. `scripts/generate-docs.ts` rewrites the integration docs and client-safe catalog; run it when this PR changes their block/icon/landing-content inputs or when `check:integration-catalog` reports drift, then review its broad generated diff. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (e.g. `bun run mship-tools:check`) — with the external source present.
68
63
69
64
**Phase B — run lint + every audit CI enforces, in parallel, and abort ship if any fails.** Before running the commands, compare this list with `.github/workflows/checks.yml`; when CI adds an audit, run it and update this skill instead of trusting a stale snapshot. The env-flag audit is currently an inline workflow block rather than a package script: when `apps/sim/lib/core/config/env-flags.ts` changed, run that current workflow block verbatim instead of copying a second version into this skill. Run `bun run lint` first (it autofixes formatting and mutates files, so don't parallelize it with the read-only audits), then run the base-sensitive block-registry check, then fan the independent audits out and collect exit codes:
Copy file name to clipboardExpand all lines: .agents/skills/v2-api-conventions/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ Audited against the primary specs and against Stripe, GitHub, and Google's AIPs.
182
182
|**`X-RateLimit-Reset` as delta-seconds**| No | It is an absolute ISO 8601 timestamp, so it is clock-skew sensitive — but the response where timing actually decides behaviour (429) also carries `Retry-After`, which is skew-free. The absolute value stays useful for scheduling. |
183
183
|**422 for semantic validation**| No | RFC 9110 §15.5.21 defines 422, but Appendix B.3 records that 9110 **deleted** RFC 4918's clause saying 400 was inappropriate. 400 covers "cannot or will not process… perceived to be a client error". The split is convention, not requirement — GitHub splits, Stripe and Google do not. Our machine-readable `error.code` already carries the distinction, and restatusing now breaks clients. |
184
184
|**`Location` on 201**| No | §9.3.3 makes this a `SHOULD`**for POST**; the status code itself (§15.3.2) requires nothing and defines the fallback — absent `Location`, the target URI identifies the resource. Declined knowingly: several 201 responses (signed upload sessions, table exports, knowledge folders) have no canonical single-resource GET, so a `Location` would 404, and adopting it on some of the 19 is worse for a client than on none. Every 201 returns the full representation including its `id`. Revisit per-route if one gains a canonical GET. |
185
-
|**ETag / `If-None-Match` / `If-Match`**| No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag`**field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. |
185
+
|**ETag / `If-None-Match` / `If-Match`**| No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. The exception is a content-addressed read (the source catalog) that sets the route builder's `entityTag`: its 200 and 304 say `private, no-cache`, so the client keeps the body and revalidates it. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag`**field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. |
186
186
|**`Deprecation` / `Sunset` on v1**| Not yet | RFC 9745 (Standards Track) and RFC 8594 (Informational) both apply, and GitHub emits both. But `Sunset` is a timestamp and 9745 §4 makes `Sunset >= Deprecation` a `MUST`, so emitting either commits Sim to a v1 retirement date — a product decision, not an engineering one. When that date exists: `Deprecation` is an RFC 9651 Structured Field **Date** (`@1688169599`); `Sunset` is an **HTTP-date** (`Sat, 31 Dec 2033 23:59:59 GMT`). Two encodings in one response — the most common implementation error here. |
187
187
|**`application/merge-patch+json`**| No | v2 PATCH bodies are merge-patch *shaped* — absent means unchanged, `null` clears — but they are `.strict()`, so unknown members are rejected where RFC 7396 §2 would merge them, and nested objects are replaced wholesale rather than merged. Advertising the media type would over-claim. Document the semantics per contract instead. |
0 commit comments