exstruct
AGENTS.md204 starsChanged 7 months agoBSD-3-ClauseView on GitHub
This repository is organized around the following top-level directories: For internal development guidance, architecture notes, ADRs, specifications, and testing references, use dev-docs/ as the canonical location. Developer-facing documentation should be written there rather than scattered across the repository. The AI does not own the following areas. Humans make these decisions. However, the AI may make proposals. Before generating or modifying code, perform the following steps according to the scale of your work:
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 35,337 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 repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adr-drafterSkill
- adr-indexerSkill
- adr-linterSkill
- adr-reconcilerSkill
- adr-reviewerSkill
- adr-suggesterSkill
- codacy-issues-fetcherSkill
- exstruct-cliSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
31 rules. About 0 are common, 27 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈27
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Always start tasks with 3 or more steps, or tasks that affect architecture, in Plan mode
- Distinctive: line 30
If things stop going well partway through, do not force it.
- Distinctive: line 31
Use Plan mode not only for implementation, but also for verification steps
- Distinctive: line 32
Write detailed specifications before implementation to reduce ambiguity
- Distinctive: line 40
Use explorer for read-heavy codebase exploration
- Distinctive: line 41
Use worker for implementation and fixes
- Distinctive: line 42
Use reviewer for reviews
- Distinctive: line 47
Write rules for yourself so you do not repeat the same mistake
- Distinctive: line 48
Keep improving those rules thoroughly until the error rate goes down
- Distinctive: line 53
Do not mark a task as complete until you can prove that it works
- Distinctive: line 55
Ask yourself, "Would a staff engineer approve this?"
- Distinctive: line 56
Run tests, review logs, and show that it works correctly
- Distinctive: line 60
Before making an important change, pause and ask, "Is there a more elegant way to do this?"
- Distinctive: line 61
If a fix feels hacky, think, "Based on everything I know now, implement an elegant solution"
- Distinctive: line 67
When you receive a bug report, fix it directly without needing step-by-step guidance
- Distinctive: line 68
Use logs, errors, and failing tests to solve it yourself
- Distinctive: line 89
Before generating or modifying code, perform the following steps according to the scale of your work:
- Distinctive: line 92
Consider the design implications: Assess impact scope, compatibility with current designs, and alternative approaches.
- Distinctive: line 93
If necessary, create working notes:
- Distinctive: line 95
Add or update tests as needed.
- Distinctive: line 100
Update documentation, ADR documents, specifications, and the CHANGELOG as appropriate.
- Distinctive: line 105
If changes affect public APIs, they may require recording in the following documentation:
- Very specific: line 118
Only user-facing contracts such as public API, CLI, and MCP should be reflected in the corresponding documents under docs/.
- Distinctive: line 122
If you are unsure where to store a document, where to move it, or how to verify it, prefer using available skills over relying on manual …
- Very specific: line 123
Use adr-suggester to determine whether an ADR is needed, adr-drafter for ADR drafts or update proposals, adr-linter to lint drafts, …
- Very specific: line 124
Do not leave skill results trapped in temporary notes under tasks/.
- Distinctive: line 143
If there is content that will be referenced in the future, move it into permanent documentation before deleting anything.
- Distinctive: line 144
Do not discard decision rationale, specifications, or validation conditions before migration is complete.
- Distinctive: line 145
Only sections confirmed to contain no permanent information may be summarized, deleted, or archived.
- Distinctive: line 146
If ADR creation, spec creation, index synchronization, or design review is involved, and a corresponding skill exists, run it first and use …
- Very specific: line 148
Prefer dev-docs/adr/ for "why", dev-docs/specs/ for "what is guaranteed", and dev-docs/architecture/ for "how the structure works".
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
ExStruct AI Agents Guide
0. Overview
This repository is organized around the following top-level directories:
exstruct/
|- src/ # Main library and implementation code
|- tests/ # Automated tests
|- sample/ # Sample workbooks and example inputs
|- schemas/ # JSON schemas and validation-related assets
|- scripts/ # Utility and maintenance scripts
|- benchmark/ # Benchmark code and performance measurements
|- docs/ # User-facing documentation
|- dev-docs/ # All developer-facing documentation
|- tasks/ # Temporary task notes and working files
|- drafts/ # Draft documents and work-in-progress materials
|- dist/ # Build artifacts and packaged outputs
`- site/ # Generated documentation site outputFor internal development guidance, architecture notes, ADRs, specifications, and testing references, use dev-docs/ as the canonical location. Developer-facing documentation should be written there rather than scattered across the repository.
1. Workflow Design
1. Use Plan mode by default
- Always start tasks with 3 or more steps, or tasks that affect architecture, in Plan mode
- If things stop going well partway through, do not force it; stop immediately and replan
- Use Plan mode not only for implementation, but also for verification steps
- Write detailed specifications before implementation to reduce ambiguity
2. Multi-Agent Strategy
- Actively use sub-agents to keep the main context window clean
- Delegate research, investigation, and parallel analysis to sub-agents
- For complex problems, use sub-agents to apply more compute resources
- To keep execution focused, assign one task per sub-agent
- Use explorer for read-heavy codebase exploration
- Use worker for implementation and fixes
- Use reviewer for reviews
3. Self-Improvement Loop
- Whenever you receive a correction from the user, record that pattern in
tasks/lessons.md - Write rules for yourself so you do not repeat the same mistake
- Keep improving those rules thoroughly until the error rate goes down
- At the start of each session, review the lessons relevant to the project
4. Always verify before completion
- Do not mark a task as complete until you can prove that it works
- Compare the main branch and your changes when necessary
- Ask yourself, "Would a staff engineer approve this?"
- Run tests, review logs, and show that it works correctly
5. Pursue elegance (with balance)
- Before making an important change, pause and ask, "Is there a more elegant way to do this?"
- If a fix feels hacky, think, "Based on everything I know now, implement an elegant solution"
- Skip this process for simple and obvious fixes (do not over-engineer)
- Question your own work before presenting it
6. Autonomous bug fixing
- When you receive a bug report, fix it directly without needing step-by-step guidance
- Use logs, errors, and failing tests to solve it yourself
- Eliminate context switching for the user
- Even without being asked, go fix failing CI tests
2. Areas Outside the AI's Responsibility (Handled by Humans)
The AI does not own the following areas. Humans make these decisions.
- Specification decisions (the direction of ExStruct's evolution)
- Public API design (deciding whether something is a breaking change)
- Large-scale reorganization of the directory structure
- Security and licensing decisions
However, the AI may make proposals.
3. Task Management
Before generating or modifying code, perform the following steps according to the scale of your work:
- Understand the requirements: Review relevant specification documents, ADR documentation, and existing implementations.
- Consider the design implications: Assess impact scope, compatibility with current designs, and alternative approaches.
- If necessary, create working notes:
- For recurrence prevention:
tasks/lessons.md
- For recurrence prevention:
- Add or update tests as needed.
- Implement changes.
- Verify functionality.
- Run tests.
- Conduct self-review.
- Update documentation, ADR documents, specifications, and the CHANGELOG as appropriate.
- Any updates to ADR documents or specifications must be recorded in the respective directories:
- For ADR documents:
dev-docs/adr/ - For specification documents:
dev-docs/specs/ - If changes affect public APIs, they may require recording in the following documentation:
- Specification documents within
dev-docs/specs/ - Overview descriptions in the
README.mdfile
4. Documentation Retention Policy
Separation of Roles
tasks/lessons.mdis where recurrence-prevention rules are stored, and should not be used to store design decisions or the specification itself.- Permanent internal documentation belongs under
dev-docs/. - Move design decisions and trade-offs to
dev-docs/adr/, current internal specifications and constraints todev-docs/specs/, and implementation structure and extension guidance todev-docs/architecture/. - Only user-facing contracts such as public API, CLI, and MCP should be reflected in the corresponding documents under
docs/.
Using skills
- If you are unsure where to store a document, where to move it, or how to verify it, prefer using available skills over relying on manual judgment alone.
- Use
adr-suggesterto determine whether an ADR is needed,adr-drafterfor ADR drafts or update proposals,adr-linterto lint drafts,adr-reviewerfor design review,adr-reconcilerfor drift audits, andadr-indexerfor index synchronization. - Do not leave skill results trapped in temporary notes under
tasks/; reflect them in the appropriatedev-docs/ordocs/location as needed.
Information to Keep
- Decision rationale that future implementers may encounter again on the same issue
- Chosen policies adopted after comparing multiple options
- Permanent rules established through review, CI, Codacy, or incident response
- Contracts related to public API, CLI, MCP, output formats, validation, and compatibility
- Specification context behind added regression tests where forgetting the reason could cause the issue to recur
Information You May Discard
- One-off notes about work order
- Rejected hypotheses or interim notes that ended midway
- Progress logs with no reference value after completion
- Simple lists of steps with no decision rationale
Required Steps at Completion
- If there is content that will be referenced in the future, move it into permanent documentation before deleting anything.
- Do not discard decision rationale, specifications, or validation conditions before migration is complete.
- Only sections confirmed to contain no permanent information may be summarized, deleted, or archived.
- If ADR creation, spec creation, index synchronization, or design review is involved, and a corresponding skill exists, run it first and use its verdict and findings to decide the permanent document destination and what to reflect there.
- Choose the destination according to the role split defined in
dev-docs/README.md. - Prefer
dev-docs/adr/for "why",dev-docs/specs/for "what is guaranteed", anddev-docs/architecture/for "how the structure works".
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.

