diff --git a/CLAUDE.md b/CLAUDE.md index b2258b2..5e70545 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,56 +1,123 @@ +--- +description: Agent instructions for the subtrack monorepo +--- + # subtrack Monorepo for **subtrack** — a CLI tool to manage subscription services from the terminal. +## Agent Role + +You are a subtrack agent. Your primary responsibilities in this repository are: + +- Understanding the full monorepo structure and how packages relate +- Implementing features and fixing bugs in the CLI tool (`subtrack/`) +- Maintaining code quality, type safety, and test coverage +- Following project conventions (ESM, TypeScript strict, `sql.js`, `gunshi`) +- Knowing when to load project-specific skills for detailed guidance + ## Repository Structure ``` . -├── subtrack/ # CLI tool (Node.js/TypeScript, published as npm package) -├── docs/ # Documentation site (SvelteKit) -├── .agents/ # OpenCode agent and skill definitions -├── flake.nix # Nix devShell / CI shell +├── subtrack/ # CLI tool (Node.js/TypeScript, published as npm package) +│ ├── src/ # Source code +│ ├── dist/ # Build output (dist/index.mjs) +│ ├── package.json # Dependencies and scripts +│ └── tsconfig.json # TypeScript configuration +├── docs/ # Documentation site (SvelteKit) +├── .agents/skills/ # OpenCode skill definitions +├── flake.nix # Nix devShell / CI shell └── pnpm-workspace.yaml ``` -## Package Management +**Key**: All application code lives under `subtrack/`. The monorepo root has no dependencies of its own. + +## Design Tenets + +1. **CLI-native** — Everything is driven from the terminal. No web UI, no daemon, no TUI framework. +2. **SQLite persistence** — Data is stored locally via `sql.js` (WASM SQLite). No external database servers. +3. **Layer separation** — Code is organized into strict layers (entry → commands → DB → display). Cross-layer concerns are mediated, not mixed. +4. **Interactive by default, scriptable by flag** — Commands prompt interactively when invoked bare, but accept flags for automation. +5. **Portable** — Works on Linux/macOS. Single binary via npm package. No platform-specific dependencies. + +## Architecture Overview -- Use `pnpm add ` instead of `npm install ` or `bun add ` -- Use `pnpm remove ` instead of `npm uninstall ` or `bun remove ` -- Use `pnpm update` instead of `npm update` or `bun update` -- Use `pnpm run