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
"- Use the discovered output shape exactly. Do not invent wrapper fields like `data.domain` or `data.items` unless the schema/sample shows them.",
73
73
"- For toggles and switches, mutate with the checked value from the event instead of inverting possibly stale query data.",
74
74
"- For optimistic writes, use TanStack `onMutate` / `onError` / `onSettled`: cancel the query, snapshot old data, `setQueryData`, roll back on error, then invalidate.",
75
-
"- Success messages must use `mutation.variables` or neutral wording, not query-derived state that may still be stale while invalidation refetches.",
76
75
"- Only hardcode small display constants like labels, colors, tab names, and chart configuration. Never embed tool response rows, API results, summaries, or dashboard data as literals in the component.",
77
76
"- Always render loading and error states from `useQuery` / `useMutation`; do not replace them with hardcoded fallback data.",
78
77
"- Tools: `tools.<namespace>.<tool>(args)` — call any configured API tool (never use raw `fetch`). Tool helpers: `.queryOptions(args, options)`, `.mutationOptions(options)`, `.queryKey(args)`, `.pathKey()`, and `.mutationKey()`.",
"- Use the discovered output shape exactly. Do not invent wrapper fields like `data.domain` or `data.items` unless the schema/sample shows them.",
339
339
"- For toggles and switches, mutate with the checked value from the event instead of inverting possibly stale query data.",
340
340
"- For optimistic writes, use TanStack `onMutate` / `onError` / `onSettled`: cancel the query, snapshot old data, `setQueryData`, roll back on error, then invalidate.",
341
-
"- Success messages must use `mutation.variables` or neutral wording, not query-derived state that may still be stale while invalidation refetches.",
342
341
"- Only hardcode small display constants like labels, colors, tab names, and chart configuration. Never embed tool response rows, API results, summaries, or dashboard data as literals in the component.",
343
342
"- Always render loading and error states from `useQuery` / `useMutation`; do not replace them with hardcoded fallback data.",
344
343
`- shadcn/ui components available by name: ${SHADCN_COMPONENTS}`,
"- For simple writes, invalidate with `queryClient.invalidateQueries(tools.<namespace>.<queryTool>.queryFilter(args))` in `onSuccess` or `onSettled`.",
374
373
"- For toggles and switches, pass the new checked value into `mutate`: `onCheckedChange={(checked) => mutation.mutate({ body: { enabled: checked } })}`.",
375
374
"- For optimistic UI, use `onMutate` to `cancelQueries`, snapshot `getQueryData`, and `setQueryData`; return the snapshot, restore it in `onError`, and invalidate in `onSettled`.",
376
-
"- Do not send mutation payloads by inverting query state like `autoRenew: !autoRenew`; the cached value can be stale after an approval flow.",
377
-
'- Do not show success text by combining `mutation.isSuccess` with query-derived state like `autoRenew ? "enabled" : "disabled"`. `isSuccess` becomes true before invalidated reads finish refetching.',
378
-
'- For action-specific success text, read the submitted value from `mutation.variables` such as `mutation.variables?.body?.autoRenew ? "enabled" : "disabled"`, or show neutral text like `Saved successfully`.',
"- Keep data live by routing every API read/write through the provided `tools` proxy from TanStack Query or `run(code)`.",
392
388
"- Do not redeclare or destructure provided globals. Hooks, components, icons, `tools`, and `run` are already in scope; use them directly.",
393
389
"- Tool proxy helpers are TanStack-native: `.queryOptions(args, options)`, `.mutationOptions(options)`, `.queryKey(args)`, `.queryFilter(args, filters)`, `.pathKey()`, `.pathFilter(filters)`, and `.mutationKey()`.",
394
-
"- The server rejects toggle mutations that invert query-backed booleans such as `autoRenew: !autoRenew`; use the checked value from the UI event.",
395
-
"- The server rejects mutation success labels that read enabled/disabled wording from stale query state; use `mutation.variables` or neutral text.",
396
390
"- The server rejects obvious hardcoded live-data snapshots such as `const rows = [{...}, {...}]`; regenerate with `useQuery` instead.",
397
391
"- The server rejects redeclarations of provided globals such as `const { useState } = React` or `const Card = ...` before the UI reaches the iframe.",
`Mutation success text must not read "${staleSuccessState}" from query state.`,
488
-
"`mutation.isSuccess` becomes true before invalidated queries finish refetching; use mutation.variables for action-specific text or show neutral saved text.",
0 commit comments