doc2skill / tests
AGENTS.md0 starsChanged 4 months agoMITView on GitHub
Tests should return Result<()> and use helper commands from tests/cli/helpers.rs: Use insta::assert_snapshot! when comparing generated files (SKILL.md, doc.skill, etc.). Integration tests run against a mock HTTP server backed by real fixtures under tests/fixtures_gen/. Fixtures are generated, not committed*. build.rs only generates when DOC2SKILL_REGEN_FIXTURES=1 is set; it otherwise no-ops so normal builds.
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 35,266 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.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 5
Use assert_cmd crate for command testing
- Very specific: line 6
Use temp_dir crate for temporary test directories
- Very specific: line 7
Use test-case crate for theory testing (same test, multiple examples)
- Very specific: line 8
Use insta crate for snapshot testing when comparing generated output
- Very specific: line 39
Use insta::assert_snapshot!
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
Testing Guidelines
Test Framework
- Use
assert_cmdcrate for command testing - Use
temp_dircrate for temporary test directories - Use
test-casecrate for theory testing (same test, multiple examples) - Use
instacrate for snapshot testing when comparing generated output
Test Pattern
Tests should return Result<()> and use helper commands from tests/cli/helpers.rs:
use color_eyre::Result;
use temp_dir::TempDir;
use crate::cli::helpers::import_cmd;
#[test]
fn test_example() -> Result<()> {
let dir = TempDir::new()?;
import_cmd("SomePackage@1.0.0", &dir, "language").success();
let output = std::fs::read_to_string(dir.path().join("SomePackage/SKILL.md"))?;
insta::assert_snapshot!(output);
Ok(())
}Available Helpers
import_cmd(arg, dir, language)- Run import commandcount_cmd(spec, dir)- Run count command
Snapshot Testing
Use insta::assert_snapshot! when comparing generated files (SKILL.md, doc.skill, etc.).
Test fixtures
Integration tests run against a mock HTTP server backed by real fixtures under tests/fixtures_gen/. Fixtures are generated, not committed*.
DOC2SKILL_REGEN_FIXTURES=1 cargo testbuild.rs only generates when DOC2SKILL_REGEN_FIXTURES=1 is set; it otherwise no-ops so normal builds.
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.

