agentleFS
asterkinasterkin/claude-taew-py/.claude/skills/add-doc/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

  • In this repository3 other files it gives its agents.

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
  1. Distinctive:

    Add new tool documentation sources to enable real-time documentation queries via the doc-query skill.

    line 8
  2. Distinctive:

    Adopting a new tool: - After creating/updating ADR for tool selection

    line 14
  3. Distinctive:

    Before adding a source, you need the Context7 library identifier:

    line 30
  4. Very specific:

    Look for official documentation sources (e.g., websites/python_3_14)

    line 33
  5. Distinctive:

    Verify documentation is retrieved successfully.

    line 79
  6. Distinctive:

    If you prefer to edit manually:

    line 103
  7. Distinctive:

    Document decision: - Create/update ADR for tool adoption

    line 125
  8. Very specific:

    Enable documentation: - Add to doc-sources.toml

    line 130
  9. Distinctive:

    Only queries Context7 when doc-query is invoked

    line 144

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. Adopting a new tool - After creating/updating ADR for tool selection
  2. User mentions needing docs - "We should add X documentation"
  3. Encountering undocumented tool - Query fails with "Unknown source"
  4. 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:

  1. Visit https://context7.com to browse available libraries
  2. Look for official documentation sources (e.g., websites/python_3_14)
  3. 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 identifier
  • description: 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,test

Step 3: Verify Addition

.claude/skills/doc-query/scripts/list-sources

The 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 exists

Solution: 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/nonexistent

Solution: Verify the library ID at https://context7.com.

Manual Addition (Alternative)

If you prefer to edit manually:

  1. Copy template:
    cat .claude/skills/add-doc/templates/source-entry.toml
  2. Edit .claude/doc-sources.toml directly:
    [sources.ruff]
    context7_id = "websites/ruff"
    description = "Ruff Python linter and formatter"
    default_tokens = 2000
    aliases = ["ruff-lint"]
  3. Verify with list-sources

Integration with Other Skills

Typical workflow (from CLAUDE.md):

  1. Document decision - Create/update ADR for tool adoption
    Use adr skill to create ADR-000X-adopt-ruff.md
  2. Enable documentation - Add to doc-sources.toml
    Use add-doc skill to add ruff documentation source
  3. 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"]     # Optional

See 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.toml

Example 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 typecheck

Query 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,test

Why 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.