npx skills add ...
npx skills add github/awesome-copilot --skill write-coding-standards-from-file
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.
npx skills add github/awesome-copilot --skill 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.
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].
${newFileName}, if file does not exist, use that file name and break, else continue to next file name of ${newFileName}.[["v", "verbose"], ["m", "minimal"], ["b", "best fit"], ["custom"]].## Coding Standards Templates, or use another composition that is a better fit.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.
${useTemplate} default. Values are [["v", "verbose"], ["m", "minimal"], ["b", "best fit"]].${fileName}.length > 1 || ${folderName} != undefined${fixInconsistencies} to false.${addToREADME} == trueREADME.md instead of outputting to the prompt or creating a new file.${createNewFile} and ${outputSpecToPrompt} to false.${addToREADMEInsertions} == "atBegin"${addToREADME} is true, then insert the coding standards data at the beginning of the README.md file after the title.${addToREADMEInsertions} == "middle"${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"${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"${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${createNewFile} == true${newFileName}.${outputSpecToPrompt} and ${addToREADME} to false.${fetchStyleURL} == true### Fetch Links as context for creating standards, specifications, and styling data for the new file, prompt, or README.md.### Fetch Links, run #fetch ${item}.${findInconsistencies} == true' or " for strings, etc., and categorize.${fixInconsistencies}, either edit and fix the low count categories to match the majority, or output to prompt inconsistencies stored in temporary memory.${fixInconsistencies} == truetypeof ${newFileName} == "string"string, create a new file using the value from ${newFileName}.typeof ${newFileName} != "string"string, but instead an object or an array, create a new file using a value from ${newFileName} by applying this rule:
${newFileName}, if file does not exist, use that file name and break, else continue to the next.${outputSpecToPrompt} == true${createNewFile} and ${addToREADME} to false.${useTemplate} == "v" || ${useTemplate} == "verbose"### "v", "verbose" as guiding template when composing the data for coding standards.${useTemplate} == "m" || ${useTemplate} == "minimal"### "m", "minimal" as guiding template when composing the data for coding standards.${useTemplate} == "b" || ${useTemplate} == "best"### "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>"${fetchStyleURL} == trueDepending on the programming language, for each link in list below, run #fetch (URL), if programming language is ${fileName} == [<Language> Style Guide].
"m", "minimal""v", verbose"