home / skills / laurigates / claude-plugins / blueprint-curate-docs

This skill curates ai_docs entries from library or project documentation to optimize AI context for prompt-relevant, concise guidance.

npx playbooks add skill laurigates/claude-plugins --skill blueprint-curate-docs

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
4.3 KB
---
model: opus
description: "Curate library or project documentation for ai_docs to optimize AI context"
args: "[library-name|project:pattern-name]"
argument-hint: "Library name (e.g., redis, pydantic) or project:pattern-name"
allowed-tools: Read, Write, Glob, Bash, WebFetch, WebSearch, AskUserQuestion
created: 2025-12-16
modified: 2026-02-14
reviewed: 2026-02-14
name: blueprint-curate-docs
---

# /blueprint:curate-docs

Curate library or project documentation into ai_docs entries optimized for AI agents - concise, actionable, gotcha-aware context that fits in PRPs.

**Usage**: `/blueprint:curate-docs [library-name]` or `/blueprint:curate-docs project:[pattern-name]`

## When to Use This Skill

| Use this skill when... | Use alternative when... |
|------------------------|-------------------------|
| Creating ai_docs for PRP context | Reading raw documentation for ad-hoc tasks |
| Documenting library patterns for reuse | One-time library usage |
| Building knowledge base for project | General library research |

## Context

- ai_docs directory: !`test -d docs/blueprint/ai_docs && echo "YES" || echo "NO"`
- Existing library docs: !`find docs/blueprint/ai_docs/libraries -name "*.md" -type f 2>/dev/null`
- Existing project patterns: !`find docs/blueprint/ai_docs/project -name "*.md" -type f 2>/dev/null`
- Library in dependencies: !`grep -m1 "^$1[\":@=]" package.json pyproject.toml requirements.txt 2>/dev/null || echo "NOT FOUND"`

## Parameters

Parse `$ARGUMENTS`:

- `library-name`: Name of library to document (e.g., `redis`, `pydantic`)
  - Location: `docs/blueprint/ai_docs/libraries/[library-name].md`
  - OR `project:[pattern-name]` for project patterns
  - Location: `docs/blueprint/ai_docs/project/[pattern-name].md`

## Execution

Execute complete documentation curation workflow:

### Step 1: Determine target and check existing docs

1. Parse argument to determine if library or project pattern
2. Check if ai_docs entry already exists
3. If exists → Ask: Update or create new version?
4. Check project dependencies for library version

### Step 2: Research and gather documentation

For **libraries**:
- Find official documentation URL
- Search for specific sections relevant to project use cases
- Find known issues and gotchas (WebSearch: "{library} common issues", "{library} gotchas")
- Extract key sections with WebFetch

For **project patterns**:
- Search codebase for pattern implementations: `grep -r "{pattern}" src/`
- Identify where and how it's used
- Document conventions and variations
- Extract real code examples from project

### Step 3: Extract key information

1. **Use cases**: How/why this library/pattern is used in project
2. **Common operations**: Most frequent uses
3. **Patterns we use**: Project-specific implementations (with file references)
4. **Configuration**: How it's configured in this project
5. **Gotchas**: Version-specific behaviors, common mistakes, performance pitfalls, security considerations

Sources for gotchas: GitHub issues, Stack Overflow, team experience, official docs warnings.

### Step 4: Create ai_docs entry

Generate file at appropriate location (see [REFERENCE.md](REFERENCE.md#template)):
- `docs/blueprint/ai_docs/libraries/[library-name].md` OR
- `docs/blueprint/ai_docs/project/[pattern-name].md`

Include all sections from template: Quick Reference, Patterns We Use, Configuration, Gotchas, Testing, Examples.

Keep under 200 lines total.

### Step 5: Add code examples

Include copy-paste-ready code snippets from:
- Project codebase (reference actual files and line numbers)
- Official documentation examples
- Stack Overflow solutions
- Personal implementation experience

### Step 6: Validate and save

1. Verify entry is < 200 lines
2. Verify all code examples are accurate
3. Verify gotchas include solutions
4. Save file
5. Report completion

## Agentic Optimizations

| Context | Command |
|---------|---------|
| Check ai_docs exists | `test -d docs/blueprint/ai_docs && echo "YES" \|\| echo "NO"` |
| List library docs | `ls docs/blueprint/ai_docs/libraries/ 2>/dev/null` |
| Check library version | `grep "{library}" package.json pyproject.toml 2>/dev/null \| head -1` |
| Search for patterns | Use grep on src/ for project patterns |
| Fast research | Use WebSearch for common issues instead of fetching docs |

---

For ai_docs template, section guidelines, and example entries, see [REFERENCE.md](REFERENCE.md).

Overview

This skill curates library or project documentation into concise ai_docs entries optimized for AI agents and PRP context. It produces actionable, gotcha-aware summaries, patterns, configuration notes, and copy-paste-ready examples. Use it to turn scattered docs and code into a compact reference that fits agent context windows.

How this skill works

The skill inspects whether the target is a library or a project pattern, checks for existing ai_docs entries, and optionally updates them. It gathers authoritative sources (official docs, issues, Stack Overflow), searches the codebase for real examples, extracts key operations and project-specific patterns, and writes a templated ai_docs file with Quick Reference, Patterns We Use, Configuration, Gotchas, Testing, and Examples. The output is validated for length and accuracy before saving.

When to use it

  • Preparing concise context for AI agents during code reviews or PRs
  • Documenting reusable library usage and project-specific patterns
  • Standardizing how a dependency is configured and used in the codebase
  • Creating a project knowledge base to onboard engineers or agents
  • Updating docs when library versions or project patterns change

Best practices

  • Prefer real project code examples and file references over generic snippets
  • Keep each ai_docs entry under the size limit so it fits PRP context
  • Include explicit gotchas and their fixes for the versions in use
  • Cite one authoritative URL per major feature and one issue or SO thread for each gotcha
  • Validate code snippets by running or referencing exact file/line examples

Example use cases

  • Curate a Redis usage entry showing connection pooling, commands used, and common pitfalls
  • Document a pydantic pattern used across services with model examples and validation gotchas
  • Extract a project-specific retry/backoff pattern with code locations and configuration knobs
  • Create an ai_docs entry for a third-party SDK used in CI with auth and rate-limit notes
  • Refresh an existing entry after upgrading a dependency to highlight breaking changes

FAQ

Does this overwrite existing ai_docs entries?

It checks for an existing entry and asks whether to update or create a new version before writing.

How are gotchas sourced?

Gotchas are compiled from official docs warnings, GitHub issues, Stack Overflow threads, and observed team experience, with recommended fixes.

Can it extract examples from the codebase?

Yes — it searches the repository for pattern implementations and includes referenced file paths and snippets.