agentsclimarketplace

Favorite stack

Skill oharato/favorite-stack/skills/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

Install
npx -y skills add oharato/favorite-stack --skill favorite-stack

Assembled 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

CategoryTool
RuntimeNode.js 24 (ESM, using keyword)
LanguageTypeScript — type-check with tsgo, not tsc
Pkg mgrpnpm (never npm/yarn)
BundlerVite — target es2024
TestingVitest — co-locate *.test.ts
DatabaseSQLite via better-sqlite3
FrontendAlpine.js v3 + Pico.css v2
LoggingPino (never console.log)
Lint/Fmtoxlint + 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

  • satisfies operator, unknown narrowing, using for 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

Keep looking

Skills are one crate of 608,475. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.