Agent skill

precommit-fast

Quick pre-commit checks — lint:fix -> test

Stars 139
Forks 18

Install this agent skill to your Project

npx add-skill https://github.com/sd0xdev/sd0x-dev-flow/tree/main/skills/precommit-fast

SKILL.md

Pre-Commit Checks (Fast)

Trigger

  • Keywords: precommit fast, quick precommit, lint and test, precommit-fast

When NOT to Use

  • Full precommit with build step (use /precommit)
  • Verification loop (use /verify)
  • Just running tests (run directly)

Workflow Steps

Step Goal Safety Skip if Missing
lint-fix Auto-fix code style issues read-write yes
test-unit Run fast test suite read-only yes

Failure behavior: continue-all (run all steps, report all results)

Task

Run quick pre-commit checks: lint:fix -> test (no build step)

Step 1: Check for runner script

Use Glob to check if .claude/scripts/precommit-runner.js exists in the project root.

  • Found → run: node .claude/scripts/precommit-runner.js --mode fast --tail 60
    • If runner succeeds, use its output and skip to the Output section.
    • If runner fails, treat as a real precommit failure (do not silently fallback).
  • NOT foundAuto-install attempt:
    1. Node.js gate: Use Glob to check if package.json exists. If no package.json → skip, fall through to Step 2.
    2. Locate plugin scripts: 3-level Glob fallback (short-circuit on first match):
      • Glob: ~/.claude/plugins/**/sd0x-dev-flow/scripts/precommit-runner.js
      • Glob: ${REPO_ROOT}/node_modules/sd0x-dev-flow/scripts/precommit-runner.js
      • Plugin-relative: try reading @scripts/precommit-runner.js
    3. Plugin not found → fall through to Step 2.
    4. Plugin found → copy runner + lib/utils.js (skip on conflict) → run.

Step 2: Fallback (no runner script)

Detect the project ecosystem to run steps manually.

Manifest Ecosystem Lint-fix Test
package.json Node.js {pm} lint:fix {pm} test:fast / test:unit / test
pyproject.toml Python ruff check --fix . pytest tests/unit/
Cargo.toml Rust cargo clippy --fix cargo test
go.mod Go golangci-lint run --fix go test ./...
build.gradle Java ./gradlew spotlessApply ./gradlew test
pom.xml Java (Maven) mvn spotless:apply mvn test
Gemfile Ruby bundle exec rubocop -a bundle exec rspec

After lint:fix completes, run git diff --name-only to capture auto-fixed files.

Output

markdown
## Precommit (fast)

## Results

| Step | Status | Notes |
|------|--------|-------|
| lint:fix | ✅/❌/⏭️ | skipped if no script |
| test | ✅/❌/⏭️ | skipped if no script |

## Changed Files (after lint:fix)

- <files or "(none)">

## Overall: ✅ PASS / ❌ FAIL

## Checklist

- [ ] All available checks pass
- [ ] git status reviewed

Expand your agent's capabilities with these related and highly-rated skills.

sd0xdev/sd0x-dev-flow

runbook

Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).

139 18
Explore
sd0xdev/sd0x-dev-flow

ask

Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code trace (use code-explore). Output: structured answer with source attribution.

139 18
Explore
sd0xdev/sd0x-dev-flow

project-brief

Convert a technical spec into a PM/CTO-readable executive summary. Simplify technical details, focus on business value.

139 18
Explore
sd0xdev/sd0x-dev-flow

codex-test-gen

Generate unit tests for specified functions using Codex MCP

139 18
Explore
sd0xdev/sd0x-dev-flow

bug-fix

Bug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev), understanding code (use code-explore). Output: fix + regression test + review gate.

139 18
Explore
sd0xdev/sd0x-dev-flow

skill-health-check

Validate skill quality against routing, progressive loading, and verification criteria. Use when: auditing skills, checking skill health, reviewing skill design. Not for: code review (use codex-code-review) or doc review (use doc-review). Output: health report with per-skill ratings + Gate.

139 18
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results