- OS: macOS
- Shell: zsh
rg(ripgrep) is not installed- Prefer
findandgrepwhen searching files/content
Nx monorepo with pnpm workspaces and TypeScript project references.
packages/core/ → @soundtouchjs/core (publishable library)
apps/demo/ → Development demo app (private, Vite dev server)
- Library build: TSC via
@nx/js/typescriptplugin (inferred fromtsconfig.lib.json) - Demo build: Vite via
@nx/vite/plugin(inferred fromindex.html) - Task orchestration: Nx handles dependency ordering —
builddepends on^build
- TypeScript, strict mode, ES2024 target, ESNext modules
- Module resolution:
bundler - ESM only (
"type": "module"in all package.json files) - Prettier with single quotes (see
.prettierrc) - No default exports from core library modules — use named exports in
index.ts - Prefer
import typefor type-only imports
pnpm install # Install all workspace dependencies
pnpm build # Build all projects (nx run-many -t build)
pnpm typecheck # Typecheck all projects
pnpm dev # Start demo dev server (Vite on port 8080)
pnpm prettier # Format all filesTest execution rule:
- Always run Vitest with
--run(never watch mode), e.g.pnpm exec vitest --run.
Individual project commands:
pnpm nx build core # Build the library (TSC → packages/core/.dist/)
pnpm nx build demo # Build the demo app (Vite → apps/demo/dist/)
pnpm nx dev demo # Dev server with HMRPackage build output convention:
- Publishable packages build to
.dist/(dot-prefixed) and publish ESM outputs from there.
- Commit messages follow Conventional Commits with sentence-case subjects, enforced by commitlint + husky
- Releases via
nx release— bumps version, generates changelog, tags, and publishes - The demo app resolves
@soundtouchjs/coreto source (not dist) during development via a Vite alias - Workspace dependency uses
"workspace:*"protocol (pnpm) - CI runs on GitHub Actions (
.github/workflows/main.yml) - Pre-commit hook runs typecheck and lint (skipped in CI via
$CIenv var) - Keep docs up to date with code changes: update affected README/docs files whenever public behavior, APIs, defaults, or workflows are changed
- Do not add comments or docstrings to code unless the logic is non-obvious
- Do not use CommonJS (
require/module.exports) anywhere - Do not use
anytype — useunknownwith narrowing or proper generics - Do not add dependencies to the core library — it has zero runtime dependencies
- Do not commit
.dist/,dist/,.nx/, or*.tsbuildinfofiles
- For navigating/exploring the workspace, invoke the
nx-workspaceskill first - it has patterns for querying projects, targets, and dependencies - When running tasks (for example build, lint, test, e2e, etc.), always prefer running the task through
nx(i.e.nx run,nx run-many,nx affected) instead of using the underlying tooling directly - Prefix nx commands with the workspace's package manager (e.g.,
pnpm nx build,npm exec nx test) - avoids using globally installed CLI - You have access to the Nx MCP server and its tools, use them to help the user
- For Nx plugin best practices, check
node_modules/@nx/<plugin>/PLUGIN.md. Not all plugins have this file - proceed without it if unavailable. - NEVER guess CLI flags - always check nx_docs or
--helpfirst when unsure
- For scaffolding tasks (creating apps, libs, project structure, setup), ALWAYS invoke the
nx-generateskill FIRST before exploring or calling MCP tools
- USE for: advanced config options, unfamiliar flags, migration guides, plugin configuration, edge cases
- DON'T USE for: basic generator syntax (
nx g @nx/react:app), standard commands, things you already know - The
nx-generateskill handles generator discovery internally - don't call nx_docs just to look up generator syntax