创建副驾驶指令

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

何时使用此技能

✅ 在以下情况下使用: 引入新文件类型(例如,C 存储库中的第一个 Python 脚本) 新工作流程需要文件范围的规则(例如,添加 InSpec 测试) 现有指令覆盖率存在可测量的差距 ❌ 不要在以下情况下使用:

工作流程

检查现有的覆盖范围。读取.github/instructions/copilot-customization.instructions.md重叠优先矩阵。调查目标文件。识别您正在为其编写说明的文件中的模式、约定和现有样式。起草最小的前沿问题。

命名约定

<topic>.instructions.md,其中<topic>是小写字母,用连字符分隔,描述文件类型或工作流程。此存储库中的示例: c-memory-safety.instructions.md cmocka-testing.instructions.md gnu-autotools.instructions.md

必需的前言

权威模式请参考.github/instructions/copilot-customization.instructions.md。至少:description:(带引号的字符串,一行)applyTo:(逗号分隔的全局模式)

反模式

为存储库中不存在的域创建指令文件 从现有指令文件复制规则 为单个文件编写指令(改为使用内联注释) 包括实现代码(指令定义约定,而不是解决方案) 来源:CTFfactory/salt — 由 TomeVault 分发。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@tomevault-io · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
Python
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Create Copilot Instructions File

Use this skill only when adding a **new** instruction file for a file type or workflow that currently lacks coverage. For updates to existing files, edit directly.

## When to Use This Skill

✅ Use when:
- A new file type is introduced (e.g., first Python script in a C repo)
- A new workflow requires file-scoped rules (e.g., InSpec tests added)
- Existing instruction coverage has a measurable gap

❌ Do NOT use when:
- The file type already has an instruction file — edit it directly
- The rule applies project-wide — add to `copilot-instructions.md` instead
- Only 1-2 files of this type exist — avoid premature abstraction

## Workflow

1. **Check for existing coverage.**
   ```sh
   ls -1 .github/instructions/*.instructions.md
   ```
   Read `.github/instructions/copilot-customization.instructions.md` overlap precedence matrix.

2. **Survey the target files.**
   Identify patterns, conventions, and existing style in the files you're writing instructions for.

3. **Draft minimal frontmatter.**
   ```yaml
   ---
   description: 'Brief description of what these instructions cover'
   applyTo: 'glob/pattern/**/*.ext'
   ---
   ```
   Test the glob pattern matches intended files:
   ```sh
   # Bash glob test
   shopt -s globstar nullglob
   files=( glob/pattern/**/*.ext )
   printf '%s\n' "${files[@]}"
   ```

4. **Write actionable rules.**
   - Be concrete: "Use `sodium_memzero()` before `free()` for secret buffers"
   - Not vague: "Handle memory safely"
   - Include code examples for DO and DON'T patterns

5. **Validate against SSOT.**
   Confirm the new file follows `.github/instructions/copilot-customization.instructions.md` schema and doesn't conflict with existing overlap precedence rules.

6. **Run validation.**
   ```sh
   scripts/validate-copilot-config.sh
   ```

## Naming Convention

`<topic>.instructions.md` where `<topic>` is lowercase, hyphen-separated, and describes the file type or workflow.

Examples from this repository:
- `c-memory-safety.instructions.md`
- `cmocka-testing.instructions.md`
- `gnu-autotools.instructions.md`
- `sbom.instructions.md`

## Required Frontmatter

Refer to `.github/instructions/copilot-customization.instructions.md` for the authoritative schema. At minimum:
- `description:` (quoted string, one line)
- `applyTo:` (comma-separated glob patterns)

## Anti-Patterns

- Creating instruction files for domains not present in the repo
- Duplicating rules from existing instruction files
- Writing instructions for a single file (use inline comments instead)
- Including implementation code (instructions define conventions, not solutions)

---
> Source: [CTFfactory/salt](https://github.com/CTFfactory/salt) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。