Index of every page on this site: llms.txt
All skills
acedergren avatar

/quality-commit

@641a79b
Run it yourself

Use when committing code changes. Runs lint, typecheck, Semgrep security scan, optional CodeRabbit review, and related tests before creating a quality-gated commit. Flags: --review, --push, --dry-run, --message. Keywords: commit, quality gates, lint, typecheck, semgrep, coderabbit, stage, push. Triggers on "commit changes" or "run quality commit".

Use this Skill: https://skilld.dev/gh/acedergren/agentic-tools/quality-commit

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈91 tokens for metadata: the name and description. ≈867 when used: this file. ≈1.7k more on demand in 1 file.

Description uses 4.6% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈366 characters, or 4.6%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Quality Commit

When to Use

Load this skill when the user request matches the frontmatter description for Quality Commit.

Run all quality gates on staged changes, then commit. Replaces manual multi-step commit prep that frequently causes pre-commit hook friction.

NEVER

  • Never run git add . or git add -A — always stage specific files by name.
  • Never commit after partial gate failures by bypassing hooks — gates exist for correctness.
  • Never let optional tools (CodeRabbit, Semgrep) block the workflow when not installed — skip with warning.
  • Never widen scope to unrelated repo cleanup during commit prep.
  • Never attempt to auto-fix gate failures and retry — report errors, let the agent fix first.

Decision: What Gates to Run

Has staged files?
├─ No → Print warning, exit
└─ Yes →
    ├─ Always: Lint → TypeCheck → Semgrep → Tests → Commit
    ├─ --review or --full: Add CodeRabbit (slow, ~30s) before commit
    └─ --push: After commit, Semgrep committed files, push to remote

Gate Execution

Scope detection

STAGED=$(git diff --cached --name-only --diff-filter=ACMR)
bash scripts/classify-staged-files.sh  # categorizes into frontend/api/shared

Semgrep: file-at-a-time (critical workaround)

Semgrep 1.146.0+ crashes with multiple file arguments (Invalid_argument: invalid path). Always loop:

for f in $STAGED_FILES; do
  semgrep scan --config auto --json "$f" 2>/dev/null || true
done

Block on critical/high findings. Warn on medium/low. Skip if not installed.

TypeCheck workspace commands

  • frontend: npx svelte-check --tsconfig ./tsconfig.json --threshold error (if the repo has a documented baseline of known errors, compare against it rather than ignoring errors)
  • api: npx tsc --noEmit
  • shared: npx tsc --noEmit

Related test discovery

node scripts/find-related-tests.js <staged-file>
# src/lib/server/auth/rbac.ts → src/lib/server/auth/rbac.test.ts

Run discovered tests: npx vitest run <test-files> --reporter=verbose

Commit message format

type(scope): description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Types: feat, fix, refactor, test, docs, chore Scopes: security, phaseX.Y, api, frontend, database, auth, workflows

Push flow (--push only)

  1. Re-run Semgrep on committed files (same file-at-a-time loop, use git diff --name-only HEAD~1)
  2. Detect upstream: git rev-parse --abbrev-ref @{u} 2>/dev/null
  3. If no upstream: git push -u origin $BRANCH, else git push
  4. Abort push on critical/high Semgrep findings — commit stays intact, do NOT undo it

Summary table

| Gate       | Status | Details                    |
|------------|--------|----------------------------|
| Lint       | PASS   | 5 files, 0 errors          |
| TypeCheck  | PASS   | api + frontend             |
| Semgrep    | PASS   | 0 findings                 |
| CodeRabbit | SKIP   | (use --review to enable)   |
| Tests      | PASS   | 3 test files, 12 tests     |
| Commit     | DONE   | abc1234                    |
| Push       | SKIP   | (use --push to enable)     |

Arguments

  • (empty): lint + typecheck + semgrep + tests + commit
  • --review / --full: Add CodeRabbit review
  • --dry-run: Run all gates, skip actual commit and push
  • --push: Commit then semgrep + push to remote
  • --message "...": Use custom commit message

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning7mo5 checks · Risk SAFE
  • Gen Agent Trust Hub8mo

    The skill automates quality gates for git commits, including linting, type checking, security scanning, and testing. It is safe for its intended purpose but contains a potential surface for indirect prompt injection as it processes untrusted code content from staged changes.

  • Socket8mo

    No alerts

  • Snyk8mo

    Risk: LOW · No issues

  • Runlayer8mo

    3/4 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 641a79b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 2 months ago

README badge

README badge for acedergren/agentic-tools/quality-commit