Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add famzila/agent-skills-set --skill "llms-txt-generator"
Install specific skill from multi-skill repository
# Description
Generates structured llms.txt documentation files from official library/framework documentation URLs. This skill should be used when users need to create standardized, LLM-optimized reference documentation for dependencies, libraries, or frameworks they're working with.
# SKILL.md
name: llms-txt-generator
description: Generates structured llms.txt documentation files from official library/framework documentation URLs. This skill should be used when users need to create standardized, LLM-optimized reference documentation for dependencies, libraries, or frameworks they're working with.
LLMs.txt Documentation Generator
This skill generates structured llms.txt documentation files from official library and framework documentation URLs. It creates standardized, LLM-optimized reference files that can be used across conversations for consistent dependency knowledge.
When to Use This Skill
Use this skill when:
- User requests llms.txt file generation for a library, framework, or API
- User provides documentation URL(s) and asks for structured documentation
- User mentions needing dependency documentation in a standardized format
- User asks to "document" or "create docs for" a specific library with a URL
Do not use this skill for:
- General web searches about libraries
- Code generation without documentation needs
- User's own custom documentation (not from official sources)
Documentation Retrieval Protocol
CRITICAL: This skill requires fetching exact URL content, not search results.
Fetching Process
- Identify the URL fetching capability in the current environment
- Common tool names: web_fetch, fetch_url, get_page, retrieve_url
-
Look for tools that can retrieve complete page content from exact URLs
-
Use that tool to retrieve the EXACT URL provided by the user
- Never substitute with web search
-
Never use search results as a proxy for actual documentation
-
If the environment defaults to search or lacks fetching capability:
- Inform the user: "This environment cannot fetch exact URLs. I need direct page access to generate accurate llms.txt files."
- Request alternative approach (manual content paste, different environment, etc.)
Validation
Before processing retrieved content, confirm:
- β Content is from the actual documentation page (check page structure, headings)
- β Contains complete information with API references, code examples, or usage patterns
- β URL in response matches the requested URL
- β Content is NOT search engine snippets or results
- β Content is NOT "Page not found", error pages, or truncated previews
If validation fails, inform the user and request the correct URL or clarification.
When URLs Are Missing
If the user requests llms.txt generation without providing URL(s):
- Ask the user to provide the official documentation URL(s)
- Explain that official documentation URLs are needed for accurate extraction
- Example response: "I'll need the official documentation URL for [library]. Please provide the link so I can generate accurate llms.txt documentation."
Do not proceed with search-based alternatives without explicit user consent.
Standard llms.txt Structure
Generate llms.txt files following this template structure (see references/llms-template.md for full template):
Required Sections
- Header Block
- Library/Framework name
- Version (if specified in docs or URL)
- Official documentation source URL
-
Generation date
-
Overview
- Brief description (2-3 sentences)
- Primary use case
-
Key features
-
Installation & Setup
- Installation commands
- Basic configuration
-
Peer dependencies (if applicable)
-
Core Concepts
- Main abstractions or patterns
- Architecture overview
-
Key terminology
-
API Reference
- Main functions/methods/components
- Parameters and return types
-
TypeScript types (if applicable)
-
Common Usage Patterns
- Practical code examples
- Frequent use cases
-
Integration patterns
-
Error Handling
- Common errors
- Error handling patterns
-
Debugging tips
-
Best Practices
- Recommended patterns
- Performance considerations
- Common pitfalls to avoid
Optional Sections (include if present in documentation)
- Authentication/Authorization
- Advanced Features
- Migration Guides
- Framework-Specific Integration (e.g., React, Vue, Node.js)
Processing Multiple URLs
When user provides multiple URLs for the same library:
- Fetch all provided URLs
- Synthesize information into a single coherent llms.txt file
- Avoid duplication - merge overlapping content
- Maintain logical section flow from the template
When user provides URLs for different libraries:
- Generate separate llms.txt files for each library
- Name files clearly:
[library-name].llms.txt - Present all files to the user
- Offer to create them as separate artifacts if requested
Extraction Guidelines
Content Quality
- Prioritize official examples over third-party code
- Include working code snippets that demonstrate actual usage
- Preserve TypeScript types exactly as documented
- Keep examples concise but functional (5-15 lines typically)
- Extract API signatures with parameter types and return types
What to Include
- Installation commands and setup steps
- Core API methods, functions, or components
- Type definitions and interfaces
- Configuration options
- Practical usage examples
- Error handling patterns
- Common integration scenarios
What to Exclude
- Marketing copy and promotional language
- Excessive background/history
- Changelog details
- Contributor information
- Overly verbose explanations (condense to essentials)
- Deprecated APIs (unless specifically requested)
Output Format
File Naming
Use kebab-case: library-name.llms.txt
Examples:
- stripe-api.llms.txt
- react-query.llms.txt
- tanstack-table.llms.txt
File Structure
# Library Name
**Version:** X.X.X
**Source:** [Official Documentation URL]
**Generated:** YYYY-MM-DD
## Overview
[Content]
## Installation & Setup
[Content]
[... remaining sections ...]
Presentation
After generation:
1. Present the complete llms.txt file to the user
2. Confirm the file meets their needs
3. Offer to:
- Adjust the level of detail
- Add/remove sections
- Generate additional llms.txt files for other dependencies
- Explain how to use the file in their workflow
Context-Aware Generation
Framework Detection
Detect the framework/context from the documentation URL and adjust structure:
- React libraries: Emphasize component usage, hooks, props
- Node.js libraries: Emphasize server-side usage, async patterns, middleware
- API services: Emphasize authentication, endpoints, request/response formats
- Build tools: Emphasize configuration, plugins, optimization
Detail Level
Default to comprehensive documentation that includes:
- Complete API surface
- Multiple usage examples per section
- Type definitions
- Configuration options
If user requests concise format:
- Focus on most common APIs (80/20 rule)
- One example per major feature
- Minimal configuration details
- Skip advanced features
Quality Assurance
Before presenting the final llms.txt file, verify:
- Completeness: All major API features are documented
- Accuracy: Information matches the official documentation
- Functionality: Code examples are syntactically correct
- Coherence: Sections flow logically
- Consistency: Formatting is uniform throughout
- Source attribution: Original documentation URL is referenced
Example Usage Flow
User: "Generate llms.txt for Stripe API from https://stripe.com/docs/api"
Response:
1. Fetch https://stripe.com/docs/api
2. Validate content is official Stripe API documentation
3. Extract according to template structure
4. Generate stripe-api.llms.txt with all sections
5. Present to user with confirmation prompt
User: "Create docs for React Query, here's the link: https://tanstack.com/query/latest"
Response:
1. Fetch the URL
2. Detect this is a React library
3. Emphasize hooks, component patterns
4. Generate react-query.llms.txt
5. Present with React-specific usage examples highlighted
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.