write-coding-standards-from-file

Generates coding standards documents by analyzing syntax patterns in source files.

Updated May 28, 2026
One-click install
npx skills add https://github.com/changfengpro/agent-skills --skill write-coding-standards-from-file-changfengpro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-coding-standards-from-file
Source: https://github.com/changfengpro/agent-skills/tree/main/skills/write-coding-standards-from-file
Command: npx skills add https://github.com/changfengpro/agent-skills --skill write-coding-standards-from-file-changfengpro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often lack documented coding standards, leading to inconsistent formatting, naming, and commenting styles across a codebase. This Skill analyzes existing source files and produces a formal coding standards document that reflects the conventions already in use. ## Core Features & Use Cases - Syntax-Based Analysis: Examines indentation, variable naming, commenting, conditionals, and function patterns in one file or an entire folder to derive style rules. - Flexible Output Targets: Writes the standards to a new file (e.g., CODING_STANDARDS.md, CONTRIBUTING.md), inserts them into README.md at a chosen position, or outputs them directly to the prompt. - Inconsistency Detection and Fixing: Counts syntax variations across files, identifies minority patterns, and optionally fixes them to match the majority style. - Language Style Guide References: Optionally fetches official style guides (PEP 8, Google Shell Guide, C++ Core Guidelines, and more) to enrich the generated standards. - Use Case: Point the Skill at your project's src folder to produce a STYLE.md documenting the conventions your team already follows, then add a test file verifying future code adheres to them. ## Quick Start Analyze the file main.py and generate a coding standards document based on its syntax and style conventions.

Frequently Asked Questions about write-coding-standards-from-file

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a coding standards document from existing code?

Pass a source file name as the required fileName parameter, and the Skill analyzes its indentation, naming, commenting, and syntax patterns to produce a standards document. You can also pass a folderName to aggregate conventions across multiple files.

How do I create a style guide for an entire project folder?

Provide the folderName parameter instead of a single file. The Skill loops through each file in the folder, aggregates the syntax data into one dataset, and derives the standards from the combined analysis.

Can the coding standards be added to README.md instead of a new file?

Yes, set addToREADME to true and choose an insertion position with addToREADMEInsertions: atBegin, middle, beforeEnd, or bestFitUsingContext. This disables new file creation and prompt output.

Does it support detecting and fixing inconsistent code styles?

Yes, findInconsistencies counts syntax variations like quote styles and indentation, flagging minority patterns. When fixInconsistencies is true, those outliers are edited to match the majority style; otherwise they are reported to the prompt.

What output file names does the coding standards generator use?

By default it tries a list of conventional names in order: CONTRIBUTING.md, STYLE.md, CODE_OF_CONDUCT.md, CODING_STANDARDS.md, DEVELOPING.md, and others, using the first name that does not already exist. You can also pass a specific string as newFileName.

Which programming languages have reference style guides available?

When fetchStyleURL is true, the Skill fetches official guides matching the file's language, including Python (PEP 8), JavaScript, TypeScript, C, C++, Java, Go, Rust, Ruby, PHP, Swift, Kotlin, SQL, HTML, CSS, and many more.