paperlint 16.8.0 → 17.1.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.
Files changed (300) hide show
  1. package/CLAUDE.md +10 -2
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +17 -14
  4. package/dist/adapters/latex/abstract.d.ts +7 -1
  5. package/dist/adapters/latex/abstract.d.ts.map +1 -1
  6. package/dist/adapters/latex/abstract.js +19 -4
  7. package/dist/adapters/latex/abstract.js.map +1 -1
  8. package/dist/adapters/latex/captions.d.ts +6 -5
  9. package/dist/adapters/latex/captions.d.ts.map +1 -1
  10. package/dist/adapters/latex/captions.js +14 -30
  11. package/dist/adapters/latex/captions.js.map +1 -1
  12. package/dist/adapters/latex/index.d.ts +1 -1
  13. package/dist/adapters/latex/index.d.ts.map +1 -1
  14. package/dist/adapters/latex/index.js +5 -2
  15. package/dist/adapters/latex/index.js.map +1 -1
  16. package/dist/adapters/latex/prose.d.ts +6 -0
  17. package/dist/adapters/latex/prose.d.ts.map +1 -1
  18. package/dist/adapters/latex/prose.js +18 -12
  19. package/dist/adapters/latex/prose.js.map +1 -1
  20. package/dist/cli.d.ts +6 -1
  21. package/dist/cli.d.ts.map +1 -1
  22. package/dist/cli.js +16 -8
  23. package/dist/cli.js.map +1 -1
  24. package/dist/domain/register.d.ts +23 -1
  25. package/dist/domain/register.d.ts.map +1 -1
  26. package/dist/domain/register.js +37 -14
  27. package/dist/domain/register.js.map +1 -1
  28. package/dist/domain/term-definitions.d.ts +48 -0
  29. package/dist/domain/term-definitions.d.ts.map +1 -0
  30. package/dist/domain/term-definitions.js +228 -0
  31. package/dist/domain/term-definitions.js.map +1 -0
  32. package/dist/domain/tex-document.d.ts +11 -0
  33. package/dist/domain/tex-document.d.ts.map +1 -1
  34. package/dist/domain/tex-document.js.map +1 -1
  35. package/dist/eslint-rules/review-frontmatter.js +5 -5
  36. package/dist/eslint-rules/review-frontmatter.schema.json +15 -8
  37. package/dist/eslint-rules/sibling-frontmatter.d.ts.map +1 -1
  38. package/dist/folder-venue-rule.d.ts +1 -1
  39. package/dist/folder-venue-rule.d.ts.map +1 -1
  40. package/dist/folder-venue-rule.js +4 -2
  41. package/dist/folder-venue-rule.js.map +1 -1
  42. package/dist/hooks-notice.d.ts +3 -3
  43. package/dist/hooks-notice.d.ts.map +1 -1
  44. package/dist/hooks-notice.js +41 -8
  45. package/dist/hooks-notice.js.map +1 -1
  46. package/dist/link-skills.d.ts +5 -0
  47. package/dist/link-skills.d.ts.map +1 -1
  48. package/dist/link-skills.js +7 -0
  49. package/dist/link-skills.js.map +1 -1
  50. package/dist/ports/latex.d.ts +11 -1
  51. package/dist/ports/latex.d.ts.map +1 -1
  52. package/dist/presets.d.ts +21 -2
  53. package/dist/presets.d.ts.map +1 -1
  54. package/dist/presets.js +66 -17
  55. package/dist/presets.js.map +1 -1
  56. package/dist/readability.d.ts +12 -2
  57. package/dist/readability.d.ts.map +1 -1
  58. package/dist/readability.js +76 -3
  59. package/dist/readability.js.map +1 -1
  60. package/dist/register-bands.d.ts +16 -5
  61. package/dist/register-bands.d.ts.map +1 -1
  62. package/dist/register-bands.js +56 -17
  63. package/dist/register-bands.js.map +1 -1
  64. package/dist/skills/argument-arc/scripts/headings-core.d.ts +12 -0
  65. package/dist/skills/argument-arc/scripts/headings.d.ts +2 -0
  66. package/dist/skills/cold-read-diff/scripts/cold-read-core.d.ts +12 -0
  67. package/dist/skills/cold-read-diff/scripts/readers.d.ts +2 -1
  68. package/dist/term-definition-rules.d.ts +26 -0
  69. package/dist/term-definition-rules.d.ts.map +1 -0
  70. package/dist/term-definition-rules.js +137 -0
  71. package/dist/term-definition-rules.js.map +1 -0
  72. package/dist/tex-paper.d.ts +6 -0
  73. package/dist/tex-paper.d.ts.map +1 -1
  74. package/dist/tex-paper.js +10 -0
  75. package/dist/tex-paper.js.map +1 -1
  76. package/dist/tex-requirements.d.ts +2 -0
  77. package/dist/tex-requirements.d.ts.map +1 -1
  78. package/dist/tex-requirements.js +9 -0
  79. package/dist/tex-requirements.js.map +1 -1
  80. package/dist/tex-venue-rules.d.ts +3 -2
  81. package/dist/tex-venue-rules.d.ts.map +1 -1
  82. package/dist/tex-venue-rules.js +3 -2
  83. package/dist/tex-venue-rules.js.map +1 -1
  84. package/docs/configuration.md +2 -2
  85. package/{skills/paper-pipeline/references → docs/design}/acceptance-gate.md +50 -53
  86. package/docs/design/paper-pipeline-history.md +217 -0
  87. package/docs/design/skill-provenance.md +132 -0
  88. package/docs/design/study-modes.md +1 -1
  89. package/docs/design/verify-citations-history.md +135 -0
  90. package/docs/design/writing-exemplars.md +19 -0
  91. package/docs/install.md +7 -4
  92. package/docs/layout.md +5 -4
  93. package/docs/optional-rules.md +4 -0
  94. package/docs/osf-artifact.md +54 -0
  95. package/docs/pipeline.md +171 -0
  96. package/docs/render.md +82 -0
  97. package/docs/rules/paper/folder-venue-leftover.md +10 -7
  98. package/docs/rules/tex/contrast-frames.md +1 -2
  99. package/docs/rules/tex/max-caption-words.md +82 -0
  100. package/docs/rules/tex/max-paragraph-words.md +2 -2
  101. package/docs/rules/tex/negated-sentences.md +96 -0
  102. package/docs/rules/tex/term-before-definition.md +103 -0
  103. package/docs/rules/tex/term-defined-twice.md +62 -0
  104. package/docs/rules/tex/venue-leftover.md +13 -1
  105. package/docs/rules.md +23 -18
  106. package/docs/skills.md +16 -21
  107. package/docs/submission.md +14 -0
  108. package/docs/texlive-install-decision.md +1 -1
  109. package/docs/toolchain.md +11 -11
  110. package/eslint-rules/review-frontmatter.schema.json +15 -8
  111. package/eslint-rules/review-frontmatter.test.mjs +8 -5
  112. package/eslint-rules/review-frontmatter.ts +5 -5
  113. package/eslint.config.mjs +1 -5
  114. package/hooks/paper-status-gates.sh +21 -4
  115. package/hooks/paper-status-gates.test.ts +51 -0
  116. package/lib/skill-checks.test.mjs +2 -6
  117. package/lib/skill-trigger-cases.mjs +12 -97
  118. package/lib/skill-trigger-cases.test.ts +0 -6
  119. package/package.json +3 -1
  120. package/presets/acm-sigconf.md +1 -1
  121. package/presets/agenticdev.jsonc +5 -2
  122. package/presets/agenticdev.md +4 -2
  123. package/presets/aidc.jsonc +14 -1
  124. package/presets/aidc.md +3 -2
  125. package/presets/aisec.jsonc +9 -3
  126. package/presets/aisec.md +4 -1
  127. package/presets/ase.jsonc +145 -0
  128. package/presets/ase.md +178 -0
  129. package/presets/ccs.jsonc +87 -0
  130. package/presets/ccs.md +184 -0
  131. package/presets/icse.jsonc +100 -0
  132. package/presets/icse.md +126 -0
  133. package/presets/ieee-conference.md +1 -1
  134. package/presets/sp.jsonc +152 -0
  135. package/presets/sp.md +160 -0
  136. package/presets/venue-profile.schema.json +22 -3
  137. package/scripts/harness-api.frozen.json +0 -4
  138. package/scripts/pipeline.ts +481 -0
  139. package/skills/CLAUDE.md +2 -2
  140. package/skills/CLAUDE.md.spec.ts +26 -1
  141. package/skills/analyze-sibling-paper/SKILL.md +2 -20
  142. package/skills/analyze-sibling-paper/SKILL.md.spec.ts +9 -19
  143. package/skills/argument-arc/SKILL.md +32 -18
  144. package/skills/argument-arc/SKILL.md.spec.ts +43 -17
  145. package/skills/argument-arc/scripts/headings-core.js +46 -0
  146. package/skills/argument-arc/scripts/headings-core.ts +65 -0
  147. package/skills/argument-arc/scripts/headings.js +15 -0
  148. package/skills/argument-arc/scripts/headings.test.ts +105 -0
  149. package/skills/argument-arc/scripts/headings.ts +20 -0
  150. package/skills/build-benchmark/SKILL.md +1 -12
  151. package/skills/build-benchmark/SKILL.md.spec.ts +15 -11
  152. package/skills/build-label-page/SKILL.md.spec.ts +11 -0
  153. package/skills/camera-ready/SKILL.md +1 -8
  154. package/skills/camera-ready/SKILL.md.spec.ts +8 -7
  155. package/skills/cold-read-diff/SKILL.md +36 -25
  156. package/skills/cold-read-diff/SKILL.md.spec.ts +44 -24
  157. package/skills/cold-read-diff/scripts/cold-read-core.js +63 -6
  158. package/skills/cold-read-diff/scripts/cold-read-core.ts +81 -6
  159. package/skills/cold-read-diff/scripts/cold-read.js +1 -1
  160. package/skills/cold-read-diff/scripts/cold-read.test.ts +66 -0
  161. package/skills/cold-read-diff/scripts/cold-read.ts +1 -1
  162. package/skills/cold-read-diff/scripts/readers.js +2 -1
  163. package/skills/cold-read-diff/scripts/readers.ts +2 -1
  164. package/skills/draft-paper/SKILL.md +16 -29
  165. package/skills/draft-paper/SKILL.md.spec.ts +27 -28
  166. package/skills/extend-paper/SKILL.md +7 -16
  167. package/skills/extend-paper/SKILL.md.spec.ts +18 -15
  168. package/skills/find-venue/SKILL.md +11 -24
  169. package/skills/find-venue/SKILL.md.spec.ts +19 -23
  170. package/skills/harden-paper/SKILL.md +62 -290
  171. package/skills/harden-paper/SKILL.md.spec.ts +82 -304
  172. package/skills/harden-paper/harden-paper.harness.mjs +1 -2
  173. package/skills/jobs.ts +25 -0
  174. package/skills/label-agent-runs/SKILL.md.spec.ts +10 -0
  175. package/skills/map-prior-work/SKILL.md +5 -4
  176. package/skills/map-prior-work/SKILL.md.spec.ts +13 -3
  177. package/skills/paper-pipeline/SKILL.md +80 -278
  178. package/skills/paper-pipeline/SKILL.md.spec.ts +130 -276
  179. package/skills/paper-pipeline/description-language.eval.mjs +0 -22
  180. package/skills/paper-pipeline/framing-vs-vocabulary.eval.mjs +0 -29
  181. package/skills/paper-pipeline/paper-pipeline.harness.mjs +0 -16
  182. package/skills/paper-pipeline/pipeline-firing.eval.mjs +7 -29
  183. package/skills/paper-pipeline/pipeline-language.eval.mjs +0 -52
  184. package/skills/paper-pipeline/references/artifact-checklist.md +6 -1
  185. package/skills/paper-pipeline/references/body-vs-appendix.md +3 -4
  186. package/skills/paper-pipeline/references/pipeline-status-template.md +8 -10
  187. package/skills/paper-pipeline/references/review-ratchet.md +4 -7
  188. package/skills/paper-pipeline/references/venue-bar.md +1 -2
  189. package/skills/paper-pipeline/references/writing-craft.md +21 -281
  190. package/skills/paper-status/SKILL.md +17 -20
  191. package/skills/paper-status/SKILL.md.spec.ts +23 -19
  192. package/skills/pc-panel-review/SKILL.md +66 -93
  193. package/skills/pc-panel-review/SKILL.md.spec.ts +75 -92
  194. package/skills/plan-paper-timeline/SKILL.md +7 -29
  195. package/skills/plan-paper-timeline/SKILL.md.spec.ts +16 -28
  196. package/skills/plan-paper-timeline/plan-paper-timeline.effects.harness.mjs +2 -2
  197. package/skills/render-paper/check-render.sh +2 -2
  198. package/skills/render-paper/render-paper.harness.mjs +4 -20
  199. package/skills/research-ideate/SKILL.md +15 -32
  200. package/skills/research-ideate/SKILL.md.spec.ts +25 -31
  201. package/skills/rewrite-unclear/SKILL.md +15 -14
  202. package/skills/rewrite-unclear/SKILL.md.spec.ts +24 -15
  203. package/skills/rewrite-unclear/rewrite-unclear.eval.ts +2 -3
  204. package/skills/run-agent-grid/SKILL.md +3 -3
  205. package/skills/run-agent-grid/SKILL.md.spec.ts +10 -2
  206. package/skills/study-accepted-papers/SKILL.md +5 -5
  207. package/skills/study-accepted-papers/SKILL.md.spec.ts +27 -4
  208. package/skills/submit-paper/SKILL.md +37 -31
  209. package/skills/submit-paper/SKILL.md.spec.ts +46 -30
  210. package/skills/submit-paper/check-deanon.sh +1 -1
  211. package/skills/tighten-paper/SKILL.md +43 -68
  212. package/skills/tighten-paper/SKILL.md.spec.ts +51 -67
  213. package/skills/verify-citations/SKILL.md +18 -112
  214. package/skills/verify-citations/SKILL.md.spec.ts +27 -114
  215. package/src/adapters/latex/abstract.test.ts +42 -0
  216. package/src/adapters/latex/abstract.ts +23 -6
  217. package/src/adapters/latex/captions.test.ts +36 -38
  218. package/src/adapters/latex/captions.ts +16 -33
  219. package/src/adapters/latex/index.test.ts +11 -0
  220. package/src/adapters/latex/index.ts +5 -2
  221. package/src/adapters/latex/prose.ts +23 -11
  222. package/src/cli.ts +26 -5
  223. package/src/domain/register.test.ts +65 -0
  224. package/src/domain/register.ts +72 -16
  225. package/src/domain/term-definitions.test.ts +240 -0
  226. package/src/domain/term-definitions.ts +329 -0
  227. package/src/domain/tex-document.ts +12 -0
  228. package/src/domain/venue-name.test.ts +4 -4
  229. package/src/folder-venue-rule.test.ts +23 -2
  230. package/src/folder-venue-rule.ts +8 -8
  231. package/src/hooks-notice.test.ts +127 -0
  232. package/src/hooks-notice.ts +50 -10
  233. package/src/link-skills.ts +9 -0
  234. package/src/new-paper.test.ts +2 -2
  235. package/src/paper-settings-commands.test.ts +1 -1
  236. package/src/ports/latex.ts +11 -0
  237. package/src/preset-card-rule.test.ts +4 -0
  238. package/src/presets.test.ts +141 -4
  239. package/src/presets.ts +113 -22
  240. package/src/readability.test.ts +92 -0
  241. package/src/readability.ts +113 -5
  242. package/src/register-bands.test.ts +81 -1
  243. package/src/register-bands.ts +88 -23
  244. package/src/rule-cases.test.ts +122 -2
  245. package/src/term-definition-rules.test.ts +150 -0
  246. package/src/term-definition-rules.ts +189 -0
  247. package/src/tex-paper.test.ts +18 -1
  248. package/src/tex-paper.ts +11 -0
  249. package/src/tex-requirements.ts +15 -0
  250. package/src/tex-venue-rules.test.ts +45 -1
  251. package/src/tex-venue-rules.ts +8 -3
  252. package/src/venue-rules.test.ts +2 -2
  253. package/templates/paper/PIPELINE-STATUS.md +19 -19
  254. package/dist/paper-prose.d.ts +0 -17
  255. package/dist/paper-prose.d.ts.map +0 -1
  256. package/dist/paper-prose.js +0 -46
  257. package/dist/paper-prose.js.map +0 -1
  258. package/skills/grade-paper-writing/SKILL.md +0 -494
  259. package/skills/grade-paper-writing/SKILL.md.spec.ts +0 -501
  260. package/skills/grade-paper-writing/__snapshots__/prose-lint.test.ts.snap +0 -84
  261. package/skills/grade-paper-writing/fixtures/control_gopen.txt +0 -1
  262. package/skills/grade-paper-writing/fixtures/control_human_paper.txt +0 -1
  263. package/skills/grade-paper-writing/fixtures/rewrite.txt +0 -1
  264. package/skills/grade-paper-writing/fixtures/specimen.txt +0 -1
  265. package/skills/grade-paper-writing/fixtures/structure-checks.md +0 -22
  266. package/skills/grade-paper-writing/grade-paper-writing.eval.mjs +0 -19
  267. package/skills/grade-paper-writing/grade-paper-writing.harness.mjs +0 -23
  268. package/skills/grade-paper-writing/prose-lint.mjs +0 -602
  269. package/skills/grade-paper-writing/prose-lint.test.ts +0 -413
  270. package/skills/osf-artifact-upload/SKILL.md +0 -58
  271. package/skills/osf-artifact-upload/SKILL.md.spec.ts +0 -65
  272. package/skills/osf-artifact-upload/osf-artifact-upload.eval.mjs +0 -22
  273. package/skills/osf-artifact-upload/osf-artifact-upload.harness.ts +0 -102
  274. package/skills/paper-adversarial-review/SKILL.md +0 -100
  275. package/skills/paper-adversarial-review/SKILL.md.spec.ts +0 -107
  276. package/skills/paper-adversarial-review/paper-adversarial-review.eval.mjs +0 -19
  277. package/skills/paper-adversarial-review/paper-adversarial-review.harness.mjs +0 -24
  278. package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +0 -1274
  279. package/skills/paper-pipeline/references/credit-criteria.md +0 -69
  280. package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/README.md +0 -35
  281. package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/run_retext.mjs +0 -24
  282. package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/sentences.txt +0 -11
  283. package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/test_sentences.py +0 -25
  284. package/skills/paper-pipeline/references/occupancy-2026-08-06-prose-checkers.md +0 -538
  285. package/skills/paper-pipeline/references/occupancy-2026-08-06-reproducible-tooling.md +0 -431
  286. package/skills/paper-pipeline/references/occupancy-2026-08-06-staleness-and-orchestration.md +0 -592
  287. package/skills/paper-pipeline/repro/2026-08-08-parent-replication.mjs +0 -92
  288. package/skills/render-paper/SKILL.md +0 -123
  289. package/skills/render-paper/SKILL.md.spec.ts +0 -130
  290. package/skills/render-paper/render-paper.eval.mjs +0 -19
  291. package/skills/submission-portal/SKILL.md +0 -129
  292. package/skills/submission-portal/SKILL.md.spec.ts +0 -134
  293. package/skills/submission-portal/submission-portal.eval.mjs +0 -15
  294. package/skills/submission-portal/submission-portal.test.ts +0 -12
  295. package/skills/sweep-design-space/SKILL.md +0 -232
  296. package/skills/sweep-design-space/SKILL.md.spec.ts +0 -248
  297. package/skills/sweep-design-space/sweep-design-space.eval.mjs +0 -19
  298. package/skills/sweep-design-space/sweep-design-space.harness.mjs +0 -23
  299. package/src/paper-prose.test.ts +0 -78
  300. package/src/paper-prose.ts +0 -67
@@ -0,0 +1,481 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * pipeline.ts — the skill pipeline, read from the skills themselves, checked, and drawn.
4
+ *
5
+ * Each `skills/<name>/SKILL.md.spec.ts` exports `flow`: its stage and three kinds of edge (see `Flow`),
6
+ * as imports of other specs, so a misspelled or deleted skill fails the type-check. `skills/jobs.ts`
7
+ * maps each job on a paper's text to its one owner. This script refuses a pipeline that:
8
+ *
9
+ * 1. has a skill folder whose spec exports no `flow`, or an edge to a skill that has no folder;
10
+ * 2. has a cycle in the hands-to edges (calls and loops back may circle; they are not the path);
11
+ * 3. hands to a skill of an earlier stage (that edge is a call or a loop back);
12
+ * 4. has an edge to a skill the source's own SKILL.md never names;
13
+ * 5. has a job with no owner, or an owner that is not a skill folder;
14
+ *
15
+ * and then writes `docs/pipeline.md`: an overview of the stages with the hand-offs and loops between
16
+ * them, the router as text, and one small picture per stage whose boxes list the jobs a skill owns
17
+ * and the skills it runs. `--check` writes nothing and fails when the file on disk differs.
18
+ *
19
+ * Run: `npm run pipeline` (write) · `node scripts/pipeline.ts --check` (also `test/pipeline.test.ts`)
20
+ */
21
+ import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
22
+ import { dirname, join } from "node:path";
23
+ import { fileURLToPath, pathToFileURL } from "node:url";
24
+ import { DepGraph } from "dependency-graph";
25
+ import { chunk, groupBy, sortBy, uniqueBy } from "remeda";
26
+ import { z } from "zod";
27
+ import { isMain } from "../skills/paper-pipeline/scripts/consumer.mjs";
28
+ import { JOBS } from "../skills/jobs.ts";
29
+
30
+ /** The stages of `docs/skills.md`, in order. */
31
+ const STAGES = [
32
+ "across",
33
+ "idea",
34
+ "venue",
35
+ "study",
36
+ "draft",
37
+ "review",
38
+ "submit",
39
+ "camera-ready",
40
+ "extend",
41
+ ] as const;
42
+
43
+ export type Stage = (typeof STAGES)[number];
44
+
45
+ /** The title each stage's subgraph shows. */
46
+ const STAGE_TITLES: Readonly<Record<Stage, string>> = {
47
+ across: "Across every stage",
48
+ idea: "1 · Idea",
49
+ venue: "2 · Venue",
50
+ study: "3 · Study",
51
+ draft: "4 · Draft",
52
+ review: "5 · Review",
53
+ submit: "6 · Submit",
54
+ "camera-ready": "7 · Camera-ready",
55
+ extend: "8 · Extend",
56
+ };
57
+
58
+ /** The stages drawn as pictures; `across` is the router, written as text. */
59
+ const PICTURED = STAGES.filter((st) => st !== "across");
60
+
61
+ /** What a skill spec's default export carries that this script reads. */
62
+ export interface SkillSpec {
63
+ readonly name: string;
64
+ }
65
+
66
+ /**
67
+ * The `flow` export of a skill spec. The lists are functions, so two specs may import each other.
68
+ *
69
+ * - `handsTo`: this skill is done, and the named skill is the next step on the main path;
70
+ * - `calls`: this skill runs or delegates to the named skill as one of its own steps, or needs its
71
+ * output (an orchestrator or a gate running sub-skills);
72
+ * - `loopsBackTo`: work is sent back to an earlier skill.
73
+ */
74
+ export interface Flow {
75
+ readonly stage: Stage;
76
+ readonly handsTo: () => readonly SkillSpec[];
77
+ readonly calls?: (() => readonly SkillSpec[]) | undefined;
78
+ readonly loopsBackTo?: (() => readonly SkillSpec[]) | undefined;
79
+ }
80
+
81
+ /** A skill folder as read from disk: its name, its flow (if the spec exports one) and its SKILL.md. */
82
+ export interface Skill {
83
+ readonly name: string;
84
+ readonly flow: Flow | undefined;
85
+ readonly text: string;
86
+ }
87
+
88
+ /** Job → owner spec; an owner may be missing only in a broken table. */
89
+ export type Jobs = Readonly<Record<string, SkillSpec | undefined>>;
90
+
91
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
92
+ const OUT = join("docs", "pipeline.md");
93
+ const SPEC = "SKILL.md.spec.ts";
94
+
95
+ const CycleError = z.object({ cyclePath: z.array(z.string()) });
96
+ const isFunction = (v: unknown): v is () => unknown => typeof v === "function";
97
+ const SpecModule = z.object({
98
+ default: z.object({ name: z.string() }),
99
+ flow: z
100
+ .object({
101
+ stage: z.enum(STAGES),
102
+ handsTo: z.custom<() => readonly SkillSpec[]>(isFunction),
103
+ calls: z.custom<() => readonly SkillSpec[]>(isFunction).optional(),
104
+ loopsBackTo: z.custom<() => readonly SkillSpec[]>(isFunction).optional(),
105
+ })
106
+ .optional(),
107
+ });
108
+
109
+ /** Every folder under `<root>/skills/` that holds a SKILL.md, with its spec's flow, sorted by name. */
110
+ export async function loadSkills(root: string): Promise<readonly Skill[]> {
111
+ const dirs = readdirSync(join(root, "skills"), { withFileTypes: true })
112
+ .filter(
113
+ (e) =>
114
+ e.isDirectory() && existsSync(join(root, "skills", e.name, "SKILL.md")),
115
+ )
116
+ .map((e) => e.name)
117
+ .sort();
118
+ return Promise.all(
119
+ dirs.map(async (name) => {
120
+ const dir = join(root, "skills", name);
121
+ const mod = SpecModule.parse(
122
+ await import(pathToFileURL(join(dir, SPEC)).href),
123
+ );
124
+ return {
125
+ name: mod.default.name,
126
+ flow: mod.flow,
127
+ text: readFileSync(join(dir, "SKILL.md"), "utf8"),
128
+ };
129
+ }),
130
+ );
131
+ }
132
+
133
+ const handsTo = (s: Skill): readonly string[] =>
134
+ (s.flow?.handsTo() ?? []).map((t) => t.name);
135
+ const calls = (s: Skill): readonly string[] =>
136
+ (s.flow?.calls?.() ?? []).map((t) => t.name);
137
+ const loopsBackTo = (s: Skill): readonly string[] =>
138
+ (s.flow?.loopsBackTo?.() ?? []).map((t) => t.name);
139
+
140
+ /** Check 1: a folder whose spec exports no `flow`, and an arrow to a skill that has no folder. */
141
+ export function missing(skills: readonly Skill[]): string[] {
142
+ const names = new Set(skills.map((s) => s.name));
143
+ const arrows = (verb: string, of: (s: Skill) => readonly string[]) =>
144
+ skills.flatMap((s) =>
145
+ of(s)
146
+ .filter((t) => !names.has(t))
147
+ .map((t) => `"${s.name}" ${verb} "${t}", which is not a skill folder`),
148
+ );
149
+ return [
150
+ ...skills
151
+ .filter((s) => s.flow === undefined)
152
+ .map((s) => `skills/${s.name}/${SPEC} exports no \`flow\``),
153
+ ...arrows("hands to", handsTo),
154
+ ...arrows("calls", calls),
155
+ ...arrows("loops back to", loopsBackTo),
156
+ ];
157
+ }
158
+
159
+ /** Check 2: the first cycle in the hands-to arrows, as a message naming its path; loops back excluded. */
160
+ export function findCycle(skills: readonly Skill[]): string | undefined {
161
+ const graph = new DepGraph<string>({ circular: false });
162
+ skills.forEach((s) => {
163
+ graph.addNode(s.name);
164
+ });
165
+ skills.forEach((s) => {
166
+ handsTo(s)
167
+ .filter((t) => graph.hasNode(t))
168
+ .forEach((t) => {
169
+ graph.addDependency(s.name, t);
170
+ });
171
+ });
172
+ try {
173
+ graph.overallOrder();
174
+ return undefined;
175
+ } catch (e) {
176
+ // `overallOrder` on a graph built only from `addNode` and `addDependency` between existing
177
+ // nodes throws one thing: `DepGraphCycleError`, with the cycle's path.
178
+ const { cyclePath } = CycleError.parse(e);
179
+ return `cycle in handsTo: ${cyclePath.join(" → ")} (mark the edge that returns as loopsBackTo)`;
180
+ }
181
+ }
182
+
183
+ /** The skill-name tokens of a text: runs of lowercase letters, digits and hyphens. */
184
+ const tokens = (text: string): ReadonlySet<string> =>
185
+ new Set(text.split(/[^a-z0-9-]+/));
186
+
187
+ /** Check 4: an edge whose source's SKILL.md never names its target. One-way: data → text. */
188
+ export function unnamedTargets(skills: readonly Skill[]): string[] {
189
+ return skills.flatMap((s) => {
190
+ const named = tokens(s.text);
191
+ return [
192
+ ...handsTo(s).map((t) => ["hands to", t] as const),
193
+ ...calls(s).map((t) => ["calls", t] as const),
194
+ ...loopsBackTo(s).map((t) => ["loops back to", t] as const),
195
+ ]
196
+ .filter(([, t]) => !named.has(t))
197
+ .map(
198
+ ([verb, t]) =>
199
+ `${s.name} ${verb} ${t}, but its SKILL.md never names it`,
200
+ );
201
+ });
202
+ }
203
+
204
+ /** An edge between two skills that both have a flow, with the stage of each end. */
205
+ interface Edge {
206
+ readonly from: string;
207
+ readonly to: string;
208
+ readonly kind: "hands" | "loops";
209
+ readonly fromStage: Stage;
210
+ readonly toStage: Stage;
211
+ }
212
+
213
+ /** The hand-offs and loops back whose two ends are known; an unknown end is check 1's to report. */
214
+ function edges(skills: readonly Skill[]): readonly Edge[] {
215
+ const stageOf = new Map(
216
+ skills.flatMap((s) => (s.flow ? [[s.name, s.flow.stage] as const] : [])),
217
+ );
218
+ return skills.flatMap(({ name, flow }) => {
219
+ const of = (kind: Edge["kind"], to: string): Edge[] => {
220
+ const toStage = stageOf.get(to);
221
+ return flow === undefined || toStage === undefined
222
+ ? []
223
+ : [{ from: name, to, kind, fromStage: flow.stage, toStage }];
224
+ };
225
+ return [
226
+ ...(flow?.handsTo() ?? []).flatMap((t) => of("hands", t.name)),
227
+ ...(flow?.loopsBackTo?.() ?? []).flatMap((t) => of("loops", t.name)),
228
+ ];
229
+ });
230
+ }
231
+
232
+ /** Check 3: a hand-off to a skill of an earlier stage; a call or a loop back may go there. */
233
+ export function handsBackwards(skills: readonly Skill[]): string[] {
234
+ return edges(skills)
235
+ .filter(
236
+ (e) =>
237
+ e.kind === "hands" &&
238
+ STAGES.indexOf(e.toStage) < STAGES.indexOf(e.fromStage),
239
+ )
240
+ .map(
241
+ (e) =>
242
+ `${e.from} hands to ${e.to}, an earlier stage (${STAGE_TITLES[e.fromStage]} → ${STAGE_TITLES[e.toStage]}): use loopsBackTo or calls`,
243
+ );
244
+ }
245
+
246
+ /** Check 5: a job with no owner, or an owner that is not a skill folder. */
247
+ export function jobProblems(jobs: Jobs, skills: readonly Skill[]): string[] {
248
+ const names = new Set(skills.map((s) => s.name));
249
+ return Object.entries(jobs).flatMap(([job, owner]) =>
250
+ owner === undefined
251
+ ? [`job "${job}" has no owner`]
252
+ : names.has(owner.name)
253
+ ? []
254
+ : [
255
+ `job "${job}" is owned by "${owner.name}", which is not a skill folder`,
256
+ ],
257
+ );
258
+ }
259
+
260
+ /** Every problem the four checks find, missing pieces first. */
261
+ export function problems(skills: readonly Skill[], jobs: Jobs): string[] {
262
+ const cycle = findCycle(skills);
263
+ return [
264
+ ...missing(skills),
265
+ ...(cycle === undefined ? [] : [cycle]),
266
+ ...handsBackwards(skills),
267
+ ...unnamedTargets(skills),
268
+ ...jobProblems(jobs, skills),
269
+ ];
270
+ }
271
+
272
+ /** A Mermaid id: `cold-read-diff` → `cold_read_diff` (a hyphen in an id can read as an arrow). */
273
+ const id = (name: string): string => name.replaceAll("-", "_");
274
+
275
+ /** The id of a stage's box; `stage_` keeps the stage `camera-ready` apart from the skill `camera-ready`. */
276
+ const stageId = (stage: Stage): string => `stage_${id(stage)}`;
277
+
278
+ /** A job key `find unclear sentences/the last edit` as a box line: `find unclear sentences (the last edit)`. */
279
+ const jobLine = (job: string): string => {
280
+ const slash = job.indexOf("/");
281
+ return slash < 0 ? job : `${job.slice(0, slash)} (${job.slice(slash + 1)})`;
282
+ };
283
+
284
+ /** Names three to a line, so a box or a label stays narrow. */
285
+ const wrap = (names: readonly string[]): string =>
286
+ chunk(names, 3)
287
+ .map((line) => line.join(", "))
288
+ .join(",<br/>");
289
+
290
+ /** The arrow between two boxes: solid for a hand-off, dashed for a loop back. */
291
+ const arrow = (e: Edge, from: string, to: string, label?: string): string => {
292
+ const solid = e.kind === "hands";
293
+ return label === undefined
294
+ ? ` ${from} ${solid ? "-->" : "-.->"} ${to}`
295
+ : ` ${from} ${solid ? "--" : "-."} "${label}" ${solid ? "-->" : ".->"} ${to}`;
296
+ };
297
+
298
+ /** The skills of one stage, in name order. */
299
+ const inStage = (skills: readonly Skill[], stage: Stage): readonly Skill[] =>
300
+ skills.filter((s) => s.flow?.stage === stage);
301
+
302
+ /** The overview: a box per stage, left to right, its skills listed; arrows only between stages. */
303
+ function overview(skills: readonly Skill[]): string[] {
304
+ const between = uniqueBy(
305
+ edges(skills).filter((e) => e.fromStage !== e.toStage),
306
+ (e) => `${e.fromStage} ${e.toStage} ${e.kind}`,
307
+ );
308
+ // In stage order, hand-offs first: Mermaid places boxes in the order their edges come.
309
+ const ordered = sortBy(
310
+ between,
311
+ (e) => e.kind,
312
+ (e) => STAGES.indexOf(e.fromStage),
313
+ (e) => STAGES.indexOf(e.toStage),
314
+ );
315
+ return [
316
+ "flowchart LR",
317
+ ...PICTURED.map(
318
+ (st) =>
319
+ ` ${stageId(st)}["<b>${STAGE_TITLES[st]}</b><br/>${inStage(skills, st)
320
+ .map((s) => s.name)
321
+ .join("<br/>")}"]`,
322
+ ),
323
+ ...ordered.map((e) => arrow(e, stageId(e.fromStage), stageId(e.toStage))),
324
+ ];
325
+ }
326
+
327
+ /** A skill's box: its name, the jobs it owns, and the skills it runs. */
328
+ const box = (s: Skill, jobs: Jobs): string => {
329
+ const owned = Object.entries(jobs)
330
+ .filter(([, owner]) => owner?.name === s.name)
331
+ .map(([job]) => jobLine(job));
332
+ const runs = calls(s);
333
+ return ` ${id(s.name)}["${[
334
+ `<b>${s.name}</b>`,
335
+ ...owned,
336
+ ...(runs.length > 0 ? [`runs: ${wrap(runs)}`] : []),
337
+ ].join("<br/>")}"]`;
338
+ };
339
+
340
+ /** One stage's picture: its skills, the arrows inside it, and one stub box per stage an arrow leaves for. */
341
+ function stagePicture(
342
+ skills: readonly Skill[],
343
+ jobs: Jobs,
344
+ stage: Stage,
345
+ ): string[] {
346
+ const from = edges(skills).filter((e) => e.fromStage === stage);
347
+ const leaving = from.filter((e) => e.toStage !== stage);
348
+ const stub = (e: Edge) => `to_${stageId(e.toStage)}`;
349
+ return [
350
+ "flowchart TB",
351
+ ...inStage(skills, stage).map((s) => box(s, jobs)),
352
+ ...from
353
+ .filter((e) => e.toStage === stage)
354
+ .map((e) => arrow(e, id(e.from), id(e.to))),
355
+ ...uniqueBy(leaving, (e) => e.toStage).map(
356
+ (e) => ` ${stub(e)}(["→ ${STAGE_TITLES[e.toStage]}"])`,
357
+ ),
358
+ ...Object.values(
359
+ groupBy(leaving, (e) => `${e.from} ${e.toStage} ${e.kind}`),
360
+ ).map((group) =>
361
+ arrow(
362
+ group[0],
363
+ id(group[0].from),
364
+ stub(group[0]),
365
+ wrap(group.map((e) => e.to)),
366
+ ),
367
+ ),
368
+ ];
369
+ }
370
+
371
+ /** The skills of no single stage, as text: the router's calls would be one arrow per stage skill. */
372
+ function across(skills: readonly Skill[], jobs: Jobs): string[] {
373
+ return inStage(skills, "across").map((s) => {
374
+ const owned = Object.entries(jobs)
375
+ .filter(([, owner]) => owner?.name === s.name)
376
+ .map(([job]) => jobLine(job));
377
+ const owns = owned.length > 0 ? ` (owns: ${owned.join("; ")})` : "";
378
+ const runs = calls(s);
379
+ return runs.length > 0
380
+ ? `- \`${s.name}\`${owns} runs ${String(runs.length)} skills: ${runs.map((r) => `\`${r}\``).join(", ")}.`
381
+ : `- \`${s.name}\`${owns}.`;
382
+ });
383
+ }
384
+
385
+ const fence = (lines: readonly string[]): string[] => [
386
+ "```mermaid",
387
+ ...lines,
388
+ "```",
389
+ ];
390
+
391
+ /** The text above the pictures: what they are drawn from and what each kind of edge means. */
392
+ function intro(skills: readonly Skill[]): string[] {
393
+ const count = (of: (s: Skill) => readonly string[]) =>
394
+ String(skills.reduce((n, s) => n + of(s).length, 0));
395
+ return [
396
+ "# The skill pipeline",
397
+ "",
398
+ "<!-- Generated by `npm run pipeline` from each skill's `flow` export and `skills/jobs.ts`. Do not edit by hand. -->",
399
+ "",
400
+ "Who hands work to whom, read from the skills themselves: each `skills/<name>/SKILL.md.spec.ts`",
401
+ "exports `flow`, and `skills/jobs.ts` names the one owner of each job on a paper's text. A flow",
402
+ `has three kinds of edge: **hands to** (${count(handsTo)}), the next step on the main path, drawn`,
403
+ `solid; **loops back to** (${count(loopsBackTo)}), work sent back to an earlier skill, drawn dashed;`,
404
+ `**runs** (${count(calls)}), a skill this one runs as one of its own steps or whose output it needs,`,
405
+ "written inside the box, never drawn. `test/pipeline.test.ts` fails on a cycle of hand-offs, a",
406
+ "hand-off to an earlier stage, an edge the skill's own text never names, a job without an owner,",
407
+ "and this file when it is stale. The stages are those of [`skills.md`](skills.md).",
408
+ ];
409
+ }
410
+
411
+ /** `docs/pipeline.md`: what the pictures are, the overview, the router, then one picture per stage. */
412
+ export function render(skills: readonly Skill[], jobs: Jobs): string {
413
+ return [
414
+ ...intro(skills),
415
+ "",
416
+ "## The stages",
417
+ "",
418
+ "Each arrow stands for one or more edges between skills of the two stages.",
419
+ "",
420
+ ...fence(overview(skills)),
421
+ "",
422
+ "## Across every stage",
423
+ "",
424
+ ...across(skills, jobs),
425
+ ...PICTURED.flatMap((st) => [
426
+ "",
427
+ `## ${STAGE_TITLES[st]}`,
428
+ "",
429
+ ...fence(stagePicture(skills, jobs, st)),
430
+ ]),
431
+ "",
432
+ ].join("\n");
433
+ }
434
+
435
+ /** What `main` reads and writes through; a test replaces any of them. */
436
+ interface Deps {
437
+ readonly root: string;
438
+ readonly load: (root: string) => Promise<readonly Skill[]>;
439
+ readonly jobs: Jobs;
440
+ readonly log: (line: string) => void;
441
+ readonly err: (line: string) => void;
442
+ }
443
+
444
+ const DEPS: Deps = {
445
+ root: ROOT,
446
+ load: loadSkills,
447
+ jobs: JOBS,
448
+ log: console.log,
449
+ err: console.error,
450
+ };
451
+
452
+ /** `--check`: 0 when the file on disk is `text`, else 1 naming the fix. */
453
+ function compare(path: string, text: string, { log, err }: Deps): number {
454
+ const current = existsSync(path) && readFileSync(path, "utf8") === text;
455
+ if (current) log(`${OUT} is current`);
456
+ else err(`${OUT} is stale: run npm run pipeline`);
457
+ return current ? 0 : 1;
458
+ }
459
+
460
+ /** Write `docs/pipeline.md`, or with `--check` compare it. Refuses a broken pipeline either way. */
461
+ export async function main(
462
+ argv: readonly string[],
463
+ overrides: Partial<Deps> = {},
464
+ ): Promise<number> {
465
+ const deps = { ...DEPS, ...overrides };
466
+ const skills = await deps.load(deps.root);
467
+ const found = problems(skills, deps.jobs);
468
+ found.forEach((p) => {
469
+ deps.err(p);
470
+ });
471
+ if (found.length > 0) return 1;
472
+ const text = render(skills, deps.jobs);
473
+ const path = join(deps.root, OUT);
474
+ if (argv.includes("--check")) return compare(path, text, deps);
475
+ writeFileSync(path, text);
476
+ deps.log(`wrote ${OUT}`);
477
+ return 0;
478
+ }
479
+
480
+ // `isMain`, not a comparison with `file://${argv[1]}`: that is false through a symlink (consumer.mjs).
481
+ if (isMain(import.meta.url)) process.exit(await main(process.argv.slice(2)));
package/skills/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- vigiles:sha256:5a8bf895a34de689 compiled from skills/CLAUDE.md.spec.ts -->
1
+ <!-- vigiles:sha256:7c3a2ced786e9294 compiled from skills/CLAUDE.md.spec.ts -->
2
2
 
3
3
  # CLAUDE.md
4
4
 
@@ -16,7 +16,7 @@ package's location come from `skills/paper-pipeline/scripts/consumer.mjs`; the l
16
16
 
17
17
  ### One Owner Per Job
18
18
 
19
- **Guidance only** — Each job on a paper's text has one owner skill, and the others hand over to it instead of carrying their own instructions for it: find unclear sentences — `cold-read-diff` (the last edit), `grade-paper-writing` (the whole paper); grade the prose — `grade-paper-writing`; rewrite for clarity — `rewrite-unclear`; cut for length — `tighten-paper`; the order of the argument — `argument-arc`; is it ready to submit — `harden-paper`; which stage runs next — `paper-pipeline`. A skill that finds a problem it does not own names the owner and stops. A second copy of an owner's rule in another skill is a defect: two copies drift, and the reader follows whichever it read last.
19
+ **Guidance only** — Each job on a paper's text has one owner skill, and the others hand over to it instead of carrying their own instructions for it: find unclear sentences — `cold-read-diff`; rewrite for clarity — `rewrite-unclear`; cut for length — `tighten-paper`; the order of the argument — `argument-arc`; judge headings — `cold-read-diff` (a heading in the last edit), `argument-arc` (the headings as a set); one name for one thing across the paper — `argument-arc` (the name budget); fix a heading or a name — `rewrite-unclear`; is it ready to submit — `harden-paper`; which stage runs next — `paper-pipeline`; the final review — `paper-pipeline`. The owners are `skills/jobs.ts`; who hands work to whom is each skill's `flow`, drawn in `docs/pipeline.md` and checked by `test/pipeline.test.ts`. A skill that finds a problem it does not own names the owner and stops. A second copy of an owner's rule in another skill is a defect: two copies drift, and the reader follows whichever it read last.
20
20
 
21
21
  ### A Criterion That Judges Prose
22
22
 
@@ -1,5 +1,30 @@
1
1
  // Compiled to skills/CLAUDE.md by `npx vigiles compile`. Edit THIS file, never the markdown.
2
2
  import { file, guidance, instructionFile, prose } from "vigiles/spec";
3
+ import { JOBS } from "./jobs.ts";
4
+
5
+ /**
6
+ * The owner list of "One Owner Per Job", printed from `JOBS`: the jobs in table order, each with its
7
+ * owners and, where a job is split, the scope after the key's `/`. The prose and the data are one copy.
8
+ */
9
+ const named = Object.entries(JOBS).map(([key, owner]) => {
10
+ const [job = key, scope] = key.split("/");
11
+ return {
12
+ job,
13
+ owner:
14
+ scope === undefined
15
+ ? `\`${owner.name}\``
16
+ : `\`${owner.name}\` (${scope})`,
17
+ };
18
+ });
19
+ const owners = [...new Set(named.map((n) => n.job))]
20
+ .map(
21
+ (job) =>
22
+ `${job} — ${named
23
+ .filter((n) => n.job === job)
24
+ .map((n) => n.owner)
25
+ .join(", ")}`,
26
+ )
27
+ .join("; ");
3
28
 
4
29
  export default instructionFile({
5
30
  sections: {
@@ -12,7 +37,7 @@ ${file("src/link-skills.ts")}; install-specific paths are flagged by ${file("esl
12
37
  "Skills ship in `skills/`, never `.claude/skills/`. `paperlint init` symlinks each one into the consumer's `.claude/skills/<name>`; the link's directory name is the skill's name. `skills/` is the npm layout: of 855 packages scanned, 336 shipped `skills/` against 15 `.claude/skills/`. Rejected: leaving the skills for Claude Code to find inside `node_modules` (`docs/install.md`); a symlink loads at startup, deterministically. A skill for working on paperlint itself (it edits this repository's presets, tests or source) does not ship: it lives in `.claude/skills/<name>/` as a real directory, outside `files`, and no shipped skill or user doc names it (`add-venue`).",
13
38
  ),
14
39
  "one-owner-per-job": guidance(
15
- "Each job on a paper's text has one owner skill, and the others hand over to it instead of carrying their own instructions for it: find unclear sentences — `cold-read-diff` (the last edit), `grade-paper-writing` (the whole paper); grade the prose — `grade-paper-writing`; rewrite for clarity — `rewrite-unclear`; cut for length — `tighten-paper`; the order of the argument — `argument-arc`; is it ready to submit — `harden-paper`; which stage runs next — `paper-pipeline`. A skill that finds a problem it does not own names the owner and stops. A second copy of an owner's rule in another skill is a defect: two copies drift, and the reader follows whichever it read last.",
40
+ `Each job on a paper's text has one owner skill, and the others hand over to it instead of carrying their own instructions for it: ${owners}. The owners are \`skills/jobs.ts\`; who hands work to whom is each skill's \`flow\`, drawn in \`docs/pipeline.md\` and checked by \`test/pipeline.test.ts\`. A skill that finds a problem it does not own names the owner and stops. A second copy of an owner's rule in another skill is a defect: two copies drift, and the reader follows whichever it read last.`,
16
41
  ),
17
42
  "a-criterion-that-judges-prose": guidance(
18
43
  'It follows the five principles in `eslint-rules/CLAUDE.md` ("A rule that judges prose"). A skill does not grep prose for what a rule can count.',
@@ -6,7 +6,7 @@ model: sonnet
6
6
  allowed-tools: [WebSearch, WebFetch, Read, Write, Grep, Glob, Bash, Agent]
7
7
  ---
8
8
 
9
- <!-- vigiles:sha256:17c3e0a4c03c6a33 compiled from skills/analyze-sibling-paper/SKILL.md.spec.ts -->
9
+ <!-- vigiles:sha256:eb9517b7e735066c compiled from skills/analyze-sibling-paper/SKILL.md.spec.ts -->
10
10
 
11
11
  # analyze-sibling-paper — settle "isn't this just X?" before a reviewer does
12
12
 
@@ -15,8 +15,7 @@ leaves a scoop risk you can't see and a reviewer can. This skill reads the *actu
15
15
  whether your contribution genuinely differs, and produces a saved analysis with concrete action points
16
16
  (the exact positioning clause to add, or — if it's a real scoop — an escalation, not a clause).
17
17
 
18
- Grounding: the original-contribution criterion (a paper a
19
- reviewer thinks is a repackaging earns no authorship credit even if accepted). Composes with
18
+ A paper a reviewer reads as a repackaging is rejected as incremental. Composes with
20
19
  `verify-citations` (which surfaces the nearest neighbors) and `harden-paper` (whose scoop axis calls this).
21
20
 
22
21
  ## When it fires
@@ -122,20 +121,3 @@ again at rebuttal. **A close sibling with no file in `<paper-dir>/siblings/` is
122
121
  - `harden-paper` — its nearest-neighbor-scoop axis (axis 3) calls this for each close competitor.
123
122
  - `study-accepted-papers` — venue-corpus levers (different axis: what the venue rewards, not a specific rival).
124
123
  - `extend-paper` — a scooped angle, or the un-scooped remainder, can become the next paper's pivot.
125
-
126
- ## Provenance
127
- Built from the **AISec 2026 GateBench** run: `verify-citations` flagged **AgentTrust** (yang2026agenttrust,
128
- arXiv:2606.08539) as making the same lexical-vs-semantic split the paper's spelling→grammar→effect framing
129
- builds on — the sharpest "isn't this just X?" in the paper. Citing it from the abstract was not enough to
130
- know whether the framing was a repackaging; only a deep read of the actual paper, classified by
131
- contribution type (their trust-*system* vs our *measurement + benchmark + existence result*) and dated
132
- against submission, could settle the delta and produce the head-on positioning clause. That is exactly
133
- the workflow this skill encodes.
134
-
135
- **Extended 2026-07-29** — *What Breaks When LLMs Code?* (arXiv:2605.30777) was cited into the
136
- `the reference paper` introduction **from its abstract**, and a card was written saying so. Two gaps
137
- surfaced immediately: the full text was never read (so the "no scoop" verdict rested on an abstract),
138
- and its reference list — assembled by authors who had just screened 68,816 papers across 22 venues —
139
- was never opened at all. Both are now steps 1–2, and both are machine-checked in the saved card, because
140
- the previous version of this rule already said "read the paper, not the abstract" in prose and that did
141
- not stop it happening. Prose isn't policy.
@@ -5,6 +5,8 @@
5
5
  // `SkillSpec` in vigiles branch `claude/skill-disallowed-tools` and is not in a release
6
6
  // this repo installs, so writing one here would not compile.
7
7
  import { experimental_skill } from "vigiles/spec";
8
+ import type { Flow } from "../../scripts/pipeline.ts";
9
+ import extendPaper from "../extend-paper/SKILL.md.spec.ts";
8
10
 
9
11
  export default experimental_skill({
10
12
  name: "analyze-sibling-paper",
@@ -33,8 +35,7 @@ leaves a scoop risk you can't see and a reviewer can. This skill reads the *actu
33
35
  whether your contribution genuinely differs, and produces a saved analysis with concrete action points
34
36
  (the exact positioning clause to add, or — if it's a real scoop — an escalation, not a clause).
35
37
 
36
- Grounding: the original-contribution criterion (a paper a
37
- reviewer thinks is a repackaging earns no authorship credit even if accepted). Composes with
38
+ A paper a reviewer reads as a repackaging is rejected as incremental. Composes with
38
39
  \`verify-citations\` (which surfaces the nearest neighbors) and \`harden-paper\` (whose scoop axis calls this).
39
40
 
40
41
  ## When it fires
@@ -140,21 +141,10 @@ again at rebuttal. **A close sibling with no file in \`<paper-dir>/siblings/\` i
140
141
  - \`harden-paper\` — its nearest-neighbor-scoop axis (axis 3) calls this for each close competitor.
141
142
  - \`study-accepted-papers\` — venue-corpus levers (different axis: what the venue rewards, not a specific rival).
142
143
  - \`extend-paper\` — a scooped angle, or the un-scooped remainder, can become the next paper's pivot.
143
-
144
- ## Provenance
145
- Built from the **AISec 2026 GateBench** run: \`verify-citations\` flagged **AgentTrust** (yang2026agenttrust,
146
- arXiv:2606.08539) as making the same lexical-vs-semantic split the paper's spelling→grammar→effect framing
147
- builds on — the sharpest "isn't this just X?" in the paper. Citing it from the abstract was not enough to
148
- know whether the framing was a repackaging; only a deep read of the actual paper, classified by
149
- contribution type (their trust-*system* vs our *measurement + benchmark + existence result*) and dated
150
- against submission, could settle the delta and produce the head-on positioning clause. That is exactly
151
- the workflow this skill encodes.
152
-
153
- **Extended 2026-07-29** — *What Breaks When LLMs Code?* (arXiv:2605.30777) was cited into the
154
- \`the reference paper\` introduction **from its abstract**, and a card was written saying so. Two gaps
155
- surfaced immediately: the full text was never read (so the "no scoop" verdict rested on an abstract),
156
- and its reference list — assembled by authors who had just screened 68,816 papers across 22 venues —
157
- was never opened at all. Both are now steps 1–2, and both are machine-checked in the saved card, because
158
- the previous version of this rule already said "read the paper, not the abstract" in prose and that did
159
- not stop it happening. Prose isn't policy.`,
144
+ `,
160
145
  });
146
+
147
+ export const flow = {
148
+ stage: "idea",
149
+ handsTo: () => [extendPaper],
150
+ } satisfies Flow;