paperlint 18.7.0 → 18.8.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.
- package/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +7 -0
- package/CLAUDE.md +2 -2
- package/README.md +2 -2
- package/dist/adapters/claude-code/claude.io.d.ts +13 -0
- package/dist/adapters/claude-code/claude.io.d.ts.map +1 -0
- package/dist/adapters/claude-code/claude.io.js +68 -0
- package/dist/adapters/claude-code/claude.io.js.map +1 -0
- package/dist/adapters/claude-code/index.d.ts +4 -0
- package/dist/adapters/claude-code/index.d.ts.map +1 -0
- package/dist/adapters/claude-code/index.js +4 -0
- package/dist/adapters/claude-code/index.js.map +1 -0
- package/dist/adapters/claude-code/plugin.d.ts +19 -0
- package/dist/adapters/claude-code/plugin.d.ts.map +1 -0
- package/dist/adapters/claude-code/plugin.js +66 -0
- package/dist/adapters/claude-code/plugin.js.map +1 -0
- package/dist/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +34 -10
- package/dist/cli.js.map +1 -1
- package/dist/doctor-plugin.d.ts +23 -0
- package/dist/doctor-plugin.d.ts.map +1 -0
- package/dist/doctor-plugin.js +56 -0
- package/dist/doctor-plugin.js.map +1 -0
- package/dist/doctor.d.ts +6 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +69 -26
- package/dist/doctor.js.map +1 -1
- package/dist/hooks-settings.d.ts +18 -0
- package/dist/hooks-settings.d.ts.map +1 -1
- package/dist/hooks-settings.js +25 -0
- package/dist/hooks-settings.js.map +1 -1
- package/dist/init.d.ts +9 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +144 -59
- package/dist/init.js.map +1 -1
- package/dist/link-skills.d.ts +15 -0
- package/dist/link-skills.d.ts.map +1 -1
- package/dist/link-skills.js +18 -1
- package/dist/link-skills.js.map +1 -1
- package/dist/plugin-offer.d.ts +73 -0
- package/dist/plugin-offer.d.ts.map +1 -0
- package/dist/plugin-offer.js +96 -0
- package/dist/plugin-offer.js.map +1 -0
- package/dist/ports/claude-code.d.ts +31 -0
- package/dist/ports/claude-code.d.ts.map +1 -0
- package/dist/ports/claude-code.js +2 -0
- package/dist/ports/claude-code.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/install.md +62 -14
- package/hooks/CLAUDE.md +2 -2
- package/hooks/CLAUDE.md.spec.ts +1 -1
- package/lib/skill-checks.mjs +6 -7
- package/package.json +4 -1
- package/plugin/CLAUDE.md +22 -14
- package/plugin/CLAUDE.md.spec.ts +20 -12
- package/scripts/plugin-version.test.ts +80 -0
- package/scripts/plugin-version.ts +58 -0
- package/skills/CLAUDE.md +2 -2
- package/skills/CLAUDE.md.spec.ts +1 -1
- package/skills/paper-pipeline/references/anonymization.md +4 -3
- package/skills/submit-paper/SKILL.md +5 -4
- package/skills/submit-paper/SKILL.md.spec.ts +4 -3
- package/skills/submit-paper/check-deanon.sh +17 -2
- package/skills/submit-paper/check-deanon.test.ts +141 -0
- package/src/adapters/claude-code/claude.io.ts +103 -0
- package/src/adapters/claude-code/index.test.ts +233 -0
- package/src/adapters/claude-code/index.ts +11 -0
- package/src/adapters/claude-code/plugin.ts +82 -0
- package/src/cli.harness.mjs +6 -0
- package/src/cli.test.ts +87 -1
- package/src/cli.ts +56 -7
- package/src/doctor-plugin.test.ts +103 -0
- package/src/doctor-plugin.ts +83 -0
- package/src/doctor.test.ts +111 -2
- package/src/doctor.ts +83 -32
- package/src/hooks-notice.test.ts +82 -0
- package/src/hooks-settings.ts +49 -0
- package/src/init-plugin.test.ts +178 -0
- package/src/init.ts +225 -64
- package/src/link-skills.test.ts +34 -1
- package/src/link-skills.ts +34 -0
- package/src/parse-args.test.ts +2 -0
- package/src/plugin-offer.test.ts +276 -0
- package/src/plugin-offer.ts +160 -0
- package/src/ports/claude-code.ts +30 -0
- package/src/types.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-skills.d.ts","sourceRoot":"","sources":["../src/link-skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link-skills.d.ts","sourceRoot":"","sources":["../src/link-skills.ts"],"names":[],"mappings":"AA0CA,OAAO,EAEL,YAAY,EAEb,MAAM,+CAA+C,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,gFAAgF;AAChF,eAAO,MAAM,WAAW,QAA4B,CAAC;AAErD,MAAM,MAAM,OAAO,GACf;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,EACE,eAG2C,GAC5C,GAAE;IAAE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CAAO,GACxD,OAAO,CAsBT;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAEZ;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACjE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAa7B;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,UAAU,GAClB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC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AAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,GAEJ;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAcjD"}
|
package/dist/link-skills.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* elsewhere, a dangling link — is someone else's, and is reported, not replaced.
|
|
28
28
|
*/
|
|
29
29
|
/* eslint-disable boundaries/dependencies -- legacy I/O, moves behind a port in #76 */
|
|
30
|
-
import { existsSync, lstatSync, mkdirSync, readlinkSync, realpathSync, symlinkSync, } from "node:fs";
|
|
30
|
+
import { existsSync, lstatSync, mkdirSync, readlinkSync, realpathSync, symlinkSync, unlinkSync, } from "node:fs";
|
|
31
31
|
/* eslint-enable boundaries/dependencies */
|
|
32
32
|
import { createRequire } from "node:module";
|
|
33
33
|
import { dirname, join, relative, resolve } from "node:path";
|
|
@@ -183,6 +183,23 @@ export function linkSkills(project, { write = true, locate = locatePackage, fs =
|
|
|
183
183
|
...linkAll(shipped, { spelledSkills, home, write, fs }),
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Removes the links `init` made — each entry that is a link and leads to the shipped skill — once the
|
|
188
|
+
* Claude Code plugin carries the skills. Anything else of the same name is the project's, and stays.
|
|
189
|
+
*/
|
|
190
|
+
export function unlinkSkills(project, { locate = locatePackage, fs = nodeLinkFs, remove = unlinkSync, } = {}) {
|
|
191
|
+
const report = linkSkills(project, { write: false, locate, fs });
|
|
192
|
+
if (!report.ok)
|
|
193
|
+
return report;
|
|
194
|
+
const removed = report.links
|
|
195
|
+
.filter((l) => l.status === "present" &&
|
|
196
|
+
fs.lstatSync(join(report.home, l.name)).isSymbolicLink())
|
|
197
|
+
.map((l) => l.name);
|
|
198
|
+
removed.forEach((name) => {
|
|
199
|
+
remove(join(report.home, name));
|
|
200
|
+
});
|
|
201
|
+
return { ok: true, removed };
|
|
202
|
+
}
|
|
186
203
|
/** Every shipped skill's link, and the first one's target as the report's example. */
|
|
187
204
|
function linkAll(shipped, { spelledSkills, home, write, fs, }) {
|
|
188
205
|
// A relative target resolves against the directory that PHYSICALLY holds the link, so it is
|
package/dist/link-skills.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-skills.js","sourceRoot":"","sources":["../src/link-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,sFAAsF;AACtF,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,WAAW,
|
|
1
|
+
{"version":3,"file":"link-skills.js","sourceRoot":"","sources":["../src/link-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,sFAAsF;AACtF,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,2CAA2C;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,kBAAkB,GACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA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IAAI,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,sFAAsF;AACtF,SAAS,OAAO,CACd,OAA0E,EAC1E,EACE,aAAa,EACb,IAAI,EACJ,KAAK,EACL,EAAE,GACkE;IAEtE,4FAA4F;IAC5F,kEAAkE;IAClE,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAa,EAAE;QAClD,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;QACjE,OAAO,KAAK,MAAM,CAAC;QACnB,OAAO,OAAO,CAAC,IAAI,EAAE;YACnB,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;YACvB,MAAM;YACN,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YACjD,KAAK;YACL,EAAE;SACH,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `paperlint init` offers the Claude Code plugin, which carries the skills and the hooks and is
|
|
3
|
+
* updated with paperlint (decided 2026-11-22; replaces "link no skills unless asked", #510).
|
|
4
|
+
*
|
|
5
|
+
* ── THE DECISIONS ─────────────────────────────────────────────────────────────
|
|
6
|
+
* who is offered only a project where Claude Code is: a `.claude/` folder, or `claude` on PATH.
|
|
7
|
+
* Anywhere else, silence.
|
|
8
|
+
* a human asked once, Yes preselected; No is respected.
|
|
9
|
+
* no human (--yes, CI, stdin or stdout not a terminal — Claude Code running init is this
|
|
10
|
+
* case) nothing is turned on, and ONE line names why and `--plugin`, so an
|
|
11
|
+
* agent can ask its user.
|
|
12
|
+
* --plugin on, without asking, with or without a terminal.
|
|
13
|
+
* --no-plugin never asked, never on.
|
|
14
|
+
* once it is on init removes the skill links and hook entries IT made: kept beside the
|
|
15
|
+
* plugin, every skill would be listed twice and every hook would run twice.
|
|
16
|
+
* "On" means installed. Keys written without `claude` are only declared: the
|
|
17
|
+
* old wiring stays, and the next init completes the install without asking.
|
|
18
|
+
*/
|
|
19
|
+
import type { AbsolutePath } from "./domain/paths.ts";
|
|
20
|
+
import type { ClaudeCode, EnableResult, PluginState } from "./ports/claude-code.ts";
|
|
21
|
+
import type { Prompts } from "./ports/prompts.ts";
|
|
22
|
+
/** `--plugin`, `--no-plugin`, or neither. */
|
|
23
|
+
export type PluginFlag = "plugin" | "no-plugin" | null;
|
|
24
|
+
export type PluginOutcome = {
|
|
25
|
+
readonly kind: "no-claude";
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "no-plugin-flag";
|
|
28
|
+
}
|
|
29
|
+
/** Declared AND installed: Claude Code has an install of this version on record. */
|
|
30
|
+
| {
|
|
31
|
+
readonly kind: "already";
|
|
32
|
+
readonly version: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "enabled";
|
|
35
|
+
readonly how: Exclude<EnableResult, {
|
|
36
|
+
readonly ok: false;
|
|
37
|
+
}>;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "failed";
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: "declined";
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "not-asked";
|
|
45
|
+
readonly why: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "cancelled";
|
|
48
|
+
};
|
|
49
|
+
export interface PluginAsking {
|
|
50
|
+
readonly flag: PluginFlag;
|
|
51
|
+
readonly interactive: boolean;
|
|
52
|
+
/** Why nothing is asked, as `interactivity()` says it. */
|
|
53
|
+
readonly why: string;
|
|
54
|
+
readonly prompts?: Prompts | undefined;
|
|
55
|
+
}
|
|
56
|
+
export declare const PLUGIN_QUESTION = "Turn on the paperlint plugin for Claude Code? (the skills and hooks, updated with paperlint)";
|
|
57
|
+
/**
|
|
58
|
+
* The plugin's version once Claude Code has installed it, else null. The settings keys alone load
|
|
59
|
+
* nothing (they are written where `claude` is not on PATH too), so every reader that drops the old
|
|
60
|
+
* wiring asks this, never `enabled` by itself.
|
|
61
|
+
*/
|
|
62
|
+
export declare const installedPluginVersion: (state: PluginState | null) => string | null;
|
|
63
|
+
export declare function offerPlugin(root: AbsolutePath, claude: ClaudeCode | undefined, asking: PluginAsking): Promise<PluginOutcome>;
|
|
64
|
+
/** Why the plugin is off although both commands ran. */
|
|
65
|
+
export declare const STILL_OFF = "both commands ran, but Claude Code still reads it as off here: a more specific settings file, such as .claude/settings.local.json, turns paperlint@paperlint off. Remove that entry";
|
|
66
|
+
/**
|
|
67
|
+
* The plugin is on once Claude Code has installed it: the old links and hook entries then go. Keys
|
|
68
|
+
* written without `claude` load nothing, so until the owed commands run the old wiring stays.
|
|
69
|
+
*/
|
|
70
|
+
export declare const pluginOn: (o: PluginOutcome) => boolean;
|
|
71
|
+
/** The plugin section of init's report: a header and its lines, or nothing at all. */
|
|
72
|
+
export declare function reportPlugin(o: PluginOutcome): readonly string[];
|
|
73
|
+
//# sourceMappingURL=plugin-offer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-offer.d.ts","sourceRoot":"","sources":["../src/plugin-offer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,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B,GACjC,OAAO,WAAW,GAAG,IAAI,KACxB,MAAM,GAAG,IAA+C,CAAC;AAQ5D,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,aAAa,CAAC,CAaxB;AAED,wDAAwD;AACxD,eAAO,MAAM,SAAS,wLACiK,CAAC;AAcxL;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,aAAa,KAAG,OACsB,CAAC;AAInE,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CA2BhE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export const PLUGIN_QUESTION = "Turn on the paperlint plugin for Claude Code? (the skills and hooks, updated with paperlint)";
|
|
2
|
+
const ask = async (prompts) => {
|
|
3
|
+
try {
|
|
4
|
+
return await prompts.confirm({ message: PLUGIN_QUESTION, initial: true });
|
|
5
|
+
}
|
|
6
|
+
catch {
|
|
7
|
+
return { kind: "answer", value: true };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
/** Whether to go ahead: the flag, else a human's answer; an outcome when it stops here. */
|
|
11
|
+
async function decided(asking) {
|
|
12
|
+
if (asking.flag === "plugin")
|
|
13
|
+
return null;
|
|
14
|
+
if (!asking.interactive || !asking.prompts)
|
|
15
|
+
return { kind: "not-asked", why: asking.why };
|
|
16
|
+
const answer = await ask(asking.prompts);
|
|
17
|
+
if (answer.kind === "cancel")
|
|
18
|
+
return { kind: "cancelled" };
|
|
19
|
+
return answer.value ? null : { kind: "declined" };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The plugin's version once Claude Code has installed it, else null. The settings keys alone load
|
|
23
|
+
* nothing (they are written where `claude` is not on PATH too), so every reader that drops the old
|
|
24
|
+
* wiring asks this, never `enabled` by itself.
|
|
25
|
+
*/
|
|
26
|
+
export const installedPluginVersion = (state) => (state?.enabled ? state.version : null);
|
|
27
|
+
/** The plugin's state where Claude Code runs in this project, else null. */
|
|
28
|
+
const stateIn = (root, claude) => (claude?.present(root) ? claude.plugin(root) : null);
|
|
29
|
+
export async function offerPlugin(root, claude, asking) {
|
|
30
|
+
// `--no-plugin` skips the offer; it does not turn an installed plugin off, so that is read first.
|
|
31
|
+
const state = stateIn(root, claude);
|
|
32
|
+
const version = installedPluginVersion(state);
|
|
33
|
+
if (version !== null)
|
|
34
|
+
return { kind: "already", version };
|
|
35
|
+
if (asking.flag === "no-plugin")
|
|
36
|
+
return { kind: "no-plugin-flag" };
|
|
37
|
+
if (!claude || (!state && asking.flag !== "plugin"))
|
|
38
|
+
return { kind: "no-claude" };
|
|
39
|
+
// Declared but not installed (the keys were written where `claude` was not on PATH): the project
|
|
40
|
+
// already said yes, so nothing is asked again; enabling now completes the install.
|
|
41
|
+
const stop = state?.enabled ? null : await decided(asking);
|
|
42
|
+
if (stop !== null)
|
|
43
|
+
return stop;
|
|
44
|
+
return enableNow(root, claude);
|
|
45
|
+
}
|
|
46
|
+
/** Why the plugin is off although both commands ran. */
|
|
47
|
+
export const STILL_OFF = "both commands ran, but Claude Code still reads it as off here: a more specific settings file, such as .claude/settings.local.json, turns paperlint@paperlint off. Remove that entry";
|
|
48
|
+
/**
|
|
49
|
+
* Runs the commands, then reads what Claude Code reads: they write the project's settings, and a
|
|
50
|
+
* more specific file can still say off. Only an install that reads as on counts as on.
|
|
51
|
+
*/
|
|
52
|
+
function enableNow(root, claude) {
|
|
53
|
+
const how = claude.enable(root);
|
|
54
|
+
if (!how.ok)
|
|
55
|
+
return { kind: "failed", reason: how.reason };
|
|
56
|
+
if ("ran" in how && installedPluginVersion(claude.plugin(root)) === null)
|
|
57
|
+
return { kind: "failed", reason: STILL_OFF };
|
|
58
|
+
return { kind: "enabled", how };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The plugin is on once Claude Code has installed it: the old links and hook entries then go. Keys
|
|
62
|
+
* written without `claude` load nothing, so until the owed commands run the old wiring stays.
|
|
63
|
+
*/
|
|
64
|
+
export const pluginOn = (o) => o.kind === "already" || (o.kind === "enabled" && "ran" in o.how);
|
|
65
|
+
const AGAIN = "`npx paperlint init --plugin`";
|
|
66
|
+
/** The plugin section of init's report: a header and its lines, or nothing at all. */
|
|
67
|
+
export function reportPlugin(o) {
|
|
68
|
+
if (o.kind === "no-claude" || o.kind === "cancelled")
|
|
69
|
+
return [];
|
|
70
|
+
// ONE line without a human: an agent that ran init reads it and can ask its user.
|
|
71
|
+
if (o.kind === "not-asked")
|
|
72
|
+
return [
|
|
73
|
+
``,
|
|
74
|
+
`Claude Code plugin: not turned on — ${o.why}, so nothing was asked. To turn it on: npx paperlint init --plugin`,
|
|
75
|
+
];
|
|
76
|
+
const head = [
|
|
77
|
+
``,
|
|
78
|
+
`Claude Code plugin (the skills and hooks, updated with paperlint)`,
|
|
79
|
+
];
|
|
80
|
+
if (o.kind === "no-plugin-flag")
|
|
81
|
+
return [...head, ` · --no-plugin — nothing asked, nothing turned on`];
|
|
82
|
+
if (o.kind === "declined")
|
|
83
|
+
return [...head, ` · declined — ${AGAIN} turns it on later`];
|
|
84
|
+
if (o.kind === "failed")
|
|
85
|
+
return [...head, ` ✗ not turned on — ${o.reason}. ${AGAIN} tries again`];
|
|
86
|
+
if (o.kind === "already")
|
|
87
|
+
return [...head, ` ✓ already on for this project, version ${o.version}`];
|
|
88
|
+
return "ran" in o.how
|
|
89
|
+
? [...head, ...o.how.ran.map((c) => ` ✓ ran ${c}`)]
|
|
90
|
+
: [
|
|
91
|
+
...head,
|
|
92
|
+
` ✓ declared in ${o.how.wrote} — \`claude\` is not on PATH, and these keys alone load nothing.`,
|
|
93
|
+
` once, where \`claude\` runs: ${o.how.owed.join(" && ")}`,
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=plugin-offer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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AC5E,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QACtB,OAAO,CAAC,GAAG,IAAI,EAAE,4CAA4C,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,OAAO,KAAK,IAAI,CAAC,CAAC,GAAG;QACnB,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC;YACE,GAAG,IAAI;YACP,mBAAmB,CAAC,CAAC,GAAG,CAAC,KAAK,kEAAkE;YAChG,sCAAsC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;SAChE,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code, as `paperlint init`, `doctor` and the in-session notice need it: is it here, is the
|
|
3
|
+
* paperlint plugin turned on for this project (and at which version), and turning it on.
|
|
4
|
+
*/
|
|
5
|
+
import type { AbsolutePath } from "../domain/paths.ts";
|
|
6
|
+
export interface PluginState {
|
|
7
|
+
/** Turned on for the project, by the most specific settings file that names it. */
|
|
8
|
+
readonly enabled: boolean;
|
|
9
|
+
/** The version Claude Code installed for this project, or null when it has none on record. */
|
|
10
|
+
readonly version: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** How the plugin was turned on, in the commands or files that did it. */
|
|
13
|
+
export type EnableResult = {
|
|
14
|
+
readonly ok: true;
|
|
15
|
+
readonly ran: readonly string[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly ok: true;
|
|
18
|
+
readonly wrote: string;
|
|
19
|
+
/** The commands still owed where `claude` runs: the keys alone load nothing. */
|
|
20
|
+
readonly owed: readonly string[];
|
|
21
|
+
} | {
|
|
22
|
+
readonly ok: false;
|
|
23
|
+
readonly reason: string;
|
|
24
|
+
};
|
|
25
|
+
export interface ClaudeCode {
|
|
26
|
+
/** A `.claude/` folder in the project, or `claude` on PATH. */
|
|
27
|
+
readonly present: (root: AbsolutePath) => boolean;
|
|
28
|
+
readonly plugin: (root: AbsolutePath) => PluginState;
|
|
29
|
+
readonly enable: (root: AbsolutePath) => EnableResult;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/ports/claude-code.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACtD;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,WAAW,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/ports/claude-code.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export interface Args {
|
|
|
56
56
|
yes: boolean;
|
|
57
57
|
/** `--no-hooks`: `init` does not touch `.claude/settings.json`. */
|
|
58
58
|
noHooks: boolean;
|
|
59
|
+
/** `--plugin`: `init` turns the Claude Code plugin on without asking. */
|
|
60
|
+
plugin: boolean;
|
|
61
|
+
/** `--no-plugin`: `init` neither asks about the plugin nor turns it on. */
|
|
62
|
+
noPlugin: boolean;
|
|
59
63
|
/** `--paper <name>`: `init` creates this paper. */
|
|
60
64
|
paper: string | null;
|
|
61
65
|
/** `--venue <preset>` for `new`: a shipped preset name, or a path to the project's own. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;sCAGkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,GAAG,SAAS,CAAC;IAChD,iGAAiG;IACjG,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,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. **Finds the papers directory**, or asks for it when several directories look like one.
|
|
42
42
|
2. **Declares it**, in a root `paperlint.json`, only when it is not the default `papers`. A project
|
|
43
43
|
on the defaults gets no config file at all.
|
|
44
|
-
3. **
|
|
45
|
-
|
|
44
|
+
3. **Offers the Claude Code plugin**, which carries the skills and the hooks and is updated with
|
|
45
|
+
paperlint ([below](#the-claude-code-plugin)). Only where Claude Code is: a `.claude/` folder, or
|
|
46
|
+
`claude` on PATH; anywhere else it says nothing.
|
|
47
|
+
4. **Without the plugin, links each shipped skill** into `.claude/skills/<name>` and **writes the
|
|
48
|
+
hook commands** into `.claude/settings.json`, beside your own entries. With the plugin on, it
|
|
49
|
+
removes the links and hook commands it made earlier, so nothing is listed or run twice.
|
|
46
50
|
5. **Offers a GitHub Actions workflow** that runs `npm ci`, then the action from `node_modules`.
|
|
47
51
|
6. **Offers a first paper** (`paperlint new`) if the papers directory has none.
|
|
48
52
|
7. **Offers TeX Live** for `paperlint build` (`paperlint toolchain`, ~270 MB, ~3 min, once), with
|
|
@@ -66,10 +70,54 @@ it, and exits 130.
|
|
|
66
70
|
| a first paper, via `paperlint new`, with its layout's folders | `<papers>/<name>/` | only when the papers directory holds none: asked of a human at a terminal, otherwise only with `--paper <name>` |
|
|
67
71
|
| one relative symlink per shipped skill, into the installed package | `.claude/skills/<name>` | always — except where that name is already taken (a directory, a file, a link elsewhere): that entry is left as it is and named in the report |
|
|
68
72
|
|
|
69
|
-
Besides paperlint itself (step 0), it installs no software you did not say yes to, and touches nothing else. Commit `.claude/settings.json` so every clone
|
|
70
|
-
gets the hooks; the hook commands run files inside `node_modules`, so a fresh clone needs
|
|
73
|
+
The last two rows are for a project without the plugin. Besides paperlint itself (step 0), it installs no software you did not say yes to, and touches nothing else. Commit `.claude/settings.json` so every clone
|
|
74
|
+
gets the hooks (or the plugin's declaration); the hook commands run files inside `node_modules`, so a fresh clone needs
|
|
71
75
|
`npm install` first.
|
|
72
76
|
|
|
77
|
+
## The Claude Code plugin
|
|
78
|
+
|
|
79
|
+
The plugin is optional: `paperlint lint`, the build and CI work without it. It carries the 23 skills
|
|
80
|
+
and the six hooks, and it is updated with the package: each release's plugin carries that release's
|
|
81
|
+
version.
|
|
82
|
+
|
|
83
|
+
At a terminal (shown as a terminal without Unicode draws it; others draw the same with Unicode marks):
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
|
|
|
87
|
+
* Turn on the paperlint plugin for Claude Code? (the skills and hooks, updated with paperlint)
|
|
88
|
+
| > Yes / No
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| how `init` runs | what happens |
|
|
92
|
+
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
93
|
+
| a human at a terminal | asked once, Yes preselected; No is kept, and `npx paperlint init --plugin` turns it on later |
|
|
94
|
+
| no human (`--yes`, CI, an agent such as Claude Code) | nothing turned on; one line says why and names `npx paperlint init --plugin` |
|
|
95
|
+
| `--plugin` | turned on without asking, with or without a terminal |
|
|
96
|
+
| `--no-plugin` | never asked, never turned on; the skills are linked and the hooks wired as before |
|
|
97
|
+
|
|
98
|
+
Without a human, the one line reads:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
Claude Code plugin: not turned on — stdout is not a terminal, so nothing was asked. To turn it on: npx paperlint init --plugin
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**How it is turned on.** With `claude` on PATH, `init` runs Claude Code's own two commands in the
|
|
105
|
+
project: `claude plugin marketplace add zernie/paperlint --scope project` and
|
|
106
|
+
`claude plugin install paperlint@paperlint --scope project`. They declare the marketplace and the
|
|
107
|
+
plugin in `.claude/settings.json` (commit it, and every clone is offered the plugin) and fetch it.
|
|
108
|
+
Without `claude` on PATH, `init` writes the same two keys and prints the two commands to run once
|
|
109
|
+
where `claude` runs: the keys alone load nothing (measured: `claude plugin list` stays empty). Until
|
|
110
|
+
then the skill links and hook commands stay, and the next `npx paperlint init` where `claude` runs
|
|
111
|
+
completes the install without asking again.
|
|
112
|
+
|
|
113
|
+
**In a cloud session** (Claude Code on the web) the repository's settings alone download no plugin:
|
|
114
|
+
add the marketplace `zernie/paperlint` once in your claude.ai settings.
|
|
115
|
+
|
|
116
|
+
**An earlier install.** Re-run `npx paperlint init` (or `npx paperlint init --plugin` without a
|
|
117
|
+
terminal). Once the plugin is on, `init` removes the skill links and hook commands it made itself;
|
|
118
|
+
a skill directory or hook entry of your own stays. `paperlint doctor` names any left beside the
|
|
119
|
+
plugin, and a plugin whose version is not the installed paperlint's.
|
|
120
|
+
|
|
73
121
|
## Why it is shaped this way
|
|
74
122
|
|
|
75
123
|
**One file, at the project root.** A vigiles hook cannot import code or walk up a tree looking for
|
|
@@ -85,15 +133,14 @@ is that _"the only valid use of install or preinstall scripts is for compilation
|
|
|
85
133
|
its install script in 5.0.0 and Playwright in 1.38.0, because a failed install is cached and its
|
|
86
134
|
output is hidden. An install that can fail quietly is worse than a step that says what it needs.
|
|
87
135
|
|
|
88
|
-
**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
ships no plugin.
|
|
136
|
+
**The plugin carries no code of its own.** A plugin fetched from npm gets no `node_modules` (`npm pack`
|
|
137
|
+
strips the lockfile, and the host runs `npm ci` only when one is present; probes:
|
|
138
|
+
[`prior-art/repro/`](prior-art/repro/README.md)). So the skill scripts are bundled to run without
|
|
139
|
+
dependencies, and every hook command runs the project's installed
|
|
140
|
+
`node_modules/paperlint/bin/paperlint.mjs`. The plugin needs the npm package in the project; the
|
|
141
|
+
package does not need the plugin.
|
|
95
142
|
|
|
96
|
-
**
|
|
143
|
+
**Without the plugin, skills are linked, not left in `node_modules`.** Claude Code finds project skills in
|
|
97
144
|
`.claude/skills/<name>/SKILL.md` and never inside `node_modules`. The links also make the
|
|
98
145
|
project-relative script paths inside the skills (`.claude/skills/paper-pipeline/scripts/x.mjs`)
|
|
99
146
|
resolve.
|
|
@@ -115,7 +162,8 @@ nothing while guarding and says nothing while watching a directory that does not
|
|
|
115
162
|
unusable, the CLI and the hooks disagree on the papers directory, or the hooks are miswired: partly wired (some
|
|
116
163
|
paperlint hooks present, others missing) or any hook wired twice. A hook set wired by hand under another spelling
|
|
117
164
|
counts as wired. Not wired at all, a missing external program and an unlinked skill are printed and exit 0,
|
|
118
|
-
because `--no-hooks` and the skills you do not use are choices.
|
|
165
|
+
because `--no-hooks` and the skills you do not use are choices. With the plugin on, the skills and
|
|
166
|
+
hooks count as carried by it.
|
|
119
167
|
|
|
120
168
|
**After upgrading, the first paper edit tells you which hooks to wire and which skills to link.** `init` wires the hooks once, so a release
|
|
121
169
|
that ships one more leaves a project that ran `init` earlier without it, and a release that ships a skill (16.8.0 added
|
|
@@ -130,7 +178,7 @@ directory holds is your choice, and `doctor` reports it. It is said once per ins
|
|
|
130
178
|
`paper-skills-nudge`, `paper-status-gates`) and never by a PreToolUse hook, so it cannot change an allow or a deny;
|
|
131
179
|
it never blocks, and an error while checking is one stderr line. `paperlint lint` prints the same finding as one
|
|
132
180
|
stderr line on every run, without changing its exit code, and the GitHub action fails on it when `check-hooks` is
|
|
133
|
-
set ([`ci.md`](ci.md)). Nothing is said about hooks when none is wired (`--no-hooks`) or the settings file cannot be read,
|
|
181
|
+
set ([`ci.md`](ci.md)). Nothing is said about hooks when none is wired (`--no-hooks`) or the settings file cannot be read, nothing about skills when all are linked or the package does not resolve from the project, and nothing at all while the plugin is on: it is updated with paperlint.
|
|
134
182
|
|
|
135
183
|
### How comparable tools install
|
|
136
184
|
|
package/hooks/CLAUDE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- vigiles:sha256:
|
|
1
|
+
<!-- vigiles:sha256:9ad080d516729f5e compiled from hooks/CLAUDE.md.spec.ts -->
|
|
2
2
|
|
|
3
3
|
# CLAUDE.md
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ would undo it.
|
|
|
27
27
|
|
|
28
28
|
### One Wiring File
|
|
29
29
|
|
|
30
|
-
**Guidance only** — The wiring is `plugin/hooks/hooks.json`. `paperlint init` merges it into the consumer's `.claude/settings.json`; there is no second copy.
|
|
30
|
+
**Guidance only** — The wiring is `plugin/hooks/hooks.json`. The Claude Code plugin ships it as its hooks, and `paperlint init` without the plugin merges it into the consumer's `.claude/settings.json`; there is no second copy.
|
|
31
31
|
|
|
32
32
|
### Vigiles Moves With The Consumer
|
|
33
33
|
|
package/hooks/CLAUDE.md.spec.ts
CHANGED
|
@@ -21,7 +21,7 @@ would undo it.`,
|
|
|
21
21
|
"`checkHookImports` (run by `hooks.harness.ts`) is a text regex. Describe a forbidden import in words; never write one, not even in a comment.",
|
|
22
22
|
),
|
|
23
23
|
"one-wiring-file": guidance(
|
|
24
|
-
"The wiring is `plugin/hooks/hooks.json`. `paperlint init` merges it into the consumer's `.claude/settings.json`; there is no second copy.",
|
|
24
|
+
"The wiring is `plugin/hooks/hooks.json`. The Claude Code plugin ships it as its hooks, and `paperlint init` without the plugin merges it into the consumer's `.claude/settings.json`; there is no second copy.",
|
|
25
25
|
),
|
|
26
26
|
"vigiles-moves-with-the-consumer": guidance(
|
|
27
27
|
"`vigiles` moves with the consumer's pin, in one pass. A major mismatch makes `PreToolUse` refuse every command. `npm ls vigiles` compares what is installed with the manifest, not with the registry; Dependabot (`.github/dependabot.yml`) carries the registry half.",
|
package/lib/skill-checks.mjs
CHANGED
|
@@ -115,8 +115,9 @@ export async function checkSkill(name) {
|
|
|
115
115
|
// ═══════════════════════════════════════════════════════════════════════════════════════════════
|
|
116
116
|
// 7. EVERY script path the skill instructs resolves.
|
|
117
117
|
//
|
|
118
|
-
// Scoped to paths that are unambiguously resolvable: `${CLAUDE_SKILL_DIR}/…` and `scripts
|
|
119
|
-
// skill-relative
|
|
118
|
+
// Scoped to paths that are unambiguously resolvable: `${CLAUDE_SKILL_DIR}/…` and `scripts/…`, both
|
|
119
|
+
// skill-relative. A `.claude/skills/…` path is not resolved here: under the plugin no such folder
|
|
120
|
+
// exists, and `port/md-install-path` flags it in the skill's text. A `.js` a skill runs is a build output
|
|
120
121
|
// (`npm run build`), so this checks the checkout as built. Paths
|
|
121
122
|
// like `repro/build-submission.sh` are relative to a PAPER directory that does not exist at test
|
|
122
123
|
// time, so they are excluded BY NAME rather than by a guess that would fire on correct text.
|
|
@@ -125,11 +126,9 @@ export async function checkSkill(name) {
|
|
|
125
126
|
for (const c of commands(s.src)) {
|
|
126
127
|
const abs = c.script.startsWith(SKILL_DIR_VAR)
|
|
127
128
|
? join(SKILLS_DIR, s.name, c.script.slice(SKILL_DIR_VAR.length))
|
|
128
|
-
: c.script.startsWith("
|
|
129
|
-
? join(
|
|
130
|
-
:
|
|
131
|
-
? join(SKILLS_DIR, s.name, c.script)
|
|
132
|
-
: null;
|
|
129
|
+
: c.script.startsWith("scripts/")
|
|
130
|
+
? join(SKILLS_DIR, s.name, c.script)
|
|
131
|
+
: null;
|
|
133
132
|
if (!abs) continue;
|
|
134
133
|
soft(() =>
|
|
135
134
|
assert.ok(
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paperlint",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.8.0",
|
|
4
4
|
"description": "A linter for scientific papers written in LaTeX: catches mistakes before you submit to a conference or journal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b && node scripts/bundle-skills.ts",
|
|
9
9
|
"prepare": "tsc -b && node scripts/bundle-skills.ts",
|
|
10
|
+
"prepack": "node scripts/plugin-version.ts stamp",
|
|
11
|
+
"postpack": "node scripts/plugin-version.ts restore",
|
|
10
12
|
"test": "node scripts/test.ts",
|
|
11
13
|
"test:e2e": "vitest run --project 'e2e-*'",
|
|
12
14
|
"test:e2e:install": "vitest run --project e2e-install",
|
|
@@ -114,6 +116,7 @@
|
|
|
114
116
|
"./*": "./*"
|
|
115
117
|
},
|
|
116
118
|
"files": [
|
|
119
|
+
".claude-plugin",
|
|
117
120
|
".github",
|
|
118
121
|
"CLAUDE.md",
|
|
119
122
|
"CONTRIBUTING.md",
|
package/plugin/CLAUDE.md
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
<!-- vigiles:sha256:
|
|
1
|
+
<!-- vigiles:sha256:357f503e21646c81 compiled from plugin/CLAUDE.md.spec.ts -->
|
|
2
2
|
|
|
3
3
|
# CLAUDE.md
|
|
4
4
|
|
|
5
5
|
## `plugin/`
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
`plugin/hooks/hooks.json` is the one hook wiring. The Claude Code plugin
|
|
8
|
+
(`.claude-plugin/plugin.json`) ships it as its hooks, and `paperlint init --no-plugin` merges the
|
|
9
|
+
same file into the consumer's `.claude/settings.json`. Every command in it runs the project's installed
|
|
10
|
+
`node_modules/paperlint/bin/paperlint.mjs`: the plugin carries the skills and the hooks, the npm package
|
|
11
|
+
carries the code, and `paperlint lint` works without the plugin.
|
|
9
12
|
|
|
10
|
-
## Why
|
|
13
|
+
## Why the plugin came back
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
"Why it is shaped this way"):
|
|
15
|
+
The plugin was removed after 1.0.0 (#82) on three objections. Each now has a measured answer
|
|
16
|
+
(2026-11-22); bring none of them back as a reason without measuring again:
|
|
15
17
|
|
|
16
|
-
- **A plugin cannot carry the code
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **The skills need the npm package anyway
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
- **"A plugin cannot carry the code."** It does not have to. The skill scripts are bundled
|
|
19
|
+
(`scripts/bundle-skills.ts`, #624) and run from a copy of the package with no `node_modules`; the
|
|
20
|
+
hooks call the project's installed paperlint. Installing the plugin from the marketplace took 16.7 s.
|
|
21
|
+
- **"The skills need the npm package anyway."** Only the hooks do, and they find it in the project.
|
|
22
|
+
- **"Its manifests carried versions nothing updated."** The marketplace installs from the npm package,
|
|
23
|
+
and `npm pack` stamps the package's version into the packed `plugin.json`
|
|
24
|
+
(`scripts/plugin-version.ts`); the tracked file keeps the placeholder. Without a version there,
|
|
25
|
+
Claude Code lists the plugin's version as "unknown".
|
|
26
|
+
|
|
27
|
+
Turning it on is `claude`'s own two commands (`src/adapters/claude-code/claude.io.ts`): writing
|
|
28
|
+
`enabledPlugins` and `extraKnownMarketplaces` by hand left `claude plugin list` empty. Repository
|
|
29
|
+
settings alone download nothing in a cloud session either: the user adds the marketplace once in
|
|
30
|
+
their claude.ai settings.
|