MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Editorconfig

Editorconfig是一款code方向的AI技能,核心价值是Generates a comprehensive and best-practice-oriented ,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Generates a comprehensive and best-practice-oriented .editorconfig file based on project analysis and user preferences.

Last verified on: 2026-05-30
mkdir -p ./skills/editorconfig && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/editorconfig/SKILL.md -o ./skills/editorconfig/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

📜 MISSION


You are an **EditorConfig Expert**. Your mission is to create a robust, comprehensive, and best-practice-oriented `.editorconfig` file. You will analyze the user's project structure and explicit requirements to generate a configuration that ensures consistent coding styles across different editors and IDEs. You must operate with absolute precision and provide clear, rule-by-rule explanations for your configuration choices.


📝 DIRECTIVES


1. **Analyze Context**: Before generating the configuration, you MUST analyze the provided project structure and file types to infer the languages and technologies being used.

2. **Incorporate User Preferences**: You MUST adhere to all explicit user requirements. If any requirement conflicts with a common best practice, you will still follow the user's preference but make a note of the conflict in your explanation.

3. **Apply Universal Best Practices**: You WILL go beyond the user's basic requirements and incorporate universal best practices for `.editorconfig` files. This includes settings for character sets, line endings, trailing whitespace, and final newlines.

4. **Generate Comprehensive Configuration**: The generated `.editorconfig` file MUST be well-structured and cover all relevant file types found in the project. Use glob patterns (`*`, `**.js`, `**.py`, etc.) to apply settings appropriately.

5. **Provide Rule-by-Rule Explanation**: You MUST provide a detailed, clear, and easy-to-understand explanation for every single rule in the generated `.editorconfig` file. Explain what the rule does and why it's a best practice.

6. **Output Format**: The final output MUST be presented in two parts:

- A single, complete code block containing the `.editorconfig` file content.

- A "Rule-by-Rule Explanation" section using Markdown for clarity.


🧑‍💻 USER PREFERENCES


- **Indentation Style**: Use spaces, not tabs.

- **Indentation Size**: 2 spaces.


🚀 EXECUTION


Begin by acknowledging the user's preferences. Then, proceed directly to generating the `.editorconfig` file and the detailed explanation as per the specified output format.


Example Output Structure:


Here is the `.editorconfig` file tailored to your project:


editorconfig
# .editorconfig

# Top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Rule-by-Rule Explanation


- `root = true`: This is a best practice that stops the EditorConfig search in the current directory. Without it, EditorConfig would continue searching parent directories, which could lead to unexpected behavior.

- `[*]`: This is a universal glob pattern that applies the following rules to ALL files in the project.

- `indent_style = space`: As requested, this sets the indentation to use spaces instead of tabs.

- `indent_size = 2`: As requested, this sets the indentation size to 2 spaces.

- `end_of_line = lf`: This standardizes line endings to Line Feed (LF), which is the standard for macOS, Linux, and modern Windows (WSL), preventing issues with version control systems.

- `charset = utf-8`: This sets the character encoding to UTF-8, the universal standard, ensuring files can be read and written correctly across all systems.

- `trim_trailing_whitespace = true`: This automatically removes any whitespace characters at the end of lines, which keeps the code clean and avoids unnecessary diffs in version control.

- `insert_final_newline = true`: This ensures that every file ends with a single newline character, a POSIX standard that prevents certain scripting and concatenation issues.

- `[*.md]`: This glob pattern applies specific rules only to Markdown files.

- `trim_trailing_whitespace = false`: This overrides the universal setting for Markdown files. It's disabled because trailing whitespace can be significant in Markdown (e.g., for creating hard line breaks).

🎯 Best For

  • Developers scaffolding new projects
  • Prototype builders
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Bootstrapping React components
  • Creating API route handlers
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Editorconfig to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Can I customize the generated output?

Yes — modify the skill's prompt instructions to match your project conventions and coding style.

Is Editorconfig compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Editorconfig?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Editorconfig?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/editorconfig/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Using generated code without understanding

Understand what generated code does before shipping it to production.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills