-
Notifications
You must be signed in to change notification settings - Fork 10
Add commit skill for quality-gated commits #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds a Claude Code skill that enforces code quality before committing: - Checks formatting with ruff format - Runs linting with ruff check - Executes unit tests - Auto-generates commit messages Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a Claude Code /commit skill that quality-gates commits by running formatting, linting, and unit tests before generating a commit message and committing staged changes.
Changes:
- Add a new
commitskill definition with step-by-step quality gates (ruff format, ruff lint, pytest). - Add commit-message generation guidelines and a standardized commit execution flow.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Reorders quality checks to run linting before formatting, matching the CI pipeline order in .github/workflows/ci.yml. Adds a re-verify step after auto-fixes to prevent commits that pass locally but fail CI when lint fixes introduce formatting issues. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
| 3. If yes, run: `uv run --frozen ruff check . --fix` | ||
| 4. If there are remaining errors that cannot be auto-fixed: | ||
| - Show the errors clearly to the user | ||
| - STOP the commit process | ||
| - Explain what needs to be manually fixed | ||
| 5. If all errors were auto-fixed: | ||
| - Stage the fixes by running `git add` only on the files that were fixed |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step says to “git add only on the files that were fixed” but doesn’t specify a deterministic way to identify those files. Without a concrete command sequence, the assistant may stage the wrong set of files (or have to guess). Consider adding explicit instructions to capture the changed file list after ruff check --fix (e.g., via git diff --name-only) and git add exactly those paths.
| 3. If yes, run: `uv run --frozen ruff check . --fix` | |
| 4. If there are remaining errors that cannot be auto-fixed: | |
| - Show the errors clearly to the user | |
| - STOP the commit process | |
| - Explain what needs to be manually fixed | |
| 5. If all errors were auto-fixed: | |
| - Stage the fixes by running `git add` only on the files that were fixed | |
| 3. If yes, and you may have other modified files in the working tree, first capture the current set of changed files: | |
| ```bash | |
| git diff --name-only | sort > /tmp/before_ruff.txt |
Then run the auto-fix:
uv run --frozen ruff check . --fixAfter the fix, capture the new set of changed files and compute exactly which files were modified by Ruff:
git diff --name-only | sort > /tmp/after_ruff.txt
comm -13 /tmp/before_ruff.txt /tmp/after_ruff.txt > /tmp/ruff_fixed.txt- If there are remaining errors that cannot be auto-fixed:
- Show the errors clearly to the user
- STOP the commit process
- Explain what needs to be manually fixed
- If all errors were auto-fixed:
-
Stage only the files modified by Ruff:
git add $(cat /tmp/ruff_fixed.txt)
-
| Run the linting check first (matches CI order in .github/workflows/ci.yml): | ||
|
|
||
| ```bash | ||
| uv run --frozen ruff check . | ||
| ``` |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI runs uv run --frozen ruff check . --preview (see .github/workflows/ci.yml). This skill uses ruff check . without --preview, so it may report a clean lint locally but fail CI if preview-only rules are enabled/changed. Align the command here (and the --fix variant) with CI by including --preview (or explicitly justify why it’s omitted).
| ```bash | ||
| uv run --frozen ruff check . | ||
| uv run --frozen ruff format --check . | ||
| ``` |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When re-running lint after auto-fixes, the skill again omits --preview even though CI includes it. To keep the “re-verify after auto-fixes” step faithful to CI (and avoid CI-only failures), update this re-run command to match the CI invocation as well.
Adds a Claude Code skill that enforces code quality before committing: