impeccable 2.2.0 → 2.3.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.
@@ -398,6 +398,36 @@ function copyProviderSkills(bundleDir, root, targets) {
398
398
  return written;
399
399
  }
400
400
 
401
+ /**
402
+ * Codex reads custom subagents from `.codex/agents/*.toml`, a sibling of the
403
+ * skill dir that the skills/ copy never touches. Treat it as a sidecar: only
404
+ * write it for projects that actually use Codex, so a pure Claude project
405
+ * doesn't get a stray `.codex/` folder. Codex-likely = the .agents (Codex
406
+ * skills) variant is a target, or a global ~/.codex install exists.
407
+ */
408
+ function isCodexLikely(targets) {
409
+ return targets.includes('.agents') || existsSync(join(homedir(), '.codex'));
410
+ }
411
+
412
+ /**
413
+ * Copy the Codex subagent definitions from the bundle's top-level `.codex/agents`
414
+ * into the project's `.codex/agents`. Returns the number of files written (0 when
415
+ * the bundle has none).
416
+ */
417
+ function installCodexAgents(bundleDir, root) {
418
+ const srcDir = join(bundleDir, '.codex', 'agents');
419
+ if (!existsSync(srcDir)) return 0;
420
+ const destDir = join(root, '.codex', 'agents');
421
+ let written = 0;
422
+ for (const entry of readdirSync(srcDir, { withFileTypes: true })) {
423
+ if (!entry.isFile()) continue;
424
+ mkdirSync(destDir, { recursive: true });
425
+ writeFileSync(join(destDir, entry.name), readFileSync(join(srcDir, entry.name)));
426
+ written++;
427
+ }
428
+ return written;
429
+ }
430
+
401
431
  async function install(flags) {
402
432
  const force = flags.includes('--force');
403
433
  const yes = flags.includes('-y') || flags.includes('--yes');
@@ -443,8 +473,15 @@ async function install(flags) {
443
473
  }
444
474
 
445
475
  let written = 0;
476
+ let codexAgents = 0;
446
477
  try {
447
478
  written = copyProviderSkills(bundleDir, root, targets);
479
+ // Codex users also need the asset-producer subagent, which lives in
480
+ // .codex/agents/ (a sibling of the skill dir, not part of skills/). Do this
481
+ // before the bundle is cleaned up below. Best-effort: never fail the install.
482
+ if (isCodexLikely(targets)) {
483
+ try { codexAgents = installCodexAgents(bundleDir, root); } catch {}
484
+ }
448
485
  } catch (e) {
449
486
  rmSync(bundleDir, { recursive: true, force: true });
450
487
  console.error(`Install failed: ${e.message}`);
@@ -457,6 +494,7 @@ async function install(flags) {
457
494
  process.exit(1);
458
495
  }
459
496
  console.log(`Installed impeccable into: ${targets.join(', ')}`);
497
+ if (codexAgents > 0) console.log(`Installed ${codexAgents} Codex subagent(s) into .codex/agents/`);
460
498
 
461
499
  // Ask about prefixing (skip in CI mode unless --prefix= is set)
462
500
  let prefix = '';
@@ -665,9 +703,18 @@ async function update(flags = []) {
665
703
 
666
704
  // Compare local vs remote -- skip if already up to date
667
705
  if (isUpToDate(root, providers, tmpDir)) {
706
+ // Skills match, but the Codex subagent sidecar may still be missing (e.g.
707
+ // an `npx skills add` install that only carried skills/). Heal it before
708
+ // declaring nothing to do.
709
+ let healed = 0;
710
+ if (isCodexLikely(providers)
711
+ && !existsSync(join(root, '.codex', 'agents', 'impeccable_asset_producer.toml'))) {
712
+ try { healed = installCodexAgents(tmpDir, root); } catch {}
713
+ }
668
714
  rmSync(tmpDir, { recursive: true, force: true });
669
715
  const v = getSkillsVersion(root);
670
- console.log(`Skills are up to date${v ? ` (v${v})` : ''}. Nothing to do.`);
716
+ if (healed > 0) console.log(`Installed ${healed} Codex subagent(s) into .codex/agents/`);
717
+ console.log(`Skills are up to date${v ? ` (v${v})` : ''}.${healed > 0 ? '' : ' Nothing to do.'}`);
671
718
  process.exit(0);
672
719
  }
673
720
 
@@ -704,6 +751,11 @@ async function update(flags = []) {
704
751
  }
705
752
  }
706
753
 
754
+ // Refresh the Codex subagent sidecar (.codex/agents/) alongside the skills.
755
+ if (isCodexLikely(providers)) {
756
+ try { installCodexAgents(tmpDir, root); } catch {}
757
+ }
758
+
707
759
  rmSync(tmpDir, { recursive: true, force: true });
708
760
 
709
761
  // Re-apply prefix if detected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impeccable",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "author": "Paul Bakaus",
5
5
  "description": "Design skills, commands, and anti-pattern detection for AI coding agents",
6
6
  "keywords": [