unit-tests-skills
AGENTS.md55 starsChanged 59 days agoMITView on GitHub
Guidance for AI agents working with this repository. Skills for generating unit tests with consistent quality. Each skill is self-contained. The skills are meant to run in sequence, and the agent is the one that chains them: generate-test-cases produces the plan, generate-tests generates from that plan instead of analyzing the target a second time. Both analyze the same way and print the same list, so invoking the second without handing it the first one's output does the work twice. /generate-tests…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- generate-test-casesSkill
- generate-testsSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 74
Keep skills/ at the repository root.
- Very specific: line 129
SKILL.md: Always uppercase, exact filename
- Very specific: line 160
Keep allowed-tools to tools every agent runtime provides.
- Distinctive: line 171
Add rules inside the skill folder that uses them:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
AGENTS.md
Guidance for AI agents working with this repository.
Overview
Skills for generating unit tests with consistent quality. Each skill is self-contained.
Skills
| Command | What it does |
/generate-tests <file> | Full workflow, unattended: analyzes code, prints test case list, generates test code, verifies it |
/generate-test-cases <file> | Analysis only: outputs test case list without generating code |
Recommended Workflow
The skills are meant to run in sequence, and the agent is the one that chains them:
generate-test-cases produces the plan, generate-tests generates from that plan
instead of analyzing the target a second time. Both analyze the same way and print the
same list, so invoking the second without handing it the first one's output does the
work twice.
generate-test-cases <target>— lists the cases as Given-When-Then, writes no codegenerate-tests <target>— generates from that list, naming what it added or dropped
/generate-tests invoked on its own is the safe fallback, not a second path to
maintain: with no list in front of it, it builds one in its own Step 2 and prints it
before writing code. Each skill runs end to end without stopping for input, so that
printed list is the record of what it decided to do.
This file guides agents working on this repository. The copy that reaches consuming
projects is templates/AGENTS-SNIPPET.md — a change to
the workflow belongs in both.
Rules Location
Rules are inside each skill folder:
generate-test-cases/rules/general/— general rules onlygenerate-tests/rules/tests/— all rules (general, java, post-generation)
Plugin Validation
This repository doubles as a Claude Code plugin and a marketplace, declared
in .claude-plugin/. Both manifests must stay valid, because the
community-marketplace review pipeline runs claude plugin validate on every
submission.
After changing anything under .claude-plugin/ or skills/, run:
./scripts/validate-plugin.shCI runs the same script on every pull request touching those paths
(.github/workflows/validate-plugin.yml). No credentials are needed —
validation is entirely local.
What it checks, and why each check exists
| Check | Why it is not redundant |
claude plugin validate . --strict | Validates the marketplace manifest. --strict promotes warnings to errors, which matters because the CLI reports a version that disagrees between the entry and plugin.json as a warning — while plugin.json silently wins at install time. |
claude plugin validate <copy> --strict | The validator switches to marketplace mode the moment it sees marketplace.json, so validating the repo root never exercises plugin.json's own schema. The script copies the plugin without the marketplace file to force plugin mode. |
Entry name matches plugin.json | The CLI does not check this. A marketplace entry naming a plugin that plugin.json does not define validates cleanly and only fails later at install time with Plugin "<name>" not found in marketplace. Verified against claude 2.1.235. |
Conventions that follow from this
- Declare
versioninplugin.jsononly. Repeating it in the marketplace entry adds a way for the two to drift, and the entry's copy is ignored. - The plugin
nameis immutable once published — it is the install id and the skill namespace (/unit-tests-skills:generate-tests). Do not rename it. - Keep
skills/at the repository root. Onlyplugin.jsonandmarketplace.jsonbelong inside.claude-plugin/.
Rule Validation
A skill is only as good as the rules it actually loads, and every way that can
break is silent at runtime: the agent reads SKILL.md, follows a reference to a
rule that is not there, and generates tests without it. Nothing errors — the
output just gets worse.
After adding, renaming, moving, or deleting anything under a skill's rules/,
run:
./scripts/validate-rules.shCI runs the same script in its own workflow
(.github/workflows/validate-rules.yml), on every pull request rather than
only ones touching skills/. Two reasons it is separate from plugin
validation: it needs no Node and no CLI, so a broken upstream release cannot
take it down; and it carries no path filter, so it always reports and is safe
to require before merge. A required check that gets skipped never reports, and
a pull request waiting on a check that will never arrive cannot merge.
What it checks, and why each check exists
| Check | What it catches |
| Referenced rule files exist | A reference in SKILL.md (or RULES-INDEX.md) naming a file that is not on disk. References come in three valid shapes — ./rules/general/x.md from the skill root, general/x.md from rules/tests/, and a bare x.md in prose — so a reference passes if any shape resolves. |
| Every rule file is referenced | The reverse direction. A rule added to the tree but never named in SKILL.md is dead weight: nothing instructs the agent to read it. |
| General rules are in sync | Each skill carries its own copy of the general rules, because a skill is installed standalone and has to be self-contained. Two copies can drift, and a drifted copy means the same request gets different rules depending on which skill the agent picked. |
| Rule files sit in a known category | This distribution ships unit-test rules only. The check lists the categories that belong here (general/, java/unit/, post-generation/) rather than the ones that do not, so it also catches a category nobody has invented yet. |
Conventions that follow from this
- A new rule takes two edits, not one: the file itself and an entry in the
relevant
SKILL.md. The second check fails without it. - Edit general rules in both locations in the same commit. Fixing one copy and leaving the other for later fails the third check.
Creating a New Skill
Directory Structure
skills/
{skill-name}/
SKILL.md
rules/ # Rules used by this skillNaming Conventions
- Skill directory:
kebab-case(e.g.,generate-tests,generate-test-cases) - SKILL.md: Always uppercase, exact filename
SKILL.md Format
---
name: skill-name
description: One sentence describing when to use this skill.
allowed-tools: Read, Write, Glob, Grep
---
# Skill Title
What this skill does.
## Rules Reference
List rule files from `./rules/` directory.
## Instructions
**Target:** $ARGUMENTS
Steps:
1. First step
2. Second step
3. ...Tools a Skill May Declare
Keep allowed-tools to tools every agent runtime provides. AskUserQuestion is
Claude Code's own — Codex and the other agents this distribution targets
(README.md, "Recommended for other agents") have no equivalent, so a skill that
stops to ask the user works in one runtime and silently does nothing in the rest.
Skills here run end to end and print what they decided instead. Do not add a tool
that pauses for input, and do not set context: fork — a forked skill's output does
not reach the user, which is the whole point of printing the plan.
Adding a New Rule
Add rules inside the skill folder that uses them:
skills/{skill-name}/rules/
general/
{rule-name}.md
{language}/unit/
{rule-name}.mdThen list it in that skill's SKILL.md and run ./scripts/validate-rules.sh.
See Rule Validation for what the checks enforce.
Rule File Format
## Rule Title
Why this rule matters.
**Incorrect:**
```java
// Bad exampleCorrect:
// Good exampleGuidelines
- Guideline one
- Guideline two
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
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.

