Project: {PROJECT_NAME}
【免费下载链接】awesome-copilotCommunity-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.项目地址: https://gitcode.com/GitHub_Trending/aw/awesome-copilot
Overview
{Brief project description}
Tech Stack
- Language: {LANGUAGE}
- Framework: {FRAMEWORK}
- Package Manager: {PACKAGE_MANAGER}
Code Standards
- Follow {STYLE_GUIDE} conventions
- Use {FORMATTER} for formatting
- Run {LINTER} before committing
Architecture
{High-level architecture notes}
Development Workflow
- {Step 1}
- {Step 2}
- {Step 3}
Important Patterns
- {Pattern 1}
- {Pattern 2}
Do Not
- {Anti-pattern 1}
- {Anti-pattern 2}
注意结尾的 "Do Not" 节:显式列出反模式是这类基础指令文件控制 Copilot 行为的关键手段。 ### Agent 模板(.agent.md) ```markdown --- description: '{DESCRIPTION}' model: GPT-4.1 tools: [{RELEVANT_TOOLS}] --- # {AGENT_NAME} ## Role {Role description} ## Capabilities - {Capability 1} - {Capability 2} ## Guidelines {Specific guidelines for this agent}Instructions 模板(.instructions.md)
--- description: '{DESCRIPTION}' applyTo: '{FILE_PATTERNS}' --- # {LANGUAGE/DOMAIN} Instructions ## Conventions - {Convention 1} - {Convention 2} ## Patterns {Preferred patterns} ## Anti-patterns {Patterns to avoid}Prompt 模板(.prompt.md)
--- agent: 'agent' description: '{DESCRIPTION}' --- {PROMPT_CONTENT}Skill 模板(SKILL.md)
--- name: '{skill-name}' description: '{DESCRIPTION - 10 to 1024 chars}' --- # {Skill Name} ## Purpose {What this skill enables} ## Instructions {Detailed instructions for the skill} ## Assets {Reference any bundled files}语言/框架预设
/bootstrap会按检测到的技术栈提供对应的起步内容:
| 技术栈 | 预设内容 |
|---|---|
| JavaScript/TypeScript | ESLint + Prettier instructions;Jest/Vitest 测试 prompt;组件生成 skill |
| Python | PEP 8 + Black/Ruff instructions;pytest 测试 prompt;类型提示(type hints)约定 |
| Go | gofmt 约定;表驱动测试(table-driven test)模式;错误处理准则 |
| Rust | Cargo 约定;Clippy 准则;内存安全模式 |
| .NET/C# | dotnet 约定;xUnit 测试模式;async/await 准则 |
校验规则:Frontmatter 要求、命名与体积
文档声明这些规则"来自 awesome-copilot 官方要求",Agent 不做逐文件深度校验,但在生成模板时必须遵守:
| 文件类型 | 必需字段 | 建议字段 |
|---|---|---|
.agent.md | description | model、tools、name |
.prompt.md | agent、description | model、tools、name |
.instructions.md | description、applyTo | - |
SKILL.md | name、description | - |
补充约束:
.prompt.md的agent字段可取'agent'、'ask'或'Plan';applyTo使用 glob 模式,如'**/*.ts'或'**/*.js, **/*.ts';SKILL.md的name必须与所在文件夹名一致,且为小写连字符命名。
命名约定:所有文件用小写加连字符(如my-agent.agent.md);skill 文件夹名必须与SKILL.md中name字段一致;文件名中不允许空格。
体积指引:
copilot-instructions.md:500–3000 字符(保持聚焦);AGENTS.md:CLI 场景可以更大(CLI 上下文窗口成本更低);- 单个 Agent:500–2000 字符;
- Skill:含资源最多约 5000 字符。
与仓库真实校验逻辑的交叉印证
上述规则并非 Agent 的主观约定,awesome-copilot 仓库的 CI 脚本对其有机器可执行的实现,可以据此核对细节:
- Skill
name必须匹配正则^[a-z0-9-]+$(仅小写字母、数字、连字符),且长度受限(上限 64 字符);description最少 10 个字符、最多 1024 个字符;文件夹名与name不一致会直接报错。这些校验见 eng/validate-skills.mjs 中的validateSkillName与validateSkillDescription,以及 eng/validate-skills.mjs 中的文件夹名一致性检查; - Skill 捆绑资源(bundled assets)单文件上限 5 MB,由 eng/validate-skills.mjs 的
MAX_ASSET_SIZE = 5 * 1024 * 1024常量强制执行; - Agent 文件的
description需以单引号包裹、非空,文件名小写连字符,tools建议提供、model强烈建议指定,这些要求同样写在本仓库根目录的 AGENTS.md "Development Workflow" 一节中。
因此在自己的项目里用/validate得到的结论,与文件将来提交进 awesome-copilot 这类社区仓库时 CI 的行为是一致的——先通过本地 Agent 校验,再进人工审查,是文档推荐的稳妥路径。
执行准则与输出格式
文档对 Agent 自身定义了六条执行准则:
- Always Detect First—— 动手前先勘察项目现状;
- Prefer Non-Destructive—— 未经确认绝不覆盖已有文件;
- Explain Tradeoffs—— 混合环境下要解释符号链接与独立文件的取舍;
- Validate After Changes——
/bootstrap或/migrate之后必须跑一遍/validate; - Respect Existing Conventions—— 模板应适配项目既有风格;
- Check MCP Availability—— 只有在确认
mcp_awesome-copil_*工具存在时才推荐社区资源,否则跳过且不引用这些工具。
执行完成后,输出必须包含三段:Summary(创建/校验了什么)、Next Steps(建议的即时动作)、Customization Hints(如何按需定制)。示例输出:
## Scaffolding Complete ✅ Created: .github/ ├── copilot-instructions.md (new) ├── agents/ │ └── code-reviewer.agent.md (new) ├── instructions/ │ └── typescript.instructions.md (new) └── prompts/ └── test-gen.prompt.md (new) AGENTS.md → symlink to .github/copilot-instructions.md Next Steps: 1. Review and customize copilot-instructions.md 2. Add project-specific agents as needed 3. Create skills for complex workflows Customization: - Add more agents in .github/agents/ - Create file-specific rules in .github/instructions/ - Build reusable prompts in .github/prompts/【免费下载链接】awesome-copilotCommunity-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.项目地址: https://gitcode.com/GitHub_Trending/aw/awesome-copilot
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考