@vegastack/skills 0.4.0 → 0.5.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 -0
- package/dist/index.js +30 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ npx @vegastack/skills add arch-guardian
|
|
|
36
36
|
| `--force` | Overwrite a modified installed copy |
|
|
37
37
|
| `--non-interactive` | Skip prompts and use defaults: `--agent both`, project-local (for automation) |
|
|
38
38
|
|
|
39
|
+
Agent targeting is automatic: the CLI detects which agents you have (`~/.claude`, `~/.codex`/`~/.agents`, `~/.hermes`) and targets them without asking — `--agent` overrides. A numbered picker appears only when nothing is detected. Installs are project-local by default; pass `--global` for the home directory (required for Hermes).
|
|
40
|
+
|
|
39
41
|
## Agent surfaces
|
|
40
42
|
|
|
41
43
|
| Agent | Project install | Global install |
|
package/dist/index.js
CHANGED
|
@@ -77,20 +77,40 @@ async function requireSkill(options) {
|
|
|
77
77
|
throw new Error(`Unknown skill: ${options.skill}. Bundled skills: ${skills.join(", ")}`);
|
|
78
78
|
return options.skill;
|
|
79
79
|
}
|
|
80
|
+
var agentLabels = { claude: "Claude Code", codex: "Codex", hermes: "Hermes" };
|
|
81
|
+
async function detectAgents() {
|
|
82
|
+
const detected = [];
|
|
83
|
+
if (await exists(join(homedir(), ".claude")))
|
|
84
|
+
detected.push("claude");
|
|
85
|
+
if (await exists(join(homedir(), ".codex")) || await exists(join(homedir(), ".agents")))
|
|
86
|
+
detected.push("codex");
|
|
87
|
+
if (await exists(join(homedir(), ".hermes")))
|
|
88
|
+
detected.push("hermes");
|
|
89
|
+
return detected;
|
|
90
|
+
}
|
|
80
91
|
async function prompt(options) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
const mode = options.mode ?? "project";
|
|
93
|
+
if (options.agent)
|
|
94
|
+
return { agent: options.agent, mode };
|
|
95
|
+
if (options.nonInteractive || !process.stdin.isTTY)
|
|
96
|
+
return { agent: "both", mode };
|
|
97
|
+
const detected = (await detectAgents()).filter((agent2) => mode === "global" || agent2 !== "hermes");
|
|
98
|
+
if (detected.length) {
|
|
99
|
+
console.log(`Detected: ${detected.map((agent2) => agentLabels[agent2]).join(", ")} (override with --agent)`);
|
|
100
|
+
if (detected.length === 1)
|
|
101
|
+
return { agent: detected[0], mode };
|
|
102
|
+
return { agent: detected.includes("hermes") ? "all" : "both", mode };
|
|
85
103
|
}
|
|
104
|
+
console.log("Where should this skill be installed?");
|
|
105
|
+
console.log(" 1) Claude Code (.claude/skills)");
|
|
106
|
+
console.log(" 2) Codex (.agents/skills)");
|
|
107
|
+
console.log(" 3) Both (recommended)");
|
|
86
108
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
87
|
-
const
|
|
88
|
-
const modeAnswer = options.mode ?? await rl.question("Install project-local or user-global? [project] ");
|
|
109
|
+
const answer = (await rl.question("Select 1-3 [3]: ")).trim();
|
|
89
110
|
rl.close();
|
|
90
|
-
const agent =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
throw new Error(`Invalid agent choice: ${agent}`);
|
|
111
|
+
const agent = { "1": "claude", "2": "codex", "3": "both", "": "both" }[answer];
|
|
112
|
+
if (!agent)
|
|
113
|
+
throw new Error(`Invalid selection: ${answer} (expected 1, 2, or 3)`);
|
|
94
114
|
return { agent, mode };
|
|
95
115
|
}
|
|
96
116
|
function resolveAgents(choice, mode) {
|