К основному содержанию
скилл GitHub Copilot официальный · GitHub

editorconfig — скилл для GitHub Copilot: настройка стиля

Создаёт .editorconfig после анализа структуры проекта и ваших правил оформления. Подходит, когда нужно закрепить единый стиль файлов.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add github/awesome-copilot --skill editorconfig -a claude-code
Открыть на GitHub

Что делает editorconfig

Скилл изучает структуру проекта и типы файлов, чтобы определить используемые языки и технологии. Затем он формирует .editorconfig с glob-шаблонами для найденных файлов и учитывает заданные требования к оформлению.

По умолчанию он задаёт отступы пробелами размером 2, а также правила для кодировки, концов строк, пробелов в конце строк и финального перевода строки. Результат содержит полный файл в блоке кода и пояснение к каждому правилу. Если требование расходится с обычной практикой, скилл следует ему и поясняет конфликт. Ставить стоит командам, которым нужен единый стиль в разных редакторах и IDE.

Какие задачи решает

  • создать .editorconfig по структуре проекта
  • задать отступы пробелами размером 2
  • применить правила к типам файлов через glob-шаблоны
  • убрать лишние пробелы в конце строк
  • объяснить каждую строку конфигурации

Примеры запросов агенту

  • Создай `.editorconfig` для этого проекта и объясни каждое правило.
  • Проанализируй типы файлов и подготовь `.editorconfig` с отступами в 2 пробела.
  • Сделай правила для Markdown, чтобы не удалять значимые пробелы в конце строк.

Как установить editorconfig

1Через Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill editorconfig -a claude-code

2Вручную: положить файлы

~/.claude/skills/editorconfig/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/editorconfig/

Похожие

migrate-to-shoehorn Matt Pocock Переводит type assertions с as в тестах на функции из @total-typescript/shoehorn. Нужен для частичных объектов и намеренно неверных данных в проверках. Claude Code 475 388установок typescript-advanced-types Seth Hobson Помогает агенту писать сложную типизацию TypeScript: generics, conditional types и преобразования типов. Нужен для библиотек, API-клиентов и строгих конфигураций. Claude Code CX Codex Cursor 92 169установок dotnet-best-practices официальный github Проверяет выделенный .NET/C# код по правилам проекта: от структуры и DI до тестов, логирования и безопасности. Нужен при ревью или доработке решения. GitHub Copilot 15 752установок nuget-manager официальный github Управляет NuGet-пакетами в .NET-проектах через dotnet CLI. Нужен при добавлении, удалении и обновлении зависимостей. GitHub Copilot 14 360установок typescript-mcp-server-generator официальный github Генерирует TypeScript-проект MCP-сервера с инструментами, ресурсами и конфигурацией. Пригодится, когда нужно быстро заложить сервер на MCP TypeScript SDK v2. GitHub Copilot 12 050установок java-junit официальный github Пишет, проверяет и исправляет Java-тесты на JUnit, AssertJ и Mockito. Нужен при добавлении, рефакторинге или разборе падений тестов в Maven и Gradle. GitHub Copilot 11 632установок

Вопросы о editorconfig

Как установить editorconfig в GitHub Copilot?

Выполните npx skills add github/awesome-copilot --skill editorconfig. Также доступна команда gh skill install github/awesome-copilot editorconfig.

Что делает editorconfig?

Скилл анализирует проект и создаёт .editorconfig для единых правил форматирования. Он добавляет объяснение для каждого правила в созданном файле.

Какие настройки добавляет editorconfig?

Скилл учитывает отступы, кодировку, окончания строк, пробелы в конце строк и финальный перевод строки. Для Markdown он может переопределить правило удаления хвостовых пробелов.

Исходный текст

SKILL.md · MIT
---
name: editorconfig
description: 'Generates a comprehensive and best-practice-oriented .editorconfig file based on project analysis and user preferences.'
---

## 📜 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).

© github · MIT · github/awesome-copilot

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой