Skip to content

Commit 29b76e7

Browse files
committed
Merge remote-tracking branch 'origin/staging' into chore/agent-guidance-refresh
# Conflicts: # .agents/skills/add-model/SKILL.md # .claude/rules/sim-integrations.md # .cursor/rules/sim-integrations.mdc
2 parents c5704e9 + b3f459d commit 29b76e7

155 files changed

Lines changed: 723 additions & 698 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/add-block/SKILL.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ When adding or changing an OAuth integration block:
177177
`packages/sim-setup/src/capability-config.ts`. The CLI catalog is exhaustively typed and checked
178178
against the runtime field list; do not infer secrecy from the field name.
179179
4. If the canonical OAuth service declares `serviceAccountProviderId`, run
180-
`bun run deployment-config:generate`; this regenerates the provider-ID facts in
180+
`bun run generate:deployment-config`; this regenerates the provider-ID facts in
181181
`packages/deployment-config/src/service-account-providers.generated.ts`. Never hand-edit that
182182
generated map. Add `deploymentRequirement` policy in
183183
`packages/deployment-config/src/service-account-metadata.ts` only when the service-account path
@@ -959,11 +959,11 @@ Verify it with `bun run check:block-successors`.
959959
Adding a block on its own needs no **tool metadata** regeneration — a block references existing
960960
tool IDs through `tools.access` and does not change any tool's shape.
961961

962-
But if the same change also adds, edits **or removes** a tool, run `bun run tool-metadata:generate` 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`.
962+
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`.
963963

964964
A visible integration block does require the generated integration catalog and docs to be refreshed:
965-
`bun run tool-metadata:generate` (only when a tool changed), `bun run scripts/generate-docs.ts`,
966-
`bun run deployment-config:generate`, then `bun run check:audits`. Also run
965+
`bun run generate:tool-metadata` (only when a tool changed), `bun run scripts/generate-docs.ts`,
966+
`bun run generate:deployment-config`, then `bun run check:audits`. Also run
967967
`bun run apps/sim/scripts/check-block-registry.ts origin/staging` (CI runs it outside `check:audits`). Commit the
968968
full generator output. For what each check verifies, see the `validate-integration` skill →
969969
Regenerate Derived Artifacts.
@@ -986,10 +986,10 @@ Regenerate Derived Artifacts.
986986
- [ ] Outputs match tool outputs
987987
- [ ] Block + meta registered in registry-maps.ts (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
988988
- [ ] If `sunset.replacedBy` changed: regenerated and committed the block successor map; `bun run check:block-successors` passes
989-
- [ ] If any tool was added, changed or removed alongside the block: ran `bun run tool-metadata:generate` and committed the artifacts
989+
- [ ] If any tool was added, changed or removed alongside the block: ran `bun run generate:tool-metadata` and committed the artifacts
990990
- [ ] Ran `bun run scripts/generate-docs.ts`, reviewed the generated diff, and committed the integration catalog changes
991-
- [ ] `bun run integration-catalog:check` passes
992-
- [ ] `bun run docs:check` passes (CI gate — fails on any stale generated docs page)
991+
- [ ] `bun run check:integration-catalog` passes
992+
- [ ] `bun run check:docs` passes (CI gate — fails on any stale generated docs page)
993993
- [ ] If icon missing: asked user to provide SVG
994994
- [ ] If triggers exist: `triggers` config set, trigger subBlocks spread
995995
- [ ] Optional/rarely-used fields set to `mode: 'advanced'`

‎.agents/skills/add-integration/SKILL.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export const tools: Record<string, ExecutableToolConfig> = {
293293
Then regenerate the generated tool metadata and commit it:
294294

295295
```bash
296-
bun run tool-metadata:generate
296+
bun run generate:tool-metadata
297297
```
298298

299299
Client code reads `params`/`outputs` from these artifacts rather than importing
@@ -370,7 +370,7 @@ the OAuth service configuration, deployment availability, and the setup CLI.
370370
infer secret fields from naming; the CLI mapping is exhaustively checked against the runtime
371371
fields.
372372
4. If the canonical OAuth service has `serviceAccountProviderId`, run
373-
`bun run deployment-config:generate` to refresh
373+
`bun run generate:deployment-config` to refresh
374374
`packages/deployment-config/src/service-account-providers.generated.ts`; never hand-edit the
375375
generated provider-ID map. In `packages/deployment-config/src/service-account-metadata.ts`, use:
376376
- no `deploymentRequirement` when the service-account path works independently of OAuth client fields;
@@ -386,8 +386,8 @@ a resolvable capability must fail validation; an independent service account use
386386

387387
## Step 8: Generate and Validate the Catalog
388388

389-
Run `bun run tool-metadata:generate`, `bun run scripts/generate-docs.ts`,
390-
`bun run deployment-config:generate`, then `bun run check:audits` (see the `validate-integration`
389+
Run `bun run generate:tool-metadata`, `bun run scripts/generate-docs.ts`,
390+
`bun run generate:deployment-config`, then `bun run check:audits` (see the `validate-integration`
391391
skill → Regenerate Derived Artifacts for the full list and what each check verifies).
392392

393393
The docs generator creates `apps/docs/content/docs/integrations/{service}.mdx` — one page per service carrying the block's Actions and, if it has one, its Triggers section. Never hand-edit generated pages; the only editable region is the `{/* MANUAL-CONTENT */}` block (see `scripts/README.md`).
@@ -457,7 +457,7 @@ If creating V2 versions (API-aligned outputs):
457457
- [ ] All optional outputs have `optional: true`
458458
- [ ] Created `index.ts` barrel export
459459
- [ ] Registered all tools in `tools/registry.ts`
460-
- [ ] Ran `bun run tool-metadata:generate` and committed the regenerated artifacts
460+
- [ ] Ran `bun run generate:tool-metadata` and committed the regenerated artifacts
461461
- [ ] Classified every model-visible, opaque, Sim-durable, and internal-execution request field
462462
- [ ] Added shared model-input projection or private provenance only where required; ordinary
463463
external resource locators and control inputs retain their request semantics
@@ -530,15 +530,15 @@ If creating V2 versions (API-aligned outputs):
530530

531531
### Docs and deployment metadata
532532
- [ ] Ran `bun run scripts/generate-docs.ts`
533-
- [ ] Ran `bun run deployment-config:generate` for OAuth or service-account changes
533+
- [ ] Ran `bun run generate:deployment-config` for OAuth or service-account changes
534534
- [ ] Verified docs file created
535535
- [ ] Wrote the `{/* MANUAL-CONTENT-START:intro */}` section under `<BlockInfoCard />` and confirmed it survives a regenerate
536536
- [ ] Reviewed and committed the generated `packages/deployment-config/src/integrations.json` change
537-
- [ ] `bun run integration-catalog:check` passes
538-
- [ ] `bun run docs:check` passes — CI fails on stale generated docs, so commit the full generator
537+
- [ ] `bun run check:integration-catalog` passes
538+
- [ ] `bun run check:docs` passes — CI fails on stale generated docs, so commit the full generator
539539
output, including catch-up regeneration for pages another PR left stale (never revert it as
540540
"unrelated drift")
541-
- [ ] `bun run deployment-config:check` passes
541+
- [ ] `bun run check:deployment-config` passes
542542

543543
### Final Validation (Required)
544544
- [ ] Read every tool file and cross-referenced inputs/outputs against the API docs

‎.agents/skills/add-model/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Use a precise WebFetch prompt: *"Extract for {model_id}: exact model id string,
5454
| `reasoningEffort` | `openai/core.ts`, `azure-openai`, `xai`, `deepseek`, `groq`, `zai`, `kimi`, `cerebras`, `meta`, `litellm` (each `index.ts`) | Not read by anthropic/gemini (they use `thinking`) or by mistral, openrouter, fireworks, vertex — re-grep before assuming |
5555
| `verbosity` | `openai/core.ts`, `azure-openai/index.ts` only | Dead elsewhere |
5656
| `thinking` | `anthropic/core.ts`, `gemini/core.ts`; `deepseek`, `groq`, `zai`, `kimi` (each `index.ts`) read the resolved `thinkingLevel` | Dead elsewhere |
57-
| `thinking.streamed` | Docs generator + `getThinkingStreamVisibility` (`models.ts`); `anthropic/core.ts` uses `'summary'` to request `display: 'summarized'` on agent-events runs | **Mandatory on Anthropic-family thinking models** (`agent-stream-docs:check` fails without it); other families fall back to provider defaults |
57+
| `thinking.streamed` | Docs generator + `getThinkingStreamVisibility` (`models.ts`); `anthropic/core.ts` uses `'summary'` to request `display: 'summarized'` on agent-events runs | **Mandatory on Anthropic-family thinking models** (`check:agent-stream-docs` fails without it); other families fall back to provider defaults |
5858
| `nativeStructuredOutputs` | `anthropic/core.ts`, `bedrock/index.ts` (via `models.ts` `supportsNativeStructuredOutputs`, which reads the flag), `nebius/index.ts`, `nvidia/index.ts` (via `getModelCapabilities`) | Dead elsewhere — fireworks/baseten/together/openrouter call their own provider-level `supportsNativeStructuredOutputs` that ignores the model flag (always on, always off, or OpenRouter API metadata) |
5959
| `maxOutputTokens` | Read by UI + executor for token estimation | Always meaningful — set if provider documents a cap |
6060
| `computerUse` | `providers/utils.ts` (`getComputerUseModels` → `computerUseModels` routing) | Set only on actual computer-use SKUs |

‎.agents/skills/add-tools/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export const tools = {
453453
3. Regenerate the tool metadata artifacts:
454454

455455
```bash
456-
bun run tool-metadata:generate
456+
bun run generate:tool-metadata
457457
```
458458

459459
Client code reads a tool's `params`/`outputs` from generated metadata rather than
@@ -612,10 +612,10 @@ If creating V2 tools (API-aligned outputs), use `_v2` suffix:
612612
- [ ] Types file has all interfaces
613613
- [ ] Index.ts exports all tools and re-exports types (`export * from './types'`)
614614
- [ ] Tools registered in `tools/registry.ts`
615-
- [ ] `bun run tool-metadata:generate` run and the regenerated artifacts committed
615+
- [ ] `bun run generate:tool-metadata` run and the regenerated artifacts committed
616616
- [ ] `bun run scripts/generate-docs.ts` run and the refreshed docs committed — the integration's
617617
docs page is rendered from each tool's description, params, and outputs, and CI's
618-
`bun run docs:check` fails on stale pages
618+
`bun run check:docs` fails on stale pages
619619
- [ ] Block wired: `tools.access`, dropdown options, subBlocks, `tools.config`, outputs, inputs
620620
- [ ] Model, durable-storage, and internal-execution boundaries use the shared provenance mechanisms
621621
only where a concrete Sim `{{...}}` resolution path requires them

‎.agents/skills/add-trigger/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,5 +543,5 @@ registered `InternalToolConfig.operation`; a `directExecution` property fails
543543
- [ ] Manually verify output keys match trigger `outputs` keys
544544
- [ ] Trigger UI shows correctly in the block
545545
- [ ] Ran `bun run scripts/generate-docs.ts` and committed the refreshed pages — trigger sections
546-
render into the owning integration's docs page, and CI's `bun run docs:check` fails on stale
546+
render into the owning integration's docs page, and CI's `bun run check:docs` fails on stale
547547
pages

‎.agents/skills/ship/SKILL.md‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ When the user runs `/ship`:
4949
- `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.
5050
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 exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
5151
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 — `agent-stream-docs:generate` (derives from the provider model registry), `docs-manifest:generate` (derives from docs page paths), and `skills:sync` (derives from `.agents/skills/**`). They write disjoint outputs (`apps/docs/…/agent.mdx`, `apps/sim/lib/mothership/generated/docs-manifest.ts`, 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 (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):
5353
```bash
5454
rm -f /tmp/ship-gen-results
55-
for g in agent-stream-docs:generate docs-manifest:generate skills:sync; do
55+
for g in generate:agent-stream-docs generate:docs-manifest generate:tool-metadata skills:sync; do
5656
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
5757
done
5858
wait
@@ -64,7 +64,7 @@ When the user runs `/ship`:
6464
```
6565
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
6666
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 `integration-catalog:check` 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.
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.
6868
6969
**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:
7070
```bash
@@ -77,17 +77,13 @@ When the user runs `/ship`:
7777
}
7878
# Runs every audit CI runs, concurrently, and replays the output of any that fail.
7979
# The audit list is derived in scripts/run-audits.ts — do not hand-list audits here.
80-
# Install CI's pinned actionlint version for the host OS/architecture and verify its
81-
# artifact against the official release checksums in a local mktemp directory.
82-
# Preserve CI's -shellcheck= -pyflakes= flags; lint all workflows and abort ship if it fails.
80+
# Workflow lint (actionlint) runs only in CI's "Lint workflows" step.
8381
bun run check:audits || { echo "❌ audit(s) failed — do not ship"; exit 1; }
8482
bun run type-check || { echo "❌ type-check failed — do not ship"; exit 1; }
85-
# CI's "Verify docs manifest is in sync" step is not a `check:*` script, so the runner above
86-
# does not cover it. (CI's "Security audit" `bun audit` step is `continue-on-error` — advisory
87-
# only, not a gate — so it is deliberately not run here.)
88-
bun run docs-manifest:check || { echo "❌ docs manifest out of sync — do not ship"; exit 1; }
83+
# CI's "Security audit" `bun audit` step is `continue-on-error` — advisory only, not a gate —
84+
# so it is deliberately not run here.
8985
```
90-
If Phase A regenerated a file, its matching `:check` in Phase B now passes trivially — that parity is the point. Do not ship with any generator or audit failing; fix the cause (never silence it) and re-run. `check:migrations` is covered by step 5 and is not repeated here.
86+
If Phase A regenerated a file, its matching `check:*` audit in Phase B now passes trivially — that parity is the point. Do not ship with any generator or audit failing; fix the cause (never silence it) and re-run. `check:migrations` is covered by step 5 and is not repeated here.
9187
7. **Stage and commit** the changes with the generated message — including any files Phase A regenerated in step 6
9288
8. **Push to origin** using the current branch name — `--force-with-lease` if step 2's sync
9389
check did any history rewrite (a clean rebase or a cherry-pick rebuild) on a branch that had

‎.agents/skills/tool-registry-boundary/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ All lookups guard with `Object.hasOwn`. `JSON.parse` yields an object with the n
4040
`apps/sim/tools/generated/tool-ids.ts`, `tool-metadata.ts` and `tool-outputs.ts` are produced by `scripts/sync-tool-metadata.ts`:
4141

4242
```bash
43-
bun run tool-metadata:generate # after adding/changing a tool
44-
bun run tool-metadata:check # what CI runs; fails if stale
43+
bun run generate:tool-metadata # after adding/changing a tool
44+
bun run check:tool-metadata # what CI runs; fails if stale
4545
```
4646

4747
Never hand-edit them. If you add a tool or change a tool's `params`/`outputs`, regenerate and commit the result, or CI fails.

0 commit comments

Comments
 (0)