Skip to content

chore(context7): limit Context7 indexing to the user docs - #99

Merged
baldurpan merged 1 commit into
mainfrom
chore/context7-config
Oct 4, 2026
Merged

baldurpan merged 1 commit into
mainfrom
chore/context7-config

Conversation

@baldurpan

Copy link
Copy Markdown
Contributor

What

Adds context7.json at the repo root, ahead of submitting northguild/worktree to Context7, and records it in context/stack.md.

By default, Context7 indexes every markdown file in a repo. Here that would be about 1,900 lines of user docs against more than 11,800 lines of planning artifacts in context/, plus the agent files under .claude/, .agents/ and .github/agents/. Agents asking how to use worktree would get plan ledgers back.

What gets indexed

Context7's owner docs say root-level markdown is always indexed, and that setting excludeFiles replaces the default exclusions.

Indexed (22 files) Excluded (119 files)
docs/src/app/docs/** (20 pages) docs/src/app/docs/changelog/ (release policy, not usage docs)
skills/worktree/SKILL.md context/, .claude/, .agents/, .github/agents/, .changeset/
root README.md docs/README.md, docs/worker/README.md
root AGENTS.md, CLAUDE.md, CHANGELOG.md (named in excludeFiles)

The counts come from running every tracked .md/.mdx file through Context7's documented rules. They are not from Context7's own parser, so check the result after submitting.

The six rules shown to agents each restate a passage of skills/worktree/SKILL.md. context/stack.md now names what has to keep this file in step: moving docs/src/app/docs/ or skills/, adding a new root .md, or changing one of the behaviours the rules describe.

No release note

context/** owes none per context/release.md. Root context7.json has no row there and isn't in the package's files list. The release-note check's path filter doesn't match either file.

Verification

  • pnpm check: exit 0. This is a docs/config-only change, so per context/verify.md Gate 1 is lint plus a read of the diff. Biome doesn't cover root JSON, so the file was also checked to parse.
  • Review (reviewer subagent): FAIL on the first pass, PASS after one fix. The first version of rule 3 said any remote ref skips the --source prompt, but src/commands/branch.ts:151 only exempts origin/.

After merge (maintainer steps, not in this PR)

  1. Submit the repo at context7.com/add-library and check that the indexed pages match the table above.
  2. Claim the library.
  3. Optionally, add Context7's refresh workflow. It needs a CONTEXT7_API_KEY repository secret from the Context7 dashboard, so it was left out rather than landed as a job that fails until that secret exists.

Add a context7.json so Context7 indexes only the docs pages under
docs/src/app/docs (minus the changelog page), skills/ and the root
README. Without it, the planning artifacts under context/ and the agent
files under .claude/ and .agents/ would outweigh the user docs roughly
six to one. AGENTS.md, CLAUDE.md and CHANGELOG.md are named in
excludeFiles because root-level markdown is always indexed and setting
excludeFiles replaces Context7's default exclusions.

The rules restate passages of skills/worktree/SKILL.md. context/stack.md
records the file and what has to keep it in step.
@baldurpan
baldurpan merged commit 1bf4735 into main Oct 4, 2026
1 check passed
@baldurpan
baldurpan deleted the chore/context7-config branch October 4, 2026 14:26
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.

1 participant