git clone https://github.com/omrikais/skill-manager.git
cd skill-manager
npm install
npm run build
npm link # makes `sm` available globallyRequires Node.js 20+. Use npm run dev for watch mode during development.
bin/sm.ts CLI entry point (Commander.js)
src/core/ Business logic (skill, meta, state, config, deploy resolution)
src/fs/ Filesystem operations (symlinks, scanner, backup, path constants)
src/deploy/ Deploy engine and format strategies
src/commands/ CLI command handlers
src/tui/ Ink v6 TUI (screens, hooks, components)
src/mcp/ MCP server (tools, resources, setup)
src/utils/ Errors, logger, slug, table formatting
tests/ Vitest test suite (unit, fs, deploy)
npm test # all tests
npx vitest run tests/unit/ # unit tests (pure functions, no I/O)
npx vitest run tests/fs/ # filesystem tests (isolated tmpdirs)
npx vitest run tests/deploy/ # deploy engine integration tests
npm run test:watch # watch modeTest isolation: FS and deploy tests use tests/helpers/tmpdir.ts, which creates a temporary ~/.skill-manager directory under os.tmpdir() via the SM_HOME and SM_TEST_HOME environment variables. Each test gets a fresh directory and cleans up after itself. Tests use vi.resetModules() with dynamic imports so path constants are re-evaluated against the temp environment.
- ESM-only — all imports use
.jsextensions (import { foo } from './bar.js') - Zod schemas for config, state, and manifest validation
- Errors extend
SmErrorwith a.codeproperty (seesrc/utils/errors.ts) - Logging goes to stderr via
src/utils/logger.ts; CLI output goes to stdout - JSX uses React 19 automatic runtime (
react-jsxtransform) - Type-check with
npm run lint(tsc --noEmit)
- Run
npm run lintandnpm testbefore submitting — both must pass - Keep PRs focused: one feature or fix per PR
- Describe what changed and why in the PR description
- Add tests for new functionality (unit tests for pure logic, FS tests for anything touching disk)
- Follow existing patterns — check nearby code for conventions before introducing new ones