Is your feature request related to a problem? Please describe.
AI coding agents (GitHub Copilot, Copilot coding agent, the daily Test Improver workflow, and the CLI Consistency Checker workflow) work on PRs in this repo but have no single authoritative document describing the rules they must follow. As a result agents sometimes emit code that violates CI checks — using yaml.dump() to file handles instead of yaml_io.dump_yaml(), using str(path.relative_to(base)) instead of portable_relpath(), or producing CLI help text that fails the consistency checker. Every failure wastes a CI cycle and requires a human to explain the rule to the agent again.
Ironically, both daily-test-improver.md and cli-consistency-checker.md already contain the instruction "read AGENTS.md first" — but the file does not exist.
Describe the solution you'd like
Create AGENTS.md at the repository root (next to README.md) as the authoritative, agent-readable contract for all coding agents working in this repository. The file must be read by every agent before making any code change.
Task breakdown
1. Audit workflows for all agent-visible rules
2. Write AGENTS.md
3. Validate the file
4. Keep AGENTS.md in sync
Rules currently enforced in CI (must all appear in AGENTS.md)
| Source |
Rule |
ci.yml |
Python 3.12; uv for all dep management |
ci.yml lint |
No yaml.dump() to file handles outside utils/yaml_io.py (use yaml_io.dump_yaml()) |
ci.yml lint |
No str(x.relative_to(y)) — use portable_relpath() from apm_cli.utils.paths |
ci.yml |
uv run pytest tests/unit tests/test_console.py -n auto --dist worksteal must pass |
ci-integration.yml |
Fork PRs require maintainer approval; scripts/test-*.sh run from main only |
codeql.yml |
Python + Actions static analysis; no known CWEs |
cli-consistency-checker |
Consistent help text structure and flag naming; docs/cli-reference.md parity |
daily-test-improver |
Read AGENTS.md first; no new test deps; no generated files in commits |
Describe alternatives you've considered
- Put the rules in
CONTRIBUTING.md: human-oriented prose; agents need machine-scannable, structured, short directives. A separate AGENTS.md follows the convention established by projects like google/adk-python.
- Put the rules inline in each workflow file: agents would need to read ~6 workflow files to reconstruct the full ruleset on every task. A single
AGENTS.md is faster and less error-prone.
- Rely on CI to teach agents by failure: wastes CI minutes and requires human intervention. Proactive documentation is strictly better.
Additional context
- Both
daily-test-improver.md and cli-consistency-checker.md already contain "read AGENTS.md first" — the file is expected but absent. Creating it closes that gap immediately.
copilot-setup-steps.yml should be updated to reference AGENTS.md so Copilot coding agents receive it as part of their initial context.
- The
AGENTS.md convention is documented by Anthropic and widely adopted in open-source repositories that integrate AI coding agents.
Is your feature request related to a problem? Please describe.
AI coding agents (GitHub Copilot, Copilot coding agent, the daily Test Improver workflow, and the CLI Consistency Checker workflow) work on PRs in this repo but have no single authoritative document describing the rules they must follow. As a result agents sometimes emit code that violates CI checks — using
yaml.dump()to file handles instead ofyaml_io.dump_yaml(), usingstr(path.relative_to(base))instead ofportable_relpath(), or producing CLI help text that fails the consistency checker. Every failure wastes a CI cycle and requires a human to explain the rule to the agent again.Ironically, both
daily-test-improver.mdandcli-consistency-checker.mdalready contain the instruction "read AGENTS.md first" — but the file does not exist.Describe the solution you'd like
Create
AGENTS.mdat the repository root (next toREADME.md) as the authoritative, agent-readable contract for all coding agents working in this repository. The file must be read by every agent before making any code change.Task breakdown
1. Audit workflows for all agent-visible rules
.github/workflows/file and extract linting, testing, and convention rules an agent could violatedocs/cli-reference.mdand extract CLI documentation conventionsdocs/contributing.md(if present) for code style and contribution rules.pre-commit-config.yaml,pyproject.tomllint sections, orruff.tomland extract enforced linting rulespyproject.tomlfor pytest options, coverage thresholds, and markers2. Write
AGENTS.mduv sync --extra dev --extra build,uv run apm --versionCommandLoggerfor output;yaml_io.dump_yaml()for YAML writes;portable_relpath()for path strings; no rawprint()--verbose/-v,--dry-run,--yes/-y); every new command/flag must appear indocs/cli-reference.md; no TODO markers in help stringstests/unit/vstests/integration/; mock all network calls in unit tests; no new external test deps without a tracked issue; no generated files in commitsmarketplace/archive.pysafe extraction helpersscripts/test-*.shin the same PR as feature changes; integration tests always run frommainbranch scripts3. Validate the file
yaml-iogrep,portable_relpathgrep) against the repo to confirm documented patterns are accurateAGENTS.mdand verify it can set up and pass CI from scratchcopilot-setup-steps.ymlstill passes after adding the file4. Keep
AGENTS.mdin syncAGENTS.mdas the agent-facing documentation for that ruleAGENTS.mdin the same PRdaily-test-improverandcli-consistency-checkerworkflows honour the "read AGENTS.md first" instruction once the file existsRules currently enforced in CI (must all appear in
AGENTS.md)ci.ymlci.ymllintyaml.dump()to file handles outsideutils/yaml_io.py(useyaml_io.dump_yaml())ci.ymllintstr(x.relative_to(y))— useportable_relpath()fromapm_cli.utils.pathsci.ymluv run pytest tests/unit tests/test_console.py -n auto --dist workstealmust passci-integration.ymlscripts/test-*.shrun frommainonlycodeql.ymlcli-consistency-checkerdocs/cli-reference.mdparitydaily-test-improverDescribe alternatives you've considered
CONTRIBUTING.md: human-oriented prose; agents need machine-scannable, structured, short directives. A separateAGENTS.mdfollows the convention established by projects likegoogle/adk-python.AGENTS.mdis faster and less error-prone.Additional context
daily-test-improver.mdandcli-consistency-checker.mdalready contain"read AGENTS.md first"— the file is expected but absent. Creating it closes that gap immediately.copilot-setup-steps.ymlshould be updated to referenceAGENTS.mdso Copilot coding agents receive it as part of their initial context.AGENTS.mdconvention is documented by Anthropic and widely adopted in open-source repositories that integrate AI coding agents.