From 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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/favorite-stack:favorite-stackThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill captures the conventions and non-obvious rules for the 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.
| 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 |
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)
These are the rules most likely to be violated — check these first in any code review.
tsgo, never tsctsgo --noEmit # ✅
tsc --noEmit # ❌ — wrong compiler
.js extensions in importsESM 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
import type for type-only importsverbatimModuleSyntax: 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`
console.log — use Pinooxlint 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
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();
pnpm, never npm or yarnpnpm add <pkg> # ✅
npm install <pkg> # ❌
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
For full examples, read the relevant reference file.
TypeScript — references/typescript.md
satisfies operator, unknown narrowing, using for resourcesSQLite — references/sqlite.md
Frontend — references/frontend.md
Logging & Errors — references/logging-errors.md
npx claudepluginhub oharato/favorite-stack --plugin favorite-stackScaffolds boilerplate for APIs (FastAPI, Express), web apps (Next.js, Nuxt, SvelteKit), CLI tools, libraries, monorepos with best-practice stacks and directory structures.
Implements features, fullstack code, and UI/API/DB changes for TypeScript/React/Next.js or Python/FastAPI apps using service layers, standard stacks, and 4-state UI patterns.
Automates fullstack scaffolding, code quality analysis, and enforces best practices. Includes scripts and reference guides for tech stacks, architecture, and workflows.