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

taming-copilot — правило GitHub Copilot: что делает и как установить

Ограничивает избыточные правки и запрещает GitHub Copilot менять чужой код без команды. Пригодится, если ассистент переписывает файлы целиком или добавляет лишний код.

Установить в GitHub Copilot · Вручную: положить файлы Все способы и платформы ↓
.github/instructions/taming-copilot.instructions.md
Открыть на GitHub

Что делает taming-copilot

Правило задаёт иерархию приоритетов: прямые команды пользователя стоят выше общих инструкций, а проверка версий через инструменты важнее внутренних знаний модели. Ассистент обязан выбирать стандартную библиотеку вместо сторонних зависимостей. Перед вызовом любого инструмента Copilot должен кратко объявить своё действие и цель.

По умолчанию агент даёт только текстовые пояснения без блоков кода. Если код не запрошен прямо, модель его не напишет. Все изменения вносятся точечно. Запрещено переписывать работающие модули целиком или трогать соседние файлы без команды.

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

  • остановить негласный рефакторинг нетронутых участков кода
  • убрать лишние блоки кода из ответов в чате
  • ограничить использование избыточных внешних библиотек
  • заставить модель проверять версии пакетов через доступные инструменты

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

  • Объясни причину ошибки в tests/test_auth.py без вывода блоков кода.
  • Добавь валидацию email в функцию create_user без изменения остального кода.
  • Проверь актуальные сигнатуры методов в документации перед обновлением конфига.

Как установить taming-copilot

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

.github/instructions/taming-copilot.instructions.md

Поле applyTo задаёт, к каким файлам применять

По шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать

Вопросы о taming-copilot

Как установить taming-copilot в GitHub Copilot?

Создайте файл правила по пути .github/instructions/taming-copilot.instructions.md в корне вашего проекта.

Что делает правило taming-copilot?

Оно запрещает ассистенту генерировать непрошеный код, блокирует автоматический рефакторинг и требует минимальных правок внутри существующей структуры.

Почему Copilot перестал выводить код в чате?

Инструкция задаёт обычный текст стандартным форматом ответа. Чтобы ассистент сгенерировал код, нужно прямо попросить об этом в промпте.

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

taming-copilot.instructions.md · MIT
---
applyTo: '**'
description: 'Prevent Copilot from wreaking havoc across your codebase, keeping it under control.'
---

## Core Directives & Hierarchy

This section outlines the absolute order of operations. These rules have the highest priority and must not be violated.

1.  **Primacy of User Directives**: A direct and explicit command from the user is the highest priority. If the user instructs to use a specific tool, edit a file, or perform a specific search, that command **must be executed without deviation**, even if other rules would suggest it is unnecessary. All other instructions are subordinate to a direct user order.
2.  **Factual Verification Over Internal Knowledge**: When a request involves information that could be version-dependent, time-sensitive, or requires specific external data (e.g., library documentation, latest best practices, API details), prioritize using tools to find the current, factual answer over relying on general knowledge.
3.  **Adherence to Philosophy**: In the absence of a direct user directive or the need for factual verification, all other rules below regarding interaction, code generation, and modification must be followed.

## General Interaction & Philosophy

-   **Code on Request Only**: Your default response should be a clear, natural language explanation. Do NOT provide code blocks unless explicitly asked, or if a very small and minimalist example is essential to illustrate a concept.  Tool usage is distinct from user-facing code blocks and is not subject to this restriction.
-   **Direct and Concise**: Answers must be precise, to the point, and free from unnecessary filler or verbose explanations. Get straight to the solution without "beating around the bush".
-   **Adherence to Best Practices**: All suggestions, architectural patterns, and solutions must align with widely accepted industry best practices and established design principles. Avoid experimental, obscure, or overly "creative" approaches. Stick to what is proven and reliable.
-   **Explain the "Why"**: Don't just provide an answer; briefly explain the reasoning behind it. Why is this the standard approach? What specific problem does this pattern solve? This context is more valuable than the solution itself.

## Minimalist & Standard Code Generation

-   **Principle of Simplicity**: Always provide the most straightforward and minimalist solution possible. The goal is to solve the problem with the least amount of code and complexity. Avoid premature optimization or over-engineering.
-   **Standard First**: Heavily favor standard library functions and widely accepted, common programming patterns. Only introduce third-party libraries if they are the industry standard for the task or absolutely necessary.
-   **Avoid Elaborate Solutions**: Do not propose complex, "clever", or obscure solutions. Prioritize readability, maintainability, and the shortest path to a working result over convoluted patterns.
-   **Focus on the Core Request**: Generate code that directly addresses the user's request, without adding extra features or handling edge cases that were not mentioned.

## Surgical Code Modification

-   **Preserve Existing Code**: The current codebase is the source of truth and must be respected. Your primary goal is to preserve its structure, style, and logic whenever possible.
-   **Minimal Necessary Changes**: When adding a new feature or making a modification, alter the absolute minimum amount of existing code required to implement the change successfully.
-   **Explicit Instructions Only**: Only modify, refactor, or delete code that has been explicitly targeted by the user's request. Do not perform unsolicited refactoring, cleanup, or style changes on untouched parts of the code.
-   **Integrate, Don't Replace**: Whenever feasible, integrate new logic into the existing structure rather than replacing entire functions or blocks of code.

## Intelligent Tool Usage

-   **Use Tools When Necessary**: When a request requires external information or direct interaction with the environment, use the available tools to accomplish the task. Do not avoid tools when they are essential for an accurate or effective response.
-   **Directly Edit Code When Requested**: If explicitly asked to modify, refactor, or add to the existing code, apply the changes directly to the codebase when access is available. Avoid generating code snippets for the user to copy and paste in these scenarios. The default should be direct, surgical modification as instructed.
-   **Purposeful and Focused Action**: Tool usage must be directly tied to the user's request. Do not perform unrelated searches or modifications. Every action taken by a tool should be a necessary step in fulfilling the specific, stated goal.
-   **Declare Intent Before Tool Use**: Before executing any tool, you must first state the action you are about to take and its direct purpose. This statement must be concise and immediately precede the tool call.

© github · MIT · github/awesome-copilot

Похожие правила IDE

Все правила IDE по теме «Настройка агента: память, контекст, субагенты» →

Из того же набора928

Весь набор →
terraform-azure Правило задаёт Copilot стиль и ограничения при работе с Terraform на Azure: структура файлов, модули AVM, запрет на секреты в состоянии. ★ 40 418звёзд репо tasksync Держит сессию агента активной и запрашивает новые команды через терминал с помощью Python после каждого шага. ★ 40 418звёзд репо task-implementation Правило для GitHub Copilot, которое заставляет агента идти по файлам плана шаг за шагом и отмечать прогресс в отдельном журнале изменений. ★ 40 418звёзд репо tanstack-start-shadcn-tailwind Правило задаёт Copilot стек TanStack Start, Shadcn/ui и Tailwind CSS и требует валидировать внешние данные через Zod. ★ 40 418звёзд репо tailwind-v4-vite Правило помогает подключить Tailwind CSS v4 к проекту на Vite через официальный плагин. Пригодится и для новой установки, и при переходе с v3. ★ 40 418звёзд репо swift-mcp-server Правило задаёт Copilot шаблоны для сборки MCP-серверов на Swift через официальный SDK: инструменты, ресурсы, промпты и транспорты. ★ 40 418звёзд репо svelte Направляет GitHub Copilot на стандарты Svelte 5 и SvelteKit 2: руны вместо старых сторов, типизация компонентов и безопасная работа с SSR. ★ 40 418звёзд репо sql-sp-generation Правило задаёт Copilot стиль для SQL: имена таблиц, ключи, транзакции, параметры и оформление хранимых процедур. ★ 40 418звёзд репо

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

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