Dotfiles apx
Quick reference for building full-stack Databricks Apps with apx (React + FastAPI). Use when working on apx projects, creating routes, adding components, or managing dev servers.
install
source · Clone the upstream repo
git clone https://github.com/msbaek/dotfiles
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/msbaek/dotfiles "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/databricks-app-apx" ~/.claude/skills/msbaek-dotfiles-apx && rm -rf "$T"
manifest:
.claude/skills/databricks-app-apx/SKILL.mdsource content
apx Toolkit
apx is the toolkit for building full-stack Databricks Apps with React + FastAPI.
Prerequisites
Before using apx, verify the CLI is installed:
apx --version
If not installed:
- macOS/Linux:
curl -fsSL https://databricks-solutions.github.io/apx/install.sh | sh - Windows (PowerShell):
irm https://databricks-solutions.github.io/apx/install.ps1 | iex
When to Use This Skill
- Working on a project that uses apx (check for
with apx entrypoint orpyproject.toml
)databricks.yml - Creating or modifying FastAPI routes, Pydantic models, or React pages
- Managing dev servers, checking errors, or viewing logs
- Adding shadcn/ui components or frontend dependencies
- Deploying or debugging Databricks Apps
Quick Start
The project follows standard apx conventions. Use MCP tools and pattern files instead of exploring the codebase:
— Call this first to see all API routes. Do NOT read source files to explore.routes
— Search SDK docs for the method you need (e.g. "jobs list") before writing anydocs
call.ws.*- Follow patterns — See backend-patterns.md for models, routers, pagination, and DI.
— Run after adding/modifying backend routes so frontend hooks update automatically.refresh_openapi
— Run type checks to verify correctness after changes.check
Project Structure
src/<app>/ ├── ui/ # React + Vite frontend │ ├── components/ # UI components (shadcn/ui) │ ├── routes/ # @tanstack/react-router pages │ ├── lib/ # Utilities (api client, selector) │ └── styles/ # CSS styles └── backend/ # FastAPI backend ├── app.py # Main FastAPI app ├── router.py # API routes ├── models.py # Pydantic models └── core.py # Config, logging, Dependency class, bootstrap
CLI Commands
| Command | Description |
|---|---|
| Start all dev servers (backend + frontend + OpenAPI watcher) |
| Stop all dev servers |
| Check status of running servers |
| Check for TypeScript/Python errors |
| View recent logs (default: last 10m) |
| Follow/stream logs in real-time |
| Build for production |
| Run bun commands (install, add, etc.) |
| Add a shadcn/ui component |
| Add apx to an existing project as a uv workspace member |
| Apply an addon to an existing project |
Addons
Addons extend the base project with additional capabilities (UI, assistant rules, database integrations, etc.). To list available addons, run
apx dev apply --help.
To apply an addon to an existing project: apx dev apply <addon> (e.g. apx dev apply lakebase).
During apx init, addons are selected interactively or via --addons=ui,claude,sidebar.
Adding to an Existing Project
Use
--as-member to add apx into an existing Python project or monorepo as a uv workspace member:
# Recommended: explicit member path apx init --as-member=packages/app # Or just auto-detect (when pyproject.toml exists without [tool.apx]) apx init
Auto-detected: running
apx init in a directory with an existing pyproject.toml (without [tool.apx]) automatically uses member mode with default path packages/app.
The command:
- Creates app files in the member subdirectory (e.g.
)packages/app - Configures
in the root[tool.uv.workspace]pyproject.toml - Initializes git at the workspace root if needed
MCP Tools
When the apx MCP server is running, these tools are available:
| Tool | Description |
|---|---|
| Start the development server and return its URL. Call before testing UI or API changes. |
| Stop the development server. |
| Restart the development server (preserves port). Use after backend code changes. |
| Fetch recent dev server logs. Use to diagnose runtime errors or startup issues. |
| Run TypeScript and Python type checks in parallel. Returns categorized errors. Call after making changes to verify correctness. |
| List all API routes with their parameters, request/response schemas, and generated hook names. Call this first to understand the project's API surface before reading source files. |
| Get a complete frontend code example for a specific API route, including Suspense/ErrorBoundary scaffold and correct hook usage with parameters. Call this before writing any frontend code that uses an API route. Pass the operation_id from the routes tool. |
| Regenerate the OpenAPI schema and TypeScript API client from backend routes. Run after adding or modifying backend routes. |
| Semantic search for UI components across configured registries (shadcn, etc). Returns component IDs usable with add_component. |
| Install a UI component into the project. Accepts 'component-name' (default registry) or '@registry-name/component-name'. |
| List all available components in a registry. Defaults to shadcn registry if none specified. |
| Search Databricks SDK documentation for Python code examples and API references. Always call this before writing any Databricks SDK (ws.*) call to verify the correct method signature. |
| Fetch logs from a deployed Databricks App using the Databricks CLI. Use for debugging deployed (not local dev) issues. |
| Prepare a feedback issue for review. Returns the formatted title, body, and a browser URL. Call to create the GitHub issue. |
| Submit a prepared feedback issue as a public GitHub issue. Pass the exact title and body returned by . |
Recommended Workflow
- routes — List all API routes to understand the project's API surface
- get_route_info — Get a complete code example for a specific route
- search_registry_components / add_component — Find and install UI components
- refresh_openapi — Regenerate the API client after backend route changes
- check — Run type checks to verify correctness
- start / restart — Start or restart the dev server to test changes
- logs — Diagnose runtime errors if something goes wrong
Do's and Don'ts
- OpenAPI client auto-regenerates on code changes when dev servers are running — don't manually regenerate.
- Prefer running apx related commands via MCP server if it's available.
- Use the apx MCP
andsearch_registry_components
tools to find and add shadcn/ui components.add_component - When using the API calls on the frontend, use error boundaries to handle errors.
- Run
command (via CLI or MCP) to check for errors in the project code after making changes.apx dev check - If agent has access to native browser tool, use it to verify changes on the frontend. If such tool is not present or is not working, use playwright MCP to automate browser actions.
Databricks SDK
- SDK first: Always use
(databricks-sdk
) methods for Databricks operations. Never use rawWorkspaceClient
/requests
calls orhttpx
to call Databricks REST APIs.ws.api_client.do() - Verify signatures: Call the
MCP tool before writing anydocs
call to confirm the exact method name, parameters, and return type.ws.* - SDK listing methods (e.g.
,ws.jobs.list()
) return lazy iterators that auto-paginate — do NOT manually manage API pagination tokens when calling SDK methods.ws.clusters.list() - SDK dataclasses are Pydantic-compatible — use them directly in
or compose into custom models:response_model
.class MyResponse(BaseModel): payload: SdkDataclass - Inject the WorkspaceClient via
(service principal) orDependencies.Client
(OBO) — never construct it manually.Dependencies.UserClient - For paginated list endpoints, see Backend Patterns — SDK Listing with Pagination.
Package Management
- Frontend: Use
orapx bun install
for frontend package management.apx bun add <dependency> - Python: Always use
(neveruv
).pip
Component Management
- Check configured registries first: Before creating custom components, check
in[tool.apx.ui.registries]
for domain-specific registries (e.g.pyproject.toml
for chat/AI components,@ai-elements
for animations). Use@animate-ui
with the registry name to browse all available components.list_registry_components - Finding components: Use MCP
to search across all registries. Results from project-configured registries are boosted in scoring.search_registry_components - Adding components: Use MCP
or CLIadd_component
. For custom registries:apx components add <component> --yes
.@registry-name/component-name - Component location: If a component was added to a wrong location (e.g.
instead ofsrc/components/
), move it to the proper folder.src/<app>/ui/components/ - Component organization: Group components by functionality (e.g.
).src/<app>/ui/components/chat/
Reference Files
For detailed patterns and code examples, see:
- Backend Patterns — DI, 3-model pattern, CRUD routers, lifespan, AppConfig
- Frontend Patterns — Suspense, mutations, selector, component conventions
Resources
- OpenAPI client:
(auto-generated). Example:src/<app>/ui/lib/api.tsimport { api } from "@/lib/api"; - Selector:
Example:src/<app>/ui/lib/selector.tsimport { selector } from "@/lib/selector"; - Routes:
src/<app>/ui/routes/ - Components:
src/<app>/ui/components/ - Backend:
src/<app>/backend/