|
8 | 8 | */ |
9 | 9 |
|
10 | 10 | import { describe, expect, test } from "bun:test"; |
11 | | -import { readFileSync } from "node:fs"; |
| 11 | +import { existsSync, readFileSync } from "node:fs"; |
12 | 12 | import { join } from "node:path"; |
13 | 13 |
|
14 | 14 | const scriptsDir = import.meta.dir; |
@@ -56,10 +56,20 @@ describe("install.sh", () => { |
56 | 56 | expect(script).toContain("git clone --depth 1 --filter=blob:none --sparse"); |
57 | 57 | expect(script).toContain("git sparse-checkout set apps/skills"); |
58 | 58 | expect(script).toContain("CLAUDE_SKILLS_DIR"); |
59 | | - expect(script).toContain("AGENTS_SKILLS_DIR"); |
| 59 | + expect(script).toContain("CODEX_SKILLS_DIR"); |
| 60 | + expect(script).toContain("$HOME/.codex/skills"); |
| 61 | + expect(script).not.toContain('mkdir -p "$CLAUDE_SKILLS_DIR" "$AGENTS_SKILLS_DIR"'); |
| 62 | + expect(script).not.toContain('cp -r apps/skills/* "$AGENTS_SKILLS_DIR/"'); |
60 | 63 | expect(script).toContain('Skipping skills install (git not found)'); |
61 | 64 | }); |
62 | 65 |
|
| 66 | + test("cleans only legacy command-overlap agent skills", () => { |
| 67 | + expect(script).toContain("LEGACY_AGENTS_SKILLS_DIR"); |
| 68 | + expect(script).toContain("plannotator-review plannotator-annotate plannotator-last"); |
| 69 | + expect(script).not.toContain("plannotator-review plannotator-annotate plannotator-last plannotator-compound"); |
| 70 | + expect(script).not.toContain("plannotator-review plannotator-annotate plannotator-last plannotator-setup-goal"); |
| 71 | + }); |
| 72 | + |
63 | 73 | test("installs slash commands for Claude Code and OpenCode", () => { |
64 | 74 | expect(script).toContain("plannotator-review.md"); |
65 | 75 | expect(script).toContain("plannotator-annotate.md"); |
@@ -147,10 +157,19 @@ describe("install.ps1", () => { |
147 | 157 | expect(script).toContain("git clone --depth 1 --filter=blob:none --sparse"); |
148 | 158 | expect(script).toContain("git sparse-checkout set apps/skills"); |
149 | 159 | expect(script).toContain("claudeSkillsDir"); |
150 | | - expect(script).toContain("agentsSkillsDir"); |
| 160 | + expect(script).toContain("codexSkillsDir"); |
| 161 | + expect(script).toContain("$env:USERPROFILE\\.codex\\skills"); |
| 162 | + expect(script).not.toContain('$agentsSkillsDir = "$env:USERPROFILE\\.agents\\skills"'); |
151 | 163 | expect(script).toContain('Skipping skills install (git not found)'); |
152 | 164 | }); |
153 | 165 |
|
| 166 | + test("cleans only legacy command-overlap agent skills", () => { |
| 167 | + expect(script).toContain("legacyAgentsSkillsDir"); |
| 168 | + expect(script).toContain('"plannotator-review", "plannotator-annotate", "plannotator-last"'); |
| 169 | + expect(script).not.toContain('"plannotator-review", "plannotator-annotate", "plannotator-last", "plannotator-compound"'); |
| 170 | + expect(script).not.toContain('"plannotator-review", "plannotator-annotate", "plannotator-last", "plannotator-setup-goal"'); |
| 171 | + }); |
| 172 | + |
154 | 173 | test("installs slash commands", () => { |
155 | 174 | expect(script).toContain("plannotator-review.md"); |
156 | 175 | expect(script).toContain("plannotator-annotate.md"); |
@@ -208,10 +227,19 @@ describe("install.cmd", () => { |
208 | 227 | expect(script).toContain("git clone --depth 1 --filter=blob:none --sparse"); |
209 | 228 | expect(script).toContain("git sparse-checkout set apps/skills"); |
210 | 229 | expect(script).toContain("CLAUDE_SKILLS_DIR"); |
211 | | - expect(script).toContain("AGENTS_SKILLS_DIR"); |
| 230 | + expect(script).toContain("CODEX_SKILLS_DIR"); |
| 231 | + expect(script).toContain("%USERPROFILE%\\.codex\\skills"); |
| 232 | + expect(script).not.toContain('set "AGENTS_SKILLS_DIR=%USERPROFILE%\\.agents\\skills"'); |
212 | 233 | expect(script).toContain("Skipping skills install"); |
213 | 234 | }); |
214 | 235 |
|
| 236 | + test("cleans only legacy command-overlap agent skills", () => { |
| 237 | + expect(script).toContain("LEGACY_AGENTS_SKILLS_DIR"); |
| 238 | + expect(script).toContain("plannotator-review plannotator-annotate plannotator-last"); |
| 239 | + expect(script).not.toContain("plannotator-review plannotator-annotate plannotator-last plannotator-compound"); |
| 240 | + expect(script).not.toContain("plannotator-review plannotator-annotate plannotator-last plannotator-setup-goal"); |
| 241 | + }); |
| 242 | + |
215 | 243 | test("installs slash commands", () => { |
216 | 244 | expect(script).toContain("plannotator-review.md"); |
217 | 245 | expect(script).toContain("plannotator-annotate.md"); |
@@ -246,6 +274,15 @@ describe("install.cmd", () => { |
246 | 274 | }); |
247 | 275 | }); |
248 | 276 |
|
| 277 | +describe("Codex Plannotator skills", () => { |
| 278 | + test("command-overlap skills include OpenAI agent config", () => { |
| 279 | + for (const skill of ["plannotator-review", "plannotator-annotate", "plannotator-last"]) { |
| 280 | + const configPath = join(scriptsDir, "..", "apps", "skills", skill, "agents", "openai.yaml"); |
| 281 | + expect(existsSync(configPath)).toBe(true); |
| 282 | + } |
| 283 | + }); |
| 284 | +}); |
| 285 | + |
249 | 286 | describe("install shared behavior", () => { |
250 | 287 | const sh = readFileSync(join(scriptsDir, "install.sh"), "utf-8"); |
251 | 288 | const ps = readFileSync(join(scriptsDir, "install.ps1"), "utf-8"); |
|
0 commit comments