/** * @fileoverview Agent skill per CLI: which workspace directory each CLI's sessions get * the one packaged skill in (`capabilities.agentSkillDir`), and the * `codeman skill install|uninstall` resolution that follows the registry. * * The skill is read from the REAL packaged source (`skills/codeman/`), so this also * guards that it meets the Agent Skills format every CLI (and the `npx skills` * installer) parses: a `name` equal to its directory, lowercase with hyphens, and a * description of at most 1024 characters. * * Pure filesystem and registry tests in a per-test temp dir. Port: N/A. */ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { mkdtemp, rm, mkdir, readFile, readdir } from 'node:fs/promises'; import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; import { agentSkillDir, agentSkillDirFor, applyAgentSkill, CLAUDE_AGENT_SKILL_DIR } from '../src/hooks-config.js'; import { getCli, listClis } from '../src/config/cli-registry/registry.js'; import { CliEntrySchema } from '../src/config/cli-registry/schema.js'; import { registryAgentSkillDirs, resolveSkillInstallDir } from '../src/cli.js'; const MARKER_PREFIX = '