agentleFS
daniel-kindldaniel-kindl/dkstack/skills/setup-quality-gates/SKILL.md

setup-quality-gates

Skill1 starsChanged 19 days agoMITView on GitHub

Use when a repository lets warnings pass, has no CI or has checks that are not deterministic. One building block of bootstrap. Makes warnings errors, sets up CI on every push and pull request, makes the checks deterministic and copies the dkstack format checks.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If the language has no such option, add a CI check that fails on any warning.

    line 15
  2. Distinctive:

    Write the tag in a comment next to the checks in CI, so that a later update knows the source.

    line 37
  3. Distinctive:

    Add the seven checks to CI.

    line 38
  4. Very specific:

    Add the title steps. On a pull request, run node scripts/check-title.mjs --event.

    line 43
  5. Very specific:

    Run node scripts/check-dashes.mjs and node scripts/check-writing.mjs in CI.

    line 44
  6. Distinctive:

    Do not change the copied scripts.

    line 47
  7. Distinctive:

    If it is not on, add a secret scanner to CI.

    line 51
  8. Distinctive:

    Keep pull request titles, bodies and author logins out of step environments and logs.

    line 55
  9. Distinctive:

    Read the event file inside each check.

    line 56
  10. Distinctive:

    Do not start subagents for this skill.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Set up quality gates

A building block of bootstrap. Use it alone, or as a step of bootstrap. Do not weaken an existing quality gate. See coding/quality-gates.md.

Steps

  1. Configure the build so warnings are errors and the build produces zero warnings and zero hints.
    • Set the compiler or build option that treats warnings as errors.
    • If the language has no such option, add a CI check that fails on any warning.
  2. Set up CI that:
    • Runs on every push to the default branch and on every pull request
    • Installs dependencies
    • Runs the full check (build, test, lint)
    • Fails if any warning or error appears
  3. Ensure deterministic checks:
    • Pin dependency versions where practical.
    • Make test and build output stable.
    • Fail the build on any non-zero warning count.
    • Follow coding/naming.md. Configure naming rules that native tools can check reliably, such as supported Roslyn, ESLint or Ruff rules. Run those checks in CI as errors. An .editorconfig file alone does not enforce naming in every language. Leave unsupported or semantic rules to review.
    • Follow coding/types.md. Turn on the strict settings of the type checker and the lint rules that it names. Run the type check in CI as an error.
  4. Copy the dkstack format checks:
    • Copy check-maps.mjs, check-context.mjs, check-adrs.mjs, check-title.mjs, check-dashes.mjs, check-writing.mjs and check-links.mjs into scripts/ from a fixed dkstack release tag, for example v1.6.0. The source URL is https://raw.githubusercontent.com/daniel-kindl/dkstack/<tag>/scripts/<name>. Do not copy them from main, from v1 or from a URL at run time. Copy markdown-files.mjs too, because check-dashes.mjs and check-writing.mjs import it. Copy pr-event.mjs too, because check-title.mjs imports it. See ADR 0001.
    • Write the tag in a comment next to the checks in CI, so that a later update knows the source.
    • Add the seven checks to CI. The checks are required. A failed check blocks the merge.
    • The scripts need Node.js and no package. Fetch the Git history for the ADR check.
    • On a pull request, run node scripts/check-adrs.mjs --base "$BASE_SHA". Set BASE_SHA in the step environment to the target commit.
    • On a push, set BASE_SHA to the commit before the push. Use HEAD~1 if git cat-file -e "$BASE_SHA^{commit}" cannot find it. Run the same ADR command.
    • A missing docs/maps/ folder or a missing CONTEXT.md is a pass. The repository may not have them yet.
    • Add the title steps. On a pull request, run node scripts/check-title.mjs --event. For each commit of a push, run node scripts/check-title.mjs -- "<commit title>".
    • Run node scripts/check-dashes.mjs and node scripts/check-writing.mjs in CI.
    • Copy check-consumer.mjs and the hash list dkstack-hashes.json from the same tag. Run node scripts/check-consumer.mjs in CI. It checks the dkstack setup of the repository, and it checks each copied script against the hash list for the tag. It needs no network.
    • Run node scripts/check-links.mjs in CI. It checks only the local links and skips each dkstack URL. To check the dkstack URLs and anchors too, clone the dkstack branch v1 to a folder outside the repository and run node scripts/check-links.mjs . --dkstack-root <clone>. The check maps each raw or blob URL to a file in the clone. The clone must be the same ref as the ref in the links, for example v1. A link on a tag, such as v1.6.0, is checked against the same clone, so use one ref in all links.
    • Do not change the copied scripts. To update them, copy them again from a newer tag.
  5. Secret scanning: follow coding/security.md.
    • If the code host has push protection and it is on, add no secret scan to CI. The setting meets the rule. For a repository that has history from before the setting was on, run one scan of the full history with a pinned scanner. Push protection does not find a secret that is already in the history. setup-repo-protection turns it on.
    • If it is not on, add a secret scanner to CI. Run it on the full history. Pin the scanner by version and SHA-256.

Check pull request text in CI

Keep pull request titles, bodies and author logins out of step environments and logs. Read the event file inside each check. See the event file example.

Subagents

Do not start subagents for this skill. Reason: this is one building block. bootstrap can check it in a subagent. See the subagent guide.

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.