Skip to content
Draft

00 #792

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
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,28 @@ bun run src/index.ts install ./plugins/compound-engineering --to codex
bun run src/index.ts install ./plugins/compound-engineering --to opencode
```

For Codex local-fork development, the CLI install only generates the Codex agent files and the managed compatibility block. Codex's native plugin cache still owns the skill files, so point Codex at the local marketplace source and refresh the cache when testing unpublished skill changes:

```toml
[marketplaces.compound-engineering-plugin]
source_type = "local"
source = "/Users/besi/Code/compound-engineering-plugin"

[plugins."compound-engineering@compound-engineering-plugin"]
enabled = true
```

```bash
mkdir -p /Users/besi/.codex/plugins/cache/compound-engineering-plugin/compound-engineering/3.4.1
cp -R /Users/besi/Code/compound-engineering-plugin/plugins/compound-engineering/. \
/Users/besi/.codex/plugins/cache/compound-engineering-plugin/compound-engineering/3.4.1/
Comment on lines +275 to +277
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 Replace the hard-coded Codex cache path

When someone follows this new local-fork workflow, the commands copy skills into /Users/besi/.../3.4.1, but this checkout's Codex plugin manifest is version 3.6.0; on any other machine or after the version changes, Codex will keep reading the active cache path instead of these copied files, so unpublished skill changes still appear stale. Use a placeholder/path variable and derive the cache version from plugins/compound-engineering/.codex-plugin/plugin.json rather than baking in this personal path and old version.

Useful? React with 👍 / 👎.


cd /Users/besi/Code/compound-engineering-plugin
bun run src/index.ts install ./plugins/compound-engineering --to codex
```

Restart Codex or open a new thread after reinstalling. The active runtime reads the plugin cache, generated agents, and `~/.codex/AGENTS.md` at session start.

### From a pushed branch

For testing someone else's branch or your own branch from a worktree, without switching checkouts. Uses `--branch` to clone the branch to a deterministic cache directory.
Expand Down Expand Up @@ -342,6 +364,23 @@ bunx @every-env/compound-plugin install compound-engineering --to codex

Native Codex plugin install handles skills. The Bun step installs the custom agents those skills delegate to.

### Codex loads CE skills but the flow is flatter than Claude Code

Check the managed Compound Codex tool map in `~/.codex/AGENTS.md`:

```bash
rg -n "Task \\(subagent dispatch\\)|use spawn_agent|run sequentially in main thread" ~/.codex/AGENTS.md
```

The task-dispatch line should say to use `spawn_agent` for CE `Task` / `Agent` / `Subagent` instructions. If it says to run subagent dispatch sequentially in the main thread, update `src/utils/codex-agents.ts`, run the regression test, and reinstall:

```bash
bun test tests/codex-agents.test.ts
bun run src/index.ts install ./plugins/compound-engineering --to codex
```

Do not fix this by adding every CE agent to `~/.codex/config.toml`. CE agents are generated under `~/.codex/agents/compound-engineering`; the workflow parity issue is the Codex compatibility block, not agent registration.

### Codex shows stale or duplicate CE skills

Back up old Bun-installed artifacts before switching to the native Codex plugin flow:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Fix OpenCode Skill Command Wrappers
type: fix
status: complete
date: 2026-04-28
---

# Fix OpenCode Skill Command Wrappers

## Summary

OpenCode installs currently copy Compound Engineering skills and agents, but they do not expose the skills as slash commands because the plugin has no source `commands/` payload. This plan makes the OpenCode converter emit small command wrappers for installed skills so `/ce-plan`, `/ce-setup`, and related commands work after installing from this fork.

## Requirements

- R1. Installing `plugins/compound-engineering` to OpenCode must create slash commands for every copied CE skill.
- R2. The generated command must run the corresponding skill content from the installed OpenCode skill path instead of depending on OpenCode's skill discovery behavior.
- R3. The command wrapper set must be managed by the existing install manifest so removed skills clean up on reinstall.
- R4. Existing source plugin commands must continue to be converted unchanged.
- R5. Tests must prove command wrapper generation and existing command behavior.

## Blast Radius

- Changed files: `src/converters/claude-to-opencode.ts`, `tests/opencode-writer.test.ts`, this plan file.
- Impacted modules: OpenCode converter output, OpenCode writer manifest cleanup, OpenCode install smoke path.
- Break risk: low. The change only appends generated command files to OpenCode bundles and reuses the existing writer path.

## Implementation Units

- U1. **Generate skill command wrappers**

**Goal:** Extend `convertClaudeToOpenCode` so every copied OpenCode skill has a matching command file when no source command already owns that name.

**Files:**
- Modify: `src/converters/claude-to-opencode.ts`
- Test: `tests/opencode-writer.test.ts`

**Approach:**
- Compute filtered OpenCode skill dirs once.
- Build existing command names from `convertCommands(plugin.commands)`.
- Append generated `OpenCodeCommandFile` entries for skills whose command name is not already present.
- Use a wrapper body that reads `~/.config/opencode/skills/<skill>/SKILL.md` for global installs and `.opencode/skills/<skill>/SKILL.md` for project-local installs only if necessary. Prefer a stable global-path wrapper for the current fork need.

**Test scenarios:**
- Happy path: converting the real compound-engineering plugin includes `ce-plan`, `ce-setup`, and `lfg` command files.
- Edge case: if a source command already uses a skill name, the converter does not emit a duplicate wrapper.
- Regression: existing source command conversion still writes nested `name:with:colon` paths through the writer.

**Verification:**
- Targeted Bun tests pass.
- Local OpenCode install from this checkout writes command wrappers into `~/.config/opencode/commands`.

- U2. **Install forked checkout into OpenCode**

**Goal:** Replace the current generated OpenCode CE install with output from the local fork.

**Files:**
- Runtime output only: `~/.config/opencode/agents`, `~/.config/opencode/skills`, `~/.config/opencode/commands`, `~/.config/opencode/compound-engineering/install-manifest.json`, `~/.config/opencode/opencode.json` backup.

**Approach:**
- Run the local CLI: `bun run src/index.ts install ./plugins/compound-engineering --to opencode`.
- Verify OpenCode resolved config includes `ce-plan` and `ce-setup` command entries.
- Verify the install manifest records command wrappers.

**Test scenarios:**
- Smoke: `opencode debug config` reports generated CE command entries.
- Smoke: install manifest command count matches the generated skill command wrapper count.

**Verification:**
- Restart OpenCode and use `/ce-plan` or `/ce-setup`.

## Verification Notes

- `bun test tests/converter.test.ts` passed.
- `bun test tests/opencode-writer.test.ts` passed.
- `bun run release:validate` passed.
- Installed the local fork with `bun run src/index.ts install ./plugins/compound-engineering --to opencode`.
- OpenCode install manifest now records 34 managed CE command wrappers and 34 OpenCode-supported CE skills, including `ce-plan.md`, `ce-setup.md`, and `lfg.md`.
39 changes: 39 additions & 0 deletions docs/plans/2026-04-28-002-fix-ce-plan-prewrite-critic-gate-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Add ce-plan Pre-Write Critic Gate
type: fix
status: complete
date: 2026-04-28
---

# Add ce-plan Pre-Write Critic Gate

## Summary

Enhance `ce-plan` with the useful part of the local `/pln` flow: a bounded pre-write critic pass that catches blocking executability issues before the plan is saved. Keep `ce-plan`'s existing post-write confidence check and `ce-doc-review` gate.

## Requirements

- R1. `ce-plan` runs a pre-write critic gate after the plan draft exists and before writing `docs/plans/...`.
- R2. The critic returns `OKAY` or `REJECT`, with max three blocking issues and max two revision loops.
- R3. The critic uses CE-portable instructions, not local-only `metis`, `prometheus`, or `momus` agents.
- R4. Runtime-path plans include a 1000-user scalability baseline.
- R5. Non-empty `$ARGUMENTS` remains source of truth despite command rendering artifacts.

## Implementation Units

- U1. **Skill Contract Tests**
- **Files:** `tests/pipeline-review-contract.test.ts`
- **Goal:** Lock in the pre-write critic and scalability/argument guard behavior.
- **Verification:** Targeted Bun test fails before the skill update and passes after it.

- U2. **ce-plan Skill Update**
- **Files:** `plugins/compound-engineering/skills/ce-plan/SKILL.md`, `plugins/compound-engineering/skills/ce-plan/references/plan-critic.md`
- **Goal:** Add a concise pre-write critic phase and put detailed rubric in a reference file.
- **Verification:** Contract tests and release validation pass; local OpenCode reinstall exposes updated `ce-plan` skill body.

## Verification Notes

- `bun test tests/pipeline-review-contract.test.ts` passed.
- `bun run release:validate` passed.
- Reinstalled the local fork with `bun run src/index.ts install ./plugins/compound-engineering --to opencode`.
- Verified installed OpenCode `ce-plan` contains Phase 5.1.7, the `$ARGUMENTS` guard, the 1000-user scalability baseline, and `references/plan-critic.md`.
95 changes: 95 additions & 0 deletions docs/plans/2026-04-29-001-feat-optional-memory-warm-start-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Add Optional CE Memory Warm-Start
type: feat
status: complete
date: 2026-04-29
---

# Add Optional CE Memory Warm-Start

## Summary

Add a portable CE memory researcher and wire it into planning, work execution, debugging, and compounding as best-effort context. The workflow should benefit from local Neo4j memory when available without making CE depend on it.

## Requirements

- R1. Add a `ce-memory-researcher` agent that can read persistent memory when Neo4j MCP tools are available.
- R2. Memory lookup must be optional and never block CE workflows when unavailable.
- R3. Memory findings must be supplementary. They cannot override the origin document, current repo evidence, or verified execution results.
- R4. `ce-plan` should warm-start Phase 1 with relevant decisions, prior errors, preferences, and cross-project patterns.
- R5. `ce-work`, `ce-debug`, and `ce-compound` should consult memory only where it improves execution context without changing scope or adding mandatory prompts.
- R6. Contract tests should lock in the optional behavior and agent presence.

## Implementation Units

- U1. **Memory Researcher Agent**

**Goal:** Add a CE-portable agent for persistent memory lookup.

**Files:**
- Create: `plugins/compound-engineering/agents/ce-memory-researcher.agent.md`

**Approach:**
- Support warm-start, context, recall, and explicit remember operations.
- Prefer Neo4j MCP tools when connected.
- Return a clear unavailable result instead of failing when tools are absent.
- Keep read operations as the default; write only on an explicit remember request.

**Test scenarios:**
- Happy path: agent instructions define warm-start output and Neo4j read behavior.
- Error path: agent instructions specify unavailable behavior when memory tools are missing.
- Safety path: agent instructions prevent memory from overriding current evidence.

**Verification:**
- Contract tests prove the agent exists and carries the optional/supplementary behavior.

- U2. **Workflow Wiring**

**Goal:** Integrate memory at the safest workflow points.

**Files:**
- Modify: `plugins/compound-engineering/skills/ce-plan/SKILL.md`
- Modify: `plugins/compound-engineering/skills/ce-work/SKILL.md`
- Modify: `plugins/compound-engineering/skills/ce-debug/SKILL.md`
- Modify: `plugins/compound-engineering/skills/ce-compound/SKILL.md`

**Approach:**
- Add `ce-plan` Phase 1.0 before standard local research.
- Add `ce-work` memory context after plan reading and before task creation.
- Add `ce-debug` prior-error recall after triage and before reproduction.
- Add `ce-compound` persistent memory recall alongside existing auto-memory support.

**Test scenarios:**
- Happy path: each workflow references `ce-memory-researcher` at the intended stage.
- Error path: each workflow states unavailable memory must not fail the parent workflow.
- Scope path: work execution memory cannot mutate plan scope.

**Verification:**
- Targeted contract tests pass.

- U3. **Contract Tests and Install Verification**

**Goal:** Keep the behavior durable across future edits and reinstall the local fork.

**Files:**
- Modify: `tests/pipeline-review-contract.test.ts`
- Update: `docs/plans/2026-04-29-001-feat-optional-memory-warm-start-plan.md`

**Approach:**
- Add tests for agent presence, optional memory behavior, and workflow placement.
- Run targeted tests and release validation.
- Reinstall the local fork into OpenCode after verification.

**Test scenarios:**
- Contract: `ce-plan` memory warm-start appears before local research.
- Contract: `ce-code-review` is not wired to persistent memory by default.
- Contract: unavailable memory is explicitly non-blocking.

**Verification:**
- Targeted tests and release validation pass.

## Verification Notes

- `bun test tests/pipeline-review-contract.test.ts` passed.
- `bun test tests/converter.test.ts tests/opencode-writer.test.ts tests/release-metadata.test.ts tests/pipeline-review-contract.test.ts` passed.
- `bun run release:validate` passed and reported `52 agents`, `35 skills`, and `0 MCP servers`.
Loading