Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计通过

documentation-generation文档生成

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

282

周安装

12

GitHub Stars

26

下载量

99
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:documentation-generation(文档生成)
来源仓库:https://github.com/nilecui/skillsbase
仓库路径:skills/documentation-generation
安装命令:
npx skills add https://github.com/nilecui/skillsbase --skill documentation-generation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/nilecui/skillsbase --skill documentation-generation

简介

基于代码自动生成 REST/GraphQL API 文档、组件说明及部署操作指南。

  • 支持 JSDoc、TSDoc、OpenAPI 等多种注释规范,适配不同语言生态。
  • 可创建架构决策记录、开发者上手指南和可视化流程图等辅助材料。
  • 要求接入真实代码库作为输入源,禁止在无源码情况下虚构技术细节。
  • documentation-generation 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Documentation Generation - Creating Clear, Maintainable Docs

When to use this skill

  • Documenting REST or GraphQL APIs
  • Creating component libraries with Storybook
  • Writing comprehensive README files
  • Generating API reference documentation
  • Documenting architecture decisions (ADRs)
  • Creating developer onboarding guides
  • Maintaining changelogs and release notes
  • Documenting configuration and environment variables
  • Building documentation sites with Docusaurus
  • Writing inline code documentation (JSDoc, TSDoc)
  • Creating visual architecture diagrams
  • Documenting deployment and operational procedures

When to use this skill

  • Creating API documentation, writing technical guides, generating code documentation, or maintaining project wikis.
  • When working on related tasks or features
  • During development that requires this expertise

Use when: Creating API documentation, writing technical guides, generating code documentation, or maintaining project wikis.

Core Principles

  1. Docs as Code - Version control, review process, automated generation
  2. Single Source of Truth - Generate from code when possible
  3. Keep It Fresh - Automated checks for outdated docs
  4. Examples Over Explanations - Show, don't just tell
  5. Audience-Specific - Different docs for different users

API Documentation

1. OpenAPI/Swagger (REST APIs)

// ✅ JSDoc comments for automatic documentation
/**
 * @swagger
 * /users:
 *   get:
 *     summary: List all users
 *     description: Returns a paginated list of users
 *     tags:
 *       - Users
 *     parameters:
 *       - in: query
 *         name: page
 *         schema:
 *           type: integer
 *           default: 1
 *         description: Page number
 *       - in: query
 *         name: limit
 *         schema:
 *           type: integer
 *           default: 20
 *         description: Items per page
 *     responses:
 *       200:
 *         description: Success
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 data:
 *                   type: array
 *                   items:
 *                     $ref: '#/components/schemas/User'
 *                 meta:
 *                   type: object
 *                   properties:
 *                     page:
 *                       type: integer
 *                     total:
 *                       type: integer
 */
app.get('/users', async (req, res) => {
  // Implementation
});

/**
 * @swagger
 * components:
 *   schemas:
 *     User:
 *       type: object
 *       required:
 *         - id
 *         - email
 *       properties:
 *         id:
 *           type: string
 *           example: "123"
 *         email:
 *           type: string
 *           format: email
 *           example: "user@example.com"
 *         name:
 *           type: string
 *           example: "John Doe"
 *         createdAt:
 *           type: string
 *           format: date-time
 */
// Setup Swagger UI
import swaggerJsdoc from 'swagger-jsdoc';
import swaggerUi from 'swagger-ui-express';

const options = {
  definition: {
    openapi: '3.0.0',
    info: {
      title: 'My API',
      version: '1.0.0',
      description: 'API documentation',
    },
    servers: [
      {
        url: 'http://localhost:3000',
        description: 'Development server',
      },
    ],
  },
  apis: ['./routes/*.ts'], // Files with @swagger comments
};

const specs = swaggerJsdoc(options);
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs));

2. TypeDoc (TypeScript)

// ✅ JSDoc comments for TypeDoc
/**
 * Represents a user in the system
 */
export interface User {
  /** Unique identifier */
  id: string;
  /** User's email address */
  email: string;
  /** User's display name */
  name: string;
  /** Account creation timestamp */
  createdAt: Date;
}

/**
 * Service for managing users
 * @example
 * ```typescript
 * const userService = new UserService();
 * const user = await userService.createUser({
 *   email: 'user@example.com',
 *   name: 'John Doe'
 * });
 * ```
 */
export class UserService {
  /**
   * Creates a new user
   * @param data - User creation data
   * @returns The created user
   * @throws {ValidationError} If email is invalid
   * @throws {ConflictError} If email already exists
   */
  async createUser(data: CreateUserData): Promise<User> {
    // Implementation
  }

  /**
   * Finds a user by ID
   * @param id - User ID
   * @returns User object or null if not found
   */
  async findById(id: string): Promise<User | null> {
    // Implementation
  }
}
// typedoc.json
{
  "entryPoints": ["src/index.ts"],
  "out": "docs",
  "plugin": ["typedoc-plugin-markdown"],
  "excludePrivate": true,
  "includeVersion": true
}
# Generate documentation
npx typedoc

3. GraphQL Documentation (Auto-generated)

// GraphQL schema with descriptions
const typeDefs = gql`
  """
  Represents a user in the system
  """
  type User {
    """Unique identifier"""
    id: ID!

    """User's email address"""
    email: String!

    """User's display name"""
    name: String!

    """Posts authored by this user"""
    posts: [Post!]!
  }

  """
  Input for creating a new user
  """
  input CreateUserInput {
    """Valid email address"""
    email: String!

    """Display name (3-50 characters)"""
    name: String!

    """Password (minimum 8 characters)"""
    password: String!
  }

  type Query {
    """
    Get a single user by ID
    @example
    query {
      user(id: "123") {
        id
        email
        name
      }
    }
    """
    user(id: ID!): User

    """
    List all users with pagination
    """
    users(limit: Int = 20, offset: Int = 0): [User!]!
  }
`;

// GraphQL Playground provides interactive docs automatically

Code Documentation

1. README.md Template

# Project Name

Brief description of what this project does.

## Features

- 🚀 Feature 1
- 📦 Feature 2
- ⚡ Feature 3

## Quick Start

\`\`\`bash
# Install dependencies
npm install

# Run development server
npm run dev

# Run tests
npm test
\`\`\`

## Installation

Detailed installation instructions...

## Usage

Basic usage examples:

\`\`\`typescript
import { MyLibrary } from 'my-library';

const instance = new MyLibrary({
  apiKey: 'your-key'
});

const result = await instance.doSomething();
\`\`\`

## API Reference

See [API Documentation](./docs/api.md)

## Configuration

Environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| `DATABASE_URL` | PostgreSQL connection string | - |
| `PORT` | Server port | `3000` |
| `NODE_ENV` | Environment | `development` |

## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md)

## License

MIT

2. CHANGELOG.md

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- New feature X
- Support for Y

### Changed
- Improved performance of Z

### Deprecated
- Old API endpoint /v1/users (use /v2/users instead)

### Removed
- Unused dependency foo

### Fixed
- Bug in authentication flow
- Memory leak in WebSocket handler

### Security
- Updated dependencies with security vulnerabilities

## [2.1.0] - 2024-01-15

### Added
- User profile customization
- Dark mode support

### Fixed
- Login redirect issue

## [2.0.0] - 2024-01-01

### Changed
- **BREAKING**: Renamed `getUser()` to `fetchUser()`
- **BREAKING**: Changed response format for `/api/users`

### Migration Guide

\`\`\`typescript
// Before
const user = await api.getUser(id);

// After
const user = await api.fetchUser(id);
\`\`\`

3. JSDoc for Functions

/**
 * Calculates the total price including tax and shipping
 *
 * @param items - Array of cart items
 * @param options - Calculation options
 * @param options.taxRate - Tax rate as decimal (e.g., 0.08 for 8%)
 * @param options.shippingCost - Flat shipping cost
 * @returns Total price object
 *
 * @example
 * ```typescript
 * const total = calculateTotal(
 *   [{ price: 10, quantity: 2 }],
 *   { taxRate: 0.08, shippingCost: 5 }
 * );
 * // Returns: { subtotal: 20, tax: 1.6, shipping: 5, total: 26.6 }
 * ```
 *
 * @throws {ValidationError} If items array is empty
 * @throws {ValidationError} If taxRate is negative
 */
export function calculateTotal(
  items: CartItem[],
  options: {
    taxRate: number;
    shippingCost: number;
  }
): TotalPrice {
  // Implementation
}

Documentation Sites

1. VitePress (Modern Static Site)

<!-- docs/index.md -->
---
layout: home
hero:
  name: My Library
  text: A modern TypeScript library
  tagline: Fast, type-safe, and easy to use
  actions:
    - theme: brand
      text: Get Started
      link: /guide/
    - theme: alt
      text: View on GitHub
      link: https://github.com/user/repo
features:
  - title: Fast
    details: Built with performance in mind
  - title: Type-safe
    details: Full TypeScript support
  - title: Simple
    details: Easy to learn and use
---

<!-- docs/guide/index.md -->
# Getting Started

## Installation

::: code-group
\`\`\`bash [npm]
npm install my-library
\`\`\`

\`\`\`bash [yarn]
yarn add my-library
\`\`\`

\`\`\`bash [pnpm]
pnpm add my-library
\`\`\`
:::

## Quick Example

\`\`\`typescript
import { createClient } from 'my-library';

const client = createClient({
  apiKey: process.env.API_KEY
});

const data = await client.fetch('/users');
\`\`\`

## Next Steps

- [Configuration](/guide/configuration)
- [API Reference](/api/)
- [Examples](/examples/)
// docs/.vitepress/config.ts
import { defineConfig } from 'vitepress';

export default defineConfig({
  title: 'My Library',
  description: 'Documentation for My Library',

  themeConfig: {
    nav: [
      { text: 'Guide', link: '/guide/' },
      { text: 'API', link: '/api/' },
      { text: 'Examples', link: '/examples/' }
    ],

    sidebar: {
      '/guide/': [
        {
          text: 'Introduction',
          items: [
            { text: 'Getting Started', link: '/guide/' },
            { text: 'Installation', link: '/guide/installation' },
            { text: 'Configuration', link: '/guide/configuration' }
          ]
        },
        {
          text: 'Core Concepts',
          items: [
            { text: 'Authentication', link: '/guide/auth' },
            { text: 'Data Fetching', link: '/guide/fetching' }
          ]
        }
      ]
    },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/user/repo' }
    ]
  }
});

2. Docusaurus (React-based)

// docusaurus.config.js
module.exports = {
  title: 'My Library',
  tagline: 'A modern TypeScript library',
  url: 'https://mylib.dev',
  baseUrl: '/',

  presets: [
    [
      '@docusaurus/preset-classic',
      {
        docs: {
          sidebarPath: require.resolve('./sidebars.js'),
          editUrl: 'https://github.com/user/repo/edit/main/',
        },
        blog: {
          showReadingTime: true,
        },
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        },
      },
    ],
  ],

  themeConfig: {
    navbar: {
      title: 'My Library',
      items: [
        { to: '/docs/intro', label: 'Docs', position: 'left' },
        { to: '/blog', label: 'Blog', position: 'left' },
        {
          href: 'https://github.com/user/repo',
          label: 'GitHub',
          position: 'right',
        },
      ],
    },
  },
};

Automated Checks

1. Link Checking

# .github/workflows/docs.yml
name: Check Docs

on: [push, pull_request]

jobs:
  check-links:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check broken links
        uses: gaurav-nelson/github-action-markdown-link-check@v1
        with:
          folder-path: 'docs/'
          config-file: '.markdown-link-check.json'

2. Code Examples Testing

// Extract and test code examples from markdown
import { readFileSync } from 'fs';

describe('Documentation Examples', () => {
  it('README example works', () => {
    const readme = readFileSync('README.md', 'utf-8');
    const codeBlocks = readme.match(/```typescript\n([\s\S]*?)```/g);

    // Test each code block
    for (const block of codeBlocks) {
      const code = block.replace(/```typescript\n/, '').replace(/```$/, '');
      expect(() => eval(code)).not.toThrow();
    }
  });
});

Documentation Checklist

Essential Documentation:
□ README.md with quick start
□ CHANGELOG.md with versions
□ LICENSE file
□ CONTRIBUTING.md for contributors
□ API reference documentation
□ Configuration guide

Code Documentation:
□ JSDoc comments on public APIs
□ Type definitions exported
□ Examples for complex functions
□ Error conditions documented
□ Breaking changes noted

Quality:
□ No broken links
□ Code examples tested
□ Screenshots up to date
□ Search functionality
□ Mobile-responsive
□ Accessible (WCAG)

Maintenance:
□ Automated generation from code
□ Versioned documentation
□ CI/CD checks for docs
□ Deprecation warnings visible
□ Migration guides for breaking changes

Resources


Remember: Documentation is part of your product. Keep it accurate, accessible, and up-to-date.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

24.67%
按下载量换算24

Codex

23.33%
按下载量换算23

Antigravity

19.14%
按下载量换算19

windsurf

12.39%
按下载量换算12

trae

7.27%
按下载量换算7

OpenCode

3.53%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills