write-coding-standards-from-file
Analyze existing code files to automatically generate a project coding standards document.
- Extracts syntax patterns (indentation, naming conventions, commenting style, braces, line length) from one or more files or entire folders to establish baseline standards
- Detects and optionally fixes inconsistencies across files, flagging deviations from the majority pattern in each category
- Outputs standards to a new file (CONTRIBUTING.md, STYLE.md, CODING_STANDARDS.md, etc.), README.md insertion, or directly to prompt using minimal or verbose templates
- Supports optional integration with language-specific style guides (Python PEP 8, JavaScript, Go, Rust, etc.) via configurable fetch links
- Configurable via boolean flags and parameters to control template style, output destination, inconsistency handling, and test file generation
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].