Skip to content
Agentmart
Submit a tool

gate-and-fix

Use on a feature branch that is getting ready to commit, when lint, unit, integration, coverage, and diff gates must pass and failures must be remediated from…

Skill by asura1234

IndexedApache-2.0★ 1
Write a review

Chalk Labs

Need help deploying gate-and-fix?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/asura1234-gate-and-fix

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use on a feature branch that is getting ready to commit, when lint, unit, integration, coverage, and diff gates must pass and failures must be remediated from complete failure evidence (the main agent decides whether to fix them itself or dispatch subagents), committing and pushing round by round until the branch converges.

Use cases: testing, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/gate-and-fix

What's inside

Skill name
gate-and-fix
Description
Use on a feature branch that is getting ready to commit, when lint, unit, integration, coverage, and diff gates must pass and failures must be remediated from complete failure evidence (the main agent decides whether to fix them itself or dispatch subagents), committing and pushing round by round until the branch converges.
License
Apache-2.0
Instructions
90 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (22)

  • SKILL.md
  • guide.md
  • coverage-policy.json · references/
  • gate-round-format.md · references/
  • lint-policy.toml · references/
  • bus_quality.py · scripts/
  • coverage_run.py · scripts/
  • gate_and_fix.py · scripts/
  • gate_artifact.py · scripts/
  • gate_process.py · scripts/
  • profile_report.py · scripts/
  • requirements.txt · scripts/
  • bus_quality_test.py · scripts/tests/
  • coverage_instrumentation_test.py · scripts/tests/
  • coverage_pool_exact_counts_test.py · scripts/tests/
  • coverage_pool_test.py · scripts/tests/
  • gate_and_fix_test.py · scripts/tests/
  • profile_crash_recovery_test.py · scripts/tests/
  • profile_legacy_upgrade_test.py · scripts/tests/
  • profile_lifecycle_test.py · scripts/tests/
  • profile_path_test.py · scripts/tests/
  • profile_report_test.py · scripts/tests/

SKILL.md (first lines)

Resolve `SKILL_DIR` to the directory containing this loaded SKILL.md; keep the working directory in the target repository.
# Gate and Fix

Read [guide.md](guide.md) and [gate-round-format.md](references/gate-round-format.md) completely.

```text
INPUT = [--base <immutable commit>] [--command "<repo gate command>"]

repo   = git rev-parse --show-toplevel
branch = git branch --show-current
IF caller base is absent: run `git fetch origin` before refreshing its default.
base   = caller-provided immutable commit, otherwise resolve origin's default branch with:
  python3 "<SKILL_DIR>/../rebase-origin-main/scripts/rebase_base.py" --repo "<repo>" --refresh-default
STOP if base resolution fails; never assume master/main.
command = caller-provided --command, otherwise policy.gate_command from the fresh repo scan.
The runner owns scanning; missing configuration is STOP "no gate configured", never PASS.

Run the branch guard (it uses the full origin symbolic ref, never --short):
  python3 "<SKILL_DIR>/../rebase-origin-main/scripts/rebase_base.py" --repo "<repo>" --base HEAD --check-branch "<branch>"
IF it fails: STOP with stderr.
IF git status --porcelain --untracked-files=all is nonempty
  STOP "The worktree is not clean; commit or remove every tracked and untracked change first."
IF git diff --name-only <base>...HEAD is empty
  STOP "There are no committed changes against the base."

branch_slug = branch with every character outside [A-Za-z0-9_-] replaced by `-`
artifact_root = <absolute Git common directory>/bus/gate-and-fix/<branch_slug>
round = 1
LOOP:
  Run:
    python3 "$SKILL_DIR/../gate-and-fix/scripts/gate_and_fix.py" \
      --repo "<repo>" --base "<base>" --round "<round>" \
      --artifact-root "<artifact_root>" [--command "<caller command>"]

  Capture the runner exit code and its sole stdout line as artifact.
  IF exit code NOT IN {0, 1}
    STOP with stderr; do not read an old artifact.

  Run:
    python3 "$SKILL_DIR/../gate-and-fix/scripts/gate_and_fix.py" verify \
      --artifact "<artifact>" --base "<resolved base commit>"
  IF verification fails
    STOP with the artifact; do not infer an outcome from Markdown.

  IF exit code == 0
    Assert verifier output is PASS; BREAK.
  Assert verifier output is FAIL.

  Run:
    python3 "$SKILL_DIR/../gate-and-fix/scripts/gate_and_fix.py" list \
      --artifact "<artifact>" --base "<resolved base commit>"
  IF list fails
    STOP with the artifact; do not infer failed gates from Markdown.
  Capture its one-name-per-line stdout as failed gates.

  FOR each listed failed gate and each stream IN {stdout, stderr}
    Run:
      python3 "$SKILL_DIR/../gate-and-fix/scripts/gate_and_fix.py" show \
        --artifact "<artifact>" --base "<resolved base commit>" \
        --gate "<gate>" --stream "<stream>"
    Capture its exact stdout as that stream's remediation evidence.

  Group all failed gate evidence by writable owner.

  For a coverage failure, read and apply code-review-guide "Never pad coverage with a tautology"
  through guide.md "Coverage-failure remediation" before choosing a repair.
  IF the coverage gap is reported rather than repaired
    STOP with the FAIL artifact and the reason; reporting does not waive the gate.

  **How the remediation is orchestrated is main's own decision**: fix sequentially itself,
  dispatch subagents grouped by owner, or mix the two. The basis is how large the failure surface
  is, whether the owners are genuinely disjoint, and how much context main has left: one or two
  small fixes are usually faster to do directly, because dispatching costs a brief and a context
  rebuild; dispatching pays off only when failures span several mutually disjoint owners and every
  group carries substantial work. This skill does not prescribe a shape, nor does it presume that
  parallel is faster.

  Hard constraints when delegating (however many groups): each subagent receives only its own
  group's artifact identity, exact owned paths, and decoded logs; it changes only files inside its
  own allowlist; it performs no Git mutation; it returns its changed files and blockers. Evidence
  with overlapping owners must be in the same group — two agents writing the same file is a STOP,
  not something to coordinate.

  After every remediation has been collected, main inspects the combined delta.

  IF any owner is unsafe/unclear, any group overlaps, a blocker is reported, or no intended
     remediation changed the worktree
    STOP with the artifact and blocker; do not retry an identical tree.

  Invoke `commit-and-push` once. It owns the only Git mutation of this round. Increment round and
  repeat the complete profile-selected gate set plus the diff gate on the clean committed tree. For the Bus adapter, never run the live
  end-to-end check here. Never run only a selected subset in a later round.

RETURN the final PASS artifact, its base/head, selected gate command, and all round commits.
A missing gate is a reported configuration blocker, never successful verification.
```

From asura1234/bus, Apache-2.0.

More from asura1234/bus

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Oct 24, 2026 (7 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from asura1234

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get gate-and-fix running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying gate-and-fix?

CallGet help
Cite this page

gate-and-fix skill. Agent Mart. https://agentmart.dev/skills/asura1234-gate-and-fix (last updated 2026-10-24)