-
Notifications
You must be signed in to change notification settings - Fork 127
Fix AppKit template documentation for LLMs #4243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
LLMs were adding query schemas but not running npm run typegen, causing TypeScript errors like "query key not assignable to type". Made Step 3 explicit: run typegen after any schema change. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Commit: bd4e486
26 interesting tests: 15 RECOVERED, 10 KNOWN, 1 SKIP
Top 46 slowest tests (at least 2 minutes):
|
The hook's return type doesn't infer from QueryRegistry, so data is typed as {}.
Without manual casting, TypeScript errors like "Property 'map' does not exist" occur.
TODO: File SDK improvement PR to fix useAnalyticsQuery type inference
from QueryRegistry so casting isn't needed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| **To refresh TypeScript types after adding queries:** | ||
| - Run `npm run typegen` OR run `npm run dev` - both auto-generate type definitions in `client/src/appKitTypes.d.ts` | ||
| - DO NOT manually edit `appKitTypes.d.ts` | ||
| **⚠️ CRITICAL: Always run `npm run typegen` after modifying `config/queries/schema.ts`** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schema.ts file doesn't exist anymore, only the appKitTypes file
| - Conditional rendering based on data values | ||
| - Data that needs transformation before display | ||
|
|
||
| **⚠️ CRITICAL: Always cast data to the correct type** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casting should generally not be required. This needs to be fixed in AppKit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug, I will check. The data from the hooks is already cast.
The most critical workflow steps were only in template docs, which agents sometimes skip. Adding to MCP guidance ensures agents see this during databricks_discover call: - npm run typegen required after schema changes - data casting required for useAnalyticsQuery - chart components don't accept children Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2aab02a to
f5f1230
Compare
AppKit SDK will fix type inference from QueryRegistry, making manual casting unnecessary. Removed workaround documentation per PR review feedback. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c5ec8c8 to
88ff134
Compare
AppKit-specific guidance now lives in skills/apps/appkit/. target_apps.tmpl focuses on validation, deployment, and operational commands only. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
88ff134 to
5bc4642
Compare
Move AppKit documentation from appkit repo llms.txt to CLI skills. This establishes CLI as the single source of truth for agent guidance. Includes: - SKILL.md: Overview, hard rules, quick start - appkit-backend.md: Server, analytics, plugins, caching - appkit-frontend.md: Charts, hooks, UI components, SSE - appkit-scaffolding.md: Project setup, type generation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Fixes critical documentation issues causing ~90% build failure rate in LLM-generated AppKit apps.
Changes:
npm run typegena required explicit step after schema changesuseAnalyticsQuerydata must be cast manuallytarget_apps.tmplso agents see it duringdatabricks_discoverRoot causes addressed:
<BarChart><Bar .../></BarChart>→ TypeScript errors (charts don't accept children)npm run typegen→ "not assignable to type" errorsdata?.map()without casting → "Property 'map' does not exist on type '{}'" errorsTest plan
Files changed
templates/appkit/template/{{.project_name}}/CLAUDE.md- typegen as Step 3templates/appkit/template/{{.project_name}}/docs/frontend.md- chart children warningtemplates/appkit/template/{{.project_name}}/docs/appkit-sdk.md- data casting guidancelib/prompts/target_apps.tmpl- AppKit workflow in MCP guidance🤖 Generated with Claude Code