@routerhub/agent-rules 1.5.196 → 1.5.197

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/merge.js +14 -7
  2. package/package.json +1 -1
package/merge.js CHANGED
@@ -17,7 +17,7 @@
17
17
  * AGENTS.md 全量合并(兼容 Cursor/Claude Code)
18
18
  * CLAUDE.md 全量合并(Claude Code 自动加载)
19
19
  * 团队级(始终生成、随仓库分发共享):
20
- * .github/copilot-instructions.md 全局规则(VS Code Copilot)
20
+ * .github/copilot-instructions.md 全局+完整私有规则(VS Code Copilot)
21
21
  * .github/instructions/*.instructions.md 按域条件加载(VS Code Copilot applyTo)
22
22
  * .github/PULL_REQUEST_TEMPLATE.md 统一 PR 模板(GitHub 新建 PR 时预填)
23
23
  * .claude/skills/* 同步 Skills 到项目本地
@@ -715,13 +715,20 @@ function mergeAgents(config) {
715
715
  .map((rule) => rule.content.trim())
716
716
  .join("\n\n");
717
717
 
718
- // 4. 生成 .github/copilot-instructions.md(全局规则 + 私有全局部分)
718
+ // 4. 生成 .github/copilot-instructions.md
719
+ // 全局基础规则 + 完整私有规则(含各 @domain 段)。让任意 Agent(Claude Code /
720
+ // VS Code Copilot / Cursor 等)读到同一份完整私有规则:只要 AGENTS.private.md 有
721
+ // 内容就整份追加,不再只取「私有全局段」——否则写在某个 @domain 段、或段落末尾
722
+ // 的私有规则会从 copilot-instructions.md 里静默缺失,造成「我加了规则但 Copilot
723
+ // 那边没同步到」的误解(与 AGENTS.md / CLAUDE.md 的全量注入保持一致)。
719
724
  let copilotContent = "# Copilot Agent Rules\n\n" + globalContent;
720
- if (privateDomains.global) {
721
- copilotContent += "\n\n---\n\n# 项目私有规则\n\n" + privateDomains.global;
725
+ if (privateContent) {
726
+ copilotContent +=
727
+ "\n\n---\n\n# 项目私有规则\n\n以下规则仅适用于本项目,会覆盖基础规则中的相同部分。\n\n" +
728
+ privateContent.trim();
722
729
  }
723
730
  writeFileIfChanged(copilotOutput, copilotContent);
724
- console.log(`✅ 全局规则已生成: ${copilotOutput}`);
731
+ console.log(`✅ 全局规则已生成(含完整私有规则): ${copilotOutput}`);
725
732
 
726
733
  // 5. 生成 .github/instructions/*.instructions.md(各域规则)
727
734
  ensureParentDir(path.join(instructionsDir, "_placeholder"));
@@ -797,7 +804,7 @@ function initAgents() {
797
804
  console.log(" - CLAUDE.md / AGENTS.md(停用时不会生成,并清理本机残留)");
798
805
  console.log(" 查看当前 git 身份:git config user.name / git config user.email");
799
806
  console.log(" 团队级文件(始终生成、随仓库分发):");
800
- console.log(" - .github/copilot-instructions.md(全局规则)");
807
+ console.log(" - .github/copilot-instructions.md(全局规则 + 完整私有规则)");
801
808
  console.log(" - .github/instructions/*.instructions.md(按域条件加载)");
802
809
  console.log(" - .claude/skills/*(Claude Code Skills 技能文件)");
803
810
  }
@@ -954,7 +961,7 @@ function main() {
954
961
  );
955
962
  console.log("输出文件(团队级,始终生成):");
956
963
  console.log(
957
- " .github/copilot-instructions.md 全局规则(VS Code Copilot)",
964
+ " .github/copilot-instructions.md 全局+完整私有规则(VS Code Copilot)",
958
965
  );
959
966
  console.log(
960
967
  " .github/instructions/*.instructions.md 按域条件加载(VS Code Copilot applyTo)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routerhub/agent-rules",
3
- "version": "1.5.196",
3
+ "version": "1.5.197",
4
4
  "description": "Shared Copilot agent rules and guidelines for RouterHub projects",
5
5
  "main": "AGENTS.base.md",
6
6
  "bin": {