Skip to content

docs(agents): route task rules out of AGENTS.md - #5429

Merged
dan-petty merged 5 commits into
mainfrom
docs/5421-route-task-rules-out-of-agents-md
Nov 13, 2026
Merged

dan-petty merged 5 commits into
mainfrom
docs/5421-route-task-rules-out-of-agents-md

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

AGENTS.md now holds only the rules that every task needs, the safety rules and the routing table, so each agent session and implement step reads 577 fewer tokens. It goes from 6,499 to 4,220 characters (35.1 percent). CONST_AGENTS_MD_MAX_CHARS goes from 6,500 to 4,500, which also caps the answer of devops ai agents in other repositories.

Moved rule Home
Alpha status, title, Closes, hard-wrap, backup form CONTRIBUTING.md
Rebase, archive, monitor, threads, queue, Copilot, no milestone docs/SDLC.md
Fail-to-pass run docs/TESTING.md
Feasibility, build cost openspec/config.yaml
devops roadmap return docs/ROADMAP_WORKFLOW.md
Model kinds ask-jev skill
A failing devops command docs/ROUTINE_TASKS.md
Release steps RELEASE_CYCLE.md
Private-data forms SECURITY.md rule 8

Closes #5421

Change: openspec/changes/archive/2026-11-13-5421-route-task-rules-out-of-agents/

The ask-jev skill now holds the rule that rule 13 of AGENTS.md held. A
test checks that the AGENTS.md table routes a closed model question to
the skill, and that the skill holds the rule. The test also lowers the
budget bound to 4,500 and reads the superseded-issue rule in
docs/SDLC.md.

Refs #5421.
AGENTS.md keeps the rules that every task needs, the safety rules and
the routing table: 4,216 characters, 35.1 percent fewer. Each moved
sentence has one home, and most homes held it already. SECURITY.md rule
8 names example.com for a domain. openspec/config.yaml names the cost
of a build with the words of the stage prompt.

CONST_AGENTS_MD_MAX_CHARS goes from 6,500 to 4,500. The tests that read
a moved sentence read its home.

Refs #5421.
Rule 10 keeps the private registry, the device path and the placeholders,
because the implement step reads AGENTS.md and not SECURITY.md for a k8s or tf
group. Rule 2 keeps the case of an item that newer issues or code replace.
Rule 7 keeps the limit of every devops ai call and links the ask-jev skill.
Rule 11 asks to comment before it files, and rule 13 keeps each necessary fact.
The backup form moves to the naming table of CONTRIBUTING.md, and
RELEASE_CYCLE.md owns the release workflow rule.
@dan-petty dan-petty added type/docs Type docs: a change to the documents scope/agents Agent instructions in AGENTS.md, skills and the agent hand-off labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Do not merge yet: the checks run now. I mark the pull request ready when they pass. No other hold.

Each moved sentence and its one home

Moved sentence (old rule) Home
Alpha before 1.0.0, no shim (intro) CONTRIBUTING.md section 1, "Pre-1.0 Alpha Status"
Rebase before each push (1) docs/SDLC.md Phase 6, "Current Branch at Every Push"
One pull request that closes it, Closes #<issue> (1) CONTRIBUTING.md section 4, "The Body Is the Commit Message"
Plan as openspec/changes/<issue>-<slug>/, archive in the last commit (1) docs/SDLC.md Phase 1, "Planning Artifacts"
Conventional Commit title, no ! before 1.0.0 (1) CONTRIBUTING.md section 4, "The Title Is the Changelog Line"
Record the premise in ## Feasibility (2) openspec/config.yaml, rules.proposal
Return to New with devops roadmap return (2) docs/ROADMAP_WORKFLOW.md (rule 2 keeps "return it with the evidence and stop")
Cost words: tokens to build, keep and fix it, elapsed time (3) openspec/config.yaml, "Existing Tool Considered" (rule 3 keeps "write the cost in tokens and time")
A fix pull request cites its fail-to-pass run (4) docs/TESTING.md, "Which change gets a test"
The pre-push hook runs the fast static checks; required checks gate the merge (5) docs/SDLC.md Phase 6, "Required Checks Gate the Merge"
devops pr monitor, devops pr ready (6) docs/SDLC.md Phase 6, "Mandatory PR Monitoring Gate"
Reply in each review thread (6) docs/SDLC.md Phase 6, "Mandatory Direct In-Thread Replies & Resolution"
Advance your pull requests oldest first (6) docs/SDLC.md Phase 6, "Sequential Pull Request Processing Queue"
Never request a Copilot review (6) docs/SDLC.md Phase 6, "Copilot Reviews"
devops paces each request against the rate limit (7) .agents/skills/devops-pr-ci/SKILL.md
Write code and documents as they read after the merge (8) The title of rule 8, "Write as merged"
The kinds of text that the style covers; no hard wrap of program output (9) CONTRIBUTING.md section 1, "Line Breaks Belong to Source Files"
The forms of hosts, registries and mount paths (10) SECURITY.md rule 8, "Repository Hygiene" (adds example.com for a domain)
A devops command that fails or warns (11) docs/ROUTINE_TASKS.md tenet 6
The form <path>.bak-<YYYYMMDD-HHMMSS> (12) CONTRIBUTING.md section 5, naming table (new row)
Decision model for a closed choice, generative model for text (13) ask-jev skill, linked from rule 7
release-merge.yml, release-please files, release workflow by ordinary pull requests RELEASE_CYCLE.md (line 3 no longer cites AGENTS.md)
Intake sets the priority; set no milestone or priority docs/SDLC.md Phase 1

Kept inline after the review

  • Rule 10 keeps the private registry, the device path and example.com, RFC 5737 and <storage-node>. The implement step reads AGENTS.md and gets SECURITY.md only for src/devops_cli/security/**, so a k8s/** or tf/** group needs them here. The step prompt cannot hold them: DROPPED_RULES in tests/roadmap/implement/test_roadmap_implement_prompt.py keeps project rules out of it (feat(roadmap): the implement step gives the agent AGENTS.md and the documents it routes to #3097).
  • Rule 2 keeps "If newer issues or code replace the item, close it as not planned." The triage line of docs/SDLC.md names the same cases.
  • Rule 7 keeps "only when no file or deterministic check can answer" for every devops ai call. The ask-jev skill copies are unchanged.
  • Rule 11 comments on the open issue first. Rule 13 keeps "each necessary fact".
  • The description line went out (not a rule; README.md holds it), to stay 35 percent below 6,499.

Sizes

  • AGENTS.md: 6,499 to 4,220 characters (6,501 to 4,222 bytes), 35.1 percent smaller; o200k tokens 1,691 to 1,114.
  • CONST_AGENTS_MD_MAX_CHARS: 6,500 to 4,500, 6.6 percent above the new size. The template renders 4,206 characters for devops-cli. The same constant caps the model answer of devops ai agents in each target repository, so that cap also goes from 6,500 to 4,500.

Checks run before the push

  • The 33 test files that read AGENTS.md, docs/SDLC.md, RELEASE_CYCLE.md, CONTRIBUTING.md or the ask-jev skill, with tests/invariants: 1,704 passed.
  • Stage prompt rules, stage cost units, fail-to-pass, tests/roadmap/implement, step rules, instruction generator, skills: 1,982 passed.
  • After the archive: test_agents_md.py and test_instruction_generator.py: 67 passed.
  • uv run devops ci --check --only lint,format,domain,docs,openspec: all rows pass.
  • The three new tests (safety rules inline, rule 2 replaced item, rule 7 limit and link) fail on the text of the first commit of this branch: its AGENTS.md lacks each needle.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 15:21
@dan-petty
dan-petty merged commit 87e813d into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the docs/5421-route-task-rules-out-of-agents-md branch November 13, 2026 15:22
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 84f857baf722270176e3c9ea7b28bcad55e02e9d

Check Conclusion Link
Audit Defect PR Hardening skipped run
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
CodeQL success run
Fail-to-Pass Check skipped run
Plan Check skipped run
Tests on Main skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Analyze (actions) success run
Analyze (python) success run
Tests & Coverage (shard 3 of 4) success run
Tests & Coverage (shard 1 of 4) success run
Tests & Coverage (shard 4 of 4) success run
Changed-Test Independence success run
Tests & Coverage (shard 2 of 4) success run
Design Tokens success run
MCP Server Image success run
Runner Image success run
Service Image success run
Static Analysis success run
Semantic PR title success run
Docs Site Build success run

Skipped check: Audit Defect PR Hardening
Skipped check: Fail-to-Pass Check
Skipped check: Plan Check
Skipped check: Tests on Main
Skipped check: Dependency Freshness
Skipped check: Test Job Duration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/agents Agent instructions in AGENTS.md, skills and the agent hand-off type/docs Type docs: a change to the documents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(agents): route task rules out of AGENTS.md

1 participant