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 1cf37ca
Browse filesBrowse the repository at this point in the historyBrowse files
docs(agents): fix contradictions and stale facts in integration skills
Verified against the code: tags live on BlockMeta, not BlockConfig;
check-block-registry requires required user-only params to be filled by a
subBlock of the same id, so remapping them in tools.config.params fails CI;
subblock ids are unique per condition; matchEvent may return a
NextResponse; createHmacVerifier needs requireSecret to fail closed;
FileToolProcessor is executor-side; provider scopes live in
lib/auth/connectors/providers.ts; BYOK needs PROVIDER_SECTIONS; polling
crons need the matching docker/crontab line. Duplicated option-list and
regenerate sections now point at one copy.
**Critical:**Every subblock `id`must be unique within the block. Duplicate IDs cause conflicts even with different conditions.
76
+
**Critical:**A subblock `id`is unique per condition. The only sanctioned cross-condition reuse is the hosted-key `apiKey` pair (`add-hosted-key` skill), where both fields deliberately share one value. `blocks.test.ts` fails same-condition duplicates.
@@ -937,30 +956,17 @@ tool IDs through `tools.access` and does not change any tool's shape.
937
956
938
957
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`.
939
958
940
-
A visible integration block does require the generated integration catalog and docs to be refreshed.
941
-
After adding or changing one, run:
942
-
943
-
```bash
944
-
bun run scripts/generate-docs.ts
945
-
bun run deployment-config:generate
946
-
bun run integration-catalog:check
947
-
bun run deployment-config:check
948
-
bun run docs:check
949
-
```
950
-
951
-
The catalog check independently derives deployment metadata from the executable block registry and
952
-
compares it with the committed `packages/deployment-config/src/integrations.json`. The deployment
953
-
config check verifies the generated service-account facts against the canonical OAuth registry and
954
-
catalog. `docs:check` re-renders every generated docs artifact in memory and fails on any committed
955
-
file that differs — it runs in CI via `check:audits`, so commit the full generator output. If the
956
-
generator also trues up pages an earlier PR left stale, commit that catch-up too; reverting it as
957
-
"unrelated drift" makes `docs:check` fail. Review the generated diff and keep only intentional
958
-
changes.
959
+
A visible integration block does require the generated integration catalog and docs to be refreshed:
960
+
`bun run tool-metadata:generate` (only when a tool changed), `bun run scripts/generate-docs.ts`,
961
+
`bun run deployment-config:generate`, then `bun run check:audits`. Also run
962
+
`bun run apps/sim/scripts/check-block-registry.ts` (CI runs it outside `check:audits`). Commit the
963
+
full generator output. For what each check verifies, see the `validate-integration` skill →
964
+
Regenerate Derived Artifacts.
959
965
960
966
## Checklist Before Finishing
961
967
962
968
-[ ]`integrationType` is set to the correct `IntegrationType` enum value
963
-
-[ ]`tags`array includes all applicable `IntegrationTag`values
969
+
-[ ]`{Service}BlockMeta.tags`lists every applicable `IntegrationTag`(tags live on the meta, not the block)
964
970
-[ ] All subBlocks have `id`, `title` (except switch), and `type`
965
971
-[ ] Conditions use correct syntax (field, value, not, and)
966
972
-[ ] DependsOn set for fields that need other values
@@ -996,7 +1002,7 @@ Validate the block against every tool in `tools.access`:
996
1002
2.**For each tool, verify the block has correct:**
997
1003
- SubBlock inputs that cover all required tool params (with correct `condition` to show for that operation)
998
1004
- SubBlock input types that match the tool param types (e.g., dropdown for enums, short-input for strings)
999
-
-`tools.config.params`correctly maps subBlock IDs to tool param names (if they differ)
1005
+
-Each subBlock (or its `canonicalParamId`) is named exactly after the tool param it fills. A required `user-only` param that is only renamed in `tools.config.params`fails `bun run apps/sim/scripts/check-block-registry.ts`; remap only optional or `user-or-llm` params
1000
1006
- Type coercions in `tools.config.params` for any params that need conversion (Number(), Boolean(), JSON.parse())
1001
1007
3.**Verify block outputs** cover the key fields returned by all tools
1002
1008
4.**Verify conditions** — each subBlock should only show for the operations that actually use it
Copy file name to clipboardExpand all lines: .agents/skills/add-hosted-key/SKILL.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,7 +198,7 @@ In the block config (`blocks/blocks/{service}.ts`), add `hideWhenHosted: true` t
198
198
},
199
199
```
200
200
201
-
The visibility is controlled by `isSubBlockHidden()` in `lib/workflows/subblocks/visibility.ts`, which checks both the `isHosted` feature flag (`hideWhenHosted`) and optional env var conditions (`hideWhenEnvSet`).
201
+
The visibility is controlled by `isSubBlockHidden()` in `lib/workflows/subblocks/visibility.ts`, which checks both `getDeploymentShape().hosted` (`hideWhenHosted`) and optional env var conditions (`hideWhenEnvSet`).
202
202
203
203
### Excluding Specific Operations from Hosted Key Support
204
204
@@ -251,6 +251,9 @@ Add an entry to the `PROVIDERS` array in the BYOK settings component so users ca
251
251
},
252
252
```
253
253
254
+
Then add the id to exactly one section's `ids` in `PROVIDER_SECTIONS` (same file), and run
255
+
`bun run check:byok-providers`.
256
+
254
257
## Step 6: Summarize Pricing and Throttling Comparison
255
258
256
259
After all code changes are complete, output a detailed summary to the user covering:
@@ -296,5 +299,6 @@ This summary helps reviewers verify that the pricing and rate limiting are well-
296
299
-[ ] Cost data captured in `transformResponse` or `postProcess` if API provides it
297
300
-[ ]`hideWhenHosted: true` added to the API key subblock in the block config
298
301
-[ ] Provider entry added to the BYOK settings UI with icon and description
302
+
-[ ] Provider id listed in exactly one `PROVIDER_SECTIONS` section's `ids`; `bun run check:byok-providers` passes
299
303
-[ ] Env vars documented: `{PREFIX}_COUNT` and `{PREFIX}_1..N`
300
304
-[ ] Pricing and throttling summary provided to reviewer
@@ -304,16 +302,11 @@ a resolvable capability must fail validation.
304
302
305
303
## Step 8: Generate and Validate the Catalog
306
304
307
-
Run the documentation generator:
308
-
```bash
309
-
bun run scripts/generate-docs.ts
310
-
bun run deployment-config:generate
311
-
bun run integration-catalog:check
312
-
bun run deployment-config:check
313
-
bun run docs:check
314
-
```
305
+
Run `bun run tool-metadata:generate`, `bun run scripts/generate-docs.ts`,
306
+
`bun run deployment-config:generate`, then `bun run check:audits` (see the `validate-integration`
307
+
skill → Regenerate Derived Artifacts for the full list and what each check verifies).
315
308
316
-
This 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`).
309
+
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`).
317
310
318
311
Every generated integration page carries a hand-written intro directly under `<BlockInfoCard />`. The
319
312
generator preserves it across regenerations, so write it once after the first generate:
@@ -392,7 +385,7 @@ If creating V2 versions (API-aligned outputs):
392
385
### Block
393
386
-[ ] Created `blocks/blocks/{service}.ts`
394
387
-[ ] Set `integrationType` to the correct `IntegrationType` enum value
395
-
-[ ]Set `tags`array with all applicable `IntegrationTag`values
388
+
-[ ]`{Service}BlockMeta.tags`lists every applicable `IntegrationTag`(tags live on the meta, not the block)
396
389
-[ ] Defined operation dropdown with all operations
397
390
-[ ] Added credential field with `requiredScopes: getScopesForService('{service}')`
398
391
-[ ] Added conditional fields per operation
@@ -415,7 +408,7 @@ If creating V2 versions (API-aligned outputs):
415
408
### OAuth Scopes (if OAuth service)
416
409
-[ ] Defined scopes in `lib/oauth/oauth.ts` under `OAUTH_PROVIDERS`
417
410
-[ ] Added scope descriptions in `SCOPE_DESCRIPTIONS` within `lib/oauth/utils.ts`
418
-
-[ ] Used `getCanonicalScopesForProvider()` in `auth.ts` (never hardcode)
411
+
-[ ] Used `getCanonicalScopesForProvider()` in `lib/auth/connectors/providers.ts` (never hardcode)
419
412
-[ ] Used `getScopesForService()` in block `requiredScopes` (never hardcode)
420
413
421
414
### Deployment Availability (if OAuth service)
@@ -548,51 +541,20 @@ Implement `apps/sim/lib/internal/{service}/execute-tool.ts` and keep the file/pr
548
541
operations beside it. The handler validates `request.input`, derives storage authority only from
549
542
trusted `request.context`, authorizes every stored file before reading bytes, forwards
550
543
`request.signal`, enforces declared and actual byte caps, and returns the canonical tool response.
551
-
Register `{service}_upload` in `apps/sim/lib/internal/tool-operations/registry.server.ts` and add a
552
-
registry/direct-handler test. There is no HTTP fallback.
544
+
Register `{service}_upload` in `apps/sim/lib/internal/tool-operations/registry.server.ts`; the
545
+
existing `registry.server.test.ts` completeness test covers registration. For anything more, run the
546
+
`test-audit` gate. There is no HTTP fallback.
553
547
554
548
### File Output Pattern (Downloads)
555
549
556
-
For tools that return files, use `FileToolProcessor` to store files and return `UserFile` objects.
|`FileToolProcessor`|`@/executor/utils/file-tool-processor`|Executor-side; stores declared file outputs (not called by tools)|
605
567
|`isUserFile`|`@/lib/core/utils/user-file`| Type guard for UserFile objects |
606
568
|`FileInputSchema`|`@/lib/uploads/utils/file-schemas`| Zod schema for file validation |
607
569
@@ -636,13 +598,13 @@ Scopes are maintained in a single source of truth and reused everywhere:
636
598
637
599
1.**Define scopes** in `lib/oauth/oauth.ts` under `OAUTH_PROVIDERS[provider].services[service].scopes`
638
600
2.**Add descriptions** in `SCOPE_DESCRIPTIONS` within `lib/oauth/utils.ts` for the OAuth modal UI
639
-
3.**Reference in auth.ts** using `getCanonicalScopesForProvider(providerId)` from `@/lib/oauth/utils`
601
+
3.**Reference in `lib/auth/connectors/providers.ts`** (`buildConnectorProviders`) using `getCanonicalScopesForProvider(providerId)` from `@/lib/oauth/utils`
640
602
4.**Reference in blocks** using `getScopesForService(serviceId)` from `@/lib/oauth/utils`
641
603
642
-
**Never hardcode scope arrays** in `auth.ts` or block `requiredScopes`. Always import from the centralized source.
604
+
**Never hardcode scope arrays** in the Better Auth connector providers or block `requiredScopes`. Always import from the centralized source.
643
605
644
606
```typescript
645
-
// In auth.ts (Better Auth config)
607
+
// In lib/auth/connectors/providers.ts (Better Auth connector providers)
0 commit comments