chore: add context7.json so agents get v5, not v4 - #3091
Open
vishr wants to merge 2 commits into
Open
Conversation
Context7 is what many AI coding agents query for library documentation. Echo's entry there currently reports `versions: ["v4.15.0"]` with no v5 at all, so an agent asking Context7 for Echo gets the v4 API and writes v4 code against a v5 module. This pins the parsed branch to master (v5), records the v4 branch as a previous version so both remain queryable, and spells out the v5/v4 split in `rules` -- most importantly the signature change from `func(c echo.Context) error` to `func(c *echo.Context) error`, which is the difference that makes v4 snippets fail to compile. Claiming the entry additionally needs `url` and `public_key` from the Context7 dashboard, which has to be generated by the account that owns the project; that is not in this commit. Claude-Session: https://claude.ai/code/session_01ABWLbEypvJUVLLY26pHxtT
`url` and `public_key` come from the Claim Library dialog at context7.com/labstack/echo/admin. Both are claim identifiers meant to be published in the repository root, which is how Context7 verifies that whoever configured the library controls the repo. Verification reads the default branch, so the claim can only be completed once this is merged to master. Claude-Session: https://claude.ai/code/session_01ABWLbEypvJUVLLY26pHxtT
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.
Why
Context7 is what many AI coding agents query for library documentation. Echo's records there are fragmented, and the one that scores highest is v4-only:
/labstack/echo["v4.15.0"]/labstack/echox/websites/echo_labstackAn agent asking Context7 about Echo resolves to the first row and gets the v4 API — then writes v4 code against a v5 module. This is a large part of why "Echo code from an LLM doesn't compile."
What this does
Adds
context7.jsonat the repo root:branch: masterso v5 is what gets parsedpreviousVersions: [{ branch: "v4" }]so v4 stays queryable rather than disappearingexcludeFoldersfor_test,_fixture,.githubrulesstating the v5/v4 split, most importantly:Verified against the source rather than from memory:
context.go:63type Context struct,echo.go:130type HandlerFunc func(c *Context) error, againstv4'stype Context interface/func(c Context) error.Not in this PR
Claiming the entry needs
urlandpublic_keyfrom context7.com/dashboard, which only the account owning the project can generate. Merging the three fragmented records needs an upstream issue atupstash/context7.Companion PR on the docs site: labstack/echox#438.
https://claude.ai/code/session_01ABWLbEypvJUVLLY26pHxtT