write-coding-standards-from-file

软件研发 工程通用 1 文件 EN 原文

'Write a coding standards document for a project

'Write a coding standards document for a project using the coding styles from the file(s) and/or folder(s) passed as arguments in the prompt.'

说明语言:英文

来源githubawesome-copilot ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/github/awesome-copilot --skill write-coding-standards-from-file

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: write-coding-standards-from-file description: 'Write a coding standards document for a project using the coding styles from the file(s) and/or folder(s) passed as arguments in the prompt.' ---

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

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

Required and Optional Parameters

Variable and Parameter Configuration Conditions

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

${addToREADME} == true

${addToREADMEInsertions} == "atBegin"

${addToREADMEInsertions} == "middle"

${addToREADMEInsertions} == "beforeEnd"

${addToREADMEInsertions} == "bestFitUsingContext"

${addStandardsTest} == true

${createNewFile} == true

${fetchStyleURL} == true

${findInconsistencies} == true

${fixInconsistencies} == true

typeof ${newFileName} == "string"

typeof ${newFileName} != "string"

${outputSpecToPrompt} == true

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

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

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

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

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"

"v", verbose"

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

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
        if (condition) {
            do_something();
        } else {
            do_something_else();
        }

Recommended tags:

        TODO: follow-up work
        FIXME: known incorrect behavior
        NOTE: non-obvious design decision
        Short summary (max ~50 chars)
        Optional longer explanation of context and rationale.

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

同类技能
acreadiness-assessacreadiness-generate-instructionsacreadiness-policyad-campaign-analyzeradd-educational-commentsai-readyai-research-exploreai-research-reproduction
本页内容来自开源项目 github, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。