Skip to content

Commit 6d2deb1

Browse files
chore(skills): reinforce skill to not guess integration outputs (#4122)
1 parent 10341ae commit 6d2deb1

File tree

10 files changed

+503
-369
lines changed

10 files changed

+503
-369
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ When the user asks you to create a block:
1414
2. Configure all subBlocks with proper types, conditions, and dependencies
1515
3. Wire up tools correctly
1616

17+
## Hard Rule: No Guessed Tool Outputs
18+
19+
Blocks depend on tool outputs. If the underlying tool response schema is not documented or live-verified, you MUST tell the user instead of guessing block outputs.
20+
21+
- Do NOT invent block outputs for undocumented tool responses
22+
- Do NOT describe unknown JSON shapes as if they were confirmed
23+
- Do NOT wire fields into the block just because they seem likely to exist
24+
25+
If the tool outputs are not known, do one of these instead:
26+
1. Ask the user for sample tool responses
27+
2. Ask the user for test credentials so the tool responses can be verified
28+
3. Limit the block to operations whose outputs are documented
29+
4. Leave uncertain outputs out and explicitly tell the user what remains unknown
30+
1731
## Block Configuration Structure
1832

1933
```typescript
@@ -575,6 +589,8 @@ Use `type: 'json'` with a descriptive string when:
575589
- It represents a list/array of items
576590
- The shape varies by operation
577591

592+
If the output shape is unknown because the underlying tool response is undocumented, you MUST tell the user and stop. Unknown is not the same as variable. Never guess block outputs.
593+
578594
## V2 Block Pattern
579595

580596
When creating V2 blocks (alongside legacy V1):
@@ -829,3 +845,4 @@ After creating the block, you MUST validate it against every tool it references:
829845
- Type coercions in `tools.config.params` for any params that need conversion (Number(), Boolean(), JSON.parse())
830846
3. **Verify block outputs** cover the key fields returned by all tools
831847
4. **Verify conditions** — each subBlock should only show for the operations that actually use it
848+
5. **If any tool outputs are still unknown**, explicitly tell the user instead of guessing block outputs

.agents/skills/add-connector/SKILL.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ When the user asks you to create a connector:
1515
3. Create the connector directory and config
1616
4. Register it in the connector registry
1717

18+
## Hard Rule: No Guessed Response Or Document Schemas
19+
20+
If the service docs do not clearly show the document list response, document fetch response, pagination shape, or metadata fields, you MUST tell the user instead of guessing.
21+
22+
- Do NOT invent document fields
23+
- Do NOT guess pagination cursors or next-page fields
24+
- Do NOT infer metadata/tag mappings from unrelated endpoints
25+
- Do NOT fabricate `ExternalDocument` content structure from partial docs
26+
27+
If the source schema is unknown, do one of these instead:
28+
1. Ask the user for sample API responses
29+
2. Ask the user for test credentials so you can verify live payloads
30+
3. Implement only the documented parts of the connector
31+
4. Leave the connector incomplete and explicitly say which fields remain unknown
32+
1833
## Directory Structure
1934

2035
Create files in `apps/sim/connectors/{service}/`:
@@ -92,6 +107,8 @@ export const {service}Connector: ConnectorConfig = {
92107
}
93108
```
94109

110+
Only map fields in `listDocuments`, `getDocument`, `validateConfig`, and `mapTags` when the source payload shape is documented or live-verified. If not, tell the user and stop rather than guessing.
111+
95112
### API key connector example
96113

97114
```typescript

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ Before writing any code:
2929
- Required vs optional parameters
3030
- Response structures
3131

32+
### Hard Rule: No Guessed Response Schemas
33+
34+
If the official docs do not clearly show the response JSON shape for an endpoint, you MUST stop and tell the user exactly which outputs are unknown.
35+
36+
- Do NOT guess response field names
37+
- Do NOT infer nested JSON paths from related endpoints
38+
- Do NOT invent output properties just because they seem likely
39+
- Do NOT implement `transformResponse` against unverified payload shapes
40+
41+
If response schemas are missing or incomplete, do one of the following before proceeding:
42+
1. Ask the user for sample responses
43+
2. Ask the user for test credentials so you can verify the live payload
44+
3. Reduce the scope to only endpoints whose response shapes are documented
45+
4. Leave the tool unimplemented and explicitly report why
46+
3247
## Step 2: Create Tools
3348

3449
### Directory Structure
@@ -103,6 +118,7 @@ export const {service}{Action}Tool: ToolConfig<Params, Response> = {
103118
- Set `optional: true` for outputs that may not exist
104119
- Never output raw JSON dumps - extract meaningful fields
105120
- When using `type: 'json'` and you know the object shape, define `properties` with the inner fields so downstream consumers know the structure. Only use bare `type: 'json'` when the shape is truly dynamic
121+
- If you do not know the response JSON shape from docs or verified examples, you MUST tell the user and stop. Never guess outputs or response mappings.
106122

107123
## Step 3: Create Block
108124

@@ -450,6 +466,8 @@ If creating V2 versions (API-aligned outputs):
450466
- [ ] Verified block subBlocks cover all required tool params with correct conditions
451467
- [ ] Verified block outputs match what the tools actually return
452468
- [ ] Verified `tools.config.params` correctly maps and coerces all param types
469+
- [ ] Verified every tool output and `transformResponse` path against documented or live-verified JSON responses
470+
- [ ] If any response schema remained unknown, explicitly told the user instead of guessing
453471

454472
## Example Command
455473

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ When the user asks you to create tools for a service:
1414
2. Create the tools directory structure
1515
3. Generate properly typed tool configurations
1616

17+
## Hard Rule: No Guessed Response Schemas
18+
19+
If the docs do not clearly show the response JSON for a tool, you MUST tell the user exactly which outputs are unknown and stop short of guessing.
20+
21+
- Do NOT invent response field names
22+
- Do NOT infer nested paths from nearby endpoints
23+
- Do NOT guess array item shapes
24+
- Do NOT write `transformResponse` against unverified payloads
25+
26+
If the response shape is unknown, do one of these instead:
27+
1. Ask the user for sample responses
28+
2. Ask the user for test credentials so you can verify live responses
29+
3. Implement only the endpoints whose outputs are documented
30+
4. Leave the tool unimplemented and explicitly say why
31+
1732
## Directory Structure
1833

1934
Create files in `apps/sim/tools/{service}/`:
@@ -187,6 +202,8 @@ items: {
187202

188203
Only use bare `type: 'json'` without `properties` when the shape is truly dynamic or unknown.
189204

205+
If the response shape is unknown because the docs do not provide it, you MUST tell the user and stop. Unknown is not the same as dynamic. Never guess outputs.
206+
190207
## Critical Rules for transformResponse
191208

192209
### Handle Nullable Fields
@@ -441,7 +458,9 @@ After creating all tools, you MUST validate every tool before finishing:
441458
- All output fields match what the API actually returns
442459
- No fields are missing from outputs that the API provides
443460
- No extra fields are defined in outputs that the API doesn't return
461+
- Every output field and JSON path is backed by docs or live-verified sample responses
444462
3. **Verify consistency** across tools:
445463
- Shared types in `types.ts` match all tools that use them
446464
- Tool IDs in the barrel export match the tool file definitions
447465
- Error handling is consistent (error checks, meaningful messages)
466+
4. **If any response schema is still unknown**, explicitly tell the user instead of guessing

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ You are an expert at creating webhook triggers for Sim. You understand the trigg
1414
3. Create a provider handler if custom auth, formatting, or subscriptions are needed
1515
4. Register triggers and connect them to the block
1616

17+
## Hard Rule: No Guessed Webhook Payload Schemas
18+
19+
If the service docs do not clearly show the webhook payload JSON for an event, you MUST tell the user instead of guessing trigger outputs or `formatInput` mappings.
20+
21+
- Do NOT invent payload field names
22+
- Do NOT guess nested event object paths
23+
- Do NOT infer output fields from the UI or marketing docs
24+
- Do NOT write `formatInput` against unverified webhook bodies
25+
26+
If the payload shape is unknown, do one of these instead:
27+
1. Ask the user for sample webhook payloads
28+
2. Ask the user for a test webhook source so you can inspect a real event
29+
3. Implement only the event registration/setup portions whose payloads are documented
30+
4. Leave the trigger unimplemented and explicitly say which payload fields are unknown
31+
1732
## Directory Structure
1833

1934
```

.agents/skills/validate-connector/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ Fetch the official API docs for the service. This is the **source of truth** for
5252

5353
Use Context7 (resolve-library-id → query-docs) or WebFetch to retrieve documentation. If both fail, note which claims are based on training knowledge vs verified docs.
5454

55+
### Hard Rule: No Guessed Source Schemas
56+
57+
If the service docs do not clearly show document list responses, document fetch responses, metadata fields, or pagination shapes, you MUST tell the user instead of guessing.
58+
59+
- Do NOT infer document fields from unrelated endpoints
60+
- Do NOT guess pagination cursors or response wrappers
61+
- Do NOT assume metadata keys that are not documented
62+
- Do NOT treat probable shapes as validated
63+
64+
If a schema is unknown, validation must explicitly recommend:
65+
1. sample API responses,
66+
2. live test credentials, or
67+
3. trimming the connector to only documented fields.
68+
5569
## Step 3: Validate API Endpoints
5670

5771
For **every** API call in the connector (`listDocuments`, `getDocument`, `validateConfig`, and any helper functions), verify against the API docs:
@@ -93,6 +107,7 @@ For **every** API call in the connector (`listDocuments`, `getDocument`, `valida
93107
- [ ] Field names extracted match what the API actually returns
94108
- [ ] Nullable fields are handled with `?? null` or `|| undefined`
95109
- [ ] Error responses are checked before accessing data fields
110+
- [ ] Every extracted field and pagination value is backed by official docs or live-verified sample payloads
96111

97112
## Step 4: Validate OAuth Scopes (if OAuth connector)
98113

@@ -304,6 +319,7 @@ After fixing, confirm:
304319
1. `bun run lint` passes
305320
2. TypeScript compiles clean
306321
3. Re-read all modified files to verify fixes are correct
322+
4. Any remaining unknown source schemas were explicitly reported to the user instead of guessed
307323

308324
## Checklist Summary
309325

.agents/skills/validate-integration/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ Fetch the official API docs for the service. This is the **source of truth** for
4141
- Pagination patterns (which param name, which response field)
4242
- Rate limits and error formats
4343

44+
### Hard Rule: No Guessed Response Schemas
45+
46+
If the official docs do not clearly show the response JSON shape for an endpoint, you MUST tell the user instead of guessing.
47+
48+
- Do NOT assume field names from nearby endpoints
49+
- Do NOT infer nested JSON paths without evidence
50+
- Do NOT treat "likely" fields as confirmed outputs
51+
- Do NOT accept implementation guesses as valid just because they are defensive
52+
53+
If a response schema is unknown, the validation must explicitly call that out and require:
54+
1. sample responses from the user,
55+
2. live test credentials for verification, or
56+
3. trimming the tool/block down to only documented fields.
57+
4458
## Step 3: Validate Tools
4559

4660
For **every** tool file, check:
@@ -81,6 +95,7 @@ For **every** tool file, check:
8195
- [ ] All optional arrays use `?? []`
8296
- [ ] Error cases are handled: checks for missing/empty data and returns meaningful error
8397
- [ ] Does NOT do raw JSON dumps — extracts meaningful, individual fields
98+
- [ ] Every extracted field is backed by official docs or live-verified sample payloads
8499

85100
### Outputs
86101
- [ ] All output fields match what the API actually returns
@@ -267,6 +282,7 @@ After fixing, confirm:
267282
1. `bun run lint` passes with no fixes needed
268283
2. TypeScript compiles clean (no type errors)
269284
3. Re-read all modified files to verify fixes are correct
285+
4. Any remaining unknown response schemas were explicitly reported to the user instead of guessed
270286

271287
## Checklist Summary
272288

.agents/skills/validate-trigger/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ Fetch the service's official webhook documentation. This is the **source of trut
4444
- Webhook subscription API (create/delete endpoints, if applicable)
4545
- Retry behavior and delivery guarantees
4646

47+
### Hard Rule: No Guessed Webhook Payload Schemas
48+
49+
If the official docs do not clearly show the webhook payload JSON for an event, you MUST tell the user instead of guessing.
50+
51+
- Do NOT invent payload field names
52+
- Do NOT infer nested payload paths without evidence
53+
- Do NOT treat likely event shapes as verified
54+
- Do NOT accept `formatInput` mappings that are not backed by docs or live payloads
55+
56+
If a payload schema is unknown, validation must explicitly recommend:
57+
1. sample webhook payloads,
58+
2. a live test webhook source, or
59+
3. trimming the trigger to only documented outputs.
60+
4761
## Step 3: Validate Trigger Definitions
4862

4963
### utils.ts
@@ -93,6 +107,7 @@ Fetch the service's official webhook documentation. This is the **source of trut
93107
- [ ] Nested output paths exist at the correct depth (e.g., `resource.id` actually has `resource: { id: ... }`)
94108
- [ ] `null` is used for missing optional fields (not empty strings or empty objects)
95109
- [ ] Returns `{ input: { ... } }` — not a bare object
110+
- [ ] Every mapped payload field is backed by official docs or live-verified webhook payloads
96111

97112
### Idempotency
98113
- [ ] `extractIdempotencyId` returns a stable, unique key per delivery
@@ -195,6 +210,7 @@ After fixing, confirm:
195210
1. `bun run type-check` passes
196211
2. Re-read all modified files to verify fixes are correct
197212
3. Provider handler tests pass (if they exist): `bun test {service}`
213+
4. Any remaining unknown webhook payload schemas were explicitly reported to the user instead of guessed
198214

199215
## Checklist Summary
200216

apps/docs/components/icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ export function FireworksIcon(props: SVGProps<SVGSVGElement>) {
35543554
>
35553555
<path
35563556
d='M314.333 110.167L255.98 251.729l-58.416-141.562h-37.459l64 154.75c5.23 12.854 17.771 21.312 31.646 21.312s26.417-8.437 31.646-21.27l64.396-154.792h-37.459zm24.917 215.666L446 216.583l-14.562-34.77-116.584 119.562c-9.708 9.958-12.541 24.833-7.146 37.646 5.292 12.73 17.792 21.083 31.584 21.083l.042.063L506 359.75l-14.562-34.77-152.146.853h-.042zM66 216.5l14.563-34.77 116.583 119.562a34.592 34.592 0 017.146 37.646C199 351.667 186.5 360.02 172.708 360.02l-166.666-.375-.042.042 14.563-34.771 152.145.875L66 216.5z'
3557-
fill='currentColor'
3557+
fill='#5019c5'
35583558
/>
35593559
</svg>
35603560
)

0 commit comments

Comments
 (0)