Scaffold and compile modular agent guidance into AGENTS.md
Project description
Agentic Guidance Builder
Agentic Guidance Builder is a Python CLI for authoring modular guidance content and compiling it into a final AGENTS.md file.
This repository is the tool itself. It helps you:
- scaffold a clean guidance structure inside a repo
- write guidance as readable Markdown
- add lightweight metadata with YAML frontmatter
- render Markdown and final outputs with Jinja templates
- validate the guidance tree before building
- keep tool-specific runtime exports derived from canonical source content
What This Repository Is
This repo contains the V1 implementation of the Agentic Guidance Builder CLI.
The current product shape is intentionally simple:
- authored guidance lives under
agents/guidance/ - authored non-guidance assets live under
agents/content/ - adapters write tool runtime outputs as derived artifacts
- repository-level build settings live in root
agd-settings.toml - the primary compiled output is root
AGENTS.md - adapters can also export runtime files for tools like OpenCode and Copilot
Why It Exists
Most repos accumulate agent instructions in a single giant file. That gets hard to maintain.
This tool breaks that problem into smaller pieces:
- global guidance
- language guidance
- framework guidance
- project guidance
- example documents
- reusable templates and settings
Instead of hand-maintaining one large output file, you author small source documents and build the final result.
Core Workflow
- run
agd init - edit the Markdown files under
agents/guidance/ - optionally customize
agd-settings.toml - optionally customize the templates under
agents/guidance/templates/base/ - run
agd validate - run
agd build
Install
This project currently targets Python >=3.13.
Install from PyPI once published:
uv tool install agenticguidancebuilder
Or install from source for local development:
uv sync --group dev
In this repository:
uv sync
Run the CLI with either:
uv run agd --help
or:
uv run agent-guidance --help
Quick Start
Initialize a repo:
uv run agd init \
--project-name "Example Repo" \
--languages python \
--frameworks django,vue
Inspect discovered content:
uv run agd list
Validate the tree:
uv run agd validate
Build the compiled output:
uv run agd build
Build OpenCode runtime exports:
uv run agd build --adapter opencode
Build Copilot runtime exports:
uv run agd build --adapter copilot
Include examples:
uv run agd build --include-examples
Refresh packaged base templates in an existing repo:
uv run agd upgrade --templates
Refresh packaged starter skills and commands:
uv run agd upgrade --content
Refresh packaged tool bootstrap assets:
uv run agd upgrade --tools
Refresh all packaged templates and starter assets:
uv run agd upgrade
Generated Repo Structure
After agd init, the target repo looks like this:
agd-settings.toml
agents/
guidance/
guidance.md
languages/
<language>/
guidance.md
examples/
example.md
frameworks/
<framework>/
guidance.md
examples/
example.md
project/
guidance.md
examples/
example.md
templates/
base/
agents.md.j2
macros.j2
section.guidance.md.j2
section.examples.md.j2
content/
skills/
test-skill.md
commands/
test-command.md
agents/
test-agent.md
How Authoring Works
Guidance Files
Compiled guidance content lives under agents/guidance/.
agents/guidance/guidance.mdis the global fileagents/guidance/languages/<name>/guidance.mdis language-specific guidanceagents/guidance/frameworks/<name>/guidance.mdis framework-specific guidanceagents/guidance/project/guidance.mdis repo-specific guidanceexamples/documents are optional example content for those scopes
Frontmatter
Markdown files can include optional YAML frontmatter.
Example:
---
id: language-python-guidance
title: Python Guidance
description: Durable guidance for the Python language.
kind: guidance
scope: language
name: python
tags:
- language
- python
applies_to:
- python
status: active
order: 1
---
# Python Guidance
## Purpose
- Explain what belongs here.
If frontmatter is omitted, defaults are derived from the file path and headings.
Examples
Example files are regular Markdown source documents with kind: example.
They are useful for:
- before/after examples
- reference snippets
- layout examples
- patterns that are easier to show than explain
Examples are only included in the compiled output when enabled.
Settings
Repository-level settings live in agd-settings.toml at the repo root.
Example:
[project]
name = "Example Repo"
summary = ""
[build]
default_output = "AGENTS.md"
include_examples_by_default = false
[vars]
product_name = "Example Repo"
repository_name = "example-repo"
Current behavior:
project.namecan supply the default project name for buildsbuild.default_outputcan supply the default output pathbuild.include_examples_by_defaultcan supply the default example-inclusion behavior[vars]values are exposed to Jinja templates asvars
Template Context
Markdown and final templates can use these top-level values:
projectbuildselectionsettingsvarsdoc
This keeps the authoring model lightweight while still allowing customization.
Commands
agd init
Scaffolds the guidance tree and starter files.
Common flags:
--project-name--languages--frameworks--force--dry-run
Language and framework names are generic. The CLI scaffolds whatever names you pass.
agd build
Builds the compiled output artifact.
Common flags:
--adapter--project-name--output--include-examples--languages--frameworks--dry-run
If filters are omitted, all discovered language and framework packages are included.
agd validate
Validates the guidance tree and reports grouped errors and warnings.
agd list
Lists discovered guidance content and shows metadata like:
idscopenameorderpath
agd upgrade
Refreshes packaged templates and starter assets in an existing repo.
If no scope flags are provided, it refreshes all supported packaged assets.
Common flags:
--target--dry-run--templates--content--tools
Examples:
agd upgradeagd upgrade --templatesagd upgrade --content --tools
agd upgrade-templates
Refreshes packaged files under agents/guidance/templates/base/ in an existing repo.
Common flags:
--target--dry-run
agd upgrade-content
Refreshes packaged starter content under agents/content/.
Today that includes:
- starter skills
- selected starter commands
Common flags:
--target--dry-run
agd upgrade-tools
Refreshes packaged tool bootstrap assets under agents/tools/.
Common flags:
--target--dry-run
agd upgrade-all
Refreshes all packaged templates and starter assets that have dedicated upgrade flows.
Common flags:
--target--dry-run
Development Tasks
Useful local commands:
task ai:setup-all-agents
task ai:setup-root
task ai:setup-opencode
task ai:setup-all-agents refreshes derived runtime files from the canonical agents/ tree.
How To Customize It
1. Add Your Own Languages And Frameworks
There is no fixed allowlist.
These all work:
uv run agd init --languages python,elixir --frameworks django,phoenix
2. Edit The Markdown Source Files
The simplest customization path is just editing the authored docs under agents/guidance/.
That is usually enough for:
- repo-specific rules
- stack-specific conventions
- examples and snippets
- organization notes
3. Customize agd-settings.toml
Use the settings file when values should be shared across multiple source docs or templates.
Good uses:
- project name
- product name
- default output path
- default example behavior
- small shared variables for templating
4. Override The Build Templates
Project-specific templates live under agents/guidance/templates/base/.
If present, they override the packaged defaults:
agents.md.j2macros.j2section.guidance.md.j2section.examples.md.j2
Example custom agents.md.j2:
# {{ project.name }} Guidance
Product: {{ vars.product_name }}
{% if global_guidance %}
{{ render_guidance_section(global_guidance) }}
{% endif %}
5. Keep Tool-Specific Assets Separate
Use agents/content/ for authored assets that should not be part of the compiled AGENTS.md source tree.
That includes reusable tool-agnostic authored assets like:
- skills
- commands
- agents
- other reusable authored content
Use agents/tools/ only when a future adapter genuinely needs tool-owned authored assets that cannot come from shared canonical content.
Use frontmatter roles to describe adapter-specific projection behavior when needed. For example, a canonical command can carry a role like opencode-command or copilot-repository-instructions without changing the top-level source taxonomy.
When a tool needs a bootstrap or base file that is not naturally derived from shared canonical content, keep that authored source in agents/tools/<tool>/. For example, OpenCode can use agents/tools/opencode/opencode.json as the canonical base config that the adapter copies to the repo root.
Adapters
The build pipeline currently supports these adapters:
agents-md- writes the compiledAGENTS.mdonlyopencode- writesAGENTS.md,.opencode/commands/,.opencode/agents/,.opencode/skills/, andopencode.jsoncopilot- writesAGENTS.md,.github/copilot-instructions.md,.github/instructions/,.github/skills/, and.github/agents/
Authoring stays markdown-first:
- canonical guidance stays in
agents/guidance/ - reusable single-file skills, commands, and agents stay in
agents/content/ agents/tools/is reserved for assets that are truly tool-specific and cannot come from the shared canonical content layer
The baked-in assets are intentionally single files so adapters can read one canonical source and remap it into the output layout each tool expects. For example, agents/content/agents/context-gatherer.md is the single authored source and the adapters generate OpenCode and Copilot agent files from it.
6. Customize The Packaged Starters
This tool ships with packaged starter assets for:
- guidance files
- example files
- settings
- skills
- selected starter commands
- build templates
During agd init, those packaged assets are copied into the target repository and become normal editable project files. Tool-specific or optional starter assets are only scaffolded when a packaged source file exists.
If you want newer packaged defaults later without re-running full init, use the upgrade commands:
agd upgradeagd upgrade-templatesagd upgrade-contentagd upgrade-toolsagd upgrade-all
Using It In Other Projects
The intended flow is to install the CLI once, then run it inside any repository you want to scaffold or build.
Examples:
# install once
uv tool install agenticguidancebuilder
# scaffold guidance in another repo
cd /path/to/other-repo
agd init --project-name "Other Repo" --languages python --frameworks django
# validate and build there
agd validate
agd build
Default Skills
The scaffold currently includes default skills such as:
agents/content/skills/code-change-review.mdagents/content/skills/guidance-layout-migration.md
It is designed to support strict, deterministic review work by requiring the reviewer to:
- state the exact scope
- read the applicable guidance docs first
- read applicable example docs
- compare the code to the closest existing in-repo pattern
- map each guidance/example file to a verdict
- tie every finding to a file plus a rule, example, or pattern
- report verification status and blind spots
This keeps review work grounded in the actual guidance tree instead of drifting into taste-only feedback.
Logging And CLI Behavior
The CLI uses simple prefixed output:
INFO:for progressOK:for successful actionsWARN:for non-fatal states like skipped or unchanged filesERROR:for failures
This keeps the CLI readable while still being easy to scan in automation.
Documentation In This Repo
README.md- product overview and usageagents/AGENTS.md- repo-specific development guidance for this repository itself
Development
Run local checks with:
uv run ruff check src tests
uv run pytest
uv build
Refresh derived guidance/runtime files with:
task ai:setup-all-agents
Building & Publishing To PyPI
- Update the version in
pyproject.toml. - Build artifacts locally with
uv build. - Inspect
dist/to verify the wheel and sdist contents. - Publish manually with
uv publish --token <pypi-token>if needed.
GitHub Actions also publishes on tag pushes matching v* using the PYPI_TOKEN repository secret.
If you prefer PyPI trusted publishing later, the workflow is already split into build and publish jobs, so switching from PYPI_TOKEN to OIDC is straightforward.
Current Status
The current implementation is a focused V1.
- stable authoring flow:
init -> list -> validate -> build - stable output target:
AGENTS.md - adapter architecture is present for future expansion
- tool-specific exports are intentionally deferred until later adapters are added
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenticguidancebuilder-1.3.0.tar.gz.
File metadata
- Download URL: agenticguidancebuilder-1.3.0.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d80f53d6171eefc2a6dc926b9bc428b75b635458c5bdda3a41728e04da14ad
|
|
| MD5 |
38a03df293d2df30b157ded80d43728c
|
|
| BLAKE2b-256 |
15191b114721c27195bc2add326a9473e085fdc76f05612c1015f49af7f2d839
|
File details
Details for the file agenticguidancebuilder-1.3.0-py3-none-any.whl.
File metadata
- Download URL: agenticguidancebuilder-1.3.0-py3-none-any.whl
- Upload date:
- Size: 44.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80cae4ad6ab42824f9dc2ec4d7d560617c25d741610af9df58586e85786f9b74
|
|
| MD5 |
db0270984a32c4d96168dc6a316b82d3
|
|
| BLAKE2b-256 |
02ff46c57ed295860526f6efd2df82c690a16e18aadfe63201f91b2817475e6d
|