Skip to content

docs(agents): AGENTS.md routes each task to the document that owns it, and no agent prompt or instruction carries the legacy process - #1975

Merged
dan-petty merged 1 commit into
mainfrom
docs/1961-agents-router
Oct 23, 2026
Merged

dan-petty merged 1 commit into
mainfrom
docs/1961-agents-router

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Every agent reads AGENTS.md in full at the start of each session. The file held 36,534 characters of rules, and many of them repeated, contradicted or outlived the documents that own the subject. The owner asked on 2026-10-23 for agent files that route to other documents instead of thousands of lines of instructions.

  • AGENTS.md is now a router of 6,221 characters. It holds the purpose, 13 rules that every task needs, one paragraph on what only a person does and on releases, and a table of 15 rows that sends each kind of task to the document that owns it. CONST_AGENTS_MD_MAX_CHARS is 6,500.
  • Each rule that AGENTS.md held is in its owner, or is deleted. CONTRIBUTING.md, ARCHITECTURE.md section 7, SECURITY.md (new principles 8, 9 and 10), docs/TESTING.md, k8s/README.md and docs/SDLC.md Phase 6 received the rules that they did not state yet.
  • The owner decisions of 2026-10-23 apply. An agent returns an item to New itself. The "Continuous Interaction" rule is deleted. release-please writes CHANGELOG.md, .release-please-manifest.json and the version lines, so nobody edits those by hand, and agents change the release workflow and its configuration through ordinary pull requests. The rule "Agents take no part in releases", the release pull request exclusion of the FIFO rule and the Release-As rule are deleted. RELEASE_CYCLE.md, docs/SDLC.md, docs/ROUTINE_TASKS.md and the knowledge base say the same.
  • devops ai agents renders the router for another repository from src/devops_cli/templates/AGENTS.md.j2 through devops_cli.core.templating, and the stubs from pointer_stub.md.j2. The router names no path, setting or dependency of devops-cli and no writing standard. Its table has a row for each document of CONST_AGENTS_MD_ROUTES that exists in the target, and its push rule names the pre-push hooks of the target. is_devops_cli, the alpha notice of the stubs, the f-string template and its # nosec B608 are deleted, so the src nosec ceiling falls from 14 to 13. The inline prompt of src/devops_cli/commands/ai.py moved to src/devops_cli/ai/tasks/generate_agents.md. The model gets the cap and the documents that exist, and an answer longer than the cap is replaced by the template.
  • The prompts, the personas, the knowledge base, openspec/config.yaml, docs/agent/README.md, .devops/review.md, docs/SDLC.md and docs/ROUTINE_TASKS.md lose the legacy process: task status in task files, card moves before an edit, implementation plans outside OpenSpec, wrong MCP tool names, stale gate lists, a release/* branch in a benchmark prompt, a bare gh release download example and a token piped into gh auth login.

Evidence:

  • tests/test_agents_md_claims.py holds AGENTS.md and the generated router within the cap, checks that each row of the table links a document that exists, checks that a generated router routes only to documents that exist, and fails when an agent instruction names a deleted process (CONST_DELETED_PROCESS_TERMS). A negative control checks the scan.
  • tests/test_instruction_generator.py checks the router shape, the pre-push commands, the stubs and the model fallback.
  • Ten of the new or changed tests failed before the change and pass after it.
  • uv run devops docs generate --sync-readme, uv run devops docs check and uv run devops openspec check pass.

Item

Closes #1961

Task file: docs/agent/tasks/task-1961-agents-router.md

…, and no agent prompt or instruction carries the legacy process

AGENTS.md is a router of 6,221 characters: the purpose, 13 rules that every task needs, what only a person does, and a table that sends each kind of task to the document that owns it. Each other rule is in its owner (CONTRIBUTING.md, ARCHITECTURE.md, SECURITY.md, docs/TESTING.md, k8s/README.md, docs/SDLC.md) or is deleted. CONST_AGENTS_MD_MAX_CHARS is 6,500.

devops ai agents renders the router and the pointer stubs from Jinja2 templates. The router names no path of devops-cli, routes only to documents that exist in the target, and names the pre-push hooks of the target. The inline prompt moved to ai/tasks/generate_agents.md, and a model answer over the cap falls back to the template.

The prompts, personas, knowledge base, openspec/config.yaml and the routed documents lose the legacy process. A test fails when an agent instruction names a deleted process.

Closes #1961
@dan-petty
dan-petty marked this pull request as ready for review October 23, 2026 19:48
@dan-petty
dan-petty merged commit 82b6a67 into main Oct 23, 2026
16 checks passed
@dan-petty
dan-petty deleted the docs/1961-agents-router branch October 23, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(agents): AGENTS.md routes each task to the document that owns it, and no agent prompt or instruction carries the legacy process

1 participant