EditorConfig file validation and template for enforcing consistent coding styles across editors and IDEs in monorepos. Includes 4 required standards (root declaration, universal settings with UTF-8 and LF line endings, language-specific indentation for JS/TS/Markdown/Python, root-only placement in monorepos). Use when creating or auditing .editorconfig files to ensure consistent code formatting.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides .editorconfig template and validation logic for maintaining consistent coding styles across editors and IDEs.
Manage .editorconfig configuration to:
This skill is invoked by the editorconfig-agent when:
The standard EditorConfig template is located at:
templates/.editorconfig.template
File must start with root declaration:
root = true
This stops EditorConfig from searching parent directories, ensuring the monorepo has a single source of truth.
Must include [*] section with these four settings:
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
These settings apply to all files unless overridden by language-specific rules.
Must include sections for JavaScript/TypeScript (2 spaces), Markdown (preserve trailing), and Python (4 spaces):
[*.{js,jsx,ts,tsx,json,jsonc,yml,yaml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[*.py]
indent_style = space
indent_size = 4
In monorepos, .editorconfig must exist ONLY at repository root:
Validation steps:
[*] with all 4 settings// Rule 1: Root declaration
if (!content.includes("root = true")) {
errors.push("Rule 1: Missing 'root = true' declaration");
}
// Rule 2: Universal settings (check all 4)
[
"[*]",
"charset = utf-8",
"end_of_line = lf",
"insert_final_newline = true",
"trim_trailing_whitespace = true",
].forEach((setting) => {
if (!content.includes(setting)) errors.push(`Rule 2: Missing ${setting}`);
});
// Rule 3: Language sections
if (!/\[\*\.\{[^}]*js[^}]*\}\]/.test(content)) {
errors.push("Rule 3: Missing JS/TS indentation rules");
}
if (!/\[\*\.md\]/.test(content)) {
errors.push("Rule 3: Missing Markdown section");
}
if (!/\[\*\.py\]/.test(content)) {
errors.push("Rule 3: Missing Python section");
}
// Rule 4: Package-level configs (monorepo only)
const packageConfigs = glob("packages/**/.editorconfig");
if (packageConfigs.length > 0) {
errors.push(
`Rule 4: Remove package-level configs: ${packageConfigs.join(", ")}`,
);
}
Repos may declare exceptions in package.json:
{
"metasaver": {
"exceptions": {
"editorconfig-config": {
"type": "custom-language-rules",
"reason": "Requires 4-space indentation for legacy YAML files"
}
}
}
}
This skill integrates with:
scope parameter. If not provided, use /skill scope-check/skill audit-workflow - Bi-directional comparison workflow/skill remediation-options - Conform/Update/Ignore choicesprettier-agent - Coordination with Prettier formatting ruleseslint-agent - Coordination with ESLint style rules