Skip to content

Commit f483968

Browse files
author
StackMemory Bot (CLI)
committed
Add command packs, remove dead modules, bump to 1.11.0
- Add `stackmemory setup-commands` CLI for installing Claude Code slash commands - Ship core pack: /start, /stop, /restart, /next (+ 4 internal deps) - Prompt for command install during `stackmemory onboard` - Include packs/ in npm files array - Remove unused team, cord, merge, and shared-context modules (-9.9K lines)
1 parent 0a5e21c commit f483968

48 files changed

Lines changed: 898 additions & 9945 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 103 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Lossless, project-scoped memory for AI coding tools. **[Website](https://stackme
1414
StackMemory is a **production-ready memory runtime** for AI coding tools that preserves full project context across sessions:
1515

1616
- **Zero-config setup**`stackmemory init` just works
17-
- **56 MCP tools** for Claude Code integration (context, tasks, Linear, traces, discovery, cord, team, planning, providers, and more)
17+
- **73 MCP tools** for Claude Code integration (context, tasks, Linear, traces, discovery, cord, team, planning, providers, and more)
1818
- **FTS5 full-text search** with BM25 scoring and hybrid retrieval
1919
- **Full Linear integration** with bidirectional sync and OAuth/API key support
2020
- **Context persistence** that survives `/clear` operations
@@ -97,6 +97,16 @@ stackmemory doctor
9797

9898
Restart Claude Code and StackMemory MCP tools will be available.
9999

100+
### Also available as `croissant-ai`
101+
102+
[croissant.ai](https://croissant.ai) wraps StackMemory as a business-facing CLI for executive intelligence. Install via `npx croissant-ai` — all unknown commands forward to StackMemory automatically.
103+
104+
```bash
105+
npx croissant-ai ask "What's our MRR?" # croissant.ai query API
106+
npx croissant-ai memory capture # → stackmemory capture
107+
npx croissant-ai init # → stackmemory init (fallback)
108+
```
109+
100110
### Wrapper Scripts
101111

102112
StackMemory ships wrapper scripts that launch your coding tool with StackMemory context pre-loaded:
@@ -132,6 +142,44 @@ Runs as an MCP server. Editors (e.g., Claude Code) call StackMemory on each inte
132142

133143
---
134144

145+
## Command Packs
146+
147+
StackMemory ships installable command packs for Claude Code — curated slash commands that integrate session lifecycle management directly into your workflow.
148+
149+
### Core Pack
150+
151+
The **core** pack provides session lifecycle commands that use StackMemory for context persistence:
152+
153+
| Command | Description |
154+
|---------|-------------|
155+
| `/start` | Boot a session — load memory, restore handoff, show git state, suggest next work |
156+
| `/stop` | End a session — summarize, capture handoff, review learnings |
157+
| `/restart` | Chain `/stop``/clear``/start` in one command |
158+
| `/next` | Suggest what to work on based on context |
159+
160+
Internal dependencies (installed automatically): `/summary`, `/capture`, `/learn`, `/restore`
161+
162+
```bash
163+
# Install core commands
164+
stackmemory setup-commands
165+
166+
# List available packs
167+
stackmemory setup-commands --list
168+
169+
# Preview what would be installed
170+
stackmemory setup-commands --dry-run
171+
172+
# Reinstall (overwrite existing)
173+
stackmemory setup-commands --force
174+
175+
# Remove installed commands
176+
stackmemory setup-commands --uninstall
177+
```
178+
179+
Commands are symlinked to `~/.claude/commands/` and available immediately in Claude Code.
180+
181+
---
182+
135183
## Skills System
136184

137185
StackMemory ships Claude Code skills that integrate directly into your workflow. Skills are invoked via `/skill-name` in Claude Code or `stackmemory skills <name>` from the CLI.
@@ -272,42 +320,61 @@ claude-sm
272320

273321
---
274322

275-
## RLM (Recursive Language Model) Orchestration
323+
## RLM-Aware Harness
324+
325+
StackMemory includes an RLM (Recursive Language Model) system inspired by [predict-rlm](https://github.com/Trampoline-AI/predict-rlm) — three layers that make agents self-harnessing:
326+
327+
### Layer 1: Context-as-REPL
328+
329+
Agents access tenant data programmatically via tool functions instead of prose handoffs:
330+
331+
- `search_knowledge(query, topK)` — vector search over tenant data
332+
- `read_context(query)` — knowledge graph entity/relationship queries
333+
- `list_runs(threadId)` — prior run history with status summaries
334+
- `get_run_events(runId)` — event stream replay for a specific run
335+
- `query_interrupts(threadId)` — pending approvals and blocks
336+
- `llm_summarize(prompt)` — sub-LLM (Haiku) for quick synthesis
337+
338+
### Layer 2: Typed Dispatch
339+
340+
Signature-based sub-agent spawning with validated I/O contracts:
341+
342+
| Signature | Persona | Inputs | Outputs |
343+
|-----------|---------|--------|---------|
344+
| `ImplementFeature` | eng | spec, context_files | branch, changed_files, test_passed |
345+
| `FixBug` | eng | description, error_log | branch, changed_files, root_cause |
346+
| `ReviewPR` | eng | pr_url, focus_areas | verdict, comments, risk_level |
347+
| `Investigate` | data | question, data_sources | findings, evidence, confidence |
348+
| `Summarize` | data | content, format | summary, key_points |
349+
350+
Parent runs dispatch typed sub-runs via `dispatchSubRun()` and collect validated results via `collectSubRun()` with timeout handling.
351+
352+
### Layer 3: Critic + Self-Decomposition
276353

277-
StackMemory includes an RLM system that handles complex tasks through recursive decomposition and parallel execution using Claude Code's Task tool.
354+
LLM quality gate that evaluates run output (ported from predict-rlm's critic pattern):
278355

279-
### Key Features
356+
- **Score >= 80**: Pass — run ships as-is
357+
- **Score 50-79**: Revise — creates a new run with critic feedback appended
358+
- **Score < 50**: Decompose — dispatches typed sub-runs to break down the task
280359

281-
- **Recursive Task Decomposition**: Breaks complex tasks into manageable subtasks
282-
- **Parallel Subagent Execution**: Run multiple specialized agents concurrently
283-
- **8 Specialized Agent Types**: Planning, Code, Testing, Linting, Review, Improve, Context, Publish
284-
- **Multi-Stage Review**: Iterative improvement cycles with quality scoring (0-1 scale)
285-
- **Automatic Test Generation**: Unit, integration, and E2E test creation
360+
Loop control: max 3 revisions, max depth 2 for decomposition.
286361

287-
### Usage
362+
### Legacy RLM Orchestrator
363+
364+
The original RLM system remains available for direct use:
288365

289366
```bash
290-
# Basic usage
291367
stackmemory skills rlm "Your complex task description"
292-
293-
# With options
294-
stackmemory skills rlm "Refactor authentication system" \
295-
--max-parallel 8 \
296-
--review-stages 5 \
297-
--quality-threshold 0.9 \
298-
--test-mode all
368+
stackmemory skills rlm "Refactor auth" --max-parallel 8 --quality-threshold 0.9
299369
```
300370

301-
### Configuration Options
302-
303371
| Option | Description | Default |
304372
|--------|-------------|---------|
305373
| `--max-parallel` | Maximum concurrent subagents | 5 |
306374
| `--max-recursion` | Maximum recursion depth | 4 |
307375
| `--review-stages` | Number of review iterations | 3 |
308376
| `--quality-threshold` | Target quality score (0-1) | 0.85 |
309377
| `--test-mode` | Test generation mode (unit/integration/e2e/all) | all |
310-
| `--verbose` | Show all recursive operations | false |
311378

312379
**Note**: RLM requires Claude Code Max plan for unlimited subagent execution.
313380

@@ -417,7 +484,7 @@ Options: `--until`, `--until-not`, `--until-empty`, `--until-non-empty`, `--unti
417484
## Documentation
418485

419486
- [Getting Started](./docs/GETTING_STARTED.md) — Quick start guide (5 minutes)
420-
- [MCP Tools Reference](https://stackmemoryai.github.io/stackmemory/tools.html) — All 56 MCP tools
487+
- [MCP Tools Reference](https://stackmemoryai.github.io/stackmemory/tools.html) — All 73 MCP tools
421488
- [CLI Reference](./docs/cli.md) — Full command reference
422489
- [Setup Guide](./docs/SETUP.md) — Advanced setup options
423490
- [Development Guide](./docs/DEVELOPMENT.md) — Contributing and development
@@ -429,6 +496,20 @@ Options: `--until`, `--until-not`, `--until-empty`, `--until-non-empty`, `--unti
429496

430497
---
431498

499+
## Substrate: The Three-Layer Vision
500+
501+
StackMemory is the foundation of a three-layer architecture for AI-native development:
502+
503+
| Layer | Product | Status | Purpose |
504+
|-------|---------|--------|---------|
505+
| **L1** | StackMemory | Shipped (v1.10.6) | Context persistence — lossless memory across sessions |
506+
| **L2** | Substrate Desktop | Shipping | Agent orchestration — multi-agent coordination with worktree isolation |
507+
| **L3** | Substrate Cloud | Design | Multiplayer development — shared context across teams and agents |
508+
509+
Grounded in distributed systems theory: FLP impossibility, Byzantine→Crash conversion via test hooks, Chandra-Toueg failure detectors for agent liveness. See [COORDINATION_THEORY.md](./docs/architecture/COORDINATION_THEORY.md).
510+
511+
---
512+
432513
## License
433514

434515
Licensed under the [Business Source License 1.1](./LICENSE). You can use, modify, and self-host StackMemory freely. The one restriction: you may not offer it as a competing hosted service. The license converts to MIT after 4 years per release.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stackmemoryai/stackmemory",
3-
"version": "1.10.6",
3+
"version": "1.11.0",
44
"description": "Lossless, project-scoped memory for AI coding tools. Durable context across sessions with 56 MCP tools, FTS5 search, conductor orchestrator, loop/watch monitoring, snapshot capture, pre-flight overlap checks, Claude/Codex/OpenCode wrappers, Linear sync, and automatic hooks.",
55
"engines": {
66
"node": ">=20.0.0",
@@ -45,6 +45,7 @@
4545
"scripts/verify-dist.cjs",
4646
"scripts/smoke-init-db.sh",
4747
"templates",
48+
"packs",
4849
"README.md",
4950
"LICENSE"
5051
],

packs/core/commands/capture.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# /capture — Save session context via StackMemory
2+
3+
Run `stackmemory capture` to commit current work and generate a handoff prompt for the next session.
4+
5+
## Usage
6+
7+
`$ARGUMENTS` — optional flags passed directly to `stackmemory capture`.
8+
9+
## Behavior
10+
11+
1. Run `stackmemory capture $ARGUMENTS`
12+
2. Display the generated handoff prompt
13+
3. If `--copy` flag is present, confirm the prompt was copied to clipboard
14+
15+
## Common flags
16+
17+
| Flag | Effect |
18+
|------|--------|
19+
| `-m "message"` | Custom commit message |
20+
| `--no-commit` | Skip git commit, just generate handoff |
21+
| `--copy` | Copy handoff prompt to clipboard |
22+
| `--format ultra` | Ultra-compact pipe-delimited format |
23+
| `--format verbose` | Full markdown format |
24+
25+
## Examples
26+
27+
```
28+
/capture # Default capture with auto-format
29+
/capture -m "privacy policy PR" # With custom message
30+
/capture --copy # Capture and copy to clipboard
31+
/capture --no-commit --copy # Just generate handoff, no commit
32+
```

packs/core/commands/learn.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# /learn — Review session and identify what to update
2+
3+
Run /summary internally, then audit what scripts, skills, commands, or memories need updating based on this session's work.
4+
5+
## Execution
6+
7+
### Phase 1: Session Review (silent)
8+
9+
Internally run the /summary logic — review conversation history for all actions, decisions, patterns, and corrections. Do NOT output the summary separately.
10+
11+
### Phase 2: Audit (parallel)
12+
13+
Compare session activity against persistent artifacts:
14+
15+
1. **Memory** — Read `MEMORY.md` from project memory dir
16+
- Any new patterns, gotchas, or decisions that should be saved?
17+
- Any existing memories now stale or contradicted by this session?
18+
- Any user corrections/feedback worth persisting?
19+
20+
2. **CLAUDE.md** — Read project and global CLAUDE.md
21+
- Any new commands, paths, or conventions discovered?
22+
- Any documented patterns that are now wrong?
23+
24+
3. **Skills/Commands** — Glob `~/.claude/commands/*.md` and project `.claude/commands/*.md`
25+
- Any skills that broke or need updating?
26+
- Any new workflow worth turning into a skill?
27+
28+
4. **Scripts** — Check `scripts/`, `.husky/`, hook files
29+
- Any scripts created or modified this session?
30+
- Any hooks that failed and need fixing?
31+
32+
5. **Wiki** — If wiki exists, check for stale articles
33+
- Any new entities or concepts from this session?
34+
35+
### Phase 3: Report
36+
37+
Output in this format:
38+
39+
```
40+
## Session Learnings
41+
42+
**What happened:**
43+
- [1-line per action/outcome]
44+
45+
**Updates needed:**
46+
47+
| Target | Action | Detail |
48+
|--------|--------|--------|
49+
| memory/X.md | create/update/delete | [what and why] |
50+
| CLAUDE.md | update | [section + change] |
51+
| commands/X.md | create/update | [what] |
52+
| scripts/X | update | [what] |
53+
| wiki/X.md | create/update | [what] |
54+
55+
**No action needed:**
56+
- [artifacts reviewed but current]
57+
```
58+
59+
### Phase 4: Execute (with confirmation)
60+
61+
Ask: "Apply these updates? (all / pick / skip)"
62+
63+
- **all**: Apply every update in the table
64+
- **pick**: Let user select which ones
65+
- **skip**: Report only, no changes
66+
67+
## Rules
68+
69+
- Don't create memories for ephemeral task details — only durable learnings
70+
- Don't update CLAUDE.md for one-off patterns — only if it'll recur
71+
- Bias toward updating existing memories over creating new ones
72+
- Keep the report under 30 lines — dense, not verbose
73+
- If nothing needs updating, say so in one line and stop

packs/core/commands/next.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# /next — What should I do next?
2+
3+
Read context and suggest the highest-impact next action.
4+
5+
## Context to gather (parallel)
6+
7+
1. **Git state**: `git status`, `git branch --show-current`, `git log --oneline -3`
8+
2. **Open PR for branch**: `/opt/homebrew/bin/gh pr view --json title,state,reviews,checks 2>/dev/null`
9+
3. **GHA status**: `/opt/homebrew/bin/gh run list --branch $(git branch --show-current) --limit 1 --json status,conclusion,name 2>/dev/null`
10+
4. **Memory**: Read `MEMORY.md` and `project_todos_queue.md` from the project memory directory
11+
5. **Uncommitted work**: `git diff --stat HEAD`
12+
13+
## Decision logic
14+
15+
Evaluate in priority order. Pick the FIRST that applies:
16+
17+
1. **Uncommitted changes exist** → suggest commit or continue current work
18+
2. **PR open + CI failing** → suggest fix CI failures
19+
3. **PR open + Greptile comments** → suggest `/greptile-fix`
20+
4. **PR open + CI passing + no reviews** → suggest waiting or starting next task
21+
5. **On feature branch, no PR** → suggest `/pr`
22+
6. **On master, clean** → suggest next task from queue (pick highest priority unchecked item)
23+
24+
## Output format
25+
26+
```
27+
## Next up
28+
29+
[One sentence: what to do and why]
30+
31+
A) [Primary action — the recommendation]
32+
B) [Alternative action]
33+
C) [Skip — pick something else from queue]
34+
```
35+
36+
Always present A/B/C options. Keep it to 5 lines max. No preamble.

0 commit comments

Comments
 (0)