Favorite stack
Coding conventions and patterns for the favorite-stack web app template: Node.js 24, TypeScript via tsgo (@typescript/native-preview), Vite, Vitest, SQLite (better-sqlite3), Alpine.js v3, Pico.css v2, Pino logger, oxlint, oxfmt, pnpm. Always use this skill when working in a project that has vite, alpinejs, better-sqlite3, or pino in package.json — even if the user doesn't mention the stack by name. Also use proactively when scaffolding any new web app, writing TypeScript, adding a database, or setting up logging in this project.From its SKILL.md
npx -y skills add oharato/favorite-stack --skill favorite-stackAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.3 KB, as published. Nobody here has run it
Favorite Stack
This skill captures the conventions and non-obvious rules for the favorite-stack. Most mistakes happen around the TypeScript toolchain, ESM imports, and SQL safety — focus there first.
Stack at a Glance
| Category | Tool |
|---|---|
| Runtime | Node.js 24 (ESM, using keyword) |
| Language | TypeScript — type-check with tsgo, not tsc |
| Pkg mgr | pnpm (never npm/yarn) |
| Bundler | Vite — target es2024 |
| Testing | Vitest — co-locate *.test.ts |
| Database | SQLite via better-sqlite3 |
| Frontend | Alpine.js v3 + Pico.css v2 |
| Logging | Pino (never console.log) |
| Lint/Fmt | oxlint + oxfmt |
Commands
pnpm dev # Vite dev server
pnpm build # Production build
pnpm test # Vitest single run
pnpm test:watch # Vitest watch
pnpm lint # oxlint src/
pnpm fmt # oxfmt src/
pnpm typecheck # tsgo --noEmit
pnpm check # lint + fmt + typecheck (run before committing)
Critical Rules (Common Mistakes)
These are the rules most likely to be violated — check these first in any code review.
1. Use tsgo, never tsc
tsgo --noEmit # ✅
tsc --noEmit # ❌ — wrong compiler
2. Always use .js extensions in imports
ESM requires explicit extensions at runtime. Bundler resolution doesn't save you in all contexts.
import { logger } from './lib/logger.js'; // ✅
import { logger } from './lib/logger'; // ❌ breaks at runtime
3. import type for type-only imports
verbatimModuleSyntax: true is enabled — the compiler will error otherwise.
import type { User } from './types.js'; // ✅
import { User } from './types.js'; // ❌ type-only import must use `import type`
4. Never console.log — use Pino
oxlint enforces no-console. Use the logger singleton instead.
import { logger } from './lib/logger.js';
logger.info({ userId }, 'User created'); // ✅
console.log('User created'); // ❌ lint error
5. Never string-interpolate SQL
SQL injection risk and no type safety. Always use prepared statements.
// ✅
const getUser = db.prepare<[number], User>('SELECT * FROM users WHERE id = ?');
const user = getUser.get(userId);
// ❌
db.prepare(`SELECT * FROM users WHERE id = ${userId}`).get();
6. Use pnpm, never npm or yarn
pnpm add <pkg> # ✅
npm install <pkg> # ❌
Project Structure
src/
├── main.ts # Entry point
├── app.ts # App setup / route mounting
├── db/
│ ├── index.ts # DB connection — WAL mode, FK ON
│ └── migrations/ # 001_init.sql, 002_add_users.sql, …
├── routes/ # One file per resource
├── middleware/
└── lib/
├── logger.ts # Pino singleton
└── errors.ts # AppError / NotFoundError / ValidationError
Useful Patterns (Quick Reference)
For full examples, read the relevant reference file.
TypeScript — references/typescript.md
satisfiesoperator,unknownnarrowing,usingfor resources
SQLite — references/sqlite.md
- DB setup, prepared statements, transactions, migrations
Frontend — references/frontend.md
- Alpine.js state/components, Pico.css semantic HTML, card/form patterns
Logging & Errors — references/logging-errors.md
- Pino setup, child loggers, typed error classes