reporefit 0.3.1 → 0.4.0

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.
@@ -7,12 +7,12 @@ var __export = (target, all2) => {
7
7
 
8
8
  // src/cli.ts
9
9
  import { writeFileSync } from "node:fs";
10
- import { join as join3 } from "node:path";
10
+ import { join as join4 } from "node:path";
11
11
 
12
12
  // ../core/src/types.ts
13
- var SCHEMA_VERSION = "0.2.0";
14
- var ENGINE_VERSION = "0.3.0";
15
- var RULESET_VERSION = "2026.12.1";
13
+ var SCHEMA_VERSION = "0.3.0";
14
+ var ENGINE_VERSION = "0.4.0";
15
+ var RULESET_VERSION = "2026.12.6";
16
16
 
17
17
  // ../core/src/input/limits.ts
18
18
  var MiB = 1024 * 1024;
@@ -75,9 +75,9 @@ function detectWrapperRoot(paths) {
75
75
  if (p !== root) return null;
76
76
  continue;
77
77
  }
78
- const first = p.slice(0, slash);
79
- if (root === null) root = first;
80
- else if (first !== root) return null;
78
+ const first2 = p.slice(0, slash);
79
+ if (root === null) root = first2;
80
+ else if (first2 !== root) return null;
81
81
  sawNested = true;
82
82
  }
83
83
  return sawNested ? root : null;
@@ -202,6 +202,7 @@ var TEXT_EXT = /* @__PURE__ */ new Set([
202
202
  "md",
203
203
  "markdown",
204
204
  "mdx",
205
+ "mdc",
205
206
  "txt",
206
207
  "rst",
207
208
  "json",
@@ -7469,8 +7470,28 @@ function blankFrontMatter(text3) {
7469
7470
  const blank = m[0].replace(/[^\r\n]/g, " ");
7470
7471
  return { body: blank + text3.slice(m[0].length), frontMatter: m[1] ?? "" };
7471
7472
  }
7473
+ var SHARED_TEXT_LIMIT = 64 * 1024;
7474
+ var shared = null;
7475
+ var sharedText = 0;
7472
7476
  function parseTree(text3) {
7473
- return fromMarkdown(blankFrontMatter(text3).body);
7477
+ const hit = shared?.get(text3);
7478
+ if (hit) return hit;
7479
+ const tree = fromMarkdown(blankFrontMatter(text3).body);
7480
+ if (shared && sharedText + text3.length <= SHARED_TEXT_LIMIT) {
7481
+ shared.set(text3, tree);
7482
+ sharedText += text3.length;
7483
+ }
7484
+ return tree;
7485
+ }
7486
+ async function withSharedTrees(fn) {
7487
+ if (shared) return fn();
7488
+ shared = /* @__PURE__ */ new Map();
7489
+ sharedText = 0;
7490
+ try {
7491
+ return await fn();
7492
+ } finally {
7493
+ shared = null;
7494
+ }
7474
7495
  }
7475
7496
  function walk(node2, visit) {
7476
7497
  visit(node2);
@@ -7854,11 +7875,11 @@ function checkMcp(docs) {
7854
7875
  const f1 = [];
7855
7876
  const f2 = [];
7856
7877
  const lines = (doc) => doc.text.split(/\r\n|\r|\n/);
7857
- const push2 = (list2, ruleId, doc, line, key, params, severity, suffix) => {
7878
+ const push2 = (list2, ruleId, doc, line, key, params, severity2, suffix) => {
7858
7879
  list2.push({
7859
7880
  id: `${ruleId}-${fnv1a(`${doc.path}:${line}:${suffix}`)}`,
7860
7881
  ruleId,
7861
- severity,
7882
+ severity: severity2,
7862
7883
  confidence: "high",
7863
7884
  messageKey: key,
7864
7885
  params,
@@ -7921,7 +7942,7 @@ function checkMcp(docs) {
7921
7942
  }
7922
7943
 
7923
7944
  // ../core/src/ai/profiles.ts
7924
- var PLATFORMS = ["codex", "claude", "gemini"];
7945
+ var PLATFORMS = ["codex", "claude", "gemini", "copilot", "cursor", "grok", "antigravity"];
7925
7946
  var PROFILES = {
7926
7947
  codex: {
7927
7948
  platform: "codex",
@@ -7936,8 +7957,8 @@ var PROFILES = {
7936
7957
  },
7937
7958
  claude: {
7938
7959
  platform: "claude",
7939
- profileVersion: "claude-code-memory@2026-11-30",
7940
- reviewedAt: "2026-11-30",
7960
+ profileVersion: "claude-code-memory@2026-12-01",
7961
+ reviewedAt: "2026-12-01",
7941
7962
  sourceUrls: ["https://code.claude.com/docs/en/memory"],
7942
7963
  // "maximum depth of four hops"
7943
7964
  maxImportDepth: 4,
@@ -7956,15 +7977,69 @@ var PROFILES = {
7956
7977
  maxImportDepth: 5,
7957
7978
  maxCombinedBytes: null,
7958
7979
  unseen: ["ai.unseen.geminiGlobal", "ai.unseen.geminiFileName", "ai.unseen.geminiJit"]
7980
+ },
7981
+ copilot: {
7982
+ platform: "copilot",
7983
+ profileVersion: "github-copilot-instructions@2026-12-01",
7984
+ reviewedAt: "2026-12-01",
7985
+ sourceUrls: ["https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions"],
7986
+ maxImportDepth: null,
7987
+ maxCombinedBytes: null,
7988
+ unseen: ["ai.unseen.copilotPersonal"]
7989
+ },
7990
+ cursor: {
7991
+ platform: "cursor",
7992
+ profileVersion: "cursor-agents-window-rules@2026-12-01",
7993
+ reviewedAt: "2026-12-01",
7994
+ // cursor.com/docs moved permanently to docs.grok.com/build on the review date.
7995
+ sourceUrls: ["https://docs.grok.com/build/agents-window/rules"],
7996
+ // "@file" in a rule only points at the file; it does not insert its content.
7997
+ maxImportDepth: null,
7998
+ maxCombinedBytes: null,
7999
+ unseen: ["ai.unseen.cursorUserTeam"]
8000
+ },
8001
+ grok: {
8002
+ platform: "grok",
8003
+ profileVersion: "grok-build-terminal-rules@2026-12-01",
8004
+ reviewedAt: "2026-12-01",
8005
+ sourceUrls: ["https://docs.grok.com/build/features/project-rules"],
8006
+ maxImportDepth: null,
8007
+ maxCombinedBytes: null,
8008
+ unseen: ["ai.unseen.grokHome"]
8009
+ },
8010
+ antigravity: {
8011
+ platform: "antigravity",
8012
+ profileVersion: "antigravity-rules@2026-12-01",
8013
+ reviewedAt: "2026-12-01",
8014
+ sourceUrls: ["https://antigravity.google/docs/rules.md"],
8015
+ maxImportDepth: null,
8016
+ maxCombinedBytes: null,
8017
+ unseen: ["ai.unseen.antigravityGlobal"]
7959
8018
  }
7960
8019
  };
7961
8020
  var base = (p) => p.slice(p.lastIndexOf("/") + 1);
7962
8021
  function instructionPlatforms(path) {
7963
8022
  const name = base(path);
7964
8023
  const out = [];
7965
- if (name === "AGENTS.md" || name === "AGENTS.override.md") out.push("codex");
7966
- if (name === "CLAUDE.md" || name === "CLAUDE.local.md" || /(^|\/)\.claude\/rules\/.+\.md$/.test(path)) out.push("claude");
7967
- if (name === "GEMINI.md") out.push("gemini");
8024
+ const add = (...ps) => {
8025
+ for (const p of ps) if (!out.includes(p)) out.push(p);
8026
+ };
8027
+ if (/(^|\/)\.claude\/AGENTS\.md$/.test(path)) return ["claude"];
8028
+ if (/(^|\/)\.agents\/(AGENTS|GEMINI)\.md$/.test(path)) return ["antigravity"];
8029
+ if (name === "AGENTS.md") add("codex", "claude", "copilot", "cursor", "grok", "antigravity");
8030
+ if (name === "AGENTS.override.md") add("codex");
8031
+ if (name === "Agents.md" || name === "AGENT.md" || name === "Claude.md") add("grok");
8032
+ if (name === "CLAUDE.md" || name === "CLAUDE.local.md") {
8033
+ add("claude");
8034
+ if (!/(^|\/)\.claude\//.test(path)) add("grok");
8035
+ }
8036
+ if (path === "CLAUDE.md" || path === "GEMINI.md") add("copilot");
8037
+ if (/(^|\/)\.claude\/rules\/.+\.md$/.test(path)) add("claude");
8038
+ if (/(^|\/)\.(claude|cursor|grok)\/rules\/[^/]+\.md$/.test(path)) add("grok");
8039
+ if (/(^|\/)\.cursor\/rules\/.+\.mdc$/.test(path)) add("cursor");
8040
+ if (name === "GEMINI.md") add("gemini", "antigravity");
8041
+ if (/(^|\/)\.agents?\/rules\/[^/]+\.md$/.test(path)) add("antigravity");
8042
+ if (path === ".github/copilot-instructions.md" || /^\.github\/instructions\/.+\.instructions\.md$/.test(path)) add("copilot");
7968
8043
  return out;
7969
8044
  }
7970
8045
 
@@ -7985,10 +8060,10 @@ function frontMatterFields(text3) {
7985
8060
  function checkSkills(docs) {
7986
8061
  const skills = docs.filter((d) => isSkillPath(d.path)).sort((a, b) => a.path < b.path ? -1 : 1);
7987
8062
  const findings = [];
7988
- const add = (doc, key, params, severity) => findings.push({
8063
+ const add = (doc, key, params, severity2) => findings.push({
7989
8064
  id: `AGT-001-${fnv1a(`${doc.path}:${key}`)}`,
7990
8065
  ruleId: "AGT-001",
7991
- severity,
8066
+ severity: severity2,
7992
8067
  confidence: "high",
7993
8068
  messageKey: key,
7994
8069
  params: { path: doc.path, ...params },
@@ -8024,9 +8099,33 @@ function checkSkills(docs) {
8024
8099
  scopeKey: "agt001.scope"
8025
8100
  };
8026
8101
  }
8027
- var PM = /\b(?:use|using|run|with|prefer|always use)\s+(npm|pnpm|yarn|bun)\b/i;
8028
- var INDENT_SPACES = /\b(?:indent(?:ation)?|use)\b[^.\n]{0,30}?\b(\d)\s*-?\s*spaces?\b/i;
8029
- var INDENT_TABS = /\b(?:indent(?:ation)?\b[^.\n]{0,20}\btabs?\b|use tabs\b)/i;
8102
+ var PM = [
8103
+ /\b(?:use|using|run|with|prefer|always use)\s+(npm|pnpm|yarn|bun)\b/i,
8104
+ /\b(npm|pnpm|yarn|bun)\s*(?:을|를|만)?\s*(?:사용|쓴다|쓰세요|씁니다|써 ?주세요|이용)/i,
8105
+ /\b(npm|pnpm|yarn|bun)\s*(?:を|だけを)?\s*(?:使用|使う|使って|使います|使いましょう)/i,
8106
+ /(?:使用|采用|统一用|只用)\s*(npm|pnpm|yarn|bun)\b/i
8107
+ ];
8108
+ var INDENT_SPACES = [
8109
+ /\b(?:indent(?:ation)?|use)\b[^.\n]{0,30}?\b(\d)\s*-?\s*spaces?\b/i,
8110
+ /들여쓰기[^.\n]{0,15}?(\d)\s*칸|(\d)\s*칸\s*들여쓰기|들여쓰기[^.\n]{0,15}?공백\s*(\d)/,
8111
+ /インデント[^。\n]{0,15}?(\d)\s*(?:スペース|文字|つ)|スペース\s*(\d)\s*(?:つ|個)で?インデント/,
8112
+ /缩进[^。\n]{0,15}?(\d)\s*个?空格|(\d)\s*个空格缩进/
8113
+ ];
8114
+ var INDENT_TABS = [
8115
+ /\b(?:indent(?:ation)?\b[^.\n]{0,20}\btabs?\b|use tabs\b)/i,
8116
+ /들여쓰기[^.\n]{0,15}탭|탭으로 들여/,
8117
+ /インデント[^。\n]{0,15}タブ|タブでインデント/,
8118
+ /缩进[^。\n]{0,15}(?:制表符|tab)|(?:制表符|tab)\s*缩进/i
8119
+ ];
8120
+ var NODE_VERSION = /\bnode(?:\.js)?\s*v?(\d{2})(?:\.\d+)*\b[^.\n]{0,20}?(?:or later|or newer|\+|required|以上|이상|以降|及以上)?/i;
8121
+ var NODE_CONTEXT = /\b(use|using|require[sd]?|need[s]?|run on|target|supported?)\b|사용|필요|필수|이상|使用|必要|以上|以降|需要|要求|及以上/i;
8122
+ var first = (res, text3) => {
8123
+ for (const re of res) {
8124
+ const m = re.exec(text3);
8125
+ if (m) return m.slice(1).find((g) => g !== void 0) ?? "";
8126
+ }
8127
+ return null;
8128
+ };
8030
8129
  function claims(doc) {
8031
8130
  const out = [];
8032
8131
  const lines = doc.text.split(/\r\n|\r|\n/);
@@ -8037,11 +8136,14 @@ function claims(doc) {
8037
8136
  for (let ln = node2.position.start.line; ln <= node2.position.end.line; ln++) {
8038
8137
  const text3 = (lines[ln - 1] ?? "").replace(/`[^`]*`/g, "");
8039
8138
  const at = { path: doc.path, line: ln, column: 1 };
8040
- const pm = PM.exec(text3);
8041
- if (pm) out.push({ topic: "package-manager", value: pm[1].toLowerCase(), at, line: lines[ln - 1] ?? "" });
8042
- const sp = INDENT_SPACES.exec(text3);
8043
- if (sp) out.push({ topic: "indentation", value: `${sp[1]} spaces`, at, line: lines[ln - 1] ?? "" });
8044
- else if (INDENT_TABS.test(text3)) out.push({ topic: "indentation", value: "tabs", at, line: lines[ln - 1] ?? "" });
8139
+ const line = lines[ln - 1] ?? "";
8140
+ const pm = first(PM, text3);
8141
+ if (pm) out.push({ topic: "package-manager", value: pm.toLowerCase(), at, line });
8142
+ const sp = first(INDENT_SPACES, text3);
8143
+ if (sp) out.push({ topic: "indentation", value: `${sp} spaces`, at, line });
8144
+ else if (first(INDENT_TABS, text3) !== null) out.push({ topic: "indentation", value: "tabs", at, line });
8145
+ const node3 = NODE_VERSION.exec(text3);
8146
+ if (node3 && NODE_CONTEXT.test(text3)) out.push({ topic: "node-version", value: `Node ${node3[1]}`, at, line });
8045
8147
  }
8046
8148
  });
8047
8149
  return out;
@@ -8050,12 +8152,12 @@ function checkConflicts(docs) {
8050
8152
  const instruction = docs.filter((d) => instructionPlatforms(d.path).length > 0).sort((a, b) => a.path < b.path ? -1 : 1);
8051
8153
  const all2 = instruction.flatMap(claims);
8052
8154
  const findings = [];
8053
- for (const topic of ["package-manager", "indentation"]) {
8155
+ for (const topic of ["package-manager", "indentation", "node-version"]) {
8054
8156
  const byValue = /* @__PURE__ */ new Map();
8055
8157
  for (const c of all2.filter((x) => x.topic === topic)) byValue.set(c.value, [...byValue.get(c.value) ?? [], c]);
8056
8158
  if (byValue.size < 2) continue;
8057
8159
  const groups = [...byValue.entries()];
8058
- const [first, ...rest] = groups.flatMap(([, cs]) => cs);
8160
+ const [first2, ...rest] = groups.flatMap(([, cs]) => cs);
8059
8161
  findings.push({
8060
8162
  id: `AGT-002-${fnv1a(`${topic}:${groups.map(([v]) => v).sort().join("|")}`)}`,
8061
8163
  ruleId: "AGT-002",
@@ -8063,10 +8165,10 @@ function checkConflicts(docs) {
8063
8165
  confidence: "medium",
8064
8166
  messageKey: `agt002.${topic}`,
8065
8167
  params: { values: groups.map(([v, cs]) => `${v} (${cs.map((c) => `${c.at.path}:${c.at.line}`).join(", ")})`).join(" / ") },
8066
- location: first.at,
8067
- evidence: truncate(maskSecrets(first.line.trim())),
8168
+ location: first2.at,
8169
+ evidence: truncate(maskSecrets(first2.line.trim())),
8068
8170
  recommendation: { messageKey: "agt002.fix", params: { topic } },
8069
- verification: { messageKey: "agt.verify", params: { path: first.at.path, line: first.at.line } },
8171
+ verification: { messageKey: "agt.verify", params: { path: first2.at.path, line: first2.at.line } },
8070
8172
  related: rest.map((c) => c.at)
8071
8173
  });
8072
8174
  }
@@ -8082,6 +8184,148 @@ function checkConflicts(docs) {
8082
8184
  };
8083
8185
  }
8084
8186
 
8187
+ // ../core/src/rules/doc-consistency.ts
8188
+ var LOCKFILES = {
8189
+ npm: /(^|\/)(package-lock\.json|npm-shrinkwrap\.json)$/,
8190
+ pnpm: /(^|\/)pnpm-lock\.yaml$/,
8191
+ yarn: /(^|\/)yarn\.lock$/,
8192
+ bun: /(^|\/)bun\.lockb?$/
8193
+ };
8194
+ var PM_COMMAND = /^(npm|pnpm|yarn|bun)\s+(install|i|ci|add|run|test|exec|remove|uninstall)\b(.*)$/;
8195
+ var CONDITIONAL = /\b(if|or|either|alternatively|e\.g\.|for example)\b|또는|이나|라면|경우|예:|예를 들|または|場合|例:|例えば|或者|如果|例如/i;
8196
+ var EXAMPLE_LEAD = /\b(e\.g\.|example|for instance)\b|예:|예시|例:|例えば|示例|例如/i;
8197
+ var GENERATED = /^(node_modules|dist|build|out|coverage|target|\.next|\.nuxt|\.venv|venv|__pycache__|\.cache|\.turbo|tmp)(\/|$)/;
8198
+ var NOT_THIS_PROJECT = /(^|\/)(tests?|__tests__|spec|fixtures?|__fixtures__|examples?|samples?|testdata|e2e)\//i;
8199
+ var PATH_EXT = /\.(md|mdx|ts|tsx|js|jsx|mjs|cjs|json|jsonc|ya?ml|toml|py|rb|go|rs|java|kt|sh|ps1|vue|svelte|astro|css|scss|html|txt|sql|lock)$/i;
8200
+ function commandsAndSpans(doc) {
8201
+ const out = [];
8202
+ const lines = doc.text.split(/\r?\n/);
8203
+ let fence = null;
8204
+ let skipBlock = false;
8205
+ let lastProse = "";
8206
+ lines.forEach((raw, i) => {
8207
+ const t2 = raw.trim();
8208
+ const f = /^(```+|~~~+)\s*([\w-]*)/.exec(t2);
8209
+ if (f) {
8210
+ if (fence === null) {
8211
+ fence = f[1];
8212
+ const lang = f[2].toLowerCase();
8213
+ skipBlock = lang !== "" && !["sh", "bash", "shell", "console", "zsh", "powershell", "ps1", "cmd"].includes(lang) || EXAMPLE_LEAD.test(lastProse);
8214
+ } else if (t2.startsWith(fence)) fence = null;
8215
+ return;
8216
+ }
8217
+ if (fence !== null) {
8218
+ if (!skipBlock && t2) out.push({ doc, line: i + 1, text: t2.replace(/^\$\s+/, ""), kind: "block", context: lastProse });
8219
+ return;
8220
+ }
8221
+ if (t2) lastProse = t2;
8222
+ for (const m of raw.matchAll(/`([^`\n]+)`/g)) out.push({ doc, line: i + 1, text: m[1].trim(), kind: "span", context: t2 });
8223
+ });
8224
+ return out;
8225
+ }
8226
+ var dirOf = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/")) : "";
8227
+ var join = (dir, name) => dir ? `${dir}/${name}` : name;
8228
+ function nearestManifest(dir, manifests) {
8229
+ let d = dir;
8230
+ for (; ; ) {
8231
+ if (manifests.has(join(d, "package.json"))) return d;
8232
+ if (d === "") return null;
8233
+ d = dirOf(d);
8234
+ }
8235
+ }
8236
+ function checkDocConsistency(input) {
8237
+ const findings = [];
8238
+ const manifests = new Map(input.allDocs.filter((d) => /(^|\/)package\.json$/.test(d.path)).map((d) => [d.path, d.text]));
8239
+ const parse3 = (path) => {
8240
+ try {
8241
+ return JSON.parse(manifests.get(path) ?? "");
8242
+ } catch {
8243
+ return null;
8244
+ }
8245
+ };
8246
+ const files = [...input.files];
8247
+ const lockKinds = (dir) => Object.keys(LOCKFILES).filter((pm) => files.some((f) => dirOf(f) === dir && LOCKFILES[pm].test(f)));
8248
+ const add = (l, key, params, fixKey) => {
8249
+ const at = { path: l.doc.path, line: l.line, column: 1 };
8250
+ const id = `DOC-001-${fnv1a(`${key}:${l.doc.path}:${l.line}:${l.text}`)}`;
8251
+ if (findings.some((f) => f.id === id)) return;
8252
+ findings.push({
8253
+ id,
8254
+ ruleId: "DOC-001",
8255
+ severity: "medium",
8256
+ confidence: "high",
8257
+ messageKey: key,
8258
+ params,
8259
+ location: at,
8260
+ evidence: truncate(maskSecrets(l.text)),
8261
+ recommendation: { messageKey: fixKey, params },
8262
+ verification: { messageKey: "agt.verify", params: { path: at.path, line: at.line } }
8263
+ });
8264
+ };
8265
+ const manifestFiles = files.filter((f) => /(^|\/)package\.json$/.test(f));
8266
+ const allManifestsRead = manifestFiles.every((f) => manifests.has(f));
8267
+ const anyScript = new Set(manifestFiles.flatMap((f) => Object.keys(parse3(f)?.scripts ?? {})));
8268
+ const known = [...input.files, ...input.directories];
8269
+ const throughFile = (ref) => ref.split("/").some((_, i, parts) => i > 0 && input.files.has(parts.slice(0, i).join("/")));
8270
+ const present = (ref) => throughFile(ref) || known.some((k) => k === ref || k.endsWith(`/${ref}`));
8271
+ for (const doc of input.docs) {
8272
+ if (NOT_THIS_PROJECT.test(doc.path)) continue;
8273
+ for (const l of commandsAndSpans(doc)) {
8274
+ const managers = new Set(l.context.match(/\b(npm|pnpm|yarn|bun)\b/g) ?? []);
8275
+ if (CONDITIONAL.test(l.context) || managers.size > 1) continue;
8276
+ const cmd = PM_COMMAND.exec(l.text);
8277
+ const base2 = nearestManifest(dirOf(doc.path), manifests);
8278
+ if (cmd) {
8279
+ const used = cmd[1];
8280
+ const verb = cmd[2];
8281
+ const args = cmd[3].trim().split(/\s+/).filter(Boolean);
8282
+ if (["install", "i", "ci"].includes(verb)) {
8283
+ if (args.some((a) => !a.startsWith("-")) || args.some((a) => a === "-g" || a === "--global")) continue;
8284
+ const lockDir = base2 !== null && lockKinds(base2).length > 0 ? base2 : "";
8285
+ const kinds = lockKinds(lockDir);
8286
+ const declared = base2 !== null ? parse3(join(base2, "package.json"))?.packageManager?.split("@")[0] : void 0;
8287
+ if (kinds.length === 1 && kinds[0] !== used && (!declared || declared === kinds[0])) {
8288
+ const lockfile = files.find((f) => dirOf(f) === lockDir && LOCKFILES[kinds[0]].test(f));
8289
+ add(l, "doc001.pm", { used, expected: kinds[0], lockfile }, "doc001.pm.fix");
8290
+ }
8291
+ continue;
8292
+ }
8293
+ const script = verb === "run" ? /^([\w:.-]+)$/.exec(args[0] ?? "")?.[1] : verb === "test" && used !== "bun" ? "test" : void 0;
8294
+ const workspace = args.some((a) => /^(-w|--workspace|--filter|-F|-C|--prefix|--dir|-r|--recursive)(=|$)/.test(a));
8295
+ if (script && base2 !== null && !workspace && allManifestsRead && !anyScript.has(script)) {
8296
+ add(l, "doc001.script", { command: l.text, script, manifest: join(base2, "package.json") }, "doc001.script.fix");
8297
+ }
8298
+ continue;
8299
+ }
8300
+ const docker = /^docker(?:\s+compose|-compose)\b(.*)$|^docker\s+build\b(.*)$/.exec(l.text);
8301
+ if (docker && input.listComplete) {
8302
+ const compose = l.text.startsWith("docker-compose") || /^docker\s+compose/.test(l.text);
8303
+ const explicit = /\s(?:-f|--file)\s+(\S+)/.exec(` ${docker[1] ?? docker[2] ?? ""}`)?.[1];
8304
+ const has = explicit ? present(explicit.replace(/^\.\//, "")) : compose ? files.some((f) => /(^|\/)(docker-)?compose\.ya?ml$/.test(f)) : files.some((f) => /(^|\/)([\w.-]*\.)?dockerfile$|(^|\/)dockerfile[\w.-]*$/i.test(f));
8305
+ if (!has) add(l, "doc001.docker", { command: l.text, file: explicit ?? (compose ? "compose.yaml" : "Dockerfile") }, "doc001.docker.fix");
8306
+ continue;
8307
+ }
8308
+ if (l.kind !== "span" || !input.listComplete || !input.instruction.has(doc.path)) continue;
8309
+ const ref = l.text.replace(/^\.\//, "");
8310
+ if (/[\s*?<>{}$|"'`[\]:=%#,;()]|^@|^~|^\/|\.\.|path\/to|your-|example|^-/.test(ref)) continue;
8311
+ const clean = ref.replace(/\/$/, "");
8312
+ if (!clean.includes("/") || !(PATH_EXT.test(clean) || ref.endsWith("/"))) continue;
8313
+ if (GENERATED.test(clean) || input.ignored?.(clean) || input.ignored?.(`${clean}/`) || input.ignored?.(`${clean}/x`)) continue;
8314
+ if (!present(clean) && !present(join(dirOf(doc.path), clean))) add(l, "doc001.path", { ref: l.text }, "doc001.path.fix");
8315
+ }
8316
+ }
8317
+ return {
8318
+ ruleId: "DOC-001",
8319
+ status: input.docs.length === 0 ? "skipped" : findings.length ? "fail" : "pass",
8320
+ eligible: input.docs.length,
8321
+ inspected: input.docs.length,
8322
+ findings,
8323
+ unverified: [],
8324
+ reason: input.docs.length ? null : "doc001.reason.none",
8325
+ scopeKey: "doc001.scope"
8326
+ };
8327
+ }
8328
+
8085
8329
  // ../core/src/rules/duplicates.ts
8086
8330
  var CODE_EXT = /* @__PURE__ */ new Set(["js", "mjs", "cjs", "jsx", "ts", "mts", "cts", "tsx", "vue", "svelte", "py", "rb", "go", "rs", "java", "kt", "cs", "php", "swift"]);
8087
8331
  var DUP_WINDOW = 6;
@@ -8141,7 +8385,7 @@ function checkDuplicateCode(docs) {
8141
8385
  for (let k = 0; k < len; k++) dupLines.add(`${o.f}:${o.i + k}`);
8142
8386
  return { path: f.path, line: f.lines[o.i].line, column: 1, end: f.lines[o.i + len - 1].line };
8143
8387
  });
8144
- const first = locs[0];
8388
+ const first2 = locs[0];
8145
8389
  if (findings.length < MAX_FINDINGS) {
8146
8390
  findings.push({
8147
8391
  id: `DUP-001-${fnv1a(locs.map((l) => `${l.path}:${l.line}`).join("|") + `:${len}`)}`,
@@ -8149,11 +8393,11 @@ function checkDuplicateCode(docs) {
8149
8393
  severity: "low",
8150
8394
  confidence: "high",
8151
8395
  messageKey: "dup001.block",
8152
- params: { lines: len, copies: locs.length, range: `${first.line}-${first.end}` },
8153
- location: { path: first.path, line: first.line, column: 1 },
8396
+ params: { lines: len, copies: locs.length, range: `${first2.line}-${first2.end}` },
8397
+ location: { path: first2.path, line: first2.line, column: 1 },
8154
8398
  evidence: truncate(maskSecrets(files[occ[0].f].lines[occ[0].i].norm)),
8155
8399
  recommendation: { messageKey: "dup001.fix", params: { copies: locs.length } },
8156
- verification: { messageKey: "dup.verify", params: { path: first.path, line: first.line } },
8400
+ verification: { messageKey: "dup.verify", params: { path: first2.path, line: first2.line } },
8157
8401
  related: locs.slice(1).map(({ path, line, column }) => ({ path, line, column }))
8158
8402
  });
8159
8403
  }
@@ -8374,7 +8618,7 @@ function checkArchitecture(docs, index2) {
8374
8618
  cycleTotal++;
8375
8619
  if (cycles.length >= MAX_FINDINGS2) continue;
8376
8620
  const loop = shortestLoop(comp[0], new Set(comp), graph);
8377
- const first = loop[0];
8621
+ const first2 = loop[0];
8378
8622
  const chain = [comp[0], ...loop.map((e) => e.to)].join(" \u2192 ");
8379
8623
  cycles.push({
8380
8624
  id: `ARC-001-${fnv1a(comp.join("|"))}`,
@@ -8383,10 +8627,10 @@ function checkArchitecture(docs, index2) {
8383
8627
  confidence: "high",
8384
8628
  messageKey: "arc001.cycle",
8385
8629
  params: { count: comp.length, cycle: chain },
8386
- location: { path: comp[0], line: first.ref.line, column: first.ref.column },
8387
- evidence: truncate(maskSecrets(first.ref.text.trim())),
8630
+ location: { path: comp[0], line: first2.ref.line, column: first2.ref.column },
8631
+ evidence: truncate(maskSecrets(first2.ref.text.trim())),
8388
8632
  recommendation: { messageKey: "arc001.fix", params: { count: comp.length } },
8389
- verification: { messageKey: "arc.verify", params: { path: comp[0], line: first.ref.line } },
8633
+ verification: { messageKey: "arc.verify", params: { path: comp[0], line: first2.ref.line } },
8390
8634
  related: loop.slice(1).map((e, i) => ({ path: loop[i].to, line: e.ref.line, column: e.ref.column }))
8391
8635
  });
8392
8636
  }
@@ -8422,14 +8666,14 @@ var CI = [
8422
8666
  /^\.buildkite\//,
8423
8667
  /^cloudbuild\.ya?ml$/
8424
8668
  ];
8425
- var LOCKFILES = ["package-lock.json", "npm-shrinkwrap.json", "pnpm-lock.yaml", "yarn.lock", "bun.lock", "bun.lockb"];
8669
+ var LOCKFILES2 = ["package-lock.json", "npm-shrinkwrap.json", "pnpm-lock.yaml", "yarn.lock", "bun.lock", "bun.lockb"];
8426
8670
  var TEST_FILE = /(^|\/)(__tests__|tests?|spec|e2e)\/|\.(test|spec)\.[a-z]+$|(^|\/)test_[^/]+\.py$|_test\.(go|py)$|Tests?\.(java|kt|cs|swift)$/;
8427
8671
  var NPM_PLACEHOLDER = /no test specified/i;
8428
8672
  function isDockerfilePath(path) {
8429
8673
  return /(^|\/)(Dockerfile|Containerfile)(\.[^/]+)?$|\.(Dockerfile|dockerfile)$/.test(path);
8430
8674
  }
8431
8675
  var PROJECT_LOCATION = { path: ".", line: 0, column: 0 };
8432
- var dirOf = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/") + 1) : "";
8676
+ var dirOf2 = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/") + 1) : "";
8433
8677
  function checkDeploy(docs, index2) {
8434
8678
  const files = [...index2.files].filter((p) => !/(^|\/)node_modules\//.test(p));
8435
8679
  const hasCode = files.some((p) => isCodePath(p) || /(^|\/)(package\.json|pyproject\.toml|go\.mod|Cargo\.toml|requirements\.txt|pom\.xml|build\.gradle(\.kts)?|Gemfile|composer\.json)$/.test(p));
@@ -8439,7 +8683,7 @@ function checkDeploy(docs, index2) {
8439
8683
  let passed = 0;
8440
8684
  const found = { "OPS-001": [], "OPS-002": [], "OPS-003": [] };
8441
8685
  const applied = { "OPS-001": 0, "OPS-002": 0, "OPS-003": 0 };
8442
- const check = (ruleId, ok, key, at, params = {}, evidence = "", severity = "medium") => {
8686
+ const check = (ruleId, ok, key, at, params = {}, evidence = "", severity2 = "medium") => {
8443
8687
  checks++;
8444
8688
  applied[ruleId]++;
8445
8689
  if (ok) {
@@ -8449,7 +8693,7 @@ function checkDeploy(docs, index2) {
8449
8693
  found[ruleId].push({
8450
8694
  id: `${ruleId}-${fnv1a(`${key}:${at.path}:${at.line}:${JSON.stringify(params)}`)}`,
8451
8695
  ruleId,
8452
- severity,
8696
+ severity: severity2,
8453
8697
  confidence: "high",
8454
8698
  messageKey: key,
8455
8699
  params,
@@ -8460,7 +8704,7 @@ function checkDeploy(docs, index2) {
8460
8704
  });
8461
8705
  };
8462
8706
  if (project) check("OPS-001", files.some((p) => CI.some((re) => re.test(p))), "ops001.noCi", PROJECT_LOCATION);
8463
- if (index2.files.has("package.json")) check("OPS-001", LOCKFILES.some((l) => index2.files.has(l)), "ops001.noLockfile", { path: "package.json", line: 1, column: 1 }, {}, "", "low");
8707
+ if (index2.files.has("package.json")) check("OPS-001", LOCKFILES2.some((l) => index2.files.has(l)), "ops001.noLockfile", { path: "package.json", line: 1, column: 1 }, {}, "", "low");
8464
8708
  const manifests = docs.filter((d) => /(^|\/)package\.json$/.test(d.path) && !d.path.includes("node_modules/")).sort((a, b) => a.path.length - b.path.length || (a.path < b.path ? -1 : 1));
8465
8709
  const scripts = manifests.map((d) => {
8466
8710
  try {
@@ -8515,8 +8759,8 @@ function checkDeploy(docs, index2) {
8515
8759
  const u = lastUser;
8516
8760
  const root2 = !u || /^(root|0)(:|$)/.test(u.value);
8517
8761
  check("OPS-003", !root2, "ops003.root", { path: d.path, line: u?.line ?? 1, column: 1 }, {}, u ? lines[u.line - 1] : "");
8518
- if (index2.listComplete || index2.files.has(`${dirOf(d.path)}.dockerignore`))
8519
- check("OPS-003", index2.files.has(`${dirOf(d.path)}.dockerignore`) || index2.files.has(".dockerignore"), "ops003.noIgnore", { path: d.path, line: 1, column: 1 }, { path: d.path }, "", "low");
8762
+ if (index2.listComplete || index2.files.has(`${dirOf2(d.path)}.dockerignore`))
8763
+ check("OPS-003", index2.files.has(`${dirOf2(d.path)}.dockerignore`) || index2.files.has(".dockerignore"), "ops003.noIgnore", { path: d.path, line: 1, column: 1 }, { path: d.path }, "", "low");
8520
8764
  }
8521
8765
  const result = (ruleId, scopeKey2, noneReason) => {
8522
8766
  const n = applied[ruleId];
@@ -8762,9 +9006,9 @@ function checkDuplicates(docs, eligible, extraPartial, minChars = MD002_MIN_CHAR
8762
9006
  const findings = [];
8763
9007
  for (const [key, list2] of groups) {
8764
9008
  if (list2.length < 2) continue;
8765
- const [first, ...rest] = list2;
9009
+ const [first2, ...rest] = list2;
8766
9010
  const protectedText = isProtectedInstruction(key);
8767
- const crossFile = rest.some((r) => r.location.path !== first.location.path);
9011
+ const crossFile = rest.some((r) => r.location.path !== first2.location.path);
8768
9012
  findings.push({
8769
9013
  id: `${MD002}-${fnv1a(list2.map((l) => `${l.location.path}:${l.location.line}`).join("|") + key.length)}`,
8770
9014
  ruleId: MD002,
@@ -8775,7 +9019,7 @@ function checkDuplicates(docs, eligible, extraPartial, minChars = MD002_MIN_CHAR
8775
9019
  count: list2.length,
8776
9020
  others: rest.map((r) => `${r.location.path}:${r.location.line}`).join(", ")
8777
9021
  },
8778
- location: first.location,
9022
+ location: first2.location,
8779
9023
  evidence: truncate(maskSecrets(key)),
8780
9024
  recommendation: { messageKey: protectedText ? "md002.fix.protected" : "md002.fix.review", params: {} },
8781
9025
  verification: { messageKey: "md002.verify", params: {} },
@@ -8823,7 +9067,7 @@ function estimateTokens(text3) {
8823
9067
  }
8824
9068
 
8825
9069
  // ../core/src/ai/agents.ts
8826
- var IMPORT_RE = /(^|[\s(])@([^\s`'"()<>[\]{}]+)/g;
9070
+ var IMPORT_RE = /(^|[\s(])@([^\s`'"()<>[\]{}*?]+)(?![^\s`'"()<>[\]{}])/g;
8827
9071
  function extractImports2(text3) {
8828
9072
  const out = [];
8829
9073
  walk(parseTree(text3), (node2) => {
@@ -8852,6 +9096,37 @@ function hasPathsFrontMatter(text3) {
8852
9096
  const fm = blankFrontMatter(text3).frontMatter;
8853
9097
  return fm !== null && /^paths\s*:/m.test(fm);
8854
9098
  }
9099
+ function frontMatterFields2(text3) {
9100
+ const fm = blankFrontMatter(text3).frontMatter;
9101
+ if (fm === null) return null;
9102
+ const out = {};
9103
+ for (const line of fm.split(/\r?\n/)) {
9104
+ const m = /^([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(line);
9105
+ if (m) out[m[1]] = m[2].trim().replace(/^(["'])(.*)\1$/, "$2");
9106
+ }
9107
+ return out;
9108
+ }
9109
+ function stripBlockHtmlComments(text3) {
9110
+ const out = [];
9111
+ let fence = null;
9112
+ let inComment = false;
9113
+ for (const line of text3.split("\n")) {
9114
+ const t2 = line.trim();
9115
+ const f = /^(```|~~~)/.exec(t2);
9116
+ if (!inComment && f) fence = fence === null ? f[1] : t2.startsWith(fence) ? null : fence;
9117
+ if (fence !== null || !inComment && !t2.startsWith("<!--")) {
9118
+ out.push(line);
9119
+ continue;
9120
+ }
9121
+ inComment = true;
9122
+ if (t2.includes("-->")) {
9123
+ inComment = false;
9124
+ const rest = t2.slice(t2.lastIndexOf("-->") + 3).trim();
9125
+ if (rest) out.push(rest);
9126
+ }
9127
+ }
9128
+ return out.join("\n");
9129
+ }
8855
9130
  function collectAgentDocs(input) {
8856
9131
  const byPath2 = new Map(input.docs.map((d) => [d.path, d]));
8857
9132
  const result = /* @__PURE__ */ new Map();
@@ -8863,23 +9138,37 @@ function collectAgentDocs(input) {
8863
9138
  return;
8864
9139
  }
8865
9140
  const doc = byPath2.get(path);
8866
- const bytes = doc ? new TextEncoder().encode(doc.text).length : null;
9141
+ const text3 = doc ? doc.text : null;
9142
+ const bytes = text3 !== null ? new TextEncoder().encode(text3).length : null;
9143
+ const claudeFile2 = platforms.includes("claude") && !/AGENTS\.md$/.test(path);
9144
+ const stripped = text3 !== null && claudeFile2 ? stripBlockHtmlComments(text3) : null;
9145
+ const commentFree = stripped !== null && stripped !== text3 ? { tokens: estimateTokens(stripped), bytes: new TextEncoder().encode(stripped).length } : null;
9146
+ const ruleFile = /\.mdc$|\.instructions\.md$|(^|\/)\.(agents?|cursor|grok|claude)\/rules\//.test(path);
8867
9147
  const supportsImports = platforms.length === 0 || platforms.some((p) => PROFILES[p].maxImportDepth !== null);
8868
9148
  const imports = doc && supportsImports ? extractImports2(doc.text).map((i) => ({ ...i, ...resolveImport2(path, i.raw, input) })) : [];
8869
9149
  result.set(path, {
8870
9150
  path,
8871
9151
  platforms: [...platforms],
8872
9152
  read: !!doc,
8873
- empty: doc ? doc.text.trim() === "" : null,
9153
+ empty: text3 !== null ? text3.trim() === "" : null,
8874
9154
  bytes,
8875
- tokens: doc ? estimateTokens(doc.text) : null,
9155
+ tokens: text3 !== null ? estimateTokens(text3) : null,
9156
+ lines: doc ? splitLines(doc.text).length : null,
8876
9157
  conditional: !!doc && platforms.includes("claude") && /(^|\/)\.claude\/rules\//.test(path) && hasPathsFrontMatter(doc.text),
9158
+ frontMatter: doc && ruleFile ? frontMatterFields2(doc.text) : null,
9159
+ commentFree,
8877
9160
  imports
8878
9161
  });
8879
9162
  queue.push(path);
8880
9163
  };
9164
+ const claudeFile = /(^|\/)(\.claude\/)?CLAUDE(\.local)?\.md$/;
9165
+ const claudeDirs = new Set([...input.files].filter((p) => claudeFile.test(p)).map((p) => p.replace(claudeFile, "")));
8881
9166
  for (const path of [...input.files].sort()) {
8882
- const platforms = instructionPlatforms(path);
9167
+ let platforms = instructionPlatforms(path);
9168
+ if (/(^|\/)AGENTS\.md$/.test(path) && !/(^|\/)\.claude\/AGENTS\.md$/.test(path)) {
9169
+ const dir = path.replace(/(^|\/)AGENTS\.md$/, "");
9170
+ if (chainDirs(dir).some((d) => claudeDirs.has(d))) platforms = platforms.filter((p) => p !== "claude");
9171
+ }
8883
9172
  if (platforms.length > 0) add(path, platforms);
8884
9173
  }
8885
9174
  while (queue.length > 0) {
@@ -8895,20 +9184,43 @@ function chainDirs(workdir) {
8895
9184
  for (let i = 1; i <= parts.length; i++) out.push(parts.slice(0, i).join("/"));
8896
9185
  return out;
8897
9186
  }
8898
- var join = (dir, name) => dir === "" ? name : `${dir}/${name}`;
9187
+ var join2 = (dir, name) => dir === "" ? name : `${dir}/${name}`;
8899
9188
  function activeContext(platform, workdir, docs) {
8900
9189
  const profile = PROFILES[platform];
8901
9190
  const byPath2 = new Map(docs.map((d) => [d.path, d]));
8902
9191
  const files = [];
8903
9192
  const seen = /* @__PURE__ */ new Set();
8904
9193
  const conditional = [];
9194
+ const conditionalLoads = [];
8905
9195
  const notes = [...profile.unseen];
8906
9196
  const push2 = (doc, via, from, depth) => {
8907
9197
  if (seen.has(doc.path)) return false;
8908
9198
  seen.add(doc.path);
8909
- files.push({ path: doc.path, via, from, depth, tokens: doc.tokens, bytes: doc.bytes, truncated: false });
9199
+ const size = platform === "claude" && doc.commentFree ? doc.commentFree : doc;
9200
+ files.push({ path: doc.path, via, from, depth, tokens: size.tokens, bytes: size.bytes, truncated: false });
8910
9201
  return true;
8911
9202
  };
9203
+ const later = (doc, load, condition) => {
9204
+ if (seen.has(doc.path)) return;
9205
+ seen.add(doc.path);
9206
+ conditional.push(doc.path);
9207
+ conditionalLoads.push({ path: doc.path, load, condition: condition || null });
9208
+ };
9209
+ const note = (key) => {
9210
+ if (!notes.includes(key)) notes.push(key);
9211
+ };
9212
+ const under = (dir, rel, ext, nested = false) => {
9213
+ const prefix = join2(dir, rel);
9214
+ return docs.filter((d) => {
9215
+ if (!d.path.startsWith(prefix) || !d.platforms.includes(platform)) return false;
9216
+ const rest = d.path.slice(prefix.length);
9217
+ return ext.test(rest) && (nested || !rest.includes("/"));
9218
+ });
9219
+ };
9220
+ const hier = (path) => {
9221
+ const d = byPath2.get(path);
9222
+ if (d && d.platforms.includes(platform) && d.empty !== true) push2(d, "hierarchy", null, 0);
9223
+ };
8912
9224
  const followImports = (doc, depth) => {
8913
9225
  const max = profile.maxImportDepth;
8914
9226
  if (max === null) return;
@@ -8923,24 +9235,66 @@ function activeContext(platform, workdir, docs) {
8923
9235
  if (push2(target, "import", doc.path, depth + 1)) followImports(target, depth + 1);
8924
9236
  }
8925
9237
  };
9238
+ const claudeFiles = ["CLAUDE.md", ".claude/CLAUDE.md", "CLAUDE.local.md"];
9239
+ const claudeUsesAgents = platform === "claude" && !chainDirs(workdir).some((dir) => claudeFiles.some((n) => byPath2.has(join2(dir, n)))) && chainDirs(workdir).some((dir) => ["AGENTS.md", ".claude/AGENTS.md"].some((n) => byPath2.has(join2(dir, n))));
9240
+ if (claudeUsesAgents) notes.push("ai.note.claudeAgentsFallback");
8926
9241
  for (const dir of chainDirs(workdir)) {
8927
9242
  if (platform === "codex") {
8928
- const pick = [join(dir, "AGENTS.override.md"), join(dir, "AGENTS.md")].map((p) => byPath2.get(p)).find((d) => d && d.platforms.includes("codex") && d.empty !== true);
9243
+ const pick = [join2(dir, "AGENTS.override.md"), join2(dir, "AGENTS.md")].map((p) => byPath2.get(p)).find((d) => d && d.platforms.includes("codex") && d.empty !== true);
8929
9244
  if (pick) push2(pick, "hierarchy", null, 0);
8930
9245
  } else if (platform === "claude") {
8931
- for (const name of ["CLAUDE.md", ".claude/CLAUDE.md", "CLAUDE.local.md"]) {
8932
- const d = byPath2.get(join(dir, name));
9246
+ const names = claudeUsesAgents ? ["AGENTS.md", ".claude/AGENTS.md"] : ["CLAUDE.md", ".claude/CLAUDE.md", "CLAUDE.local.md"];
9247
+ for (const name of names) {
9248
+ const d = byPath2.get(join2(dir, name));
8933
9249
  if (d && d.platforms.includes("claude") && push2(d, "hierarchy", null, 0)) followImports(d, 0);
8934
9250
  }
8935
- const rulesPrefix = join(dir, ".claude/rules/");
9251
+ const rulesPrefix = join2(dir, ".claude/rules/");
8936
9252
  for (const d of docs) {
8937
9253
  if (!d.path.startsWith(rulesPrefix) || !d.platforms.includes("claude")) continue;
8938
- if (d.conditional) conditional.push(d.path);
9254
+ if (d.conditional) later(d, "path", d.frontMatter?.paths ?? null);
8939
9255
  else if (push2(d, "rule", null, 0)) followImports(d, 0);
8940
9256
  }
8941
- } else {
8942
- const d = byPath2.get(join(dir, "GEMINI.md"));
9257
+ } else if (platform === "gemini") {
9258
+ const d = byPath2.get(join2(dir, "GEMINI.md"));
8943
9259
  if (d && d.platforms.includes("gemini") && push2(d, "hierarchy", null, 0)) followImports(d, 0);
9260
+ } else if (platform === "cursor") {
9261
+ hier(join2(dir, "AGENTS.md"));
9262
+ for (const d of under(dir, ".cursor/rules/", /\.mdc$/, true)) {
9263
+ const fm = d.frontMatter ?? {};
9264
+ if (fm.alwaysApply === "true") push2(d, "rule", null, 0);
9265
+ else if (fm.globs) later(d, "path", fm.globs);
9266
+ else if (fm.description) later(d, "model", null);
9267
+ else later(d, "manual", null);
9268
+ }
9269
+ } else if (platform === "grok") {
9270
+ for (const name of ["AGENTS.md", "Agents.md", "AGENT.md", "CLAUDE.md", "Claude.md", "CLAUDE.local.md"]) hier(join2(dir, name));
9271
+ for (const rel of [".grok/rules/", ".claude/rules/", ".cursor/rules/"]) for (const d of under(dir, rel, /\.md$/)) push2(d, "rule", null, 0);
9272
+ } else if (platform === "antigravity") {
9273
+ for (const name of ["AGENTS.md", "GEMINI.md", ".agents/AGENTS.md", ".agents/GEMINI.md"]) hier(join2(dir, name));
9274
+ for (const rel of [".agents/rules/", ".agent/rules/"]) {
9275
+ for (const d of under(dir, rel, /\.md$/)) {
9276
+ const fm = d.frontMatter ?? {};
9277
+ if (fm.trigger === "always_on") push2(d, "rule", null, 0);
9278
+ else if (fm.trigger === "glob") later(d, "path", fm.globs ?? fm.glob ?? null);
9279
+ else if (fm.trigger === "model_decision") later(d, "model", null);
9280
+ else if (fm.trigger === "manual") later(d, "manual", null);
9281
+ else note("ai.note.ruleIgnored");
9282
+ }
9283
+ }
9284
+ }
9285
+ }
9286
+ if (platform === "copilot") {
9287
+ hier(".github/copilot-instructions.md");
9288
+ const nearest = [...chainDirs(workdir)].reverse().find((dir) => byPath2.get(join2(dir, "AGENTS.md"))?.platforms.includes("copilot"));
9289
+ if (nearest !== void 0) hier(join2(nearest, "AGENTS.md"));
9290
+ hier("CLAUDE.md");
9291
+ hier("GEMINI.md");
9292
+ for (const d of under("", ".github/instructions/", /\.instructions\.md$/, true)) {
9293
+ const applyTo = d.frontMatter?.applyTo;
9294
+ if (applyTo) {
9295
+ later(d, "path", applyTo);
9296
+ note("ai.note.copilotGithub");
9297
+ } else later(d, "manual", null);
8944
9298
  }
8945
9299
  }
8946
9300
  if (platform === "codex" && profile.maxCombinedBytes !== null) {
@@ -8957,6 +9311,8 @@ function activeContext(platform, workdir, docs) {
8957
9311
  }
8958
9312
  }
8959
9313
  }
9314
+ if (platform === "claude" && files.some((f) => f.via === "hierarchy" && (byPath2.get(f.path)?.lines ?? 0) > 200)) notes.push("ai.note.claudeLong");
9315
+ if (platform === "claude" && conditionalLoads.length > 0) notes.push("ai.note.claudeCompaction");
8960
9316
  const unknown = files.some((f) => f.tokens === null);
8961
9317
  if (unknown) notes.push("ai.note.unknownTokens");
8962
9318
  return {
@@ -8964,6 +9320,7 @@ function activeContext(platform, workdir, docs) {
8964
9320
  workdir,
8965
9321
  files,
8966
9322
  conditional,
9323
+ conditionalLoads,
8967
9324
  totalTokens: unknown ? null : files.reduce((s, f) => s + (f.tokens ?? 0), 0),
8968
9325
  totalBytes: unknown ? null : files.reduce((s, f) => s + (f.bytes ?? 0), 0),
8969
9326
  notes
@@ -8973,8 +9330,8 @@ function candidateWorkdirs(docs) {
8973
9330
  const dirs = /* @__PURE__ */ new Set([""]);
8974
9331
  for (const d of docs) {
8975
9332
  if (d.platforms.length === 0) continue;
8976
- const idx = d.path.startsWith(".claude/") ? 0 : d.path.indexOf("/.claude/");
8977
- dirs.add(idx === -1 ? dirname(d.path) : d.path.slice(0, Math.max(idx, 0)));
9333
+ const m = /(^|\/)\.(claude|cursor|grok|agents?|github)\//.exec(d.path);
9334
+ dirs.add(m ? d.path.slice(0, m.index) : dirname(d.path));
8978
9335
  }
8979
9336
  return [...dirs].sort();
8980
9337
  }
@@ -9208,19 +9565,19 @@ function duplicatePreviews(docs, findings, instructionPaths) {
9208
9565
  for (const finding of findings) {
9209
9566
  if (finding.recommendation.messageKey !== "md002.fix.review") continue;
9210
9567
  const locations = [finding.location, ...finding.related ?? []].filter((loc2) => byPath2.has(loc2.path));
9211
- const first = locations[0];
9212
- if (!first || first.column !== 1) continue;
9213
- const keepLines = linesAt(first.path);
9214
- const sentence = keepLines[first.line - 1];
9568
+ const first2 = locations[0];
9569
+ if (!first2 || first2.column !== 1) continue;
9570
+ const keepLines = linesAt(first2.path);
9571
+ const sentence = keepLines[first2.line - 1];
9215
9572
  if (!sentence || !new RegExp("^\\p{L}", "u").test(sentence) || /[@`[\]<>*_\\]/u.test(sentence)) continue;
9216
- if (keepLines[first.line - 2]?.trim() || keepLines[first.line]?.trim()) continue;
9573
+ if (keepLines[first2.line - 2]?.trim() || keepLines[first2.line]?.trim()) continue;
9217
9574
  for (const omit of locations.slice(1)) {
9218
9575
  const lines = linesAt(omit.path);
9219
9576
  const at = omit.line - 1;
9220
9577
  if (omit.column !== 1 || lines[at] !== sentence || lines[at - 1]?.trim() || lines[at + 1]?.trim()) continue;
9221
9578
  const edited = [...lines.slice(0, at), ...lines.slice(at + 1)].join("\n");
9222
9579
  if (!edited.trim()) continue;
9223
- previews.push({ findingId: finding.id, keep: first, omit, editedDocTokens: estimateTokens(edited) });
9580
+ previews.push({ findingId: finding.id, keep: first2, omit, editedDocTokens: estimateTokens(edited) });
9224
9581
  if (previews.length === 8) return previews;
9225
9582
  }
9226
9583
  }
@@ -9245,7 +9602,10 @@ var ScanCancelledError = class extends Error {
9245
9602
  super("cancelled");
9246
9603
  }
9247
9604
  };
9248
- async function runScan(adapter, ctx) {
9605
+ function runScan(adapter, ctx) {
9606
+ return withSharedTrees(() => scanOnce(adapter, ctx));
9607
+ }
9608
+ async function scanOnce(adapter, ctx) {
9249
9609
  const now = ctx.now ?? (() => /* @__PURE__ */ new Date());
9250
9610
  const startedAt = Date.now();
9251
9611
  const check = () => {
@@ -9314,8 +9674,19 @@ async function runScan(adapter, ctx) {
9314
9674
  const mdPartial = stoppedEarly || readFailures > 0;
9315
9675
  const md001 = checkHeadings(mdDocs, eligibleMd, mdPartial);
9316
9676
  const md003 = checkRelativeLinks(mdDocs, { files: listed, directories: adapter.directories, listComplete: adapter.listComplete }, eligibleMd, mdPartial);
9317
- const agents = runAgentRules({ docs: mdDocs, files: listed, listComplete: adapter.listComplete });
9677
+ const agentDocs = docs.filter((d) => isMarkdownPath(d.path) || /(^|\/)\.cursor\/rules\/.+\.mdc$/.test(d.path));
9678
+ const agents = runAgentRules({ docs: agentDocs, files: listed, listComplete: adapter.listComplete });
9318
9679
  const contextPaths = new Set(agents.metrics.docs.map((d) => d.path));
9680
+ const docConsistency = checkDocConsistency({
9681
+ docs: agentDocs.filter((d) => contextPaths.has(d.path) || /(^|\/)readme\.md$/i.test(d.path)),
9682
+ allDocs: docs,
9683
+ files: listed,
9684
+ directories: adapter.directories,
9685
+ listComplete: adapter.listComplete,
9686
+ instruction: contextPaths,
9687
+ ignored: gitignoreMatcher(docs.find((d) => d.path === ".gitignore")?.text ?? null)
9688
+ });
9689
+ ctx.onInstructionTexts?.(agentDocs.filter((d) => contextPaths.has(d.path)).map((d) => ({ path: d.path, text: d.text })));
9319
9690
  const contextDocs = mdDocs.filter((d) => contextPaths.has(d.path));
9320
9691
  const md002 = checkDuplicates(contextDocs, contextDocs.length, mdPartial);
9321
9692
  const deps = extractDependencies(docs);
@@ -9359,7 +9730,7 @@ async function runScan(adapter, ctx) {
9359
9730
  input: { kind: adapter.kind, wrapperRoot: adapter.wrapperRoot, github: adapter.github, fingerprint },
9360
9731
  options: { profile: ctx.profile },
9361
9732
  coverage,
9362
- rules: [inv001, md001, md002, md003, ...agents.rules, sec001, sec002, ...checkMcp(docs), ...checkDependencies(deps), checkSkills(mdDocs), checkConflicts(mdDocs), dup.rule, ...arc.rules, ...ops.rules],
9733
+ rules: [inv001, md001, md002, md003, ...agents.rules, sec001, sec002, ...checkMcp(docs), ...checkDependencies(deps), checkSkills(mdDocs), checkConflicts(mdDocs), docConsistency, dup.rule, ...arc.rules, ...ops.rules],
9363
9734
  metrics: { tokens: agents.metrics, dependencies: deps, duplicates: dup.metrics, architecture: arc.metrics, deploy: ops.metrics }
9364
9735
  };
9365
9736
  }
@@ -9384,7 +9755,7 @@ var en2 = {
9384
9755
  "md002.fix.review": "Review every copy. If the files serve different agents, both may need the text; otherwise keep one copy and reference it.",
9385
9756
  "md002.fix.protected": "This text contains approval, deployment, deletion or test instructions. Do not remove a copy unless every agent that reads it still gets the instruction.",
9386
9757
  "md002.verify": "Run the same check again and compare the remaining copies.",
9387
- "ai001.scope.m2": "Finds AGENTS.md / AGENTS.override.md (Codex), CLAUDE.md / CLAUDE.local.md / .claude/rules (Claude Code) and GEMINI.md (Gemini CLI) in the project.",
9758
+ "ai001.scope.m2": "Finds the instruction and rule files of Codex (AGENTS.md, AGENTS.override.md), Claude Code (CLAUDE.md, CLAUDE.local.md, .claude/rules, AGENTS.md as fallback), Gemini CLI (GEMINI.md), GitHub Copilot (.github/copilot-instructions.md, .github/instructions), Cursor desktop app (.cursor/rules/*.mdc), Grok Build terminal (.grok/rules) and Antigravity (.agents/rules) in the project.",
9388
9759
  "ai001.empty": "{path} is empty. Codex and other tools skip empty instruction files.",
9389
9760
  "ai001.fix.empty": "Add the intended instructions to {path} or delete the file.",
9390
9761
  "ai001.overrideShadows": "Codex ignores {path} because {override} exists in the same folder.",
@@ -9409,6 +9780,8 @@ var en2 = {
9409
9780
  "ai.note.depthLimit": "Some imports are beyond the platform depth limit and are not loaded.",
9410
9781
  "ai.note.codexCap": "The Codex chain passes the default 32 KiB limit; later files are not loaded.",
9411
9782
  "ai.note.unknownTokens": "Some files were not inspected, so totals are unknown.",
9783
+ "ai.note.claudeAgentsFallback": "No CLAUDE.md applies here, so Claude Code (v2.1.277 or later) reads AGENTS.md instead.",
9784
+ "ai.note.claudeLong": "A CLAUDE.md file here is over 200 lines. Claude Code recommends keeping each file under 200 lines.",
9412
9785
  "ai.unseen.codexHome": "Not visible: ~/.codex (or CODEX_HOME) global AGENTS files.",
9413
9786
  "ai.unseen.codexFallbackNames": "Not visible: project_doc_fallback_filenames and project_doc_max_bytes overrides.",
9414
9787
  "ai.unseen.claudeUserManaged": "Not visible: ~/.claude/CLAUDE.md, user rules and managed policy files.",
@@ -9416,6 +9789,16 @@ var en2 = {
9416
9789
  "ai.unseen.geminiGlobal": "Not visible: ~/.gemini/GEMINI.md.",
9417
9790
  "ai.unseen.geminiFileName": "Not visible: context.fileName settings that rename or add context files.",
9418
9791
  "ai.unseen.geminiJit": "Not counted: files loaded just in time when tools touch other folders.",
9792
+ "ai.unseen.copilotPersonal": "Not visible: personal and organization custom instructions.",
9793
+ "ai.unseen.cursorUserTeam": "Not visible: user rules and team rules.",
9794
+ "ai.unseen.grokHome": "Not visible: global rules in ~/.grok/. Files ignored by .gitignore are skipped.",
9795
+ "ai.unseen.antigravityGlobal": "Not visible: global files and rules in ~/.gemini/.",
9796
+ "ai.note.ruleIgnored": "Some rule files here have no valid trigger, so Antigravity ignores them.",
9797
+ "ai.note.copilotGithub": "On github.com, path-specific instructions apply only to the cloud agent and code review.",
9798
+ "platform.copilot": "GitHub Copilot",
9799
+ "platform.cursor": "Cursor (desktop app)",
9800
+ "platform.grok": "Grok Build (terminal)",
9801
+ "platform.antigravity": "Antigravity",
9419
9802
  "platform.codex": "Codex",
9420
9803
  "platform.claude": "Claude Code",
9421
9804
  "platform.gemini": "Gemini CLI",
@@ -9434,7 +9817,26 @@ var en2 = {
9434
9817
  "report.ai.via.hierarchy": "folder chain",
9435
9818
  "report.ai.via.rule": "rule",
9436
9819
  "report.ai.via.import": "import",
9437
- "report.ai.conditional": "Conditional (path rules, not counted)",
9820
+ "report.ai.conditional": "Conditional (not counted)",
9821
+ "report.ai.agent": "Agent",
9822
+ "report.ai.agentsCaption": "Instruction tokens each agent loads at start, for the selected working folder",
9823
+ "report.ai.conditionalCount": "Conditional files",
9824
+ "report.ai.detail": "{platform}: files and rules",
9825
+ "report.ai.load": "Loading",
9826
+ "report.ai.load.always": "Always",
9827
+ "report.ai.load.path": "Matching paths",
9828
+ "report.ai.load.model": "Model decides",
9829
+ "report.ai.load.manual": "When asked",
9830
+ "report.ai.route": "How it is reached",
9831
+ "report.ai.notCounted": "not counted",
9832
+ "report.ai.profilesHeading": "Agent profiles and the official pages they follow",
9833
+ "report.ai.reviewed": "reviewed {date}",
9834
+ "report.ai.switch.title": "Switching agents",
9835
+ "report.ai.switch.to": "Move from {platform} to",
9836
+ "report.ai.switch.none": "Moving from {from} to {to} loses no instruction file here.",
9837
+ "report.ai.switch.lost": "Moving from {from} to {to} loses {count} file(s) here: {to} never reads them.",
9838
+ "report.ai.switch.gained": "Read only by {to}",
9839
+ "ai.note.claudeCompaction": "After compaction Claude Code re-reads its start-up files; path rules return only when a matching file is read again.",
9438
9840
  "report.ai.total": "Total",
9439
9841
  "report.ai.unknown": "unknown",
9440
9842
  "report.ai.sources": "Profile sources (reviewed {date})",
@@ -9460,7 +9862,7 @@ var ko2 = {
9460
9862
  "md002.fix.review": "\uBAA8\uB4E0 \uC704\uCE58\uB97C \uAC80\uD1A0\uD558\uC138\uC694. \uC11C\uB85C \uB2E4\uB978 \uC5D0\uC774\uC804\uD2B8\uAC00 \uC77D\uB294 \uD30C\uC77C\uC774\uBA74 \uC591\uCABD \uBAA8\uB450 \uD544\uC694\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC544\uB2C8\uB77C\uBA74 \uD55C \uACF3\uB9CC \uB0A8\uAE30\uACE0 \uCC38\uC870\uD558\uC138\uC694.",
9461
9863
  "md002.fix.protected": "\uC2B9\uC778\xB7\uBC30\uD3EC\xB7\uC0AD\uC81C\xB7\uD14C\uC2A4\uD2B8 \uC9C0\uC2DC\uAC00 \uB4E4\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uC774 \uBB38\uB2E8\uC744 \uC77D\uB294 \uBAA8\uB4E0 \uC5D0\uC774\uC804\uD2B8\uAC00 \uACC4\uC18D \uC9C0\uC2DC\uB97C \uBC1B\uB294\uB2E4\uB294 \uAC83\uC744 \uD655\uC778\uD558\uAE30 \uC804\uC5D0\uB294 \uC9C0\uC6B0\uC9C0 \uB9C8\uC138\uC694.",
9462
9864
  "md002.verify": "\uAC19\uC740 \uAC80\uC0AC\uB97C \uB2E4\uC2DC \uC2E4\uD589\uD574 \uB0A8\uC740 \uC704\uCE58\uB97C \uBE44\uAD50\uD558\uC138\uC694.",
9463
- "ai001.scope.m2": "\uD504\uB85C\uC81D\uD2B8\uC5D0\uC11C AGENTS.md\xB7AGENTS.override.md(Codex), CLAUDE.md\xB7CLAUDE.local.md\xB7.claude/rules(Claude Code), GEMINI.md(Gemini CLI)\uB97C \uCC3E\uC2B5\uB2C8\uB2E4.",
9865
+ "ai001.scope.m2": "\uD504\uB85C\uC81D\uD2B8\uC5D0\uC11C Codex(AGENTS.md\xB7AGENTS.override.md), Claude Code(CLAUDE.md\xB7CLAUDE.local.md\xB7.claude/rules, \uB300\uCCB4\uB85C AGENTS.md), Gemini CLI(GEMINI.md), GitHub Copilot(.github/copilot-instructions.md\xB7.github/instructions), Cursor \uB370\uC2A4\uD06C\uD1B1 \uC571(.cursor/rules/*.mdc), Grok Build \uD130\uBBF8\uB110(.grok/rules), Antigravity(.agents/rules)\uC758 \uC9C0\uC2DC\xB7\uADDC\uCE59 \uD30C\uC77C\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.",
9464
9866
  "ai001.empty": "{path}\uC774(\uAC00) \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. Codex \uB4F1\uC740 \uBE48 \uC9C0\uC2DC \uD30C\uC77C\uC744 \uAC74\uB108\uB701\uB2C8\uB2E4.",
9465
9867
  "ai001.fix.empty": "{path}\uC5D0 \uC758\uB3C4\uD55C \uC9C0\uC2DC\uB97C \uB123\uAC70\uB098 \uD30C\uC77C\uC744 \uC9C0\uC6B0\uC138\uC694.",
9466
9868
  "ai001.overrideShadows": "\uAC19\uC740 \uD3F4\uB354\uC5D0 {override}\uC774(\uAC00) \uC788\uC5B4 Codex\uAC00 {path}\uC744(\uB97C) \uBB34\uC2DC\uD569\uB2C8\uB2E4.",
@@ -9485,6 +9887,8 @@ var ko2 = {
9485
9887
  "ai.note.depthLimit": "\uC77C\uBD80 import\uAC00 \uD50C\uB7AB\uD3FC \uAE4A\uC774 \uD55C\uB3C4\uB97C \uB118\uC5B4 \uC77D\uD788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
9486
9888
  "ai.note.codexCap": "Codex \uC9C0\uC2DC \uBB36\uC74C\uC774 \uAE30\uBCF8 32 KiB \uD55C\uB3C4\uB97C \uB118\uC5B4 \uB4A4\uCABD \uD30C\uC77C\uC740 \uC77D\uD788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
9487
9889
  "ai.note.unknownTokens": "\uAC80\uC0AC\uD558\uC9C0 \uBABB\uD55C \uD30C\uC77C\uC774 \uC788\uC5B4 \uD569\uACC4\uB97C \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
9890
+ "ai.note.claudeAgentsFallback": "\uC5EC\uAE30\uC5D0 \uD574\uB2F9\uD558\uB294 CLAUDE.md\uAC00 \uC5C6\uC5B4 Claude Code(v2.1.277 \uC774\uC0C1)\uB294 AGENTS.md\uB97C \uB300\uC2E0 \uC77D\uC2B5\uB2C8\uB2E4.",
9891
+ "ai.note.claudeLong": "\uC5EC\uAE30\uC758 CLAUDE.md\uAC00 200\uC904\uC744 \uB118\uC2B5\uB2C8\uB2E4. Claude Code\uB294 \uD30C\uC77C\uB2F9 200\uC904 \uC774\uD558\uB97C \uAD8C\uC7A5\uD569\uB2C8\uB2E4.",
9488
9892
  "ai.unseen.codexHome": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: ~/.codex(\uB610\uB294 CODEX_HOME)\uC758 \uC804\uC5ED AGENTS \uD30C\uC77C.",
9489
9893
  "ai.unseen.codexFallbackNames": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: project_doc_fallback_filenames\uC640 project_doc_max_bytes \uC124\uC815.",
9490
9894
  "ai.unseen.claudeUserManaged": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: ~/.claude/CLAUDE.md, \uC0AC\uC6A9\uC790 \uADDC\uCE59, \uAD00\uB9AC \uC815\uCC45 \uD30C\uC77C.",
@@ -9492,6 +9896,16 @@ var ko2 = {
9492
9896
  "ai.unseen.geminiGlobal": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: ~/.gemini/GEMINI.md.",
9493
9897
  "ai.unseen.geminiFileName": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: \uCEE8\uD14D\uC2A4\uD2B8 \uD30C\uC77C \uC774\uB984\uC744 \uBC14\uAFB8\uAC70\uB098 \uCD94\uAC00\uD558\uB294 context.fileName \uC124\uC815.",
9494
9898
  "ai.unseen.geminiJit": "\uD569\uACC4\uC5D0\uC11C \uC81C\uC678: \uB3C4\uAD6C\uAC00 \uB2E4\uB978 \uD3F4\uB354\uB97C \uB2E4\uB8F0 \uB54C \uC989\uC2DC \uC77D\uB294 \uD30C\uC77C.",
9899
+ "ai.unseen.copilotPersonal": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: \uAC1C\uC778\xB7\uC870\uC9C1\uC758 \uC0AC\uC6A9\uC790 \uC9C0\uC815 \uC9C0\uC2DC.",
9900
+ "ai.unseen.cursorUserTeam": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: \uC0AC\uC6A9\uC790 \uADDC\uCE59\uACFC \uD300 \uADDC\uCE59.",
9901
+ "ai.unseen.grokHome": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: ~/.grok/\uC758 \uC804\uC5ED \uADDC\uCE59. .gitignore\uC5D0 \uAC78\uB9B0 \uD30C\uC77C\uC740 \uC77D\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
9902
+ "ai.unseen.antigravityGlobal": "\uBCF4\uC774\uC9C0 \uC54A\uC74C: ~/.gemini/\uC758 \uC804\uC5ED \uD30C\uC77C\uACFC \uADDC\uCE59.",
9903
+ "ai.note.ruleIgnored": "\uC5EC\uAE30 \uC77C\uBD80 \uADDC\uCE59 \uD30C\uC77C\uC740 trigger\uAC00 \uC5C6\uAC70\uB098 \uC798\uBABB\uB418\uC5B4 Antigravity\uAC00 \uC77D\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
9904
+ "ai.note.copilotGithub": "github.com\uC5D0\uC11C \uACBD\uB85C\uBCC4 \uC9C0\uC2DC\uB294 \uD074\uB77C\uC6B0\uB4DC \uC5D0\uC774\uC804\uD2B8\uC640 \uCF54\uB4DC \uB9AC\uBDF0\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.",
9905
+ "platform.copilot": "GitHub Copilot",
9906
+ "platform.cursor": "Cursor \uB370\uC2A4\uD06C\uD1B1 \uC571",
9907
+ "platform.grok": "Grok Build \uD130\uBBF8\uB110",
9908
+ "platform.antigravity": "Antigravity",
9495
9909
  "platform.codex": "Codex",
9496
9910
  "platform.claude": "Claude Code",
9497
9911
  "platform.gemini": "Gemini CLI",
@@ -9510,7 +9924,26 @@ var ko2 = {
9510
9924
  "report.ai.via.hierarchy": "\uD3F4\uB354 \uACC4\uCE35",
9511
9925
  "report.ai.via.rule": "\uADDC\uCE59",
9512
9926
  "report.ai.via.import": "import",
9513
- "report.ai.conditional": "\uC870\uAC74\uBD80(\uACBD\uB85C \uADDC\uCE59, \uD569\uACC4 \uC81C\uC678)",
9927
+ "report.ai.conditional": "\uC870\uAC74\uBD80(\uD569\uACC4 \uC81C\uC678)",
9928
+ "report.ai.agent": "\uC5D0\uC774\uC804\uD2B8",
9929
+ "report.ai.agentsCaption": "\uC120\uD0DD\uD55C \uC791\uC5C5 \uD3F4\uB354\uC5D0\uC11C \uC5D0\uC774\uC804\uD2B8\uB9C8\uB2E4 \uC2DC\uC791\uD560 \uB54C \uC77D\uB294 \uC9C0\uC2DC \uD1A0\uD070",
9930
+ "report.ai.conditionalCount": "\uC870\uAC74\uBD80 \uD30C\uC77C",
9931
+ "report.ai.detail": "{platform}: \uD30C\uC77C\uACFC \uADDC\uCE59",
9932
+ "report.ai.load": "\uC77D\uB294 \uBC29\uC2DD",
9933
+ "report.ai.load.always": "\uD56D\uC0C1",
9934
+ "report.ai.load.path": "\uACBD\uB85C\uAC00 \uB9DE\uC744 \uB54C",
9935
+ "report.ai.load.model": "\uBAA8\uB378\uC774 \uD310\uB2E8",
9936
+ "report.ai.load.manual": "\uC694\uCCAD\uD560 \uB54C\uB9CC",
9937
+ "report.ai.route": "\uC77D\uD788\uB294 \uACBD\uB85C",
9938
+ "report.ai.notCounted": "\uD569\uACC4 \uC81C\uC678",
9939
+ "report.ai.profilesHeading": "\uC5D0\uC774\uC804\uD2B8 \uD504\uB85C\uD544\uACFC \uADFC\uAC70\uB85C \uC0BC\uC740 \uACF5\uC2DD \uBB38\uC11C",
9940
+ "report.ai.reviewed": "{date} \uD655\uC778",
9941
+ "report.ai.switch.title": "\uC5D0\uC774\uC804\uD2B8 \uBC14\uAFB8\uAE30",
9942
+ "report.ai.switch.to": "{platform}\uC5D0\uC11C \uBC14\uAFC0 \uC5D0\uC774\uC804\uD2B8",
9943
+ "report.ai.switch.none": "\uC5EC\uAE30\uC11C\uB294 {from}\uC5D0\uC11C {to}\uB85C \uBC14\uAFD4\uB3C4 \uC783\uB294 \uC9C0\uC2DC \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.",
9944
+ "report.ai.switch.lost": "\uC5EC\uAE30\uC11C {from}\uC5D0\uC11C {to}\uB85C \uBC14\uAFB8\uBA74 \uD30C\uC77C {count}\uAC1C\uB97C \uC783\uC2B5\uB2C8\uB2E4. {to}\uB294 \uC774 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
9945
+ "report.ai.switch.gained": "{to}\uB9CC \uC77D\uB294 \uD30C\uC77C",
9946
+ "ai.note.claudeCompaction": "\uC555\uCD95(compact) \uB4A4 Claude Code\uB294 \uC2DC\uC791 \uD30C\uC77C\uC744 \uB2E4\uC2DC \uC77D\uC9C0\uB9CC, \uACBD\uB85C \uADDC\uCE59\uC740 \uB9DE\uB294 \uD30C\uC77C\uC744 \uB2E4\uC2DC \uC77D\uC744 \uB54C\uC5D0\uC57C \uB3CC\uC544\uC635\uB2C8\uB2E4.",
9514
9947
  "report.ai.total": "\uD569\uACC4",
9515
9948
  "report.ai.unknown": "\uC54C \uC218 \uC5C6\uC74C",
9516
9949
  "report.ai.sources": "\uD504\uB85C\uD544 \uCD9C\uCC98(\uAC80\uD1A0\uC77C {date})",
@@ -9536,7 +9969,7 @@ var ja2 = {
9536
9969
  "md002.fix.review": "\u3059\u3079\u3066\u306E\u4F4D\u7F6E\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u5225\u3005\u306E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u8AAD\u3080\u30D5\u30A1\u30A4\u30EB\u306A\u3089\u4E21\u65B9\u5FC5\u8981\u306A\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u305D\u3046\u3067\u306A\u3051\u308C\u3070 1 \u304B\u6240\u306B\u6B8B\u3057\u3066\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
9537
9970
  "md002.fix.protected": "\u627F\u8A8D\u30FB\u30C7\u30D7\u30ED\u30A4\u30FB\u524A\u9664\u30FB\u30C6\u30B9\u30C8\u306E\u6307\u793A\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u6BB5\u843D\u3092\u8AAD\u3080\u3059\u3079\u3066\u306E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u5F15\u304D\u7D9A\u304D\u6307\u793A\u3092\u53D7\u3051\u53D6\u308B\u3068\u78BA\u8A8D\u3067\u304D\u308B\u307E\u3067\u306F\u524A\u9664\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002",
9538
9971
  "md002.verify": "\u540C\u3058\u691C\u67FB\u3092\u518D\u5B9F\u884C\u3057\u3001\u6B8B\u3063\u305F\u4F4D\u7F6E\u3092\u6BD4\u8F03\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
9539
- "ai001.scope.m2": "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E AGENTS.md\u30FBAGENTS.override.md(Codex)\u3001CLAUDE.md\u30FBCLAUDE.local.md\u30FB.claude/rules(Claude Code)\u3001GEMINI.md(Gemini CLI)\u3092\u63A2\u3057\u307E\u3059\u3002",
9972
+ "ai001.scope.m2": "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E Codex(AGENTS.md\u30FBAGENTS.override.md)\u3001Claude Code(CLAUDE.md\u30FBCLAUDE.local.md\u30FB.claude/rules\u3001\u4EE3\u66FF\u3068\u3057\u3066 AGENTS.md)\u3001Gemini CLI(GEMINI.md)\u3001GitHub Copilot(.github/copilot-instructions.md\u30FB.github/instructions)\u3001Cursor \u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA(.cursor/rules/*.mdc)\u3001Grok Build \u30BF\u30FC\u30DF\u30CA\u30EB(.grok/rules)\u3001Antigravity(.agents/rules)\u306E\u6307\u793A\u30FB\u30EB\u30FC\u30EB\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3057\u307E\u3059\u3002",
9540
9973
  "ai001.empty": "{path} \u306F\u7A7A\u3067\u3059\u3002Codex \u306A\u3069\u306F\u7A7A\u306E\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3059\u3002",
9541
9974
  "ai001.fix.empty": "{path} \u306B\u610F\u56F3\u3057\u305F\u6307\u793A\u3092\u66F8\u304F\u304B\u3001\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
9542
9975
  "ai001.overrideShadows": "\u540C\u3058\u30D5\u30A9\u30EB\u30C0\u30FC\u306B {override} \u304C\u3042\u308B\u305F\u3081\u3001Codex \u306F {path} \u3092\u7121\u8996\u3057\u307E\u3059\u3002",
@@ -9561,6 +9994,8 @@ var ja2 = {
9561
9994
  "ai.note.depthLimit": "\u4E00\u90E8\u306E import \u304C\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E\u6DF1\u3055\u306E\u4E0A\u9650\u3092\u8D85\u3048\u3066\u304A\u308A\u3001\u8AAD\u307F\u8FBC\u307E\u308C\u307E\u305B\u3093\u3002",
9562
9995
  "ai.note.codexCap": "Codex \u306E\u6307\u793A\u30C1\u30A7\u30FC\u30F3\u304C\u65E2\u5B9A\u306E 32 KiB \u4E0A\u9650\u3092\u8D85\u3048\u3066\u304A\u308A\u3001\u5F8C\u308D\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u8AAD\u307F\u8FBC\u307E\u308C\u307E\u305B\u3093\u3002",
9563
9996
  "ai.note.unknownTokens": "\u691C\u67FB\u3057\u3066\u3044\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308B\u305F\u3081\u3001\u5408\u8A08\u306F\u4E0D\u660E\u3067\u3059\u3002",
9997
+ "ai.note.claudeAgentsFallback": "\u3053\u3053\u306B\u8A72\u5F53\u3059\u308B CLAUDE.md \u304C\u306A\u3044\u305F\u3081\u3001Claude Code(v2.1.277 \u4EE5\u964D)\u306F\u4EE3\u308F\u308A\u306B AGENTS.md \u3092\u8AAD\u307F\u307E\u3059\u3002",
9998
+ "ai.note.claudeLong": "\u3053\u3053\u306E CLAUDE.md \u304C 200 \u884C\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002Claude Code \u306F 1 \u30D5\u30A1\u30A4\u30EB 200 \u884C\u4EE5\u4E0B\u3092\u63A8\u5968\u3057\u3066\u3044\u307E\u3059\u3002",
9564
9999
  "ai.unseen.codexHome": "\u898B\u3048\u306A\u3044: ~/.codex(\u307E\u305F\u306F CODEX_HOME)\u306E\u30B0\u30ED\u30FC\u30D0\u30EB AGENTS \u30D5\u30A1\u30A4\u30EB\u3002",
9565
10000
  "ai.unseen.codexFallbackNames": "\u898B\u3048\u306A\u3044: project_doc_fallback_filenames \u3068 project_doc_max_bytes \u306E\u8A2D\u5B9A\u3002",
9566
10001
  "ai.unseen.claudeUserManaged": "\u898B\u3048\u306A\u3044: ~/.claude/CLAUDE.md\u3001\u30E6\u30FC\u30B6\u30FC\u30EB\u30FC\u30EB\u3001\u7BA1\u7406\u30DD\u30EA\u30B7\u30FC\u306E\u30D5\u30A1\u30A4\u30EB\u3002",
@@ -9568,6 +10003,16 @@ var ja2 = {
9568
10003
  "ai.unseen.geminiGlobal": "\u898B\u3048\u306A\u3044: ~/.gemini/GEMINI.md\u3002",
9569
10004
  "ai.unseen.geminiFileName": "\u898B\u3048\u306A\u3044: \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5909\u66F4\u30FB\u8FFD\u52A0\u3059\u308B context.fileName \u306E\u8A2D\u5B9A\u3002",
9570
10005
  "ai.unseen.geminiJit": "\u5408\u8A08\u304B\u3089\u9664\u5916: \u30C4\u30FC\u30EB\u304C\u5225\u306E\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u89E6\u308C\u305F\u3068\u304D\u306B\u5373\u6642\u306B\u8AAD\u307F\u8FBC\u307E\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u3002",
10006
+ "ai.unseen.copilotPersonal": "\u898B\u3048\u306A\u3044: \u500B\u4EBA\u3068\u7D44\u7E54\u306E\u30AB\u30B9\u30BF\u30E0\u6307\u793A\u3002",
10007
+ "ai.unseen.cursorUserTeam": "\u898B\u3048\u306A\u3044: \u30E6\u30FC\u30B6\u30FC\u30EB\u30FC\u30EB\u3068\u30C1\u30FC\u30E0\u30EB\u30FC\u30EB\u3002",
10008
+ "ai.unseen.grokHome": "\u898B\u3048\u306A\u3044: ~/.grok/ \u306E\u30B0\u30ED\u30FC\u30D0\u30EB\u30EB\u30FC\u30EB\u3002.gitignore \u3067\u9664\u5916\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u306F\u8AAD\u307F\u307E\u305B\u3093\u3002",
10009
+ "ai.unseen.antigravityGlobal": "\u898B\u3048\u306A\u3044: ~/.gemini/ \u306E\u30B0\u30ED\u30FC\u30D0\u30EB\u30D5\u30A1\u30A4\u30EB\u3068\u30EB\u30FC\u30EB\u3002",
10010
+ "ai.note.ruleIgnored": "\u3053\u3053\u306E\u4E00\u90E8\u306E\u30EB\u30FC\u30EB\u30D5\u30A1\u30A4\u30EB\u306F trigger \u304C\u306A\u3044\u304B\u8AA4\u3063\u3066\u3044\u308B\u305F\u3081\u3001Antigravity \u306F\u8AAD\u307F\u307E\u305B\u3093\u3002",
10011
+ "ai.note.copilotGithub": "github.com \u3067\u306F\u30D1\u30B9\u5225\u306E\u6307\u793A\u306F\u30AF\u30E9\u30A6\u30C9\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3068\u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC\u306B\u306E\u307F\u9069\u7528\u3055\u308C\u307E\u3059\u3002",
10012
+ "platform.copilot": "GitHub Copilot",
10013
+ "platform.cursor": "Cursor \u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA",
10014
+ "platform.grok": "Grok Build \u30BF\u30FC\u30DF\u30CA\u30EB",
10015
+ "platform.antigravity": "Antigravity",
9571
10016
  "platform.codex": "Codex",
9572
10017
  "platform.claude": "Claude Code",
9573
10018
  "platform.gemini": "Gemini CLI",
@@ -9586,7 +10031,26 @@ var ja2 = {
9586
10031
  "report.ai.via.hierarchy": "\u30D5\u30A9\u30EB\u30C0\u30FC\u968E\u5C64",
9587
10032
  "report.ai.via.rule": "\u30EB\u30FC\u30EB",
9588
10033
  "report.ai.via.import": "import",
9589
- "report.ai.conditional": "\u6761\u4EF6\u4ED8\u304D(\u30D1\u30B9\u30EB\u30FC\u30EB\u3001\u5408\u8A08\u5916)",
10034
+ "report.ai.conditional": "\u6761\u4EF6\u4ED8\u304D(\u5408\u8A08\u5916)",
10035
+ "report.ai.agent": "\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8",
10036
+ "report.ai.agentsCaption": "\u9078\u629E\u3057\u305F\u4F5C\u696D\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u3001\u5404\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u958B\u59CB\u6642\u306B\u8AAD\u3080\u6307\u793A\u306E\u30C8\u30FC\u30AF\u30F3",
10037
+ "report.ai.conditionalCount": "\u6761\u4EF6\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB",
10038
+ "report.ai.detail": "{platform}: \u30D5\u30A1\u30A4\u30EB\u3068\u30EB\u30FC\u30EB",
10039
+ "report.ai.load": "\u8AAD\u307F\u8FBC\u307F\u65B9",
10040
+ "report.ai.load.always": "\u5E38\u306B",
10041
+ "report.ai.load.path": "\u30D1\u30B9\u304C\u4E00\u81F4\u3057\u305F\u3068\u304D",
10042
+ "report.ai.load.model": "\u30E2\u30C7\u30EB\u304C\u5224\u65AD",
10043
+ "report.ai.load.manual": "\u6307\u5B9A\u3057\u305F\u3068\u304D\u3060\u3051",
10044
+ "report.ai.route": "\u8AAD\u307E\u308C\u308B\u7D4C\u8DEF",
10045
+ "report.ai.notCounted": "\u5408\u8A08\u5916",
10046
+ "report.ai.profilesHeading": "\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3068\u6839\u62E0\u306B\u3057\u305F\u516C\u5F0F\u30DA\u30FC\u30B8",
10047
+ "report.ai.reviewed": "{date} \u78BA\u8A8D",
10048
+ "report.ai.switch.title": "\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u5207\u308A\u66FF\u3048",
10049
+ "report.ai.switch.to": "{platform} \u304B\u3089\u306E\u5207\u308A\u66FF\u3048\u5148",
10050
+ "report.ai.switch.none": "\u3053\u3053\u3067\u306F {from} \u304B\u3089 {to} \u306B\u5207\u308A\u66FF\u3048\u3066\u3082\u5931\u308F\u308C\u308B\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u306F\u3042\u308A\u307E\u305B\u3093\u3002",
10051
+ "report.ai.switch.lost": "\u3053\u3053\u3067 {from} \u304B\u3089 {to} \u306B\u5207\u308A\u66FF\u3048\u308B\u3068 {count} \u500B\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5931\u308F\u308C\u307E\u3059\u3002{to} \u306F\u3053\u308C\u3089\u3092\u8AAD\u307F\u307E\u305B\u3093\u3002",
10052
+ "report.ai.switch.gained": "{to} \u3060\u3051\u304C\u8AAD\u3080\u30D5\u30A1\u30A4\u30EB",
10053
+ "ai.note.claudeCompaction": "\u5727\u7E2E(compact)\u5F8C\u3001Claude Code \u306F\u958B\u59CB\u6642\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u76F4\u3057\u307E\u3059\u304C\u3001\u30D1\u30B9\u30EB\u30FC\u30EB\u306F\u4E00\u81F4\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u3092\u518D\u3073\u8AAD\u3080\u307E\u3067\u623B\u308A\u307E\u305B\u3093\u3002",
9590
10054
  "report.ai.total": "\u5408\u8A08",
9591
10055
  "report.ai.unknown": "\u4E0D\u660E",
9592
10056
  "report.ai.sources": "\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u51FA\u5178(\u78BA\u8A8D\u65E5 {date})",
@@ -9612,7 +10076,7 @@ var zh2 = {
9612
10076
  "md002.fix.review": "\u8BF7\u68C0\u67E5\u6240\u6709\u4F4D\u7F6E\u3002\u5982\u679C\u8FD9\u4E9B\u6587\u4EF6\u4F9B\u4E0D\u540C\u7684\u4EE3\u7406\u8BFB\u53D6,\u53EF\u80FD\u90FD\u9700\u8981\u4FDD\u7559;\u5426\u5219\u53EA\u4FDD\u7559\u4E00\u5904\u5E76\u5F15\u7528\u5B83\u3002",
9613
10077
  "md002.fix.protected": "\u6B64\u6BB5\u843D\u5305\u542B\u5BA1\u6279\u3001\u90E8\u7F72\u3001\u5220\u9664\u6216\u6D4B\u8BD5\u6307\u4EE4\u3002\u5728\u786E\u8BA4\u6240\u6709\u8BFB\u53D6\u5B83\u7684\u4EE3\u7406\u4ECD\u80FD\u6536\u5230\u8BE5\u6307\u4EE4\u4E4B\u524D,\u4E0D\u8981\u5220\u9664\u4EFB\u4F55\u526F\u672C\u3002",
9614
10078
  "md002.verify": "\u518D\u6B21\u8FD0\u884C\u76F8\u540C\u7684\u68C0\u67E5\u5E76\u6BD4\u8F83\u5269\u4F59\u7684\u4F4D\u7F6E\u3002",
9615
- "ai001.scope.m2": "\u5728\u9879\u76EE\u4E2D\u67E5\u627E AGENTS.md\u3001AGENTS.override.md(Codex),CLAUDE.md\u3001CLAUDE.local.md\u3001.claude/rules(Claude Code)\u4EE5\u53CA GEMINI.md(Gemini CLI)\u3002",
10079
+ "ai001.scope.m2": "\u5728\u9879\u76EE\u4E2D\u67E5\u627E Codex(AGENTS.md\u3001AGENTS.override.md)\u3001Claude Code(CLAUDE.md\u3001CLAUDE.local.md\u3001.claude/rules,\u4EE5\u53CA\u4F5C\u4E3A\u66FF\u4EE3\u7684 AGENTS.md)\u3001Gemini CLI(GEMINI.md)\u3001GitHub Copilot(.github/copilot-instructions.md\u3001.github/instructions)\u3001Cursor \u684C\u9762\u5E94\u7528(.cursor/rules/*.mdc)\u3001Grok Build \u7EC8\u7AEF(.grok/rules)\u548C Antigravity(.agents/rules)\u7684\u6307\u4EE4\u4E0E\u89C4\u5219\u6587\u4EF6\u3002",
9616
10080
  "ai001.empty": "{path} \u662F\u7A7A\u6587\u4EF6\u3002Codex \u7B49\u5DE5\u5177\u4F1A\u8DF3\u8FC7\u7A7A\u7684\u6307\u4EE4\u6587\u4EF6\u3002",
9617
10081
  "ai001.fix.empty": "\u5728 {path} \u4E2D\u5199\u5165\u9884\u671F\u7684\u6307\u4EE4,\u6216\u5220\u9664\u8BE5\u6587\u4EF6\u3002",
9618
10082
  "ai001.overrideShadows": "\u7531\u4E8E\u540C\u4E00\u6587\u4EF6\u5939\u4E2D\u5B58\u5728 {override},Codex \u4F1A\u5FFD\u7565 {path}\u3002",
@@ -9637,6 +10101,8 @@ var zh2 = {
9637
10101
  "ai.note.depthLimit": "\u90E8\u5206 import \u8D85\u51FA\u5E73\u53F0\u7684\u6DF1\u5EA6\u4E0A\u9650,\u4E0D\u4F1A\u88AB\u52A0\u8F7D\u3002",
9638
10102
  "ai.note.codexCap": "Codex \u6307\u4EE4\u94FE\u8D85\u8FC7\u9ED8\u8BA4\u7684 32 KiB \u4E0A\u9650,\u540E\u9762\u7684\u6587\u4EF6\u4E0D\u4F1A\u88AB\u52A0\u8F7D\u3002",
9639
10103
  "ai.note.unknownTokens": "\u6709\u672A\u68C0\u67E5\u7684\u6587\u4EF6,\u56E0\u6B64\u5408\u8BA1\u672A\u77E5\u3002",
10104
+ "ai.note.claudeAgentsFallback": "\u8FD9\u91CC\u6CA1\u6709\u9002\u7528\u7684 CLAUDE.md,\u56E0\u6B64 Claude Code(v2.1.277 \u53CA\u4EE5\u4E0A)\u6539\u4E3A\u8BFB\u53D6 AGENTS.md\u3002",
10105
+ "ai.note.claudeLong": "\u8FD9\u91CC\u7684 CLAUDE.md \u8D85\u8FC7 200 \u884C\u3002Claude Code \u5EFA\u8BAE\u6BCF\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC7 200 \u884C\u3002",
9640
10106
  "ai.unseen.codexHome": "\u4E0D\u53EF\u89C1:~/.codex(\u6216 CODEX_HOME)\u4E2D\u7684\u5168\u5C40 AGENTS \u6587\u4EF6\u3002",
9641
10107
  "ai.unseen.codexFallbackNames": "\u4E0D\u53EF\u89C1:project_doc_fallback_filenames \u548C project_doc_max_bytes \u8BBE\u7F6E\u3002",
9642
10108
  "ai.unseen.claudeUserManaged": "\u4E0D\u53EF\u89C1:~/.claude/CLAUDE.md\u3001\u7528\u6237\u89C4\u5219\u548C\u6258\u7BA1\u7B56\u7565\u6587\u4EF6\u3002",
@@ -9644,6 +10110,16 @@ var zh2 = {
9644
10110
  "ai.unseen.geminiGlobal": "\u4E0D\u53EF\u89C1:~/.gemini/GEMINI.md\u3002",
9645
10111
  "ai.unseen.geminiFileName": "\u4E0D\u53EF\u89C1:\u66F4\u6539\u6216\u6DFB\u52A0\u4E0A\u4E0B\u6587\u6587\u4EF6\u540D\u7684 context.fileName \u8BBE\u7F6E\u3002",
9646
10112
  "ai.unseen.geminiJit": "\u672A\u8BA1\u5165:\u5DE5\u5177\u8BBF\u95EE\u5176\u4ED6\u6587\u4EF6\u5939\u65F6\u5373\u65F6\u52A0\u8F7D\u7684\u6587\u4EF6\u3002",
10113
+ "ai.unseen.copilotPersonal": "\u4E0D\u53EF\u89C1:\u4E2A\u4EBA\u548C\u7EC4\u7EC7\u7684\u81EA\u5B9A\u4E49\u6307\u4EE4\u3002",
10114
+ "ai.unseen.cursorUserTeam": "\u4E0D\u53EF\u89C1:\u7528\u6237\u89C4\u5219\u548C\u56E2\u961F\u89C4\u5219\u3002",
10115
+ "ai.unseen.grokHome": "\u4E0D\u53EF\u89C1:~/.grok/ \u4E2D\u7684\u5168\u5C40\u89C4\u5219\u3002\u88AB .gitignore \u5FFD\u7565\u7684\u6587\u4EF6\u4E0D\u4F1A\u8BFB\u53D6\u3002",
10116
+ "ai.unseen.antigravityGlobal": "\u4E0D\u53EF\u89C1:~/.gemini/ \u4E2D\u7684\u5168\u5C40\u6587\u4EF6\u548C\u89C4\u5219\u3002",
10117
+ "ai.note.ruleIgnored": "\u8FD9\u91CC\u7684\u90E8\u5206\u89C4\u5219\u6587\u4EF6\u7F3A\u5C11 trigger \u6216 trigger \u65E0\u6548,Antigravity \u4E0D\u4F1A\u8BFB\u53D6\u3002",
10118
+ "ai.note.copilotGithub": "\u5728 github.com \u4E0A,\u6309\u8DEF\u5F84\u7684\u6307\u4EE4\u53EA\u9002\u7528\u4E8E\u4E91\u7AEF\u4EE3\u7406\u548C\u4EE3\u7801\u5BA1\u67E5\u3002",
10119
+ "platform.copilot": "GitHub Copilot",
10120
+ "platform.cursor": "Cursor \u684C\u9762\u5E94\u7528",
10121
+ "platform.grok": "Grok Build \u7EC8\u7AEF",
10122
+ "platform.antigravity": "Antigravity",
9647
10123
  "platform.codex": "Codex",
9648
10124
  "platform.claude": "Claude Code",
9649
10125
  "platform.gemini": "Gemini CLI",
@@ -9662,7 +10138,26 @@ var zh2 = {
9662
10138
  "report.ai.via.hierarchy": "\u6587\u4EF6\u5939\u5C42\u7EA7",
9663
10139
  "report.ai.via.rule": "\u89C4\u5219",
9664
10140
  "report.ai.via.import": "import",
9665
- "report.ai.conditional": "\u6761\u4EF6\u52A0\u8F7D(\u8DEF\u5F84\u89C4\u5219,\u4E0D\u8BA1\u5165\u5408\u8BA1)",
10141
+ "report.ai.conditional": "\u6761\u4EF6\u52A0\u8F7D(\u4E0D\u8BA1\u5165\u5408\u8BA1)",
10142
+ "report.ai.agent": "\u4EE3\u7406",
10143
+ "report.ai.agentsCaption": "\u5728\u6240\u9009\u5DE5\u4F5C\u6587\u4EF6\u5939\u4E2D,\u6BCF\u4E2A\u4EE3\u7406\u542F\u52A8\u65F6\u8BFB\u53D6\u7684\u6307\u4EE4 token",
10144
+ "report.ai.conditionalCount": "\u6761\u4EF6\u52A0\u8F7D\u6587\u4EF6",
10145
+ "report.ai.detail": "{platform}:\u6587\u4EF6\u4E0E\u89C4\u5219",
10146
+ "report.ai.load": "\u52A0\u8F7D\u65B9\u5F0F",
10147
+ "report.ai.load.always": "\u59CB\u7EC8",
10148
+ "report.ai.load.path": "\u8DEF\u5F84\u5339\u914D\u65F6",
10149
+ "report.ai.load.model": "\u7531\u6A21\u578B\u51B3\u5B9A",
10150
+ "report.ai.load.manual": "\u4EC5\u5728\u8BF7\u6C42\u65F6",
10151
+ "report.ai.route": "\u8BFB\u53D6\u9014\u5F84",
10152
+ "report.ai.notCounted": "\u4E0D\u8BA1\u5165",
10153
+ "report.ai.profilesHeading": "\u4EE3\u7406\u914D\u7F6E\u53CA\u5176\u4F9D\u636E\u7684\u5B98\u65B9\u9875\u9762",
10154
+ "report.ai.reviewed": "{date} \u6838\u5BF9",
10155
+ "report.ai.switch.title": "\u5207\u6362\u4EE3\u7406",
10156
+ "report.ai.switch.to": "\u4ECE {platform} \u5207\u6362\u5230",
10157
+ "report.ai.switch.none": "\u5728\u8FD9\u91CC\u4ECE {from} \u5207\u6362\u5230 {to} \u4E0D\u4F1A\u4E22\u5931\u6307\u4EE4\u6587\u4EF6\u3002",
10158
+ "report.ai.switch.lost": "\u5728\u8FD9\u91CC\u4ECE {from} \u5207\u6362\u5230 {to} \u4F1A\u4E22\u5931 {count} \u4E2A\u6587\u4EF6:{to} \u4E0D\u8BFB\u53D6\u5B83\u4EEC\u3002",
10159
+ "report.ai.switch.gained": "\u53EA\u6709 {to} \u8BFB\u53D6\u7684\u6587\u4EF6",
10160
+ "ai.note.claudeCompaction": "\u538B\u7F29(compact)\u540E Claude Code \u4F1A\u91CD\u65B0\u8BFB\u53D6\u542F\u52A8\u6587\u4EF6,\u4F46\u8DEF\u5F84\u89C4\u5219\u8981\u7B49\u518D\u6B21\u8BFB\u53D6\u5339\u914D\u7684\u6587\u4EF6\u65F6\u624D\u4F1A\u6062\u590D\u3002",
9666
10161
  "report.ai.total": "\u5408\u8BA1",
9667
10162
  "report.ai.unknown": "\u672A\u77E5",
9668
10163
  "report.ai.sources": "\u914D\u7F6E\u6765\u6E90(\u6838\u5BF9\u65E5\u671F {date})",
@@ -9743,8 +10238,19 @@ var enT = {
9743
10238
  "rule.AGT-001": "Skill files (SKILL.md)",
9744
10239
  "rule.AGT-002": "Conflicting conventions",
9745
10240
  "agt001.scope": "Checks SKILL.md front matter: name and description present, name in lowercase-hyphen form (max 64) matching its folder, description up to 1024 characters, non-empty body.",
9746
- "agt002.scope": "Compares instruction files for clearly worded package-manager (npm, pnpm, yarn, bun) and indentation (spaces, tabs) rules. Results are candidates for review.",
10241
+ "agt002.scope": "Compares instruction files for clearly worded package-manager (npm, pnpm, yarn, bun), indentation (spaces, tabs) and Node.js version rules, in English, Korean, Japanese and Chinese sentences. Results are candidates for review.",
9747
10242
  "agt.verify": "Run the same check again and confirm {path}:{line} no longer appears.",
10243
+ "rule.DOC-001": "Docs vs project",
10244
+ "doc001.scope": "Compares commands and paths in instruction files and README with the project: package manager vs lockfile, npm/pnpm/yarn scripts vs package.json, file paths in code spans vs the file list, Docker commands vs Dockerfile and compose files. Only clear-cut cases are reported; examples and conditional sentences are skipped.",
10245
+ "doc001.reason.none": "No instruction files or README were found.",
10246
+ "doc001.pm": "The command uses {used}, but the project has only a {expected} lockfile ({lockfile}).",
10247
+ "doc001.pm.fix": "Write the command for {expected}, or remove {lockfile} if the project moved to {used}.",
10248
+ "doc001.script": '"{command}" runs the script "{script}", which {manifest} does not define.',
10249
+ "doc001.script.fix": 'Add a "{script}" script to {manifest}, or correct the command.',
10250
+ "doc001.path": "{ref} is not in the project.",
10251
+ "doc001.path.fix": "Correct the path {ref}, or remove the reference if the file is gone.",
10252
+ "doc001.docker": '"{command}" needs {file}, which is not in the project.',
10253
+ "doc001.docker.fix": "Add {file}, or remove the Docker instructions.",
9748
10254
  "agt001.reason.none": "No SKILL.md files were found.",
9749
10255
  "agt001.noFrontMatter": "{path} has no front matter.",
9750
10256
  "agt001.noFrontMatter.fix": "Start {path} with --- front matter that sets name and description.",
@@ -9762,6 +10268,7 @@ var enT = {
9762
10268
  "agt001.emptyBody.fix": "Write the skill's instructions in the body of {path}.",
9763
10269
  "agt002.package-manager": "Instruction files name different package managers: {values}.",
9764
10270
  "agt002.indentation": "Instruction files ask for different indentation: {values}.",
10271
+ "agt002.node-version": "Instruction files ask for different Node.js versions: {values}.",
9765
10272
  "agt002.fix": "Pick one {topic} rule, keep it in one shared file and remove the others.",
9766
10273
  "rule.DEP-001": "Pinned dependency versions",
9767
10274
  "rule.DEP-002": "Known vulnerabilities (OSV)",
@@ -9889,8 +10396,19 @@ var koT = {
9889
10396
  "rule.AGT-001": "\uC2A4\uD0AC \uD30C\uC77C(SKILL.md)",
9890
10397
  "rule.AGT-002": "\uC11C\uB85C \uB2E4\uB978 \uADDC\uCE59",
9891
10398
  "agt001.scope": "SKILL.md\uC758 front matter\uB97C \uD655\uC778\uD569\uB2C8\uB2E4. name\xB7description\uC774 \uC788\uB294\uC9C0, name\uC774 \uC18C\uBB38\uC790\xB7\uD558\uC774\uD508 \uD615\uC2DD(\uCD5C\uB300 64\uC790)\uC774\uACE0 \uD3F4\uB354 \uC774\uB984\uACFC \uAC19\uC740\uC9C0, description\uC774 1024\uC790 \uC774\uD558\uC778\uC9C0, \uBCF8\uBB38\uC774 \uC788\uB294\uC9C0 \uBD05\uB2C8\uB2E4.",
9892
- "agt002.scope": "\uC9C0\uC2DC \uD30C\uC77C\uB4E4\uC5D0 \uBD84\uBA85\uD558\uAC8C \uC801\uD78C \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790(npm, pnpm, yarn, bun)\uC640 \uB4E4\uC5EC\uC4F0\uAE30(\uACF5\uBC31, \uD0ED) \uADDC\uCE59\uC744 \uBE44\uAD50\uD569\uB2C8\uB2E4. \uACB0\uACFC\uB294 \uAC80\uD1A0\uD560 \uD6C4\uBCF4\uC785\uB2C8\uB2E4.",
10399
+ "agt002.scope": "\uC9C0\uC2DC \uD30C\uC77C\uB4E4\uC5D0 \uBD84\uBA85\uD558\uAC8C \uC801\uD78C \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790(npm, pnpm, yarn, bun), \uB4E4\uC5EC\uC4F0\uAE30(\uACF5\uBC31, \uD0ED), Node.js \uBC84\uC804 \uADDC\uCE59\uC744 \uC601\uC5B4\xB7\uD55C\uAD6D\uC5B4\xB7\uC77C\uBCF8\uC5B4\xB7\uC911\uAD6D\uC5B4 \uBB38\uC7A5\uC5D0\uC11C \uBE44\uAD50\uD569\uB2C8\uB2E4. \uACB0\uACFC\uB294 \uAC80\uD1A0\uD560 \uD6C4\uBCF4\uC785\uB2C8\uB2E4.",
9893
10400
  "agt.verify": "\uAC19\uC740 \uAC80\uC0AC\uB97C \uB2E4\uC2DC \uC2E4\uD589\uD574 {path}:{line}\uC774(\uAC00) \uB354 \uC774\uC0C1 \uB098\uC624\uC9C0 \uC54A\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694.",
10401
+ "rule.DOC-001": "\uBB38\uC11C\uC640 \uD504\uB85C\uC81D\uD2B8 \uBD88\uC77C\uCE58",
10402
+ "doc001.scope": "\uC9C0\uC2DC \uD30C\uC77C\uACFC README\uC758 \uBA85\uB839\xB7\uACBD\uB85C\uB97C \uD504\uB85C\uC81D\uD2B8\uC640 \uBE44\uAD50\uD569\uB2C8\uB2E4. \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790\uC640 \uC7A0\uAE08 \uD30C\uC77C, npm/pnpm/yarn \uC2A4\uD06C\uB9BD\uD2B8\uC640 package.json, \uCF54\uB4DC \uD45C\uAE30 \uC18D \uD30C\uC77C \uACBD\uB85C\uC640 \uD30C\uC77C \uBAA9\uB85D, Docker \uBA85\uB839\uACFC Dockerfile\xB7compose \uD30C\uC77C. \uD655\uC2E4\uD55C \uACBD\uC6B0\uB9CC \uC54C\uB9AC\uACE0, \uC608\uC2DC\uC640 \uC870\uAC74\uBB38\uC740 \uAC74\uB108\uB701\uB2C8\uB2E4.",
10403
+ "doc001.reason.none": "\uC9C0\uC2DC \uD30C\uC77C\uC774\uB098 README\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
10404
+ "doc001.pm": "\uBA85\uB839\uC740 {used}\uB97C \uC4F0\uC9C0\uB9CC \uD504\uB85C\uC81D\uD2B8\uC5D0\uB294 {expected} \uC7A0\uAE08 \uD30C\uC77C({lockfile})\uB9CC \uC788\uC2B5\uB2C8\uB2E4.",
10405
+ "doc001.pm.fix": "\uBA85\uB839\uC744 {expected}\uB85C \uACE0\uCE58\uAC70\uB098, \uD504\uB85C\uC81D\uD2B8\uAC00 {used}\uB85C \uBC14\uB00C\uC5C8\uB2E4\uBA74 {lockfile}\uC744 \uC9C0\uC6B0\uC138\uC694.",
10406
+ "doc001.script": '"{command}"\uB294 \uC2A4\uD06C\uB9BD\uD2B8 "{script}"\uB97C \uC2E4\uD589\uD558\uC9C0\uB9CC {manifest}\uC5D0 \uADF8 \uC2A4\uD06C\uB9BD\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.',
10407
+ "doc001.script.fix": '{manifest}\uC5D0 "{script}" \uC2A4\uD06C\uB9BD\uD2B8\uB97C \uCD94\uAC00\uD558\uAC70\uB098 \uBA85\uB839\uC744 \uACE0\uCE58\uC138\uC694.',
10408
+ "doc001.path": "{ref}\uC774(\uAC00) \uD504\uB85C\uC81D\uD2B8\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4.",
10409
+ "doc001.path.fix": "\uACBD\uB85C {ref}\uB97C \uACE0\uCE58\uAC70\uB098, \uD30C\uC77C\uC774 \uC5C6\uC5B4\uC84C\uB2E4\uBA74 \uC5B8\uAE09\uC744 \uC9C0\uC6B0\uC138\uC694.",
10410
+ "doc001.docker": '"{command}"\uC5D0\uB294 {file}\uC774(\uAC00) \uD544\uC694\uD558\uC9C0\uB9CC \uD504\uB85C\uC81D\uD2B8\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4.',
10411
+ "doc001.docker.fix": "{file}\uC744(\uB97C) \uCD94\uAC00\uD558\uAC70\uB098 Docker \uC548\uB0B4\uB97C \uC9C0\uC6B0\uC138\uC694.",
9894
10412
  "agt001.reason.none": "SKILL.md \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.",
9895
10413
  "agt001.noFrontMatter": "{path}\uC5D0 front matter\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
9896
10414
  "agt001.noFrontMatter.fix": "{path} \uB9E8 \uC704\uC5D0 name\uACFC description\uC744 \uB2F4\uC740 --- front matter\uB97C \uB123\uC73C\uC138\uC694.",
@@ -9908,6 +10426,7 @@ var koT = {
9908
10426
  "agt001.emptyBody.fix": "{path} \uBCF8\uBB38\uC5D0 \uC2A4\uD0AC\uC758 \uC9C0\uC2DC \uB0B4\uC6A9\uC744 \uC801\uC73C\uC138\uC694.",
9909
10427
  "agt002.package-manager": "\uC9C0\uC2DC \uD30C\uC77C\uB9C8\uB2E4 \uB2E4\uB978 \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790\uB97C \uC801\uC5C8\uC2B5\uB2C8\uB2E4: {values}.",
9910
10428
  "agt002.indentation": "\uC9C0\uC2DC \uD30C\uC77C\uB9C8\uB2E4 \uB2E4\uB978 \uB4E4\uC5EC\uC4F0\uAE30\uB97C \uC694\uAD6C\uD569\uB2C8\uB2E4: {values}.",
10429
+ "agt002.node-version": "\uC9C0\uC2DC \uD30C\uC77C\uB9C8\uB2E4 \uB2E4\uB978 Node.js \uBC84\uC804\uC744 \uC694\uAD6C\uD569\uB2C8\uB2E4: {values}.",
9911
10430
  "agt002.fix": "{topic} \uADDC\uCE59\uC744 \uD558\uB098\uB85C \uC815\uD574 \uACF5\uD1B5 \uD30C\uC77C \uD55C \uACF3\uC5D0\uB9CC \uB0A8\uAE30\uACE0 \uB098\uBA38\uC9C0\uB294 \uC9C0\uC6B0\uC138\uC694.",
9912
10431
  "rule.DEP-001": "\uC758\uC874\uC131 \uBC84\uC804 \uACE0\uC815",
9913
10432
  "rule.DEP-002": "\uC54C\uB824\uC9C4 \uCDE8\uC57D\uC810(OSV)",
@@ -10035,8 +10554,19 @@ var jaT = {
10035
10554
  "rule.AGT-001": "\u30B9\u30AD\u30EB\u30D5\u30A1\u30A4\u30EB(SKILL.md)",
10036
10555
  "rule.AGT-002": "\u98DF\u3044\u9055\u3046\u898F\u7D04",
10037
10556
  "agt001.scope": "SKILL.md \u306E front matter \u3092\u78BA\u8A8D\u3057\u307E\u3059\u3002name \u3068 description \u304C\u3042\u308B\u304B\u3001name \u304C\u5C0F\u6587\u5B57\u3068\u30CF\u30A4\u30D5\u30F3(\u6700\u5927 64 \u6587\u5B57)\u3067\u30D5\u30A9\u30EB\u30C0\u30FC\u540D\u3068\u4E00\u81F4\u3059\u308B\u304B\u3001description \u304C 1024 \u6587\u5B57\u4EE5\u5185\u304B\u3001\u672C\u6587\u304C\u3042\u308B\u304B\u3092\u898B\u307E\u3059\u3002",
10038
- "agt002.scope": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u306B\u660E\u78BA\u306B\u66F8\u304B\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC(npm\u3001pnpm\u3001yarn\u3001bun)\u3068\u30A4\u30F3\u30C7\u30F3\u30C8(\u30B9\u30DA\u30FC\u30B9\u3001\u30BF\u30D6)\u306E\u30EB\u30FC\u30EB\u3092\u6BD4\u3079\u307E\u3059\u3002\u7D50\u679C\u306F\u78BA\u8A8D\u3059\u3079\u304D\u5019\u88DC\u3067\u3059\u3002",
10557
+ "agt002.scope": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u306B\u660E\u78BA\u306B\u66F8\u304B\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC(npm\u3001pnpm\u3001yarn\u3001bun)\u3001\u30A4\u30F3\u30C7\u30F3\u30C8(\u30B9\u30DA\u30FC\u30B9\u3001\u30BF\u30D6)\u3001Node.js \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30EB\u30FC\u30EB\u3092\u3001\u82F1\u8A9E\u30FB\u97D3\u56FD\u8A9E\u30FB\u65E5\u672C\u8A9E\u30FB\u4E2D\u56FD\u8A9E\u306E\u6587\u304B\u3089\u6BD4\u3079\u307E\u3059\u3002\u7D50\u679C\u306F\u78BA\u8A8D\u5019\u88DC\u3067\u3059\u3002",
10039
10558
  "agt.verify": "\u540C\u3058\u691C\u67FB\u3092\u518D\u5B9F\u884C\u3057\u3001{path}:{line} \u304C\u8868\u793A\u3055\u308C\u306A\u304F\u306A\u3063\u305F\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
10559
+ "rule.DOC-001": "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3068\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u4E0D\u4E00\u81F4",
10560
+ "doc001.scope": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3068 README \u306E\u30B3\u30DE\u30F3\u30C9\u30FB\u30D1\u30B9\u3092\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3068\u6BD4\u3079\u307E\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u3068\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u3001npm/pnpm/yarn \u306E\u30B9\u30AF\u30EA\u30D7\u30C8\u3068 package.json\u3001\u30B3\u30FC\u30C9\u8868\u8A18\u5185\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\u3068\u30D5\u30A1\u30A4\u30EB\u4E00\u89A7\u3001Docker \u30B3\u30DE\u30F3\u30C9\u3068 Dockerfile\u30FBcompose \u30D5\u30A1\u30A4\u30EB\u3002\u78BA\u5B9F\u306A\u5834\u5408\u3060\u3051\u5831\u544A\u3057\u3001\u4F8B\u3068\u6761\u4EF6\u6587\u306F\u98DB\u3070\u3057\u307E\u3059\u3002",
10561
+ "doc001.reason.none": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3082 README \u3082\u3042\u308A\u307E\u305B\u3093\u3002",
10562
+ "doc001.pm": "\u30B3\u30DE\u30F3\u30C9\u306F {used} \u3092\u4F7F\u3044\u307E\u3059\u304C\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u306F {expected} \u306E\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB({lockfile})\u3057\u304B\u3042\u308A\u307E\u305B\u3093\u3002",
10563
+ "doc001.pm.fix": "\u30B3\u30DE\u30F3\u30C9\u3092 {expected} \u7528\u306B\u76F4\u3059\u304B\u3001{used} \u306B\u79FB\u884C\u3057\u305F\u306A\u3089 {lockfile} \u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
10564
+ "doc001.script": '"{command}" \u306F\u30B9\u30AF\u30EA\u30D7\u30C8 "{script}" \u3092\u5B9F\u884C\u3057\u307E\u3059\u304C\u3001{manifest} \u306B\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u305B\u3093\u3002',
10565
+ "doc001.script.fix": '{manifest} \u306B "{script}" \u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u8FFD\u52A0\u3059\u308B\u304B\u3001\u30B3\u30DE\u30F3\u30C9\u3092\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002',
10566
+ "doc001.path": "{ref} \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u3042\u308A\u307E\u305B\u3093\u3002",
10567
+ "doc001.path.fix": "\u30D1\u30B9 {ref} \u3092\u76F4\u3059\u304B\u3001\u30D5\u30A1\u30A4\u30EB\u304C\u306A\u304F\u306A\u3063\u305F\u306A\u3089\u8A18\u8FF0\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
10568
+ "doc001.docker": '"{command}" \u306B\u306F {file} \u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u3042\u308A\u307E\u305B\u3093\u3002',
10569
+ "doc001.docker.fix": "{file} \u3092\u8FFD\u52A0\u3059\u308B\u304B\u3001Docker \u306E\u8AAC\u660E\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
10040
10570
  "agt001.reason.none": "SKILL.md \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
10041
10571
  "agt001.noFrontMatter": "{path} \u306B front matter \u304C\u3042\u308A\u307E\u305B\u3093\u3002",
10042
10572
  "agt001.noFrontMatter.fix": "{path} \u306E\u5148\u982D\u306B name \u3068 description \u3092\u542B\u3080 --- front matter \u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
@@ -10054,6 +10584,7 @@ var jaT = {
10054
10584
  "agt001.emptyBody.fix": "{path} \u306E\u672C\u6587\u306B\u30B9\u30AD\u30EB\u306E\u6307\u793A\u3092\u66F8\u3044\u3066\u304F\u3060\u3055\u3044\u3002",
10055
10585
  "agt002.package-manager": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3054\u3068\u306B\u7570\u306A\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u304C\u66F8\u304B\u308C\u3066\u3044\u307E\u3059: {values}\u3002",
10056
10586
  "agt002.indentation": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3054\u3068\u306B\u7570\u306A\u308B\u30A4\u30F3\u30C7\u30F3\u30C8\u304C\u6C42\u3081\u3089\u308C\u3066\u3044\u307E\u3059: {values}\u3002",
10587
+ "agt002.node-version": "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3054\u3068\u306B\u6C42\u3081\u308B Node.js \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u9055\u3044\u307E\u3059: {values}\u3002",
10057
10588
  "agt002.fix": "{topic} \u306E\u30EB\u30FC\u30EB\u3092 1 \u3064\u306B\u6C7A\u3081\u3001\u5171\u901A\u30D5\u30A1\u30A4\u30EB 1 \u304B\u6240\u3060\u3051\u306B\u6B8B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
10058
10589
  "rule.DEP-001": "\u4F9D\u5B58\u95A2\u4FC2\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u56FA\u5B9A",
10059
10590
  "rule.DEP-002": "\u65E2\u77E5\u306E\u8106\u5F31\u6027(OSV)",
@@ -10181,8 +10712,19 @@ var zhT = {
10181
10712
  "rule.AGT-001": "\u6280\u80FD\u6587\u4EF6\uFF08SKILL.md\uFF09",
10182
10713
  "rule.AGT-002": "\u4E92\u76F8\u77DB\u76FE\u7684\u7EA6\u5B9A",
10183
10714
  "agt001.scope": "\u68C0\u67E5 SKILL.md \u7684 front matter\uFF1A\u662F\u5426\u6709 name \u548C description\uFF0Cname \u662F\u5426\u4E3A\u5C0F\u5199\u52A0\u8FDE\u5B57\u7B26\uFF08\u6700\u591A 64 \u4E2A\u5B57\u7B26\uFF09\u5E76\u4E0E\u6587\u4EF6\u5939\u540C\u540D\uFF0Cdescription \u662F\u5426\u4E0D\u8D85\u8FC7 1024 \u4E2A\u5B57\u7B26\uFF0C\u6B63\u6587\u662F\u5426\u4E3A\u7A7A\u3002",
10184
- "agt002.scope": "\u6BD4\u8F83\u5404\u6307\u4EE4\u6587\u4EF6\u4E2D\u5199\u5F97\u660E\u786E\u7684\u5305\u7BA1\u7406\u5668\uFF08npm\u3001pnpm\u3001yarn\u3001bun\uFF09\u548C\u7F29\u8FDB\uFF08\u7A7A\u683C\u3001\u5236\u8868\u7B26\uFF09\u89C4\u5219\u3002\u7ED3\u679C\u662F\u9700\u8981\u590D\u6838\u7684\u5019\u9009\u9879\u3002",
10715
+ "agt002.scope": "\u6BD4\u8F83\u6307\u4EE4\u6587\u4EF6\u4E2D\u4EE5\u82F1\u8BED\u3001\u97E9\u8BED\u3001\u65E5\u8BED\u6216\u4E2D\u6587\u660E\u786E\u5199\u51FA\u7684\u5305\u7BA1\u7406\u5668\uFF08npm\u3001pnpm\u3001yarn\u3001bun\uFF09\u3001\u7F29\u8FDB\uFF08\u7A7A\u683C\u3001\u5236\u8868\u7B26\uFF09\u548C Node.js \u7248\u672C\u89C4\u5219\u3002\u7ED3\u679C\u662F\u5F85\u590D\u6838\u7684\u5019\u9009\u3002",
10185
10716
  "agt.verify": "\u518D\u6B21\u8FD0\u884C\u76F8\u540C\u7684\u68C0\u67E5\uFF0C\u786E\u8BA4 {path}:{line} \u4E0D\u518D\u51FA\u73B0\u3002",
10717
+ "rule.DOC-001": "\u6587\u6863\u4E0E\u9879\u76EE\u4E0D\u4E00\u81F4",
10718
+ "doc001.scope": "\u628A\u6307\u4EE4\u6587\u4EF6\u548C README \u4E2D\u7684\u547D\u4EE4\u4E0E\u8DEF\u5F84\u540C\u9879\u76EE\u6BD4\u5BF9\uFF1A\u5305\u7BA1\u7406\u5668\u4E0E\u9501\u6587\u4EF6\u3001npm/pnpm/yarn \u811A\u672C\u4E0E package.json\u3001\u4EE3\u7801\u6807\u8BB0\u4E2D\u7684\u6587\u4EF6\u8DEF\u5F84\u4E0E\u6587\u4EF6\u5217\u8868\u3001Docker \u547D\u4EE4\u4E0E Dockerfile \u548C compose \u6587\u4EF6\u3002\u53EA\u62A5\u544A\u786E\u5B9A\u7684\u60C5\u51B5\uFF0C\u8DF3\u8FC7\u793A\u4F8B\u548C\u6761\u4EF6\u53E5\u3002",
10719
+ "doc001.reason.none": "\u6CA1\u6709\u627E\u5230\u6307\u4EE4\u6587\u4EF6\u6216 README\u3002",
10720
+ "doc001.pm": "\u547D\u4EE4\u4F7F\u7528 {used}\uFF0C\u4F46\u9879\u76EE\u53EA\u6709 {expected} \u7684\u9501\u6587\u4EF6\uFF08{lockfile}\uFF09\u3002",
10721
+ "doc001.pm.fix": "\u628A\u547D\u4EE4\u6539\u6210 {expected} \u7684\u5199\u6CD5\uFF1B\u5982\u679C\u9879\u76EE\u5DF2\u6539\u7528 {used}\uFF0C\u8BF7\u5220\u9664 {lockfile}\u3002",
10722
+ "doc001.script": "\u201C{command}\u201D\u4F1A\u8FD0\u884C\u811A\u672C\u201C{script}\u201D\uFF0C\u4F46 {manifest} \u4E2D\u6CA1\u6709\u5B9A\u4E49\u5B83\u3002",
10723
+ "doc001.script.fix": "\u5728 {manifest} \u4E2D\u6DFB\u52A0\u201C{script}\u201D\u811A\u672C\uFF0C\u6216\u6539\u6B63\u547D\u4EE4\u3002",
10724
+ "doc001.path": "\u9879\u76EE\u4E2D\u6CA1\u6709 {ref}\u3002",
10725
+ "doc001.path.fix": "\u6539\u6B63\u8DEF\u5F84 {ref}\uFF1B\u5982\u679C\u6587\u4EF6\u5DF2\u5220\u9664\uFF0C\u8BF7\u53BB\u6389\u8FD9\u5904\u5F15\u7528\u3002",
10726
+ "doc001.docker": "\u201C{command}\u201D\u9700\u8981 {file}\uFF0C\u4F46\u9879\u76EE\u4E2D\u6CA1\u6709\u3002",
10727
+ "doc001.docker.fix": "\u6DFB\u52A0 {file}\uFF0C\u6216\u5220\u9664 Docker \u8BF4\u660E\u3002",
10186
10728
  "agt001.reason.none": "\u672A\u627E\u5230 SKILL.md \u6587\u4EF6\u3002",
10187
10729
  "agt001.noFrontMatter": "{path} \u6CA1\u6709 front matter\u3002",
10188
10730
  "agt001.noFrontMatter.fix": "\u5728 {path} \u5F00\u5934\u6DFB\u52A0\u5305\u542B name \u548C description \u7684 --- front matter\u3002",
@@ -10200,6 +10742,7 @@ var zhT = {
10200
10742
  "agt001.emptyBody.fix": "\u5728 {path} \u7684\u6B63\u6587\u4E2D\u5199\u51FA\u6280\u80FD\u7684\u6307\u4EE4\u3002",
10201
10743
  "agt002.package-manager": "\u5404\u6307\u4EE4\u6587\u4EF6\u5199\u4E86\u4E0D\u540C\u7684\u5305\u7BA1\u7406\u5668\uFF1A{values}\u3002",
10202
10744
  "agt002.indentation": "\u5404\u6307\u4EE4\u6587\u4EF6\u8981\u6C42\u7684\u7F29\u8FDB\u4E0D\u540C\uFF1A{values}\u3002",
10745
+ "agt002.node-version": "\u5404\u6307\u4EE4\u6587\u4EF6\u8981\u6C42\u7684 Node.js \u7248\u672C\u4E0D\u540C\uFF1A{values}\u3002",
10203
10746
  "agt002.fix": "\u786E\u5B9A\u4E00\u6761 {topic} \u89C4\u5219\uFF0C\u53EA\u5728\u4E00\u4E2A\u5171\u4EAB\u6587\u4EF6\u4E2D\u4FDD\u7559\uFF0C\u5220\u9664\u5176\u4ED6\u5199\u6CD5\u3002",
10204
10747
  "rule.DEP-001": "\u4F9D\u8D56\u7248\u672C\u56FA\u5B9A",
10205
10748
  "rule.DEP-002": "\u5DF2\u77E5\u6F0F\u6D1E\uFF08OSV\uFF09",
@@ -10715,7 +11258,10 @@ function renderAiSection(report, locale) {
10715
11258
  out.push(`${i + 1}. ${code(f.path)} \xB7 ${via} \xB7 ${num(f.tokens)}${f.truncated ? " \u26A0" : ""}`);
10716
11259
  });
10717
11260
  out.push("", `- ${t(locale, "report.ai.total")}: ${num(ctx.totalTokens)}`);
10718
- if (ctx.conditional.length > 0) out.push(`- ${t(locale, "report.ai.conditional")}: ${ctx.conditional.map(code).join(", ")}`);
11261
+ if (ctx.conditionalLoads.length > 0) {
11262
+ const items = ctx.conditionalLoads.map((c) => `${code(c.path)} (${t(locale, `report.ai.load.${c.load}`)}${c.condition ? ` ${code(c.condition)}` : ""})`);
11263
+ out.push(`- ${t(locale, "report.ai.conditional")}: ${items.join(", ")}`);
11264
+ }
10719
11265
  for (const n of ctx.notes) out.push(`- ${t(locale, n)}`);
10720
11266
  out.push("");
10721
11267
  }
@@ -10857,7 +11403,7 @@ var TOOLS = [
10857
11403
  { id: "secrets", status: "live", rules: ["SEC-001", "SEC-002"], milestone: "M3", category: "security" },
10858
11404
  { id: "dependencies", status: "live", rules: ["DEP-001", "DEP-002"], milestone: "M3 (OSV with consent)", category: "security" },
10859
11405
  { id: "mcp", status: "live", rules: ["MCP-001", "MCP-002"], milestone: "M3", category: "ai-context" },
10860
- { id: "agent-rules", status: "live", rules: ["AI-001", "AI-004", "AGT-001", "AGT-002"], milestone: "P1", category: "ai-context" },
11406
+ { id: "agent-rules", status: "live", rules: ["AI-001", "AI-004", "AGT-001", "AGT-002", "DOC-001"], milestone: "P1", category: "ai-context" },
10861
11407
  { id: "duplicates", status: "live", rules: ["DUP-001"], milestone: "P1", category: "code-quality" },
10862
11408
  { id: "architecture", status: "live", rules: ["ARC-001", "ARC-002"], milestone: "P1", category: "architecture" },
10863
11409
  { id: "deploy", status: "live", rules: ["OPS-001", "OPS-002", "OPS-003"], milestone: "P1", category: "deploy" }
@@ -10909,6 +11455,187 @@ function allToolsSummary(report, tools) {
10909
11455
  };
10910
11456
  }
10911
11457
 
11458
+ // ../core/src/ai/preservation.ts
11459
+ var MANDATORY_RE = /\b(must|never|always|required|do not|don't|shall not)\b|반드시|절대|금지|필수|하지 ?마|必ず|禁止|してはいけない|しないで|必须|不要|不得|务必/i;
11460
+ var TAG_RE = {
11461
+ security: /\b(secret|token|api key|password|credential|security)\w*|보안|비밀|토큰|秘密|セキュリティ|密钥|安全/i,
11462
+ deploy: /\b(deploy|release|approv|publish)\w*|배포|승인|릴리스|デプロイ|承認|リリース|部署|批准|发布/i,
11463
+ test: /\b(test|spec|coverage)\w*|테스트|커버리지|テスト|カバレッジ|测试|覆盖率/i,
11464
+ database: /\b(database|migration|schema|sql|db)\b|데이터베이스|마이그레이션|データベース|マイグレーション|数据库|迁移/i,
11465
+ delete: /\b(delet|remov|drop|rm -rf|truncat)\w*|삭제|削除|删除/i
11466
+ };
11467
+ var NEGATION_RE = /\b(not|never|no|without|don't|doesn't|won't|cannot|can't)\b|않|말고|말 것|금지|없이|ない|禁止|ず[、。]|不|别|勿|没有|禁止/gi;
11468
+ var unify = (s) => s.replace(/\r\n?/g, "\n").trim();
11469
+ function normalizeRule(s) {
11470
+ return unify(s).replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "").replace(/(\*\*|__|\*)(?=\S)([^*_]*?\S)\1/g, "$2").replace(/[“”„]/g, '"').replace(/[‘’]/g, "'").replace(/\s+/g, " ").replace(/[.。!!;;]+$/, "").trim();
11471
+ }
11472
+ function fixedTokens(s) {
11473
+ const out = [];
11474
+ for (const m of s.matchAll(/`([^`]+)`/g)) out.push(`code:${m[1]}`);
11475
+ const plain = s.replace(/`[^`]+`/g, " ");
11476
+ for (const m of plain.matchAll(/\d+(?:[.,]\d+)?%?/g)) out.push(`num:${m[0]}`);
11477
+ for (const m of plain.matchAll(/(?:\.{0,2}\/)?[\w.-]+\/[\w./-]+|\b[\w-]+\.(?:md|json|ya?ml|toml|ts|js|py|sh|env|lock)\b/g)) out.push(`path:${m[0]}`);
11478
+ for (const m of plain.matchAll(NEGATION_RE)) out.push(`neg:${m[0].toLowerCase()}`);
11479
+ return out.sort();
11480
+ }
11481
+ var sameFixed = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
11482
+ function words(s) {
11483
+ const out = /* @__PURE__ */ new Set();
11484
+ const lower = s.toLowerCase();
11485
+ for (const m of lower.matchAll(/[a-z0-9_]+/g)) out.add(m[0]);
11486
+ const cjk = lower.replace(/[^\p{Script=Hangul}\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]+/gu, " ");
11487
+ for (const part of cjk.split(" ")) for (let i = 0; i + 1 < part.length; i++) out.add(part.slice(i, i + 2));
11488
+ return out;
11489
+ }
11490
+ function overlap(a, b) {
11491
+ if (a.size === 0 || b.size === 0) return 0;
11492
+ let both = 0;
11493
+ for (const w of a) if (b.has(w)) both++;
11494
+ return both / Math.min(a.size, b.size);
11495
+ }
11496
+ function extractRuleUnits(doc) {
11497
+ const units = [];
11498
+ const tree = parseTree(doc.text);
11499
+ const headings = [];
11500
+ const slice = (n) => n.position && n.position.start.offset !== void 0 && n.position.end.offset !== void 0 ? doc.text.slice(n.position.start.offset, n.position.end.offset) : "";
11501
+ const add = (raw, line) => {
11502
+ const exact = unify(raw);
11503
+ if (!exact) return;
11504
+ units.push({
11505
+ path: doc.path,
11506
+ line,
11507
+ headings: [...headings],
11508
+ preview: truncate(maskSecrets(exact.replace(/\s+/g, " "))),
11509
+ exact,
11510
+ normalized: normalizeRule(exact),
11511
+ fixed: fixedTokens(exact),
11512
+ mandatory: MANDATORY_RE.test(exact),
11513
+ tags: Object.keys(TAG_RE).filter((t2) => TAG_RE[t2].test(exact))
11514
+ });
11515
+ };
11516
+ const visit = (node2) => {
11517
+ const line = node2.position?.start.line ?? 1;
11518
+ if (node2.type === "heading") {
11519
+ const depth = node2.depth ?? 1;
11520
+ headings.length = Math.min(headings.length, depth - 1);
11521
+ while (headings.length < depth - 1) headings.push("");
11522
+ headings.push(unify(slice(node2)).replace(/^#+\s*/, ""));
11523
+ return;
11524
+ }
11525
+ if (node2.type === "paragraph") {
11526
+ const lines = slice(node2).split(/\r?\n/);
11527
+ if (lines.length > 1 && lines.every((l) => l.trim().startsWith("|"))) {
11528
+ lines.forEach((l, i) => {
11529
+ if (!/^\s*\|?[\s:|-]+\|?\s*$/.test(l)) add(l, line + i);
11530
+ });
11531
+ return;
11532
+ }
11533
+ return add(lines.join("\n"), line);
11534
+ }
11535
+ if (node2.type === "tableRow") return add(slice(node2), line);
11536
+ if (node2.type === "code" || node2.type === "html" || node2.type === "thematicBreak" || node2.type === "yaml") return;
11537
+ for (const child of node2.children ?? []) visit(child);
11538
+ };
11539
+ visit(tree);
11540
+ return units;
11541
+ }
11542
+ var severity = (i) => (i.mandatory ? 2 : 0) + (i.tags.length > 0 ? 1 : 0);
11543
+ function comparePreservation(platform, workdir, before, after) {
11544
+ const scopeOf = (docs) => activeContext(platform, workdir, docs);
11545
+ const beforeCtx = scopeOf(before.docs);
11546
+ const afterCtx = scopeOf(after.docs);
11547
+ const beforeScope = new Set(beforeCtx.files.map((f) => f.path));
11548
+ const afterScope = new Set(afterCtx.files.map((f) => f.path));
11549
+ const unitsOf = (texts) => texts.flatMap((t2) => extractRuleUnits(t2));
11550
+ const beforeUnits = unitsOf(before.texts.filter((t2) => beforeScope.has(t2.path)));
11551
+ const afterAll = unitsOf(after.texts);
11552
+ const afterIn = afterAll.filter((u) => afterScope.has(u.path));
11553
+ const unknownReasons = [];
11554
+ if (before.partial || after.partial) unknownReasons.push("partial");
11555
+ if (beforeCtx.files.some((f) => f.tokens === null) || afterCtx.files.some((f) => f.tokens === null)) unknownReasons.push("unread");
11556
+ const loc2 = (u) => ({ path: u.path, line: u.line, preview: u.preview });
11557
+ const items = [];
11558
+ let kept = 0;
11559
+ let review = 0;
11560
+ let fixedChanged = 0;
11561
+ let missing = 0;
11562
+ let scopeReduced = 0;
11563
+ const wordCache = /* @__PURE__ */ new Map();
11564
+ const wordsOf = (u) => wordCache.get(u) ?? (wordCache.set(u, words(u.normalized)), wordCache.get(u));
11565
+ const match = (u, pool) => {
11566
+ const exact = pool.find((a) => a.exact === u.exact);
11567
+ if (exact) return { grade: "exact", at: exact, reason: null };
11568
+ const norm = pool.find((a) => a.normalized === u.normalized);
11569
+ if (norm) return { grade: "normalized", at: norm, reason: null };
11570
+ const inside = pool.find((a) => a.normalized.includes(u.normalized));
11571
+ if (inside && u.normalized.length >= 8) return { grade: "structural", at: inside, reason: null };
11572
+ const sentences = u.normalized.split(/(?<=[.!?。!?])\s*/).map((s) => normalizeRule(s)).filter((s) => s.length >= 4);
11573
+ if (sentences.length > 1) {
11574
+ const homes = sentences.map((s) => pool.find((a) => a.normalized.includes(s)));
11575
+ if (homes.every(Boolean)) return { grade: "structural", at: homes[0], reason: null };
11576
+ }
11577
+ let best = null;
11578
+ let score = 0;
11579
+ for (const a of pool) {
11580
+ const o = overlap(wordsOf(u), wordsOf(a));
11581
+ if (o > score) [best, score] = [a, o];
11582
+ }
11583
+ if (best && score >= 0.5) return { grade: "review", at: best, reason: sameFixed(u.fixed, best.fixed) ? "reworded" : "fixedChanged" };
11584
+ return { grade: "missing", at: null, reason: null };
11585
+ };
11586
+ const claimed = /* @__PURE__ */ new Set();
11587
+ for (const u of beforeUnits) {
11588
+ const inScope = match(u, afterIn);
11589
+ if (inScope.at) claimed.add(inScope.at);
11590
+ const keptGrade = inScope.grade === "exact" || inScope.grade === "normalized" || inScope.grade === "structural";
11591
+ if (keptGrade) {
11592
+ kept++;
11593
+ continue;
11594
+ }
11595
+ const anywhere = match(u, afterAll);
11596
+ const base2 = { before: loc2(u), mandatory: u.mandatory, tags: u.tags };
11597
+ if (anywhere.grade === "exact" || anywhere.grade === "normalized" || anywhere.grade === "structural") {
11598
+ scopeReduced++;
11599
+ items.push({ ...base2, grade: "scope", reason: "outOfScope", after: anywhere.at ? loc2(anywhere.at) : null });
11600
+ } else if (inScope.grade === "review") {
11601
+ review++;
11602
+ if (inScope.reason === "fixedChanged") fixedChanged++;
11603
+ items.push({ ...base2, grade: "review", reason: inScope.reason, after: inScope.at ? loc2(inScope.at) : null });
11604
+ } else {
11605
+ missing++;
11606
+ items.push({ ...base2, grade: "missing", reason: null, after: null });
11607
+ }
11608
+ }
11609
+ const count = (units) => units.reduce((m, u) => m.set(u.normalized, (m.get(u.normalized) ?? 0) + 1), /* @__PURE__ */ new Map());
11610
+ const nb = count(beforeUnits);
11611
+ const na = count(afterIn);
11612
+ let removedDuplicates = 0;
11613
+ for (const [n, c] of nb) {
11614
+ const a = na.get(n) ?? 0;
11615
+ if (c > 1 && a >= 1 && a < c) removedDuplicates += c - a;
11616
+ }
11617
+ const beforeNorms = new Set(beforeUnits.map((u) => u.normalized));
11618
+ const added = afterIn.filter((a) => !claimed.has(a) && !beforeNorms.has(a.normalized) && !beforeUnits.some((u) => a.normalized.includes(u.normalized) || u.normalized.includes(a.normalized))).length;
11619
+ items.sort((a, b) => severity(b) - severity(a) || (a.before.path < b.before.path ? -1 : a.before.path > b.before.path ? 1 : a.before.line - b.before.line));
11620
+ const verdict = unknownReasons.length > 0 ? "unknown" : missing + scopeReduced + fixedChanged > 0 || review > 0 ? "review" : "clean";
11621
+ return {
11622
+ platform,
11623
+ workdir,
11624
+ units: beforeUnits.length,
11625
+ mandatory: beforeUnits.filter((u) => u.mandatory).length,
11626
+ kept,
11627
+ review,
11628
+ fixedChanged,
11629
+ missing,
11630
+ scopeReduced,
11631
+ removedDuplicates,
11632
+ added,
11633
+ verdict,
11634
+ unknownReasons,
11635
+ items
11636
+ };
11637
+ }
11638
+
10912
11639
  // ../ui/share.ts
10913
11640
  function badgeMessage(d) {
10914
11641
  if (!d.evaluated) return "not checked";
@@ -10932,14 +11659,14 @@ function badgeSvg(label, message, color) {
10932
11659
 
10933
11660
  // src/run.ts
10934
11661
  import { lstatSync, readdirSync, readFileSync } from "node:fs";
10935
- import { basename, join as join2, resolve } from "node:path";
11662
+ import { basename, join as join3, resolve } from "node:path";
10936
11663
  var SKIP_DIRS = /* @__PURE__ */ new Set([".git", ".hg", ".svn", "node_modules", ".pnpm-store", ".yarn", ".next", ".nuxt", ".turbo", ".cache", ".venv", "venv", "__pycache__", "target", ".gradle"]);
10937
11664
  function listFolder(root, opts) {
10938
11665
  const abs = resolve(root);
10939
11666
  const top = basename(abs) || "project";
10940
11667
  const read = (name) => {
10941
11668
  try {
10942
- return readFileSync(join2(abs, name), "utf8");
11669
+ return readFileSync(join3(abs, name), "utf8");
10943
11670
  } catch {
10944
11671
  return "";
10945
11672
  }
@@ -10959,7 +11686,7 @@ function listFolder(root, opts) {
10959
11686
  out.truncated = true;
10960
11687
  return;
10961
11688
  }
10962
- const full = join2(dir, name);
11689
+ const full = join3(dir, name);
10963
11690
  const path = rel ? `${rel}/${name}` : name;
10964
11691
  let st;
10965
11692
  try {
@@ -11010,14 +11737,23 @@ async function runFolder(root, o) {
11010
11737
  adapter.listComplete = false;
11011
11738
  adapter.listingReasons.push({ code: "file-count-limit", params: { limit: limits.maxDiscoveredFiles } });
11012
11739
  }
11013
- const full = await runScan(adapter, { scanId: "cli", profile: "desktop", limits, signal: o.signal, onProgress: o.onProgress, now: o.now });
11740
+ let instructionTexts = [];
11741
+ const full = await runScan(adapter, {
11742
+ scanId: "cli",
11743
+ profile: "desktop",
11744
+ limits,
11745
+ signal: o.signal,
11746
+ onProgress: o.onProgress,
11747
+ now: o.now,
11748
+ onInstructionTexts: (texts) => instructionTexts = texts
11749
+ });
11014
11750
  const report = filterReport(full, tool2);
11015
11751
  const s = allToolsSummary(report, TOOLS.filter((t2) => t2.status === "live"));
11016
11752
  const findings = report.rules.flatMap((r) => r.findings);
11017
11753
  const bySeverity = { high: 0, medium: 0, low: 0, info: 0, unknown: 0 };
11018
11754
  for (const f of findings) bySeverity[f.severity]++;
11019
11755
  const { entries, ...rest } = listing;
11020
- return { report, tool: tool2, findings, evaluated: s.rulesEvaluated, passed: s.rulesPassed, bySeverity, listing: { ...rest, listed: entries.length }, elapsedMs: Date.now() - started };
11756
+ return { report, tool: tool2, findings, evaluated: s.rulesEvaluated, passed: s.rulesPassed, bySeverity, listing: { ...rest, listed: entries.length }, elapsedMs: Date.now() - started, instructionTexts };
11021
11757
  }
11022
11758
  var RANK = { high: 3, medium: 2, low: 1 };
11023
11759
  function shouldFail(r, failOn) {
@@ -11027,7 +11763,7 @@ function shouldFail(r, failOn) {
11027
11763
  }
11028
11764
 
11029
11765
  // src/version.ts
11030
- var VERSION = "0.3.1";
11766
+ var VERSION = "0.4.0";
11031
11767
 
11032
11768
  // src/mcp.ts
11033
11769
  import { createInterface } from "node:readline";
@@ -11035,7 +11771,7 @@ import { statSync } from "node:fs";
11035
11771
  import { resolve as resolve2 } from "node:path";
11036
11772
 
11037
11773
  // ../ui/rule-docs.ts
11038
- var RULE_ORDER = ["MD-001", "MD-003", "MD-002", "AI-001", "AI-002", "AI-003", "AI-004", "SEC-001", "SEC-002", "DEP-001", "DEP-002", "MCP-001", "MCP-002", "AGT-001", "AGT-002", "DUP-001", "ARC-001", "ARC-002", "OPS-001", "OPS-002", "OPS-003"];
11774
+ var RULE_ORDER = ["MD-001", "MD-003", "MD-002", "AI-001", "AI-002", "AI-003", "AI-004", "SEC-001", "SEC-002", "DEP-001", "DEP-002", "MCP-001", "MCP-002", "AGT-001", "AGT-002", "DOC-001", "DUP-001", "ARC-001", "ARC-002", "OPS-001", "OPS-002", "OPS-003"];
11039
11775
  var ruleDocs = {
11040
11776
  en: {
11041
11777
  "MD-001": { why: "Skipped heading levels (an h1 followed by an h3) break the outline that readers, screen readers and AI tools use to navigate a document.", fix: "Lower the heading by one level at a time, or add the missing parent heading." },
@@ -11053,6 +11789,7 @@ var ruleDocs = {
11053
11789
  "MCP-002": { why: "MCP servers run with your permissions. Inline tokens, downloads piped into a shell, unpinned packages and plain HTTP endpoints widen what can go wrong.", fix: "Reference secrets through environment variables, pin package versions, use HTTPS and avoid piping downloads into a shell." },
11054
11790
  "AGT-001": { why: "Agent Skills are found by their front matter. A missing name or description, or a name that does not match the folder, makes the skill hard to find or unused.", fix: "Add name and description in the front matter, use lowercase words joined by hyphens, and match the folder name." },
11055
11791
  "AGT-002": { why: "When two instruction files ask for different package managers or indentation, the assistant has to guess which one wins.", fix: "Choose one convention, state it in one shared file and remove the conflicting line." },
11792
+ "DOC-001": { why: "An assistant follows the commands and paths in its instruction files. A wrong package manager, a missing script or a stale path makes it run the wrong thing or look for files that are gone.", fix: "Update the instruction or README line to match the project, or restore what it points to." },
11056
11793
  "DUP-001": { why: "Copied blocks of code have to be fixed in every copy; missing one is a common source of bugs.", fix: "Move the shared lines into a function or module and call it from each place." },
11057
11794
  "ARC-001": { why: "Modules that import each other in a loop can load half-initialised values and make the code hard to split or test.", fix: "Move the shared part into a separate module both can import, or reverse one of the imports." },
11058
11795
  "ARC-002": { why: "A relative import that matches no file fails at build or run time, often only on a clean checkout.", fix: "Correct the path or add the missing file. Files generated during the build can be ignored." },
@@ -11076,6 +11813,7 @@ var ruleDocs = {
11076
11813
  "MCP-002": { why: "MCP \uC11C\uBC84\uB294 \uB0B4 \uAD8C\uD55C\uC73C\uB85C \uC2E4\uD589\uB3FC\uC694. \uC124\uC815\uC5D0 \uC9C1\uC811 \uB123\uC740 \uD1A0\uD070, \uC178\uB85C \uBC14\uB85C \uC2E4\uD589\uD558\uB294 \uB2E4\uC6B4\uB85C\uB4DC, \uBC84\uC804 \uBBF8\uACE0\uC815 \uD328\uD0A4\uC9C0, HTTP \uC8FC\uC18C\uB294 \uC704\uD5D8\uC744 \uD0A4\uC6CC\uC694.", fix: "\uBE44\uBC00\uAC12\uC740 \uD658\uACBD \uBCC0\uC218\uB85C \uCC38\uC870\uD558\uACE0, \uD328\uD0A4\uC9C0 \uBC84\uC804\uC744 \uACE0\uC815\uD558\uACE0, HTTPS\uB97C \uC4F0\uACE0, \uB2E4\uC6B4\uB85C\uB4DC\uB97C \uC178\uB85C \uBC14\uB85C \uB118\uAE30\uC9C0 \uB9C8\uC138\uC694." },
11077
11814
  "AGT-001": { why: "Agent Skills\uB294 front matter\uB85C \uCC3E\uC544\uC694. name\xB7description\uC774 \uC5C6\uAC70\uB098 \uC774\uB984\uC774 \uD3F4\uB354\uC640 \uB2E4\uB974\uBA74 \uC2A4\uD0AC\uC744 \uCC3E\uAE30 \uC5B4\uB835\uAC70\uB098 \uC4F0\uC774\uC9C0 \uC54A\uC544\uC694.", fix: "front matter\uC5D0 name\uACFC description\uC744 \uB123\uACE0, \uC774\uB984\uC740 \uC18C\uBB38\uC790\uC640 \uD558\uC774\uD508\uC73C\uB85C, \uD3F4\uB354 \uC774\uB984\uACFC \uAC19\uAC8C \uD558\uC138\uC694." },
11078
11815
  "AGT-002": { why: "\uB450 \uC9C0\uC2DC \uD30C\uC77C\uC774 \uC11C\uB85C \uB2E4\uB978 \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790\uB098 \uB4E4\uC5EC\uC4F0\uAE30\uB97C \uC694\uAD6C\uD558\uBA74 \uB3C4\uC6B0\uBBF8\uAC00 \uC5B4\uB290 \uCABD\uC744 \uB530\uB97C\uC9C0 \uCD94\uCE21\uD574\uC57C \uD574\uC694.", fix: "\uADDC\uCE59 \uD558\uB098\uB97C \uC815\uD574 \uACF5\uD1B5 \uD30C\uC77C \uD55C\uACF3\uC5D0 \uC801\uACE0, \uC5B4\uAE0B\uB098\uB294 \uC904\uC740 \uC9C0\uC6B0\uC138\uC694." },
11816
+ "DOC-001": { why: "\uB3C4\uC6B0\uBBF8\uB294 \uC9C0\uC2DC \uD30C\uC77C\uC5D0 \uC801\uD78C \uBA85\uB839\uACFC \uACBD\uB85C\uB97C \uADF8\uB300\uB85C \uB530\uB985\uB2C8\uB2E4. \uD328\uD0A4\uC9C0 \uAD00\uB9AC\uC790\uAC00 \uB2E4\uB974\uAC70\uB098, \uC2A4\uD06C\uB9BD\uD2B8\uAC00 \uC5C6\uAC70\uB098, \uACBD\uB85C\uAC00 \uB0A1\uC558\uC73C\uBA74 \uC798\uBABB\uB41C \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uAC70\uB098 \uC5C6\uB294 \uD30C\uC77C\uC744 \uCC3E\uC544\uC694.", fix: "\uC9C0\uC2DC \uD30C\uC77C\uC774\uB098 README\uC758 \uADF8 \uC904\uC744 \uD504\uB85C\uC81D\uD2B8\uC5D0 \uB9DE\uAC8C \uACE0\uCE58\uAC70\uB098, \uAC00\uB9AC\uD0A4\uB294 \uB300\uC0C1\uC744 \uB418\uC0B4\uB9AC\uC138\uC694." },
11079
11817
  "DUP-001": { why: "\uBCF5\uC0AC\uB41C \uCF54\uB4DC\uB294 \uACE0\uCE60 \uB54C \uBAA8\uB4E0 \uC0AC\uBCF8\uC744 \uACE0\uCCD0\uC57C \uD574\uC694. \uD558\uB098\uB77C\uB3C4 \uB193\uCE58\uBA74 \uBC84\uADF8\uAC00 \uC0DD\uAE30\uAE30 \uC26C\uC6CC\uC694.", fix: "\uACF5\uD1B5 \uC904\uC744 \uD568\uC218\uB098 \uBAA8\uB4C8\uB85C \uC62E\uAE30\uACE0 \uAC01 \uC704\uCE58\uC5D0\uC11C \uBD88\uB7EC \uC4F0\uC138\uC694." },
11080
11818
  "ARC-001": { why: "\uC11C\uB85C\uB97C \uBD88\uB7EC\uC624\uB294 \uBAA8\uB4C8\uC740 \uCD08\uAE30\uD654\uAC00 \uB35C \uB41C \uAC12\uC744 \uC77D\uC744 \uC218 \uC788\uACE0, \uCF54\uB4DC\uB97C \uB098\uB204\uAC70\uB098 \uD14C\uC2A4\uD2B8\uD558\uAE30 \uC5B4\uB824\uC6CC\uC838\uC694.", fix: "\uACF5\uD1B5 \uBD80\uBD84\uC744 \uB458 \uB2E4 \uBD88\uB7EC\uC62C \uC218 \uC788\uB294 \uBCC4\uB3C4 \uBAA8\uB4C8\uB85C \uC62E\uAE30\uAC70\uB098, import \uD558\uB098\uC758 \uBC29\uD5A5\uC744 \uBC14\uAFB8\uC138\uC694." },
11081
11819
  "ARC-002": { why: "\uC5B4\uB5A4 \uD30C\uC77C\uACFC\uB3C4 \uB9DE\uC9C0 \uC54A\uB294 \uC0C1\uB300 \uACBD\uB85C import\uB294 \uBE4C\uB4DC\uB098 \uC2E4\uD589 \uB54C \uC2E4\uD328\uD558\uACE0, \uAE68\uB057\uD55C \uD658\uACBD\uC5D0\uC11C\uC57C \uB4DC\uB7EC\uB098\uB294 \uACBD\uC6B0\uAC00 \uB9CE\uC544\uC694.", fix: "\uACBD\uB85C\uB97C \uACE0\uCE58\uAC70\uB098 \uBE60\uC9C4 \uD30C\uC77C\uC744 \uCD94\uAC00\uD558\uC138\uC694. \uBE4C\uB4DC \uC911 \uC0DD\uC131\uB418\uB294 \uD30C\uC77C\uC774\uB77C\uBA74 \uBB34\uC2DC\uD574\uB3C4 \uB3FC\uC694." },
@@ -11099,6 +11837,7 @@ var ruleDocs = {
11099
11837
  "MCP-002": { why: "MCP \u30B5\u30FC\u30D0\u30FC\u306F\u3042\u306A\u305F\u306E\u6A29\u9650\u3067\u52D5\u304D\u307E\u3059\u3002\u8A2D\u5B9A\u306B\u76F4\u66F8\u304D\u3057\u305F\u30C8\u30FC\u30AF\u30F3\u3001\u30B7\u30A7\u30EB\u306B\u76F4\u63A5\u6E21\u3059\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3001\u30D0\u30FC\u30B8\u30E7\u30F3\u672A\u56FA\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001HTTP \u306E\u63A5\u7D9A\u5148\u306F\u30EA\u30B9\u30AF\u3092\u5E83\u3052\u307E\u3059\u3002", fix: "\u79D8\u5BC6\u306E\u5024\u306F\u74B0\u5883\u5909\u6570\u3067\u53C2\u7167\u3057\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u56FA\u5B9A\u3057\u3001HTTPS \u3092\u4F7F\u3044\u3001\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3092\u30B7\u30A7\u30EB\u306B\u76F4\u63A5\u6E21\u3055\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002" },
11100
11838
  "AGT-001": { why: "Agent Skills \u306F front matter \u3067\u898B\u3064\u3051\u3089\u308C\u307E\u3059\u3002name \u3084 description \u304C\u306A\u3044\u3001\u307E\u305F\u306F\u540D\u524D\u304C\u30D5\u30A9\u30EB\u30C0\u30FC\u3068\u9055\u3046\u3068\u3001\u30B9\u30AD\u30EB\u304C\u898B\u3064\u3051\u306B\u304F\u304F\u306A\u308A\u4F7F\u308F\u308C\u307E\u305B\u3093\u3002", fix: "front matter \u306B name \u3068 description \u3092\u5165\u308C\u3001\u540D\u524D\u306F\u5C0F\u6587\u5B57\u3068\u30CF\u30A4\u30D5\u30F3\u306B\u3057\u3066\u30D5\u30A9\u30EB\u30C0\u30FC\u540D\u3068\u5408\u308F\u305B\u3066\u304F\u3060\u3055\u3044\u3002" },
11101
11839
  "AGT-002": { why: "2 \u3064\u306E\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u304C\u5225\u3005\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u3084\u30A4\u30F3\u30C7\u30F3\u30C8\u3092\u6C42\u3081\u308B\u3068\u3001\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u306F\u3069\u3061\u3089\u306B\u5F93\u3046\u304B\u63A8\u6E2C\u3059\u308B\u3057\u304B\u3042\u308A\u307E\u305B\u3093\u3002", fix: "\u30EB\u30FC\u30EB\u3092 1 \u3064\u306B\u6C7A\u3081\u3066\u5171\u901A\u30D5\u30A1\u30A4\u30EB 1 \u304B\u6240\u306B\u66F8\u304D\u3001\u98DF\u3044\u9055\u3046\u884C\u306F\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002" },
11840
+ "DOC-001": { why: "\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u306F\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u306E\u30B3\u30DE\u30F3\u30C9\u3068\u30D1\u30B9\u306B\u305D\u306E\u307E\u307E\u5F93\u3044\u307E\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u306E\u9055\u3044\u3001\u5B58\u5728\u3057\u306A\u3044\u30B9\u30AF\u30EA\u30D7\u30C8\u3001\u53E4\u3044\u30D1\u30B9\u304C\u3042\u308B\u3068\u3001\u8AA4\u3063\u305F\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u305F\u308A\u3001\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3057\u305F\u308A\u3057\u307E\u3059\u3002", fix: "\u6307\u793A\u30D5\u30A1\u30A4\u30EB\u3084 README \u306E\u8A72\u5F53\u884C\u3092\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u5408\u308F\u305B\u3066\u76F4\u3059\u304B\u3001\u53C2\u7167\u5148\u3092\u623B\u3057\u3066\u304F\u3060\u3055\u3044\u3002" },
11102
11841
  "DUP-001": { why: "\u30B3\u30D4\u30FC\u3055\u308C\u305F\u30B3\u30FC\u30C9\u306F\u3001\u76F4\u3059\u3068\u304D\u306B\u3059\u3079\u3066\u306E\u30B3\u30D4\u30FC\u3092\u76F4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u30021 \u3064\u3067\u3082\u6F0F\u308C\u308B\u3068\u30D0\u30B0\u306E\u539F\u56E0\u306B\u306A\u308A\u307E\u3059\u3002", fix: "\u5171\u901A\u306E\u884C\u3092\u95A2\u6570\u304B\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u307E\u3068\u3081\u3001\u5404\u7B87\u6240\u304B\u3089\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002" },
11103
11842
  "ARC-001": { why: "\u4E92\u3044\u3092\u8AAD\u307F\u8FBC\u3080\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u521D\u671F\u5316\u9014\u4E2D\u306E\u5024\u3092\u8AAD\u3080\u3053\u3068\u304C\u3042\u308A\u3001\u30B3\u30FC\u30C9\u306E\u5206\u5272\u3084\u30C6\u30B9\u30C8\u3082\u96E3\u3057\u304F\u306A\u308A\u307E\u3059\u3002", fix: "\u5171\u901A\u90E8\u5206\u3092\u4E21\u65B9\u304C\u8AAD\u307F\u8FBC\u3081\u308B\u5225\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u79FB\u3059\u304B\u3001import \u306E\u5411\u304D\u3092 1 \u3064\u5909\u3048\u3066\u304F\u3060\u3055\u3044\u3002" },
11104
11843
  "ARC-002": { why: "\u3069\u306E\u30D5\u30A1\u30A4\u30EB\u306B\u3082\u4E00\u81F4\u3057\u306A\u3044\u76F8\u5BFE\u30D1\u30B9\u306E import \u306F\u30D3\u30EB\u30C9\u3084\u5B9F\u884C\u6642\u306B\u5931\u6557\u3057\u3001\u30AF\u30EA\u30FC\u30F3\u306A\u74B0\u5883\u3067\u521D\u3081\u3066\u8868\u306B\u51FA\u308B\u3053\u3068\u304C\u591A\u3044\u3067\u3059\u3002", fix: "\u30D1\u30B9\u3092\u76F4\u3059\u304B\u3001\u8DB3\u308A\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D3\u30EB\u30C9\u4E2D\u306B\u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u306A\u3089\u7121\u8996\u3057\u3066\u304B\u307E\u3044\u307E\u305B\u3093\u3002" },
@@ -11122,6 +11861,7 @@ var ruleDocs = {
11122
11861
  "MCP-002": { why: "MCP \u670D\u52A1\u5668\u4EE5\u4F60\u7684\u6743\u9650\u8FD0\u884C\u3002\u914D\u7F6E\u4E2D\u76F4\u63A5\u5199\u5165\u7684\u4EE4\u724C\u3001\u76F4\u63A5\u4EA4\u7ED9 shell \u6267\u884C\u7684\u4E0B\u8F7D\u3001\u672A\u56FA\u5B9A\u7248\u672C\u7684\u5305\u4EE5\u53CA HTTP \u5730\u5740\u90FD\u4F1A\u6269\u5927\u98CE\u9669\u3002", fix: "\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u5F15\u7528\u673A\u5BC6\uFF0C\u56FA\u5B9A\u5305\u7248\u672C\uFF0C\u4F7F\u7528 HTTPS\uFF0C\u4E0D\u8981\u628A\u4E0B\u8F7D\u5185\u5BB9\u76F4\u63A5\u4EA4\u7ED9 shell\u3002" },
11123
11862
  "AGT-001": { why: "Agent Skills \u901A\u8FC7 front matter \u88AB\u53D1\u73B0\u3002\u7F3A\u5C11 name \u6216 description\uFF0C\u6216\u540D\u79F0\u4E0E\u76EE\u5F55\u4E0D\u4E00\u81F4\uFF0C\u6280\u80FD\u5C31\u96BE\u4EE5\u88AB\u627E\u5230\u6216\u4E0D\u4F1A\u88AB\u4F7F\u7528\u3002", fix: "\u5728 front matter \u4E2D\u586B\u5199 name \u548C description\uFF0C\u540D\u79F0\u4F7F\u7528\u5C0F\u5199\u5B57\u6BCD\u52A0\u8FDE\u5B57\u7B26\uFF0C\u5E76\u4E0E\u76EE\u5F55\u540D\u4E00\u81F4\u3002" },
11124
11863
  "AGT-002": { why: "\u4E24\u4E2A\u6307\u4EE4\u6587\u4EF6\u8981\u6C42\u4E0D\u540C\u7684\u5305\u7BA1\u7406\u5668\u6216\u7F29\u8FDB\u65F6\uFF0C\u52A9\u624B\u53EA\u80FD\u731C\u6D4B\u8BE5\u542C\u54EA\u4E00\u4E2A\u3002", fix: "\u786E\u5B9A\u4E00\u79CD\u7EA6\u5B9A\uFF0C\u5199\u5728\u4E00\u4E2A\u5171\u4EAB\u6587\u4EF6\u4E2D\uFF0C\u5E76\u5220\u9664\u51B2\u7A81\u7684\u90A3\u4E00\u884C\u3002" },
11864
+ "DOC-001": { why: "\u52A9\u624B\u4F1A\u7167\u642C\u6307\u4EE4\u6587\u4EF6\u4E2D\u7684\u547D\u4EE4\u548C\u8DEF\u5F84\u3002\u5305\u7BA1\u7406\u5668\u4E0D\u4E00\u81F4\u3001\u811A\u672C\u4E0D\u5B58\u5728\u6216\u8DEF\u5F84\u8FC7\u65F6\uFF0C\u4F1A\u8BA9\u5B83\u8FD0\u884C\u9519\u8BEF\u7684\u547D\u4EE4\u6216\u5BFB\u627E\u5DF2\u4E0D\u5B58\u5728\u7684\u6587\u4EF6\u3002", fix: "\u628A\u6307\u4EE4\u6587\u4EF6\u6216 README \u4E2D\u7684\u90A3\u4E00\u884C\u6539\u6210\u4E0E\u9879\u76EE\u4E00\u81F4\uFF0C\u6216\u6062\u590D\u5B83\u6307\u5411\u7684\u5185\u5BB9\u3002" },
11125
11865
  "DUP-001": { why: "\u590D\u5236\u7684\u4EE3\u7801\u5728\u4FEE\u6539\u65F6\u5FC5\u987B\u6539\u52A8\u6BCF\u4E00\u4EFD\u526F\u672C\uFF0C\u6F0F\u6389\u4E00\u5904\u5C31\u5BB9\u6613\u4EA7\u751F\u7F3A\u9677\u3002", fix: "\u628A\u5171\u540C\u7684\u4EE3\u7801\u63D0\u53D6\u5230\u51FD\u6570\u6216\u6A21\u5757\u4E2D\uFF0C\u5728\u5404\u5904\u8C03\u7528\u3002" },
11126
11866
  "ARC-001": { why: "\u76F8\u4E92\u5BFC\u5165\u7684\u6A21\u5757\u53EF\u80FD\u8BFB\u5230\u5C1A\u672A\u521D\u59CB\u5316\u5B8C\u6210\u7684\u503C\uFF0C\u4EE3\u7801\u4E5F\u66F4\u96BE\u62C6\u5206\u548C\u6D4B\u8BD5\u3002", fix: "\u628A\u5171\u4EAB\u90E8\u5206\u79FB\u5230\u4E24\u8005\u90FD\u80FD\u5BFC\u5165\u7684\u72EC\u7ACB\u6A21\u5757\uFF0C\u6216\u53CD\u8F6C\u5176\u4E2D\u4E00\u4E2A\u5BFC\u5165\u3002" },
11127
11867
  "ARC-002": { why: "\u627E\u4E0D\u5230\u5BF9\u5E94\u6587\u4EF6\u7684\u76F8\u5BF9\u8DEF\u5F84\u5BFC\u5165\u4F1A\u5728\u6784\u5EFA\u6216\u8FD0\u884C\u65F6\u5931\u8D25\uFF0C\u800C\u4E14\u5F80\u5F80\u53EA\u5728\u5E72\u51C0\u7684\u73AF\u5883\u4E2D\u624D\u66B4\u9732\u3002", fix: "\u4FEE\u6B63\u8DEF\u5F84\u6216\u8865\u4E0A\u7F3A\u5931\u7684\u6587\u4EF6\u3002\u6784\u5EFA\u65F6\u751F\u6210\u7684\u6587\u4EF6\u53EF\u4EE5\u5FFD\u7565\u3002" },
@@ -11459,6 +12199,7 @@ Run "reporefit help" for usage.
11459
12199
  const ta = measurableContext(a.report, "claude", "");
11460
12200
  const tb = measurableContext(b.report, "claude", "");
11461
12201
  lines.push("", ta && tb ? `Estimated tokens (Claude Code at /): ${ta.tokens} -> ${tb.tokens} (${tb.tokens - ta.tokens >= 0 ? "+" : ""}${tb.tokens - ta.tokens})` : "Estimated tokens: not comparable (instruction files missing, conditional or partly read).");
12202
+ lines.push("", ...preservationLines(a, b, locale));
11462
12203
  io.out(lines.join("\n") + "\n");
11463
12204
  return shouldFail(b, failOn) ? 1 : 0;
11464
12205
  }
@@ -11470,9 +12211,9 @@ Run "reporefit help" for usage.
11470
12211
  else io.out(md);
11471
12212
  } else if (command === "report") {
11472
12213
  const dir = opts.out ?? ".";
11473
- writeFileSync(join3(dir, "reporefit-report.md"), renderMarkdownReport(r.report, locale));
11474
- writeFileSync(join3(dir, "reporefit-report.json"), renderJsonReport(r.report));
11475
- io.out(`Wrote ${join3(dir, "reporefit-report.md")} and ${join3(dir, "reporefit-report.json")}
12214
+ writeFileSync(join4(dir, "reporefit-report.md"), renderMarkdownReport(r.report, locale));
12215
+ writeFileSync(join4(dir, "reporefit-report.json"), renderJsonReport(r.report));
12216
+ io.out(`Wrote ${join4(dir, "reporefit-report.md")} and ${join4(dir, "reporefit-report.json")}
11476
12217
  `);
11477
12218
  } else if (command === "badge") {
11478
12219
  const file = opts.out ?? "reporefit-badge.svg";
@@ -11486,6 +12227,26 @@ Run "reporefit help" for usage.
11486
12227
  }
11487
12228
  return shouldFail(r, failOn) ? 1 : 0;
11488
12229
  }
12230
+ function preservationLines(a, b, locale) {
12231
+ const side = (r) => ({ docs: r.report.metrics.tokens?.docs ?? [], texts: r.instructionTexts, partial: r.report.coverage.partial });
12232
+ const out = ["Rule preservation (string and structure checks only; a reworded rule goes to review, never counted as kept):"];
12233
+ const active = a.report.metrics.tokens?.active ?? [];
12234
+ if (active.length === 0) return [...out, " No instruction files in the original."];
12235
+ for (const ctx of active) {
12236
+ const r = comparePreservation(ctx.platform, "", side(a), side(b));
12237
+ if (r.units === 0) continue;
12238
+ const verdict = r.verdict === "clean" ? "no loss found in the checked scope" : r.verdict === "unknown" ? `cannot judge (${r.unknownReasons.join(", ")})` : "review the revised copy";
12239
+ out.push(
12240
+ ` ${t(locale, `platform.${ctx.platform}`)} at /: ${r.units} rules (${r.mandatory} mandatory), kept ${r.kept}, review ${r.review} (fixed tokens changed ${r.fixedChanged}), possible losses ${r.missing}, out of scope ${r.scopeReduced}, duplicates removed ${r.removedDuplicates}, new ${r.added} -> ${verdict}`
12241
+ );
12242
+ for (const i of r.items.slice(0, 10)) {
12243
+ const where3 = i.after ? ` -> ${i.after.path}:${i.after.line}` : "";
12244
+ out.push(` ${i.before.path}:${i.before.line}${where3} ${i.grade}${i.reason ? ` (${i.reason})` : ""}${i.mandatory ? " [mandatory]" : ""} ${i.before.preview}`);
12245
+ }
12246
+ if (r.items.length > 10) out.push(` \u2026 ${r.items.length - 10} more`);
12247
+ }
12248
+ return out;
12249
+ }
11489
12250
 
11490
12251
  // src/bin.ts
11491
12252
  var controller = new AbortController();