agentleFS
thebiglaskowskithebiglaskowski/claude-sentient/.claude/skills/quality-gates/SKILL.md

quality-gates

Skill2 starsChanged 7 months agoMITView on GitHub

Use when a lint, test, or build gate fails during the VERIFY phase and you need the auto-fix procedure, when you need to classify an error and choose a fix strategy, or when WebSearch fallback is needed after repeated gate failures.

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use plan.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 14 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a gate fails, attempt automatic repair (max 3 attempts per gate):

    line 24
  2. Very specific:

    If profile has fix_command for this gate: run it, re-verify

    line 39
  3. Very specific:

    If no fix_command or it didn't resolve: read error, apply manual fix, re-verify

    line 40
  4. Distinctive:

    If error count increases after any attempt: revert changes and stop

    line 42
  5. Distinctive:

    If all 3 attempts fail: fall through to WebSearch strategy

    line 43
  6. Distinctive:

    Never modify test assertions or expected values to make tests pass

    line 47
  7. Distinctive:

    Never skip or disable quality gates

    line 48
  8. Distinctive:

    If fix introduces new errors, revert immediately

    line 49
  9. Distinctive:

    When auto-fix exhausts 3 attempts:

    line 54
  10. Distinctive:

    If solution found: apply fix automatically

    line 58
  11. Distinctive:

    If still failing after 2 WebSearch attempts: stop and report

    line 59
  12. Very specific:

    GitHub: Check CI status on PRs (passing/failing/pending)

    line 64
  13. Distinctive:

    After committing on a branch with a PR:

    line 69
  14. Distinctive:

    Check if current branch has an open PR

    line 70
  15. Distinctive:

    If PR exists, monitor CI:

    line 71
  16. Very specific:

    Default is atomic (single checkpoint commit).

    line 80
  17. Distinctive:

    Never modify test assertions: When tests fail, fix the source logic, not the expected values.

    line 92
  18. Distinctive:

    Error count regression: If auto-fix attempt increases the error count, revert immediately.

    line 95

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Quality Gates Skill

Reference material for executing quality gates during /cs-loop VERIFY phase.

Gate Execution Order

GateActionPass Criteria
LINTRun lint command from profileZero errors
TESTRun test command from profileAll tests pass
BUILDRun build command if definedClean compilation
GITCheck git statusClean working state

Advisory gates (report only, non-blocking): TYPE, DOCS, SECURITY.

Auto-Fix Sub-Loop

When a gate fails, attempt automatic repair (max 3 attempts per gate):

Error Classification

Error TypeFix Strategy
Lint (auto-fixable)Run fix_command from profile gates (e.g., ruff check . --fix)
Import orderingRun format/sort command from profile gates
Type errorsRead file at error location, fix type annotations
Test failuresRead failing test + source under test, fix logic in source
Build errorsRead compiler output, fix compilation issues

Procedure

  1. Gate fails -> classify error type from output
  2. If profile has fix_command for this gate: run it, re-verify
  3. If no fix_command or it didn't resolve: read error, apply manual fix, re-verify
  4. Maximum 3 attempts per gate. Track: [VERIFY] Auto-fix attempt {n}/3: {gate}
  5. If error count increases after any attempt: revert changes and stop
  6. If all 3 attempts fail: fall through to WebSearch strategy

Hard Constraints

  • Never modify test assertions or expected values to make tests pass
  • Never skip or disable quality gates
  • If fix introduces new errors, revert immediately
  • Report each attempt: [VERIFY] Auto-fix attempt {n}/3: {gate} -- {strategy}

WebSearch Fallback

When auto-fix exhausts 3 attempts:

  1. Extract error message from gate output
  2. WebSearch("{language} {error_message} fix 2026")
  3. If solution found: apply fix automatically
  4. If still failing after 2 WebSearch attempts: stop and report

MCP Integration

  • Puppeteer (web projects): Navigate -> screenshot after UI changes
  • GitHub: Check CI status on PRs (passing/failing/pending)
  • Vision: Capture and analyze error screenshots for UI test failures

CI Monitoring (Post-Commit)

After committing on a branch with a PR:

  1. Check if current branch has an open PR
  2. If PR exists, monitor CI:
    • Passing -> [COMMIT] CI passed
    • Pending -> [COMMIT] CI running... (continue)
    • Failing -> Auto-fix if lint/test/type error (max 2 attempts)
    • Infrastructure failure -> Report for manual review

Commit Strategies

See references/commit-strategies.md for per-file and per-task commit strategies. Default is atomic (single checkpoint commit). Override via --commit-strategy argument or CLAUDE.local.md.

Advisory: Browser Verification (web projects)

Trigger: Web project profile AND Playwright/puppeteer MCP connected Action: Navigate to dev server, take screenshot, validate against task intent Blocking: No (advisory only) Gotcha: Dev server must be running. If not, attempt npm run dev or equivalent in background, wait 5s, then screenshot.

Gotchas

  • Never dismiss errors as "pre-existing": Fix ALL lint issues during VERIFY — even if they existed before your changes. If ruff reports it, fix it. This is an Integrity Rule.
  • Never modify test assertions: When tests fail, fix the source logic, not the expected values. If tests are genuinely wrong, report to the user rather than "fixing" assertions.
  • post-tool-observer null exit_code: Claude Code's PostToolUse may omit exit_code (yields null). post-tool-observer treats null as inconclusive (passed: null), not failure. Don't log spurious "Gate failed (exit null)" entries.
  • Large gate output truncation: Stdout > 8000 chars is saved to .claude/state/gate-output/ and replaced with a reference. If you see outputRef in gate_history.json instead of raw output, read the referenced file.
  • Error count regression: If auto-fix attempt increases the error count, revert immediately. Don't try to "fix forward" — the fix introduced new problems.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.