agentleFS
Microsoft AzureKnown publisherAzure/azure-sdk-for-rust/.github/skills/export-api/SKILL.md

export-api

Skill887 starsChanged 29 days agoMITView on GitHub

Generate api.md artifacts for changed Rust crates after code generation or source edits.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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
  1. Distinctive:

    Run this after regenerating sources or changing Rust code that can affect a crate's public API.

    line 8
  2. Distinctive:

    If the user wants branch-based detection instead, diff against the merge base with main:

    line 18
  3. Very specific:

    If no changed files map to a crate directory under sdk/<service-directory>/<crate-name>, stop and report that no crate API artifacts need …

    line 46
  4. Very specific:

    After generation, check the resulting api.md files in git diff and report which crates were updated.

    line 51

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

Export API artifacts

Run this after regenerating sources or changing Rust code that can affect a crate's public API.

Default workflow

  1. Collect changed non-deleted files from Git. By default, use both staged and unstaged local changes:

    { git diff --staged --name-only --diff-filter=d; git diff --name-only --diff-filter=d; git ls-files --others --exclude-standard -- 'sdk'; } | sort -u
  2. If the user wants branch-based detection instead, diff against the merge base with main:

    base="$(git merge-base main HEAD)"
    git diff --name-only --diff-filter=d "$base"...HEAD | sort -u

    This branch-based mode only considers tracked branch changes; use the default local-change mode when untracked files should also trigger API regeneration.

  3. Assume service crates live under sdk/<service-directory>/<crate-name>. For each changed file under sdk/, derive the candidate crate directory from the first three path segments and keep it only when <crate-directory>/Cargo.toml exists.
  4. For each affected crate, run the explicit generator command from the repository root:

    cargo run --manifest-path eng/tools/generate_api/Cargo.toml -- \
      --manifest-path <crate>/Cargo.toml

Optional outputs

  • Pass --review to also generate api.metadata.yml, api.md.map, and api.documentation.patch.

No changed crates

If no changed files map to a crate directory under sdk/<service-directory>/<crate-name>, stop and report that no crate API artifacts need regeneration.

Validation

After generation, check the resulting api.md files in git diff and report which crates were updated.

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.

Reviews can't be read right now.

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.