Pre-commit Quality Workflow

VerifiedSafe

Pre-commit quality workflow that runs tests, linters, formatters, and type checks before creating atomic commits with conventional commit messages. Automatically detects project type (TypeScript/Python), extracts issue references from conversation history, and suggests appropriate commit scopes.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#git#commit-workflow#pre-commit#testing#linting

Recommended for

Automated summary

This skill automates a pre-commit workflow that runs tests, lints, formats, and type-checks code before creating atomic commits with conventional commit messages.

Strengths

  • Ensures code quality before commits
  • automatically detects project type (TypeScript or Python)
  • supports submodules
  • extracts issue references from conversation.

Limitations

  • Only supports TypeScript and Python toolchains
  • requires specific tools like biome, ruff, uv, bun
  • may not handle all edge cases in mixed projects.
When to use it

Use when you want to commit code safely with automated checks and consistent commit messages.

When not to use it

Use when you need to commit partial work-in-progress or when the project uses unsupported languages or tools.

Security analysis

Safe
Quality score95/100

Standard pre-commit workflow using Git and development tools; no destructive, exfiltrating, or obfuscated actions.

No concerns found

How this analysis is made

Examples

Basic commit request
commit
Commit with specific area
commit my changes in src/auth/
Commit all changes from this conversation
commit all my changes

name: commit description: Pre-commit workflow - test, lint, format, type-check, atomic commits. Use when user says "commit", "/commit", or wants to commit changes. allowed-tools: Bash, Read, Glob, Grep

Commit

Pre-commit quality workflow with atomic commits.

When to Use

  • User says "commit", "/commit", "commit my changes"
  • After completing a feature or fix
  • Before pushing changes

Workflow

Execute in order. Stop on failure.

0. Scope Check

Only commit changes relevant to this conversation/thread.

  • Review the conversation history and plan file (if present)
  • Identify files created/modified as part of this task
  • Ignore unrelated changes in the working tree
  • If unsure, ask user which changes to include
# Show all changes, but only stage task-relevant files
git status

1. Detect Submodules

Check for git submodules:

git submodule status

If submodules exist with changes:

  1. Enter each submodule with changes
  2. Run full workflow (lint, format, type-check, commit) inside submodule
  3. Return to parent repo
  4. Stage submodule pointer update
# Check for submodule changes
git diff --submodule
# Enter submodule
cd <submodule-path>
# ... run workflow ...
cd ..
# Stage submodule update
git add <submodule-path>

2. Detect Project Type

Check changed files to determine toolchain:

git diff --cached --name-only
git diff --name-only
  • *.ts, *.tsx, *.js, *.jsx → TypeScript toolchain
  • *.py → Python toolchain
  • Mixed → run both toolchains

3. Run Tests

Check for test entry points in order:

1. Makefile (preferred):

make -n test 2>/dev/null && make test
# OR default target
make -n 2>/dev/null && make

2. package.json (TypeScript/JS):

# Check for test script
jq -e '.scripts.test' package.json && bun run test

3. pytest (Python):

# Check for pytest config or test files
uv run pytest

Run first available. Skip with note if none found.

4. Lint

TypeScript:

bunx biome lint --write .

Python:

uv run ruff check --fix .

5. Format

TypeScript:

bunx biome format --write .

Python:

uv run ruff format .

6. Type Check

TypeScript:

bunx tsc --noEmit

Python:

uv run ty check .
# fallback if ty unavailable:
uv run basedpyright .

7. Extract Issue References

Scan the conversation for issue references from:

  • Linear: PROJ-123, BACKEND-4ZW (uppercase prefix + alphanumeric ID)
  • GitHub: #123, org/repo#123, or GitHub issue URLs
  • Sentry: Sentry issue URLs like https://sentry.io/issues/... or issue IDs like PROJ-123

If found, include in commit message body (not title). Format:

type(scope): message

Refs: BACKEND-4ZW

For fixes that close an issue:

fix(scope): message

Closes: BACKEND-4ZW

8. Atomic Commits

Group related changes. Each feature/fix gets its own commit.

  1. Review changes: git diff
  2. Stage related files: git add <files>
  3. Commit with convention format (include issue refs if found)
  4. Repeat for remaining changes

Commit Convention

Format: type(scope): message

Scope is required - use affected area (api, auth, db, ui, cli).

| Type | Use for | |------|---------| | feat | New features | | fix | Bug fixes (reference issue: fix(auth): resolve login #123) | | refactor | Code restructuring (no behaviour change) | | perf | Performance improvements | | docs | Documentation only | | test | Adding or updating tests | | build | Build system, dependencies, CI/CD | | style | Formatting, whitespace (no logic changes) | | chore | Maintenance, config, tooling | | revert | Reverting a previous commit | | hotfix | Urgent production fixes |

Examples

# Single feature
git add src/auth/*.ts
git commit -m "feat(auth): add JWT refresh token support"

# Bug fix with GitHub issue reference
git add src/api/users.ts tests/api/users.test.ts
git commit -m "fix(api): handle null user in profile endpoint #142"

# Fix with Linear issue reference (multiline via heredoc)
git add opennem/tasks/app.py
git commit -m "$(cat <<'EOF'
fix(worker): pass WorkerSettings as positional arg

Sentry ArqIntegration expects settings_cls as args[0], not kwarg.

Closes: BACKEND-4ZW
EOF
)"

# Feature with Sentry issue reference
git add src/error-handler.ts
git commit -m "$(cat <<'EOF'
fix(errors): handle null response in API client

Refs: SENTRY-ABC123
EOF
)"

# Multiple atomic commits from one session
git add src/components/Button.tsx
git commit -m "feat(ui): add loading state to Button"

git add src/utils/format.ts
git commit -m "refactor(utils): extract date formatting helpers"

Notes

  • If lint/format changes files, re-stage before commit
  • Prefer small, focused commits over large batches
  • Keep commit messages concise (<72 chars first line)
  • Don't commit generated files, build artifacts, or secrets
  • Always check conversation for issue refs (Linear, GitHub, Sentry) and include them
  • Use Closes: for fixes, Refs: for related work

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/pre-commit-quality-workflow-mm8o51pz' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pre-commit-quality-workflow-mm8o51pz/download' --output '.skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md.part' && mv '.skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md.part' '.skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash, Read, Glob, Grep

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md' && test -s '.skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/commit' && cp -R '.skill-downloads/pre-commit-quality-workflow-mm8o51pz' '.claude/skills/commit'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/pre-commit-quality-workflow-mm8o51pz'

openskills read 'pre-commit-quality-workflow-mm8o51pz'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/pre-commit-quality-workflow-mm8o51pz/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills