GitHub Copilot 从哪里读取仓库级指令?
GitHub Copilot 会自动加载 .github/copilot-instructions.md(用于 Copilot Chat、PR 审查及 coding agent),并在支持的工作流中兼容 AGENTS.md。
从现有 CLAUDE.md 一键生成 .github/copilot-instructions.md,自动剥离 Claude 专属机制并保留构建测试命令与安全边界。
# Acme Billing API Node 22 + TypeScript REST service handling Stripe webhooks, idempotent ledger writes, and PDF invoices. ## Commands - Fast single test: `npx vitest run src/billing/webhook.test.ts` - Full test suite: `pnpm test` - Typecheck & lint: `npx tsc --noEmit && pnpm lint` - Build: `pnpm build` ## Rules - Don't bypass Zod validation on webhook routes. Instead parse payloads in `src/webhooks/schema.ts`. Because unvalidated retries previously caused duplicate charges. - Don't mix package managers. Instead use `pnpm` exclusively. Because competing lockfiles break CI caching. - When changing SQL schemas, read `docs/migrations.md` before editing Prisma files. ## Continuity - Record verified test outputs in `HANDOFF.md` before ending multi-step sessions.
| 文件 | 读取工具 | 推荐放什么 | 同步策略 |
|---|---|---|---|
| AGENTS.md | Codex CLI, Cursor, Copilot, Windsurf | 项目事实、构建/测试命令、包管理器约束、架构与安全边界 | 唯一真源 |
| CLAUDE.md | Claude Code | @AGENTS.md 导入 + .claude/settings.json hooks、skills、权限说明 | @AGENTS.md |
| .cursor/rules/*.mdc | Cursor Agent & Inline Edit | 带 globs: 的按目录/文件类型局部规范(UI、SQL、测试等) | 按 glob 挂载 |
| .github/copilot-instructions.md | GitHub Copilot | 指向 AGENTS.md 或同步后的精简仓库规范 | 指针 / CI 校验 |
| GEMINI.md | Gemini CLI | @AGENTS.md 导入 + Gemini 专属工具提示 | @AGENTS.md |
GitHub Copilot 会自动加载 .github/copilot-instructions.md(用于 Copilot Chat、PR 审查及 coding agent),并在支持的工作流中兼容 AGENTS.md。
切换到指针模式,以 AGENTS.md 为唯一真源,两个工具文件均指向它,并在 CI 中接入 agentlint check 防止漂移。
直接复制 TypeScript、Python、Next.js、FastAPI、Rust、Go、Vue、Monorepo 高分起步模板。
查看中位数 132 行、37 个超 40K 截断案例与 58% Actions 未锁 SHA 的全量数据。
看 VS Code、Next.js、uv、Bun 等顶级开源项目的 CLAUDE.md / AGENTS.md 实测评分。