Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
21
Quick reference for AI agents performing quality assurance tasks in this monorepo.
Sign in to like and favorite skills
Quick reference for AI agents performing quality assurance tasks in this monorepo.
# Quality gates (run ALL before committing) bun run typecheck:all # Type checking bun run test # All tests (Vitest) bun run lint # ESLint bun run format:check # Prettier # Fix issues bun run lint:fix # Auto-fix lint bun run format # Auto-format # Single file/package testing npx vitest run <path> # Run specific test bun run test:watch # Watch mode bun run test:sqlite # SQLite tests only
⚠️ NEVER use
— incompatible with Vitest APIs (bun test
vi.hoisted, vi.mocked, jsdom).
Before any commit:
| Gate | Command | Requirement |
|---|---|---|
| Types | | Zero errors |
| Tests | | All pass |
| Lint | | No errors |
| Format | | Clean |
All four must pass. No exceptions.
jsdom for browser simulationdescribe, it, expect without imports)| Category | Minimum |
|---|---|
| API routes | 80% |
| Business logic | 90% |
| Utilities | 70% |
| UI components | 60% |
const { default: routes } = await import("../../routes/api-keys") const app = new Hono() app.onError(testErrorHandler) app.route("/api/api-keys", routes) const response = await app.request("/api/api-keys/ep_123/keys") expect(response.status).toBe(200)
vi.mock("../../lib/db", () => ({ getDb: vi.fn(() => mockDb), })) beforeEach(() => vi.clearAllMocks())
any without justification commentunknown + type guards over any@ts-ignore — use @ts-expect-error with linked issue if unavoidable! non-null assertions — handle nullability properly// Bad: any const data: any = await fetch(url) // Good: unknown + guard const data: unknown = await fetch(url) if (isUser(data)) { /* typed */ } // Bad: assertion const user = data as User // Good: validation const user = UserSchema.parse(data)
| Type | Convention | Example |
|---|---|---|
| Variables | camelCase | |
| Constants | UPPER_SNAKE | |
| Functions | camelCase | |
| Types | PascalCase | |
| Files | kebab-case | |
| Components | PascalCase | |
Prefix with underscore:
function handler(_req: Request, res: Response) { // _req intentionally unused }
# Database cd packages/db && bun run migrate # Gateway binary cd packages/gateway && bun run build:binary # Desktop app cd apps/desktop && bun run tauri:dev # API server cd apps/api && bun run dev # Platform cd apps/platform && bun run dev
<type>(<scope>): <subject> Types: feat, fix, refactor, test, docs, chore Scope: package or app name
Examples:
feat(gateway): add trace collectionfix(api): handle null user IDtest(db): add migration tests@types/*)tsconfig.json includesnpx vitest run <file>beforeEach?)bun run lint:fix first.eslintrc for rule configUse the structured logger from
@athreei/shared instead of console.log/error/warn:
import { createLogger, honoLogger } from "@athreei/shared" // Create service logger const logger = createLogger({ service: "api", level: process.env.LOG_LEVEL || "info", pretty: process.env.NODE_ENV !== "production", }) // Use structured logging logger.info("Operation completed", { userId, duration }) logger.warn("Rate limit approaching", { current: 95, limit: 100 }) logger.error("Database error", { error, query }) // For Hono apps, use middleware app.use("*", honoLogger({ logger })) // Access request-scoped logger in routes const log = c.get("logger") log.info("Processing request") // Includes requestId
| Level | Use for |
|---|---|
| Detailed debugging (disabled in production) |
| Normal operations, startup messages |
| Recoverable issues, deprecation notices |
| Errors requiring attention |