@stackmemoryai/stackmemory 1.5.3 → 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,140 +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
- ```
5
+ ## Project Overview
21
6
 
22
- ## Key Files
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
23
18
 
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
19
+ ## Development Commands
28
20
 
29
- ## Detailed Guides
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
+ ```
30
32
 
31
- Quick reference (agent_docs/):
32
- - linear_integration.md - Linear sync
33
- - mcp_server.md - MCP tools
34
- - database_storage.md - Storage
35
- - claude_hooks.md - Hooks
33
+ ### Docker Dependencies (api/docker-compose.yml)
34
+ ```bash
35
+ cd api && docker-compose up -d
36
+ # TimescaleDB: localhost:15432
37
+ # Redis: localhost:16379
38
+ # Kafka: localhost:9092
39
+ # MySQL: localhost:13306
40
+ ```
36
41
 
37
- Full documentation (docs/):
38
- - principles.md - Agent programming paradigm
39
- - architecture.md - Extension model and browser sandbox
40
- - SPEC.md - Technical specification
41
- - API_REFERENCE.md - API docs
42
- - DEVELOPMENT.md - Dev guide
43
- - SETUP.md - Installation
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
44
48
 
45
- ## Commands
49
+ # Electron (Jest)
50
+ cd electron && npm test
51
+ cd electron && npm run test:watch
52
+ cd electron && npm run test:coverage
46
53
 
54
+ # Web - no active tests (exits 0)
55
+ ```
56
+
57
+ ### Building
47
58
  ```bash
48
- npm run build # Compile TypeScript (esbuild)
49
- npm run lint # ESLint check
50
- npm run lint:fix # Auto-fix lint issues
51
- npm test # Run Vitest (watch)
52
- npm run test:run # Run tests once
53
- npm run linear:sync # Sync with Linear
54
-
55
- # StackMemory CLI
56
- stackmemory capture # Save session state for handoff
57
- stackmemory restore # Restore from captured state
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
58
63
  ```
59
64
 
60
- ## Working Directory
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
+ ```
61
70
 
62
- - PRIMARY: /Users/jwu/Dev/stackmemory
63
- - ALLOWED: All subdirectories
64
- - TEMP: /tmp for temporary operations
71
+ ## Architecture
65
72
 
66
- ## Validation (MUST DO)
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)
67
77
 
68
- After code changes:
69
- 1. `npm run lint` - fix any errors AND warnings
70
- 2. `npm run test:run` - verify no regressions
71
- 3. `npm run build` - ensure compilation
72
- 4. Run code to verify it works
78
+ Located at `api/app/graphql/{api,private}/v1/`
73
79
 
74
- Test coverage:
75
- - New features require tests in `src/**/__tests__/`
76
- - Maintain or improve coverage (no untested code paths)
77
- - Critical paths: context management, handoff, Linear sync
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`
78
84
 
79
- Never: Assume success | Skip testing | Use mock data as fallback
85
+ ### Background Jobs
86
+ - **Sidekiq** for async job processing (`api/config/sidekiq.yml`)
87
+ - **Clockwork** for scheduled jobs (`api/config/clock.rb`)
80
88
 
81
- ## Git Rules (CRITICAL)
89
+ ### Event Streaming
90
+ - **Kafka** for event publishing/consumption
91
+ - Services consume events via `services/consumers/`
92
+ - Kafka config: `api/config/initializers/kafka.rb`
82
93
 
83
- - NEVER use `--no-verify` on git push or commit
84
- - ALWAYS fix lint/test errors before pushing
85
- - If pre-push hooks fail, fix the underlying issue
86
- - Run `npm run lint && npm run test:run` before pushing
87
- - Commit message format: `type(scope): message`
88
- - Branch naming: `feature/STA-XXX-description` | `fix/STA-XXX-description` | `chore/description`
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
89
99
 
90
- ## Task Management
100
+ ## Style Guidelines
91
101
 
92
- - Use TodoWrite for 3+ steps or multiple requests
93
- - Keep one task in_progress at a time
94
- - Update task status immediately on completion
102
+ ### JavaScript/TypeScript
103
+ - Use `test()` instead of `it()` in tests
104
+ - Use `toBeCalled()` instead of `toHaveBeenCalledWith()` in jest assertions
95
105
 
96
- ## Security
106
+ ## LSP Setup (Code Intelligence)
97
107
 
98
- NEVER hardcode secrets - use process.env with dotenv/config
108
+ Claude Code uses LSP plugins for go-to-definition, find-references, and real-time diagnostics.
99
109
 
100
- ```javascript
101
- import 'dotenv/config';
102
- const API_KEY = process.env.LINEAR_API_KEY;
103
- if (!API_KEY) {
104
- console.error('LINEAR_API_KEY not set');
105
- process.exit(1);
106
- }
107
- ```
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
108
113
 
109
- Environment sources (check in order):
110
- 1. .env file
111
- 2. .env.local
112
- 3. ~/.zshrc
113
- 4. Process environment
114
+ ### Prerequisites
115
+ ```bash
116
+ # TypeScript/JS language server
117
+ npm install -g @vtsls/language-server
114
118
 
115
- Secret patterns to block: lin_api_* | lin_oauth_* | sk-* | npm_*
119
+ # Ruby language server (use rbenv gem, not system)
120
+ /Users/jwu/.rbenv/versions/3.3.5/bin/gem install ruby-lsp
121
+ ```
116
122
 
117
- ## Deploy
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
118
127
 
128
+ ### Reinstall Commands
119
129
  ```bash
120
- # npm publish (uses NPM_TOKEN from .env, no OTP needed)
121
- git stash -- scripts/gepa/ # stash GEPA state (dirties working tree)
122
- NPM_TOKEN=$(grep '^NPM_TOKEN=' .env | cut -d= -f2) \
123
- npm publish --registry https://registry.npmjs.org/ \
124
- --//registry.npmjs.org/:_authToken="$NPM_TOKEN"
125
- git stash pop # restore GEPA state
126
-
127
- # Railway
128
- railway up
130
+ claude plugin marketplace add boostvolt/claude-code-lsps
131
+ claude plugin install vtsls@claude-code-lsps
129
132
 
130
- # Pre-publish checks require clean git status — stash GEPA files first
133
+ claude plugin marketplace add st0012/ruby-skills
134
+ claude plugin install ruby-lsp@ruby-skills
135
+ claude plugin install ruby-skills@ruby-skills
131
136
  ```
132
137
 
133
- ## Workflow
138
+ ## Key Configuration Files
134
139
 
135
- - Check .env for API keys before asking
136
- - Run npm run linear:sync after task completion
137
- - Use browser MCP for visual testing
138
- - Review recent commits and stackmemory.json on session start
139
- - Use subagents for multi-step tasks
140
- - 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,172 +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
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
28
18
 
29
- ## Detailed Guides
19
+ ## Development Commands
30
20
 
31
- Quick reference (agent_docs/):
32
- - linear_integration.md - Linear sync
33
- - mcp_server.md - MCP tools
34
- - database_storage.md - Storage
35
- - claude_hooks.md - Hooks
36
-
37
- Full documentation (docs/):
38
- - principles.md - Agent programming paradigm
39
- - architecture.md - Extension model and browser sandbox
40
- - SPEC.md - Technical specification
41
- - API_REFERENCE.md - API docs
42
- - DEVELOPMENT.md - Dev guide
43
- - SETUP.md - Installation
44
-
45
- ## 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
+ ```
46
32
 
33
+ ### Docker Dependencies (api/docker-compose.yml)
47
34
  ```bash
48
- npm run build # Compile TypeScript (esbuild)
49
- npm run lint # ESLint check
50
- npm run lint:fix # Auto-fix lint issues
51
- npm test # Run Vitest (watch)
52
- npm run test:run # Run tests once
53
- npm run linear:sync # Sync with Linear
54
-
55
- # StackMemory CLI
56
- stackmemory capture # Save session state for handoff
57
- stackmemory restore # Restore from captured state
35
+ cd api && docker-compose up -d
36
+ # TimescaleDB: localhost:15432
37
+ # Redis: localhost:16379
38
+ # Kafka: localhost:9092
39
+ # MySQL: localhost:13306
58
40
  ```
59
41
 
60
- ## 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
61
48
 
62
- - PRIMARY: /Users/jwu/Dev/stackmemory
63
- - ALLOWED: All subdirectories
64
- - 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
65
53
 
66
- ## Validation (MUST DO)
54
+ # Web - no active tests (exits 0)
55
+ ```
67
56
 
68
- After code changes:
69
- 1. `npm run lint` - fix any errors AND warnings
70
- 2. `npm run test:run` - verify no regressions
71
- 3. `npm run build` - ensure compilation
72
- 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
+ ```
73
64
 
74
- Test coverage:
75
- - New features require tests in `src/**/__tests__/`
76
- - Maintain or improve coverage (no untested code paths)
77
- - 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
+ ```
78
70
 
79
- Never: Assume success | Skip testing | Use mock data as fallback
71
+ ## Architecture
80
72
 
81
- ## 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)
82
77
 
83
- - NEVER use `--no-verify` on git push or commit
84
- - ALWAYS fix lint/test errors before pushing
85
- - If pre-push hooks fail, fix the underlying issue
86
- - Run `npm run lint && npm run test:run` before pushing
87
- - Commit message format: `type(scope): message`
88
- - Branch naming: `feature/STA-XXX-description` | `fix/STA-XXX-description` | `chore/description`
78
+ Located at `api/app/graphql/{api,private}/v1/`
89
79
 
90
- ## 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`
91
84
 
92
- - Use TodoWrite for 3+ steps or multiple requests
93
- - Keep one task in_progress at a time
94
- - 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`)
95
88
 
96
- ## 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`
97
93
 
98
- 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
99
99
 
100
- ```javascript
101
- import 'dotenv/config';
102
- const API_KEY = process.env.LINEAR_API_KEY;
103
- if (!API_KEY) {
104
- console.error('LINEAR_API_KEY not set');
105
- process.exit(1);
106
- }
107
- ```
100
+ ## Style Guidelines
108
101
 
109
- Environment sources (check in order):
110
- 1. .env file
111
- 2. .env.local
112
- 3. ~/.zshrc
113
- 4. Process environment
102
+ ### JavaScript/TypeScript
103
+ - Use `test()` instead of `it()` in tests
104
+ - Use `toBeCalled()` instead of `toHaveBeenCalledWith()` in jest assertions
114
105
 
115
- Secret patterns to block: lin_api_* | lin_oauth_* | sk-* | npm_*
106
+ ## LSP Setup (Code Intelligence)
116
107
 
117
- ## Deploy
108
+ Claude Code uses LSP plugins for go-to-definition, find-references, and real-time diagnostics.
118
109
 
119
- ```bash
120
- # npm publish (uses NPM_TOKEN from .env, no OTP needed)
121
- git stash -- scripts/gepa/ # stash GEPA state (dirties working tree)
122
- NPM_TOKEN=$(grep '^NPM_TOKEN=' .env | cut -d= -f2) \
123
- npm publish --registry https://registry.npmjs.org/ \
124
- --//registry.npmjs.org/:_authToken="$NPM_TOKEN"
125
- 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
126
113
 
127
- # Railway
128
- railway up
114
+ ### Prerequisites
115
+ ```bash
116
+ # TypeScript/JS language server
117
+ npm install -g @vtsls/language-server
129
118
 
130
- # 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
131
121
  ```
132
122
 
133
- ## Task Delegation Model
134
-
135
- Route effort by task complexitynot all code changes deserve equal scrutiny:
136
-
137
- **AUTOMATE** — Execute immediately, lint+test is sufficient:
138
- - CRUD operations, boilerplate, formatting, simple transforms
139
- - Adding a tool handler following existing switch/case pattern
140
- - 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
141
127
 
142
- **STANDARD** Normal workflow, lint+test+build:
143
- - Feature implementation, bug fixes, refactoring
144
- - New test coverage, documentation updates
145
- - Integration wiring (adding handler to server.ts dispatch)
146
-
147
- **CAREFUL** — Review approach before implementation:
148
- - API/schema changes, database migrations, auth flows
149
- - New integration patterns (MCP tools, webhook handlers)
150
- - Changes to frame-manager, sqlite-adapter, or daemon lifecycle
151
- - Anything touching error handling chains
152
-
153
- **ARCHITECT** — Plan mode required, explore existing patterns first:
154
- - New service boundaries, system integrations
155
- - Performance-critical paths (FTS5 queries, search scoring)
156
- - Breaking changes to MCP protocol or CLI interface
157
-
158
- **HUMAN** — Explicit user approval before any changes:
159
- - Security-critical decisions, secret handling
160
- - Irreversible operations (data migrations, schema drops)
161
- - 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
162
132
 
163
- 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
+ ```
164
137
 
165
- ## Workflow
138
+ ## Key Configuration Files
166
139
 
167
- - Check .env for API keys before asking
168
- - Run npm run linear:sync after task completion
169
- - Use browser MCP for visual testing
170
- - Review recent commits and stackmemory.json on session start
171
- - Use subagents for multi-step tasks
172
- - 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)