Skip to content

Conversation

@keugenek
Copy link
Contributor

@keugenek keugenek commented Jan 9, 2026

Summary

Fixes critical documentation issues causing ~90% build failure rate in LLM-generated AppKit apps.

Changes:

  1. Chart components: Clarified that AppKit charts do NOT accept children (Recharts pattern doesn't work)
  2. Typegen step: Made npm run typegen a required explicit step after schema changes
  3. Data casting: Added critical guidance that useAnalyticsQuery data must be cast manually
  4. MCP guidance: Added AppKit workflow to target_apps.tmpl so agents see it during databricks_discover

Root causes addressed:

  • Agents using <BarChart><Bar .../></BarChart> → TypeScript errors (charts don't accept children)
  • Agents skipping npm run typegen → "not assignable to type" errors
  • Agents using data?.map() without casting → "Property 'map' does not exist on type '{}'" errors

Test plan

  • Manual testing with app generation
  • Iteration 1: Build 11% → docs in template only
  • Iteration 2: Build 10% → typegen/casting docs added
  • Iteration 3: Build 0% → confirmed agents skip template docs
  • Iteration 4: Testing with MCP guidance (in progress)

Files changed

  • templates/appkit/template/{{.project_name}}/CLAUDE.md - typegen as Step 3
  • templates/appkit/template/{{.project_name}}/docs/frontend.md - chart children warning
  • templates/appkit/template/{{.project_name}}/docs/appkit-sdk.md - data casting guidance
  • lib/prompts/target_apps.tmpl - AppKit workflow in MCP guidance

🤖 Generated with Claude Code

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 <[email protected]>
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Jan 9, 2026

Commit: bd4e486

Run: 20964242915

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 17 2 383 685 27:36
🟨​ aws windows 10 14 2 385 683 22:07
🟨​ aws-ucws linux 3 21 2 534 562 42:44
🟨​ aws-ucws windows 6 18 2 536 560 37:41
💚​ azure linux 19 3 383 684 32:04
🟨​ azure windows 4 15 3 385 682 23:29
💚​ azure-ucws linux 19 3 530 561 52:31
🟨​ azure-ucws windows 4 15 3 532 559 44:18
💚​ gcp linux 19 3 372 690 30:51
🟨​ gcp windows 4 15 3 374 688 28:03
26 interesting tests: 15 RECOVERED, 10 KNOWN, 1 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K
💚​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🟨​ TestAccept/bundle/generate/alert 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K
🟨​ TestAccept/bundle/generate/alert/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K
🟨​ TestAccept/bundle/generate/alert/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K
💚​ TestAccept/bundle/resources/alerts/basic 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 🟨​K 🟨​K 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestExport 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestExportWithFileFlag 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestImportDir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestImportDirDoesNotOverwrite 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestImportDirWithOverwriteFlag 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestImportFileFormatAuto 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestImportFileFormatSource 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 46 slowest tests (at least 2 minutes):
duration env testname
8:51 azure-ucws linux TestAccept/bundle/resources/synced_database_tables/basic
8:24 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
8:22 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
7:10 azure-ucws windows TestAccept/bundle/resources/synced_database_tables/basic
6:48 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic
6:27 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:48 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:35 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:24 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:13 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic
4:27 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:20 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:01 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
3:17 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
3:06 azure-ucws windows TestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:47 aws-ucws linux TestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
2:41 azure-ucws windows TestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=direct
2:37 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=yes/PY=yes/READPLAN=
2:34 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:30 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:30 azure-ucws windows TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no/READPLAN=
2:29 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes/READPLAN=
2:23 azure-ucws linux TestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
2:23 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes/READPLAN=
2:22 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=no/READPLAN=
2:18 azure linux TestAccept
2:18 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:16 gcp linux TestAccept
2:15 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:14 azure-ucws windows TestAccept/bundle/resources/experiments/basic/DATABRICKS_BUNDLE_ENGINE=terraform
2:14 azure-ucws linux TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.11
2:14 azure-ucws linux TestAccept
2:13 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:13 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:11 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no/READPLAN=
2:11 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:08 azure-ucws windows TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=yes/NBOOK=yes/PY=yes/READPLAN=
2:08 azure-ucws windows TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes/READPLAN=
2:07 azure-ucws windows TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=no/READPLAN=
2:04 aws-ucws windows TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=yes/READPLAN=
2:04 azure-ucws windows TestAccept/bundle/resources/experiments/basic/DATABRICKS_BUNDLE_ENGINE=direct
2:04 azure linux TestAccept/bundle/resources/models/basic/DATABRICKS_BUNDLE_ENGINE=direct
2:03 aws-ucws linux TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.10
2:02 aws-ucws linux TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.13
2:01 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=yes/READPLAN=

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 <[email protected]>
**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`**
Copy link
Contributor

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**
Copy link
Contributor

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

@ditadi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree!

Copy link

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 <[email protected]>
@keugenek keugenek force-pushed the fix/appkit-docs-for-llms branch from 2aab02a to f5f1230 Compare January 12, 2026 12:10
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 <[email protected]>
@keugenek keugenek force-pushed the fix/appkit-docs-for-llms branch from c5ec8c8 to 88ff134 Compare January 13, 2026 15:28
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 <[email protected]>
@keugenek keugenek force-pushed the fix/appkit-docs-for-llms branch from 88ff134 to 5bc4642 Compare January 13, 2026 16:00
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants