Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

write-coding-standards-from-file从文件中写入编码标准

Agent Skill

write-coding-standards-from-file 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

213,312

周安装

8,776

GitHub Stars

31,682

下载量

69,696
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/github/awesome-copilot --skill write-coding-standards-from-file

简介

分析现有代码文件,自动生成项目编码标准文档。

  • 从一个或多个文件或整个文件夹中提取语法模式(缩进、命名约定、注释样式、大括号、行长度)以建立基线标准
  • 检测并选择性地修复文件之间的不一致,标记每个类别中与大多数模式的偏差
  • 将标准输出到新文件(CONTRIBUTING.md、STYLE.md、CODING_STANDARDS.md 等)、README.md 插入,或直接提示使用最小或详细模板
  • 支持通过可配置的获取链接与特定于语言的样式指南(Python PEP 8、JavaScript、Go、Rust 等)进行可选集成
  • 可通过布尔标志和参数进行配置,以控制模板样式、输出目标、不一致处理和测试文件生成

SKILL.md

Write Coding Standards From File

Use the existing syntax of the file(s) to establish the standards and style guides for the project. If more than one file or a folder is passed, loop through each file or files in the folder, appending the file's data to temporary memory or a file, then when complete use temporary data as a single instance; as if it were the file name to base the standards and style guideline on.

Rules and Configuration

Below is a set of quasi-configuration boolean and string[] variables. Conditions for handling true, or other values for each variable are under the level two heading ## Variable and Parameter Configuration Conditions.

Parameters for the prompt have a text definition. There is one required parameter ${fileName}, and several optional parameters ${folderName}, ${instructions}, and any [configVariableAsParameter].

Configuration Variables

  • addStandardsTest = false;
  • addToREADME = false;
  • addToREADMEInsertions = ["atBegin", "middle", "beforeEnd", "bestFitUsingContext"];

- Default to beforeEnd.

  • createNewFile = true;
  • fetchStyleURL = true;
  • findInconsistencies = true;
  • fixInconsistencies = true;
  • newFileName = ["CONTRIBUTING.md", "STYLE.md", "CODE_OF_CONDUCT.md", "CODING_STANDARDS.md", "DEVELOPING.md", "CONTRIBUTION_GUIDE.md", "GUIDELINES.md", "PROJECT_STANDARDS.md", "BEST_PRACTICES.md", "HACKING.md"];

- For each file in ${newFileName}, if file does not exist, use that file name and break, else continue to next file name of ${newFileName}.

  • outputSpecToPrompt = false;
  • useTemplate = "verbose"; // or "v"

- Possible values are [["v", "verbose"], ["m", "minimal"], ["b", "best fit"], ["custom"]]. - Selects one of the two example templates at the bottom of prompt file under the level two heading ## Coding Standards Templates, or use another composition that is a better fit. - If custom, then apply per request.

Configuration Variables as Prompt Parameters

If any of the variable names are passed to prompt as-is, or as a similar but clearly related text value, then override the default variable value with the value passed to prompt.

Prompt Parameters

  • fileName = The name of the file that will be analyzed in terms of: indentation, variable naming, commenting, conditional procedures, functional procedures, and other syntax related data for the coding language of the file.
  • folderName = The name of the folder that will be used to extract data from multiple files into one aggregated dataset that will be analyzed in terms of: indentation, variable naming, commenting, conditional procedures, functional procedures, and other syntax related data for the coding language of the files.
  • instructions = Additional instructions, rules, and procedures that will be provided for unique cases.
  • [configVariableAsParameter] = If passed will override the default state of the configuration variable. Example:

- useTemplate = If passed will override the configuration ${useTemplate} default. Values are [["v", "verbose"], ["m", "minimal"], ["b", "best fit"]].

Required and Optional Parameters

  • fileName - required
  • folderName - *optional*
  • instructions - *optional*
  • [configVariableAsParameter] - *optional*

Variable and Parameter Configuration Conditions

${fileName}.length > 1 || ${folderName}!= undefined

  • If true, toggle ${fixInconsistencies} to false.

${addToREADME} == true

  • Insert the coding standards into the README.md instead of outputting to the prompt or creating a new file.
  • If true, toggle both ${createNewFile} and ${outputSpecToPrompt} to false.

${addToREADMEInsertions} == "atBegin"

  • If ${addToREADME} is true, then insert the coding standards data at the beginning of the README.md file after the title.

${addToREADMEInsertions} == "middle"

  • If ${addToREADME} is true, then insert the coding standards data at the middle of the README.md file, changing the standards title heading to match that of the README.md composition.

${addToREADMEInsertions} == "beforeEnd"

  • If ${addToREADME} is true, then insert the coding standards data at the end of the README.md file, inserting a new line after the last character, then inserting the data on a new line.

${addToREADMEInsertions} == "bestFitUsingContext"

  • If ${addToREADME} is true, then insert the coding standards data at the best fitting line of the README.md file in regards to the context of the README.md composition and flow of data.

${addStandardsTest} == true

  • Once the coding standards file is complete, write a test file to ensure the file or files passed to it adhere to the coding standards.

${createNewFile} == true

  • Create a new file using the value, or one of the possible values, from ${newFileName}.
  • If true, toggle both ${outputSpecToPrompt} and ${addToREADME} to false.

${fetchStyleURL} == true

  • Additionally use the data fetched from the links nested under level three heading ### Fetch Links as context for creating standards, specifications, and styling data for the new file, prompt, or README.md.
  • For each relevant item in ### Fetch Links, run #fetch ${item}.

${findInconsistencies} == true

  • Evaluate syntax related to indentations, line-breaks, comments, conditional and function nesting, quotation wrappers i.e. ' or " for strings, etc., and categorize.
  • For each category, make a count, and if one item does not match the majority of the count, then commit to temporary memory.
  • Depending on the status of ${fixInconsistencies}, either edit and fix the low count categories to match the majority, or output to prompt inconsistencies stored in temporary memory.

${fixInconsistencies} == true

  • Edit and fix the low count categories of syntax data to match the majority of corresponding syntax data using inconsistencies stored in temporary memory.

typeof ${newFileName} == "string"

  • If specifically defined as a string, create a new file using the value from ${newFileName}.

typeof ${newFileName}!= "string"

  • If NOT specifically defined as a string, but instead an object or an array, create a new file using a value from ${newFileName} by applying this rule:

- For each file name in ${newFileName}, if file does not exist, use that file name and break, else continue to the next.

${outputSpecToPrompt} == true

  • Output the coding standards to the prompt instead of creating a file or adding to README.
  • If true, toggle both ${createNewFile} and ${addToREADME} to false.

${useTemplate} == "v" || ${useTemplate} == "verbose"

  • Use data under the level three heading ### "v", "verbose" as guiding template when composing the data for coding standards.

${useTemplate} == "m" || ${useTemplate} == "minimal"

  • Use data under the level three heading ### "m", "minimal" as guiding template when composing the data for coding standards.

${useTemplate} == "b" || ${useTemplate} == "best"

  • Use either the data under the level three heading ### "v", "verbose" or ### "m", "minimal", depending on the data extracted from ${fileName}, and use the best fit as guiding template when composing the data for coding standards.

${useTemplate} == "custom" || ${useTemplate} == "<ANY_NAME>"

  • Use the custom prompt, instructions, template, or other data passed as guiding template when composing the data for coding standards.

if ${fetchStyleURL} == true

Depending on the programming language, for each link in list below, run #fetch (URL), if programming language is ${fileName} == [<Language> Style Guide].

Fetch Links

Coding Standards Templates

"m", "minimal"

## 1. Introduction * Purpose: Briefly explain why the coding standards are being established (e.g., to improve code quality, maintainability, and team collaboration). * Scope: Define which languages, projects, or modules this specification applies to.

## 2. Naming Conventions * Variables: camelCase * Functions/Methods: PascalCase or camelCase. * Classes/Structs: PascalCase. * Constants: UPPER_SNAKE_CASE.

## 3. Formatting and Style * Indentation: Use 4 spaces per indent (or tabs). * Line Length: Limit lines to a maximum of 80 or 120 characters. * Braces: Use the "K&R" style (opening brace on the same line) or the "Allman" style (opening brace on a new line). * Blank Lines: Specify how many blank lines to use for separating logical blocks of code.

## 4. Commenting * Docstrings/Function Comments: Describe the function's purpose, parameters, and return values. * Inline Comments: Explain complex or non-obvious logic. * File Headers: Specify what information should be included in a file header, such as author, date, and file description.

## 5. Error Handling * General: How to handle and log errors. * Specifics: Which exception types to use, and what information to include in error messages.

## 6. Best Practices and Anti-Patterns * General: List common anti-patterns to avoid (e.g., global variables, magic numbers). * Language-specific: Specific recommendations based on the project's programming language.

## 7. Examples * Provide a small code example demonstrating the correct application of the rules. * Provide a small code example of an incorrect implementation and how to fix it.

## 8. Contribution and Enforcement * Explain how the standards are to be enforced (e.g., via code reviews). * Provide a guide for contributing to the standards document itself.

"v", verbose"

# Style Guide

This document defines the style and conventions used in this project. All contributions should follow these rules unless otherwise noted.

## 1. General Code Style

- Favor clarity over brevity. - Keep functions and methods small and focused. - Avoid repeating logic; prefer shared helpers/utilities. - Remove unused variables, imports, code paths, and files.

## 2. Naming Conventions

Use descriptive names. Avoid abbreviations unless well-known.

ItemConventionExample
Variableslower_snake_casebuffer_size
Functionslower_snake_case()read_file()
ConstantsUPPER_SNAKE_CASEMAX_RETRIES
Types/StructsPascalCaseFileHeader
File Nameslower_snake_casefile_reader.c

## 3. Formatting Rules

- Indentation: 4 spaces - Line length: max 100 characters - Encoding: UTF-8, no BOM - End files with a newline

### Braces (example in C, adjust for your language)

        if (condition) {
            do_something();
        } else {
            do_something_else();
        }

### Spacing

- One space after keywords: if (x), not if(x) - One blank line between top-level functions

## 4. Comments & Documentation

- Explain *why*, not *what*, unless intent is unclear. - Keep comments up-to-date as code changes. - Public functions should include a short description of purpose and parameters.

Recommended tags:

        TODO: follow-up work
        FIXME: known incorrect behavior
        NOTE: non-obvious design decision

## 5. Error Handling

- Handle error conditions explicitly. - Avoid silent failures; either return errors or log them appropriately. - Clean up resources (files, memory, handles) before returning on failure.

## 6. Commit & Review Practices

### Commits - One logical change per commit. - Write clear commit messages:

        Short summary (max ~50 chars)
        Optional longer explanation of context and rationale.

### Reviews - Keep pull requests reasonably small. - Be respectful and constructive in review discussions. - Address requested changes or explain if you disagree.

## 7. Tests

- Write tests for new functionality. - Tests should be deterministic (no randomness without seeding). - Prefer readable test cases over complex test abstraction.

## 8. Changes to This Guide

Style evolves. Propose improvements by opening an issue or sending a patch updating this document.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.98%
按下载量换算27,168

Claude

28.53%
按下载量换算19,884

Cursor

18.77%
按下载量换算13,082

Gemini CLI

10.42%
按下载量换算7,262

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/github/awesome-copilot --skill write-coding-standards-from-file 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills