Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

code-documentation-standards代码文档标准

Agent Skill

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

总安装

198

周安装

8

GitHub Stars

公开资料未说明

下载量

62
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/findinfinitelabs/chuuk --skill code-documentation-standards

简介

code-documentation-standards 强制文档与代码同步更新,并在提交前验证 Markdown 语法正确性。

  • 它要求修复所有 markdown 错误(如未闭合代码块、无效链接),确保文档可读性。
  • 适用于重视文档质量的工程,自动拦截格式问题防止低质提交进入主干分支。
  • 使用前需配置 pre-commit hook 或 CI 检查机制,否则无法自动触发验证流程。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Code Documentation Standards

Core Principle

ALWAYS maintain up-to-date documentation when creating or modifying code. Documentation must be updated simultaneously with code changes. ALWAYS fix markdown validation errors promptly before committing any changes.

Pre-Commit Markdown Validation

Before any commit, ALWAYS:

  1. Run markdown validation on all.md files in the repository
  2. Fix all markdown syntax errors including:

- Unclosed code blocks - Missing link destinations - Invalid heading structures - Broken table formatting - Incorrect list indentation

  1. Validate code block syntax in documentation
  2. Check internal links are properly formatted
  3. Ensure consistent formatting across all markdown files

Documentation Requirements

1. Python Functions/Classes

def process_document(file_path: str, patterns: List[str]) -> ProcessResult:
    """
    Process a document for redaction using specified patterns.

    Args:
        file_path (str): Path to the document file to process
        patterns (List[str]): List of redaction patterns to apply

    Returns:
        ProcessResult: Object containing processed document and metadata

    Raises:
        FileNotFoundError: If the specified file doesn't exist
        ValidationError: If patterns are invalid

    Example:
        >>> result = process_document('doc.pdf', ['ssn', 'email'])
        >>> print(result.redacted_count)
    """
    pass

2. Class Documentation

class DocumentProcessor:
    """
    Handles document processing operations for various file formats.

    This class provides methods for parsing, analyzing, and transforming
    documents while maintaining original formatting and metadata.

    Attributes:
        supported_formats (List[str]): File formats supported by processor
        max_file_size (int): Maximum file size in bytes

    Example:
        >>> processor = DocumentProcessor()
        >>> result = processor.process('document.pdf')
    """

    def __init__(self, config: ProcessingConfig = None):
        """Initialize processor with optional configuration."""
        pass

3. Template Documentation

<!--
Template: translation_interface.html
Purpose: Main interface for Chuukese-English translation
Variables:
  - dictionary_entries: List of recent dictionary entries
  - user_translations: User's translation history
  - cultural_context: Cultural context data for assistance
Dependencies:
  - static/css/translation.css
  - static/js/translation-ui.js
  - Bootstrap 5.1+
-->
<div class="translation-container">
    <!-- Translation form content -->
</div>

4. CSS Class Documentation

/*
 * Chuukese Text Display
 * Purpose: Styles for displaying Chuukese text with proper accent handling
 * Usage: Apply to containers holding Chuukese language content
 * Dependencies: Requires font-family supporting Unicode accents
 */
.chuukese-text {
    font-family: 'Noto Sans', 'Arial Unicode MS', sans-serif;
    font-size: 1.1em;
    line-height: 1.5;
    direction: ltr;
}

/*
 * Responsive adaptation: Increase font size on mobile
 * Context: Better readability for accented characters
 */
@media (max-width: 768px) {
    .chuukese-text {
        font-size: 1.2em;
    }
}

5. JavaScript Function Documentation

/**
 * Normalize Chuukese text for search operations
 * @param {string} text - The Chuukese text to normalize
 * @param {boolean} preserveAccents - Whether to preserve accent marks
 * @returns {string} Normalized text suitable for searching
 * @throws {TypeError} If text is not a string
 *
 * @example
 * const normalized = normalizeChuukeseText('kápás', false);
 * console.log(normalized); // 'kapas'
 */
function normalizeChuukeseText(text, preserveAccents = true) {
    if (typeof text !== 'string') {
        throw new TypeError('Text parameter must be a string');
    }
    // Implementation...
}

Documentation Standards by Context

Database Models

class DictionaryEntry(Base):
    """
    Represents a Chuukese-English dictionary entry.

    This model stores bilingual dictionary data with cultural context,
    pronunciation guides, and usage information for language learning
    and translation applications.

    Attributes:
        chuukese_word (str): Primary Chuukese term (required)
        english_definition (str): English definition or translation
        pronunciation (str): IPA or phonetic pronunciation guide
        cultural_context (str): Cultural significance and usage notes
        part_of_speech (str): Grammatical category (noun, verb, etc.)
        difficulty_level (str): Learning difficulty (beginner/intermediate/advanced)
        usage_frequency (float): Frequency score 0.0-1.0

    Relationships:
        phrases: Related phrase entries using this word
        translations: Translation pairs containing this entry

    Example:
        >>> entry = DictionaryEntry(
        ...     chuukese_word="chomong",
        ...     english_definition="to help, assist",
        ...     cultural_context="Community cooperation value"
        ... )
    """
    __tablename__ = 'dictionary_entries'

    id = Column(Integer, primary_key=True)
    chuukese_word = Column(String(200), nullable=False, index=True)
    # ... rest of model

API Routes

@app.route('/api/translate', methods=['POST'])
def translate_text():
    """
    Translate text between Chuukese and English.

    Endpoint for bidirectional text translation with quality assessment
    and cultural context preservation.

    Request Body:
        {
            "text": "string - Text to translate (required)",
            "source_language": "string - Source language code (required)",
            "target_language": "string - Target language code (required)",
            "include_cultural_context": "boolean - Include cultural notes
                                        (optional, default: false)"
        }

    Response:
        {
            "translated_text": "string - Translated result",
            "quality_score": "float - Translation quality 0.0-1.0",
            "cultural_notes": "array - Cultural context information (if requested)",
            "confidence": "float - Translation confidence score"
        }

    Status Codes:
        200: Translation successful
        400: Invalid request parameters
        422: Translation quality too low
        500: Internal server error

    Example:
        >>> POST /api/translate
        >>> {
        ...     "text": "chomong",
        ...     "source_language": "chuukese",
        ...     "target_language": "english"
        ... }

        Response:
        {
            "translated_text": "to help",
            "quality_score": 0.95,
            "confidence": 0.98
        }
    """
    pass

Best Practices

1. Consistency Standards

  • Use consistent parameter naming across similar functions
  • Maintain uniform documentation formatting
  • Follow established patterns for each language/framework
  • Update documentation immediately when code changes
  • Fix all markdown validation errors before committing

2. Content Guidelines

  • Write for developers who don't know the codebase
  • Include practical examples whenever possible
  • Document edge cases and error conditions
  • Explain the "why" behind implementation decisions

3. Cultural Context Documentation (Chuukese Project Specific)

  • Document cultural significance of Chuukese terms
  • Explain traditional concepts that may not translate directly
  • Note appropriate usage contexts (formal/informal, traditional/modern)
  • Include pronunciation guides for language learners

4. Maintenance Requirements

  • Review documentation during code reviews
  • Update documentation in the same commit as code changes
  • Mark deprecated functions with alternatives
  • Remove documentation for deleted code
  • Validate markdown syntax before each commit

5. Quality Checks

  • Verify all parameters are documented
  • Ensure examples are current and functional
  • Check that return types match actual implementation
  • Validate that error conditions are accurately described
  • Run markdown linting tools on all documentation

6. Markdown Validation Process

MANDATORY before every commit:

  1. Syntax Validation: # Check for markdown syntax errors markdownlint **/*.md
  2. Code Block Validation:

- Ensure all code blocks have proper opening/closing backticks - Verify language tags are correct (python, javascript, html, css) - Test that code examples are syntactically valid

  1. Link Validation:

- Check all internal links reference existing files/sections - Verify external links are accessible - Ensure proper markdown link syntax: [text](url)

  1. Structure Validation:

- Confirm heading hierarchy is logical (h1 → h2 → h3) - Verify lists have consistent indentation - Check table formatting is complete

  1. Common Fixes:

- Close unclosed code blocks with proper backticks - Fix malformed tables with proper pipe alignment - Correct broken link references - Standardize heading styles (#, ##, ###) - Fix list item indentation and nesting

Templates

Function Documentation Template

def function_name(param1: Type1, param2: Type2 = default) -> ReturnType:
    """
    Brief description of what the function does.

    Longer description if needed, explaining the purpose and any
    important implementation details or assumptions.

    Args:
        param1 (Type1): Description of first parameter
        param2 (Type2, optional): Description with default value

    Returns:
        ReturnType: Description of return value

    Raises:
        ExceptionType: When this exception occurs

    Example:
        >>> result = function_name(value1, value2)
        >>> print(result)

    Note:
        Any special considerations or warnings
    """

Class Documentation Template

class ClassName:
    """
    Brief description of the class purpose.

    Detailed explanation of what the class represents,
    its main responsibilities, and how it fits into
    the larger system.

    Attributes:
        attr_name (Type): Description of attribute

    Example:
        >>> instance = ClassName(param)
        >>> result = instance.method()

    See Also:
        RelatedClass: For related functionality
    """

Dependencies

  • Follow project-specific documentation tools
  • Use type hints for Python functions
  • Include JSDoc for JavaScript when applicable
  • Maintain README files for project overviews

Validation Criteria

Proper documentation should:

  • ✅ Explain the purpose clearly and concisely
  • ✅ Document all parameters and return values
  • ✅ Include practical usage examples
  • ✅ Note error conditions and exceptions
  • ✅ Use consistent formatting and style
  • ✅ Stay current with code changes
  • ✅ Provide cultural context for Chuukese-specific terms
  • Pass markdown validation without errors
  • Have properly formatted code blocks and links
  • Use consistent heading structure and list formatting

Pre-Commit Workflow

MANDATORY checklist before every commit:

  1. Code documentation updated
  2. Markdown files validated and errors fixed
  3. Code blocks properly formatted with language tags
  4. All links functional and properly formatted
  5. Heading hierarchy follows logical structure
  6. Examples tested and verified working

Tools for validation:

  • markdownlint for syntax checking
  • VS Code markdown preview for visual verification
  • Link checkers for external references
  • Code syntax validators for embedded examples

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.52%
按下载量换算23

Claude

29.97%
按下载量换算19

Cursor

16.99%
按下载量换算11

Gemini CLI

9.79%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills