搜索

PythonReactSEOPDF
GitHub Skill

checking-code-quality

Automated lint and test smoke check workflow for code quality verification. Triggers when user requests code quality checks, lint execution, test validation, or smoke testing. Use for pre-commit checks or quality gates.

skyasu2☆ 1 仓库 Stars1 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Lint & Test Smoke Check

Target Token Efficiency: 62% (300 tokens → 114 tokens)

Purpose

Automated lint + test workflow for quick code quality verification without manual commands.

Trigger Keywords

  • "check code quality"
  • "quality check"
  • "run lint and tests"
  • "lint check"
  • "smoke check"
  • "verify code"
  • "validate code"
  • "pre-commit check"
  • "quality gate"
  • "코드 검증"
  • "test파일 실행"
  • "품질 체크"

Context

  • Project: OpenManager VIBE v5.85.0
  • Test Framework: Vitest v4.0.15
  • Linter: Biome v2.3.8 (lint + format)
  • Current Pass Rate: 98.2% (134/134 tests)
  • Fast Test Target: < 25초 (current: ~21초)

Workflow

0. Pre-Check: Biome Configuration

Verify Biome settings:

# Check Biome configuration
cat biome.json | head -30

Expected Configuration:

  • ✅ linter.enabled: true
  • ✅ formatter.enabled: true
  • ✅ TypeScript strict mode: enforced via tsconfig.json
  • ✅ noExplicitAny: via TypeScript compiler

If Missing:

⚠️ Warning: Biome 설정 누락 감지
권장: biome.json 확인 필요
  - linter.enabled: true
  - formatter.enabled: true
1. Run Lint Check
npm run lint

Expected Output:

  • ✅ No Biome errors
  • ⚠️ Warnings acceptable if < 5개
  • ❌ Errors require immediate fix

Auto-Fix Detection:

If errors are detected, check for auto-fixable issues:

# Attempt auto-fix for common issues
npx biome check --write .

# Re-verify after auto-fix
npm run lint

Common Auto-Fixable Issues:

  • Formatting inconsistencies
  • Import order violations
  • Trailing whitespace
  • Unused imports

Manual Fix Required:

  • TypeScript type errors (via npm run type-check)
  • Logic errors in code flow
  • Complex refactoring needs
2. Run Fast Tests
npm run test:quick

Expected Metrics:

  • Duration: < 25초 (current: ~21초)
  • Pass Rate: ≥ 98% (134/134)
  • Failed Tests: < 5개
3. Analyze Results

If All Pass:

  • ✅ Code quality verified
  • ✅ Ready for commit
  • Action: Proceed with git commit

If Lint Fails:

  • ❌ Fix Biome errors first
  • Run: npx biome check --write . (if auto-fixable)
  • Re-run lint check

If Tests Fail:

  • 📊 Check failure count vs baseline (80 failed)
  • ⚠️ New failures: Investigate immediately
  • ✅ Same failures: Known issues, can proceed
4. Report Summary

Format:

🧪 Smoke Check Results
├─ Lint: ✅ Pass / ❌ Fail (N errors)
├─ Tests: ✅ 134/134 (98.2%) / ⚠️ X/134 (Y%)
├─ Duration: Xs (target: <25s)
└─ Status: ✅ Ready / ⚠️ Review / ❌ Fix Required

Token Optimization Strategy

Before (Manual):

User: "코드 품질 체크해줘"
Assistant: [reads package.json, explains lint, explains test, runs commands, parses output, formats report]
Tokens: ~300

After (Skill):

User: "check code quality"
Skill: [executes workflow, reports summary]
Tokens: ~114 (62% reduction)

Efficiency Gains:

  • ❌ No need to explain npm scripts
  • ❌ No need to read test config
  • ✅ Direct command execution
  • ✅ Structured output format

Edge Cases

Case 1: Timeout

  • If test > 30초: Stop and report timeout
  • Likely cause: Environment issue
  • Action: Check WSL resources, restart dev server

Case 2: Zero Tests Run

  • Possible config issue
  • Check: vitest.config.ts
  • Verify: setupFiles path correct

Case 3: All Tests Fail

  • Critical environment issue
  • Check: Node.js version (v22.21.1)
  • Check: Dependencies installed (npm ci)

Success Criteria

  • Lint: 0 errors (Biome)
  • Tests: Pass rate ≥ 98%
  • Duration: < 25초
  • No manual intervention required

Related Skills

  • performance/next-router-bottleneck.md - If performance issues detected
  • playwright/triage.md - If E2E tests need debugging

Changelog

  • 2025-12-22: v1.2.1 - Version sync with project v5.85.0
  • 2025-12-12: v1.2.0 - Tech stack upgrade alignment
    • Vitest 3.2.4 → 4.0.15
    • ESLint → Biome v2.3.8 migration
    • Updated test metrics (98.2% pass rate)
    • Updated auto-fix commands for Biome
  • 2025-11-24: v1.1.0 - Enhanced trigger coverage (Phase 1.1 Optimization)
    • Added 2 new trigger keywords: "quality check", "lint check" (10 → 12 total)
    • Improved Skill discoverability and auto-activation
  • 2025-11-08: Enhanced with auto-fix detection and ESLint config verification (Phase 1 Optimization)
    • Added 5 new trigger keywords (10 total)
    • Added auto-fix suggestion logic for common issues
    • Added ESLint strict mode configuration verification
  • 2025-11-04: v1.0.0 - Initial implementation (Phase 1)

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!