Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "basic-memory-local",
"interface": {
"displayName": "Basic Memory Local"
},
"plugins": [
{
"name": "codex",
"source": {
"source": "local",
"path": "./plugins/codex"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Developer Tools"
}
]
}
8 changes: 6 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ check: lint format typecheck test
# Run all code quality checks and all test suites, including semantic benchmarks
check-all: lint format typecheck test test-semantic

# Validate every consolidated agent package (Claude Code, skills, Hermes, OpenClaw)
package-check: package-check-claude-code package-check-skills package-check-hermes package-check-openclaw
# Validate every consolidated agent package (Claude Code, Codex, skills, Hermes, OpenClaw)
package-check: package-check-claude-code package-check-codex package-check-skills package-check-hermes package-check-openclaw

# Alias for plugin/package validation during consolidation work
plugins-check: package-check
Expand All @@ -278,6 +278,10 @@ agent-harness-check: package-check-claude-code package-check-hermes package-chec
package-check-claude-code:
just --justfile plugins/claude-code/justfile --working-directory plugins/claude-code check

# Codex plugin: manifest, bundled skills, hooks, MCP config, and schemas
package-check-codex:
just --justfile plugins/codex/justfile --working-directory plugins/codex check

# Shared top-level SKILL.md source
package-check-skills:
just --justfile skills/justfile --working-directory skills check
Expand Down
46 changes: 46 additions & 0 deletions plugins/codex/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "codex",
"version": "0.1.0+codex.20260604201213",
"description": "A Codex-native bridge to Basic Memory for durable engineering context, decisions, and resumable checkpoints.",
"author": {
"name": "Basic Machines",
"email": "hello@basicmachines.co",
"url": "https://basicmemory.com"
},
"homepage": "https://docs.basicmemory.com",
"repository": "https://github.com/basicmachines-co/basic-memory/tree/main/plugins/codex",
"license": "MIT",
"keywords": [
"basic-memory",
"codex",
"memory",
"knowledge-graph",
"mcp",
"checkpoints"
],
"skills": "./skills/",
"mcpServers": "./.mcp.json",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the referenced MCP config

When this plugin is installed or just package-check-codex is run, the manifest points Codex and the validator at ./.mcp.json, but no such file is included in the new plugins/codex tree (I checked with rg --files plugins/codex .agents scripts | rg '(^|/)\.mcp\.json$|mcp'). The new validator then exits with Missing JSON file: /workspace/basic-memory/plugins/codex/.mcp.json, so the newly added package check fails and the plugin has no Basic Memory MCP server configuration to load.

Useful? React with 👍 / 👎.

"interface": {
"displayName": "Basic Memory for Codex",
"shortDescription": "Carry decisions, active work, and handoffs across Codex threads",
"longDescription": "Use Basic Memory for Codex to orient from your durable knowledge graph, capture engineering decisions, checkpoint long-running work, and resume with repo-backed context across Codex sessions.",
"developerName": "Basic Machines",
"category": "Developer Tools",
"capabilities": [
"Interactive",
"Read",
"Write"
],
"websiteURL": "https://basicmemory.com",
"privacyPolicyURL": "https://basicmemory.com/privacy",
"termsOfServiceURL": "https://basicmemory.com/terms",
"defaultPrompt": [
"Use Basic Memory to orient before changing this repo.",
"Checkpoint this Codex thread into Basic Memory.",
"Capture the decision we just made."
],
"brandColor": "#2563EB",
"composerIcon": "./assets/app-icon.png",
"logo": "./assets/logo.png"
}
}
76 changes: 76 additions & 0 deletions plugins/codex/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Basic Memory Codex Plugin Development

This plugin is developed in-place from the Basic Memory repository. Codex installs local plugins
through marketplaces, so local testing uses a repo-local marketplace wrapper rather than publishing
anything external.

## Local Marketplace

The repo marketplace lives at:

```text
.agents/plugins/marketplace.json
```

It exposes this plugin as:

```text
codex@basic-memory-local
```

The marketplace entry points at `./plugins/codex`, resolved relative to the repository root.

## First-Time Setup

From the repository root:

```bash
codex plugin marketplace add "$(git rev-parse --show-toplevel)"
codex plugin add codex@basic-memory-local
```

Start a new Codex thread after installing. New threads are the reliable boundary for picking up
plugin skills, hooks, and MCP configuration.

## Iteration Loop

After changing files in `plugins/codex`, run the local checks:

```bash
just package-check-codex
```

Then update the manifest cachebuster and reinstall from the local marketplace:

```bash
python3 "$CODEX_PLUGIN_CREATOR_SCRIPTS/update_plugin_cachebuster.py" \
"$(git rev-parse --show-toplevel)/plugins/codex"
codex plugin add codex@basic-memory-local
```

Start a fresh Codex thread to test the updated plugin.

## Useful Checks

List configured marketplaces:

```bash
codex plugin marketplace list
```

List plugins Codex can see:

```bash
codex plugin list
```

Run the full package validation gate when touching plugin packaging, shared skills, or integration
metadata:

```bash
just package-check
```

To also run Codex's scaffold validator during `just package-check-codex`, set
`CODEX_PLUGIN_VALIDATOR` to the local `plugin-creator` validator script before
running the check.
74 changes: 74 additions & 0 deletions plugins/codex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Basic Memory for Codex

Basic Memory for Codex is the Codex-native bridge between a working coding thread
and Basic Memory's durable knowledge graph.

It is not a 1:1 copy of the Claude Code plugin. This version leans into Codex
workflows: repo orientation, long-running goals, changed-file evidence, explicit
verification, decision capture, and resumable checkpoints.

## What It Does

- **Orient from memory.** The `bm-orient` skill reads active tasks, open
decisions, and recent Codex checkpoints before substantial work.
- **Checkpoint work.** The `bm-checkpoint` skill and `PreCompact` hook write
`type: codex_session` notes with the current work cursor.
- **Capture decisions.** The `bm-decide` skill records durable engineering
decisions with rationale, alternatives, and consequences.
- **Remember lightly.** The `bm-remember` skill saves small facts without turning
them into a full decision or session note.
- **Share deliberately.** The `bm-share` skill copies personal notes to configured
team projects only after confirmation.
- **Report status.** The `bm-status` skill shows configuration, reachability, and
recent memory state.

## Package Contents

| Path | Role |
| --- | --- |
| `.codex-plugin/plugin.json` | Codex plugin manifest |
| `.mcp.json` | Basic Memory MCP server configuration |
| `hooks/hooks.json` | SessionStart and PreCompact hook registration |
| `hooks/session-start.sh` | Injects a compact memory brief at thread start |
| `hooks/pre-compact.sh` | Writes an automatic Codex checkpoint before compaction |
| `skills/` | Codex-native Basic Memory workflows |
| `schemas/` | Seed schemas for Codex sessions, decisions, and tasks |

## Configuration

Run the setup skill, or create `.codex/basic-memory.json` in a repo:

```json
{
"basicMemory": {
"primaryProject": "my-project",
"secondaryProjects": [],
"teamProjects": {},
"focus": "code/dev",
"captureFolder": "codex-sessions",
"rememberFolder": "codex-remember",
"recallTimeframe": "7d",
"placementConventions": "Put decisions in decisions/ and work checkpoints in codex-sessions/."
}
}
```

Codex plugin hooks must be reviewed and trusted before they run. Open `/hooks` in
Codex after enabling the plugin and trust the Basic Memory hook definitions.

## Development

From this directory:

```bash
just check
```

From the repo root:

```bash
just package-check-codex
```

The package intentionally keeps Codex-specific configuration separate from
Claude's `.claude/settings.json`.
Binary file added plugins/codex/assets/app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/codex/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions plugins/codex/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"description": "Basic Memory for Codex hooks - orient from the graph on session start and checkpoint before compaction.",
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|compact",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include clear sessions in the startup matcher

When a user starts a fresh context with /clear, Codex sends SessionStart with source clear (the hooks docs list startup|resume|clear|compact as the supported startup sources: https://developers.openai.ac.cn/codex/hooks#matcher-patterns). This matcher skips that case, so cleared sessions do not receive the Basic Memory orientation/setup nudge even though the plugin is intended to brief Codex at thread start; add clear to the matcher.

Useful? React with 👍 / 👎.

"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/hooks/session-start.sh",
"statusMessage": "Loading Basic Memory context",
"timeout": 30
}
]
}
],
"PreCompact": [
{
"matcher": "manual|auto",
"hooks": [
{
"type": "command",
"command": "${PLUGIN_ROOT}/hooks/pre-compact.sh",
"statusMessage": "Checkpointing Codex work to Basic Memory",
"timeout": 60
}
]
}
]
}
}
Loading
Loading