| name | val-town-dev |
| description | This skill should be used when the user asks to "create a val", "make a val town project", "build a val", "deploy to val town", "set up a val", "clone a val", "remix a val", or mentions Val Town, vals, or the vt CLI. Provides Val Town platform knowledge, standard libraries, and vt CLI workflows. |
| user-invocable | true |
Val Town Development
Create, develop, and deploy vals on Val Town using the vt CLI.
Core Workflow
Creating a New Val
vt create <valName> [targetDir]
Options:
--public (default), --private, --unlisted for visibility
--org-name <org> to create under an organization
-d, --description <desc> to set a description
--upload-if-exists to upload existing files in the target directory
After creation, cd into the val directory and run vt watch to sync changes.
Cloning an Existing Val
vt clone <username/valName> [targetDir]
Accepts a username/valName or a full https://www.val.town/x/username/valName URL.
Remixing a Val
vt remix <fromValUri> [newValName] [targetDir]
Bootstrap from existing vals. Example: vt remix std/reactHonoStarter myWebsite
Development Loop
vt watch — auto-syncs local changes to Val Town
vt browse — opens the val in a browser
vt tail — streams logs for debugging
vt push — pushes local changes (use -d for dry run)
vt status — shows working tree status
Branching
vt checkout -b my-branch
vt branch
vt checkout main
Val Types (Triggers)
Every val exports a default function. The function signature determines the trigger type.
HTTP Trigger
export default async function (req: Request) {
return new Response("Hello World");
}
Cron Trigger
export default async function () {
}
Email Trigger
export default async function (email: Email) {
}
Key Platform Constraints
Standard Libraries (Quick Reference)
Val Town provides hosted services importable via https://esm.town/v/std/:
| Library | Import | Purpose |
|---|
| Blob | https://esm.town/v/std/blob | Key-value storage (JSON, text, binary) |
| SQLite | https://esm.town/v/std/sqlite@14-main/main.ts | Persistent SQL database |
| OpenAI | https://esm.town/v/std/openai | GPT completions (pre-configured) |
| Email | https://esm.town/v/std/email | Send emails to val owner |
| Utils | https://esm.town/v/std/utils/index.ts | serveFile, readFile, listFiles |
For detailed usage examples, API patterns, and project structure guidance, consult references/platform-guide.md.
Typical Project Structure
├── backend/
│ ├── database/
│ │ ├── migrations.ts
│ │ └── queries.ts
│ ├── routes/
│ │ └── [route].ts
│ └── index.ts # Main entry point
├── frontend/
│ ├── components/
│ │ └── App.tsx
│ ├── index.html
│ ├── index.tsx
│ └── style.css
└── shared/
└── utils.ts # Shared types (no Deno keyword here)
Development Checklist
Before pushing a val:
Additional Resources
Reference Files
For detailed library examples, Hono patterns, and platform gotchas, consult:
references/platform-guide.md — Full Val Town platform guide with code examples for all standard libraries, utility functions, backend patterns, and common pitfalls