Skip to content

Commit f5f1230

Browse files
keugenekclaude
andcommitted
Add AppKit TypeScript workflow to MCP target_apps guidance
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>
1 parent 11e3d3a commit f5f1230

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

cli-linux

-48.4 MB
Binary file not shown.

cli-linux-arm64

-48.9 MB
Binary file not shown.

experimental/aitools/lib/prompts/target_apps.tmpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@
77

88
## Databricks Apps Development
99

10+
### CRITICAL: AppKit TypeScript Workflow (for TypeScript/AppKit apps)
11+
12+
After scaffolding an AppKit app, follow this workflow for EVERY query you add:
13+
14+
1. Create SQL file: `config/queries/my_query.sql`
15+
2. Add schema: `config/queries/schema.ts` → add entry to `querySchemas`
16+
3. **RUN: `npm run typegen`** - REQUIRED to regenerate types
17+
4. Use data with explicit cast:
18+
```typescript
19+
const { data } = useAnalyticsQuery('my_query', {});
20+
const typedData = data as MyType[] | undefined; // REQUIRED cast
21+
typedData?.map(...) // Now TypeScript works
22+
```
23+
24+
⚠️ **Common build failures (avoid these):**
25+
- Skipping `npm run typegen` after schema changes → "not assignable to type" errors
26+
- Using `data?.map()` without casting → "Property 'map' does not exist on type '{}'" errors
27+
- Using `<BarChart queryKey="..."><Bar.../></BarChart>` → charts DON'T accept children
28+
1029
### Validation
1130
⚠️ Always validate before deploying:
1231
invoke_databricks_cli 'experimental aitools tools validate ./'

0 commit comments

Comments
 (0)