agentleFS
xenodevexenodeve/xeno-skills/skills/qwen38/qwen38-code-gate/SKILL.md

qwen38-code-gate

Skill2 starsChanged 2 months agoMITView on GitHub

Done-gate for any code change by a small model. Run it before saying a change is finished: the brief table for code (the test that goes red then green, the error path, the doc line, no new dependency), then six commands with pass conditions — scope of the diff, placeholders, secrets, the repo's tests with the last line pasted, lint/typecheck if configured, and the RED line before the GREEN one. Slice 1 of xeno-skills #355.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    4. The repo's tests, last line pasted: Use the repo's own command (python -m pytest -q, npm test, bun test, go test ./..., cargo test).

    line 47
  2. Distinctive:

    Never install a package or a tool to satisfy a check.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Code gate (qwen38-code-gate)

Run this before you say a code change is finished. Fill the table, run every command, paste each output. A check you did not run is a check that failed. Report CODE GATE: n/6 with the outputs under it.

0. Brief table — before the first edit

the brief names or impliesfile(s) that deliver it
each change the brief asks forthe file and function
a test that fails before the change and passes afterthe test file — always a row, even when the brief does not say "test"
the error paths — one row each: wrong type · negative or out of range · empty · missing file or keywhere each raises or returns, and the test for each. (2026-09-05 16:49: with one combined row the model tested garbage input and skipped the negative amount the hidden test caught; enumerated rows are the fix)
the doc line, if the repo has a README or docstrings for this areathe line
new dependencynone unless the brief allows one; write "none"

Edit only the files in the right-hand column. Anything else you think needs changing goes in the report as a note, not in the diff.

1–6. The checks

D is the diff of your change: git diff if the repo is a git checkout (make a commit or git add -N . first so new files show), otherwise the list of files you wrote.

1. Scope. Pass: every path printed is in the brief table.

git diff --name-only HEAD

2. No placeholders. Pass: nothing prints. (The bare-stub half is its own alternative: ^\+ cannot appear in the middle of an alternation, and while it did, + pass never matched and the gate printed a passing placeholders 0 over a stub-filled diff. Found in review 2026-09-06.)

git diff HEAD | grep -nE "^\+\s*(pass|\.\.\.)\s*$|^\+.*(TODO|FIXME|XXX|NotImplemented|raise NotImplementedError|console\.log\(\"debug|print\(\"debug)"

3. No secrets or machine paths. Pass: nothing prints.

git diff HEAD | grep -nE "^\+.*((api[_-]?key|secret|token|password)\s*[:=]\s*['\"][^'\"]{8,}|C:\\\\Users\\\\|/home/[a-z]+/)"

4. The repo's tests, last line pasted. Use the repo's own command (python -m pytest -q, npm test, bun test, go test ./..., cargo test); do not invent one. Pass: the last line reports 0 failed and the count is not lower than before your change.

python -m pytest -q 2>&1 | tail -3

5. Lint / typecheck when the repo has a config. Pass: exits 0, or write "no config" when none of these files exists: pyproject.toml [tool.ruff], .eslintrc*, eslint.config.*, tsconfig.json, .flake8, mypy.ini.

ls pyproject.toml .eslintrc* eslint.config.* tsconfig.json .flake8 mypy.ini 2>/dev/null

Then the matching command: ruff check . · npx eslint . · npx tsc --noEmit · flake8 · mypy .

6. RED before GREEN. Paste the test command's last line from before you changed the source (the new test failing) and from after (passing). If you wrote the test after the code, write "test written after code" — that is a fail of this check, not a reason to hide it.

Report

THINK: assumptions <k> · flaws checked 3 · found <n> · pushback: <yes: the line | no>   <- first, from qwen38-think, when it was loaded
CODE GATE: n/6  (scope ok · placeholders 0 · secrets 0 · tests: <last line> · lint: <ok|no config> · red-then-green: yes)
brief table: k rows, all filled

A brief the three-flaw check found impossible does not get a CODE GATE: 6/6; it gets the Pushback: line, the possible part, and an honest gate for that part. Paste the six outputs under it. CODE GATE: 6/6 with no outputs is not a pass.

Rules that apply here as everywhere (using-qwen38)

Never install a package or a tool to satisfy a check; if the command is missing, write one line saying so and continue. Never spawn an agent. Stop at the report.

What this does not touch

How to design the change, name things, or structure a module — karpathy-guidelines and the repo's own conventions own that. This file only says whether a change may be called finished.

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.