Back to list
motlin

precommit

by motlin

A Claude Code skill for tracking and completing tasks from a markdown task list

2🍴 3📅 Jan 24, 2026

SKILL.md


name: precommit description: Running precommit checks and build validation. ALWAYS use after ANY code changes.

Precommit and Build Validation

🔋 Battery Check

CRITICAL: Before running any build or test commands, check if the machine is on battery power:

scripts/check-battery || { echo "⚡ Skipping precommit on battery power"; exit 0; }
just precommit
  • If on battery power, skip the build and report: "⚡ Skipped precommit checks (on battery power)"
  • If on AC power, proceed with the build

⚙️ Running Precommit

Run just precommit to validate code:

  • Use a timeout of at least 10 minutes
  • Don't check if the justfile or recipe exists first
  • This command typically runs autoformatting, builds, tests, and other quality checks

📋 Handle Missing Recipe

If the command fails because the justfile doesn't exist or the 'precommit' recipe is not defined, clearly explain this situation. Indicate whether the justfile file is missing or whether just the precommit recipe is missing.

❌ Handle Check Failures

When precommit fails (due to: type checking errors, test failures, linting issues, build errors):

  • Analyze the error output to understand what failed
  • Fix the specific failures
  • Run the precommit command again
  • Continue the fix-and-retry cycle until precommit completes successfully with exit code 0

✅ Reporting Results

Your final message MUST start with one of:

  • "⚡ Skipped precommit checks (on battery power)" - if skipped due to battery
  • "✅ Precommit checks passed" - if ran successfully
  • "✅ Precommit checks passed (after fixing [brief description])" - if fixed issues

Agents

TaskUse
Run precommit and fixbuild:precommit-runner agent
Test all branch commits/build:test-branch command
Test and autosquashbuild:build-fixer-autosquash agent

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon