Observed since 21 Oct, 09:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Analyze repositories and synthesize AGENTS.md
Analyze a code repository and synthesize an AGENTS.md that lets any agent produce code indistinguishable from the existing codebase.
agentskill is not a linter and not a style guide generator. It is a forensic extraction tool. It walks a repository, measures every line, reads every config file, and inspects the commit log — then synthesizes a precise behavioral spec for a code-generating agent.
The output is not advice. It is mimicry instructions.
Seven analyzers run in parallel. Each extracts one class of signal that an LLM cannot derive reliably from reading source files alone:
| Analyzer | What it measures |
|---|---|
scan | Directory tree, file inventory, suggested read order |
measure | Exact indentation, line length percentiles, blank line distributions |
config | Formatter, linter, and type-checker detection with config excerpts |
git | Commit prefixes, branch naming, merge strategy, signing |
graph | Internal import graph, circular dependencies, most-depended modules |
symbols | Symbol name extraction, naming pattern clustering, affix detection |
tests | Test-to-source mapping, framework detection, fixture extraction |
Analyzer output feeds directly into AGENTS.md synthesis. The synthesis step follows the behavioral spec in SYSTEM.md.
Check our latest technical article for a deeper dive: Turning Repository Knowledge Into Usable Agent Context.
agentskill already ships analyzer coverage and repository examples across a wide set of languages. This matters because the tool is meant to extract project-specific conventions from real repositories, not only from Python-only layouts.
Current supported language set:
The repository also includes fixture/example projects for these languages under
examples/, which act as both regression coverage and reference
shapes for multi-language analysis.
agentskill supports two distinct generation modes:
Use the CLI when you want deterministic output produced by the packaged runtime without an LLM in the loop.
agentskill analyze <repo> --pretty for combined machine-readable analysisagentskill generate <repo> for a fresh AGENTS.md draftagentskill generate <repo> --profile comprehensive for a richer draft with representative snippets and expanded detailagentskill generate <repo> --layout split --out AGENTS.md for separate concise primary plus comprehensive companionagentskill generate <repo> --layout multifile --out AGENTS.md for per-section markdown files with a root indexagentskill update <repo> for deterministic regeneration of an existing AGENTS.mdThis is the right mode for CI workflows, automation, and operator-driven usage where the packaged runtime produces the final document.
This repository is also distributed as a dedicated skill through the repo-root
SKILL.md. In this mode, an agent harness installs the skill,
follows the workflow defined in SKILL.md, and the model itself authors
the final AGENTS.md from gathered evidence.
In skill mode:
analyze, scan, measure, config,
git, graph, symbols, tests) to extract repository facts.agentskill generate to produce the output.In short:
pip install agsk
This installs the agentskill CLI command.
Published package is available at:
For local development:
python -m pip install -e '.[dev]'
To enable the commit-time checks after installing the dev environment:
pre-commit install
This repository is also distributed as a standard skill with a repo-root
SKILL.md. Harnesses that support skill installation from a filesystem path,
git repository, or marketplace entry should install it as a normal skill and
use SKILL.md as the entrypoint document.
Generic install guidance for skill-aware harnesses:
SKILL.md, SYSTEM.md, references/, and examples/.SKILL.md as the skill manifest.Expected skill layout:
SKILL.md # skill entrypoint and workflow
SYSTEM.md # generation/synthesis behavioral spec
references/ # gotchas and supporting guidance
examples/ # fixture repos and reference shapes
After a harness installs the skill, the analyzer commands remain available for evidence gathering:
# Evidence gathering (used in skill mode)
agentskill analyze <repo> --pretty
agentskill scan <repo> --pretty
agentskill measure <repo> --lang python --pretty
agentskill config <repo> --pretty
agentskill git <repo> --pretty
agentskill graph <repo> --pretty
agentskill symbols <repo> --pretty
agentskill tests <repo> --pretty
# Static generation (CLI/operator mode only, not for skill workflows)
agentskill generate <repo>
agentskill update <repo>
In skill mode, the model authors the final AGENTS.md itself. The
generate and update commands are for direct CLI use only.
Run the canonical local checks:
ruff format .
ruff check .
mypy
pytest
To verify formatting without rewriting files:
ruff format --check .
ruff check .
mypy
pytest
mypy is the repo's configured type-check command. Its configuration in
pyproject.toml covers agentskill/, scripts/, and tests/.
Optional commit-time hooks are available if you want them locally:
pre-commit install
pre-commit run --all-files
The pre-commit setup mirrors the lightweight formatting, lint, and type-check
passes. Full pytest runs remain part of normal local verification and CI.
# Canonical installed CLI
agentskill analyze <repo> --pretty
agentskill scan <repo> --pretty
agentskill measure <repo> --lang python --pretty
agentskill config <repo> --pretty
agentskill git <repo> --pretty
agentskill graph <repo> --pretty
agentskill symbols <repo> --pretty
agentskill tests <repo> --pretty
# Write output to file
agentskill analyze <repo> --out report.json
agentskill analyze <repo> --reference ../reference-repo --pretty
# Generate AGENTS.md markdown directly
agentskill generate <repo>
agentskill generate <repo> --out AGENTS.md
agentskill generate <repo> --reference ../ref-a --reference ../ref-b
agentskill generate <repo> --interactive
agentskill generate <repo> --profile concise
agentskill generate <repo> --profile comprehensive
agentskill generate <repo> --layout split
agentskill generate <repo> --layout multifile
agentskill generate <repo> --layout multifile --profile concise --out AGENTS.md
# Update or create AGENTS.md in place
agentskill update <repo>
agentskill update <repo> --section testing
agentskill update <repo> --exclude-section git
agentskill update <repo> --force
agentskill update <repo> --out updated-AGENTS.md
agentskill update <repo> --profile concise
# Retained wrapper entrypoints for operator/skill workflows
python scripts/analyze.py <repo> --pretty
python scripts/scan.py <repo> --pretty
python scripts/measure.py <repo> --lang python --pretty
python scripts/generate.py <repo>
python scripts/update.py <repo>
The installed agentskill command is the steady-state CLI surface, including
local development after an editable install. The retained scripts/*.py
wrappers exist for direct analyzer execution and skill/operator workflows; they
are not the primary runtime surface.
The published console entrypoint is agentskill.main:main. The packaged
runtime under agentskill/ is the source of truth for subcommand behavior,
output contracts, generation, update flows, and reference handling.
analyze, generate, or updateUse analyze when you want machine-readable JSON from all analyzers and do not
want to touch any markdown files. This is the contract-stable inspection path.
Use generate when you want a fresh AGENTS draft from current analyzer output.
It prints markdown to stdout by default, never merges with an existing
AGENTS.md, and only writes a file when you pass --out.
Use update when you already have an AGENTS.md and want deterministic
regeneration plus preservation of untouched manual content. It writes back to
<repo>/AGENTS.md by default, or to --out while still using the repo-local
AGENTS.md as merge input.
Both analyze and generate accept repeatable --reference flags. References
are explicit inputs, not hidden priors.
AGENTS.md.analyze --reference validates references but does not change the JSON output
shape.generate --reference preserves reference order in the emitted metadata block
so the provenance is inspectable.generate --interactive is opt-in guided gap filling. It asks a small number of
targeted questions only when important signals are missing or ambiguous, then
injects those answers into the generated markdown as explicit interactive notes.
References can reduce prompt count when they clearly provide the missing convention. Conflicting references do not get auto-resolved; the command asks instead of guessing.
agentskill update <repo> analyzes the repository, regenerates AGENTS sections,
merges them with any existing AGENTS.md, and writes the result back to
<repo>/AGENTS.md by default.
--section to regenerate only named sections.--exclude-section to keep generated sections untouched.--force for a clean-slate rebuild that drops preserved/manual sections
and ignores preservation hints from feedback.generate and update accept --profile to control content density. generate
also accepts --layout to control how the output is packaged across files.
Both generate and update accept --profile:
--profile concise (default) — operational rules and key facts only; omits
representative code snippets and secondary explanatory bullets.--profile comprehensive — includes everything from concise plus
representative snippets, annotation counts, expanded explanatory bullets,
and richer provenance from analyzer results.All profiles produce deterministic output from the same analyzer results. The same section headings and section order are preserved regardless of profile.
generate accepts --layout to control file packaging:
--layout single (default) — writes one complete markdown file.
--layout split — writes two files: a concise primary document and an
AGENTS.reference.md companion with comprehensive content. The primary file
links to the companion. Split mode always uses concise for the primary and
comprehensive for the companion regardless of the --profile flag; the
--profile flag only affects single and multifile layouts. If --out is
omitted, split writes into the target repo using AGENTS.md as the primary
path.
--layout multifile — writes a compact root index plus per-section markdown
files in a .agentskill/ directory beside the primary output. Each section file
includes a backlink to the root. The --profile flag controls the density of
content in each section file. If --out is omitted, multifile writes into
the target repo using AGENTS.md as the root path. Multifile section filenames
follow a stable numbering scheme:
AGENTS.md
.agentskill/
01_OVERVIEW.md
02_REPOSITORY_STRUCTURE.md
05_COMMANDS_AND_WORKFLOWS.md
06_CODE_FORMATTING.md
07_NAMING_CONVENTIONS.md
08_TYPE_ANNOTATIONS.md
09_IMPORTS.md
10_ERROR_HANDLING.md
11_COMMENTS_AND_DOCSTRINGS.md
12_TESTING.md
13_GIT.md
14_DEPENDENCIES_AND_TOOLING.md
15_RED_LINES.md
| Layout | --profile applies to | Default profile |
|---|---|---|
single | Single output file | concise |
split | Ignored; primary is concise, companion is comprehensive | N/A |
multifile | Content in each section file | comprehensive |
--layout single without --out prints markdown to stdout.--layout split without --out writes into the target repo: <repo>/AGENTS.md
and <repo>/AGENTS.reference.md.--layout multifile without --out writes into the target repo:
<repo>/AGENTS.md and <repo>/.agentskill/.--out to write to a custom location.update only supports --layout single (the default). Passing
--layout split or --layout multifile to update is explicitly rejected
with a clear error message. This constraint may be lifted in a future release.
# Single-file generation (default)
agentskill generate <repo>
agentskill generate <repo> --profile comprehensive
# Split generation (writes into repo by default)
agentskill generate <repo> --layout split
agentskill generate <repo> --layout split --out AGENTS.md
# Multifile generation (writes into repo by default)
agentskill generate <repo> --layout multifile
agentskill generate <repo> --layout multifile --out AGENTS.md
agentskill generate <repo> --layout multifile --profile concise --out AGENTS.md
# Update (single layout only)
agentskill update <repo>
agentskill update <repo> --profile comprehensive
Incremental updates can read an optional repo-local sidecar file named
.agentskill-feedback.json. This file is explicit, version-controllable, and
affects only the current repository. It is not hidden memory and it is not
global learning.
{
"sections": {
"overview": {
"prepend_notes": [
"Mention that deployments go through GitHub Actions."
]
},
"testing": {
"pinned_facts": [
"Use pytest as the canonical test runner."
]
}
},
"preserve_sections": [
"red lines"
]
}
Supported feedback keys are intentionally narrow by design:
sections.<name>.prepend_notessections.<name>.pinned_factspreserve_sectionsIn normal update mode, preserve_sections acts like an implicit exclusion list.
In --force mode, those preservation hints are ignored so the command can
produce a true clean-slate rebuild.
Use .agentskill-feedback.json when you want durable, repo-local regeneration
guidance that should survive future updates. Edit AGENTS.md directly when you
are making one-off manual notes that should remain untouched unless you
explicitly target or force-regenerate that section.
README.md # user-facing overview and contributor workflow
AGENTS.md # conventions for this repository itself
SYSTEM.md # synthesis spec for generated AGENTS.md files
SKILL.md # operational workflow used by the skill
pyproject.toml # packaging, CLI entrypoint, tool configuration
LICENSE
docs/
reference/ # packaged API reference for contributors
agentskill/
main.py # packaged CLI entry point — subcommand dispatch only
commands/ # analyzer implementations
lib/ # orchestration, output, update, generation helpers
common/ # shared low-level helpers and registries
scripts/
*.py # thin wrappers that import packaged analyzer entrypoints
tests/ # pytest suite for package code and wrapper behavior
references/
GOTCHAS.md # extraction and synthesis errors to avoid
examples/
README.md # language fixture index for analyzer validation
python/ # compact per-language analyzer fixtures
javascript/
typescript/
go/
rust/
java/
kotlin/
csharp/
c/
cpp/
ruby/
php/
swift/
objectivec/
bash/
mixed/
SINGLE_LANGUAGE.md # reference output: single-language repo
MULTI_LANGUAGE.md # reference output: multi-language single repo
MONOREPO.md # reference output: monorepo with multiple services
agentskill/.agentskill/commands/.agentskill/lib/.agentskill/common/.scripts/ limited to thin wrappers and operator-facing workflow entrypoints.scripts/.tests/ as test_<subject>.py; do not colocate tests under scripts/.There is no separate steady-state runtime under scripts/, and there is no
root cli.py compatibility entrypoint to extend. New runtime behavior should
land in the package tree and then be exposed through agentskill.main if
it belongs on the public CLI.
For normal use and contributor verification:
python -m pip install -e '.[dev]'
agentskill analyze <repo> --pretty
ruff format .
ruff check .
mypy
pytest
When you add or extend functionality:
agentskill/commands/ when it maps to a command.agentskill/lib/ or agentskill/common/, based on whether they are orchestration-level or low-level utilities.agentskill/main.py.scripts/*.py wrapper only when direct operator or skill invocation is still useful, and keep it as a thin import-and-dispatch shim.tests/.For retained wrappers:
agentskill <command> ... as the canonical interface in docs and examples.python scripts/<name>.py ... only for retained thin wrappers that still exist.generate and update wrappers thin; packaged CLI behavior must still live under agentskill/.Three files govern behavior. Read all three before modifying anything.
| File | Role |
|---|---|
SYSTEM.md | The canonical spec: what every section of AGENTS.md must contain and how to evaluate it |
SKILL.md | The operational workflow: when to invoke, what scripts to run, in what order |
GOTCHAS.md | Extraction and synthesis errors from previous runs — read before writing |
The public commands stay the same after refactors. The packaged runtime lives
under agentskill/, while scripts/ stays intentionally small as a
wrapper and operator layer for direct analyzer entrypoints.
The examples/ directory now serves two roles:
AGENTS.md examples in SINGLE_LANGUAGE.md, MULTI_LANGUAGE.md, and MONOREPO.md.If this skill was downloaded from ClawHub, or if examples/ is not present in the local copy, do not consult it; skip that step to avoid execution errors.
See examples/README.md for the supported fixture set.
Static API reference for the packaged codebase lives under
docs/reference/:
docs/reference/cli.md for the packaged CLI entrypoint and dispatch modeldocs/reference/commands.md for analyzer command modulesdocs/reference/library.md for orchestration, generation, update, and reference helpersdocs/reference/common.md for low-level registries and filesystem helpersThe reference is contributor-oriented. It documents the packaged namespace and extension points that matter for real maintenance work without trying to expose every private helper as public API.
Contributions are welcome, especially in these areas:
AGENTS.md generation qualityBefore opening a pull request, read:
Use the repository issue and pull request templates when reporting bugs, requesting features, or proposing changes.
For supported versions and vulnerability reporting guidance, see
SECURITY.md.
This is the current star history progress of the project:
Project metadata and support files available in this repository include:
If you want to support the project, starring, sharing, contributing fixes, and supporting through GitHub Sponsors all help.
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.4.0 | 6 May 2026 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7ca0e1b0e6b0079132a91a8c0261f44a158ecfe439911b234dc1abf896b31a25