@vibe-agent-toolkit/agent-skills 0.1.41-rc.7 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/content-type-routing.d.ts +18 -1
  2. package/dist/content-type-routing.d.ts.map +1 -1
  3. package/dist/content-type-routing.js +17 -0
  4. package/dist/content-type-routing.js.map +1 -1
  5. package/dist/evidence/build-evidence.d.ts +38 -0
  6. package/dist/evidence/build-evidence.d.ts.map +1 -0
  7. package/dist/evidence/build-evidence.js +60 -0
  8. package/dist/evidence/build-evidence.js.map +1 -0
  9. package/dist/evidence/index.d.ts +1 -0
  10. package/dist/evidence/index.d.ts.map +1 -1
  11. package/dist/evidence/index.js +1 -0
  12. package/dist/evidence/index.js.map +1 -1
  13. package/dist/files-config.d.ts +225 -31
  14. package/dist/files-config.d.ts.map +1 -1
  15. package/dist/files-config.js +445 -123
  16. package/dist/files-config.js.map +1 -1
  17. package/dist/index.d.ts +8 -6
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +10 -4
  20. package/dist/index.js.map +1 -1
  21. package/dist/post-build-checks.d.ts +10 -1
  22. package/dist/post-build-checks.d.ts.map +1 -1
  23. package/dist/post-build-checks.js +55 -6
  24. package/dist/post-build-checks.js.map +1 -1
  25. package/dist/schemas/index.d.ts +3 -2
  26. package/dist/schemas/index.d.ts.map +1 -1
  27. package/dist/schemas/index.js +2 -2
  28. package/dist/schemas/index.js.map +1 -1
  29. package/dist/schemas/installed-plugins-registry.d.ts +137 -63
  30. package/dist/schemas/installed-plugins-registry.d.ts.map +1 -1
  31. package/dist/schemas/installed-plugins-registry.js +94 -6
  32. package/dist/schemas/installed-plugins-registry.js.map +1 -1
  33. package/dist/schemas/known-marketplaces-registry.d.ts +165 -100
  34. package/dist/schemas/known-marketplaces-registry.d.ts.map +1 -1
  35. package/dist/schemas/known-marketplaces-registry.js +108 -21
  36. package/dist/schemas/known-marketplaces-registry.js.map +1 -1
  37. package/dist/schemas/registry-drift.d.ts +53 -0
  38. package/dist/schemas/registry-drift.d.ts.map +1 -0
  39. package/dist/schemas/registry-drift.js +50 -0
  40. package/dist/schemas/registry-drift.js.map +1 -0
  41. package/dist/skill-packager.d.ts +75 -5
  42. package/dist/skill-packager.d.ts.map +1 -1
  43. package/dist/skill-packager.js +304 -50
  44. package/dist/skill-packager.js.map +1 -1
  45. package/dist/skill-source/git-clone.d.ts.map +1 -1
  46. package/dist/skill-source/git-clone.js +32 -11
  47. package/dist/skill-source/git-clone.js.map +1 -1
  48. package/dist/skill-test/eval-inputs.js +2 -2
  49. package/dist/skill-test/eval-inputs.js.map +1 -1
  50. package/dist/skill-test/eval-lint.js +2 -2
  51. package/dist/skill-test/eval-lint.js.map +1 -1
  52. package/dist/skill-test/grader-prompt.js +2 -2
  53. package/dist/skill-test/grader-prompt.js.map +1 -1
  54. package/dist/test-input.d.ts +59 -24
  55. package/dist/test-input.d.ts.map +1 -1
  56. package/dist/test-input.js +77 -16
  57. package/dist/test-input.js.map +1 -1
  58. package/dist/validators/agent-instruction-presence.d.ts +41 -0
  59. package/dist/validators/agent-instruction-presence.d.ts.map +1 -0
  60. package/dist/validators/agent-instruction-presence.js +79 -0
  61. package/dist/validators/agent-instruction-presence.js.map +1 -0
  62. package/dist/validators/bundled-resource-link-detection.d.ts +20 -3
  63. package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
  64. package/dist/validators/bundled-resource-link-detection.js +78 -34
  65. package/dist/validators/bundled-resource-link-detection.js.map +1 -1
  66. package/dist/validators/compat-detectors.d.ts +9 -4
  67. package/dist/validators/compat-detectors.d.ts.map +1 -1
  68. package/dist/validators/compat-detectors.js +18 -30
  69. package/dist/validators/compat-detectors.js.map +1 -1
  70. package/dist/validators/index.d.ts +1 -0
  71. package/dist/validators/index.d.ts.map +1 -1
  72. package/dist/validators/index.js +1 -0
  73. package/dist/validators/index.js.map +1 -1
  74. package/dist/validators/packaging-validator.d.ts +68 -10
  75. package/dist/validators/packaging-validator.d.ts.map +1 -1
  76. package/dist/validators/packaging-validator.js +51 -10
  77. package/dist/validators/packaging-validator.js.map +1 -1
  78. package/dist/validators/registry-validator.d.ts.map +1 -1
  79. package/dist/validators/registry-validator.js +28 -7
  80. package/dist/validators/registry-validator.js.map +1 -1
  81. package/dist/validators/rule-engine/rule-context.d.ts +4 -2
  82. package/dist/validators/rule-engine/rule-context.d.ts.map +1 -1
  83. package/dist/validators/rule-engine/rule-context.js.map +1 -1
  84. package/dist/validators/rule-engine/rule-engine.d.ts.map +1 -1
  85. package/dist/validators/rule-engine/rule-engine.js +15 -3
  86. package/dist/validators/rule-engine/rule-engine.js.map +1 -1
  87. package/dist/validators/skill-validator.d.ts.map +1 -1
  88. package/dist/validators/skill-validator.js +16 -10
  89. package/dist/validators/skill-validator.js.map +1 -1
  90. package/dist/validators/source-only-codes.d.ts.map +1 -1
  91. package/dist/validators/source-only-codes.js +1 -0
  92. package/dist/validators/source-only-codes.js.map +1 -1
  93. package/dist/validators/validation-rules.d.ts +135 -17
  94. package/dist/validators/validation-rules.d.ts.map +1 -1
  95. package/dist/validators/validation-rules.js +192 -38
  96. package/dist/validators/validation-rules.js.map +1 -1
  97. package/dist/validators/walker-to-issues.d.ts.map +1 -1
  98. package/dist/validators/walker-to-issues.js +20 -7
  99. package/dist/validators/walker-to-issues.js.map +1 -1
  100. package/dist/walk-link-graph.d.ts +10 -1
  101. package/dist/walk-link-graph.d.ts.map +1 -1
  102. package/dist/walk-link-graph.js +124 -39
  103. package/dist/walk-link-graph.js.map +1 -1
  104. package/package.json +5 -5
@@ -1,14 +1,19 @@
1
1
  /**
2
2
  * Validation rules for Claude Code skills
3
3
  *
4
- * Based on Anthropic's official guidance and research findings:
5
- * - SKILL.md recommended: ≤500 lines
6
- * - Total skill size: ≤2000 lines
7
- * - File count: ≤6 files
8
- * - Reference depth: ≤2 levels
4
+ * Thresholds and their provenance — do not read this list as "Anthropic says so".
5
+ * Only the first is Anthropic's; the rest are VAT's, and two of them Anthropic
6
+ * actively contradicts. The full audit is in the comment above
7
+ * VALIDATION_THRESHOLDS below; read it before tuning any number here.
8
+ *
9
+ * - SKILL.md recommended: ≤500 lines (Anthropic's, verbatim)
10
+ * - Total skill size: ≤2000 lines (VAT's; Anthropic counter-signals it)
11
+ * - File count: ≤6 files (VAT's; Anthropic counter-signals it)
12
+ * - Reference depth: ≤2 levels (VAT's; Anthropic's rule is ONE level)
9
13
  *
10
14
  * References:
11
15
  * - https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices
16
+ * - docs/external/anthropic-skill-authoring-best-practices.md (dated cache of the above)
12
17
  * - https://github.com/anthropics/skills (official examples)
13
18
  */
14
19
  /**
@@ -34,12 +39,11 @@ export const VALIDATION_RULES = {
34
39
  message: (ctx) => `Link points outside project: ${ctx['href'] ?? 'unknown'}`,
35
40
  fix: 'Keep skills self-contained - move referenced files into the project',
36
41
  },
37
- FILENAME_COLLISION: {
38
- code: 'FILENAME_COLLISION',
39
- category: 'required',
40
- message: (ctx) => `Multiple files have same basename: ${ctx['filename'] ?? 'unknown'}`,
41
- fix: 'Enable path-based naming: packagingOptions.usePathNames: true',
42
- },
42
+ // FILENAME_COLLISION is deliberately absent: it lives in CODE_REGISTRY and is
43
+ // emitted by the packager (see `filenameCollisionIssue` in skill-packager.ts).
44
+ // The entry that used to sit here was never emitted by anything and its fix
45
+ // hint named `packagingOptions.usePathNames`, an option that does not exist —
46
+ // a second, stale definition of one code is worse than none.
43
47
  WINDOWS_BACKSLASH_IN_PATH: {
44
48
  code: 'WINDOWS_BACKSLASH_IN_PATH',
45
49
  category: 'required',
@@ -73,7 +77,12 @@ export const VALIDATION_RULES = {
73
77
  category: 'best_practice',
74
78
  message: (ctx) => `Skill includes ${Number(ctx['fileCount'] ?? 0)} files (recommended ≤6)`,
75
79
  fix: 'Split into focused sub-skills or use progressive disclosure',
76
- example: 'Official skills use 1-5 files',
80
+ // This used to read "Official skills use 1-5 files", which is false: Anthropic's
81
+ // own pdf/ example in the best-practices doc ships 7 (SKILL.md, FORMS.md,
82
+ // reference.md, examples.md + 3 scripts). 6 is a VAT maintainability heuristic,
83
+ // not a vendor limit — and Anthropic explicitly says to "Bundle comprehensive
84
+ // resources … no context penalty until accessed".
85
+ example: 'VAT heuristic, not an Anthropic limit — Anthropic\'s own pdf/ example ships 7 files',
77
86
  },
78
87
  REFERENCE_TOO_DEEP: {
79
88
  code: 'REFERENCE_TOO_DEEP',
@@ -112,31 +121,42 @@ export const VALIDATION_RULES = {
112
121
  // that restates the `files:` map is the symptom this text used to cause.
113
122
  fix: 'Add a markdown link from SKILL.md or a linked resource, or declare it under skills.config.<name>.files as a source/dest pair',
114
123
  },
115
- PACKAGED_TEST_INPUT: {
116
- code: 'PACKAGED_TEST_INPUT',
117
- category: 'best_practice',
118
- message: (ctx) => `Declared test input packaged into the shipped skill: ${ctx['relativePath'] ?? 'unknown'}`,
119
- fix: 'Remove the files: entry mapping the eval suite into the bundle — test input is read from source, never shipped',
120
- },
121
- PACKAGED_BROKEN_LINK: {
122
- code: 'PACKAGED_BROKEN_LINK',
123
- category: 'best_practice',
124
- message: (ctx) => `Broken link in packaged output: ${ctx['href'] ?? 'unknown'} (from ${ctx['mdPath'] ?? 'unknown'})`,
125
- fix: 'Indicates a link-rewriting bug — the source link was valid but the packaged link is broken',
126
- },
127
124
  };
128
125
  /**
129
- * Validation thresholds (based on Anthropic guidance)
126
+ * Validation thresholds — mostly VAT's, not Anthropic's (see the audit below)
127
+ *
128
+ * @vendor-claim reviewed=2026-07-30 verify=Re-fetch https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices and diff it against docs/external/anthropic-skill-authoring-best-practices.md
129
+ *
130
+ * The original header ("based on Anthropic guidance") overstated the provenance.
131
+ * Of the six numbers here, the repo's own cached copy of Anthropic's guidance
132
+ * supports only RECOMMENDED_SKILL_LINES (500), and it explicitly *disclaims*
133
+ * MAX_DESCRIPTION_CHARS_CLAUDE_CODE (250) — Anthropic documents a 1024-character
134
+ * maximum, while 250 is VAT's own reading of where the Claude Code `/skills`
135
+ * listing truncates. MAX_TOTAL_LINES, MAX_FILE_COUNT, MAX_REFERENCE_DEPTH and
136
+ * MIN_DESCRIPTION_LENGTH are VAT-originated.
130
137
  *
131
- * @vendor-claim reviewed=2026-04-18 verify=Re-fetch https://platform.claude.com/docs/en/docs/agents-and-tools/agent-skills/best-practices and diff it against docs/external/anthropic-skill-authoring-best-practices.md
138
+ * Re-verified against the live page on 2026-07-30. That pass sharpened two of
139
+ * those verdicts from "unsupported" to "contradicted", which is a stronger claim:
132
140
  *
133
- * The header above overstates the provenance. Of the six numbers here, the repo's
134
- * own cached copy of Anthropic's guidance supports only RECOMMENDED_SKILL_LINES
135
- * (500), and it explicitly *disclaims* MAX_DESCRIPTION_CHARS_CLAUDE_CODE (250) —
136
- * Anthropic documents a 1024-character maximum, while 250 is VAT's own reading of
137
- * where the Claude Code `/skills` listing truncates. MAX_TOTAL_LINES,
138
- * MAX_FILE_COUNT, MAX_REFERENCE_DEPTH and MIN_DESCRIPTION_LENGTH are
139
- * VAT-originated. The date above is the cache's Fetched date, not a later review.
141
+ * - MAX_REFERENCE_DEPTH (2) is CONTRADICTED, not merely VAT-originated. Anthropic:
142
+ * "Keep references one level deep from SKILL.md", and their "Bad example: Too
143
+ * deep" is literally `SKILL.md → advanced.md → details.md` — the exact chain
144
+ * REFERENCE_TOO_DEEP's own `example` string above blesses as "2 hops, OK". VAT
145
+ * is deliberately one hop laxer than the vendor here; that is a product
146
+ * decision, not an oversight, but nothing in this file may imply Anthropic
147
+ * endorses 2.
148
+ * - MAX_TOTAL_LINES (2000) and MAX_FILE_COUNT (6) are COUNTER-SIGNALLED, not just
149
+ * silent. Anthropic's runtime-environment guidance says "Bundle comprehensive
150
+ * resources: Include complete API docs, extensive examples, large datasets; no
151
+ * context penalty until accessed", and "No context penalty for large files".
152
+ * Their own pdf/ example ships 7 files, one past MAX_FILE_COUNT. VAT flags large
153
+ * bundles as a maintainability/reviewability signal, which the vendor does not.
154
+ * - MIN_DESCRIPTION_LENGTH (50) stays SILENT-not-contradicted: Anthropic rejects
155
+ * vague descriptions ("Helps with documents") on specificity, never on length.
156
+ *
157
+ * The `reviewed=` date above is now a real review date, not the cache's Fetched
158
+ * date. Do not resolve any of these divergences by editing a number here — the
159
+ * values decide what fires on adopter trees and are the repo owner's call.
140
160
  */
141
161
  export const VALIDATION_THRESHOLDS = {
142
162
  /** Recommended maximum lines for SKILL.md */
@@ -156,18 +176,152 @@ export const VALIDATION_THRESHOLDS = {
156
176
  MAX_DESCRIPTION_CHARS_CLAUDE_CODE: 250,
157
177
  };
158
178
  /**
159
- * Navigation file patterns to detect
179
+ * Navigation file patterns to detect.
180
+ *
181
+ * ONE canonical spelling per name. Every consumer matches these
182
+ * **case-insensitively** — via {@link isNavigationBasename} /
183
+ * {@link isNeverPackagedBasename} for basename lookups, or via
184
+ * {@link toAnyDepthGlobs} for glob lanes.
185
+ *
186
+ * This list used to enumerate spellings (`README.md` *and* `readme.md`,
187
+ * `index.md` *and* `INDEX.md`, …) and that approach provably cannot win: it
188
+ * never contained `Readme.md`, the single most common real spelling, nor
189
+ * `ReadMe.md` or `README.MD`. Do not re-add a second spelling of any name —
190
+ * matching handles case, and a duplicate implies enumeration still matters.
160
191
  */
161
192
  export const NAVIGATION_FILE_PATTERNS = [
162
193
  'README.md',
163
- 'readme.md',
164
194
  'index.md',
165
- 'INDEX.md',
166
195
  'toc.md',
167
- 'TOC.md',
168
196
  'overview.md',
169
- 'OVERVIEW.md',
170
197
  ];
198
+ /**
199
+ * Repo-internal agent-instruction files. Deliberately a SEPARATE list from
200
+ * {@link NAVIGATION_FILE_PATTERNS}: a README is real content at the wrong
201
+ * granularity, whereas these files are guidance *about the repository they live
202
+ * in* and are meaningless — or actively misleading — once copied into a
203
+ * distributed bundle.
204
+ *
205
+ * Two distinct harms, both observed:
206
+ *
207
+ * 1. **Silent mis-resolution.** Two packages' `CLAUDE.md` files bundled under
208
+ * `resourceNaming: basename` collide on one destination; one wins, and every
209
+ * link to either source then resolves to the winner's content.
210
+ * 2. **Unintended instruction loading.** Claude Code loads `CLAUDE.md` files
211
+ * found in subdirectories *under the working directory* on demand, when it
212
+ * reads a file in that directory. A skill installed project-locally (e.g.
213
+ * `.claude/skills/<name>/`) is under the working directory, so a bundled
214
+ * `CLAUDE.md` is read as instructions the moment the agent opens a reference
215
+ * beside it. (Skills installed outside the cwd — `~/.claude/skills`, plugin
216
+ * directories — are not affected by this second harm. `AGENTS.md` and
217
+ * `GEMINI.md` are not loaded as memory by Claude Code — it reads `CLAUDE.md`,
218
+ * and picks up an `AGENTS.md` only where a `CLAUDE.md` imports it explicitly
219
+ * (`@AGENTS.md`) or `/init` incorporates it — so they are listed here for the
220
+ * portability and collision reasons, and treated identically to `CLAUDE.md`.)
221
+ *
222
+ * @vendor-claim reviewed=2026-08-02 verify=Re-read https://code.claude.com/docs/en/memory — "How CLAUDE.md files load" for harm 2, and the "AGENTS.md" section for the AGENTS.md/GEMINI.md sentence
223
+ */
224
+ export const AGENT_INSTRUCTION_FILE_PATTERNS = [
225
+ 'CLAUDE.md',
226
+ 'CLAUDE.local.md',
227
+ 'AGENTS.md',
228
+ 'GEMINI.md',
229
+ ];
230
+ /**
231
+ * Basenames a GLOB `files:` entry never packages into a **skill bundle**.
232
+ *
233
+ * Two tiers, deliberately composed here rather than merged at the source:
234
+ *
235
+ * - {@link AGENT_INSTRUCTION_FILE_PATTERNS} — never packaged on ANY surface.
236
+ * - {@link NAVIGATION_FILE_PATTERNS} — never packaged into a *skill bundle*, and
237
+ * **only** there. A plugin-root `README.md` is the plugin's front page (measured
238
+ * 2026-08-02: 50 of 86 installed plugins ship one; 57 of 94 when first measured),
239
+ * so the plugin tree-copy must import the agent-instruction list alone. Merging
240
+ * the two lists would strip the front page off three in five real plugins. The
241
+ * population moves as plugins are installed and removed — the ratio is the load-
242
+ * bearing part, so re-measure before citing the count as current.
243
+ *
244
+ * Only globs consult this list. Naming `source: README.md` explicitly is an
245
+ * unambiguous instruction to ship that file; a glob is a net, not a declaration,
246
+ * and does not get to launder an exemption for a file it never named.
247
+ */
248
+ export const NEVER_PACKAGE_IN_SKILL_BUNDLE = [
249
+ ...AGENT_INSTRUCTION_FILE_PATTERNS,
250
+ ...NAVIGATION_FILE_PATTERNS,
251
+ ];
252
+ /**
253
+ * Build a case-insensitive basename predicate over a fixed pattern list.
254
+ *
255
+ * THE matcher every never-package lane shares. Two lanes ask this question — a
256
+ * glob lane (crawler include/exclude patterns) and a basename lane (`files:`
257
+ * expansion, broken-link remediation) — and they must not be able to drift: the
258
+ * glob lane's patterns come from {@link toAnyDepthGlobs} over the same arrays,
259
+ * and its verdict is asserted equal to this predicate's in the unit tests.
260
+ *
261
+ * `toLowerCase()` (not `toLocaleLowerCase()`) is deliberate: the ASCII-only
262
+ * basenames here must fold identically under every locale, and the Turkish
263
+ * dotless-i rule would otherwise break `INDEX.md` on a `tr-TR` host.
264
+ */
265
+ function basenameMatcher(patterns) {
266
+ const lowered = new Set(patterns.map((pattern) => pattern.toLowerCase()));
267
+ return (name) => lowered.has(name.toLowerCase());
268
+ }
269
+ /**
270
+ * Is this basename a navigation file (README/index/toc/overview, any case)?
271
+ *
272
+ * Skill-bundle scope only — see {@link NEVER_PACKAGE_IN_SKILL_BUNDLE}.
273
+ */
274
+ export const isNavigationBasename = basenameMatcher(NAVIGATION_FILE_PATTERNS);
275
+ /**
276
+ * Is this basename a repo-internal agent-instruction file (CLAUDE.md/AGENTS.md/…, any case)?
277
+ *
278
+ * Case-insensitivity is not cosmetic here: on APFS and NTFS, `Claude.md` and
279
+ * `claude.md` satisfy Claude Code's project-local instruction lookup exactly as
280
+ * `CLAUDE.md` does, so a case-sensitive check leaves the harm fully reachable.
281
+ */
282
+ export const isAgentInstructionBasename = basenameMatcher(AGENT_INSTRUCTION_FILE_PATTERNS);
283
+ /**
284
+ * Is this basename one a GLOB `files:` entry never packages into a skill bundle?
285
+ *
286
+ * The basename-lane counterpart of {@link toAnyDepthGlobs}; both read
287
+ * {@link NEVER_PACKAGE_IN_SKILL_BUNDLE}. Any lane doing a `Set.has(basename)`
288
+ * against that constant must call this instead — a raw Set is case-sensitive and
289
+ * is exactly the gap this exists to close.
290
+ */
291
+ export const isNeverPackagedBasename = basenameMatcher(NEVER_PACKAGE_IN_SKILL_BUNDLE);
292
+ /**
293
+ * Fold one literal basename into a case-insensitive glob.
294
+ *
295
+ * `CLAUDE.md` → `[cC][lL][aA][uU][dD][eE].[mM][dD]`. Bracket classes rather than a
296
+ * matcher-level `nocase` flag because these patterns travel INTO crawls whose
297
+ * other patterns (caller excludes, `skills/<dir>/**`) must stay case-sensitive —
298
+ * picomatch's `nocase` applies to every pattern compiled in the same call, so it
299
+ * would silently widen those too.
300
+ */
301
+ function toCaseInsensitiveGlob(name) {
302
+ return [...name]
303
+ .map((char) => {
304
+ const lower = char.toLowerCase();
305
+ const upper = char.toUpperCase();
306
+ return lower === upper ? char : `[${lower}${upper}]`;
307
+ })
308
+ .join('');
309
+ }
310
+ /**
311
+ * Expand basenames into globs matching them at the tree root AND at any depth,
312
+ * **regardless of case**.
313
+ *
314
+ * `**\/name` alone is not portable across matchers for a root-level hit, so both
315
+ * depths are emitted. Shared by the presence detector's include globs and the
316
+ * plugin tree-copy's exclude globs so the two can never drift apart — and folded
317
+ * to case-insensitive so neither can be evaded by spelling the file `Claude.md`.
318
+ */
319
+ export function toAnyDepthGlobs(patterns) {
320
+ return patterns.flatMap((name) => {
321
+ const glob = toCaseInsensitiveGlob(name);
322
+ return [glob, `**/${glob}`];
323
+ });
324
+ }
171
325
  /**
172
326
  * Create a validation issue from a rule
173
327
  */
@@ -1 +1 @@
1
- {"version":3,"file":"validation-rules.js","sourceRoot":"","sources":["../../src/validators/validation-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA+CH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+C;IAC1E,mCAAmC;IACnC,oBAAoB,E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AED;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,IAAoB,EACpB,UAAmC,EAAE,EACrC,QAAiB;IAEjB,MAAM,KAAK,GAAoB;QAC7B,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,IAAI,CAAC,IAAa,EAAE,0CAA0C;QACpE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAC9B,GAAG,EAAE,IAAI,CAAC,GAAG;KACd,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"walker-to-issues.d.ts","sourceRoot":"","sources":["../../src/validators/walker-to-issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA2C5D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,SAAS,cAAc,EAAE,EACrC,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAmBnB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAKnB"}
1
+ {"version":3,"file":"walker-to-issues.d.ts","sourceRoot":"","sources":["../../src/validators/walker-to-issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA2D5D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,SAAS,cAAc,EAAE,EACrC,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAmBnB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAKnB"}
@@ -14,28 +14,41 @@ import { evaluate, makeRuleContext, materializeIssue } from './rule-engine/index
14
14
  * emitted (the engine returns `null` for a non-typed-slot directory). A
15
15
  * `files:` typed-slot source resolving to a directory is an error, but that
16
16
  * check lives in packaging-validator, not here.
17
+ *
18
+ * `existsAtSource` is READ FROM the walker's record, never assumed. The engine
19
+ * gates `LINK_TO_GITIGNORED_FILE` on "gitignored AND exists"; hardcoding
20
+ * existence here made that guard unreachable, so a walker that mislabelled a
21
+ * missing target as gitignored got its mislabel rubber-stamped into an error
22
+ * about a file that is not there.
17
23
  */
18
- function exclusionToContext(reason) {
24
+ function exclusionToContext(reason, targetExists) {
19
25
  switch (reason) {
20
26
  case 'depth-exceeded':
21
27
  return makeRuleContext({ subject: 'edge', droppedByDepth: true });
22
28
  case 'outside-project':
23
29
  return makeRuleContext({ subject: 'edge', outsideProject: true });
24
30
  case 'gitignored':
25
- return makeRuleContext({ subject: 'edge', gitignored: true, existsAtSource: true });
31
+ return makeRuleContext({ subject: 'edge', gitignored: true, existsAtSource: targetExists });
26
32
  case 'skill-definition':
27
33
  return makeRuleContext({ subject: 'edge', crossSkillDefinition: true });
28
34
  case 'directory-target':
29
35
  return makeRuleContext({ subject: 'edge', fileKind: 'directory' });
30
36
  case 'navigation-file':
31
37
  return makeRuleContext({ subject: 'edge', fileKind: 'nav' });
38
+ case 'agent-instruction-file':
39
+ return makeRuleContext({ subject: 'edge', fileKind: 'agent-instruction' });
32
40
  case 'missing-target':
33
- return makeRuleContext({ subject: 'edge', phase: 'source', existsAtSource: false });
41
+ return makeRuleContext({ subject: 'edge', phase: 'source', existsAtSource: targetExists });
34
42
  case 'pattern-matched':
35
43
  return makeRuleContext({ subject: 'edge', patternExcluded: true });
36
- default:
37
- // Exhaustive — every excludeReason is handled above.
38
- return makeRuleContext({ subject: 'edge' });
44
+ default: {
45
+ // Exhaustiveness guard, NOT a fallback. A `default:` arm that returns a
46
+ // context is precisely what disables TypeScript's exhaustiveness check:
47
+ // a newly added excludeReason would compile and be silently dropped into
48
+ // a no-op context. Assigning to `never` makes it a compile error instead.
49
+ const _exhaustive = reason;
50
+ throw new Error(`Unhandled walker excludeReason: ${String(_exhaustive)}`);
51
+ }
39
52
  }
40
53
  }
41
54
  /**
@@ -48,7 +61,7 @@ export function walkerExclusionsToIssues(exclusions, locationRoot) {
48
61
  for (const r of exclusions) {
49
62
  if (!r.excludeReason)
50
63
  continue;
51
- const code = evaluate(exclusionToContext(r.excludeReason));
64
+ const code = evaluate(exclusionToContext(r.excludeReason, r.targetExists));
52
65
  if (code === null)
53
66
  continue;
54
67
  // Anchor to the file CONTAINING the link, not the target. For a
@@ -1 +1 @@
1
- {"version":3,"file":"walker-to-issues.js","sourceRoot":"","sources":["../../src/validators/walker-to-issues.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI1D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAoB,MAAM,wBAAwB,CAAC;AAEvG;;;;;;;;;;;;;;GAcG;AACH,SAAS,kBAAkB,CAAC,MAAoD;IAC9E,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,gBAAgB;YACnB,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,KAAK,iBAAiB;YACpB,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,KAAK,YAAY;YACf,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QACtF,KAAK,kBAAkB;YACrB,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,oB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,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAC3E,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,gEAAgE;QAChE,sEAAsE;QACtE,yEAAyE;QACzE,kCAAkC;QAClC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE;YACjC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC;YACnD,GAAG,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;YACzD,IAAI,EAAE,CAAC,CAAC,QAAQ,IAAI,MAAM;YAC1B,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,IAAI,MAAM,EAAE;SACxC,CAAC,CAAC,CAAC;IACN,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,cAAiC,EACjC,YAAoB;IAEpB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAClC,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACpD,OAAO,gBAAgB,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -28,10 +28,19 @@ export interface LinkResolution {
28
28
  sourcePath: string;
29
29
  /** 1-based line of the link within {@link LinkResolution.sourcePath}, when known */
30
30
  sourceLine?: number | undefined;
31
+ /**
32
+ * Whether the link TARGET existed on disk when the walker classified it.
33
+ *
34
+ * Recorded rather than re-derived downstream. The verdict engine gates
35
+ * `LINK_TO_GITIGNORED_FILE` on "gitignored AND exists at source"; a
36
+ * translation front-end that hardcodes existence turns that guard into dead
37
+ * code, so the one place that actually stat'ed the path carries the answer.
38
+ */
39
+ targetExists: boolean;
31
40
  /** Whether the file will be bundled */
32
41
  bundled: boolean;
33
42
  /** Reason it was excluded (only set when bundled is false) */
34
- excludeReason?: 'depth-exceeded' | 'pattern-matched' | 'directory-target' | 'outside-project' | 'navigation-file' | 'skill-definition' | 'gitignored' | 'missing-target' | undefined;
43
+ excludeReason?: 'depth-exceeded' | 'pattern-matched' | 'directory-target' | 'outside-project' | 'navigation-file' | 'agent-instruction-file' | 'skill-definition' | 'gitignored' | 'missing-target' | undefined;
35
44
  /** The rule that matched (only set for pattern-matched exclusions) */
36
45
  matchedRule?: ExcludeRule | undefined;
37
46
  /** Link text from the source markdown */
@@ -1 +1 @@
1
- {"version":3,"file":"walk-link-graph.d.ts","sourceRoot":"","sources":["../src/walk-link-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAgB,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,KAAK,UAAU,EAA0C,MAAM,2BAA2B,CAAC;AAKpG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACrL,sEAAsE;IACtE,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACtC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MA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