cyberaudit-skill 3.1.3 → 3.1.5

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 (2) hide show
  1. package/dist/cli.js +24 -10
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
- import { existsSync, mkdirSync, cpSync, writeFileSync, readFileSync } from "fs";
3
+ import { existsSync, mkdirSync, cpSync, readdirSync, writeFileSync, readFileSync, rmSync, unlinkSync } from "fs";
4
4
  import { createInterface } from "readline";
5
5
  import { homedir } from "os";
6
6
  import { join, dirname } from "path";
@@ -38,6 +38,12 @@ function detectInstalledAgents() {
38
38
  found.push("antigravity-cli");
39
39
  return found;
40
40
  }
41
+ function installDir(src, dst) {
42
+ if (existsSync(dst))
43
+ rmSync(dst, { recursive: true, force: true });
44
+ mkdirSync(dirname(dst), { recursive: true });
45
+ cpSync(src, dst, { recursive: true });
46
+ }
41
47
  function installSkill(targetDir, agent, dryRun) {
42
48
  if (!existsSync(SKILL_SRC)) {
43
49
  console.error(`✗ Skill source not found at ${SKILL_SRC}.`);
@@ -47,23 +53,31 @@ function installSkill(targetDir, agent, dryRun) {
47
53
  console.log(` → Would install to ${targetDir} (--dry-run)`);
48
54
  return true;
49
55
  }
50
- // Install/update skill files
51
- mkdirSync(targetDir, { recursive: true });
52
- cpSync(SKILL_SRC, targetDir, { recursive: true });
56
+ // Wipe + re-copy skill dir so stale files are cleaned up
57
+ installDir(SKILL_SRC, targetDir);
53
58
  console.log(` ✓ Installed at ${targetDir}`);
54
59
  // Install command + skill files for opencode
55
60
  if (agent === "opencode") {
56
61
  const opencodeConf = join(homedir(), ".config", "opencode");
57
- const cmdDir = join(opencodeConf, "commands");
58
62
  const cmdSrc = join(PKG_ROOT, "skills", "cyberaudit", "commands");
59
63
  if (existsSync(cmdSrc)) {
60
- mkdirSync(cmdDir, { recursive: true });
61
- cpSync(cmdSrc, cmdDir, { recursive: true });
64
+ // Remove stale audit command files, keep other commands (caveman etc.)
65
+ if (existsSync(opencodeConf + "/commands")) {
66
+ for (const f of readdirSync(opencodeConf + "/commands")) {
67
+ if (typeof f === "string" && f.startsWith("audit") && f.endsWith(".md")) {
68
+ try {
69
+ unlinkSync(join(opencodeConf, "commands", f));
70
+ }
71
+ catch { }
72
+ }
73
+ }
74
+ }
75
+ mkdirSync(join(opencodeConf, "commands"), { recursive: true });
76
+ cpSync(cmdSrc, join(opencodeConf, "commands"), { recursive: true });
62
77
  console.log(` ✓ Commands installed to opencode`);
63
78
  }
64
- const skillDir = join(opencodeConf, "skills", "cyberaudit");
65
- mkdirSync(skillDir, { recursive: true });
66
- cpSync(SKILL_SRC, skillDir, { recursive: true });
79
+ // Wipe + re-copy opencode skill dir
80
+ installDir(SKILL_SRC, join(opencodeConf, "skills", "cyberaudit"));
67
81
  console.log(` ✓ Skill installed to opencode`);
68
82
  }
69
83
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberaudit-skill",
3
- "version": "3.1.3",
3
+ "version": "3.1.5",
4
4
  "description": "Universal security audit skill for AI agents. Install once, audit any web or mobile app. OpenCode, Claude Code, Cursor, Kiro, Gemini — all supported.",
5
5
  "keywords": [
6
6
  "mcp",