agentleFS
ag2aiag2ai/ag2-skills/AGENTS.md

ag2-skills

AGENTS.md12 starsChanged 8 days agoApache-2.0View on GitHub

A collection of skills for working with AG2 — an async, protocol-driven Python agent framework (ag2). Skills are packaged instructions and optional helper scripts that extend an agent's capabilities. Skills follow the Agent Skills format: a SKILL.md with YAML frontmatter, plus optional scripts/ and references/ directories. These are hard limits, checked by skills-ref validate ./skills/{skill-name}. Stay within them: Skills are loaded on-demand — only the skill name and description from the frontmatter are loaded at startup. The full SKILL.md loads…

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    SKILL.md: Always uppercase, always this exact filename.

    line 28
  2. Very specific:

    Zip file: Must match directory name exactly: {skill-name}.zip.

    line 30
  3. Very specific:

    Use #!/usr/bin/env python3 shebang and chmod +x the file.

    line 89
  4. Distinctive:

    Keep stdout machine-readable.

    line 90
  5. Distinctive:

    Avoid hidden global state — accept all inputs via CLI args or stdin so the script is reproducible.

    line 91
  6. Very specific:

    Use #!/bin/bash and set -e for fail-fast behaviour.

    line 96
  7. Distinctive:

    After creating or updating a skill:

    line 102
  8. Very specific:

    After the bump PR merges, tag main as ag2-<ag2_version> (e.g.

    line 117
  9. Distinctive:

    Document these installation methods for users:

    line 121

≈ “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.

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

AGENTS.md

This file provides guidance to AI coding agents (Claude Code, Cursor, Copilot, etc.) when working with code in this repository.

Repository Overview

A collection of skills for working with AG2 — an async, protocol-driven Python agent framework (ag2). Skills are packaged instructions and optional helper scripts that extend an agent's capabilities.

Skills follow the Agent Skills format: a SKILL.md with YAML frontmatter, plus optional scripts/ and references/ directories.

Creating a New Skill

Directory Structure

skills/
  {skill-name}/           # kebab-case directory name
    SKILL.md              # Required: skill definition
    scripts/              # Optional: executable scripts
      {script-name}.py    # Python preferred (matches AG2's runtime)
    references/           # Optional: supporting docs the agent reads on demand
  {skill-name}.zip        # Optional: packaged for distribution

Naming Conventions

  • Skill directory: kebab-case, prefixed ag2- for AG2-feature skills (e.g. ag2-quickstart, ag2-middleware).
  • SKILL.md: Always uppercase, always this exact filename.
  • Scripts: kebab-case or snake_case — pick one per skill and stay consistent.
  • Zip file: Must match directory name exactly: {skill-name}.zip.

SKILL.md Format

---
name: {skill-name}
description: {One paragraph describing exactly when to use this skill. Lead with the action and key API surface; include trigger phrases and what to use it *with* (sibling skills).}
license: Apache-2.0
metadata:
  ag2_version: "{ag2_version from COMPATIBILITY.json}"
---

# {Skill Title}

## When to use

{Concrete situations where this skill applies. List trigger phrases and the user goals it serves.}

## Recipe

{Numbered steps or a minimal working example, in Python. Show the imports.}

## Reference

{Link to any files in `references/` or upstream AG2 docs (`website/docs/user-guide/...`).}

Frontmatter limits (per the Agent Skills spec)

These are hard limits, checked by skills-ref validate ./skills/{skill-name}. Stay within them:

FieldLimitRules
name≤ 64 charactersLowercase a–z, 0–9, and hyphens only; no leading/trailing hyphen; no consecutive --; must equal the directory name.
description≤ 1024 charactersNon-empty; say what it does and when to use it, with trigger keywords. Must be valid YAML: if the text contains a colon-then-space (: ), wrap the whole value in quotes — otherwise the frontmatter fails to parse.
compatibility≤ 500 charactersOptional; only for real environment requirements.
metadata.ag2_version—Required in this repo. Must equal ag2_version in COMPATIBILITY.json (checked by scripts/validate_versions.py in CI). It travels with a copied skill or zip, which COMPATIBILITY.json does not.
license, allowed-tools—Optional (see spec).

Body sizing (chars / tokens)

  • name + description are the only bytes loaded at startup (the discovery budget, ~100 tokens) — keep them tight but keyword-rich.
  • The full SKILL.md body loads on activation. The spec recommends keeping it under ~5000 tokens and under 500 lines. Aim well under that — target < 5000 characters for a focused skill — and push depth into references/ (loaded only on demand).

Best Practices for Context Efficiency

Skills are loaded on-demand — only the skill name and description from the frontmatter are loaded at startup. The full SKILL.md loads into context only when the agent decides the skill is relevant. To minimise context usage:

  • Keep SKILL.md under 500 lines — put detailed reference material in references/ or separate files.
  • Write specific descriptions — list the exact AG2 classes / functions the skill covers (e.g. BaseMiddleware.on_turn, KnowledgeStore, TestConfig) so the agent can recognise the trigger.
  • Use progressive disclosure — reference supporting files that get read only when needed.
  • Prefer scripts over inline code — script execution doesn't consume context (only output does).
  • Cross-link sibling skills — a description that says "for X see ag2-other-skill" is cheap and saves the agent loading the wrong file.

Script Requirements

For Python scripts (the common case):

  • Use #!/usr/bin/env python3 shebang and chmod +x the file.
  • Keep stdout machine-readable; print human-facing status to stderr.
  • Avoid hidden global state — accept all inputs via CLI args or stdin so the script is reproducible.
  • Reference the script as skills/{skill-name}/scripts/{script}.py from SKILL.md.

For Bash scripts:

  • Use #!/bin/bash and set -e for fail-fast behaviour.
  • Status messages to stderr, machine-readable output (JSON or plain values) to stdout.
  • Include a trap for any temp files.

Creating the Zip Package

After creating or updating a skill:

cd skills
rm -f {skill-name}.zip
zip -r {skill-name}.zip {skill-name}/ -x "*.DS_Store" "*/__pycache__/*"

The -x excludes keep macOS metadata and Python bytecode out of the archive.

Versioning and releases

Skills are versioned as a set, by the AG2 release they were verified against:

  1. On an AG2 bump, update ag2_version / ag2_commit in COMPATIBILITY.json and metadata.ag2_version in every SKILL.md, then rebuild the zips. python3 scripts/validate_versions.py and python3 scripts/validate_zips.py must pass.
  2. After the bump PR merges, tag main as ag2-<ag2_version> (e.g. ag2-1.3.0) and push the tag. .github/workflows/release.yml re-validates and publishes a GitHub Release with all skill zips attached.

End-User Installation

Document these installation methods for users:

Claude Code:

cp -r skills/{skill-name} ~/.claude/skills/

claude.ai: Upload the skill .zip from skills/ in the project's Skills settings, or paste the contents of SKILL.md into the conversation.

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.