Repository navigation
Description
Problem or Motivation
The guidelines in docs/guidelines/ (SRE, production readiness, Kubernetes, agentic jobs) apply to each managed project. An agent in another repository does not find them: devops ai agents adds a "Where to look" row only for a local file that exists (CONST_AGENTS_MD_ROUTES in src/devops_cli/config/constants.py). A copy of each guideline in each repository would drift.
Proposed Solution & Architectural Design
- Add
CONST_DOCS_SITE_URLwith the value ofsite_urlofzensical.toml, andCONST_GUIDELINES_INDEX=docs/guidelines/index.md, the section page that lists each guideline. AGENTS.md.j2gets one fixed row: "apply a shared guideline". The row has 1 link: the local path of the index when it exists in the project (devops-cli), else<site_url>docs/guidelines/. The row names no topic and no file, so a new guideline changes no AGENTS.md, and a hand copy of the row in an existing AGENTS.md cannot drift.- A repository with an AGENTS.md keeps its file (
devops ai agentsdoes not overwrite it without--force). The production readiness guideline gets a row "AGENTS.md routes to the shared guidelines", which the readiness report (feat(roadmap): report production readiness in the project review #5537) measures and which prints the row to add. - The row must keep the scaffold under
CONST_AGENTS_MD_MAX_CHARS(4,500). docs(ai): trim the rules of the devops ai agents template #5430 measured 4,206 characters for the template and trims it; this item changes the same template, so the later of the two rebases on the other. - Update the knowledge base page of the instructions scaffolding.
Related: #5430 (the same template). The guideline index comes from the amendment of PR #5492.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
- GitHub default community health files (a public
.githubrepository) share only fixed files, such as CONTRIBUTING.md and SECURITY.md. They do not share other documents. - A link to the published page needs no tool.
Cost to build: about 25 lines with tests, about 50k tokens, about 2 hours.
Acceptance Criteria
- A test:
generate_agents_mdfor a project with nodocs/guidelines/index.mdgives the row with the site URL of the index. - A test: for a project that has the index, the row gives its relative path.
- A test:
CONST_DOCS_SITE_URLequalssite_urlofzensical.toml. -
tests/invariants/test_agents_md.pypasses, with the size test on the scaffold that has every routed document.
Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches surfaced only rulesync, a generator that copies one set of rules into each repository's AGENTS.md; it cannot emit one fixed row that links the published guidelines index, so no tool covers the need.
Covers:
- Generates AGENTS.md and other agent rule files from one source
- Writes rule files for several agent tools
- Keeps rule content identical across repositories
Lacks:
- No single fixed row linking a published guidelines index
- No choice between a local index path and the docs site URL
- Copies guideline text into each repository, so copies drift
Proposed design
Problem statement
An agent in another managed repository does not find the guidelines in docs/guidelines/ of devops-cli. devops ai agents adds a "Where to look" row only for a local file that exists (CONST_AGENTS_MD_ROUTES), so no row points at the shared guidelines, and a copy of each guideline in each repository would drift. This item adds one fixed row to the generated AGENTS.md that links the published guidelines index (the local index when the target holds it, else the docs site), and one constant that holds the site URL the row needs.
Acceptance criteria
Requirement: The shared guideline row for a project with no index
A generated AGENTS.md MUST route the task "apply a shared guideline" to the published guidelines index when the target holds no docs/guidelines/index.md.
Scenario: A target with no guideline index
- WHEN A test calls
generate_agents_md(parse_project_metadata(tmp_path))for a temporary project that has nodocs/guidelines/index.md. - THEN The "Where to look" table holds one row whose task is "apply a shared guideline" and whose link is
<CONST_DOCS_SITE_URL>docs/guidelines/.
Requirement: The shared guideline row for a project with the index
A generated AGENTS.md MUST route that task to the local docs/guidelines/index.md (CONST_GUIDELINES_INDEX) when the target holds the file.
Scenario: A target with the guideline index
- WHEN A test calls
generate_agents_md(parse_project_metadata(tmp_path))for a temporary project that holdsdocs/guidelines/index.md. - THEN The row for the task links
docs/guidelines/index.md, and the link resolves on disk.
Requirement: A new guideline leaves AGENTS.md unchanged
The generated row MUST NOT name a guideline topic or a guideline file.
Scenario: A guideline is added
- WHEN A test generates the AGENTS.md of a temporary project, adds
docs/guidelines/a-new-guideline.md, and generates it again. - THEN The two generated texts are equal.
Requirement: The docs site URL constant
CONST_DOCS_SITE_URL MUST hold the base URL of the published docs site, so that <CONST_DOCS_SITE_URL>docs/guidelines/ is the published guideline index.
Scenario: The constant matches the site settings
- WHEN A person runs
uv run devops gh pages verifyin the repository that holdsdocs/guidelines/index.md. - THEN The command passes and reports that the
site_urlofzensical.tomlequalsCONST_DOCS_SITE_URL.
Requirement: The invariants of the generated AGENTS.md
The change MUST keep tests/invariants/test_agents_md.py passing, with the fixed row counted in the routing table and the scaffold that holds every routed document at or below CONST_AGENTS_MD_MAX_CHARS.
Scenario: The invariants of the generated file
- WHEN A person runs
uv run pytest tests/invariants/test_agents_md.py. - THEN The file passes: the generated table holds the fixed row, and the scaffold with every routed document is at most 4,500 characters.
Requirement: The knowledge base page names the row and the constant
The change MUST update the knowledge base page of the instruction scaffolding with the fixed row and the site URL constant.
Scenario: The instruction scaffolding page
- WHEN A test reads
src/devops_cli/ai/knowledge_base/devops_cli/tasks/agent_instructions_scaffolding.md. - THEN The page names the "apply a shared guideline" row and
CONST_DOCS_SITE_URL.
Existing Tool Considered
The alternatives check of 2026-11-17 gives the verdict none; the closest open, maintained tool it considered is dyoshikawa/rulesync (MIT, last activity 2026-11-17), and the Lacks: list of that check's block in the issue body states what the tool lacks. The change builds one template row and one constant. Written cost, from the issue body: about 25 lines with tests, about 50k tokens, about 2 hours.
Key questions
- How does
generate_agents_mdbuild the route table of an AGENTS.md today, and what caps the file size?:CONST_AGENTS_MD_ROUTESatsrc/devops_cli/config/constants.py:212holds each routed path with the task it owns, in table order.parse_project_metadataatsrc/devops_cli/ai/instruction_generator.py:174keeps only the paths that exist in the target, inProjectMetadata.routed_documents(src/devops_cli/ai/instruction_generator.py:97), andgenerate_agents_mdatsrc/devops_cli/ai/instruction_generator.py:246renders one row for each of them; it receives the metadata only, not the target path.CONST_AGENTS_MD_MAX_CHARSatsrc/devops_cli/config/constants.py:209caps the file at 4,500 characters, andtests/invariants/test_agents_md.py:174holds the size test. [sources: src/devops_cli/config/constants.py:209, src/devops_cli/config/constants.py:212, src/devops_cli/ai/instruction_generator.py:97, src/devops_cli/ai/instruction_generator.py:174, src/devops_cli/ai/instruction_generator.py:246, tests/invariants/test_agents_md.py:174] - Where does the generator decide the link of the shared-guideline row?:
parse_project_metadatais the only function that knows the target path, so it records whetherCONST_GUIDELINES_INDEX(docs/guidelines/index.md) exists in a newProjectMetadatafield, andgenerate_agents_mdpasses the chosen link toAGENTS.md.j2as one template variable:docs/guidelines/index.mdwhen the target holds it, else<CONST_DOCS_SITE_URL>docs/guidelines/. The row text stays fixed in the template and names no guideline topic and no guideline file. (best practice) [sources: src/devops_cli/ai/instruction_generator.py:97, src/devops_cli/ai/instruction_generator.py:174, src/devops_cli/ai/instruction_generator.py:217, src/devops_cli/ai/instruction_generator.py:246, src/devops_cli/templates/AGENTS.md.j2:34]- Chosen: Record the index in
parse_project_metadataand pass the link to the template.generate_agents_mdreceives no path, andparse_project_metadataalready tests each routed path against the resolved target (src/devops_cli/ai/instruction_generator.py:217); the template then renders one fixed row for every project. - Rejected: Add the row to
CONST_AGENTS_MD_ROUTES. That table writes a row only for a path that exists, so a project without the index gets no row at all (src/devops_cli/ai/instruction_generator.py:217). - Rejected: Write the absolute URL as a literal row in
AGENTS.md.j2. devops-cli's own copy of the row would then point at the site, not at its local index, and no variable could change it.
- Chosen: Record the index in
- Where does the published docs site URL come from, and what proves it matches
zensical.toml?:CONST_DOCS_SITE_URLinsrc/devops_cli/config/constants.pyholds thesite_urlofzensical.toml(https://dan-petty.github.io/devops-cli/,zensical.toml:13), becausedevops ai agentsruns against another repository that has nozensical.toml.devops gh pages verifyalready readszensical.tomland reportssite_url(src/devops_cli/github/pages.py:78), so it gains one comparison: in the repository that holdsdocs/guidelines/index.md(the one that publishes the guidelines) it passes only when thatsite_urlequalsCONST_DOCS_SITE_URL, and a managed project's own site is not compared with it. The live checkuv run devops gh pages verifythen proves the two agree, and the same pull request amends thegithub-pagesrequirement (openspec/specs/github-pages/spec.md:35). (best practice) [sources: src/devops_cli/config/constants.py:261, zensical.toml:13, src/devops_cli/github/pages.py:78, openspec/specs/github-pages/spec.md:35, docs/guidelines/index.md]- Chosen: A constant, compared by
devops gh pages verifyin the repository that holds the guideline index. The command already readszensical.tomland printssite_url(src/devops_cli/github/pages.py:78), and only the repository that publishes the guidelines mirrors that URL. - Rejected: Read
site_urlfromzensical.tomlwhen the command runs. A managed project holds nozensical.toml, so the command would have no URL for it. - Rejected: A test that parses
zensical.toml. The project refuses a new test that reads a committed config file (docs/TESTING.md:62,tests/gate/tree_checks/config_values.py:80), so the agreement goes to the command that already reads the file.
- Chosen: A constant, compared by
- Does
docs/guidelines/index.mdexist, and does it list each guideline?: Yes.docs/guidelines/index.md:5lists each of the four guidelines (agentic jobs, Kubernetes, production readiness, SRE), andtests/invariants/test_guidelines.pyfails when a guideline of the folder has no line in the index. The page defines a guideline as a rule that applies with no change to each managed project and states that the docs site publishes it. [sources: docs/guidelines/index.md:3, docs/guidelines/index.md:5, tests/invariants/test_guidelines.py, CONTEXT.md] - Does
devops ai agentsoverwrite an AGENTS.md that a repository already holds?: No.src/devops_cli/commands/ai.py:986refuses to overwrite an existingAGENTS.mdwithout--force, so a repository that holds its own file keeps it;--forcereplaces it with the generic router. [sources: src/devops_cli/commands/ai.py:986, CHANGELOG.md:4975] - Does the new row wait for docs(ai): trim the rules of the devops ai agents template #5430, which trims the same template?: No.
CONST_AGENTS_MD_MAX_CHARScaps the file at 4,500 characters andtests/invariants/test_agents_md.py:174fails when the scaffold grows past it, so the size test is the gate. docs(ai): trim the rules of the devops ai agents template #5430 and this item change the same template, so the later pull request rebases on the other. (best practice) [sources: src/devops_cli/config/constants.py:209, tests/invariants/test_agents_md.py:174]- Chosen: Land in either order and rebase the later pull request. The size test decides whether the row fits, and the cap is already at 4,500 characters.
- Rejected: Wait for docs(ai): trim the rules of the devops ai agents template #5430 to merge first. It delays the row for a merge order that a rebase settles, and the size test already guards the cap.
- Is the row in the production readiness guideline part of this item?: No. The guideline already holds the row:
OWN-7atdocs/guidelines/production-readiness.md:39saysAGENTS.mdroutes the agents to the shared guidelines, with a link to the guideline index in its "Where to look" table, and that table is its measure. Nothing remains to add to the guideline here; the report of feat(roadmap): report production readiness in the project review #5537 that reads the row is that item's work, so the deferral is dropped. (best practice) [sources: docs/guidelines/production-readiness.md:39]- Chosen: Keep the guideline row out of this item because it already exists.
OWN-7already states the row and its measure, so a new issue would carry no work. - Rejected: Defer the guideline row to a new issue that waits on feat(roadmap): report production readiness in the project review #5537. The row exists, so the deferred issue would duplicate
OWN-7.
- Chosen: Keep the guideline row out of this item because it already exists.
- Is the knowledge base page of the instruction scaffolding generated or hand-written?: Hand-written. The page is
src/devops_cli/ai/knowledge_base/devops_cli/tasks/agent_instructions_scaffolding.md, and no generator writes it:devops docs generatewrites onlydocs/commands/*.mdanddocs/CLI_REFERENCE.md(.tuicrignore:6). The change edits the page; it does not regenerate it. [sources: src/devops_cli/ai/knowledge_base/devops_cli/tasks/agent_instructions_scaffolding.md:5]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both items change how AGENTS.md routes content, but #5421 removes task rules while this candidate adds a row that links to shared guidelines.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: Searches found only rule-file generators that build per-repo AGENTS.md copies and a closed beta sync service that writes files into each repo; none points an agent at a published guidelines index, so the template row and URL constant are the work.
Tool: none found
Lacks:
Searches (10)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 86358b6 (see proposed design in issue body).