add-doc
Skill0 starsChanged 13 months agoMITView on GitHub
Add new documentation sources to .claude/doc-sources.toml for Context7 access
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ir0nfelix/study_materialstheir own version, first seen Oct 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ir0nfelix/study_materials★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Add new tool documentation sources to enable real-time documentation queries via the doc-query skill.
- Distinctive: line 14
Adopting a new tool: - After creating/updating ADR for tool selection
- Distinctive: line 30
Before adding a source, you need the Context7 library identifier:
- Very specific: line 33
Look for official documentation sources (e.g., websites/python_3_14)
- Distinctive: line 79
Verify documentation is retrieved successfully.
- Distinctive: line 103
If you prefer to edit manually:
- Distinctive: line 125
Document decision: - Create/update ADR for tool adoption
- Very specific: line 130
Enable documentation: - Add to doc-sources.toml
- Distinctive: line 144
Only queries Context7 when doc-query is invoked
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Documentation Source Skill
Add new tool documentation sources to enable real-time documentation queries via the doc-query skill.
When to Use This Skill
Invoke this skill when:
- Adopting a new tool - After creating/updating ADR for tool selection
- User mentions needing docs - "We should add X documentation"
- Encountering undocumented tool - Query fails with "Unknown source"
- Following CLAUDE.md workflow - "Enable documentation" step
What This Skill Does
- Validates source name and aliases don't conflict
- Adds TOML entry to
.claude/doc-sources.toml - Makes source immediately available to doc-query skill
- Maintains configuration consistency
Instructions
Step 1: Identify Context7 Library ID
Before adding a source, you need the Context7 library identifier:
- Visit https://context7.com to browse available libraries
- Look for official documentation sources (e.g.,
websites/python_3_14) - Note the exact library ID format:
websites/LIBRARY_ID
Common patterns:
- Official sites:
websites/python_3_14,websites/code_claude - GitHub projects:
github_repos/OWNER/REPO
Step 2: Run add-source Script
.claude/skills/add-doc/scripts/add-source <name> <context7_id> <description> [options]Parameters:
name: Source name (lowercase, hyphens for spaces)context7_id: Context7 library identifierdescription: Brief description (in quotes)--tokens N: Optional default token limit (default: 2500)--alias A1,A2: Optional comma-separated aliases
Examples:
# Basic usage
.claude/skills/add-doc/scripts/add-source ruff websites/ruff "Ruff Python linter and formatter"
# With custom tokens
.claude/skills/add-doc/scripts/add-source mypy websites/mypy "Mypy static type checker" --tokens 3000
# With aliases
.claude/skills/add-doc/scripts/add-source pytest websites/pytest "Pytest testing framework" --alias py.test,testStep 3: Verify Addition
.claude/skills/doc-query/scripts/list-sourcesThe new source should appear in the list.
Step 4: Test Query
.claude/skills/doc-query/scripts/query <name> "test query"Verify documentation is retrieved successfully.
Error Handling
If source already exists:
Error: Source 'ruff' already existsSolution: Use a different name or update existing source manually.
If alias conflicts:
Error: Alias 'py' already used by 'python'Solution: Choose different aliases.
If Context7 ID not found:
Error: Library not found: websites/nonexistentSolution: Verify the library ID at https://context7.com.
Manual Addition (Alternative)
If you prefer to edit manually:
- Copy template:
cat .claude/skills/add-doc/templates/source-entry.toml - Edit
.claude/doc-sources.tomldirectly:[sources.ruff] context7_id = "websites/ruff" description = "Ruff Python linter and formatter" default_tokens = 2000 aliases = ["ruff-lint"] - Verify with
list-sources
Integration with Other Skills
Typical workflow (from CLAUDE.md):
- Document decision - Create/update ADR for tool adoption
Use adr skill to create ADR-000X-adopt-ruff.md - Enable documentation - Add to doc-sources.toml
Use add-doc skill to add ruff documentation source - Query as needed - Access documentation during development
Use doc-query skill to query "ruff configuration"
Token Efficiency
- Script runs locally (no AI tokens)
- Validation prevents configuration errors
- Only queries Context7 when doc-query is invoked
- Cost: 0 Sonnet tokens (shell script execution)
Configuration Format
The script generates TOML entries in this format:
[sources.TOOL_NAME]
context7_id = "websites/LIBRARY_ID"
description = "Tool description"
default_tokens = 2500 # Optional
aliases = ["alias1", "alias2"] # OptionalSee source-entry.toml template for annotated example.
Technical Details
Implementation:
- Python 3.12+ stdlib only (tomllib, pathlib)
- TOML validation and conflict detection
- Atomic file updates (read, validate, append)
- Modern type hints (
str | None,list[str])
See: ADR-0003
Examples
Example 1: Adding ruff
Scenario: Team adopts ruff for linting/formatting
Steps:
# 1. Add documentation source
.claude/skills/add-doc/scripts/add-source ruff websites/ruff "Ruff Python linter and formatter" --tokens 2000 --alias ruff-lint
# 2. Verify
.claude/skills/doc-query/scripts/list-sources
# 3. Test query
.claude/skills/doc-query/scripts/query ruff "configuration options"Output:
✓ Added documentation source: ruff
Context7 ID: websites/ruff
Description: Ruff Python linter and formatter
Default tokens: 2000
Aliases: ruff-lint
Updated: /path/to/.claude/doc-sources.tomlExample 2: Adding mypy
Scenario: Need type checking documentation
Steps:
.claude/skills/add-doc/scripts/add-source mypy websites/mypy "Mypy static type checker for Python" --alias typecheckQuery later:
.claude/skills/doc-query/scripts/query mypy "strict mode"
# Or using alias:
.claude/skills/doc-query/scripts/query typecheck "strict mode"Example 3: Adding pytest
Scenario: Adding test framework documentation
Steps:
.claude/skills/add-doc/scripts/add-source pytest websites/pytest "Pytest testing framework" --tokens 3000 --alias py.test,testWhy 3000 tokens: Pytest has extensive documentation; higher limit reduces truncation.
Maintenance
Adding new fields to config:
Edit template in templates/source-entry.toml and update format_toml_entry() in add-source script.
Removing sources:
Manually edit .claude/doc-sources.toml to remove unwanted sections.
Updating sources:
Edit .claude/doc-sources.toml directly or remove and re-add with add-source.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

