lib-skill-creator-skill

📁 haibaraaiaptx/lib-skill-creator-skill 📅 Jan 26, 2026
4
总安装量
3
周安装量
#49556
全站排名
安装命令
npx skills add https://github.com/haibaraaiaptx/lib-skill-creator-skill --skill lib-skill-creator-skill

Agent 安装分布

opencode 3
claude-code 3
codex 2
github-copilot 1

Skill 文档

Source Code Into Skill

Overview

This skill transforms specified source code into AI-coding-friendly guiding skills through natural collaborative conversations.

Why generate skills for libraries?

When AI coding tools work on projects that depend on a library, they often need to understand the library’s APIs and classes to complete user requests effectively. By generating a skill from the library’s source code:

  • AI tools can understand the purpose and logic of each API without reading the original source code
  • Developers can share library knowledge with AI tools in a standardized format
  • The generated skill serves as comprehensive, searchable documentation optimized for AI consumption

The workflow includes:

  1. Understand the repository – Analyze the source code structure of the target repository
  2. Determine the partitioning strategy – Ask the user to choose how to organize generated files based on project type:
    • By namespace
    • By folder
    • By file
  3. Document and generate API files – Confirm documentation for each API and write to file immediately
  4. Update main skill documentation – Add API references to the main SKILL.md file

This approach ensures that the generated skills accurately reflect the codebase structure and provide clear, actionable guidance for AI coding tools.

The Process

Step 1: Identify Public APIs

Analyze the source code to identify all publicly exposed APIs, objects, classes, interfaces, enums, services, and other constructs. Summarize your findings and present them to the user for confirmation.

Confirm with the user:

  • Is this summary correct?
  • Are there any public APIs missing that should be included?
  • Are there any internal APIs that were incorrectly marked as public?
  • Any additional notes or context that should be documented?

This step focuses on confirming which public APIs need documentation.

Step 2: Document and Generate API Files

Based on the confirmed list of APIs, document each API through collaborative dialogue and write the content to a file immediately after confirmation.

For each API, confirm and document the following:

  1. API Declaration – The exact function/class/interface signature as it appears in the source code
  2. Description – A clear explanation of what the API does and its purpose
  3. Usage Scenarios – When and why a user would use this API, including common use cases
  4. Example Code – Practical code snippets demonstrating how to use the API correctly

Workflow for each API:

  1. Present the current documentation draft to the user
  2. Ask for confirmation on each element (declaration, description, scenarios, examples)
  3. Incorporate user feedback iteratively
  4. Once confirmed, write the validated content to:
    /<skill-name>/references/<folder>/<api>.md
    
  5. Proceed to the next API and repeat

File path structure:

  • <skill-name> – The name of the skill being created
  • <folder> – The folder determined by the partitioning strategy
  • <api> – The name of the API being documented

Each .md file should contain the confirmed documentation for a single API, formatted clearly for AI coding tools to reference.

Step 3: Update Main Skill Documentation

After all public API documentation files have been generated, update the main skill documentation (<skill-name>/SKILL.md) to include references to all documented APIs.

Update the SKILL.md to:

  • Add a section listing all available APIs organized by the chosen partitioning strategy
  • Provide brief descriptions or links to each API’s detailed documentation
  • Include an overview section that helps users navigate the generated documentation
  • Ensure the table of contents (if present) reflects all newly added API documentation

This step ensures users can easily discover and navigate all available API documentation from the main skill file.

Key Constraints

When engaging with users through collaborative dialogue, follow these guidelines:

  1. One question at a time – Avoid overwhelming the user by asking only one question per interaction
  2. Prefer multiple choice – Structure questions as single-select options whenever possible
  3. Recommend with rationale – When presenting options, lead with the recommended approach followed by brief explanations

Example of recommended question format:

How would you like to organize the generated documentation?

**Recommended: By namespace** - Best for languages like Java, C#, TypeScript with clear namespace/package structures

- By namespace - Groups APIs by their namespace/package
- By folder - Groups APIs by their source directory structure
- By file - Each file becomes a separate section