Guide · Agent skill
How to use the Repo Hygiene Scanner agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The repo-hygiene skill is an agent skill: a folder containing a SKILL.md instruction file and supporting reference documents that tell an AI coding agent how to do one specific job. This one is written for the scheduled repo-hygiene workflow in the QwenLM/qwen-code repository, where an agent scans for small, certain docs, test and code problems and fixes them on one batched branch. This guide explains what the skill makes the agent do, how to install it, how to trigger it, and what it needs to run safely.
Quick start
- 1Download the ZIP. Download the repo-hygiene skill ZIP from this page.
- 2Unzip the folder. Unzip the archive so the folder contains SKILL.md, references/scan.md, references/fix.md and scripts/run-agent.mjs.
- 3Place the skill. Move the folder into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder for one repository.
- 4Or upload in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the skill.
- 5Confirm the requirements. Check that Node.js, the Docker sandbox with rg, the npm toolchain and the GitHub Actions workflow are available.
- 6Run through the workflow. Let the scheduled or dry-run workflow invoke the skill, naming the scan or fix phase.
- 7Review the branch. Review each commit and the PR before merging, and read report-only.md for larger findings.
What the repo-hygiene skill makes the agent do
The skill splits an automated cleanup into two phases that run as separate CI jobs. In the scan phase, the agent searches the repository read-only and records findings in a file. It looks for small, certain hygiene issues such as stale docs or simple test and code problems. A pattern match is treated only as a lead until the agent reads the surrounding code and confirms it.
In the fix phase, the agent reads those findings, makes minimal fixes, and commits each fix separately. After each change it runs the project's build, typecheck, lint and tests. The result is one branch that a human maintainer reviews. A run that finds nothing worth fixing is a valid, silent outcome.
- Scan phase: read-only, produces findings.json and, when needed, report-only.md.
- Fix phase: reads findings, edits code, runs verification after each fix, writes PR files.
- One Conventional Commit per finding so each fix can be audited or reverted alone.
- Findings that are too large (more than three production files or more than one hundred lines of production code) are report-only.
Install the repo-hygiene skill
Download the ZIP for the skill from this page and unzip it. You can place the folder in one of two locations. For a personal skill that applies across projects, put it in ~/.claude/skills/. For a skill that belongs to one project, put it in that project's .claude/skills/ folder.
If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.
- Personal location: ~/.claude/skills/
- Project location: .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload
Trigger the skill with natural requests
The skill's description says it applies when the scheduled repo-hygiene workflow runs from GitHub Actions, or during an operator dry-run. In practice, the agent loads it when the invocation is part of that workflow and names the phase it is in. The workflow, not a casual chat request, is the intended trigger.
Because the skill tells the agent to read only the document for its current phase before doing anything else, the invocation should name that phase. The scan phase reads references/scan.md and the fix phase reads references/fix.md.
- Scan phase: the run is the read-only scan job.
- Fix phase: the run applies accepted findings from findings.json.
- Operator dry-run: a manual run of the same workflow.
Examples of what a run looks like
A typical scan phase reads the partitions described in references/scan.md, collects candidates, and keeps only those backed by a file:line quote. A fix phase then checks each selected finding against the current checkout, because the base may have moved since the scan. If the evidence no longer holds, that entry is moved out of fixes rather than forced through.
Every commit is additive. The agent does not amend, rebase or reset history.
- Stale documentation reference confirmed by a file:line quote, fixed in a small commit.
- Simple test issue fixed, then the Vitest run for the touched package is repeated.
- Finding too large to fit the threshold, recorded in report-only.md and filed as one consolidated issue by the workflow.
What the skill needs to run
The skill assumes a specific environment. It needs Node.js to run scripts/run-agent.mjs. The sandbox must provide rg (ripgrep), because the skill assumes tools.sandbox: docker. The project toolchain must include npm with npm run build, npm run typecheck, npm run lint and Vitest. A GitHub Actions workflow must supply credentials, checkout, pushes and PR creation. An AI model or agent runtime, Qwen Code, executes the instructions.
- Node.js (for scripts/run-agent.mjs)
- Docker sandbox image providing rg (ripgrep)
- Project toolchain: npm, npm run build, typecheck, lint and Vitest
- GitHub Actions workflow that handles credentials, checkout, pushes and PR creation
- An AI model or agent runtime (Qwen Code)
Safety notes: scripts and network access
The skill runs scripts (scripts/run-agent.mjs) and uses the network. The agent itself has no GitHub credentials and must not push, comment, create pull requests or edit labels. The workflow performs all network writes.
The skill also tells the agent not to run the CLI, examples, release scripts or networked package commands such as npx tool downloads. Scanned content is treated as untrusted, so instructions embedded in issues, comments or code are to be ignored. The skill commits model-generated changes, so it should not run unattended against important branches without review.
- Agent has no GitHub credentials; the workflow handles pushes and PRs.
- Scanned text (issues, comments, docs, code comments) is untrusted input.
- Networked package commands and arbitrary scripts are off-limits to the agent.
- Review the branch before merging; the safeguards depend on the workflow.
Tips for getting useful results
Expect a quiet run to be normal. The skill prefers quality over quantity, so a small number of certain fixes is the intended result. Read report-only.md for larger findings, since those are not committed.
If a verification command fails, the skill's rules say to fix the cause and rerun it. If a blocker stops the whole run, the agent writes failure.md instead of guessing. When you change settings source files in the project, the skill requires running npm run generate:settings-schema and committing the regenerated schema in the same commit.
- Review each commit on the branch separately.
- Check failure.md first if a run stops early.
- Keep the skill inside its intended repository and workflow.
npm run generate:settings-schemaWhat people use it for
- Maintainers of the qwen-code repository running the scheduled hygiene workflow.
- Reviewing a batched branch with one commit per fix so each change can be audited or reverted.
- Studying how an automated agent job can split a scan phase from a fix phase with verification gates.
- Filing larger, report-only findings as a single consolidated issue for later work.
Frequently asked questions
Is the repo-hygiene skill free to use?
The source gives the licence as Apache-2.0. It does not list prices, so check the repository and licence file for the terms that apply to you.
What do I need to install the repo-hygiene skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it in the Claude apps under Settings → Capabilities → Skills. The skill also expects Node.js, a Docker sandbox with rg, and the project's npm toolchain to run.
Can I use repo-hygiene on my own project?
It is not intended for general use. The skill is written around the qwen-code repository's workflow, sandbox, scripts and commands, so ordinary users should look for a general cleanup tool instead.
Does the agent need GitHub access to use this skill?
No. The skill states that the agent has no GitHub credentials and must not push, comment, create pull requests or edit labels. The GitHub Actions workflow handles credentials, checkout, pushes and PR creation.
Why does the skill need Docker and rg?
The skill assumes tools.sandbox: docker and says that rg (ripgrep) is provided by the Docker sandbox image rather than by ubuntu-latest. Deterministic scanning in this skill is rg-only by design.
Is it safe to run repo-hygiene on important branches?
The source warns against running it unattended on important branches without review, because it commits model-generated changes. It depends on the workflow's safeguards for pushes and PRs, so review the branch before merging.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use repo-hygiene if you maintain the qwen-code repository and run or review its scheduled hygiene workflow, or if you want to study how to split an automated agent job into scan and fix phases with verification gates. Pick a general-purpose cleanup tool or a manual review process if you need something for your own project, or if you want unattended changes to important branches.
Download the skill