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 521c77b
Browse filesBrowse the repository at this point in the historyBrowse files
"1. If you need to understand tool names, query syntax, required arguments, response shapes, IDs, mutation inputs, or a list tool's cursor field, first use the regular `execute` tool to inspect them.",
106
+
"1. Follow the discovery workflow above to inspect tool names, input schemas, response shapes, and pagination before writing the artifact.",
107
107
"2. Then call `create-artifact` with a component named `App` in the `code` parameter.",
108
108
"3. Recreate every read from the discovery step inside `App` with `useQuery(tools.<integration>.<tool>.queryOptions(args))` so the UI stays live.",
109
109
"4. Use `useMutation(tools.<integration>.<tool>.mutationOptions({ onSuccess }))` for user-triggered writes or actions.",
"- **Never hand-roll `useQuery({ queryKey, queryFn })`.** Always pass the proxy's options object: `useQuery(tools.<integration>.<tool>.queryOptions(args))`. A hand-written `queryKey` is invisible to `queryFilter`/`pathFilter`, so mutations silently stop refreshing the UI, and it hides which tool the artifact uses from artifact analysis.",
216
214
"- **Never fetch in a loop by hand.** Cursor pagination is declarative — see below.",
217
215
"",
218
-
"## Using Execute For Discovery",
216
+
"## Keep Discovered Data Live",
219
217
"",
220
-
"- `execute` is for exploration: list datasets, inspect schemas, test a query, fetch one small sample row, or learn the exact mutation input shape.",
218
+
"- Use the discovery workflow above to inspect schemas, test a query, fetch a small sample, or learn mutation inputs.",
221
219
"- `create-artifact` is for the final interactive surface. Do not paste discovery results into JSX as literal rows, cards, summaries, metrics, or chart series.",
222
-
"- After discovering an API call with `execute`, put the same call in TanStack Query options inside the generated component.",
223
-
"- Example discovery: call `execute` with `return await tools.axiom_mcp.querydataset({ ... })` to confirm columns, then call `create-artifact` with `useQuery(tools.axiom_mcp.querydataset.queryOptions({ ... }))`.",
220
+
"- After discovering an API call, put that integration operation in TanStack Query options inside the generated component.",
221
+
"- For example, inspect a dataset query to confirm columns, then use its integration operation with `.queryOptions(...)` in the component.",
224
222
"- Use discovered result shapes exactly. If a sample or schema returns `{ renew, expiresAt }`, read `data?.renew`, not `data?.domain?.renew`.",
225
223
"- Keep discovery small. Use limits, narrow time ranges, or schema/list tools when possible.",
"- `getNextPageParam(lastPage, allPages)` reads the cursor out of the tool's own response. Return `undefined` (or `null`) when there are no more pages — that is what stops the paging.",
245
243
"- `initialPageParam` defaults to `null`, which means the FIRST request carries no cursor at all. Set it only when a tool requires an explicit starting value (e.g. `initialPageParam: 1` for page numbers).",
246
-
'- `cursorKey` says where the page param lands in the tool input. It defaults to `"cursor"`. Use a dotted path for nested inputs — `cursorKey: "query.since"` writes `{ query: { since: <pageParam> } }`. Read the tool\'s input shape with `execute` first; do not guess the field name.',
244
+
'- `cursorKey` says where the page param lands in the tool input. It defaults to `"cursor"`. Use a dotted path for nested inputs — `cursorKey: "query.since"` writes `{ query: { since: <pageParam> } }`. Read the tool\'s input schema during discovery first; do not guess the field name.',
247
245
"- Render `data.pages` (an array of tool results, newest page last) and drive further loading from `hasNextPage` / `fetchNextPage` / `isFetchingNextPage`. Do not call `fetchNextPage` in a loop on mount — let the user pull more, or paginate deliberately with a bounded `useEffect`.",
248
246
"",
249
247
"**Never chain `useQuery` calls in a loop to page through a cursor.** This is",
"- Use this tool instead of `execute` whenever the output should be an interactive UI.",
327
+
"- Use this tool whenever the output should be an interactive UI.",
330
328
"- Export a component named `App`. A top-level `const config = { maxHeight }` caps the frame height where the artifact is embedded in a scrolling page; it is ignored where the artifact has been given the whole viewport.",
331
329
'- Lay the artifact out as an APP, not a document: root `flex h-full flex-col`, headers and filters as ordinary children, and the one long list or table as `flex-1 min-h-0 overflow-auto` so it scrolls under a header that stays put. See `skills({ name: "artifact-style" })`.',
332
330
"- Do not call API tools first and paste returned data into JSX.",
"1. Call `integrations({})` to choose an account. Its `integration`, `owner`, and `connection` fields form the artifact binding, joined with dots.",
357
+
'2. Call `search({ query: "list issues", integration: "linear", owner: "org", connection: "linearProd" })` using that account. Read the returned inputSchema.',
358
+
"3. Call `invoke({ tool: <exact returned id>, arguments: <JSON input> })` to inspect a small sample response. Use search and invoke, not general code execution, to learn the data shape.",
359
+
]
360
+
: [
361
+
'1. Use `execute` to call `tools.search({ query: "list issues" })`, then `tools.describe.tool({ path })` to inspect the matched tool.',
362
+
"2. Use `tools.executor.coreTools.connections.list({})` for saved accounts. The connection address without its leading `tools.` is the artifact binding.",
363
+
"3. Call the discovered tool in `execute` to inspect a small sample response.",
364
+
]),
365
+
"",
366
+
CREATE_ARTIFACT_SKILL_BODY,
367
+
].join("\n");
368
+
350
369
exportconstCREATE_ARTIFACT_SKILL: Skill={
351
370
name: "create-artifact",
352
371
summary:
353
372
"How to write a React component for the create-artifact tool: discover data with execute, keep it live with TanStack Query (including cursor pagination), and what is already in scope.",
354
-
body: CREATE_ARTIFACT_SKILL_BODY,
373
+
body: createArtifactSkillBody(false),
355
374
};
356
375
357
376
// The design system, kept SEPARATE from the capability manifest above.
@@ -631,8 +650,25 @@ const ARTIFACT_SKILLS: ReadonlySet<Skill> = new Set([CREATE_ARTIFACT_SKILL, ARTI
631
650
* artifact skills so the index never advertises a doc for tools this connection
632
651
* does not have; a session that opted in gets the full {@link SKILLS} list.
0 commit comments