docs: Add llms.txt and make guidance pages self-describing - #22
Merged
Conversation
An LLM answering from memory usually cannot name this repository, and one model that did recall it then invented its directory structure. An agent that fetches the repository should not have to guess at the layout. Add a curated, annotated index covering every policy/ capability page and every infra/ pattern, one line each, saying which question that resource answers. Modelled on the AWS Networking Best Practices llms.txt. Also record it in CONVENTIONS.md as a fourth index that must be kept synchronized when a page or pattern is added, removed, or renamed -- without that, it goes stale on the next pattern change, which is exactly the failure the existing synchronization rule guards against. Links are relative throughout, so they survive the pending org transfer and rename. No llms-full.txt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Guidance pages here are usually reached directly — from a link someone sent, or from a search — rather than by browsing from the README. Three changes make a page state what it covers before anyone opens it, plus an index for tooling that fetches the repository.
llms.txtat the repository root. An annotated index of everypolicy/page and everyinfra/pattern, one line each, saying which question that resource answers. Written for an AI agent that has fetched the repository and needs to know what is here rather than guessing at the directory structure — the observed failure mode was a model inventing directory names. Relative links only, and deliberately nollms-full.txt.titleanddescriptionfront matter on all 10policy/pages and all 7 tier 1 / tier 2infra/READMEs. Each title says what the page answers instead of repeating the filename:# Service insertionCloud WAN service insertion: send-to and send-via for centralized traffic inspection# Static routesCloud WAN static routes: create-route and blackhole routes in a segmentHeadings, anchors and technical content are unchanged; each page gains five lines.
Retitled
##and###headings onpolicy/3-attachment_policies.mdandpolicy/7-routing_policies.md— 14 headings. These are the two longest capability pages, and their use-case sections were titled as prose statements naming none of the mechanisms they demonstrate. "An external partner gets its own segment" offers nothing to a reader scanning foraccountconditions. Each heading now names the policy key or attribute and the scenario, which is how5-service_insertion.md,8-and9-were already written:### An external partner gets its own segment### account conditions with association-method: constant: an external partner gets its own segment### Preferring one Region's hybrid edge### prepend-asn-list: AS_PATH prepending to prefer one Region's hybrid edge### Verify policy effects with the right API### get-network-routes versus list-core-network-routing-information: verify policy effects with the right APINo body text, code block or policy JSON was changed. The only non-heading edits are four internal anchor links that the renames broke.
CONVENTIONS.mdgains two rules so this does not decay: Front matter on guidance pages (§2, next to Documentation tiers, whose tier vocabulary it uses) and Headings name the mechanism, not only the scenario (§6).llms.txtis registered in the existing index-synchronization rule, so it must be updated whenever a page or pattern is added, removed or renamed.Breaking: moved anchors
Deep links to these
policy/3-attachment_policies.mdsections will 404. Every in-repo link is updated; no redirect stubs, given the pending org transfer.Nine section anchors on
policy/7-routing_policies.mdmoved as well. The anchors linked from elsewhere in the repository —#action,#routing-policy-direction,#routing-policy-rules,#how-rules-are-evaluated— were left unchanged on purpose, so no cross-file link required editing.Where is the change?
infra/— front matter on the 7 pattern/index READMEs only; no IaC, no template, no baseline policy changedpolicy/— front matter on all 10 pages, plus headings on3-and7-SKILLS.md— unchangedChecklist for every change
pre-commit run --all-filespasses locally — verified for every hook this change can affect:check-policies,check-yaml,check-json,lychee,end-of-file-fixer,trailing-whitespace,check-merge-conflict. The Terraform, cfn-lint and Checkov hooks act only on files this PR does not touch.If the change is in
infra/infra/README.mdand theSKILLS.mdselector are unchanged and still accurate. The tags the IaC applies and theattachment-policiesthat expect them are both untouched.llms.txtlists all six patterns.If the change is in
policy/check_policies.pycounts the same 64 inline snippets as before.#headings are unchanged, sopolicy/README.mdand bothSKILLS.mdtables still resolve.llms.txtlists all nine capability pages.SKILLS.mdneeds no update.python3 .github/scripts/check_policies.py): 7 policy documents, 64 snippets, all pass.Testing
Static validation only. Nothing was deployed — this change touches documentation exclusively, and no template, Terraform file or baseline policy was modified.
pre-commithooks listed above all pass, includinglycheeacross every markdown file.python3 .github/scripts/check_policies.pypasses: CloudFormation templates still match theirbaseline.json, all documents structurally valid, 64 snippets parse.](...)target. This is what caught that four self-links insidepolicy/3andpolicy/7needed updating.SKILLS.md(×2),policy/5-service_insertion.mdandpolicy/9-attachment_routing_policy_rules.md— all target headings that were deliberately left unchanged.titleanddescription, blank line before the#heading.github.com/aws-samples/...URLs added anywhere, so nothing in this PR breaks at the pending org transfer and rename.