web-of-flaws / scripts
AGENTS.md8 starsChanged 3 months agoMITView on GitHub
This directory contains Python tooling for repository validation, catalog generation, guide parsing, standards validation, label synchronization, and related maintenance tasks. These scripts are part of the repository's integrity layer. Changes here may affect guides, generated catalog data, CI validation, and downstream machine-readable consumers. - Prefer the Python standard library unless an external dependency provides substantial value. - Add type annotations to function parameters and return values. - Prefer precise types over Any. - Use pathlib.Path for filesystem paths. - Read…
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 repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- catalog/AGENTS.mdAGENTS.md
- .github/actions/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/scripts/AGENTS.mdAGENTS.md
- guides/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
38 rules. About 0 are common, 29 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈29
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Prefer the Python standard library unless an external dependency provides substantial value.
- Distinctive: line 14
Add type annotations to function parameters and return values.
- Very specific: line 15
Prefer precise types over Any.
- Very specific: line 16
Use pathlib.Path for filesystem paths.
- Distinctive: line 17
Read and write text files using explicit UTF-8 encoding.
- Distinctive: line 18
Prefer immutable data structures for configuration and value objects when practical.
- Distinctive: line 19
Keep module-level mutable state to a minimum.
- Distinctive: line 20
Keep parsing, validation, transformation, filesystem I/O, subprocess execution, and CLI handling separated when practical.
- Distinctive: line 22
Prefer pure functions for repository-domain logic so behavior can be tested without filesystem or process side effects.
- Distinctive: line 24
Keep functions focused on one responsibility.
- Distinctive: line 25
Prefer explicit control flow over clever or overly compact implementations.
- Distinctive: line 27
Do not silently swallow parsing, validation, filesystem, or subprocess errors.
- Distinctive: line 32
Do not rely on the caller's current working directory unless that is an explicit interface requirement.
- Distinctive: line 34
Do not rely on filesystem traversal order.
- Distinctive: line 36
Prefer generating complete output in memory before replacing an existing generated file.
- Distinctive: line 37
Use temporary files or directories for intermediate state when needed.
- Distinctive: line 38
Avoid modifying unrelated repository files as a side effect of validation.
- Distinctive: line 42
Use proper parsers for structured formats.
- Distinctive: line 43
Do not parse JSON, YAML, or similar structured data with regular expressions or shell pipelines.
- Distinctive: line 47
Do not silently normalize malformed security metadata when rejection is safer.
- Distinctive: line 49
Treat guide schema and catalog structure as compatibility-sensitive contracts.
- Very specific: line 53
Use subprocess.run() with an argument list.
- Very specific: line 54
Never use shell=True with dynamic or repository-controlled input.
- Distinctive: line 55
Do not construct shell commands by concatenating strings.
- Very specific: line 57
Use check=True when failure should abort immediately.
- Very specific: line 58
Use check=False only when the return code is intentionally handled.
- Distinctive: line 64
When selective or incremental validation cannot reliably determine what must run, fall back to the broader validation.
- Distinctive: line 66
Never interpret missing Git metadata, malformed input, or detection uncertainty as permission to skip a check.
- Distinctive: line 67
Prefer running extra validation over silently missing an affected repository invariant.
- Distinctive: line 73
Keep runtime dependencies minimal.
- Very specific: line 75
Update pyproject.toml and uv.lock together when dependency state changes.
- Distinctive: line 76
Use locked dependency execution where the repository already provides it.
- Distinctive: line 77
Do not update dependency locks implicitly during validation.
- Distinctive: line 83
Test observable behavior and repository invariants, not internal implementation details.
- Very specific: line 84
Prefer real temporary filesystem fixtures over mocking Path.
- Very specific: line 88
Keep shared fixture-building helpers in scripts/tests/support.py when they are genuinely reusable.
- Distinctive: line 89
Do not weaken assertions merely to accommodate changed implementation behavior.
- Distinctive: line 102
If mutation-tested logic changes, also run the relevant mutation test command defined by the repository.
≈ “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
Python Repository Tooling Instructions
Scope
This directory contains Python tooling for repository validation, catalog generation, guide parsing, standards validation, label synchronization, and related maintenance tasks.
These scripts are part of the repository's integrity layer. Changes here may affect guides, generated catalog data, CI validation, and downstream machine-readable consumers.
Python Rules
- Prefer the Python standard library unless an external dependency provides substantial value.
- Add type annotations to function parameters and return values.
- Prefer precise types over
Any. - Use
pathlib.Pathfor filesystem paths. - Read and write text files using explicit UTF-8 encoding.
- Prefer immutable data structures for configuration and value objects when practical.
- Keep module-level mutable state to a minimum.
- Keep parsing, validation, transformation, filesystem I/O, subprocess execution, and CLI handling separated when practical.
- Prefer pure functions for repository-domain logic so behavior can be tested without filesystem or process side effects.
- Keep functions focused on one responsibility.
- Prefer explicit control flow over clever or overly compact implementations.
- Catch only exceptions that can be handled meaningfully.
- Do not silently swallow parsing, validation, filesystem, or subprocess errors.
Filesystem and Generated Data
- Resolve the repository root from the script location when behavior depends on repository-relative paths.
- Do not rely on the caller's current working directory unless that is an explicit interface requirement.
- Sort filesystem-derived collections when order affects generated output or diagnostics.
- Do not rely on filesystem traversal order.
- Generated output must be deterministic.
- Prefer generating complete output in memory before replacing an existing generated file.
- Use temporary files or directories for intermediate state when needed.
- Avoid modifying unrelated repository files as a side effect of validation.
Structured Data and Validation
- Use proper parsers for structured formats.
- Do not parse JSON, YAML, or similar structured data with regular expressions or shell pipelines.
- Validate required fields and expected value shapes explicitly.
- Reject unsupported or unexpected fields when the repository format is intentionally strict.
- Detect duplicate identifiers and conflicting entries.
- Do not silently normalize malformed security metadata when rejection is safer.
- Centralize shared guide/catalog validation rules instead of duplicating them across scripts.
- Treat guide schema and catalog structure as compatibility-sensitive contracts.
Subprocess Rules
- Use
subprocess.run()with an argument list. - Never use
shell=Truewith dynamic or repository-controlled input. - Do not construct shell commands by concatenating strings.
- Set
cwdexplicitly when command behavior depends on repository location. - Use
check=Truewhen failure should abort immediately. - Use
check=Falseonly when the return code is intentionally handled. - Capture subprocess output only when it is consumed.
- Preserve useful failure context in diagnostics.
Fail-safe Validation
- When selective or incremental validation cannot reliably determine what must run, fall back to the broader validation.
- Never interpret missing Git metadata, malformed input, or detection uncertainty as permission to skip a check.
- Prefer running extra validation over silently missing an affected repository invariant.
- Validation scripts should detect invalid state, not automatically repair it unless repair is the explicit purpose of the script.
Dependencies
- Keep runtime dependencies minimal.
- Pin every added Python dependency to an exact version.
- Update
pyproject.tomlanduv.locktogether when dependency state changes. - Use locked dependency execution where the repository already provides it.
- Do not update dependency locks implicitly during validation.
Tests
- Behavioral changes in
scripts/must be covered by tests inscripts/tests/. - Bug fixes should include a regression test when practical.
- Test observable behavior and repository invariants, not internal implementation details.
- Prefer real temporary filesystem fixtures over mocking
Path. - Tests must not modify the real repository.
- Tests must not depend on network access, developer credentials, or execution order.
- Cover meaningful success, failure, malformed-input, and boundary cases.
- Keep shared fixture-building helpers in
scripts/tests/support.pywhen they are genuinely reusable. - Do not weaken assertions merely to accommodate changed implementation behavior.
Required Checks
For changes under scripts/, run:
ruff check scripts
ruff format --check scripts
python3 -m unittest discover -s scripts/tests -v
python3 scripts/check.pyIf mutation-tested logic changes, also run the relevant mutation test command defined by the repository.
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.

