agentleFS
OdonnoOdonno/doc2skill/tests/AGENTS.md

doc2skill / tests

AGENTS.md1 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 checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 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.

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
  1. Very specific:

    Use assert_cmd crate for command testing

    line 5
  2. Very specific:

    Use temp_dir crate for temporary test directories

    line 6
  3. Very specific:

    Use test-case crate for theory testing (same test, multiple examples)

    line 7
  4. Very specific:

    Use insta crate for snapshot testing when comparing generated output

    line 8
  5. Very specific:

    Use insta::assert_snapshot!

    line 39

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Testing Guidelines

Test Framework

  • Use assert_cmd crate for command testing
  • Use temp_dir crate for temporary test directories
  • Use test-case crate for theory testing (same test, multiple examples)
  • Use insta crate 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 command
  • count_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 test

build.rs only generates when DOC2SKILL_REGEN_FIXTURES=1 is set; it otherwise no-ops so normal builds.

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.