Skip to main content
code-quality Maintain code quality using Biome linting, formatting, and git hooks. Use this when the user asks about linting errors, code formatting, Biome configuration, fixing code style issues, organizing imports, or ensuring code quality standards before commits.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/ruchernchong/is-leap-year --skill code-qualityThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... Related occupations SOC
Based on SOC occupation classification
name code-quality description Maintain code quality using Biome linting, formatting, and git hooks. Use this when the user asks about linting errors, code formatting, Biome configuration, fixing code style issues, organizing imports, or ensuring code quality standards before commits. allowed-tools Read, Edit, Grep, Glob, Bash
Code Quality Skill
This Skill helps maintain code quality using Biome for linting and formatting in the IsLeapYear project.
When to Use
Fixing linting errors
Formatting code
Configuring Biome rules
Organizing imports
Resolving code style issues
Understanding git hooks (Husky + lint-staged)
Pre-commit quality checks
Code Quality Stack
Primary Tools:
Biome 2.3.7 - Linting and formatting (replaces ESLint + Prettier)
Husky 9.1.7 - Git hooks
lint-staged 16.2.7 - Run linters on staged files
commitlint - Enforce conventional commits
NOT Used:
Biome Commands
pnpm biome check .
pnpm biome check --write .
pnpm biome format --write .
pnpm lint
Biome Configuration
Located in biome.json at project root:
Key Settings {
"formatter" : {
"enabled" : true ,
"indentStyle" : "space" ,
"indentWidth" : 2
} ,
"javascript" : {
"formatter" : {
"quoteStyle" : "double" ,
"semicolons" : "always"
}
} ,
"linter" : {
"enabled" : true ,
"rules" : {
"recommended" : true
}
} ,
"organizeImports" : {
"enabled" : true
}
}
Important Rules {
"style" : {
"noUnknownProperty" : "off"
}
}
{
"nursery" : {
"useSortedClasses" : "error"
}
}
Git Hooks (Husky) Configured in .husky/ directory:
Pre-commit Hook Runs lint-staged on all staged files:
#!/usr/bin/env sh
. "$(dirname -- "$0 " ) /_/husky.sh"
pnpm lint-staged
Detects staged files
Runs Biome formatting on them
Blocks commit if errors found
Auto-fixes and stages changes
Commit Message Hook Validates commit messages using commitlint:
#!/usr/bin/env sh
. "$(dirname -- "$0 " ) /_/husky.sh"
npx --no -- commitlint --edit ${1}
type(scope): subject
# Examples:
feat(api): add batch year validation endpoint
fix(ui): correct mobile navigation layout
docs(readme): update installation instructions
Commitlint Configuration Located in .commitlintrc.json:
Valid Types
feat - New feature
fix - Bug fix
docs - Documentation changes
style - Code style (formatting, whitespace)
refactor - Code refactoring
perf - Performance improvements
test - Adding tests
build - Build system changes
ci - CI/CD changes
chore - Maintenance tasks
revert - Revert previous commit
Rules {
"extends" : [ "@commitlint/config-conventional" ] ,
"rules" : {
"header-max-length" : [ 2 , "always" , 100 ]
}
}
lint-staged Configuration {
"lint-staged" : {
"**/*" : "biome check --write --no-errors-on-unmatched"
}
}
Runs on all staged files
Auto-fixes with --write
Ignores unmatched files
Organizes imports
Formats code
Fixes linting issues
Common Tasks
1. Fix All Linting Errors
pnpm biome check .
pnpm biome check --write .
2. Format Specific Files
npx biome format --write src/app/page.tsx
npx biome format --write src/components/
3. Organize Imports Biome automatically organizes imports when running:
pnpm biome check --write .
External packages
Internal modules (using @/ alias)
Relative imports
Type imports (if separate)
4. Skip Git Hooks (Emergency Only)
git commit --no-verify -m "emergency fix"
git commit -n -m "quick fix"
⚠️ Use sparingly - Hooks ensure code quality
5. Fix Tailwind Class Order Biome enforces sorted Tailwind classes:
<div className="text-white bg-blue-500 p-4 rounded" >
<div className ="rounded bg-blue-500 p-4 text-white" >
Biome vs ESLint/Prettier
⚡ 25x faster than ESLint
🔧 Single tool for linting + formatting
📦 Zero config required
🎯 Built-in import organization
🔒 Type-safe configuration
Some custom ESLint rules
Plugin ecosystem (smaller than ESLint)
IDE Integration
VS Code Install the official Biome extension:
{
"editor.defaultFormatter" : "biomejs.biome" ,
"editor.formatOnSave" : true ,
"editor.codeActionsOnSave" : {
"quickfix.biome" : "explicit" ,
"source.organizeImports.biome" : "explicit"
}
}
Troubleshooting
"Biome check failed"
Run pnpm biome check . to see errors
Run pnpm biome check --write . to auto-fix
Check biome.json for rule configuration
Review error messages for manual fixes
"Commit message doesn't follow convention" Format: type(scope): subject
git commit -m "fixed bug"
git commit -m "fix(api): handle invalid year parameters"
"lint-staged failed"
Check which files failed: pnpm lint-staged
Run Biome directly: pnpm biome check --write .
Stage fixed files: git add .
Retry commit
Best Practices
Run checks before committing:
pnpm biome check --write .
Let hooks work: Don't bypass with --no-verify unless emergency
Write conventional commits: Follow the type(scope): subject format
Fix issues immediately: Don't accumulate linting errors
Use auto-fix: Biome handles most issues automatically
Keep config minimal: Rely on Biome's recommended rules
CI/CD Integration GitHub Actions runs checks on all PRs:
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
✅ Pass Biome linting
✅ Build successfully
✅ Use conventional commits
Important Notes
This project uses pnpm , not npm/yarn/bun
Biome configuration is in biome.json
Git hooks are in .husky/ directory
Commitlint config is in .commitlintrc.json
All hooks run automatically on commit
Biome is faster and simpler than ESLint + Prettier combined
The project maintains strict code quality standards
More from this repository Develop and test API routes in the Next.js App Router. Use this when the user asks to create, modify, test, or debug API endpoints, handle API responses, validate request parameters, or work with the /api directory.
Analyze leap year calculations, calendar systems, and date validation logic. Use this when the user asks about leap year rules, calendar types (Gregorian, Julian, Hebrew, Chinese), year range validation (1582-9999), mathematical formulas, or needs to understand the core leap year detection algorithms.
Optimize SEO, metadata, structured data, and search engine visibility. Use this when the user asks about meta tags, Open Graph, Twitter Cards, Schema.org markup, sitemap.xml, robots.txt, social media previews, or improving search engine rankings.