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…
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,774 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 repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ag2-a2aSkill
- ag2-acpSkill
- ag2-add-custom-toolSkill
- ag2-ag-uiSkill
- ag2-eval-comparisonSkill
- ag2-evaluationSkill
- ag2-hitlSkill
- ag2-knowledge-and-memorySkill
- ag2-liveSkill
- ag2-mcpSkill
- ag2-middlewareSkill
- ag2-multimodal-inputSkill
- ag2-network-discussionSkill
- ag2-network-governanceSkill
- ag2-network-quickstartSkill
- ag2-network-tools-and-viewsSkill
- ag2-network-workflowSkill
- ag2-observers-and-alertsSkill
- ag2-overviewSkill
- ag2-quickstartSkill
- ag2-shell-toolSkill
- ag2-structured-outputSkill
- ag2-subagent-delegationSkill
- ag2-telemetrySkill
- ag2-testingSkill
- ag2-use-builtin-toolsSkill
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
- Very specific: line 28
SKILL.md: Always uppercase, always this exact filename. - Very specific: line 30
Zip file: Must match directory name exactly: {skill-name}.zip.
- Very specific: line 89
Use #!/usr/bin/env python3 shebang and chmod +x the file.
- Distinctive: line 90
Keep stdout machine-readable.
- Distinctive: line 91
Avoid hidden global state — accept all inputs via CLI args or stdin so the script is reproducible.
- Very specific: line 96
Use #!/bin/bash and set -e for fail-fast behaviour.
- Distinctive: line 102
After creating or updating a skill:
- Very specific: line 117
After the bump PR merges, tag main as ag2-<ag2_version> (e.g.
- Distinctive: line 121
Document these installation methods for users:
≈ “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
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 distributionNaming Conventions
- Skill directory:
kebab-case, prefixedag2-for AG2-feature skills (e.g.ag2-quickstart,ag2-middleware). SKILL.md: Always uppercase, always this exact filename.- Scripts:
kebab-caseorsnake_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:
| Field | Limit | Rules |
name | ≤ 64 characters | Lowercase a–z, 0–9, and hyphens only; no leading/trailing hyphen; no consecutive --; must equal the directory name. |
description | ≤ 1024 characters | Non-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 characters | Optional; 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+descriptionare the only bytes loaded at startup (the discovery budget, ~100 tokens) — keep them tight but keyword-rich.- The full
SKILL.mdbody 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 intoreferences/(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.mdunder 500 lines — put detailed reference material inreferences/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 python3shebang andchmod +xthe 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}.pyfromSKILL.md.
For Bash scripts:
- Use
#!/bin/bashandset -efor fail-fast behaviour. - Status messages to stderr, machine-readable output (JSON or plain values) to stdout.
- Include a
trapfor 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:
- On an AG2 bump, update
ag2_version/ag2_commitinCOMPATIBILITY.jsonandmetadata.ag2_versionin everySKILL.md, then rebuild the zips.python3 scripts/validate_versions.pyandpython3 scripts/validate_zips.pymust pass. - After the bump PR merges, tag
mainasag2-<ag2_version>(e.g.ag2-1.3.0) and push the tag..github/workflows/release.ymlre-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.
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.

