npx skills add ...
npx skills add denoland/skills --skill deno-project-templates
Use when scaffolding new Deno projects. Provides templates for Fresh web apps, CLI tools, libraries, and API servers with modern best practices.
npx skills add denoland/skills --skill deno-project-templates
This skill provides templates for creating new Deno projects with modern best practices.
This skill applies only when the user asks for a Deno project. Follow these rules:
Choose the appropriate template based on what you want to build:
| Type | Use Case | Key Files |
|---|---|---|
| Fresh web app | Full-stack web application with Fresh framework | main.ts, routes/, islands/ |
| CLI tool | Command-line application | main.ts with arg parsing |
| Library | Reusable package to publish on JSR | mod.ts, mod_test.ts |
| API server | Backend API without frontend | main.ts with HTTP handlers |
For full-stack web applications, use the Fresh initializer:
This creates:
deno.json - Project configuration and dependenciesmain.ts - Server entry pointclient.ts - Client entry point (CSS imports)vite.config.ts - Vite build configurationroutes/ - Pages and API routes (file-based routing)islands/ - Interactive components that get JavaScript on the clientcomponents/ - Server-only components (no JavaScript shipped)static/ - Static assets like images, CSSDevelopment: Fresh uses Vite. The dev server runs at http://localhost:5173
(not port 8000).
Create a command-line application with argument parsing.
Template files: See assets/cli-tool/ directory.
Create a reusable package for publishing to JSR.
Template files: See assets/library/ directory.
Remember: Replace @username with your JSR username before publishing.
Create a backend API without a frontend.
Template files: See assets/api-server/ directory.
After creating project files:
| Project Type | Start Development | Build/Compile |
|---|---|---|
| Fresh | deno task dev (port 5173) | deno task build |
| CLI | deno task dev | deno task compile |
| Library | deno test | N/A |
| API | deno task dev | N/A |
When ready to deploy:
deno task build && deno deploy --proddeno task compile (creates standalone binary)deno publish (publishes to JSR)deno deploy --prodjsr: imports for Deno packages (the old URL-based imports are
deprecated)deno fmt and deno lint regularly