@stackmemoryai/stackmemory 1.5.4 → 1.5.5

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.
@@ -1,180 +1,144 @@
1
- # StackMemory - Project Configuration
1
+ # CLAUDE.md
2
2
 
3
- ## Project Structure
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
4
 
5
- ```
6
- src/
7
- cli/ # CLI commands and entry point
8
- core/ # Core business logic
9
- context/ # Frame and context management
10
- database/ # Database adapters (SQLite, ParadeDB)
11
- digest/ # Digest generation
12
- query/ # Query parsing and routing
13
- integrations/ # External integrations (Linear, MCP)
14
- services/ # Business services
15
- skills/ # Claude Code skills
16
- utils/ # Shared utilities
17
- scripts/ # Build and utility scripts
18
- config/ # Configuration files
19
- docs/ # Documentation
20
- ```
21
-
22
- ## Key Files
5
+ ## Project Overview
23
6
 
24
- - Entry: src/cli/index.ts
25
- - MCP Server: src/integrations/mcp/server.ts
26
- - Frame Manager: src/core/context/frame-manager.ts
27
- - Database: src/core/database/sqlite-adapter.ts
28
- - Snapshot: src/core/worktree/capture.ts
29
- - Preflight: src/core/worktree/preflight.ts
30
- - Conductor: src/cli/commands/orchestrator.ts
31
- - Shared Utils: src/core/utils/{git,text,fs}.ts
7
+ Sol is the monorepo for **Rize**, an automatic time tracking application. The stack consists of:
8
+ - **api/** - Rails 7.1 GraphQL backend (Ruby 3.3.5)
9
+ - **web/** - Next.js 14 React web app (Node 22)
10
+ - **electron/** - Electron desktop app (Node 22)
11
+ - **services/** - Bun-based TypeScript event consumers/workers
12
+ - **vanity/** - Webflow marketing site scripts (deprecated)
13
+ - **voyager/** - Marketing website for home and landing pageas (Next.js)
14
+ - **puppet/** - Puppeteer server for images/PDFs
15
+ - **chrome/** - Chrome browser extension
16
+ - **docs/** - Docusaurus documentation site
17
+ - **zapier/** - Zapier integration
32
18
 
33
- ## Detailed Guides
19
+ ## Development Commands
34
20
 
35
- Quick reference (agent_docs/):
36
- - linear_integration.md - Linear sync
37
- - mcp_server.md - MCP tools
38
- - database_storage.md - Storage
39
- - claude_hooks.md - Hooks
40
-
41
- Full documentation (docs/):
42
- - principles.md - Agent programming paradigm
43
- - architecture.md - Extension model and browser sandbox
44
- - SPEC.md - Technical specification
45
- - API_REFERENCE.md - API docs
46
- - DEVELOPMENT.md - Dev guide
47
- - SETUP.md - Installation
48
-
49
- ## Commands
21
+ ### Starting Development Environment
22
+ ```bash
23
+ # Start all services (requires iTerm2 on macOS)
24
+ ./scripts/run-dev.sh
25
+
26
+ # Or start individually:
27
+ cd api && hivemind Procfile.dev # Rails + AnyCable + Sidekiq + Clockwork
28
+ cd web && npm run dev # Next.js dev server
29
+ cd electron && npm run dev # Electron with hot reload
30
+ cd services && hivemind Procfile.dev # Bun services
31
+ ```
50
32
 
33
+ ### Docker Dependencies (api/docker-compose.yml)
51
34
  ```bash
52
- npm run build # Compile TypeScript (esbuild)
53
- npm run lint # ESLint check
54
- npm run lint:fix # Auto-fix lint issues
55
- npm test # Run Vitest (watch)
56
- npm run test:run # Run tests once
57
- npm run linear:sync # Sync with Linear
58
-
59
- # StackMemory CLI
60
- stackmemory capture # Save session state for handoff
61
- stackmemory restore # Restore from captured state
62
- stackmemory snapshot save # Post-run context snapshot (alias: snap)
63
- stackmemory snapshot list # List recent snapshots
64
- stackmemory preflight # File overlap check for parallel tasks (alias: pf)
65
- stackmemory conductor start # Autonomous Linear→worktree→agent orchestrator
35
+ cd api && docker-compose up -d
36
+ # TimescaleDB: localhost:15432
37
+ # Redis: localhost:16379
38
+ # Kafka: localhost:9092
39
+ # MySQL: localhost:13306
66
40
  ```
67
41
 
68
- ## Working Directory
42
+ ### Testing
43
+ ```bash
44
+ # API (RSpec)
45
+ cd api && bundle exec rspec
46
+ cd api && bundle exec rspec spec/path/to/file_spec.rb # Single file
47
+ cd api && bundle exec rspec spec/path/to/file_spec.rb:42 # Single test at line
69
48
 
70
- - PRIMARY: /Users/jwu/Dev/stackmemory
71
- - ALLOWED: All subdirectories
72
- - TEMP: /tmp for temporary operations
49
+ # Electron (Jest)
50
+ cd electron && npm test
51
+ cd electron && npm run test:watch
52
+ cd electron && npm run test:coverage
73
53
 
74
- ## Validation (MUST DO)
54
+ # Web - no active tests (exits 0)
55
+ ```
75
56
 
76
- After code changes:
77
- 1. `npm run lint` - fix any errors AND warnings
78
- 2. `npm run test:run` - verify no regressions
79
- 3. `npm run build` - ensure compilation
80
- 4. Run code to verify it works
57
+ ### Building
58
+ ```bash
59
+ cd api && bundle install && rake db:migrate
60
+ cd web && npm run build # Runs gql-gen, tailwind, next build
61
+ cd electron && npm run build # Electron Forge make
62
+ cd services && bun install
63
+ ```
81
64
 
82
- Test coverage:
83
- - New features require tests in `src/**/__tests__/`
84
- - Maintain or improve coverage (no untested code paths)
85
- - Critical paths: context management, handoff, Linear sync
65
+ ### GraphQL Code Generation
66
+ ```bash
67
+ cd web && npm run build # Includes gql codegen
68
+ cd electron && npm run dev # Runs gql codegen as part of dev
69
+ ```
86
70
 
87
- Never: Assume success | Skip testing | Use mock data as fallback
71
+ ## Architecture
88
72
 
89
- ## Git Rules (CRITICAL)
73
+ ### GraphQL API Structure
74
+ The API exposes two GraphQL endpoints:
75
+ - **api/v1** - Public API (OAuth consumers, Zapier)
76
+ - **private/v1** - Private API (web, electron apps)
90
77
 
91
- - NEVER use `--no-verify` on git push or commit
92
- - ALWAYS fix lint/test errors before pushing
93
- - If pre-push hooks fail, fix the underlying issue
94
- - Run `npm run lint && npm run test:run` before pushing
95
- - Commit message format: `type(scope): message`
96
- - Branch naming: `feature/STA-XXX-description` | `fix/STA-XXX-description` | `chore/description`
78
+ Located at `api/app/graphql/{api,private}/v1/`
97
79
 
98
- ## Task Management
80
+ ### Real-time Communication
81
+ - **AnyCable** WebSocket server for subscriptions
82
+ - ActionCable channels in `api/app/channels/`
83
+ - WebSocket config: `api/config/cable.yml` and `api/config/anycable.yml`
99
84
 
100
- - Use TodoWrite for 3+ steps or multiple requests
101
- - Keep one task in_progress at a time
102
- - Update task status immediately on completion
85
+ ### Background Jobs
86
+ - **Sidekiq** for async job processing (`api/config/sidekiq.yml`)
87
+ - **Clockwork** for scheduled jobs (`api/config/clock.rb`)
103
88
 
104
- ## Security
89
+ ### Event Streaming
90
+ - **Kafka** for event publishing/consumption
91
+ - Services consume events via `services/consumers/`
92
+ - Kafka config: `api/config/initializers/kafka.rb`
105
93
 
106
- NEVER hardcode secrets - use process.env with dotenv/config
94
+ ### Databases
95
+ - **Primary PostgreSQL** - Main application data
96
+ - **TimescaleDB** - Time-series data (separate connection in `database.yml`)
97
+ - **MySQL** - Legacy/external integrations
98
+ - **Redis** - Caching, ActionCable, Sidekiq
107
99
 
108
- ```javascript
109
- import 'dotenv/config';
110
- const API_KEY = process.env.LINEAR_API_KEY;
111
- if (!API_KEY) {
112
- console.error('LINEAR_API_KEY not set');
113
- process.exit(1);
114
- }
115
- ```
100
+ ## Style Guidelines
116
101
 
117
- Environment sources (check in order):
118
- 1. .env file
119
- 2. .env.local
120
- 3. ~/.zshrc
121
- 4. Process environment
102
+ ### JavaScript/TypeScript
103
+ - Use `test()` instead of `it()` in tests
104
+ - Use `toBeCalled()` instead of `toHaveBeenCalledWith()` in jest assertions
122
105
 
123
- Secret patterns to block: lin_api_* | lin_oauth_* | sk-* | npm_*
106
+ ## LSP Setup (Code Intelligence)
124
107
 
125
- ## Deploy
108
+ Claude Code uses LSP plugins for go-to-definition, find-references, and real-time diagnostics.
126
109
 
127
- ```bash
128
- # npm publish (uses NPM_TOKEN from .env, no OTP needed)
129
- git stash -- scripts/gepa/ # stash GEPA state (dirties working tree)
130
- NPM_TOKEN=$(grep '^NPM_TOKEN=' .env | cut -d= -f2) \
131
- npm publish --registry https://registry.npmjs.org/ \
132
- --//registry.npmjs.org/:_authToken="$NPM_TOKEN"
133
- git stash pop # restore GEPA state
110
+ ### Installed Plugins
111
+ - **vtsls** (JS/TS) - `vtsls@claude-code-lsps` from boostvolt marketplace
112
+ - **ruby-lsp** (Ruby) - `ruby-lsp@ruby-skills` + `ruby-skills@ruby-skills` from st0012 marketplace
134
113
 
135
- # Railway
136
- railway up
114
+ ### Prerequisites
115
+ ```bash
116
+ # TypeScript/JS language server
117
+ npm install -g @vtsls/language-server
137
118
 
138
- # Pre-publish checks require clean git status stash GEPA files first
119
+ # Ruby language server (use rbenv gem, not system)
120
+ /Users/jwu/.rbenv/versions/3.3.5/bin/gem install ruby-lsp
139
121
  ```
140
122
 
141
- ## Task Delegation Model
142
-
143
- Route effort by task complexitynot all code changes deserve equal scrutiny:
144
-
145
- **AUTOMATE** — Execute immediately, lint+test is sufficient:
146
- - CRUD operations, boilerplate, formatting, simple transforms
147
- - Adding a tool handler following existing switch/case pattern
148
- - Config additions (new env var, feature flag)
123
+ ### Known Issues
124
+ - Official `typescript-lsp@claude-plugins-official` is broken (missing plugin.json) — use `vtsls@claude-code-lsps` instead
125
+ - Ruby LSP launch script patched at `~/.claude/plugins/cache/ruby-skills/ruby-lsp/1.0.0/scripts/launch-ruby-lsp.sh` macOS lacks GNU `timeout` which breaks the version manager detection. Patch hardcodes rbenv PATH.
126
+ - Plugin auto-updates may overwrite the patch — re-apply if Ruby LSP stops working
149
127
 
150
- **STANDARD** Normal workflow, lint+test+build:
151
- - Feature implementation, bug fixes, refactoring
152
- - New test coverage, documentation updates
153
- - Integration wiring (adding handler to server.ts dispatch)
154
-
155
- **CAREFUL** — Review approach before implementation:
156
- - API/schema changes, database migrations, auth flows
157
- - New integration patterns (MCP tools, webhook handlers)
158
- - Changes to frame-manager, sqlite-adapter, or daemon lifecycle
159
- - Anything touching error handling chains
160
-
161
- **ARCHITECT** — Plan mode required, explore existing patterns first:
162
- - New service boundaries, system integrations
163
- - Performance-critical paths (FTS5 queries, search scoring)
164
- - Breaking changes to MCP protocol or CLI interface
165
-
166
- **HUMAN** — Explicit user approval before any changes:
167
- - Security-critical decisions, secret handling
168
- - Irreversible operations (data migrations, schema drops)
169
- - Publishing (npm publish, Railway deploy)
128
+ ### Reinstall Commands
129
+ ```bash
130
+ claude plugin marketplace add boostvolt/claude-code-lsps
131
+ claude plugin install vtsls@claude-code-lsps
170
132
 
171
- Quality gates scale with tier — don't over-engineer AUTOMATE tasks, don't under-review CAREFUL ones.
133
+ claude plugin marketplace add st0012/ruby-skills
134
+ claude plugin install ruby-lsp@ruby-skills
135
+ claude plugin install ruby-skills@ruby-skills
136
+ ```
172
137
 
173
- ## Workflow
138
+ ## Key Configuration Files
174
139
 
175
- - Check .env for API keys before asking
176
- - Run npm run linear:sync after task completion
177
- - Use browser MCP for visual testing
178
- - Review recent commits and stackmemory.json on session start
179
- - Use subagents for multi-step tasks
180
- - Ask 1-3 clarifying questions for complex commands (one at a time)
140
+ - `api/config/database.yml` - Database connections (primary + timescale)
141
+ - `api/config/cable.yml` - AnyCable WebSocket config
142
+ - `api/Procfile.dev` - Development processes (rails, anycable, sidekiq, clockwork)
143
+ - `sol.code-workspace` - VS Code multi-folder workspace
144
+ - Each project requires its own `.env` file (not in repo)
@@ -1,176 +1 @@
1
- # StackMemory - Project Configuration
2
-
3
- ## Project Structure
4
-
5
- ```
6
- src/
7
- cli/ # CLI commands and entry point
8
- core/ # Core business logic
9
- context/ # Frame and context management
10
- database/ # Database adapters (SQLite, ParadeDB)
11
- digest/ # Digest generation
12
- query/ # Query parsing and routing
13
- integrations/ # External integrations (Linear, MCP)
14
- services/ # Business services
15
- skills/ # Claude Code skills
16
- utils/ # Shared utilities
17
- scripts/ # Build and utility scripts
18
- config/ # Configuration files
19
- docs/ # Documentation
20
- ```
21
-
22
- ## Key Files
23
-
24
- - Entry: `src/cli/index.ts`
25
- - MCP Server: `src/integrations/mcp/server.ts`
26
- - Frame Manager: `src/core/context/frame-manager.ts`
27
- - Database: `src/core/database/sqlite-adapter.ts`
28
- - Snapshot: `src/core/worktree/capture.ts`
29
- - Preflight: `src/core/worktree/preflight.ts`
30
- - Conductor: `src/cli/commands/orchestrator.ts`
31
- - Shared Utils: `src/core/utils/{git,text,fs}.ts`
32
-
33
- ## Reference Docs
34
-
35
- Quick reference (`agent_docs/`):
36
- - `linear_integration.md` — Linear sync
37
- - `mcp_server.md` — MCP tools
38
- - `database_storage.md` — Storage
39
- - `claude_hooks.md` — Hooks
40
-
41
- Full docs (`docs/`):
42
- - `principles.md` — Agent programming paradigm
43
- - `architecture.md` — Extension model and browser sandbox
44
- - `SPEC.md` — Technical specification
45
- - `API_REFERENCE.md` — API docs
46
- - `DEVELOPMENT.md` — Dev guide
47
- - `SETUP.md` — Installation
48
-
49
- ## Commands
50
-
51
- ```bash
52
- npm run build # Compile TypeScript (esbuild)
53
- npm run lint # ESLint check
54
- npm run lint:fix # Auto-fix lint issues
55
- npm test # Run Vitest (watch)
56
- npm run test:run # Run tests once
57
- npm run linear:sync # Sync with Linear
58
-
59
- # StackMemory CLI
60
- stackmemory capture # Save session state for handoff
61
- stackmemory restore # Restore from captured state
62
- stackmemory snapshot save # Post-run context snapshot (alias: snap)
63
- stackmemory snapshot list # List recent snapshots
64
- stackmemory preflight # File overlap check for parallel tasks (alias: pf)
65
- stackmemory conductor start # Autonomous Linear→worktree→agent orchestrator
66
- ```
67
-
68
- ## Working Directory
69
-
70
- - PRIMARY: `/Users/jwu/Dev/stackmemory`
71
- - ALLOWED: All subdirectories
72
- - TEMP: `/tmp`
73
-
74
- ## Validation (REQUIRED after every code change)
75
-
76
- 1. `npm run lint` — fix all errors and warnings
77
- 2. `npm run test:run` — confirm no regressions
78
- 3. `npm run build` — confirm compilation succeeds
79
- 4. Run the code to verify behavior
80
-
81
- Test coverage rules:
82
- - New features require tests in `src/**/__tests__/`
83
- - Maintain or improve coverage — no untested code paths
84
- - Critical paths: context management, handoff, Linear sync
85
-
86
- Do not: assume success | skip testing | use mock data as fallback
87
-
88
- ## Git Rules (CRITICAL)
89
-
90
- - NEVER pass `--no-verify` to `git push` or `git commit`
91
- - Fix lint/test errors before pushing — never bypass pre-push hooks
92
- - Run `npm run lint && npm run test:run` before every push
93
- - Commit format: `type(scope): message`
94
- - Branch format: `feature/STA-XXX-description` | `fix/STA-XXX-description` | `chore/description`
95
-
96
- ## Task Management
97
-
98
- - Use TodoWrite for tasks with 3+ steps or multiple requests
99
- - Keep exactly one task `in_progress` at a time
100
- - Mark tasks complete immediately when done
101
-
102
- ## Security
103
-
104
- Never hardcode secrets. Always use `process.env` with dotenv:
105
-
106
- ```javascript
107
- import 'dotenv/config';
108
- const API_KEY = process.env.LINEAR_API_KEY;
109
- if (!API_KEY) {
110
- console.error('LINEAR_API_KEY not set');
111
- process.exit(1);
112
- }
113
- ```
114
-
115
- Check env sources in order:
116
- 1. `.env`
117
- 2. `.env.local`
118
- 3. `~/.zshrc`
119
- 4. Process environment
120
-
121
- Block these patterns: `lin_api_*` | `lin_oauth_*` | `sk-*` | `npm_*`
122
-
123
- ## Deploy
124
-
125
- ```bash
126
- # npm publish (NPM_TOKEN from .env, no OTP required)
127
- git stash -- scripts/gepa/ # stash GEPA state (dirties working tree)
128
- NPM_TOKEN=$(grep '^NPM_TOKEN=' .env | cut -d= -f2) \
129
- npm publish --registry https://registry.npmjs.org/ \
130
- --//registry.npmjs.org/:_authToken="$NPM_TOKEN"
131
- git stash pop # restore GEPA state
132
-
133
- # Railway
134
- railway up
135
-
136
- # Note: pre-publish checks require clean git status — stash GEPA files first
137
- ```
138
-
139
- ## Task Delegation Model
140
-
141
- Match scrutiny to complexity:
142
-
143
- **AUTOMATE** — Run immediately; lint+test is enough:
144
- - CRUD, boilerplate, formatting, simple transforms
145
- - Adding a tool handler to an existing switch/case
146
- - Config additions (env vars, feature flags)
147
-
148
- **STANDARD** — Normal workflow; lint+test+build:
149
- - Feature work, bug fixes, refactoring
150
- - New tests, doc updates
151
- - Integration wiring (e.g., adding handler to `server.ts`)
152
-
153
- **CAREFUL** — Confirm approach before implementing:
154
- - API/schema changes, DB migrations, auth flows
155
- - New MCP tools or webhook handlers
156
- - Changes to `frame-manager`, `sqlite-adapter`, or daemon lifecycle
157
- - Any error handling chain modifications
158
-
159
- **ARCHITECT** — Enter plan mode; read existing patterns first:
160
- - New service boundaries or system integrations
161
- - Performance-critical paths (FTS5 queries, search scoring)
162
- - Breaking changes to MCP protocol or CLI interface
163
-
164
- **HUMAN** — Get explicit user approval before touching:
165
- - Security decisions, secret handling
166
- - Irreversible operations (data migrations, schema drops)
167
- - Publishing (`npm publish`, Railway deploy)
168
-
169
- ## Workflow
170
-
171
- - Check `.env` for API keys before asking the user
172
- - Run `npm run linear:sync` after completing tasks
173
- - Use browser MCP for visual testing
174
- - On session start: review recent commits and `stackmemory.json`
175
- - Use subagents for multi-step tasks
176
- - Ask at most 1–3 clarifying questions for complex requests, one at a time
1
+ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"You have reached your specified API usage limits. You will regain access on 2026-04-01 at 00:00 UTC."},"request_id":"req_011CYrHCd5bajfrRXjhYqSFH"}