skillset 0.1.0-beta.3 → 0.1.0-beta.4

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 (3) hide show
  1. package/dist/cli.js +229 -316
  2. package/dist/create.js +228 -320
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -31,48 +31,8 @@ var __toESM = (mod, isNodeMode, target) => {
31
31
  return to;
32
32
  };
33
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
- var __returnValue = (v) => v;
35
- function __exportSetter(name, newValue) {
36
- this[name] = __returnValue.bind(null, newValue);
37
- }
38
- var __export = (target, all) => {
39
- for (var name in all)
40
- __defProp(target, name, {
41
- get: all[name],
42
- enumerable: true,
43
- configurable: true,
44
- set: __exportSetter.bind(all, name)
45
- });
46
- };
47
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
48
34
  var __require = import.meta.require;
49
35
 
50
- // src/path.ts
51
- import { relative, resolve, sep } from "path";
52
- function resolveInside(root, candidate) {
53
- const resolvedRoot = resolve(root);
54
- const resolved = resolve(resolvedRoot, candidate);
55
- const relativePath = relative(resolvedRoot, resolved);
56
- if (relativePath === "" || relativePath.startsWith("..") || relativePath.includes(`..${sep}`)) {
57
- throw new Error(`skillset: refusing to operate outside repo root: ${candidate}`);
58
- }
59
- return resolved;
60
- }
61
- function compareStrings(left, right) {
62
- if (left < right)
63
- return -1;
64
- if (left > right)
65
- return 1;
66
- return 0;
67
- }
68
- function validateSlug(value, label) {
69
- if (!/^[a-z0-9][a-z0-9-]*$/.test(value)) {
70
- throw new Error(`skillset: expected ${label} to be a lowercase slug, received ${JSON.stringify(value)}`);
71
- }
72
- return value;
73
- }
74
- var init_path = () => {};
75
-
76
36
  // node_modules/yaml/dist/nodes/identity.js
77
37
  var require_identity = __commonJS((exports) => {
78
38
  var ALIAS = Symbol.for("yaml.alias");
@@ -7063,7 +7023,49 @@ var require_dist = __commonJS((exports) => {
7063
7023
  exports.visitAsync = visit.visitAsync;
7064
7024
  });
7065
7025
 
7026
+ // src/cli-core.ts
7027
+ import { basename as basename5, resolve as resolve6 } from "path";
7028
+
7029
+ // src/authoring.ts
7030
+ import { resolve as resolve3, relative as relative7 } from "path";
7031
+
7032
+ // src/build.ts
7033
+ import { mkdir, readdir as readdir3, readFile as readFile4, rm, stat as stat4, writeFile } from "fs/promises";
7034
+ import { dirname as dirname4, join as join4, relative as relative5 } from "path";
7035
+
7036
+ // src/path.ts
7037
+ import { relative, resolve, sep } from "path";
7038
+ function resolveInside(root, candidate) {
7039
+ const resolvedRoot = resolve(root);
7040
+ const resolved = resolve(resolvedRoot, candidate);
7041
+ const relativePath = relative(resolvedRoot, resolved);
7042
+ if (relativePath === "" || relativePath.startsWith("..") || relativePath.includes(`..${sep}`)) {
7043
+ throw new Error(`skillset: refusing to operate outside repo root: ${candidate}`);
7044
+ }
7045
+ return resolved;
7046
+ }
7047
+ function compareStrings(left, right) {
7048
+ if (left < right)
7049
+ return -1;
7050
+ if (left > right)
7051
+ return 1;
7052
+ return 0;
7053
+ }
7054
+ function validateSlug(value, label) {
7055
+ if (!/^[a-z0-9][a-z0-9-]*$/.test(value)) {
7056
+ throw new Error(`skillset: expected ${label} to be a lowercase slug, received ${JSON.stringify(value)}`);
7057
+ }
7058
+ return value;
7059
+ }
7060
+
7061
+ // src/render.ts
7062
+ import { readFileSync, readdirSync, statSync } from "fs";
7063
+ import { readdir, readFile as readFile2, stat as stat2 } from "fs/promises";
7064
+ import { createHash } from "crypto";
7065
+ import { basename, dirname as dirname2, join as join2, relative as relative3 } from "path";
7066
+
7066
7067
  // src/yaml.ts
7068
+ var import_yaml = __toESM(require_dist(), 1);
7067
7069
  function isJsonRecord(value) {
7068
7070
  return typeof value === "object" && value !== null && !Array.isArray(value);
7069
7071
  }
@@ -7145,12 +7147,40 @@ function sortValue(value) {
7145
7147
  return sortRecord(value);
7146
7148
  return value;
7147
7149
  }
7148
- var import_yaml;
7149
- var init_yaml = __esm(() => {
7150
- import_yaml = __toESM(require_dist(), 1);
7151
- });
7152
7150
 
7153
7151
  // src/config.ts
7152
+ var TARGET_NAMES = ["claude", "codex"];
7153
+ var DEFAULT_SURFACES = new Set(["agents", "instructions", "plugins", "skills"]);
7154
+ var CONFIG_TOP_LEVEL_KEYS = new Set(["agents", "claude", "codex", "defaults", "skillset"]);
7155
+ var ROOT_CONFIG_TOP_LEVEL_KEYS = new Set([...CONFIG_TOP_LEVEL_KEYS, "compile"]);
7156
+ var COMPILE_BUILD_MODES = new Set(["updated", "all"]);
7157
+ var COMPILE_UNSUPPORTED_POLICIES = new Set([
7158
+ "error",
7159
+ "warn",
7160
+ "skip",
7161
+ "force"
7162
+ ]);
7163
+ var SOURCE_ONLY_KEYS = new Set([
7164
+ "agents",
7165
+ "allowed_tools",
7166
+ "bin",
7167
+ "claude",
7168
+ "compile",
7169
+ "codex",
7170
+ "defaults",
7171
+ "implicit_invocation",
7172
+ "mcp",
7173
+ "model",
7174
+ "resources",
7175
+ "schema",
7176
+ "skillset",
7177
+ "summary",
7178
+ "targets",
7179
+ "title",
7180
+ "tool_intent",
7181
+ "tools",
7182
+ "version"
7183
+ ]);
7154
7184
  function defaultTargets() {
7155
7185
  return {
7156
7186
  claude: { enabled: true, options: {} },
@@ -7536,44 +7566,53 @@ function readStringArrayValue(value, label) {
7536
7566
  }
7537
7567
  return value.map((item) => String(item));
7538
7568
  }
7539
- var TARGET_NAMES, DEFAULT_SURFACES, CONFIG_TOP_LEVEL_KEYS, ROOT_CONFIG_TOP_LEVEL_KEYS, COMPILE_BUILD_MODES, COMPILE_UNSUPPORTED_POLICIES, SOURCE_ONLY_KEYS;
7540
- var init_config = __esm(() => {
7541
- init_yaml();
7542
- TARGET_NAMES = ["claude", "codex"];
7543
- DEFAULT_SURFACES = new Set(["agents", "instructions", "plugins", "skills"]);
7544
- CONFIG_TOP_LEVEL_KEYS = new Set(["agents", "claude", "codex", "defaults", "skillset"]);
7545
- ROOT_CONFIG_TOP_LEVEL_KEYS = new Set([...CONFIG_TOP_LEVEL_KEYS, "compile"]);
7546
- COMPILE_BUILD_MODES = new Set(["updated", "all"]);
7547
- COMPILE_UNSUPPORTED_POLICIES = new Set([
7548
- "error",
7549
- "warn",
7550
- "skip",
7551
- "force"
7552
- ]);
7553
- SOURCE_ONLY_KEYS = new Set([
7554
- "agents",
7555
- "allowed_tools",
7556
- "bin",
7557
- "claude",
7558
- "compile",
7559
- "codex",
7560
- "defaults",
7561
- "implicit_invocation",
7562
- "mcp",
7563
- "model",
7564
- "resources",
7565
- "schema",
7566
- "skillset",
7567
- "summary",
7568
- "targets",
7569
- "title",
7570
- "tool_intent",
7571
- "tools",
7572
- "version"
7573
- ]);
7574
- });
7575
7569
 
7576
7570
  // src/hooks.ts
7571
+ var CLAUDE_HOOK_EVENTS = new Set([
7572
+ "ConfigChange",
7573
+ "CwdChanged",
7574
+ "Elicitation",
7575
+ "ElicitationResult",
7576
+ "FileChanged",
7577
+ "InstructionsLoaded",
7578
+ "MessageDisplay",
7579
+ "Notification",
7580
+ "PermissionDenied",
7581
+ "PermissionRequest",
7582
+ "PostCompact",
7583
+ "PostToolBatch",
7584
+ "PostToolUseFailure",
7585
+ "PreToolUse",
7586
+ "PostToolUse",
7587
+ "PreCompact",
7588
+ "SessionEnd",
7589
+ "SessionStart",
7590
+ "Setup",
7591
+ "Stop",
7592
+ "StopFailure",
7593
+ "SubagentStart",
7594
+ "SubagentStop",
7595
+ "TaskCompleted",
7596
+ "TaskCreated",
7597
+ "TeammateIdle",
7598
+ "UserPromptSubmit",
7599
+ "UserPromptExpansion",
7600
+ "WorktreeCreate",
7601
+ "WorktreeRemove"
7602
+ ]);
7603
+ var CODEX_HOOK_EVENTS = new Set([
7604
+ "PreToolUse",
7605
+ "PermissionRequest",
7606
+ "PostToolUse",
7607
+ "PreCompact",
7608
+ "PostCompact",
7609
+ "SessionStart",
7610
+ "SubagentStart",
7611
+ "SubagentStop",
7612
+ "UserPromptSubmit",
7613
+ "Stop"
7614
+ ]);
7615
+ var CODEX_HOOK_HANDLER_TYPES = new Set(["command"]);
7577
7616
  function validateHookDefinition(parsed, context) {
7578
7617
  const targetLabel = context.target === "claude" ? "Claude" : "Codex";
7579
7618
  if (!isJsonRecord(parsed)) {
@@ -7614,58 +7653,10 @@ function validateCodexHooks(parsed, sourcePath) {
7614
7653
  }
7615
7654
  }
7616
7655
  }
7617
- var CLAUDE_HOOK_EVENTS, CODEX_HOOK_EVENTS, CODEX_HOOK_HANDLER_TYPES;
7618
- var init_hooks = __esm(() => {
7619
- init_yaml();
7620
- CLAUDE_HOOK_EVENTS = new Set([
7621
- "ConfigChange",
7622
- "CwdChanged",
7623
- "Elicitation",
7624
- "ElicitationResult",
7625
- "FileChanged",
7626
- "InstructionsLoaded",
7627
- "MessageDisplay",
7628
- "Notification",
7629
- "PermissionDenied",
7630
- "PermissionRequest",
7631
- "PostCompact",
7632
- "PostToolBatch",
7633
- "PostToolUseFailure",
7634
- "PreToolUse",
7635
- "PostToolUse",
7636
- "PreCompact",
7637
- "SessionEnd",
7638
- "SessionStart",
7639
- "Setup",
7640
- "Stop",
7641
- "StopFailure",
7642
- "SubagentStart",
7643
- "SubagentStop",
7644
- "TaskCompleted",
7645
- "TaskCreated",
7646
- "TeammateIdle",
7647
- "UserPromptSubmit",
7648
- "UserPromptExpansion",
7649
- "WorktreeCreate",
7650
- "WorktreeRemove"
7651
- ]);
7652
- CODEX_HOOK_EVENTS = new Set([
7653
- "PreToolUse",
7654
- "PermissionRequest",
7655
- "PostToolUse",
7656
- "PreCompact",
7657
- "PostCompact",
7658
- "SessionStart",
7659
- "SubagentStart",
7660
- "SubagentStop",
7661
- "UserPromptSubmit",
7662
- "Stop"
7663
- ]);
7664
- CODEX_HOOK_HANDLER_TYPES = new Set(["command"]);
7665
- });
7666
7656
 
7667
7657
  // src/resources.ts
7668
7658
  import { stat } from "fs/promises";
7659
+ var RESOURCE_GROUPS = new Set(["assets", "references", "scripts", "templates"]);
7669
7660
  async function readSkillResources(raw, context) {
7670
7661
  if (raw === undefined)
7671
7662
  return [];
@@ -7913,6 +7904,7 @@ function resourceSourceRelativePath(from) {
7913
7904
  return;
7914
7905
  return normalizeResourcePath(from.slice(separatorIndex + 1));
7915
7906
  }
7907
+ var RESOURCE_LINK_PATTERN = /(?:!?\[[^\]\n]*\]\()([^) \t\n]+)(?:\))/g;
7916
7908
  function findUndeclaredResourceLinks(body, resources) {
7917
7909
  const declared = new Set(resources.map((resource) => resource.from));
7918
7910
  const directoryResources = resources.filter((resource) => resource.kind === "directory").map((resource) => ({ from: resource.from, source: resourceSourceRelativePath(resource.from) }));
@@ -7935,6 +7927,8 @@ function findUndeclaredResourceLinks(body, resources) {
7935
7927
  }
7936
7928
  return [...found].map(([reference, suggestion]) => ({ reference, suggestion }));
7937
7929
  }
7930
+ var SCRIPT_EXTENSION_PATTERN = /\.(sh|bash|zsh|py|rb|pl|js|ts|mjs)$/i;
7931
+ var PLUGIN_ROOT_PATTERN = /\$\{?(?:CLAUDE_)?PLUGIN_ROOT\}?/;
7938
7932
  function findPluginRootScriptLinks(body) {
7939
7933
  const offenders = new Set;
7940
7934
  for (const match of body.matchAll(RESOURCE_LINK_PATTERN)) {
@@ -7982,17 +7976,19 @@ function canonicalResourceReference(value) {
7982
7976
  function isResourceReference(value) {
7983
7977
  return value.startsWith("shared:") || value.startsWith("plugin:");
7984
7978
  }
7985
- var RESOURCE_GROUPS, RESOURCE_LINK_PATTERN, SCRIPT_EXTENSION_PATTERN, PLUGIN_ROOT_PATTERN;
7986
- var init_resources = __esm(() => {
7987
- init_path();
7988
- init_yaml();
7989
- RESOURCE_GROUPS = new Set(["assets", "references", "scripts", "templates"]);
7990
- RESOURCE_LINK_PATTERN = /(?:!?\[[^\]\n]*\]\()([^) \t\n]+)(?:\))/g;
7991
- SCRIPT_EXTENSION_PATTERN = /\.(sh|bash|zsh|py|rb|pl|js|ts|mjs)$/i;
7992
- PLUGIN_ROOT_PATTERN = /\$\{?(?:CLAUDE_)?PLUGIN_ROOT\}?/;
7993
- });
7994
7979
 
7995
7980
  // src/skill-policy.ts
7981
+ var TARGET_KEYS = ["claude", "codex"];
7982
+ var PORTABLE_TOOL_KEYS = new Set([
7983
+ "edit",
7984
+ "mcp",
7985
+ "read",
7986
+ "search",
7987
+ "shell",
7988
+ "web_fetch",
7989
+ "web_search",
7990
+ "write"
7991
+ ]);
7996
7992
  function readImplicitInvocation(record, target, label) {
7997
7993
  const value = readTargetedValue(record, "implicit_invocation", target, label);
7998
7994
  if (value === undefined)
@@ -8420,21 +8416,6 @@ function readNonEmptyString2(value, label) {
8420
8416
  }
8421
8417
  return trimmed;
8422
8418
  }
8423
- var TARGET_KEYS, PORTABLE_TOOL_KEYS;
8424
- var init_skill_policy = __esm(() => {
8425
- init_yaml();
8426
- TARGET_KEYS = ["claude", "codex"];
8427
- PORTABLE_TOOL_KEYS = new Set([
8428
- "edit",
8429
- "mcp",
8430
- "read",
8431
- "search",
8432
- "shell",
8433
- "web_fetch",
8434
- "web_search",
8435
- "write"
8436
- ]);
8437
- });
8438
8419
 
8439
8420
  // src/preprocess.ts
8440
8421
  import { readFile } from "fs/promises";
@@ -8541,10 +8522,6 @@ function validatePartialPath(path, specifier, context) {
8541
8522
  }
8542
8523
  }
8543
8524
  }
8544
- var init_preprocess = __esm(() => {
8545
- init_config();
8546
- init_path();
8547
- });
8548
8525
 
8549
8526
  // src/structured-output.ts
8550
8527
  function renderValidatedJson(value, label) {
@@ -8670,11 +8647,11 @@ function quoteTomlString(value) {
8670
8647
  function structuredOutputLabel(args) {
8671
8648
  return args.sourcePath === undefined ? args.targetPath : `${args.sourcePath} -> ${args.targetPath}`;
8672
8649
  }
8673
- var init_structured_output = __esm(() => {
8674
- init_yaml();
8675
- });
8676
8650
 
8677
8651
  // src/versioning.ts
8652
+ var DEFAULT_VERSION = "0.1.0";
8653
+ var SUPPORTED_SOURCE_SCHEMA = 1;
8654
+ var SEMVER_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
8678
8655
  function validateSchemaField(metadata, label) {
8679
8656
  const value = metadata.schema;
8680
8657
  if (value === undefined)
@@ -8709,17 +8686,16 @@ function skillVersion(graph, plugin, skill) {
8709
8686
  function skillVersionLabel(graph, plugin, skill) {
8710
8687
  return `${skill.id}@${skillVersion(graph, plugin, skill)}`;
8711
8688
  }
8712
- var DEFAULT_VERSION = "0.1.0", SUPPORTED_SOURCE_SCHEMA = 1, SEMVER_PATTERN;
8713
- var init_versioning = __esm(() => {
8714
- init_config();
8715
- SEMVER_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
8716
- });
8717
8689
 
8718
8690
  // src/render.ts
8719
- import { readFileSync, readdirSync, statSync } from "fs";
8720
- import { readdir, readFile as readFile2, stat as stat2 } from "fs/promises";
8721
- import { createHash } from "crypto";
8722
- import { basename, dirname as dirname2, join as join2, relative as relative3 } from "path";
8691
+ var textEncoder = new TextEncoder;
8692
+ var textDecoder = new TextDecoder;
8693
+ var DEFAULT_CODEX_COLOR = "#B06DFF";
8694
+ var COMPILER_ID = "skillset";
8695
+ var COMPILER_VERSION = "0.1.0";
8696
+ var GENERATED_BY = `${COMPILER_ID}@${COMPILER_VERSION}`;
8697
+ var CLAUDE_RULES_OUTPUT_ROOT = ".claude/rules";
8698
+ var CODEX_RULES_LOCK_ROOT = ".";
8723
8699
  async function renderBuildGraph(graph) {
8724
8700
  const rendered = [];
8725
8701
  const lockRoots = new Map;
@@ -10033,25 +10009,22 @@ function titleize(value) {
10033
10009
  function readFileSyncBytes(path) {
10034
10010
  return readFileSync(path);
10035
10011
  }
10036
- var textEncoder, textDecoder, DEFAULT_CODEX_COLOR = "#B06DFF", COMPILER_ID = "skillset", COMPILER_VERSION = "0.1.0", GENERATED_BY, CLAUDE_RULES_OUTPUT_ROOT = ".claude/rules", CODEX_RULES_LOCK_ROOT = ".";
10037
- var init_render = __esm(() => {
10038
- init_config();
10039
- init_hooks();
10040
- init_path();
10041
- init_resources();
10042
- init_skill_policy();
10043
- init_preprocess();
10044
- init_structured_output();
10045
- init_versioning();
10046
- init_yaml();
10047
- textEncoder = new TextEncoder;
10048
- textDecoder = new TextDecoder;
10049
- GENERATED_BY = `${COMPILER_ID}@${COMPILER_VERSION}`;
10050
- });
10051
10012
 
10052
10013
  // src/resolver.ts
10053
10014
  import { readdir as readdir2, readFile as readFile3, stat as stat3 } from "fs/promises";
10054
10015
  import { basename as basename2, dirname as dirname3, join as join3, relative as relative4, sep as sep3 } from "path";
10016
+ var DEFAULT_SOURCE_DIR = ".skillset";
10017
+ var ROOT_CONFIG_FILE = "config.yaml";
10018
+ var PLUGIN_CONFIG_FILES = ["skillset.yaml", "config.yaml"];
10019
+ var PLUGINS_DIR = "plugins";
10020
+ var INSTRUCTIONS_DIR = "instructions";
10021
+ var INSTRUCTIONS_COMPAT_DIR = "rules";
10022
+ var SKILLS_DIR = "skills";
10023
+ var SKILL_FILE = "SKILL.md";
10024
+ var RULES_OUTPUT_ROOT = ".claude/rules";
10025
+ var TARGET_NATIVE_SOURCE_DIR = "src";
10026
+ var PROJECT_AGENTS_DIR = "agents";
10027
+ var PLUGIN_FEATURE_KEYS = ["bin", "mcp"];
10055
10028
  async function loadBuildGraph(rootPath, options = {}) {
10056
10029
  const sourceDir = options.sourceDir ?? DEFAULT_SOURCE_DIR;
10057
10030
  const sourcePath = resolveInside(rootPath, sourceDir);
@@ -10628,20 +10601,11 @@ function isSameOrInside(candidate, parent) {
10628
10601
  const relativePath = relative4(parent, candidate);
10629
10602
  return relativePath === "" || !relativePath.startsWith("..") && !relativePath.includes(`..${sep3}`);
10630
10603
  }
10631
- var DEFAULT_SOURCE_DIR = ".skillset", ROOT_CONFIG_FILE = "config.yaml", PLUGIN_CONFIG_FILES, PLUGINS_DIR = "plugins", INSTRUCTIONS_DIR = "instructions", INSTRUCTIONS_COMPAT_DIR = "rules", SKILLS_DIR = "skills", SKILL_FILE = "SKILL.md", RULES_OUTPUT_ROOT = ".claude/rules", TARGET_NATIVE_SOURCE_DIR = "src", PROJECT_AGENTS_DIR = "agents", PLUGIN_FEATURE_KEYS;
10632
- var init_resolver = __esm(() => {
10633
- init_config();
10634
- init_path();
10635
- init_resources();
10636
- init_versioning();
10637
- init_yaml();
10638
- PLUGIN_CONFIG_FILES = ["skillset.yaml", "config.yaml"];
10639
- PLUGIN_FEATURE_KEYS = ["bin", "mcp"];
10640
- });
10641
10604
 
10642
10605
  // src/build.ts
10643
- import { mkdir, readdir as readdir3, readFile as readFile4, rm, stat as stat4, writeFile } from "fs/promises";
10644
- import { dirname as dirname4, join as join4, relative as relative5 } from "path";
10606
+ var WORKSPACE_LOCK_FILE = ".skillset.lock";
10607
+ var textDecoder2 = new TextDecoder;
10608
+ var CODEX_AGENTS_MAX_BYTES = 32 * 1024;
10645
10609
  function warnLargeInstructionFiles(rendered) {
10646
10610
  for (const file of rendered) {
10647
10611
  if (file.path !== "AGENTS.md" && !file.path.endsWith("/AGENTS.md"))
@@ -11011,19 +10975,32 @@ async function exists3(path) {
11011
10975
  throw error;
11012
10976
  }
11013
10977
  }
11014
- var WORKSPACE_LOCK_FILE = ".skillset.lock", textDecoder2, CODEX_AGENTS_MAX_BYTES;
11015
- var init_build = __esm(() => {
11016
- init_path();
11017
- init_render();
11018
- init_resolver();
11019
- init_yaml();
11020
- textDecoder2 = new TextDecoder;
11021
- CODEX_AGENTS_MAX_BYTES = 32 * 1024;
11022
- });
11023
10978
 
11024
10979
  // src/lint.ts
11025
10980
  import { readFile as readFile5, stat as stat5 } from "fs/promises";
11026
10981
  import { join as join5, relative as relative6 } from "path";
10982
+ var CLAUDE_DYNAMIC_PATTERNS = [
10983
+ {
10984
+ code: "claude-arguments",
10985
+ label: "$ARGUMENTS",
10986
+ pattern: /\$ARGUMENTS(?:\b|\[[^\]]+\]|\.[A-Za-z_][A-Za-z0-9_-]*)/
10987
+ },
10988
+ {
10989
+ code: "claude-positional-argument",
10990
+ label: "$0/$1 positional arguments",
10991
+ pattern: /(^|[^\w$])\$[0-9]+\b/
10992
+ },
10993
+ {
10994
+ code: "claude-env-substitution",
10995
+ label: "${CLAUDE_*} substitution",
10996
+ pattern: /\$\{CLAUDE_[A-Z0-9_]+\}/
10997
+ },
10998
+ {
10999
+ code: "claude-shell-placeholder",
11000
+ label: "Claude shell-command placeholder",
11001
+ pattern: /(^|\n)\s*!`[^`\n]+`/
11002
+ }
11003
+ ];
11027
11004
  async function lintSkillset(rootPath, options = {}) {
11028
11005
  const graph = await loadBuildGraph(rootPath, options);
11029
11006
  emitGraphWarnings(graph);
@@ -11214,39 +11191,9 @@ function formatLintError(issues) {
11214
11191
  ${issues.map((issue) => `${issue.path}: ${issue.code}: ${issue.message}`).join(`
11215
11192
  `)}`;
11216
11193
  }
11217
- var CLAUDE_DYNAMIC_PATTERNS;
11218
- var init_lint = __esm(() => {
11219
- init_config();
11220
- init_hooks();
11221
- init_resources();
11222
- init_resolver();
11223
- init_skill_policy();
11224
- CLAUDE_DYNAMIC_PATTERNS = [
11225
- {
11226
- code: "claude-arguments",
11227
- label: "$ARGUMENTS",
11228
- pattern: /\$ARGUMENTS(?:\b|\[[^\]]+\]|\.[A-Za-z_][A-Za-z0-9_-]*)/
11229
- },
11230
- {
11231
- code: "claude-positional-argument",
11232
- label: "$0/$1 positional arguments",
11233
- pattern: /(^|[^\w$])\$[0-9]+\b/
11234
- },
11235
- {
11236
- code: "claude-env-substitution",
11237
- label: "${CLAUDE_*} substitution",
11238
- pattern: /\$\{CLAUDE_[A-Z0-9_]+\}/
11239
- },
11240
- {
11241
- code: "claude-shell-placeholder",
11242
- label: "Claude shell-command placeholder",
11243
- pattern: /(^|\n)\s*!`[^`\n]+`/
11244
- }
11245
- ];
11246
- });
11247
11194
 
11248
11195
  // src/authoring.ts
11249
- import { resolve as resolve3, relative as relative7 } from "path";
11196
+ var textDecoder3 = new TextDecoder;
11250
11197
  async function explainPath(rootPath, inputPath, options = {}) {
11251
11198
  const graph = await loadBuildGraph(rootPath, options);
11252
11199
  const rendered = scopedRenderedFiles(graph, await renderBuildGraph(graph), options.scopes);
@@ -11409,20 +11356,40 @@ function normalizeRepoPath(rootPath, inputPath) {
11409
11356
  const absolute = resolve3(rootPath, inputPath);
11410
11357
  return relative7(rootPath, absolute).replaceAll("\\", "/");
11411
11358
  }
11412
- var textDecoder3;
11413
- var init_authoring = __esm(() => {
11414
- init_build();
11415
- init_lint();
11416
- init_render();
11417
- init_resolver();
11418
- init_yaml();
11419
- textDecoder3 = new TextDecoder;
11420
- });
11421
11359
 
11422
11360
  // src/import.ts
11423
11361
  import { mkdir as mkdir2, mkdtemp, readdir as readdir4, readFile as readFile6, realpath, rename, rm as rm2, stat as stat6, writeFile as writeFile2 } from "fs/promises";
11424
11362
  import { homedir } from "os";
11425
11363
  import { basename as basename3, dirname as dirname5, join as join6, resolve as resolve4 } from "path";
11364
+ var DEFAULT_SOURCE_DIR2 = ".skillset";
11365
+ var RECOGNIZED_SOURCE_KEYS = new Set([
11366
+ "agents",
11367
+ "allowed_tools",
11368
+ "claude",
11369
+ "codex",
11370
+ "description",
11371
+ "id",
11372
+ "implicit_invocation",
11373
+ "name",
11374
+ "resources",
11375
+ "skillset",
11376
+ "summary",
11377
+ "title",
11378
+ "tool_intent",
11379
+ "tools",
11380
+ "version"
11381
+ ]);
11382
+ var KNOWN_TARGET_NATIVE_KEYS = new Set([
11383
+ "allowed-tools",
11384
+ "argument-hint",
11385
+ "color",
11386
+ "disable-model-invocation",
11387
+ "disallowed-tools",
11388
+ "license",
11389
+ "metadata",
11390
+ "model",
11391
+ "user-facing-name"
11392
+ ]);
11426
11393
  async function importSources(options) {
11427
11394
  const sourcePath = resolveImportSourcePath(options);
11428
11395
  const plan = await planImports(sourcePath, options.kind);
@@ -11751,44 +11718,14 @@ async function exists4(path) {
11751
11718
  throw error;
11752
11719
  }
11753
11720
  }
11754
- var DEFAULT_SOURCE_DIR2 = ".skillset", RECOGNIZED_SOURCE_KEYS, KNOWN_TARGET_NATIVE_KEYS;
11755
- var init_import = __esm(() => {
11756
- init_config();
11757
- init_path();
11758
- init_yaml();
11759
- RECOGNIZED_SOURCE_KEYS = new Set([
11760
- "agents",
11761
- "allowed_tools",
11762
- "claude",
11763
- "codex",
11764
- "description",
11765
- "id",
11766
- "implicit_invocation",
11767
- "name",
11768
- "resources",
11769
- "skillset",
11770
- "summary",
11771
- "title",
11772
- "tool_intent",
11773
- "tools",
11774
- "version"
11775
- ]);
11776
- KNOWN_TARGET_NATIVE_KEYS = new Set([
11777
- "allowed-tools",
11778
- "argument-hint",
11779
- "color",
11780
- "disable-model-invocation",
11781
- "disallowed-tools",
11782
- "license",
11783
- "metadata",
11784
- "model",
11785
- "user-facing-name"
11786
- ]);
11787
- });
11788
11721
 
11789
11722
  // src/setup.ts
11790
11723
  import { mkdir as mkdir3, readdir as readdir5, readFile as readFile7, stat as stat7, writeFile as writeFile3 } from "fs/promises";
11791
11724
  import { basename as basename4, dirname as dirname6, join as join7, resolve as resolve5 } from "path";
11725
+ var DEFAULT_CREATE_NAME = "my-skillset";
11726
+ var DEFAULT_GLOBAL_SOURCE = ".skillset/src";
11727
+ var INSTRUCTIONS_DIR2 = ".skillset/instructions";
11728
+ var SETUP_SOURCE_DIR = ".skillset/src";
11792
11729
  async function initSkillset(options = {}) {
11793
11730
  const rootPath = resolve5(options.cwd ?? process.cwd(), options.rootPath ?? ".");
11794
11731
  return applySetupPlan("init", rootPath, options);
@@ -11940,18 +11877,18 @@ async function pathExists(path) {
11940
11877
  function isErrno2(error, code) {
11941
11878
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
11942
11879
  }
11943
- var DEFAULT_CREATE_NAME = "my-skillset", DEFAULT_GLOBAL_SOURCE = ".skillset/src", INSTRUCTIONS_DIR2 = ".skillset/instructions", SETUP_SOURCE_DIR = ".skillset/src";
11944
- var init_setup = __esm(() => {
11945
- init_path();
11946
- });
11947
11880
 
11948
- // src/cli.ts
11949
- var exports_cli = {};
11950
- __export(exports_cli, {
11951
- runCli: () => runCli,
11952
- reportCliError: () => reportCliError
11953
- });
11954
- import { basename as basename5, resolve as resolve6 } from "path";
11881
+ // src/cli-core.ts
11882
+ var USAGE = [
11883
+ "usage: skillset build [--yes|--dry-run] [--updated|--all] [--scope <scope>] [--root <path>] [--source <dir>] [--dist <dir>]",
11884
+ " skillset <check|diff|doctor|lint|list> [--updated|--all] [--scope <scope>] [--root <path>] [--source <dir>] [--dist <dir>]",
11885
+ " skillset init [path] [--yes|--dry-run] [--targets claude,codex] [--with-project-doc] [--with-agents] [--with-islands] [--name <name>] [--root <path>]",
11886
+ " skillset create [path|--global] [--yes|--dry-run] [--targets claude,codex] [--with-project-doc] [--with-agents] [--with-islands] [--name <name>] [--root <path>]",
11887
+ " skillset explain <path> [--root <path>] [--source <dir>]",
11888
+ " skillset import [skill|skills|plugin|plugins] <path> [--kind <kind>] [--from <provider>] [--name <name>] [--root <path>] [--source <dir>]",
11889
+ " skillset import <claude|codex|agents> [--root <path>] [--source <dir>]"
11890
+ ].join(`
11891
+ `);
11955
11892
  async function runCli(rawArgs = process.argv.slice(2), invokedName = basename5(process.argv[1] ?? "")) {
11956
11893
  const args = invokedName === "create-skillset" ? ["create", ...rawArgs] : rawArgs;
11957
11894
  if (args.some((arg) => arg === "--help" || arg === "-h")) {
@@ -12401,30 +12338,6 @@ function isImportKind(value) {
12401
12338
  function isImportProvider(value) {
12402
12339
  return value === "agents" || value === "claude" || value === "codex" || value === "skillset";
12403
12340
  }
12404
- var USAGE;
12405
- var init_cli = __esm(() => {
12406
- init_authoring();
12407
- init_build();
12408
- init_import();
12409
- init_lint();
12410
- init_setup();
12411
- USAGE = [
12412
- "usage: skillset build [--yes|--dry-run] [--updated|--all] [--scope <scope>] [--root <path>] [--source <dir>] [--dist <dir>]",
12413
- " skillset <check|diff|doctor|lint|list> [--updated|--all] [--scope <scope>] [--root <path>] [--source <dir>] [--dist <dir>]",
12414
- " skillset init [path] [--yes|--dry-run] [--targets claude,codex] [--with-project-doc] [--with-agents] [--with-islands] [--name <name>] [--root <path>]",
12415
- " skillset create [path|--global] [--yes|--dry-run] [--targets claude,codex] [--with-project-doc] [--with-agents] [--with-islands] [--name <name>] [--root <path>]",
12416
- " skillset explain <path> [--root <path>] [--source <dir>]",
12417
- " skillset import [skill|skills|plugin|plugins] <path> [--kind <kind>] [--from <provider>] [--name <name>] [--root <path>] [--source <dir>]",
12418
- " skillset import <claude|codex|agents> [--root <path>] [--source <dir>]"
12419
- ].join(`
12420
- `);
12421
- if (import.meta.main && !globalThis.__skillsetCreateEntrypoint) {
12422
- runCli().catch(reportCliError);
12423
- }
12424
- });
12425
- init_cli();
12426
12341
 
12427
- export {
12428
- runCli,
12429
- reportCliError
12430
- };
12342
+ // src/cli.ts
12343
+ runCli().catch(reportCliError);