infrahub
AGENTS.md548 starsChanged 8 days agoApache-2.0View on GitHub
Infrahub documentation is organized using the Diataxis framework, separating documentation into four categories: Choose the right documentation type: - docs/ – MDX content - guides/ – How-to guides (task-oriented) - topics/ – Explanations (understanding-oriented) - reference/ – API/configuration reference - tutorials/ – Learning tutorials - media/ – Images and screenshots. Export diagrams (Excalidraw) with an opaque white background, not transparent — the docs support a dark theme, where near-black line work on a transparent canvas becomes unreadable, and the white…
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,700 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 repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- analyzing-ci-flakinessSkill
- audit-docsSkill
- commitSkill
- creating-changelog-entriesSkill
- creating-issuesSkill
- creating-prdSkill
- grilling-ideasSkill
- harvesting-reviewSkill
- migrate-feature-pageSkill
- monitoring-pull-requestsSkill
- neo4j-cypher-guideSkill
- opsmill-dev-analyzing-bugsSkill
- opsmill-dev-fixing-bugsSkill
- opsmill-dev-test-driving-bugsSkill
- pre-ciSkill
- prSkill
- rebaseSkill
- reviewing-pull-requestsSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-critique-runSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-opsmill-autoSkill
- speckit-opsmill-extractSkill
- speckit-opsmill-implementSkill
- speckit-opsmill-prepSkill
- speckit-opsmill-retrospectSkill
- speckit-opsmill-summarySkill
- speckit-planSkill
- speckit-review-codeSkill
- speckit-review-commentsSkill
- speckit-review-errorsSkill
- speckit-review-runSkill
- speckit-review-simplifySkill
- speckit-review-testsSkill
- speckit-review-typesSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- upgrading-infrastructure-dependenciesSkill
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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
- could be automatic: a setting could enforce it
- Distinctive: line 76
Professional but approachable: Avoid "simple", "easy", or "just"
- Distinctive: line 93
Never use "transform" or "transforms" as a noun: Always use "Transformation" or "Transformations".
- Distinctive: line 109
When restructuring, merging, or deleting existing pages (on any branch, not only the docs-revamp workflow):
- Distinctive: line 111
Inventory the old content: Every claim, example, and section from a deleted page gets a home in the new set or an explicit drop decision — …
- Very specific: line 112
Add redirects: Every deleted or renamed published URL needs an entry in docs/redirects-pending/ in the same PR.
- Very specific: line 121
Run uv run invoke docs.lint before committing
- Distinctive: line 123
Use sentence case for headings
- Very specific: line 128
When documenting marketplace items, verify each item actually resolves in the live catalog at <https://marketplace.infrahub.app>.
- Very specific: line 130
Prefer plain Markdown/MDX over custom React components in doc pages.
- Distinctive: line 140
Use "simple", "easy", or "just" (minimizes complexity)
- Distinctive: line 142
Commit large unoptimized images
- Very specific: line 145
Delete or rename a published docs page without adding a redirect entry in docs/redirects-pending/ (see docs/redirects-pending/README.md)
≈ “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 - Documentation
Overview
Infrahub documentation is organized using the Diataxis framework, separating documentation into four categories:
- Tutorials - Learning-oriented walkthroughs
- Guides - Task-oriented how-to documentation
- Topics - Understanding-oriented explanations
- Reference - Information-oriented specifications
Before You Start
Choose the right documentation type:
| Question | Doc Type | See Guide |
| Teaching users to complete a specific task? | Guide | writing-a-guide.md |
| Explaining concepts or how something works? | Topic | writing-a-topic.md |
| Providing reference information? | Reference | Auto-generated |
| Walking through a complete learning scenario? | Tutorial | Diataxis framework |
File Structure
docs/– MDX contentguides/– How-to guides (task-oriented)topics/– Explanations (understanding-oriented)reference/– API/configuration referencetutorials/– Learning tutorialsmedia/– Images and screenshots. Export diagrams (Excalidraw) with an opaque white background, not transparent — the docs support a dark theme, where near-black line work on a transparent canvas becomes unreadable, and the white card is the established convention heredevelopment/– Developer documentationdocs.mdx– Documentation guide with linting rulesstyle-guide.mdx– Writing style and terminology rules
sidebars.ts– Navigation configuration
Commands
# Linting & Validation
uv run invoke docs.lint # Run all linters (Vale + markdownlint)
# Development
uv run invoke docs.build # Build documentation site
uv run invoke docs.serve # Serve documentation site
# Format
uv run invoke docs.format # Auto-format markdown filesTarget Audience
- Primary: Automation engineers, network operators, infrastructure teams
- Assumed knowledge: Git, CI/CD, YAML/JSON, infrastructure-as-code
- Not assumed: Prior Infrahub experience
Writing Guides
For step-by-step instructions on writing documentation:
dev/guides/docs/writing-a-guide.md- How to write how-to guidesdev/guides/docs/writing-a-topic.md- How to write topic/explanation documentation
Essential Style Guidelines
For detailed markdown formatting rules, see dev/guidelines/markdown.md.
For documentation writing guidelines, see dev/guidelines/documentation.md.
For the complete style guide including terminology, see docs/development/style-guide.mdx.
Voice and Tone
- Active voice: "Create a branch" (not "A branch can be created")
- Imperative mood for guides: "Click New Branch"
- Present tense: "Infrahub uses branches to isolate changes"
- Professional but approachable: Avoid "simple", "easy", or "just"
- Literal words: much of the audience reads English as a second or third language. Avoid figurative phrasing — "carry" (for have), "lives on" (for is stored on), "walk" (for traverse), "reach for" (for use). Say the literal thing.
- FAQ answers stay short: a couple of sentences plus a link to the topical page; detail that needs paragraphs (constraints, edition caveats, step-by-step procedure) belongs on the linked page, not in the FAQ. Never present a capability as the default when it requires explicit deployment or configuration.
Infrahub Terminology
Capitalize these Infrahub-specific terms when referring to the feature:
| Term | Capitalize? | Example |
| Generator(s) | Yes | "Infrahub Generators convert service models into objects." |
| Transformation(s) | Yes | "Transformations convert graph data into artifacts." |
| Profile(s) | Yes | "Create Profiles for your devices." |
| Resource Manager | Yes (singular) | "Use Resource Manager to allocate IPs." |
| artifact(s) | No | "The artifact is stored in object storage." |
| transform (verb) | No | "Use this to transform data into vendor formats." |
Never use "transform" or "transforms" as a noun. Always use "Transformation" or "Transformations".
Call a populated instance an "object", not a "node", in user-facing text (docs, error messages, UI copy). "Node" stays where it names a schema kind — the counterpart of "Generic" — which is the term the schema docs and the UI already use.
Documentation Workflow
- Choose documentation type using the table above (if not specified)
- Follow specialized guide (
dev/guides/docs/writing-a-guide.mdordev/guides/docs/writing-a-topic.md) - Create the .mdx file in the appropriate directory
- Add to navigation by editing
sidebars.tsin the appropriate section - Lint before committing:
uv run invoke docs.lint - Build to verify:
uv run invoke docs.build - Serve for human verification:
uv run invoke docs.serve
Restructuring existing docs
When restructuring, merging, or deleting existing pages (on any branch, not only the docs-revamp workflow):
- Inventory the old content. Every claim, example, and section from a deleted page gets a home in the new set or an explicit drop decision — including when-to-use guidance and basic CRUD paths, not just the headline topics.
- Add redirects. Every deleted or renamed published URL needs an entry in
docs/redirects-pending/in the same PR. - Close every spoke. In hub+spokes feature docs, each spoke ends with a
## Nextsection linking to adjacent spokes.
The migrate-feature-page skill documents the full workflow.
Boundaries
Always Do
- Run
uv run invoke docs.lintbefore committing - Build docs to check for broken links
- Use sentence case for headings
- Include language tags on code blocks
- Choose the appropriate documentation type (guide vs. topic)
- Define technical terms on first use
- Verify factual claims (attribute kinds, GraphQL fields, defaults, UI button and label text) against the code on the branch the PR targets — docs PRs frequently target a release branch whose features differ from the development branch; this applies doubly before acting on a bot review claim that something "does not exist". For
infrahubctl/SDK features, the reference is the commit thepython_sdksubmodule pins (git -C python_sdk show $(git rev-parse HEAD:python_sdk):<path>), not an SDK branch tip — and never bump the pin just to make docs resolve - When documenting marketplace items, verify each item actually resolves in the live catalog at https://marketplace.infrahub.app; if an item is planned but unpublished, get an explicit decision on release timing before referencing it
- When a page imports a file from outside
docs/(import x from '!!raw-loader!../../../../utilities/...'), add aCOPYline for that file to thedocsstage ofdevelopment/Dockerfile, then rundocker build --target docs -f development/Dockerfile .. That stage copies onlydocs/and the files listed there, souv run invoke docs.buildpasses while the container image build fails withModule not found - Prefer plain Markdown/MDX over custom React components in doc pages; before adding anything to
docs/src/components/, check the existing components for reuse, and give a genuinely new component typed props (the docs package typechecks withtsc)
Ask First
- New top-level navigation sections
- Docusaurus configuration changes
- Major restructuring of documentation hierarchy
Never Do
- Use "simple", "easy", or "just" (minimizes complexity)
- Leave broken links
- Commit large unoptimized images
- Skip alt text for images
- Mix guide and topic content in the same document
- Delete or rename a published docs page without adding a redirect entry in
docs/redirects-pending/(seedocs/redirects-pending/README.md)
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.

