Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build Package

# Main PowerMem release (Python packages). Does not run on plugin-only tags (plugins-v*).
on:
push:
branches: [main, develop]
Expand Down Expand Up @@ -140,7 +141,8 @@ jobs:

build-and-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
# Only release on version tags v*; do not run for plugin-only tags (plugins-v*)
if: startsWith(github.ref, 'refs/tags/v') && !startsWith(github.ref, 'refs/tags/plugins-')
needs: combine-artifacts
permissions:
contents: write
Expand Down
135 changes: 135 additions & 0 deletions .github/workflows/plugins-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Plugins Build and Release

on:
push:
branches: [main, develop]
paths:
- 'apps/**'
- '.github/workflows/plugins-build.yml'
tags:
- 'plugins-v*'
pull_request:
branches: [main, develop]
paths:
- 'apps/**'
- '.github/workflows/plugins-build.yml'
workflow_dispatch:
inputs:
create_release:
description: 'Create a GitHub Release with plugin assets (only if not tag)'
required: false
default: false
type: boolean

env:
NODE_VERSION: '20'

jobs:
build-vscode-extension:
name: Build VS Code Extension
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/vscode-extension

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: apps/vscode-extension/package-lock.json

- name: Install dependencies
run: npm ci

- name: Compile
run: npm run compile

- name: Install vsce
run: npm install -g @vscode/vsce

- name: Package .vsix
run: vsce package --no-dependencies
id: vsce

- name: Upload VS Code extension (.vsix)
uses: actions/upload-artifact@v4
with:
name: powermem-vscode-vsix
path: apps/vscode-extension/*.vsix
retention-days: 30

package-claude-plugin:
name: Package Claude Code Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create plugin zip
run: |
cd apps/claude-code-plugin
zip -r ../../powermem-claude-code-plugin.zip . -x "*.git*" -x ".DS_Store"

- name: Upload Claude Code plugin (zip)
uses: actions/upload-artifact@v4
with:
name: powermem-claude-code-plugin-zip
path: powermem-claude-code-plugin.zip
retention-days: 30
release-plugins:
name: Release Plugin Assets
runs-on: ubuntu-latest
needs: [build-vscode-extension, package-claude-plugin]
if: startsWith(github.ref, 'refs/tags/plugins-') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')
permissions:
contents: write

steps:
- name: Download VS Code extension
uses: actions/download-artifact@v4
with:
name: powermem-vscode-vsix
path: vsix

- name: Download Claude Code plugin
uses: actions/download-artifact@v4
with:
name: powermem-claude-code-plugin-zip
path: zip

- name: Get version from tag or default
id: ver
run: |
if [[ "${{ github.ref }}" == refs/tags/plugins-* ]]; then
echo "version=${GITHUB_REF#refs/tags/plugins-}" >> $GITHUB_OUTPUT
else
echo "version=dev-$(date +%Y%m%d-%H%M)" >> $GITHUB_OUTPUT
fi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('plugins-{0}', steps.ver.outputs.version) }}
name: Plugins ${{ steps.ver.outputs.version }}
body: |
## PowerMem IDE Plugins

- **PowerMem for VS Code** (`.vsix`): Install in VS Code/Cursor via Install from VSIX, or publish to marketplace.
- **PowerMem Claude Code Plugin** (`.zip`): Use with `claude --plugin-dir /path/to/unzipped-folder`.

See [apps/README.md](https://github.com/${{ github.repository }}/blob/main/apps/README.md) and [apps/TESTING.md](https://github.com/${{ github.repository }}/blob/main/apps/TESTING.md).
files: |
vsix/*.vsix
zip/powermem-claude-code-plugin.zip
draft: false
prerelease: ${{ contains(github.ref, 'refs/tags/') == false }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

64 changes: 64 additions & 0 deletions .github/workflows/plugins-publish-vscode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Publish VS Code extension to Visual Studio Marketplace / Open VSX (manual trigger only).
# Configure in repo Settings -> Secrets and variables -> Actions:
# - VSCE_PAT: Personal Access Token for Visual Studio Marketplace
# (https://dev.azure.com -> User settings -> Personal access tokens; scope must include Marketplace)
# - OVSX_PAT: Token for Open VSX (optional; create at https://open-vsx.org after sign-in)

name: Publish VS Code Extension

on:
workflow_dispatch:
inputs:
publish_vsce:
description: 'Publish to Visual Studio Marketplace'
required: false
default: true
type: boolean
publish_ovsx:
description: 'Publish to Open VSX'
required: false
default: false
type: boolean

jobs:
publish:
name: Publish to Marketplace(s)
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: apps/vscode-extension/package-lock.json

- name: Build .vsix
run: |
cd apps/vscode-extension
npm ci
npm run compile
npx @vscode/vsce package --no-dependencies
mkdir -p ../.vsix
cp *.vsix ../.vsix/

- name: Publish to Visual Studio Marketplace
if: github.event.inputs.publish_vsce == 'true'
env:
VSCE_TOKEN: ${{ secrets.VSCE_PAT }}
run: |
cd apps/vscode-extension
npx @vscode/vsce publish --pat $VSCE_TOKEN -i ../.vsix/*.vsix

- name: Publish to Open VSX
if: github.event.inputs.publish_ovsx == 'true'
env:
OVSX_TOKEN: ${{ secrets.OVSX_PAT }}
run: |
cd apps/vscode-extension
npx @vscode/vsce publish --pat $OVSX_TOKEN -i ../.vsix/*.vsix --registryUrl https://open-vsx.org
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,8 @@ api_data/
server_backup/
*.backup

# apps/vscode-extension (Node / VS Code)
apps/vscode-extension/node_modules/
apps/vscode-extension/out/
apps/vscode-extension/*.vsix

16 changes: 16 additions & 0 deletions apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PowerMem IDE Apps

## Contents

| Directory | Description |
|-----------|--------------|
| **vscode-extension** | VS Code extension that links PowerMem to Cursor, Claude Code, Codex, Windsurf, and Copilot. Provides commands: Query memories, Add selection, Quick note, Link to AI tools, Setup, Dashboard. |
| **claude-code-plugin** | Claude Code–only plugin (`.claude-plugin` + `.mcp.json` + skills). Use with `claude --plugin-dir apps/claude-code-plugin` or publish to a Claude Code plugin marketplace. |

## Quick start

1. **Backend**: Start PowerMem (e.g. `powermem-server --port 8000` or `uvx powermem-mcp sse`).
2. **VS Code / Cursor**: Install the extension from `vscode-extension/` (Run and Debug or package as `.vsix`), set backend URL in PowerMem settings, then use **PowerMem: Link to AI tools**.
3. **Claude Code only**: Load the plugin with `claude --plugin-dir /path/to/powermem/apps/claude-code-plugin`.

See each subdirectory’s `README.md` for details.
8 changes: 8 additions & 0 deletions apps/claude-code-plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "memory-powermem",
"description": "PowerMem intelligent memory for Claude Code: add, search, update, and delete memories with Ebbinghaus decay and multi-agent support.",
"version": "1.0.0",
"author": { "name": "OceanBase / PowerMem" },
"homepage": "https://github.com/oceanbase/powermem",
"repository": "https://github.com/oceanbase/powermem"
}
8 changes: 8 additions & 0 deletions apps/claude-code-plugin/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"powermem": {
"transport": "http",
"url": "http://localhost:8000/mcp"
}
}
}
5 changes: 5 additions & 0 deletions apps/claude-code-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0

- Initial release: PowerMem MCP config and skills (remember, recall) for Claude Code.
61 changes: 61 additions & 0 deletions apps/claude-code-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# PowerMem Plugin for Claude Code

Claude Code plugin that connects to [PowerMem](https://github.com/oceanbase/powermem) for intelligent, persistent memory.

## Features

- **MCP integration**: Uses PowerMem MCP Server so Claude can call `add_memory`, `search_memories`, `get_memory_by_id`, `update_memory`, `delete_memory`, `list_memories`.
- **Skills**: `/memory-powermem:remember` and `/memory-powermem:recall` to guide when to store and when to search memories.

## Prerequisites

1. **PowerMem** installed and a running PowerMem backend:
- Either **MCP Server** (e.g. `uvx powermem-mcp sse` or `uvx powermem-mcp stdio`) with a `.env` in project or home directory.
- Or **HTTP API Server** (e.g. `powermem-server --host 0.0.0.0 --port 8000`). The plugin's default `.mcp.json` points to `http://localhost:8000/mcp` (MCP over HTTP).

2. **Claude Code** (VS Code extension or CLI) with plugin support.

## Installation

### Option A: Load from directory (development)

```bash
claude --plugin-dir /path/to/powermem/apps/claude-code-plugin
```

### Option B: Install from marketplace

If this plugin is published to a Claude Code plugin marketplace, install it from there.

## Configuration

The default `.mcp.json` in this plugin uses:

- **HTTP transport**: `http://localhost:8000/mcp`

To use a different URL or **stdio** (local MCP process), edit `.mcp.json` in this directory. Example for stdio:

```json
{
"mcpServers": {
"powermem": {
"transport": "stdio",
"command": "uvx",
"args": ["powermem-mcp", "stdio"]
}
}
}
```

Ensure PowerMem is installed (`pip install powermem`) and a `.env` file is available when using stdio.

## Usage

- In Claude Code, the PowerMem MCP tools are available automatically once the plugin is loaded.
- Use **/memory-powermem:remember** when you want Claude to store something.
- Use **/memory-powermem:recall** when you want Claude to search memories before answering.

## Links

- [PowerMem](https://github.com/oceanbase/powermem)
- [PowerMem MCP docs](https://github.com/oceanbase/powermem/blob/master/docs/api/0004-mcp.md)
8 changes: 8 additions & 0 deletions apps/claude-code-plugin/skills/recall/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
description: Search PowerMem for relevant memories. Use before answering questions about the user, project, or past decisions.
---

Before answering questions about the user, project history, or past decisions:
1. Use the PowerMem `search_memories` tool with a short query.
2. Optionally filter by user_id or agent_id if the user has multiple contexts.
3. Use the retrieved memories to tailor the response.
8 changes: 8 additions & 0 deletions apps/claude-code-plugin/skills/remember/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
description: Add or update a memory in PowerMem. Use when the user or conversation reveals a fact, preference, or decision that should be remembered across sessions.
---

When the user asks to remember something, or when the conversation contains a clear fact/preference/decision worth persisting:
1. Use the PowerMem `add_memory` tool with appropriate content and optional user_id/agent_id.
2. Prefer concise, factual memory content.
3. Confirm what was stored in one sentence.
6 changes: 6 additions & 0 deletions apps/vscode-extension/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/**
.vscode-test/**
src/**
tsconfig.json
**/*.map
node_modules/**
Loading
Loading