claudepluginhub 0.17.0 → 0.18.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/README.md +2 -1
- package/dist/doctor/rules.d.ts +23 -0
- package/dist/doctor/rules.js +73 -0
- package/dist/doctor/run.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,7 +117,8 @@ plugin's install directory, and reports concrete findings: native load errors,
|
|
|
117
117
|
broken install paths or manifests, duplicate/ambiguous installations, exact
|
|
118
118
|
duplicate skill/command/agent content across enabled plugins, broad
|
|
119
119
|
unconditional command hooks, missing MCP/LSP prerequisites, missing declared
|
|
120
|
-
dependencies, LSP extension conflicts, non-executable `bin/` files,
|
|
120
|
+
dependencies, LSP extension conflicts, non-executable `bin/` files, a skill
|
|
121
|
+
listing over Claude Code's budget (entries then show by name only), and
|
|
121
122
|
heuristic context-size estimates. No account or network needed.
|
|
122
123
|
|
|
123
124
|
```bash
|
package/dist/doctor/rules.d.ts
CHANGED
|
@@ -130,6 +130,16 @@ export declare const FINDING_CODES: {
|
|
|
130
130
|
readonly category: "review";
|
|
131
131
|
readonly title: "Multiple LSP servers claim the same extension";
|
|
132
132
|
};
|
|
133
|
+
readonly skill_listing_over_budget: {
|
|
134
|
+
readonly severity: "warning";
|
|
135
|
+
readonly category: "review";
|
|
136
|
+
readonly title: "Skill listing is over its budget";
|
|
137
|
+
};
|
|
138
|
+
readonly skill_listing_over_small_budget: {
|
|
139
|
+
readonly severity: "info";
|
|
140
|
+
readonly category: "review";
|
|
141
|
+
readonly title: "Skill listing is over the budget on 200k-context models";
|
|
142
|
+
};
|
|
133
143
|
readonly scan_incomplete: {
|
|
134
144
|
readonly severity: "warning";
|
|
135
145
|
readonly category: "coverage";
|
|
@@ -149,9 +159,22 @@ export interface AnalysisInput {
|
|
|
149
159
|
droppedRecords: number;
|
|
150
160
|
/** duplicateRecordKey()s resolved as scan-equivalent — only those duplicate_record groups are suppressed. */
|
|
151
161
|
scanEquivalentKeys: Set<string>;
|
|
162
|
+
/** Parsed SLASH_COMMAND_TOOL_CHAR_BUDGET; null/absent = the c48 model budgets. */
|
|
163
|
+
listingBudgetOverride?: number | null;
|
|
152
164
|
}
|
|
153
165
|
export interface AnalysisOutput {
|
|
154
166
|
global: Finding[];
|
|
155
167
|
byContext: Map<string, Finding[]>;
|
|
156
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Claude Code's skill listing budget, settled by oracle c48 (CLI 2.1.332; 2.1.333 identical):
|
|
171
|
+
* floor(context window × chars/token × 0.01), i.e. 30,000 on 1M-context models such as Opus 5.5
|
|
172
|
+
* and 8,000 on 200k-context models such as Sonnet 4.6 and Haiku 4.5. SLASH_COMMAND_TOOL_CHAR_BUDGET
|
|
173
|
+
* replaces it. Built-in skills took ~6,200 of the listing in c48's clean config.
|
|
174
|
+
*/
|
|
175
|
+
export declare const SKILL_LISTING_BUDGET_1M = 30000;
|
|
176
|
+
export declare const SKILL_LISTING_BUDGET_200K = 8000;
|
|
177
|
+
export declare const BUILT_IN_SKILL_LISTING_CHARS = 6200;
|
|
178
|
+
/** SLASH_COMMAND_TOOL_CHAR_BUDGET: a positive integer replaces the budget (c48 set 2500); anything else is ignored. */
|
|
179
|
+
export declare function parseListingBudgetOverride(value: string | undefined): number | null;
|
|
157
180
|
export declare function analyze(input: AnalysisInput): AnalysisOutput;
|
package/dist/doctor/rules.js
CHANGED
|
@@ -36,6 +36,8 @@ export const FINDING_CODES = {
|
|
|
36
36
|
dependency_disabled: { severity: 'warning', category: 'review', title: 'Declared plugin dependency is disabled' },
|
|
37
37
|
dependency_resolution_unknown: { severity: 'info', category: 'coverage', title: 'Plugin dependency could not be verified' },
|
|
38
38
|
lsp_extension_conflict: { severity: 'warning', category: 'review', title: 'Multiple LSP servers claim the same extension' },
|
|
39
|
+
skill_listing_over_budget: { severity: 'warning', category: 'review', title: 'Skill listing is over its budget' },
|
|
40
|
+
skill_listing_over_small_budget: { severity: 'info', category: 'review', title: 'Skill listing is over the budget on 200k-context models' },
|
|
39
41
|
scan_incomplete: { severity: 'warning', category: 'coverage', title: 'Plugin scan hit a resource limit' },
|
|
40
42
|
symlink_skipped: { severity: 'warning', category: 'coverage', title: 'Symlinks skipped during scan' },
|
|
41
43
|
};
|
|
@@ -304,6 +306,76 @@ function ruleLspConflicts(context, scanFor, out) {
|
|
|
304
306
|
out.push(makeFinding('lsp_extension_conflict', `${claimants.length} enabled LSP servers claim ${extension}: ${names.join(', ')}. Per the documented first-wins behavior, only the first registered server starts and the others never do — registration order is not observable here, so no winner is asserted.`, pluginIds, { extension, servers: evidenceList(names) }));
|
|
305
307
|
}
|
|
306
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Claude Code's skill listing budget, settled by oracle c48 (CLI 2.1.332; 2.1.333 identical):
|
|
311
|
+
* floor(context window × chars/token × 0.01), i.e. 30,000 on 1M-context models such as Opus 5.5
|
|
312
|
+
* and 8,000 on 200k-context models such as Sonnet 4.6 and Haiku 4.5. SLASH_COMMAND_TOOL_CHAR_BUDGET
|
|
313
|
+
* replaces it. Built-in skills took ~6,200 of the listing in c48's clean config.
|
|
314
|
+
*/
|
|
315
|
+
export const SKILL_LISTING_BUDGET_1M = 30_000;
|
|
316
|
+
export const SKILL_LISTING_BUDGET_200K = 8_000;
|
|
317
|
+
export const BUILT_IN_SKILL_LISTING_CHARS = 6_200;
|
|
318
|
+
/**
|
|
319
|
+
* One plugin's share of the listing: a `- <plugin>:<name>: <description>` line per listed skill or
|
|
320
|
+
* command plus the newline between lines. `disable-model-invocation` entries and skills without a
|
|
321
|
+
* description are not listed (c48); unreadable components are skipped, so this is a lower bound.
|
|
322
|
+
*/
|
|
323
|
+
function pluginListingChars(pluginName, scan) {
|
|
324
|
+
let total = 0;
|
|
325
|
+
for (const c of scan.components) {
|
|
326
|
+
if (c.type !== 'skill' && c.type !== 'command')
|
|
327
|
+
continue;
|
|
328
|
+
if (c.disableModelInvocation || !c.estimable)
|
|
329
|
+
continue;
|
|
330
|
+
if (c.type === 'skill' && c.description === null)
|
|
331
|
+
continue;
|
|
332
|
+
total += 2 + pluginName.length + 1 + c.listingChars + (c.description !== null ? 2 : 0) + 1;
|
|
333
|
+
}
|
|
334
|
+
return total;
|
|
335
|
+
}
|
|
336
|
+
function ruleSkillListingBudget(context, scanFor, budgetOverride, out) {
|
|
337
|
+
const contributors = context.instances
|
|
338
|
+
.flatMap((i) => i.selection === 'sole' && i.record !== null
|
|
339
|
+
? [{ id: i.id, chars: pluginListingChars(i.record.name, scanFor(i.record)) }]
|
|
340
|
+
: [])
|
|
341
|
+
.filter((c) => c.chars > 0)
|
|
342
|
+
.sort((a, b) => b.chars - a.chars || compareBytes(a.id, b.id));
|
|
343
|
+
const pluginChars = contributors.reduce((sum, c) => sum + c.chars, 0);
|
|
344
|
+
const listingChars = pluginChars + BUILT_IN_SKILL_LISTING_CHARS;
|
|
345
|
+
const n = (value) => value.toLocaleString('en-US');
|
|
346
|
+
let code;
|
|
347
|
+
let budget;
|
|
348
|
+
let over;
|
|
349
|
+
if (budgetOverride !== null) {
|
|
350
|
+
if (listingChars <= budgetOverride)
|
|
351
|
+
return;
|
|
352
|
+
code = 'skill_listing_over_budget';
|
|
353
|
+
budget = budgetOverride;
|
|
354
|
+
over = `the ${n(budget)} set by SLASH_COMMAND_TOOL_CHAR_BUDGET`;
|
|
355
|
+
}
|
|
356
|
+
else if (listingChars > SKILL_LISTING_BUDGET_1M) {
|
|
357
|
+
code = 'skill_listing_over_budget';
|
|
358
|
+
budget = SKILL_LISTING_BUDGET_1M;
|
|
359
|
+
over = `the ${n(budget)} budget on 1M-context models such as Opus 5.5`;
|
|
360
|
+
}
|
|
361
|
+
else if (listingChars > SKILL_LISTING_BUDGET_200K) {
|
|
362
|
+
code = 'skill_listing_over_small_budget';
|
|
363
|
+
budget = SKILL_LISTING_BUDGET_200K;
|
|
364
|
+
over = `the ${n(budget)} budget on 200k-context models such as Sonnet 4.6 and Haiku 4.5; it fits the ${n(SKILL_LISTING_BUDGET_1M)} on 1M-context models`;
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const largest = contributors.slice(0, 3).map((c) => `${c.id} ~${n(c.chars)}`);
|
|
370
|
+
out.push(makeFinding(code, `Plugin skills and commands add ~${n(pluginChars)} characters to Claude Code's skill listing (~${n(listingChars)} with built-in skills), over ${over}. Over budget, entries are shown by name only, without descriptions, so Claude is less likely to pick them. Largest: ${largest.join(', ')}.`, contributors.map((c) => c.id), { listingChars, pluginChars, builtInChars: BUILT_IN_SKILL_LISTING_CHARS, budget, largest: evidenceList(largest) }, 'Run `/skills` to turn some off, set `disable-model-invocation: true` on skills you only run by name, or disable plugins you do not use (`claude plugin disable <id>`). Your own user and project skills are not counted here, and a `skillListingBudgetFraction` setting changes the budget (Claude Code 2.1.332).'));
|
|
371
|
+
}
|
|
372
|
+
/** SLASH_COMMAND_TOOL_CHAR_BUDGET: a positive integer replaces the budget (c48 set 2500); anything else is ignored. */
|
|
373
|
+
export function parseListingBudgetOverride(value) {
|
|
374
|
+
if (value === undefined || !/^\d+$/.test(value.trim()))
|
|
375
|
+
return null;
|
|
376
|
+
const parsed = Number(value.trim());
|
|
377
|
+
return parsed > 0 ? parsed : null;
|
|
378
|
+
}
|
|
307
379
|
export function analyze(input) {
|
|
308
380
|
const { selection, scanFor, droppedRecords, scanEquivalentKeys } = input;
|
|
309
381
|
const applicable = unionApplicable(selection);
|
|
@@ -322,6 +394,7 @@ export function analyze(input) {
|
|
|
322
394
|
ruleBroadHooks(context, scanFor, findings);
|
|
323
395
|
ruleDependencies(context, scanFor, findings);
|
|
324
396
|
ruleLspConflicts(context, scanFor, findings);
|
|
397
|
+
ruleSkillListingBudget(context, scanFor, input.listingBudgetOverride ?? null, findings);
|
|
325
398
|
findings.sort(compareFindings);
|
|
326
399
|
byContext.set(context.context.key, findings);
|
|
327
400
|
}
|
package/dist/doctor/run.js
CHANGED
|
@@ -7,7 +7,7 @@ import { canonicalize } from './paths.js';
|
|
|
7
7
|
import { selectEffective } from './select.js';
|
|
8
8
|
import { resolveEquivalences } from './equivalence.js';
|
|
9
9
|
import { createScanner } from './inventory.js';
|
|
10
|
-
import { analyze } from './rules.js';
|
|
10
|
+
import { analyze, parseListingBudgetOverride } from './rules.js';
|
|
11
11
|
import { estimatePlugin } from './estimate.js';
|
|
12
12
|
import { renderHuman, renderJson } from './render.js';
|
|
13
13
|
import { renderHtml } from './html-report.js';
|
|
@@ -224,7 +224,13 @@ export function buildDoctorReport(inputs) {
|
|
|
224
224
|
return scan;
|
|
225
225
|
};
|
|
226
226
|
const { resolved: selection, scanEquivalentKeys } = resolveEquivalences(baseSelection, scanFor);
|
|
227
|
-
const analysis = analyze({
|
|
227
|
+
const analysis = analyze({
|
|
228
|
+
selection,
|
|
229
|
+
scanFor,
|
|
230
|
+
droppedRecords,
|
|
231
|
+
scanEquivalentKeys,
|
|
232
|
+
listingBudgetOverride: parseListingBudgetOverride(process.env.SLASH_COMMAND_TOOL_CHAR_BUDGET),
|
|
233
|
+
});
|
|
228
234
|
const contexts = selection.contexts.map((contextSelection) => buildContextReport(contextSelection, analysis.byContext.get(contextSelection.context.key) ?? [], scanFor));
|
|
229
235
|
const allFindings = [...analysis.global, ...[...analysis.byContext.values()].flat()];
|
|
230
236
|
const summary = {
|