Task: Create a New Hudson App
Context
You are building an app for the Hudson workspace platform. Read docs/building-apps.md and packages/hudson-sdk/src/types/app.ts before starting.
Inputs
- App name: (e.g., “Glyph Editor”)
- App ID: (e.g., “glyph-editor”)
- Description: (e.g., “Vector glyph editor with family overview and detail editing”)
- Frame mode:
canvasorpanel - Panels needed: left, right, both, or none
- Canvas participation:
nativeorwindowed
Steps
-
Create directory:
app/apps/{app-id}/ -
Create Provider (
{Name}Provider.tsx):- Define context interface with all app state
- Create context +
use{Name}()hook - Export Provider component wrapping children with context
-
Create Content slot (
{Name}Content.tsx):- Import and use the app context hook
- Render main UI
-
Create panel slots (if needed):
{Name}LeftPanel.tsx— navigation, tools, project tree{Name}RightPanel.tsx— inspector, properties
-
Create hooks (
hooks.ts):use{Name}Commands()— return CommandOption[] for paletteuse{Name}Status()— return { label, color }- Optional:
use{Name}Search(),use{Name}NavCenter(),use{Name}LayoutMode()
-
Create intents (
intents.ts, optional):- Declare AppIntent[] with commandId matching CommandOption.id values
- Include keywords for fuzzy matching
-
Create app definition (
index.ts):- Import all pieces
- Export const satisfying HudsonApp interface
-
Register in workspace:
- Add to
app/workspaces/hudsonOS.tsor create new workspace file - If new workspace, register in
app/page.tsx
- Add to
-
Test:
- Run
bun dev - Verify app renders in workspace
- Test command palette commands (Cmd+K)
- Test panel toggle
- Test intent execution if applicable
- Run
Validation Checklist
- App implements
HudsonAppinterface - Provider wraps state correctly
-
useCommandsreturns valid CommandOption[] -
useStatusreturns valid { label, color } - Intent commandIds match command IDs
- App registered in workspace
- No purple colors used
- No library UI components (custom only)
- Uses bun, not npm/pnpm