home-mcp: Instructions file for GitHub Copilot

.github/copilot-instructions.md

home-mcp copilot-instructions.md is an instructions file for GitHub Copilot from shenjingnan/home-mcp. It costs 1,064 tokens per session, scanned A, original, MIT.

Code-review instructions for a repository containing a Model Context Protocol, or MCP, implementation. They tell reviewers to write useful Chinese comments and focus on security, performance, logic, architecture, types, errors, and tests.

In plain words
What is it for?
Use them to review MCP message handling, reconnect behavior, tool and resource lifecycles, TypeScript design, module boundaries, and asynchronous or end-to-end tests.
Why use it?
They help reviewers distinguish problems that can break software from minor style preferences. Each important comment should explain the cause, suggest a fix, and consider wider effects.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is shenjingnan/home-mcp's own configuration. It tells GitHub Copilot how to work on home-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything home-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shenjingnan/home-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shenjingnan/home-mcp/main/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/home-mcp

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for home-mcp copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shenjingnan/home-mcp/copilot-instructions/github.svg)](https://agentmods.dev/instructions/shenjingnan/home-mcp/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/shenjingnan/home-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/shenjingnan/home-mcp/copilot-instructions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for home-mcp copilot-instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/shenjingnan/home-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/shenjingnan/home-mcp/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,064 This file is loaded in full into every session.
When invoked 1,064 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01064 $0.01064
Opus 5 $0.00532 $0.00532
Sonnet 5 $0.00213 $0.00213
Haiku 4.5 $0.00106 $0.00106

Measured 9d ago against content hash 91df67cec964, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

home-mcp copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 131 lines

What it actually says

GitHub Copilot Code Review 指导

基础规则

  1. Code Review 评论内容请使用中文
  2. 专注于提供有价值、可操作的建议,避免指出显而易见的问题

CR 优先级框架

🔴 高优先级(必须评论)

  • 安全问题:输入验证、SQL 注入、XSS、权限控制等
  • 性能问题:算法复杂度过高、内存泄漏、不必要的循环等
  • 关键逻辑错误:业务逻辑缺陷、边界条件处理不当
  • 架构一致性:违反项目架构模式、模块职责不清
  • TypeScript 类型安全:类型滥用、any 类型的不当使用

🟡 中优先级(建议评论)

  • API 设计:接口一致性、参数设计、返回值结构
  • 错误处理:异常处理不完整、错误信息不清晰
  • 代码可读性:复杂的业务逻辑需要更好的注释或重构
  • 测试质量:测试覆盖率不足、测试用例设计不合理

🟢 低优先级(避免评论)

  • 格式问题:缩进、空格、换行等(应由自动化工具处理)
  • 命名风格:除非严重影响理解
  • 个人编码偏好:不影响功能实现的习惯性写法

项目特定指导

MCP 协议实现

  • 关注 MCP 消息处理的正确性和完整性
  • 检查传输适配器的错误处理和重连机制
  • 验证工具调用和资源管理的生命周期

TypeScript 最佳实践

  • 优先使用具体的类型而非 any
  • 鼓励使用类型推导和泛型
  • 检查接口设计的一致性和向后兼容性

模块化架构

  • 验证模块间的依赖关系是否合理
  • 检查单一职责原则的遵循
  • 确保依赖注入容器的正确使用

测试策略

  • 重点检查集成测试和端到端测试
  • 验证异步代码的正确测试
  • 关注测试的可维护性和可读性

评论质量标准

✅ 好的评论应该

  1. 解释原因:说明为什么需要这个改动
  2. 提供方案:给出具体的修改建议
  3. 考虑影响:说明改动可能对其他部分的影响
  4. 示例代码:在需要时提供代码示例

❌ 避免的评论类型

  1. 仅指出问题:"这里有问题"、"这样不好"
  2. 模糊建议:"建议重构"、"优化一下"
  3. 过度建议:针对边缘案例的过度设计
  4. 风格偏好:个人习惯相关的评论

技术债务关注点

可维护性

  • 代码重复
  • 过长的函数或类
  • 深层嵌套的复杂逻辑

可扩展性

  • 硬编码的配置和常量
  • 缺乏抽象的重复代码
  • 紧耦合的组件设计

可测试性

  • 难以测试的代码结构
  • 过多的外部依赖
  • 缺乏依赖注入

具体示例

好的评论示例

🔴 **安全问题**:这个函数直接使用用户输入构建 SQL 查询,存在 SQL 注入风险。

建议:使用参数化查询或 ORM 的查询构建器来避免 SQL 注入。

```typescript
// 当前代码(不安全)
const query = `SELECT * FROM users WHERE name = '${userName}'`;

// 建议改为
const query = 'SELECT * FROM users WHERE name = ?';
db.query(query, [userName]);

### 应该避免的评论

❌ "这个函数太长了"(没有具体建议) ❌ "变量名应该用 camelCase"(自动化工具应处理) ❌ "建议用 async/await"(没有说明具体收益)


## 上下文理解

1. **理解改动目的**:在评论前先理解这个 PR 的目标
2. **考虑整体影响**:不要只关注局部代码片段
3. **平衡建议**:在完美主义和实用性之间找到平衡
4. **尊重设计决策**:除非有明确问题,否则尊重现有的架构选择

通过遵循这些指导,Copilot 将提供更有价值、更符合人类标准的 Code Review。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 131 lines · 1,064 tokens per session scan A 91df67cec964

Subscribe to this mod's changes

home-mcp copilot-instructions.md is an instructions file published in the GitHub repository shenjingnan/home-mcp (21 stars, last pushed 7mo ago), licensed MIT. It adds 1,064 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens