diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index fcfd3df..18eac1c 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -6,31 +6,44 @@
},
"metadata": {
"description": "Plugin marketplace for Claude Code extensions",
- "version": "1.0.0"
+ "version": "1.0.2"
},
"plugins": [
{
"name": "compound-engineering",
- "description": "AI-powered development tools that get smarter with every use. Make each unit of engineering work easier than the last. Includes 25 specialized agents, 54 skills, and 4 commands.",
- "version": "2.40.0",
+ "description": "AI-powered development tools that get smarter with every use. Make each unit of engineering work easier than the last.",
"author": {
"name": "Kieran Klaassen",
"url": "https://github.com/kieranklaassen",
"email": "kieran@every.to"
},
"homepage": "https://github.com/EveryInc/compound-engineering-plugin",
- "tags": ["ai-powered", "compound-engineering", "workflow-automation", "code-review", "quality", "knowledge-management", "image-generation"],
+ "tags": [
+ "ai-powered",
+ "compound-engineering",
+ "workflow-automation",
+ "code-review",
+ "quality",
+ "knowledge-management",
+ "image-generation"
+ ],
"source": "./plugins/compound-engineering"
},
{
"name": "coding-tutor",
"description": "Personalized coding tutorials that build on your existing knowledge and use your actual codebase for examples. Includes spaced repetition quizzes to reinforce learning. Includes 3 commands and 1 skill.",
- "version": "1.2.1",
"author": {
"name": "Nityesh Agarwal"
},
"homepage": "https://github.com/EveryInc/compound-engineering-plugin",
- "tags": ["coding", "programming", "tutorial", "learning", "spaced-repetition", "education"],
+ "tags": [
+ "coding",
+ "programming",
+ "tutorial",
+ "learning",
+ "spaced-repetition",
+ "education"
+ ],
"source": "./plugins/coding-tutor"
}
]
diff --git a/.claude/commands/release-docs.md b/.claude/commands/release-docs.md
deleted file mode 100644
index 903d6ae..0000000
--- a/.claude/commands/release-docs.md
+++ /dev/null
@@ -1,211 +0,0 @@
----
-name: release-docs
-description: Build and update the documentation site with current plugin components
-argument-hint: "[optional: --dry-run to preview changes without writing]"
----
-
-# Release Documentation Command
-
-You are a documentation generator for the compound-engineering plugin. Your job is to ensure the documentation site at `plugins/compound-engineering/docs/` is always up-to-date with the actual plugin components.
-
-## Overview
-
-The documentation site is a static HTML/CSS/JS site based on the Evil Martians LaunchKit template. It needs to be regenerated whenever:
-
-- Agents are added, removed, or modified
-- Commands are added, removed, or modified
-- Skills are added, removed, or modified
-- MCP servers are added, removed, or modified
-
-## Step 1: Inventory Current Components
-
-First, count and list all current components:
-
-```bash
-# Count agents
-ls plugins/compound-engineering/agents/*.md | wc -l
-
-# Count commands
-ls plugins/compound-engineering/commands/*.md | wc -l
-
-# Count skills
-ls -d plugins/compound-engineering/skills/*/ 2>/dev/null | wc -l
-
-# Count MCP servers
-ls -d plugins/compound-engineering/mcp-servers/*/ 2>/dev/null | wc -l
-```
-
-Read all component files to get their metadata:
-
-### Agents
-For each agent file in `plugins/compound-engineering/agents/*.md`:
-- Extract the frontmatter (name, description)
-- Note the category (Review, Research, Workflow, Design, Docs)
-- Get key responsibilities from the content
-
-### Commands
-For each command file in `plugins/compound-engineering/commands/*.md`:
-- Extract the frontmatter (name, description, argument-hint)
-- Categorize as Workflow or Utility command
-
-### Skills
-For each skill directory in `plugins/compound-engineering/skills/*/`:
-- Read the SKILL.md file for frontmatter (name, description)
-- Note any scripts or supporting files
-
-### MCP Servers
-For each MCP server in `plugins/compound-engineering/mcp-servers/*/`:
-- Read the configuration and README
-- List the tools provided
-
-## Step 2: Update Documentation Pages
-
-### 2a. Update `docs/index.html`
-
-Update the stats section with accurate counts:
-```html
-
-
- [AGENT_COUNT]
- Specialized Agents
-
-
-
-```
-
-Ensure the component summary sections list key components accurately.
-
-### 2b. Update `docs/pages/agents.html`
-
-Regenerate the complete agents reference page:
-- Group agents by category (Review, Research, Workflow, Design, Docs)
-- Include for each agent:
- - Name and description
- - Key responsibilities (bullet list)
- - Usage example: `claude agent [agent-name] "your message"`
- - Use cases
-
-### 2c. Update `docs/pages/commands.html`
-
-Regenerate the complete commands reference page:
-- Group commands by type (Workflow, Utility)
-- Include for each command:
- - Name and description
- - Arguments (if any)
- - Process/workflow steps
- - Example usage
-
-### 2d. Update `docs/pages/skills.html`
-
-Regenerate the complete skills reference page:
-- Group skills by category (Development Tools, Content & Workflow, Image Generation)
-- Include for each skill:
- - Name and description
- - Usage: `claude skill [skill-name]`
- - Features and capabilities
-
-### 2e. Update `docs/pages/mcp-servers.html`
-
-Regenerate the MCP servers reference page:
-- For each server:
- - Name and purpose
- - Tools provided
- - Configuration details
- - Supported frameworks/services
-
-## Step 3: Update Metadata Files
-
-Ensure counts are consistent across:
-
-1. **`plugins/compound-engineering/.claude-plugin/plugin.json`**
- - Update `description` with correct counts
- - Update `components` object with counts
- - Update `agents`, `commands` arrays with current items
-
-2. **`.claude-plugin/marketplace.json`**
- - Update plugin `description` with correct counts
-
-3. **`plugins/compound-engineering/README.md`**
- - Update intro paragraph with counts
- - Update component lists
-
-## Step 4: Validate
-
-Run validation checks:
-
-```bash
-# Validate JSON files
-cat .claude-plugin/marketplace.json | jq .
-cat plugins/compound-engineering/.claude-plugin/plugin.json | jq .
-
-# Verify counts match
-echo "Agents in files: $(ls plugins/compound-engineering/agents/*.md | wc -l)"
-grep -o "[0-9]* specialized agents" plugins/compound-engineering/docs/index.html
-
-echo "Commands in files: $(ls plugins/compound-engineering/commands/*.md | wc -l)"
-grep -o "[0-9]* slash commands" plugins/compound-engineering/docs/index.html
-```
-
-## Step 5: Report Changes
-
-Provide a summary of what was updated:
-
-```
-## Documentation Release Summary
-
-### Component Counts
-- Agents: X (previously Y)
-- Commands: X (previously Y)
-- Skills: X (previously Y)
-- MCP Servers: X (previously Y)
-
-### Files Updated
-- docs/index.html - Updated stats and component summaries
-- docs/pages/agents.html - Regenerated with X agents
-- docs/pages/commands.html - Regenerated with X commands
-- docs/pages/skills.html - Regenerated with X skills
-- docs/pages/mcp-servers.html - Regenerated with X servers
-- plugin.json - Updated counts and component lists
-- marketplace.json - Updated description
-- README.md - Updated component lists
-
-### New Components Added
-- [List any new agents/commands/skills]
-
-### Components Removed
-- [List any removed agents/commands/skills]
-```
-
-## Dry Run Mode
-
-If `--dry-run` is specified:
-- Perform all inventory and validation steps
-- Report what WOULD be updated
-- Do NOT write any files
-- Show diff previews of proposed changes
-
-## Error Handling
-
-- If component files have invalid frontmatter, report the error and skip
-- If JSON validation fails, report and abort
-- Always maintain a valid state - don't partially update
-
-## Post-Release
-
-After successful release:
-1. Suggest updating CHANGELOG.md with documentation changes
-2. Remind to commit with message: `docs: Update documentation site to match plugin components`
-3. Remind to push changes
-
-## Usage Examples
-
-```bash
-# Full documentation release
-claude /release-docs
-
-# Preview changes without writing
-claude /release-docs --dry-run
-
-# After adding new agents
-claude /release-docs
-```
diff --git a/.cursor-plugin/CHANGELOG.md b/.cursor-plugin/CHANGELOG.md
new file mode 100644
index 0000000..f63f166
--- /dev/null
+++ b/.cursor-plugin/CHANGELOG.md
@@ -0,0 +1,8 @@
+# Changelog
+
+## [1.0.1](https://github.com/EveryInc/compound-engineering-plugin/compare/cursor-marketplace-v1.0.0...cursor-marketplace-v1.0.1) (2026-03-19)
+
+
+### Bug Fixes
+
+* add cursor-marketplace as release-please component ([#315](https://github.com/EveryInc/compound-engineering-plugin/issues/315)) ([838aeb7](https://github.com/EveryInc/compound-engineering-plugin/commit/838aeb79d069b57a80d15ff61d83913919b81aef))
diff --git a/.cursor-plugin/marketplace.json b/.cursor-plugin/marketplace.json
index e9adfaa..130e9ec 100644
--- a/.cursor-plugin/marketplace.json
+++ b/.cursor-plugin/marketplace.json
@@ -7,14 +7,14 @@
},
"metadata": {
"description": "Cursor plugin marketplace for Every Inc plugins",
- "version": "1.0.0",
+ "version": "1.0.1",
"pluginRoot": "plugins"
},
"plugins": [
{
"name": "compound-engineering",
"source": "compound-engineering",
- "description": "AI-powered development tools that get smarter with every use. Includes specialized agents, commands, skills, and Context7 MCP."
+ "description": "AI-powered development tools that get smarter with every use. Make each unit of engineering work easier than the last."
},
{
"name": "coding-tutor",
diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json
new file mode 100644
index 0000000..87fd9c2
--- /dev/null
+++ b/.github/.release-please-manifest.json
@@ -0,0 +1,7 @@
+{
+ ".": "2.52.0",
+ "plugins/compound-engineering": "2.52.0",
+ "plugins/coding-tutor": "1.2.1",
+ ".claude-plugin": "1.0.2",
+ ".cursor-plugin": "1.0.1"
+}
diff --git a/.github/release-please-config.json b/.github/release-please-config.json
new file mode 100644
index 0000000..298eef7
--- /dev/null
+++ b/.github/release-please-config.json
@@ -0,0 +1,73 @@
+{
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
+ "include-component-in-tag": true,
+ "release-search-depth": 20,
+ "commit-search-depth": 50,
+ "packages": {
+ ".": {
+ "release-type": "simple",
+ "package-name": "cli",
+ "extra-files": [
+ {
+ "type": "json",
+ "path": "package.json",
+ "jsonpath": "$.version"
+ }
+ ]
+ },
+ "plugins/compound-engineering": {
+ "release-type": "simple",
+ "package-name": "compound-engineering",
+ "extra-files": [
+ {
+ "type": "json",
+ "path": ".claude-plugin/plugin.json",
+ "jsonpath": "$.version"
+ },
+ {
+ "type": "json",
+ "path": ".cursor-plugin/plugin.json",
+ "jsonpath": "$.version"
+ }
+ ]
+ },
+ "plugins/coding-tutor": {
+ "release-type": "simple",
+ "package-name": "coding-tutor",
+ "extra-files": [
+ {
+ "type": "json",
+ "path": ".claude-plugin/plugin.json",
+ "jsonpath": "$.version"
+ },
+ {
+ "type": "json",
+ "path": ".cursor-plugin/plugin.json",
+ "jsonpath": "$.version"
+ }
+ ]
+ },
+ ".claude-plugin": {
+ "release-type": "simple",
+ "package-name": "marketplace",
+ "extra-files": [
+ {
+ "type": "json",
+ "path": "marketplace.json",
+ "jsonpath": "$.metadata.version"
+ }
+ ]
+ },
+ ".cursor-plugin": {
+ "release-type": "simple",
+ "package-name": "cursor-marketplace",
+ "extra-files": [
+ {
+ "type": "json",
+ "path": "marketplace.json",
+ "jsonpath": "$.metadata.version"
+ }
+ ]
+ }
+ }
+}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c9d5410..4eb98c8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,6 +7,31 @@ on:
workflow_dispatch:
jobs:
+ pr-title:
+ if: github.event_name == 'pull_request'
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+
+ steps:
+ - name: Validate PR title
+ uses: amannn/action-semantic-pull-request@v6.1.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ requireScope: false
+ types: |
+ feat
+ fix
+ docs
+ refactor
+ chore
+ test
+ ci
+ build
+ perf
+ revert
+
test:
runs-on: ubuntu-latest
@@ -21,5 +46,8 @@ jobs:
- name: Install dependencies
run: bun install
+ - name: Validate release metadata
+ run: bun run release:validate
+
- name: Run tests
run: bun test
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
deleted file mode 100644
index 5dff6bc..0000000
--- a/.github/workflows/publish.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: Publish to npm
-
-on:
- push:
- branches: [main]
- workflow_dispatch:
-
-jobs:
- publish:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- id-token: write
- issues: write
- pull-requests: write
-
- concurrency:
- group: publish-${{ github.ref }}
- cancel-in-progress: false
-
- steps:
- - uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup Bun
- uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
-
- - name: Install dependencies
- run: bun install --frozen-lockfile
-
- - name: Run tests
- run: bun test
-
- - name: Setup Node.js for release
- uses: actions/setup-node@v4
- with:
- # npm trusted publishing requires Node 22.14.0+.
- node-version: "24"
-
- - name: Release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npx semantic-release
diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml
new file mode 100644
index 0000000..25bc332
--- /dev/null
+++ b/.github/workflows/release-pr.yml
@@ -0,0 +1,98 @@
+name: Release PR
+
+on:
+ push:
+ branches: [main]
+ workflow_dispatch:
+
+permissions:
+ contents: write
+ pull-requests: write
+ issues: write
+
+concurrency:
+ group: release-pr-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ release-pr:
+ runs-on: ubuntu-latest
+ outputs:
+ cli_release_created: ${{ steps.release.outputs.release_created }}
+ cli_tag_name: ${{ steps.release.outputs.tag_name }}
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Detect release PR merge
+ id: detect
+ run: |
+ MSG=$(git log -1 --format=%s)
+ if [[ "$MSG" == chore:\ release* ]]; then
+ echo "is_release_merge=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "is_release_merge=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Validate release metadata scripts
+ if: steps.detect.outputs.is_release_merge == 'false'
+ run: bun run release:validate
+
+ - name: Maintain release PR
+ id: release
+ uses: googleapis/release-please-action@v4.4.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ config-file: .github/release-please-config.json
+ manifest-file: .github/.release-please-manifest.json
+ skip-labeling: false
+
+ publish-cli:
+ needs: release-pr
+ if: needs.release-pr.outputs.cli_release_created == 'true'
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ id-token: write
+
+ concurrency:
+ group: publish-${{ needs.release-pr.outputs.cli_tag_name }}
+ cancel-in-progress: false
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ ref: ${{ needs.release-pr.outputs.cli_tag_name }}
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Run tests
+ run: bun test
+
+ - name: Setup Node.js for release
+ uses: actions/setup-node@v4
+ with:
+ node-version: "24"
+ registry-url: https://registry.npmjs.org
+
+ - name: Publish package
+ run: npm publish --provenance --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml
new file mode 100644
index 0000000..3f3923e
--- /dev/null
+++ b/.github/workflows/release-preview.yml
@@ -0,0 +1,101 @@
+name: Release Preview
+
+on:
+ workflow_dispatch:
+ inputs:
+ title:
+ description: "Conventional title to evaluate (defaults to the latest commit title on this ref)"
+ required: false
+ type: string
+ cli_bump:
+ description: "CLI bump override"
+ required: false
+ type: choice
+ options: [auto, patch, minor, major]
+ default: auto
+ compound_engineering_bump:
+ description: "compound-engineering bump override"
+ required: false
+ type: choice
+ options: [auto, patch, minor, major]
+ default: auto
+ coding_tutor_bump:
+ description: "coding-tutor bump override"
+ required: false
+ type: choice
+ options: [auto, patch, minor, major]
+ default: auto
+ marketplace_bump:
+ description: "marketplace bump override"
+ required: false
+ type: choice
+ options: [auto, patch, minor, major]
+ default: auto
+ cursor_marketplace_bump:
+ description: "cursor-marketplace bump override"
+ required: false
+ type: choice
+ options: [auto, patch, minor, major]
+ default: auto
+
+jobs:
+ preview:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Determine title and changed files
+ id: inputs
+ shell: bash
+ run: |
+ TITLE="${{ github.event.inputs.title }}"
+ if [ -z "$TITLE" ]; then
+ TITLE="$(git log -1 --pretty=%s)"
+ fi
+
+ FILES="$(git diff --name-only HEAD~1...HEAD | tr '\n' ' ')"
+
+ echo "title=$TITLE" >> "$GITHUB_OUTPUT"
+ echo "files=$FILES" >> "$GITHUB_OUTPUT"
+
+ - name: Add preview note
+ run: |
+ echo "This preview currently evaluates the selected ref from its latest commit title and changed files." >> "$GITHUB_STEP_SUMMARY"
+ echo "It is side-effect free, but it does not yet reconstruct the full accumulated open release PR state." >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Validate release metadata
+ run: bun run release:validate
+
+ - name: Preview release
+ shell: bash
+ run: |
+ TITLE='${{ steps.inputs.outputs.title }}'
+ FILES='${{ steps.inputs.outputs.files }}'
+
+ args=(--title "$TITLE" --json)
+ for file in $FILES; do
+ args+=(--file "$file")
+ done
+
+ args+=(--override "cli=${{ github.event.inputs.cli_bump || 'auto' }}")
+ args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
+ args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
+ args+=(--override "marketplace=${{ github.event.inputs.marketplace_bump || 'auto' }}")
+ args+=(--override "cursor-marketplace=${{ github.event.inputs.cursor_marketplace_bump || 'auto' }}")
+
+ bun run scripts/release/preview.ts "${args[@]}" | tee /tmp/release-preview.txt
+
+ - name: Publish preview summary
+ shell: bash
+ run: cat /tmp/release-preview.txt >> "$GITHUB_STEP_SUMMARY"
diff --git a/.gitignore b/.gitignore
index dae7aba..7783391 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ node_modules/
.codex/
todos/
.worktrees
+.context/
diff --git a/.releaserc.json b/.releaserc.json
deleted file mode 100644
index cad12f6..0000000
--- a/.releaserc.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "branches": [
- "main"
- ],
- "tagFormat": "v${version}",
- "plugins": [
- "@semantic-release/commit-analyzer",
- "@semantic-release/release-notes-generator",
- [
- "@semantic-release/changelog",
- {
- "changelogTitle": "# Changelog\n\nAll notable changes to the `@every-env/compound-plugin` CLI tool will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\nRelease numbering now follows the repository `v*` tag line. Starting at `v2.34.0`, the root CLI package and this changelog stay on that shared version stream. Older entries below retain the previous `0.x` CLI numbering."
- }
- ],
- "@semantic-release/npm",
- [
- "@semantic-release/git",
- {
- "assets": [
- "CHANGELOG.md",
- "package.json"
- ],
- "message": "chore(release): ${nextRelease.version} [skip ci]"
- }
- ],
- [
- "@semantic-release/github",
- {
- "successComment": false,
- "failCommentCondition": false,
- "labels": false,
- "releasedLabels": false
- }
- ]
- ]
-}
diff --git a/AGENTS.md b/AGENTS.md
index 5e730a5..5c52e5e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,19 +1,89 @@
# Agent Instructions
-This repository contains a Bun/TypeScript CLI that converts Claude Code plugins into other agent platform formats.
+This repository primarily houses the `compound-engineering` coding-agent plugin and the Claude Code marketplace/catalog metadata used to distribute it.
+
+It also contains:
+- the Bun/TypeScript CLI that converts Claude Code plugins into other agent platform formats
+- additional plugins under `plugins/`, such as `coding-tutor`
+- shared release and metadata infrastructure for the CLI, marketplace, and plugins
+
+`AGENTS.md` is the canonical repo instruction file. Root `CLAUDE.md` exists only as a compatibility shim for tools and conversions that still look for it.
+
+## Quick Start
+
+```bash
+bun install
+bun test # full test suite
+bun run release:validate # check plugin/marketplace consistency
+```
## Working Agreement
- **Branching:** Create a feature branch for any non-trivial change. If already on the correct branch for the task, keep using it; do not create additional branches or worktrees unless explicitly requested.
- **Safety:** Do not delete or overwrite user data. Avoid destructive commands.
- **Testing:** Run `bun test` after changes that affect parsing, conversion, or output.
-- **Release versioning:** The root CLI package (`package.json`, root `CHANGELOG.md`, and repo `v*` tags) uses one shared release line managed by semantic-release on `main`. Do not start or maintain a separate root CLI version stream. Use conventional commits and let release automation write the next root package version. Keep the root changelog header block in sync with `.releaserc.json` `changelogTitle` so generated release entries stay under the header. Embedded marketplace plugin metadata (`plugins/compound-engineering/.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json`) is a separate version surface and may differ, but contributors should not guess or hand-bump release versions for it in normal PRs. The automated release process decides the next plugin/marketplace releases and changelog entries after deciding which merged changes ship together.
+- **Release versioning:** Releases are prepared by release automation, not normal feature PRs. The repo now has multiple release components (`cli`, `compound-engineering`, `coding-tutor`, `marketplace`). GitHub release PRs and GitHub Releases are the canonical release-notes surface for new releases; root `CHANGELOG.md` is only a pointer to that history. Use conventional titles such as `feat:` and `fix:` so release automation can classify change intent, but do not hand-bump release-owned versions or hand-author release notes in routine PRs.
- **Output Paths:** Keep OpenCode output at `opencode.json` and `.opencode/{agents,skills,plugins}`. For OpenCode, command go to `~/.config/opencode/commands/.md`; `opencode.json` is deep-merged (never overwritten wholesale).
-- **ASCII-first:** Use ASCII unless the file already contains Unicode.
+- **Scratch Space:** When authoring or editing skills and agents that need repo-local scratch space, instruct them to use `.context/` for ephemeral collaboration artifacts. Namespace compound-engineering workflow state under `.context/compound-engineering//`, add a per-run subdirectory when concurrent runs are plausible, and clean scratch artifacts up after successful completion unless the user asked to inspect them or another agent still needs them. Durable outputs like plans, specs, learnings, and docs do not belong in `.context/`.
+- **Character encoding:**
+ - **Identifiers** (file names, agent names, command names): ASCII only -- converters and regex patterns depend on it.
+ - **Markdown tables:** Use pipe-delimited (`| col | col |`), never box-drawing characters.
+ - **Prose and skill content:** Unicode is fine (emoji, punctuation, etc.). Prefer ASCII arrows (`->`, `<-`) over Unicode arrows in code blocks and terminal examples.
-## Adding a New Target Provider (e.g., Codex)
+## Directory Layout
-Use this checklist when introducing a new target provider:
+```
+src/ CLI entry point, parsers, converters, target writers
+plugins/ Plugin workspaces (compound-engineering, coding-tutor)
+.claude-plugin/ Claude marketplace catalog metadata
+tests/ Converter, writer, and CLI tests + fixtures
+docs/ Requirements, plans, solutions, and target specs
+```
+
+## Repo Surfaces
+
+Changes in this repo may affect one or more of these surfaces:
+
+- `compound-engineering` under `plugins/compound-engineering/`
+- the Claude marketplace catalog under `.claude-plugin/`
+- the converter/install CLI in `src/` and `package.json`
+- secondary plugins such as `plugins/coding-tutor/`
+
+Do not assume a repo change is "just CLI" or "just plugin" without checking which surface owns the affected files.
+
+## Plugin Maintenance
+
+When changing `plugins/compound-engineering/` content:
+
+- Update substantive docs like `plugins/compound-engineering/README.md` when the plugin behavior, inventory, or usage changes.
+- Do not hand-bump release-owned versions in plugin or marketplace manifests.
+- Do not hand-add release entries to `CHANGELOG.md` or treat it as the canonical source for new releases.
+- Run `bun run release:validate` if agents, commands, skills, MCP servers, or release-owned descriptions/counts may have changed.
+
+Useful validation commands:
+
+```bash
+bun run release:validate
+cat .claude-plugin/marketplace.json | jq .
+cat plugins/compound-engineering/.claude-plugin/plugin.json | jq .
+```
+
+## Coding Conventions
+
+- Prefer explicit mappings over implicit magic when converting between platforms.
+- Keep target-specific behavior in dedicated converters/writers instead of scattering conditionals across unrelated files.
+- Preserve stable output paths and merge semantics for installed targets; do not casually change generated file locations.
+- When adding or changing a target, update fixtures/tests alongside implementation rather than treating docs or examples as sufficient proof.
+
+## Commit Conventions
+
+- Use conventional titles such as `feat: ...`, `fix: ...`, `docs: ...`, and `refactor: ...`.
+- Component scope is optional. Example: `feat(coding-tutor): add quiz reset`.
+- Breaking changes must be explicit with `!` or a breaking-change footer so release automation can classify them correctly.
+
+## Adding a New Target Provider
+
+Only add a provider when the target format is stable, documented, and has a clear mapping for tools/permissions/hooks. Use this checklist:
1. **Define the target entry**
- Add a new handler in `src/targets/index.ts` with `implemented: false` until complete.
@@ -37,17 +107,6 @@ Use this checklist when introducing a new target provider:
5. **Docs**
- Update README with the new `--to` option and output locations.
-## When to Add a Provider
-
-Add a new provider when at least one of these is true:
-
-- A real user/workflow needs it now.
-- The target format is stable and documented.
-- There’s a clear mapping for tools/permissions/hooks.
-- You can write fixtures + tests that validate the mapping.
-
-Avoid adding a provider if the target spec is unstable or undocumented.
-
## Agent References in Skills
When referencing agents from within skill SKILL.md files (e.g., via the `Agent` or `Task` tool), always use the **fully-qualified namespace**: `compound-engineering::`. Never use the short agent name alone.
@@ -60,4 +119,7 @@ This prevents resolution failures when the plugin is installed alongside other p
## Repository Docs Convention
-- **Plans** live in `docs/plans/` and track implementation progress.
+- **Requirements** live in `docs/brainstorms/` — requirements exploration and ideation.
+- **Plans** live in `docs/plans/` — implementation plans and progress tracking.
+- **Solutions** live in `docs/solutions/` — documented decisions and patterns.
+- **Specs** live in `docs/specs/` — target platform format specifications.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e725990..c5856df 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,242 +1,126 @@
# Changelog
-All notable changes to the `@every-env/compound-plugin` CLI tool will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-Release numbering now follows the repository `v*` tag line. Starting at `v2.34.0`, the root CLI package and this changelog stay on that shared version stream. Older entries below retain the previous `0.x` CLI numbering.
-
-## [2.37.1](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.37.0...v2.37.1) (2026-03-16)
-
-
-### Bug Fixes
-
-* **compound:** remove overly defensive context budget precheck ([#278](https://github.com/EveryInc/compound-engineering-plugin/issues/278)) ([#279](https://github.com/EveryInc/compound-engineering-plugin/issues/279)) ([84ca52e](https://github.com/EveryInc/compound-engineering-plugin/commit/84ca52efdb198c7c8ae6c94ca06fc02d2c3ef648))
-
-# [2.37.0](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.5...v2.37.0) (2026-03-15)
+## [2.52.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.51.0...cli-v2.52.0) (2026-03-25)
### Features
-* sync agent-browser skill with upstream vercel-labs/agent-browser ([24860ec](https://github.com/EveryInc/compound-engineering-plugin/commit/24860ec3f1f1e7bfdee0f4408636ada1a3bb8f75))
+* add consolidation support and overlap detection to `ce:compound` and `ce:compound-refresh` skills ([#372](https://github.com/EveryInc/compound-engineering-plugin/issues/372)) ([fe27f85](https://github.com/EveryInc/compound-engineering-plugin/commit/fe27f85810268a8e713ef2c921f0aec1baf771d7))
+* minimal config for conductor support ([#373](https://github.com/EveryInc/compound-engineering-plugin/issues/373)) ([aad31ad](https://github.com/EveryInc/compound-engineering-plugin/commit/aad31adcd3d528581e8b00e78943b21fbe2c47e8))
+* optimize `ce:compound` speed and effectiveness ([#370](https://github.com/EveryInc/compound-engineering-plugin/issues/370)) ([4e3af07](https://github.com/EveryInc/compound-engineering-plugin/commit/4e3af079623ae678b9a79fab5d1726d78f242ec2))
+* promote `ce:review-beta` to stable `ce:review` ([#371](https://github.com/EveryInc/compound-engineering-plugin/issues/371)) ([7c5ff44](https://github.com/EveryInc/compound-engineering-plugin/commit/7c5ff445e3065fd13e00bcd57041f6c35b36f90b))
+* rationalize todo skill names and optimize skills ([#368](https://github.com/EveryInc/compound-engineering-plugin/issues/368)) ([2612ed6](https://github.com/EveryInc/compound-engineering-plugin/commit/2612ed6b3d86364c74dc024e4ce35dde63fefbf6))
-## [2.36.5](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.4...v2.36.5) (2026-03-15)
-
-
-### Bug Fixes
-
-* **create-agent-skills:** remove literal dynamic context directives that break skill loading ([4b4d1ae](https://github.com/EveryInc/compound-engineering-plugin/commit/4b4d1ae2707895d6d4fd2e60a64d83ca50f094a6)), closes [anthropics/claude-code#27149](https://github.com/anthropics/claude-code/issues/27149) [#13655](https://github.com/EveryInc/compound-engineering-plugin/issues/13655)
-
-## [2.36.4](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.3...v2.36.4) (2026-03-14)
-
-
-### Bug Fixes
-
-* **skills:** use fully-qualified agent namespace in Task invocations ([026602e](https://github.com/EveryInc/compound-engineering-plugin/commit/026602e6247d63a83502b80e72cd318232a06af7)), closes [#251](https://github.com/EveryInc/compound-engineering-plugin/issues/251)
-
-## [2.36.3](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.2...v2.36.3) (2026-03-13)
-
-
-### Bug Fixes
-
-* **targets:** nest colon-separated command names into directories ([a84682c](https://github.com/EveryInc/compound-engineering-plugin/commit/a84682cd35e94b0408f6c6a990af0732c2acf03f)), closes [#226](https://github.com/EveryInc/compound-engineering-plugin/issues/226)
-
-## [2.36.2](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.1...v2.36.2) (2026-03-13)
-
-
-### Bug Fixes
-
-* **plan:** remove deprecated /technical_review references ([0ab9184](https://github.com/EveryInc/compound-engineering-plugin/commit/0ab91847f278efba45477462d8e93db5f068e058)), closes [#244](https://github.com/EveryInc/compound-engineering-plugin/issues/244)
-
-## [2.36.1](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.36.0...v2.36.1) (2026-03-13)
-
-
-### Bug Fixes
-
-* **agents:** update learnings-researcher model from haiku to inherit ([30852b7](https://github.com/EveryInc/compound-engineering-plugin/commit/30852b72937091b0a85c22b7c8c45d513ab49fd1)), closes [#249](https://github.com/EveryInc/compound-engineering-plugin/issues/249)
-
-# [2.36.0](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.35.0...v2.36.0) (2026-03-11)
-
-
-### Bug Fixes
-
-* **hooks:** wrap PreToolUse handlers in try-catch to prevent parallel tool call crashes ([598222e](https://github.com/EveryInc/compound-engineering-plugin/commit/598222e11cb2206a2e3347cb5dd38cacdc3830df)), closes [#85](https://github.com/EveryInc/compound-engineering-plugin/issues/85)
-* **install:** merge config instead of overwriting on opencode target ([1db7680](https://github.com/EveryInc/compound-engineering-plugin/commit/1db76800f91fefcc1bb9c1798ef273ddd0b65f5c)), closes [#125](https://github.com/EveryInc/compound-engineering-plugin/issues/125)
-* **review:** add serial mode to prevent context limit crashes ([d96671b](https://github.com/EveryInc/compound-engineering-plugin/commit/d96671b9e9ecbe417568b2ce7f7fa4d379c2bec2)), closes [#166](https://github.com/EveryInc/compound-engineering-plugin/issues/166)
+## [2.51.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.50.0...cli-v2.51.0) (2026-03-24)
### Features
-* **compound:** add context budget precheck and compact-safe mode ([c4b1358](https://github.com/EveryInc/compound-engineering-plugin/commit/c4b13584312058cb8db3ad0f25674805bbb91b2d)), closes [#198](https://github.com/EveryInc/compound-engineering-plugin/issues/198)
-* **plan:** add daily sequence number to plan filenames ([e94ca04](https://github.com/EveryInc/compound-engineering-plugin/commit/e94ca0409671efcfa2d4a8fcb2d60b79a848fd85)), closes [#135](https://github.com/EveryInc/compound-engineering-plugin/issues/135)
-* **plugin:** release v2.39.0 with community contributions ([d2ab6c0](https://github.com/EveryInc/compound-engineering-plugin/commit/d2ab6c076882a4dacaa787c0a6f3c9d555d38af0))
+* add `ce:review-beta` with structured persona pipeline ([#348](https://github.com/EveryInc/compound-engineering-plugin/issues/348)) ([e932276](https://github.com/EveryInc/compound-engineering-plugin/commit/e9322768664e194521894fe770b87c7dabbb8a22))
+* promote ce:plan-beta and deepen-plan-beta to stable ([#355](https://github.com/EveryInc/compound-engineering-plugin/issues/355)) ([169996a](https://github.com/EveryInc/compound-engineering-plugin/commit/169996a75e98a29db9e07b87b0911cc80270f732))
+* redesign `document-review` skill with persona-based review ([#359](https://github.com/EveryInc/compound-engineering-plugin/issues/359)) ([18d22af](https://github.com/EveryInc/compound-engineering-plugin/commit/18d22afde2ae08a50c94efe7493775bc97d9a45a))
-# [2.35.0](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.7...v2.35.0) (2026-03-10)
-
-
-### Bug Fixes
-
-* **test-browser:** detect dev server port from project config ([94aedd5](https://github.com/EveryInc/compound-engineering-plugin/commit/94aedd5a7b6da4ce48de994b5a137953c0fd21c3)), closes [#164](https://github.com/EveryInc/compound-engineering-plugin/issues/164)
+## [2.50.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.49.0...cli-v2.50.0) (2026-03-23)
### Features
-* **compound:** add context budget precheck and compact-safe mode ([7266062](https://github.com/EveryInc/compound-engineering-plugin/commit/726606286873c4059261a8c5f1b75c20fe11ac77)), closes [#198](https://github.com/EveryInc/compound-engineering-plugin/issues/198)
-* **plan:** add daily sequence number to plan filenames ([4fc6ddc](https://github.com/EveryInc/compound-engineering-plugin/commit/4fc6ddc5db3e2b4b398c0ffa0c156e1177b35d05)), closes [#135](https://github.com/EveryInc/compound-engineering-plugin/issues/135)
-
-## [2.34.7](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.6...v2.34.7) (2026-03-10)
+* **ce-work:** add Codex delegation mode ([#328](https://github.com/EveryInc/compound-engineering-plugin/issues/328)) ([341c379](https://github.com/EveryInc/compound-engineering-plugin/commit/341c37916861c8bf413244de72f83b93b506575f))
+* improve `feature-video` skill with GitHub native video upload ([#344](https://github.com/EveryInc/compound-engineering-plugin/issues/344)) ([4aa50e1](https://github.com/EveryInc/compound-engineering-plugin/commit/4aa50e1bada07e90f36282accb3cd81134e706cd))
+* rewrite `frontend-design` skill with layered architecture and visual verification ([#343](https://github.com/EveryInc/compound-engineering-plugin/issues/343)) ([423e692](https://github.com/EveryInc/compound-engineering-plugin/commit/423e69272619e9e3c14750f5219cbf38684b6c96))
### Bug Fixes
-* **test-browser:** detect dev server port from project config ([50cb89e](https://github.com/EveryInc/compound-engineering-plugin/commit/50cb89efde7cee7d6dcd42008e6060e1bec44fcc)), closes [#164](https://github.com/EveryInc/compound-engineering-plugin/issues/164)
+* quote frontend-design skill description ([#353](https://github.com/EveryInc/compound-engineering-plugin/issues/353)) ([86342db](https://github.com/EveryInc/compound-engineering-plugin/commit/86342db36c0d09b65afe11241e095dda2ad2cdb0))
-## [2.34.6](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.5...v2.34.6) (2026-03-10)
+## [2.49.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.48.0...cli-v2.49.0) (2026-03-22)
+
+
+### Features
+
+* add execution mode toggle and context pressure bounds to parallel skills ([#336](https://github.com/EveryInc/compound-engineering-plugin/issues/336)) ([216d6df](https://github.com/EveryInc/compound-engineering-plugin/commit/216d6dfb2c9320c3354f8c9f30e831fca74865cd))
+* fix skill transformation pipeline across all targets ([#334](https://github.com/EveryInc/compound-engineering-plugin/issues/334)) ([4087e1d](https://github.com/EveryInc/compound-engineering-plugin/commit/4087e1df82138f462a64542831224e2718afafa7))
+* improve reproduce-bug skill, sync agent-browser, clean up redundant skills ([#333](https://github.com/EveryInc/compound-engineering-plugin/issues/333)) ([affba1a](https://github.com/EveryInc/compound-engineering-plugin/commit/affba1a6a0d9320b529d429ad06fd5a3b5200bd8))
### Bug Fixes
-* **mcp:** add API key auth support for Context7 server ([c649cfc](https://github.com/EveryInc/compound-engineering-plugin/commit/c649cfc17f895b58babf737dfdec2f6cc391e40a)), closes [#153](https://github.com/EveryInc/compound-engineering-plugin/issues/153)
+* gitignore .context/ directory for Conductor ([#331](https://github.com/EveryInc/compound-engineering-plugin/issues/331)) ([0f6448d](https://github.com/EveryInc/compound-engineering-plugin/commit/0f6448d81cbc47e66004b4ecb8fb835f75aeffe2))
-## [2.34.5](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.4...v2.34.5) (2026-03-10)
+## [2.48.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.47.0...cli-v2.48.0) (2026-03-22)
+
+
+### Features
+
+* **git-worktree:** auto-trust mise and direnv configs in new worktrees ([#312](https://github.com/EveryInc/compound-engineering-plugin/issues/312)) ([cfbfb67](https://github.com/EveryInc/compound-engineering-plugin/commit/cfbfb6710a846419cc07ad17d9dbb5b5a065801c))
+* make skills platform-agnostic across coding agents ([#330](https://github.com/EveryInc/compound-engineering-plugin/issues/330)) ([52df90a](https://github.com/EveryInc/compound-engineering-plugin/commit/52df90a16688ee023bbdb203969adcc45d7d2ba2))
+
+## [2.47.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.46.0...cli-v2.47.0) (2026-03-20)
+
+
+### Features
+
+* improve `repo-research-analyst` by adding a structured technology scan ([#327](https://github.com/EveryInc/compound-engineering-plugin/issues/327)) ([1c28d03](https://github.com/EveryInc/compound-engineering-plugin/commit/1c28d0321401ad50a51989f5e6293d773ac1a477))
### Bug Fixes
-* **lfg:** enforce plan phase with explicit step gating ([b07f43d](https://github.com/EveryInc/compound-engineering-plugin/commit/b07f43ddf59cd7f2fe54b2e0a00d2b5b508b7f11)), closes [#227](https://github.com/EveryInc/compound-engineering-plugin/issues/227)
+* **skills:** update ralph-wiggum references to ralph-loop in lfg/slfg ([#324](https://github.com/EveryInc/compound-engineering-plugin/issues/324)) ([ac756a2](https://github.com/EveryInc/compound-engineering-plugin/commit/ac756a267c5e3d5e4ceb2f99939dbb93491ac4d2))
-## [2.34.4](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.3...v2.34.4) (2026-03-04)
+## [2.46.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.45.0...cli-v2.46.0) (2026-03-20)
+
+
+### Features
+
+* add optional high-level technical design to plan-beta skills ([#322](https://github.com/EveryInc/compound-engineering-plugin/issues/322)) ([3ba4935](https://github.com/EveryInc/compound-engineering-plugin/commit/3ba4935926b05586da488119f215057164d97489))
### Bug Fixes
-* **openclaw:** emit empty configSchema in plugin manifests ([4e9899f](https://github.com/EveryInc/compound-engineering-plugin/commit/4e9899f34693711b8997cf73eaa337f0da2321d6)), closes [#224](https://github.com/EveryInc/compound-engineering-plugin/issues/224)
+* **ci:** add npm registry auth to release publish job ([#319](https://github.com/EveryInc/compound-engineering-plugin/issues/319)) ([3361a38](https://github.com/EveryInc/compound-engineering-plugin/commit/3361a38108991237de51050283e781be847c6bd3))
-## [2.34.3](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.2...v2.34.3) (2026-03-03)
+## [2.45.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.44.0...cli-v2.45.0) (2026-03-19)
+
+
+### Features
+
+* edit resolve_todos_parallel skill for complete todo lifecycle ([#292](https://github.com/EveryInc/compound-engineering-plugin/issues/292)) ([88c89bc](https://github.com/EveryInc/compound-engineering-plugin/commit/88c89bc204c928d2f36e2d1f117d16c998ecd096))
+* integrate claude code auto memory as supplementary data source for ce:compound and ce:compound-refresh ([#311](https://github.com/EveryInc/compound-engineering-plugin/issues/311)) ([5c1452d](https://github.com/EveryInc/compound-engineering-plugin/commit/5c1452d4cc80b623754dd6fe09c2e5b6ae86e72e))
### Bug Fixes
-* **release:** keep changelog header stable ([2fd29ff](https://github.com/EveryInc/compound-engineering-plugin/commit/2fd29ff6ed99583a8539b7a1e876194df5b18dd6))
+* add cursor-marketplace as release-please component ([#315](https://github.com/EveryInc/compound-engineering-plugin/issues/315)) ([838aeb7](https://github.com/EveryInc/compound-engineering-plugin/commit/838aeb79d069b57a80d15ff61d83913919b81aef))
+
+## [2.44.0](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.43.2...cli-v2.44.0) (2026-03-18)
+
+
+### Features
+
+* **plugin:** add execution posture signaling to ce:plan-beta and ce:work ([#309](https://github.com/EveryInc/compound-engineering-plugin/issues/309)) ([748f72a](https://github.com/EveryInc/compound-engineering-plugin/commit/748f72a57f713893af03a4d8ed69c2311f492dbd))
+
+## [2.43.2](https://github.com/EveryInc/compound-engineering-plugin/compare/cli-v2.43.1...cli-v2.43.2) (2026-03-18)
-## [2.34.2](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.1...v2.34.2) (2026-03-03)
### Bug Fixes
-* **release:** add package repository metadata ([eab77bc](https://github.com/EveryInc/compound-engineering-plugin/commit/eab77bc5b5361dc73e2ec8aa4678c8bb6114f6e7))
+* enable release-please labeling so it can find its own PRs ([a7d6e3f](https://github.com/EveryInc/compound-engineering-plugin/commit/a7d6e3fbba862d4e8b4e1a0510f0776e9e274b89))
+* re-enable changelogs so release PRs accumulate correctly ([516bcc1](https://github.com/EveryInc/compound-engineering-plugin/commit/516bcc1dc4bf4e4756ae08775806494f5b43968a))
+* reduce release-please search depth from 500 to 50 ([f1713b9](https://github.com/EveryInc/compound-engineering-plugin/commit/f1713b9dcd0deddc2485e8cf0594266232bf0019))
+* remove close-stale-PR step that broke release creation ([178d6ec](https://github.com/EveryInc/compound-engineering-plugin/commit/178d6ec282512eaee71ab66d45832d22d75353ec))
-## [2.34.1](https://github.com/EveryInc/compound-engineering-plugin/compare/v2.34.0...v2.34.1) (2026-03-03)
+## Changelog
-### Bug Fixes
+Release notes now live in GitHub Releases for this repository:
-* **release:** align cli versioning with repo tags ([7c58eee](https://github.com/EveryInc/compound-engineering-plugin/commit/7c58eeeec6cf33675cbe2b9639c7d69b92ecef60))
+https://github.com/EveryInc/compound-engineering-plugin/releases
-## [2.34.0] - 2026-03-03
+Multi-component releases are published under component-specific tags such as:
-### Added
+- `cli-vX.Y.Z`
+- `compound-engineering-vX.Y.Z`
+- `coding-tutor-vX.Y.Z`
+- `marketplace-vX.Y.Z`
-- **Sync parity across supported providers** — `sync` now uses a shared target registry and supports MCP sync for Codex, Droid, Gemini, Copilot, Pi, Windsurf, Kiro, and Qwen, with OpenClaw kept validation-gated for skills-only sync.
-- **Personal command sync** — Personal Claude commands from `~/.claude/commands/` now sync into provider-native command surfaces, including Codex prompts and generated skills, Gemini TOML commands, OpenCode command markdown, Windsurf workflows, and converted skills where that is the closest available equivalent.
-
-### Changed
-
-- **Global user config targets** — Copilot sync now writes to `~/.copilot/` and Gemini sync writes to `~/.gemini/`, matching current documented user-level config locations.
-- **Gemini skill deduplication** — Gemini sync now avoids mirroring skills that Gemini already resolves from `~/.agents/skills`, preventing duplicate skill conflict warnings after sync.
-
-### Fixed
-
-- **Safe skill sync replacement** — When a real directory already exists at a symlink target (for example `~/.config/opencode/skills/proof`), sync now logs a warning and skips instead of throwing an error.
-
----
-
-## [0.12.0] - 2026-03-01
-
-### Added
-
-- **Auto-detect install targets** — `install --to all` and `convert --to all` auto-detect installed AI coding tools and install to all of them in one command
-- **Gemini sync** — `sync --target gemini` symlinks personal skills to `.gemini/skills/` and merges MCP servers into `.gemini/settings.json`
-- **Sync all targets** — `sync --target all` syncs personal config to all detected tools
-- **Tool detection utility** — Checks config directories for OpenCode, Codex, Droid, Cursor, Pi, and Gemini
-
----
-
-## [0.11.0] - 2026-03-01
-
-### Added
-
-- **OpenClaw target** — `--to openclaw` converts plugins to OpenClaw format. Agents become `.md` files, commands become `.md` files, pass-through skills copy unchanged, and MCP servers are written to `openclaw-extension.json`. Output goes to `~/.openclaw/extensions//` by default. Use `--openclaw-home` to override. ([#217](https://github.com/EveryInc/compound-engineering-plugin/pull/217)) — thanks [@TrendpilotAI](https://github.com/TrendpilotAI)!
-- **Qwen Code target** — `--to qwen` converts plugins to Qwen Code extension format. Agents become `.yaml` files with Qwen-compatible fields, commands become `.md` files, MCP servers write to `qwen-extension.json`, and a `QWEN.md` context file is generated. Output goes to `~/.qwen/extensions//` by default. Use `--qwen-home` to override. ([#220](https://github.com/EveryInc/compound-engineering-plugin/pull/220)) — thanks [@rlam3](https://github.com/rlam3)!
-- **Windsurf target** — `--to windsurf` converts plugins to Windsurf format. Claude agents become Windsurf skills (`skills/{name}/SKILL.md`), commands become flat workflows (`global_workflows/{name}.md` for global scope, `workflows/{name}.md` for workspace), and pass-through skills copy unchanged. MCP servers write to `mcp_config.json` (machine-readable, merged with existing config). ([#202](https://github.com/EveryInc/compound-engineering-plugin/pull/202)) — thanks [@rburnham52](https://github.com/rburnham52)!
-- **Global scope support** — New `--scope global|workspace` flag (generic, Windsurf as first adopter). `--to windsurf` defaults to global scope (`~/.codeium/windsurf/`), making installed skills, workflows, and MCP servers available across all projects. Use `--scope workspace` for project-level `.windsurf/` output.
-- **`mcp_config.json` integration** — Windsurf converter writes proper machine-readable MCP config supporting stdio, Streamable HTTP, and SSE transports. Merges with existing config (user entries preserved, plugin entries take precedence). Written with `0o600` permissions.
-- **Shared utilities** — Extracted `resolveTargetOutputRoot` to `src/utils/resolve-output.ts` and `hasPotentialSecrets` to `src/utils/secrets.ts` to eliminate duplication.
-
-### Fixed
-
-- **OpenClaw code injection** — `generateEntryPoint` now uses `JSON.stringify()` for all string interpolation (was escaping only `"`, leaving `\n`/`\\` unguarded).
-- **Qwen `plugin.manifest.name`** — context file header was `# undefined` due to using `plugin.name` (which doesn't exist on `ClaudePlugin`); fixed to `plugin.manifest.name`.
-- **Qwen remote MCP servers** — curl fallback removed; HTTP/SSE servers are now skipped with a warning (Qwen only supports stdio transport).
-- **`--openclaw-home` / `--qwen-home` CLI flags** — wired through to `resolveTargetOutputRoot` so custom home directories are respected.
-
----
-
-## [0.9.1] - 2026-02-20
-
-### Changed
-
-- **Remove docs/reports and docs/decisions directories** — only `docs/plans/` is retained as living documents that track implementation progress
-- **OpenCode commands as Markdown** — commands are now `.md` files with deep-merged config, permissions default to none ([#201](https://github.com/EveryInc/compound-engineering-plugin/pull/201)) — thanks [@0ut5ider](https://github.com/0ut5ider)!
-- **Fix changelog GitHub link** ([#215](https://github.com/EveryInc/compound-engineering-plugin/pull/215)) — thanks [@XSAM](https://github.com/XSAM)!
-- **Update Claude Code install command in README** ([#218](https://github.com/EveryInc/compound-engineering-plugin/pull/218)) — thanks [@ianguelman](https://github.com/ianguelman)!
-
----
-
-## [0.9.0] - 2026-02-17
-
-### Added
-
-- **Kiro CLI target** — `--to kiro` converts plugins to `.kiro/` format with custom agent JSON configs, prompt files, skills, steering files, and `mcp.json`. Only stdio MCP servers are supported ([#196](https://github.com/EveryInc/compound-engineering-plugin/pull/196)) — thanks [@krthr](https://github.com/krthr)!
-
----
-
-## [0.8.0] - 2026-02-17
-
-### Added
-
-- **GitHub Copilot target** — `--to copilot` converts plugins to `.github/` format with `.agent.md` files, `SKILL.md` skills, and `copilot-mcp-config.json`. Also supports `sync --target copilot` ([#192](https://github.com/EveryInc/compound-engineering-plugin/pull/192)) — thanks [@brayanjuls](https://github.com/brayanjuls)!
-- **Native Cursor plugin support** — Cursor now installs via `/add-plugin compound-engineering` using Cursor's native plugin system instead of CLI conversion ([#184](https://github.com/EveryInc/compound-engineering-plugin/pull/184)) — thanks [@ericzakariasson](https://github.com/ericzakariasson)!
-
-### Removed
-
-- Cursor CLI conversion target (`--to cursor`) — replaced by native Cursor plugin install
-
----
-
-## [0.6.0] - 2026-02-12
-
-### Added
-
-- **Droid sync target** — `sync --target droid` symlinks personal skills to `~/.factory/skills/`
-- **Cursor sync target** — `sync --target cursor` symlinks skills to `.cursor/skills/` and merges MCP servers into `.cursor/mcp.json`
-- **Pi target** — First-class `--to pi` converter with MCPorter config and subagent compatibility ([#181](https://github.com/EveryInc/compound-engineering-plugin/pull/181)) — thanks [@gvkhosla](https://github.com/gvkhosla)!
-
-### Fixed
-
-- **Bare Claude model alias resolution** — Fixed OpenCode converter not resolving bare model aliases like `claude-sonnet-4-5-20250514` ([#182](https://github.com/EveryInc/compound-engineering-plugin/pull/182)) — thanks [@waltbeaman](https://github.com/waltbeaman)!
-
-### Changed
-
-- Extracted shared `expandHome` / `resolveTargetHome` helpers to `src/utils/resolve-home.ts`, removing duplication across `convert.ts`, `install.ts`, and `sync.ts`
-
----
-
-## [0.5.2] - 2026-02-09
-
-### Fixed
-
-- Fix cursor install defaulting to cwd instead of opencode config dir
-
-## [0.5.1] - 2026-02-08
-
-- Initial npm publish
+Do not add new release entries here. New release notes are managed by release automation in GitHub.
diff --git a/CLAUDE.md b/CLAUDE.md
index 1df9ec6..43c994c 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,394 +1 @@
-# compound-engineering-plugin - Claude Code Plugin Marketplace
-
-This repository is a Claude Code plugin marketplace that distributes the `compound-engineering` plugin to developers building with AI-powered tools.
-
-## Repository Structure
-
-```
-compound-engineering-plugin/
-├── .claude-plugin/
-│ └── marketplace.json # Marketplace catalog (lists available plugins)
-├── docs/ # Documentation site (GitHub Pages)
-│ ├── index.html # Landing page
-│ ├── css/ # Stylesheets
-│ ├── js/ # JavaScript
-│ └── pages/ # Reference pages
-└── plugins/
- └── compound-engineering/ # The actual plugin
- ├── .claude-plugin/
- │ └── plugin.json # Plugin metadata
- ├── agents/ # 24 specialized AI agents
- ├── commands/ # 13 slash commands
- ├── skills/ # 11 skills
- ├── mcp-servers/ # 2 MCP servers (playwright, context7)
- ├── README.md # Plugin documentation
- └── CHANGELOG.md # Version history
-```
-
-## Philosophy: Compounding Engineering
-
-**Each unit of engineering work should make subsequent units of work easier—not harder.**
-
-When working on this repository, follow the compounding engineering process:
-
-1. **Plan** → Understand the change needed and its impact
-2. **Delegate** → Use AI tools to help with implementation
-3. **Assess** → Verify changes work as expected
-4. **Codify** → Update this CLAUDE.md with learnings
-
-## Working with This Repository
-
-## CLI Release Versioning
-
-The repository has two separate version surfaces:
-
-1. **Root CLI package** — `package.json`, root `CHANGELOG.md`, and repo `v*` tags all share one release line managed by semantic-release on `main`.
-2. **Embedded marketplace plugin metadata** — `plugins/compound-engineering/.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json` track the distributed Claude plugin metadata and can differ from the root CLI package version.
-
-Rules:
-
-- Do not start a separate root CLI version stream. The root CLI follows the repo tag line.
-- Do not hand-bump the root CLI `package.json` or root `CHANGELOG.md` for routine feature work. Use conventional commits and let semantic-release write the released root version back to git.
-- Keep the root `CHANGELOG.md` header block aligned with `.releaserc.json` `changelogTitle`. If they drift, semantic-release will prepend release notes above the header.
-- Do not guess or hand-bump embedded plugin release versions in routine PRs. The automated release process decides the next plugin/marketplace version and generate release changelog entries after choosing which merged changes ship together.
-
-### Adding a New Plugin
-
-1. Create plugin directory: `plugins/new-plugin-name/`
-2. Add plugin structure:
- ```
- plugins/new-plugin-name/
- ├── .claude-plugin/plugin.json
- ├── agents/
- ├── commands/
- └── README.md
- ```
-3. Update `.claude-plugin/marketplace.json` to include the new plugin
-4. Test locally before committing
-
-### Updating the Compounding Engineering Plugin
-
-When agents, commands, or skills are added/removed, follow this checklist:
-
-#### 1. Count all components accurately
-
-```bash
-# Count agents
-ls plugins/compound-engineering/agents/*.md | wc -l
-
-# Count commands
-ls plugins/compound-engineering/commands/*.md | wc -l
-
-# Count skills
-ls -d plugins/compound-engineering/skills/*/ 2>/dev/null | wc -l
-```
-
-#### 2. Update ALL description strings with correct counts
-
-The description appears in multiple places and must match everywhere:
-
-- [ ] `plugins/compound-engineering/.claude-plugin/plugin.json` → `description` field
-- [ ] `.claude-plugin/marketplace.json` → plugin `description` field
-- [ ] `plugins/compound-engineering/README.md` → intro paragraph
-
-Format: `"Includes X specialized agents, Y commands, and Z skill(s)."`
-
-#### 3. Do not pre-cut release versions
-
-Contributors should not guess the next released plugin version in a normal PR:
-
-- [ ] No manual bump in `plugins/compound-engineering/.claude-plugin/plugin.json` → `version`
-- [ ] No manual bump in `.claude-plugin/marketplace.json` → plugin `version`
-
-#### 4. Update documentation
-
-- [ ] `plugins/compound-engineering/README.md` → list all components
-- [ ] Do not cut a release section in `plugins/compound-engineering/CHANGELOG.md` for a normal feature PR
-- [ ] `CLAUDE.md` → update structure diagram if needed
-
-#### 5. Rebuild documentation site
-
-Run the release-docs command to update all documentation pages:
-
-```bash
-claude /release-docs
-```
-
-This will:
-- Update stats on the landing page
-- Regenerate reference pages (agents, commands, skills, MCP servers)
-- Update the changelog page
-- Validate all counts match actual files
-
-#### 6. Validate JSON files
-
-```bash
-cat .claude-plugin/marketplace.json | jq .
-cat plugins/compound-engineering/.claude-plugin/plugin.json | jq .
-```
-
-#### 6. Verify before committing
-
-```bash
-# Ensure counts in descriptions match actual files
-grep -o "Includes [0-9]* specialized agents" plugins/compound-engineering/.claude-plugin/plugin.json
-ls plugins/compound-engineering/agents/*.md | wc -l
-```
-
-### Marketplace.json Structure
-
-The marketplace.json follows the official Claude Code spec:
-
-```json
-{
- "name": "marketplace-identifier",
- "owner": {
- "name": "Owner Name",
- "url": "https://github.com/owner"
- },
- "metadata": {
- "description": "Marketplace description",
- "version": "1.0.0"
- },
- "plugins": [
- {
- "name": "plugin-name",
- "description": "Plugin description",
- "version": "1.0.0",
- "author": { ... },
- "homepage": "https://...",
- "tags": ["tag1", "tag2"],
- "source": "./plugins/plugin-name"
- }
- ]
-}
-```
-
-**Only include fields that are in the official spec.** Do not add custom fields like:
-
-- `downloads`, `stars`, `rating` (display-only)
-- `categories`, `featured_plugins`, `trending` (not in spec)
-- `type`, `verified`, `featured` (not in spec)
-
-### Plugin.json Structure
-
-Each plugin has its own plugin.json with detailed metadata:
-
-```json
-{
- "name": "plugin-name",
- "version": "1.0.0",
- "description": "Plugin description",
- "author": { ... },
- "keywords": ["keyword1", "keyword2"],
- "components": {
- "agents": 15,
- "commands": 6,
- "hooks": 2
- },
- "agents": {
- "category": [
- {
- "name": "agent-name",
- "description": "Agent description",
- "use_cases": ["use-case-1", "use-case-2"]
- }
- ]
- },
- "commands": {
- "category": ["command1", "command2"]
- }
-}
-```
-
-## Documentation Site
-
-The documentation site is at `/docs` in the repository root (for GitHub Pages). This site is built with plain HTML/CSS/JS (based on Evil Martians' LaunchKit template) and requires no build step to view.
-
-### Documentation Structure
-
-```
-docs/
-├── index.html # Landing page with stats and philosophy
-├── css/
-│ ├── style.css # Main styles (LaunchKit-based)
-│ └── docs.css # Documentation-specific styles
-├── js/
-│ └── main.js # Interactivity (theme toggle, mobile nav)
-└── pages/
- ├── getting-started.html # Installation and quick start
- ├── agents.html # All 24 agents reference
- ├── commands.html # All 13 commands reference
- ├── skills.html # All 11 skills reference
- ├── mcp-servers.html # MCP servers reference
- └── changelog.html # Version history
-```
-
-### Keeping Docs Up-to-Date
-
-**IMPORTANT:** After ANY change to agents, commands, skills, or MCP servers, run:
-
-```bash
-claude /release-docs
-```
-
-This command:
-1. Counts all current components
-2. Reads all agent/command/skill/MCP files
-3. Regenerates all reference pages
-4. Updates stats on the landing page
-5. Updates the changelog from CHANGELOG.md
-6. Validates counts match across all files
-
-### Manual Updates
-
-If you need to update docs manually:
-
-1. **Landing page stats** - Update the numbers in `docs/index.html`:
- ```html
- 24
- 13
- ```
-
-2. **Reference pages** - Each page in `docs/pages/` documents all components in that category
-
-3. **Changelog** - `docs/pages/changelog.html` mirrors `CHANGELOG.md` in HTML format
-
-### Viewing Docs Locally
-
-Since the docs are static HTML, you can view them directly:
-
-```bash
-# Open in browser
-open docs/index.html
-
-# Or start a local server
-cd docs
-python -m http.server 8000
-# Then visit http://localhost:8000
-```
-
-## Testing Changes
-
-### Test Locally
-
-1. Install the marketplace locally:
-
- ```bash
- claude /plugin marketplace add /Users/yourusername/compound-engineering-plugin
- ```
-
-2. Install the plugin:
-
- ```bash
- claude /plugin install compound-engineering
- ```
-
-3. Test agents and commands:
- ```bash
- claude /review
- claude agent kieran-rails-reviewer "test message"
- ```
-
-### Validate JSON
-
-Before committing, ensure JSON files are valid:
-
-```bash
-cat .claude-plugin/marketplace.json | jq .
-cat plugins/compound-engineering/.claude-plugin/plugin.json | jq .
-```
-
-## Common Tasks
-
-### Adding a New Agent
-
-1. Create `plugins/compound-engineering/agents/new-agent.md`
-2. Update plugin.json agent count and agent list
-3. Update README.md agent list
-4. Test with `claude agent new-agent "test"`
-
-### Adding a New Command
-
-1. Create `plugins/compound-engineering/commands/new-command.md`
-2. Update plugin.json command count and command list
-3. Update README.md command list
-4. Test with `claude /new-command`
-
-### Adding a New Skill
-
-1. Create skill directory: `plugins/compound-engineering/skills/skill-name/`
-2. Add skill structure:
- ```
- skills/skill-name/
- ├── SKILL.md # Skill definition with frontmatter (name, description)
- └── scripts/ # Supporting scripts (optional)
- ```
-3. Update plugin.json description with new skill count
-4. Update marketplace.json description with new skill count
-5. Update README.md with skill documentation
-6. Update CHANGELOG.md with the addition
-7. Test with `claude skill skill-name`
-
-**Skill file format (SKILL.md):**
-```markdown
----
-name: skill-name
-description: Brief description of what the skill does
----
-
-# Skill Title
-
-Detailed documentation...
-```
-
-### Updating Tags/Keywords
-
-Tags should reflect the compounding engineering philosophy:
-
-- Use: `ai-powered`, `compound-engineering`, `workflow-automation`, `knowledge-management`
-- Avoid: Framework-specific tags unless the plugin is framework-specific
-
-## Commit Conventions
-
-Follow these patterns for commit messages:
-
-- `Add [agent/command name]` - Adding new functionality
-- `Remove [agent/command name]` - Removing functionality
-- `Update [file] to [what changed]` - Updating existing files
-- `Fix [issue]` - Bug fixes
-- `Simplify [component] to [improvement]` - Refactoring
-
-Include the Claude Code footer:
-
-```
-🤖 Generated with [Claude Code](https://claude.com/claude-code)
-
-Co-Authored-By: Claude
-```
-
-## Resources to search for when needing more information
-
-- [Claude Code Plugin Documentation](https://docs.claude.com/en/docs/claude-code/plugins)
-- [Plugin Marketplace Documentation](https://docs.claude.com/en/docs/claude-code/plugin-marketplaces)
-- [Plugin Reference](https://docs.claude.com/en/docs/claude-code/plugins-reference)
-
-## Key Learnings
-
-_This section captures important learnings as we work on this repository._
-
-### 2024-11-22: Added gemini-imagegen skill and fixed component counts
-
-Added the first skill to the plugin and discovered the component counts were wrong (said 15 agents, actually had 17). Created a comprehensive checklist for updating the plugin to prevent this in the future.
-
-**Learning:** Always count actual files before updating descriptions. The counts appear in multiple places (plugin.json, marketplace.json, README.md) and must all match. Use the verification commands in the checklist above.
-
-### 2024-10-09: Simplified marketplace.json to match official spec
-
-The initial marketplace.json included many custom fields (downloads, stars, rating, categories, trending) that aren't part of the Claude Code specification. We simplified to only include:
-
-- Required: `name`, `owner`, `plugins`
-- Optional: `metadata` (with description and version)
-- Plugin entries: `name`, `description`, `version`, `author`, `homepage`, `tags`, `source`
-
-**Learning:** Stick to the official spec. Custom fields may confuse users or break compatibility with future versions.
+@AGENTS.md
diff --git a/README.md b/README.md
index 0eef127..6d67b50 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ Then run `claude-dev-ce` instead of `claude` to test your changes. Your producti
**Codex** — point the install command at your local path:
```bash
-bunx @every-env/compound-plugin install ./plugins/compound-engineering --to codex
+bun run src/index.ts install ./plugins/compound-engineering --to codex
```
**Other targets** — same pattern, swap the target:
@@ -97,7 +97,7 @@ bun run src/index.ts install ./plugins/compound-engineering --to opencode
| Target | Output path | Notes |
|--------|------------|-------|
| `opencode` | `~/.config/opencode/` | Commands as `.md` files; `opencode.json` MCP config deep-merged; backups made before overwriting |
-| `codex` | `~/.codex/prompts` + `~/.codex/skills` | Each command becomes a prompt + skill pair; descriptions truncated to 1024 chars |
+| `codex` | `~/.codex/prompts` + `~/.codex/skills` | Claude commands become prompt + skill pairs; canonical `ce:*` workflow skills also get prompt wrappers; deprecated `workflows:*` aliases are omitted |
| `droid` | `~/.factory/` | Tool names mapped (`Bash`→`Execute`, `Write`→`Create`); namespace prefixes stripped |
| `pi` | `~/.pi/agent/` | Prompts, skills, extensions, and `mcporter.json` for MCPorter interoperability |
| `gemini` | `.gemini/` | Skills from agents; commands as `.toml`; namespaced commands become directories (`workflows:plan` → `commands/workflows/plan.toml`) |
@@ -184,17 +184,20 @@ Notes:
```
Brainstorm → Plan → Work → Review → Compound → Repeat
+ ↑
+ Ideate (optional — when you need ideas)
```
| Command | Purpose |
|---------|---------|
+| `/ce:ideate` | Discover high-impact project improvements through divergent ideation and adversarial filtering |
| `/ce:brainstorm` | Explore requirements and approaches before planning |
| `/ce:plan` | Turn feature ideas into detailed implementation plans |
| `/ce:work` | Execute plans with worktrees and task tracking |
| `/ce:review` | Multi-agent code review before merging |
| `/ce:compound` | Document learnings to make future work easier |
-The `brainstorming` skill supports `/ce:brainstorm` with collaborative dialogue to clarify requirements and compare approaches before committing to a plan.
+The `/ce:ideate` skill proactively surfaces strong improvement ideas, and `/ce:brainstorm` then clarifies the selected one before committing to a plan.
Each cycle compounds: brainstorms sharpen plans, plans inform future plans, reviews catch more issues, patterns get documented.
diff --git a/docs/brainstorms/2026-03-14-ce-plan-rewrite-requirements.md b/docs/brainstorms/2026-03-14-ce-plan-rewrite-requirements.md
new file mode 100644
index 0000000..ce28e9d
--- /dev/null
+++ b/docs/brainstorms/2026-03-14-ce-plan-rewrite-requirements.md
@@ -0,0 +1,85 @@
+---
+date: 2026-03-14
+topic: ce-plan-rewrite
+---
+
+# Rewrite `ce:plan` to Separate Planning from Implementation
+
+## Problem Frame
+
+`ce:plan` sits between `ce:brainstorm` and `ce:work`, but the current skill mixes issue authoring, technical planning, and pseudo-implementation. That makes plans brittle and pushes the planning phase to predict details that are often only discoverable during implementation. PR #246 intensifies this by asking plans to include complete code, exact commands, and micro-step TDD and commit choreography. The rewrite should keep planning strong enough for a capable agent or engineer to execute, while moving code-writing, test-running, and execution-time learning back into `ce:work`.
+
+## Requirements
+
+- R1. `ce:plan` must accept either a raw feature description or a requirements document produced by `ce:brainstorm` as primary input.
+- R2. `ce:plan` must preserve compound-engineering's planning strengths: repo pattern scan, institutional learnings, conditional external research, and requirements-gap checks when warranted.
+- R3. `ce:plan` must produce a durable implementation plan focused on decisions, sequencing, file paths, dependencies, risks, and test scenarios, not implementation code.
+- R4. `ce:plan` must not instruct the planner to run tests, generate exact implementation snippets, or learn from execution-time results. Those belong to `ce:work`.
+- R5. Plan tasks and subtasks must be right-sized for implementation handoff, but sized as logical units or atomic commits rather than 2-5 minute copy-paste steps.
+- R6. Plans must remain shareable and portable as documents or issues without tool-specific executor litter such as TodoWrite instructions, `/ce:work` choreography, or git command recipes in the artifact itself.
+- R7. `ce:plan` must carry forward product decisions, scope boundaries, success criteria, and deferred questions from `ce:brainstorm` without re-inventing them.
+- R8. `ce:plan` must explicitly distinguish what gets resolved during planning from what is intentionally deferred to implementation-time discovery.
+- R9. `ce:plan` must hand off cleanly to `ce:work`, giving enough information for task creation without pre-writing code.
+- R10. If detail levels remain, they must change depth of analysis and documentation, not the planning philosophy. A small plan can be terse while still staying decision-first.
+- R11. If an upstream requirements document contains unresolved `Resolve Before Planning` items, `ce:plan` must classify whether they are true product blockers or misfiled technical questions before proceeding.
+- R12. `ce:plan` must not plan past unresolved product decisions that would change behavior, scope, or success criteria, but it may absorb technical or research questions by reclassifying them into planning-owned investigation.
+- R13. When true blockers remain, `ce:plan` must pause helpfully: surface the blockers, allow the user to convert them into explicit assumptions or decisions, or route them back to `ce:brainstorm`.
+
+## Success Criteria
+
+- A fresh implementer can start work from the plan without needing clarifying questions, but the plan does not contain implementation code.
+- `ce:work` can derive actionable tasks from the plan without relying on micro-step commands or embedded git/test instructions.
+- Plans stay accurate longer as repo context changes because they capture decisions and boundaries rather than speculative code.
+- A requirements document from `ce:brainstorm` flows into planning without losing decisions, scope boundaries, or success criteria.
+- Plans do not proceed past unresolved product blockers unless the user explicitly converts them into assumptions or decisions.
+- For the same feature, the rewritten `ce:plan` produces output that is materially shorter and less brittle than the current skill or PR #246's proposed format while remaining execution-ready.
+
+## Scope Boundaries
+
+- Do not redesign `ce:brainstorm`'s product-definition role.
+- Do not remove decomposition, file paths, verification, or risk analysis from `ce:plan`.
+- Do not move planning into a vague, under-specified artifact that leaves execution to guess.
+- Do not change `ce:work` in this phase beyond possible follow-up clarification of what plan structure it should prefer.
+- Do not require heavyweight PRD ceremony for small or straightforward work.
+
+## Key Decisions
+
+- Use a hybrid model: keep compound-engineering's research and handoff strengths, but adopt iterative-engineering's "decisions, not code" boundary.
+- Planning stops before execution: no running tests, no fail/pass learning, no exact implementation snippets, and no commit shell commands in the plan.
+- Use logical tasks and subtasks sized around atomic changes or commit units rather than 2-5 minute micro-steps.
+- Keep explicit verification and test scenarios, but express them as expected coverage and validation outcomes rather than commands with predicted output.
+- Preserve `ce:brainstorm` as the preferred upstream input when available, with clear handling for deferred technical questions.
+- Treat `Resolve Before Planning` as a classification gate: planning first distinguishes true product blockers from technical questions, then investigates only the latter.
+
+## High-Level Direction
+
+- Phase 0: Resume existing plan work when relevant, detect brainstorm input, and assess scope.
+- Phase 1: Gather context through repo research, institutional learnings, and conditional external research.
+- Phase 2: Resolve planning-time technical questions and capture implementation-time unknowns separately.
+- Phase 3: Structure the plan around components, dependencies, files, test targets, risks, and verification.
+- Phase 4: Write a right-sized plan artifact whose depth varies by scope, but whose boundary stays planning-only.
+- Phase 5: Review and hand off to refinement, deeper research, issue sharing, or `ce:work`.
+
+## Alternatives Considered
+
+- Keep the current `ce:plan` and only reject PR #246.
+ Rejected because the underlying issue remains: the current skill already drifts toward issue-template output plus pseudo-implementation.
+- Adopt Superpowers `writing-plans` nearly wholesale.
+ Rejected because it is intentionally execution-script-oriented and collapses planning into detailed code-writing and command choreography.
+- Adopt iterative-engineering `tech-planning` wholesale.
+ Rejected because it would lose useful compound-engineering behaviors such as brainstorm-origin integration, institutional learnings, and richer post-plan handoff options.
+
+## Dependencies / Assumptions
+
+- `ce:work` can continue creating its own actionable task list from a decision-first plan.
+- If `ce:work` later benefits from an explicit section such as `## Implementation Units` or `## Work Breakdown`, that should be a separate follow-up designed around execution needs rather than micro-step code generation.
+
+## Resolved During Planning
+
+- [Affects R10][Technical] Replaced `MINIMAL` / `MORE` / `A LOT` with `Lightweight` / `Standard` / `Deep` to align `ce:plan` with `ce:brainstorm`'s scope model.
+- [Affects R9][Technical] Updated `ce:work` to explicitly consume decision-first plan sections such as `Implementation Units`, `Requirements Trace`, `Files`, `Test Scenarios`, and `Verification`.
+- [Affects R2][Needs research] Kept SpecFlow as a conditional planning aid: use it for `Standard` or `Deep` plans when flow completeness is unclear rather than making it mandatory for every plan.
+
+## Next Steps
+
+-> Review, refine, and commit the `ce:plan` and `ce:work` rewrite
diff --git a/docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md b/docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md
new file mode 100644
index 0000000..41f2d40
--- /dev/null
+++ b/docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md
@@ -0,0 +1,77 @@
+---
+date: 2026-03-15
+topic: ce-ideate-skill
+---
+
+# ce:ideate — Open-Ended Ideation Skill
+
+## Problem Frame
+
+The ce:brainstorm skill is reactive — the user brings an idea, and the skill helps refine it through collaborative dialogue. There is no workflow for the opposite direction: having the AI proactively generate ideas by deeply understanding the project and then filtering them through critical self-evaluation. Users currently achieve this through ad-hoc prompting (e.g., "come up with 100 ideas and give me your best 10"), but that approach has no codebase grounding, no structured output, no durable artifact, and no connection to the ce:* workflow pipeline.
+
+## Requirements
+
+- R1. ce:ideate is a standalone skill, separate from ce:brainstorm, with its own SKILL.md in `plugins/compound-engineering/skills/ce-ideate/`
+- R2. Accepts an optional freeform argument that serves as a focus hint — can be a concept ("DX improvements"), a path ("plugins/compound-engineering/skills/"), a constraint ("low-complexity quick wins"), or empty for fully open ideation
+- R3. Performs a deep codebase scan before generating ideas, grounding ideation in the actual project state rather than abstract speculation
+- R4. Preserves the user's proven prompt mechanism as the core workflow: generate many ideas first, then systematically and critically reject weak ones, then explain only the surviving ideas in detail
+- R5. Self-critiques the full list, rejecting weak ideas with explicit reasoning — the adversarial filtering step is the core quality mechanism
+- R6. Presents the top 5-7 surviving ideas with structured analysis: description, rationale, downsides, confidence score (0-100%), estimated complexity
+- R7. Includes a brief rejection summary — one-line per rejected idea with the reason — so the user can see what was considered and why it was cut
+- R8. Writes a durable ideation artifact to `docs/ideation/YYYY-MM-DD--ideation.md` (or `YYYY-MM-DD-open-ideation.md` when no focus area). This compounds — rejected ideas prevent re-exploring dead ends, and un-acted-on ideas remain available for future sessions.
+- R9. The default volume (~30 ideas, top 5-7 presented) can be overridden by the user's argument (e.g., "give me your top 3" or "go deep, 100 ideas")
+- R10. Handoff options after presenting ideas: brainstorm a selected idea (feeds into ce:brainstorm), refine the ideation (dig deeper, re-evaluate, explore new angles), share to Proof, or end the session
+- R11. Always routes to ce:brainstorm when the user wants to act on an idea — ideation output is never detailed enough to skip requirements refinement
+- R12. Session completion: when ending, offer to commit the ideation doc to the current branch. If the user declines, leave the file uncommitted. Do not create branches or push — just the local commit.
+- R13. Resume behavior: when ce:ideate is invoked, check `docs/ideation/` for ideation docs created within the last 30 days. If a relevant one exists, offer to continue from it (add new ideas, revisit rejected ones, act on un-explored ideas) or start fresh.
+- R14. Present the surviving candidates to the user before writing the durable ideation artifact, so the user can ask questions or lightly reshape the candidate set before it is archived
+- R15. The ideation artifact must be written or updated before any downstream handoff, Proof sharing, or session end, even though the initial survivor presentation happens first
+- R16. Refine routes based on intent: "add more ideas" or "explore new angles" returns to generation (Phase 2), "re-evaluate" or "raise the bar" returns to critique (Phase 3), "dig deeper on idea #N" expands that idea's analysis in place. The ideation doc is updated after each refinement when the refined state is being preserved
+- R17. Uses agent intelligence to improve ideation quality, but only as support for the core prompt mechanism rather than as a replacement for it
+- R18. Uses existing research agents for codebase grounding, but ideation and critique sub-agents are prompt-defined roles with distinct perspectives rather than forced reuse of existing named review agents
+- R19. When sub-agents are used for ideation, each one receives the same grounding summary, the user focus hint, and the current volume target
+- R20. Focus hints influence both candidate generation and final filtering; they are not only an evaluation-time bias
+- R21. Ideation sub-agents return ideas in a standardized structured format so the orchestrator can merge, dedupe, and reason over them consistently
+- R22. The orchestrator owns final scoring, ranking, and survivor decisions across the merged idea set; sub-agents may emit lightweight local signals, but they do not authoritatively rank their own ideas
+- R23. Distinct ideation perspectives should be created through prompt framing methods that encourage creative spread without over-constraining the workflow; examples include friction, unmet need, inversion, assumption-breaking, leverage, and extreme-case prompts
+- R24. The skill does not hardcode a fixed number of sub-agents for all runs; it should use the smallest useful set that preserves diversity without overwhelming the orchestrator's context window
+- R25. When the user picks an idea to brainstorm, the ideation doc is updated to mark that idea as "explored" with a reference to the resulting brainstorm session date, so future revisits show which ideas have been acted on.
+
+## Success Criteria
+
+- A user can invoke `/ce:ideate` with no arguments on any project and receive genuinely surprising, high-quality improvement ideas grounded in the actual codebase
+- Ideas that survive the filter are meaningfully better than what the user would get from a naive "give me 10 ideas" prompt
+- The workflow uses agent intelligence to widen the candidate pool without obscuring the core generate -> reject -> survivors mechanism
+- The user sees and can question the surviving candidates before they are written into the durable artifact
+- The ideation artifact persists and provides value when revisited weeks later
+- The skill composes naturally with the existing pipeline: ideate → brainstorm → plan → work
+
+## Scope Boundaries
+
+- ce:ideate does NOT produce requirements, plans, or code — it produces ranked ideas
+- ce:ideate does NOT modify ce:brainstorm's behavior — discovery of ce:ideate is handled through the skill description and catalog, not by altering other skills
+- The skill does not do external research (competitive analysis, similar projects) in v1 — this could be a future enhancement but adds cost and latency without proven need
+- No configurable depth modes in v1 — fixed volume with argument-based override is sufficient
+
+## Key Decisions
+
+- **Standalone skill, not a mode within ce:brainstorm**: The workflows are fundamentally different cognitive modes (proactive/divergent vs. reactive/convergent) with different phases, outputs, and success criteria. Combining them would make ce:brainstorm harder to maintain and blur its identity.
+- **Durable artifact in docs/ideation/**: Discarding ideation results is anti-compounding. The file is cheap to write and provides value when revisiting un-acted-on ideas or avoiding re-exploration of rejected ones.
+- **Artifact written after candidate review, not before initial presentation**: The first survivor presentation is collaborative review, not archival finalization. The artifact should be written only after the candidate set is good enough to preserve, but always before handoff, sharing, or session end.
+- **Always route to ce:brainstorm for follow-up**: At ideation depth, ideas are one-paragraph concepts — never detailed enough to skip requirements refinement.
+- **Survivors + rejection summary output format**: Full transparency on what was considered without overwhelming with detailed analysis of rejected ideas.
+- **Freeform optional argument**: A concept, a path, or nothing at all — the skill interprets whatever it gets as context. No artificial distinction between "focus area" and "target path."
+- **Agent intelligence as support, not replacement**: The value comes from the proven ideation-and-rejection mechanism. Parallel sub-agents help produce a richer candidate pool and stronger critique, but the orchestrator remains responsible for synthesis, scoring, and final ranking.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R3][Technical] Which research agents should always run for codebase grounding in v1 beyond `repo-research-analyst` and `learnings-researcher`, if any?
+- [Affects R21][Technical] What exact structured output schema should ideation sub-agents return so the orchestrator can merge and score consistently without overfitting the format too early?
+- [Affects R6][Technical] Should the structured analysis per surviving idea include "suggested next steps" or "what this would unlock" beyond the current fields (description, rationale, downsides, confidence, complexity)?
+- [Affects R2][Technical] How should the skill detect volume overrides in the freeform argument vs. focus-area hints? Simple heuristic or explicit parsing?
+
+## Next Steps
+
+→ `/ce:plan` for structured implementation planning
diff --git a/docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md b/docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md
new file mode 100644
index 0000000..9afc291
--- /dev/null
+++ b/docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md
@@ -0,0 +1,65 @@
+---
+date: 2026-03-16
+topic: issue-grounded-ideation
+---
+
+# Issue-Grounded Ideation Mode for ce:ideate
+
+## Problem Frame
+
+When a team wants to ideate on improvements, their issue tracker holds rich signal about real user pain, recurring failures, and severity patterns — but ce:ideate currently only looks at the codebase and past learnings. Teams have to manually synthesize issue patterns before ideating, or they ideate without that context and miss what their users are actually hitting.
+
+The goal is not "fix individual bugs" but "generate strategic improvement ideas grounded in the patterns your issue tracker reveals." 25 duplicate bugs about the same failure mode is a signal about collaboration reliability, not 25 separate problems.
+
+## Requirements
+
+- R1. When the user's argument indicates they want issue-tracker data as input (e.g., "bugs", "github issues", "open issues", "what users are reporting", "issue patterns"), ce:ideate activates an issue intelligence step alongside the existing Phase 1 scans
+- R2. A new **issue intelligence agent** fetches, clusters, deduplicates, and analyzes issues, returning structured theme analysis — not a list of individual issues
+- R3. The agent fetches **open issues** plus **recently closed issues** (approximately 30 days), filtering out issues closed as duplicate, won't-fix, or not-planned. Recently fixed issues are included because they show which areas had enough pain to warrant action.
+- R4. Issue clusters drive the ideation frames in Phase 2 using a **hybrid strategy**: derive frames from clusters, pad with default frames (e.g., "assumption-breaking", "leverage/compounding") when fewer than 4 clusters exist. This ensures ideas are grounded in real pain patterns while maintaining ideation diversity.
+- R5. The existing Phase 1 scans (codebase context + learnings search) still run in parallel — issue analysis is additive context, not a replacement
+- R6. The issue intelligence agent detects the repository from the current directory's git remote
+- R7. Start with GitHub issues via `gh` CLI. Design the agent prompt and output structure so Linear or other trackers can be added later without restructuring the ideation flow.
+- R8. The issue intelligence agent is independently useful outside of ce:ideate — it can be dispatched directly by a user or other workflows to summarize issue themes, understand the current landscape, or reason over recent activity. Its output should be self-contained, not coupled to ideation-specific context.
+- R9. The agent's output must communicate at the **theme level**, not the individual-issue level. Each theme should convey: what the pattern is, why it matters (user impact, severity, frequency, trend direction), and what it signals about the system. The output should help a human or agent fully understand the importance and shape of each theme without needing to read individual issues.
+
+## Success Criteria
+
+- Running `/ce:ideate bugs` on a repo with noisy/duplicate issues (like proof's 25+ LIVE_DOC_UNAVAILABLE variants) produces clustered themes, not a rehash of individual issues
+- Surviving ideas are strategic improvements ("invest in collaboration reliability infrastructure") not bug fixes ("fix LIVE_DOC_UNAVAILABLE")
+- The issue intelligence agent's output is structured enough that ideation sub-agents can engage with themes meaningfully
+- Ideation quality is at least as good as the default mode, with the added benefit of issue grounding
+
+## Scope Boundaries
+
+- GitHub issues only in v1 (Linear is a future extension)
+- No issue triage or management — this is read-only analysis for ideation input
+- No changes to Phase 3 (adversarial filtering) or Phase 4 (presentation) — only Phase 1 and Phase 2 frame derivation are affected
+- The issue intelligence agent is a new agent file, not a modification to an existing research agent
+- The agent is designed as a standalone capability that ce:ideate composes, not an ideation-internal module
+- Assumes `gh` CLI is available and authenticated in the environment
+- When a repo has too few issues to cluster meaningfully (e.g., < 5 open+recent), the agent should report that and ce:ideate should fall back to default ideation with a note to the user
+
+## Key Decisions
+
+- **Pattern-first, not issue-first**: The output is improvement ideas grounded in bug patterns, not a prioritized bug list. The ideation instructions already prevent "just fix bug #534" thinking.
+- **Hybrid frame strategy**: Clusters derive ideation frames, padded with defaults when thin. Pure cluster-derived frames risk too few frames; pure default frames risk ignoring the issue signal.
+- **Flexible argument detection**: Use intent-based parsing ("reasonable interpretation rather than formal parsing") consistent with the existing volume hint system. No rigid keyword matching.
+- **Open + recently closed**: Including recently fixed issues provides richer pattern data — shows which areas warranted action, not just what's currently broken.
+- **Additive to Phase 1**: Issue analysis runs as a third parallel agent alongside codebase scan and learnings search. All three feed the grounding summary.
+- **Titles + labels + sample bodies**: Read titles and labels for all issues (cheap), then read full bodies for 2-3 representative issues per emerging cluster. This handles both well-labeled repos (labels drive clustering, bodies confirm) and poorly-labeled repos (bodies drive clustering). Avoids reading all bodies which is expensive at scale.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R2][Technical] What structured output format should the issue intelligence agent return? Likely theme clusters with: theme name, issue count, severity distribution, representative issue titles, and a one-line synthesis.
+- [Affects R3][Technical] How to detect GitHub close reasons (completed vs not-planned vs duplicate) via `gh` CLI? May need `gh issue list --state closed --json stateReason` or label-based filtering.
+- [Affects R4][Technical] What's the threshold for "too few clusters"? Current thinking: pad with default frames when fewer than 4 clusters, but this may need tuning.
+- [Affects R6][Technical] How to extract the GitHub repo from git remote? Standard `gh repo view --json nameWithOwner` or parse the remote URL.
+- [Affects R7][Needs research] What would a Linear integration look like? Just swapping the fetch mechanism, or does Linear's project/cycle structure change the clustering approach?
+- [Affects R2][Technical] Exact number of sample bodies per cluster to read (starting point: 2-3 per cluster).
+
+## Next Steps
+
+→ `/ce:plan` for structured implementation planning
diff --git a/docs/brainstorms/2026-03-17-release-automation-requirements.md b/docs/brainstorms/2026-03-17-release-automation-requirements.md
new file mode 100644
index 0000000..6a2344e
--- /dev/null
+++ b/docs/brainstorms/2026-03-17-release-automation-requirements.md
@@ -0,0 +1,89 @@
+---
+date: 2026-03-17
+topic: release-automation
+---
+
+# Release Automation and Changelog Ownership
+
+## Problem Frame
+
+The repository currently has one automated release flow for the npm CLI, but the broader release story is split across CI, manual maintainer workflows, stale docs, and multiple version surfaces. That makes it hard to batch releases intentionally, hard for multiple maintainers to share release responsibility, and easy for changelogs, plugin manifests, and derived metadata like component counts to drift out of sync. The goal is to move to a release model that supports intentional batching, independent component versioning, centralized history, and CI-owned release authority without forcing version bumps for untouched plugins.
+
+## Requirements
+
+- R1. The release process must be manually triggered; merging to `main` must not automatically publish a release.
+- R2. The release system must support batching: releasable merges may accumulate on `main` until maintainers decide to cut a release.
+- R3. The release system must maintain a single release PR for the whole repo that stays open until merged and automatically accumulates additional releasable changes merged to `main`.
+- R4. The release system must support independent version bumps for these components: `cli`, `compound-engineering`, `coding-tutor`, and `marketplace`.
+- R5. The release system must not bump untouched plugins or unrelated components.
+- R6. The release system must preserve one centralized root `CHANGELOG.md` as the canonical changelog for the repository.
+- R7. The root changelog must record releases as top-level entries per component version, rather than requiring separate changelog files per plugin.
+- R8. Existing root changelog history must be preserved during the migration; the new release model must not discard or rewrite historical entries in a way that loses continuity.
+- R9. `plugins/compound-engineering/CHANGELOG.md` must no longer be treated as the canonical changelog after the migration.
+- R10. The release process must replace the current `release-docs` workflow; `release-docs` must no longer act as a release authority or required release step.
+- R11. Narrow scripts must replace `release-docs` responsibilities, including metadata synchronization, count calculation, docs generation where still needed, and validation.
+- R12. Release automation must be the sole authority for version bumps, changelog writes, and computed metadata updates such as counts of agents, skills, commands, or similar release-owned descriptions.
+- R13. The release flow must support a dry-run mode that summarizes what would happen without publishing, tagging, or committing release changes.
+- R14. Dry run output must clearly summarize which components would release, the proposed version bumps, the changelog entries that would be added, and any blocking validation failures.
+- R15. Marketplace version bumps must happen only for marketplace-level changes, such as marketplace metadata changes or adding/removing plugins from the catalog.
+- R16. Updating a plugin version alone must not require a marketplace version bump.
+- R17. Plugin-only content changes must be releasable without requiring a CLI version bump when the CLI code itself has not changed.
+- R18. The release model must remain compatible with the current install behavior where `bunx @every-env/compound-plugin install ...` runs the npm CLI but fetches named plugin content from the GitHub repository at runtime.
+- R19. The release process must be triggerable by a maintainer or an AI agent through CI without requiring a local maintainer-only skill.
+- R20. The resulting model must scale to future plugins without requiring the repo to special-case `compound-engineering` forever.
+- R21. The release model must continue to rely on conventional release intent signals (`feat`, `fix`, breaking changes, etc.), but component scopes in commit or PR titles must remain optional rather than required.
+- R22. Release automation must infer component ownership primarily from changed files, not from commit or PR title scopes alone.
+- R23. The repo should enforce parseable conventional PR or merge titles strongly enough for release tooling to classify change type, while avoiding mandatory component scoping on every change.
+- R24. The manual CI-driven release workflow must support explicit bump overrides for exceptional cases, at least `patch`, `minor`, and `major`, without requiring maintainers to create fake or empty commits purely to coerce a release.
+- R25. Bump overrides must be expressible per component rather than only as a repo-wide override.
+- R26. Dry run output must clearly show both the inferred bump and any applied manual override for each affected component.
+
+## Success Criteria
+
+- Maintainers can let multiple PRs merge to `main` without immediately cutting a release.
+- At any point, maintainers can inspect a release PR or dry run and understand what would ship next.
+- A change to `coding-tutor` does not force a version bump to `compound-engineering`.
+- A plugin version bump does not force a marketplace version bump unless marketplace-level files changed.
+- Release-owned metadata and counts stay in sync without relying on a local slash command.
+- The root changelog remains readable and continuous before and after the migration.
+
+## Scope Boundaries
+
+- This work does not require changing how Claude Code itself consumes plugin and marketplace versions.
+- This work does not require solving end-user auto-update discovery for non-Claude harnesses in v1.
+- This work does not require adding dedicated per-plugin changelog files as the canonical history model.
+- This work does not require immediate future automation of release timing; manual release remains the default.
+
+## Key Decisions
+
+- **Use `release-please` rather than a single release-line flow**: The repo now has multiple independently versioned components, and the release PR model matches the need to batch merges on `main` until a release is intentionally cut.
+- **One release PR for the whole repo**: Centralized release visibility matters more than separate PRs per component, and a single release PR can still carry multiple component bumps.
+- **Manual release timing**: The release process should prepare and accumulate the next release automatically, but the decision to cut that release should remain explicit.
+- **Root changelog stays canonical**: Centralized history is more important than per-plugin changelog isolation for the current repo shape.
+- **Top-level changelog entries per component version**: This preserves one changelog file while keeping independent component version history readable.
+- **Retire `release-docs`**: Its responsibilities are too broad, stale, and conflated. Release logic, docs logic, and metadata synchronization should be separated.
+- **Scripts for narrow responsibilities**: Explicit scripts are easier to validate, automate, and reuse from CI than a local repo-maintenance skill.
+- **Marketplace version is catalog-scoped**: Plugin version bumps alone should not imply a marketplace release.
+- **Conventional type required, component scope optional**: Release intent should still come from conventional commit semantics, but requiring `(compound-engineering)` on most repo changes would add unnecessary wording overhead. Component detection should remain file-driven.
+- **Manual bump override is an explicit escape hatch**: Automatic bump inference remains the default, but maintainers should be able to override a component's release level in CI for exceptional cases without awkward synthetic commits.
+
+## Dependencies / Assumptions
+
+- The current install flow for named plugins continues to fetch plugin content from GitHub at runtime, so plugin content releases can remain independent from CLI releases unless CLI behavior also changes.
+- Claude Code already respects marketplace and plugin versions, so those version surfaces remain meaningful release signals.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R3][Technical] Should the release PR be updated automatically on every push to `main`, or via a manually triggered maintenance workflow that refreshes the release PR state on demand?
+- [Affects R7][Technical] What exact root changelog format best balances readability and automation for multiple component-version entries in one file?
+- [Affects R11][Technical] Which responsibilities should become distinct scripts versus steps embedded directly in the CI workflow?
+- [Affects R12][Technical] Which release-owned metadata fields should be computed automatically versus validated and left untouched when no count change is needed?
+- [Affects R9][Technical] Should `plugins/compound-engineering/CHANGELOG.md` be deleted, frozen, or replaced with a short pointer note after the migration?
+- [Affects R21][Technical] Should conventional-format enforcement happen on PR titles, squash-merge titles, commits, or some combination of them?
+- [Affects R24][Technical] Should manual bump overrides be implemented as workflow inputs that shape the generated release PR directly, or as an internal generated release-control commit on the release branch only?
+
+## Next Steps
+
+→ `/ce:plan` for structured implementation planning
diff --git a/docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md b/docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md
new file mode 100644
index 0000000..3a03dad
--- /dev/null
+++ b/docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md
@@ -0,0 +1,50 @@
+---
+date: 2026-03-18
+topic: auto-memory-integration
+---
+
+# Auto Memory Integration for ce:compound and ce:compound-refresh
+
+## Problem Frame
+
+Claude Code's Auto Memory feature passively captures debugging insights, fix patterns, and preferences across sessions in `~/.claude/projects//memory/`. The ce:compound and ce:compound-refresh skills currently don't leverage this data source, even though it contains exactly the kind of raw material these workflows need: notes about problems solved, approaches tried, and patterns discovered.
+
+After long sessions or compaction, auto memory may preserve insights that conversation context has lost. For ce:compound-refresh, auto memory may contain newer observations that signal drift in existing docs/solutions/ learnings without anyone explicitly flagging it.
+
+## Requirements
+
+- R1. **ce:compound uses auto memory as supplementary evidence.** The orchestrator reads MEMORY.md before launching Phase 1 subagents, scans for entries related to the problem being documented, and passes relevant memory content as additional context to the Context Analyzer and Solution Extractor subagents. Those subagents treat memory notes as supplementary evidence alongside conversation history.
+- R2. **ce:compound-refresh investigation subagents check auto memory.** When investigating a candidate learning's staleness, investigation subagents also check auto memory for notes in the same problem domain. A memory note describing a different approach than what the learning recommends is treated as a drift signal.
+- R3. **Graceful absence handling.** If auto memory doesn't exist for the project (no memory directory or empty MEMORY.md), all skills proceed exactly as they do today with no errors or warnings.
+
+## Success Criteria
+
+- ce:compound produces richer documentation when auto memory contains relevant notes about the fix, especially after sessions involving compaction
+- ce:compound-refresh surfaces staleness signals that would otherwise require manual discovery
+- No regression when auto memory is absent or empty
+
+## Scope Boundaries
+
+- **Not changing auto memory's output location or format** -- these skills consume it as-is
+- **Read-only** -- neither skill writes to auto memory; ce:compound writes to docs/solutions/ (team-shared, structured), which serves a different purpose than machine-local auto memory
+- **Not adding a new subagent** -- existing subagents are augmented with memory-checking instructions
+- **Not changing the structure of docs/solutions/ output** -- the final artifacts are the same
+
+## Dependencies / Assumptions
+
+- Claude knows its auto memory directory path from the system prompt context in every session -- no path discovery logic needed in the skills
+
+## Key Decisions
+
+- **Augment existing subagents, not a new one**: ce:compound-refresh investigation subagents need memory context during their own investigation (not as a separate report), so a dedicated Memory Scanner subagent would be awkward. For ce:compound, the orchestrator pre-reads MEMORY.md once and passes relevant excerpts to subagents, avoiding redundant reads while keeping the same subagent count.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R1][Technical] How should the orchestrator determine which MEMORY.md entries are "related" to the current problem? Keyword matching against the problem description, or broader heuristic?
+- [Affects R2][Technical] Should ce:compound-refresh investigation subagents read the full MEMORY.md or only topic files matching the learning's domain? The 200-line MEMORY.md is small enough to read in full, but topic files may be more targeted.
+
+## Next Steps
+
+-> `/ce:plan` for structured implementation planning
diff --git a/docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md b/docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md
new file mode 100644
index 0000000..4d1d094
--- /dev/null
+++ b/docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md
@@ -0,0 +1,187 @@
+# Frontend Design Skill Improvement
+
+**Date:** 2026-03-22
+**Status:** Design approved, pending implementation plan
+**Scope:** Rewrite `frontend-design` skill + surgical addition to `ce:work-beta`
+
+## Context
+
+The current `frontend-design` skill (43 lines) is a brief aesthetic manifesto forked from the Anthropic official skill. It emphasizes bold design and avoiding AI slop but lacks practical structure, concrete constraints, context-specific guidance, and any verification mechanism.
+
+Two external sources informed this redesign:
+- **Anthropic's official frontend-design skill** -- nearly identical to ours, same gaps
+- **OpenAI's frontend skill** (from their "Designing Delightful Frontends with GPT-5.4" article, March 2026) -- dramatically more comprehensive with composition rules, context modules, card philosophy, copy guidelines, motion specifics, and litmus checks
+
+Additionally, the beta workflow (`ce:plan-beta` -> `deepen-plan-beta` -> `ce:work-beta`) has no mechanism to invoke the frontend-design skill. The old `deepen-plan` discovered and applied it dynamically; `deepen-plan-beta` uses deterministic agent mapping and skips skill discovery entirely. The skill is effectively orphaned in the beta workflow.
+
+## Design Decisions
+
+### Authority Hierarchy
+
+Every rule in the skill is a default, not a mandate:
+1. **Existing design system / codebase patterns** -- highest priority, always respected
+2. **User's explicit instructions** -- override skill defaults
+3. **Skill defaults** -- only fully apply in greenfield or when user asks for design guidance
+
+This addresses a key weakness in OpenAI's approach: their rules read as absolutes ("No cards by default", "Full-bleed hero only") without escape hatches. Users who want cards in the hero shouldn't fight their own tooling.
+
+### Layered Architecture
+
+The skill is structured as layers:
+
+- **Layer 0: Context Detection** -- examine codebase for existing design signals before doing anything. Short-circuits opinionated guidance when established patterns exist.
+- **Layer 1: Pre-Build Planning** -- visual thesis + content plan + interaction plan (3 short statements). Adapts to greenfield vs existing codebase.
+- **Layer 2: Design Guidance Core** -- always-applicable principles (typography, color, composition, motion, accessibility, imagery). All yield to existing systems.
+- **Context Modules** -- agent selects one based on what's being built:
+ - Module A: Landing pages & marketing (greenfield)
+ - Module B: Apps & dashboards (greenfield)
+ - Module C: Components & features (default when working inside an existing app, regardless of what's being built)
+
+### Layer 0: Detection Signals (Concrete Checklist)
+
+The agent looks for these specific signals when classifying the codebase:
+
+- **Design tokens / CSS variables**: `--color-*`, `--spacing-*`, `--font-*` custom properties, theme files
+- **Component libraries**: shadcn/ui, Material UI, Chakra, Ant Design, Radix, or project-specific component directories
+- **CSS frameworks**: `tailwind.config.*`, `styled-components` theme, Bootstrap imports, CSS modules with consistent naming
+- **Typography**: Font imports in HTML/CSS, `@font-face` declarations, Google Fonts links
+- **Color palette**: Defined color scales, brand color files, design token exports
+- **Animation libraries**: Framer Motion, GSAP, anime.js, Motion One, Vue Transition imports
+- **Spacing / layout patterns**: Consistent spacing scale usage, grid systems, layout components
+
+**Mode classification:**
+- **Existing system**: 4+ signals detected across multiple categories. Defer to it.
+- **Partial system**: 1-3 signals detected. Apply skill defaults where no convention was detected; yield to detected conventions where they exist.
+- **Greenfield**: No signals detected. Full skill guidance applies.
+- **Ambiguous**: Signals are contradictory or unclear. Ask the user.
+
+### Interaction Method for User Questions
+
+When Layer 0 needs to ask the user (ambiguous detection), use the platform's blocking question tool:
+- Claude Code: `AskUserQuestion`
+- Codex: `request_user_input`
+- Gemini CLI: `ask_user`
+- Fallback: If no question tool is available, assume "partial" mode and proceed conservatively.
+
+### Where We Improve Beyond OpenAI
+
+1. **Accessibility as a first-class concern** -- OpenAI's skill is pure aesthetics. We include semantic HTML, contrast ratios, focus states as peers of typography and color.
+
+2. **Existing codebase integration** -- OpenAI has one exception line buried in the rules. We make context detection the first step and add Module C specifically for "adding a feature to an existing app" -- the most common real-world case that both OpenAI and Anthropic ignore entirely.
+
+3. **Defaults with escape hatches** -- Two-tier anti-pattern system: "default against" (overridable preferences) vs "always avoid" (genuine quality failures). OpenAI mixes these in a flat list.
+
+4. **Framework-aware animation defaults** -- OpenAI assumes Framer Motion. We detect existing animation libraries first. When no existing library is found, the default is framework-conditional: CSS animations as the universal baseline, Framer Motion for React, Vue Transition / Motion One for Vue, Svelte transitions for Svelte.
+
+5. **Visual self-verification** -- Neither OpenAI nor Anthropic have any verification. We add a browser-based screenshot + assessment step with a tool preference cascade:
+ 1. Existing project browser tooling (Playwright, Puppeteer, etc.)
+ 2. Browser MCP tools (claude-in-chrome, etc.)
+ 3. agent-browser CLI (default when nothing else exists -- load the `agent-browser` skill for setup)
+ 4. Mental review against litmus checks (last resort)
+
+6. **Responsive guidance** -- kept light (trust smart models) but present, unlike OpenAI's single mention.
+
+7. **Performance awareness** -- careful balance, noting that heavy animations and multiple font imports have costs, without being prescriptive about specific thresholds.
+
+8. **Copy guidance without arbitrary thresholds** -- OpenAI says "if deleting 30% of the copy improves the page, keep deleting." We use: "Every sentence should earn its place. Default to less copy, not more."
+
+### Scope Control on Verification
+
+Visual verification is a sanity check, not a pixel-perfect review. One pass. If there's a glaring issue, fix it. If it looks solid, move on. The goal is catching "this clearly doesn't work" before the user sees it.
+
+### ce:work-beta Integration
+
+A small addition to Phase 2 (Execute), after the existing Figma Design Sync section:
+
+**UI task detection heuristic:** A task is a "UI task" if any of these are true:
+- The task's implementation files include view, template, component, layout, or page files
+- The task creates new user-visible routes or pages
+- The plan text contains explicit "UI", "frontend", "design", "layout", or "styling" language
+- The task references building or modifying something the user will see in a browser
+
+The agent uses judgment -- these are heuristics, not a rigid classifier.
+
+**What ce:work-beta adds:**
+
+> For UI tasks without a Figma design, load the `frontend-design` skill before implementing. Follow its detection, guidance, and verification flow.
+
+This is intentionally minimal:
+- Doesn't duplicate skill content into ce:work-beta
+- Doesn't load the skill for non-UI tasks
+- Doesn't load the skill when Figma designs exist (Figma sync covers that)
+- Doesn't change any other phase
+
+**Verification screenshot reuse:** The frontend-design skill's visual verification screenshot satisfies ce:work-beta Phase 4's screenshot requirement. The agent does not need to screenshot twice -- the skill's verification output is reused for the PR.
+
+**Relationship to design-iterator agent:** The frontend-design skill's verification is a single sanity-check pass. For iterative refinement beyond that (multiple rounds of screenshot-assess-fix), see the `design-iterator` agent. The skill does not invoke design-iterator automatically.
+
+## Files Changed
+
+| File | Change |
+|------|--------|
+| `plugins/compound-engineering/skills/frontend-design/SKILL.md` | Full rewrite |
+| `plugins/compound-engineering/skills/ce-work-beta/SKILL.md` | Add ~5 lines to Phase 2 |
+
+## Skill Description (Optimized)
+
+```yaml
+name: frontend-design
+description: Build web interfaces with genuine design quality, not AI slop. Use for
+ any frontend work: landing pages, web apps, dashboards, admin panels, components,
+ interactive experiences. Activates for both greenfield builds and modifications to
+ existing applications. Detects existing design systems and respects them. Covers
+ composition, typography, color, motion, and copy. Verifies results via screenshots
+ before declaring done.
+```
+
+## Skill Structure (frontend-design/SKILL.md)
+
+```
+Frontmatter (name, description)
+Preamble (what, authority hierarchy, workflow preview)
+Layer 0: Context Detection
+ - Detect existing design signals
+ - Choose mode: existing / partial / greenfield
+ - Ask user if ambiguous
+Layer 1: Pre-Build Planning
+ - Visual thesis (one sentence)
+ - Content plan (what goes where)
+ - Interaction plan (2-3 motion ideas)
+Layer 2: Design Guidance Core
+ - Typography (2 typefaces max, distinctive choices, yields to existing)
+ - Color & Theme (CSS variables, one accent, no purple bias, yields to existing)
+ - Composition (poster mindset, cardless default, whitespace before chrome)
+ - Motion (2-3 intentional motions, use existing library, framework-conditional defaults)
+ - Accessibility (semantic HTML, WCAG AA contrast, focus states)
+ - Imagery (real photos, stable tonal areas, image generation when available)
+Context Modules (select one)
+ - A: Landing Pages & Marketing (greenfield -- hero rules, section sequence, copy as product language)
+ - B: Apps & Dashboards (greenfield -- calm surfaces, utility copy, minimal chrome)
+ - C: Components & Features (default in existing apps -- match existing, inherit tokens, focus on states)
+Hard Rules & Anti-Patterns
+ - Default against (overridable): generic card grids, purple bias, overused fonts, etc.
+ - Always avoid (quality floor): prompt language in UI, broken contrast, missing focus states
+Litmus Checks
+ - Context-sensitive self-review questions
+Visual Verification
+ - Tool cascade: existing > MCP > agent-browser > mental review
+ - One iteration, sanity check scope
+ - Include screenshot in deliverable
+```
+
+## What We Keep From Current Skill
+
+- Strong anti-AI-slop identity and messaging
+- Creative energy / encouragement to be bold in greenfield work
+- Tone-picking exercise (brutally minimal, maximalist chaos, retro-futuristic...)
+- "Differentiation" prompt: what makes this unforgettable?
+- Framework-agnostic approach (HTML/CSS/JS, React, Vue, etc.)
+
+## Cross-Agent Compatibility
+
+Per AGENTS.md rules:
+- Describe tools by capability class with platform hints, not Claude-specific names alone
+- Use platform-agnostic question patterns (name known equivalents + fallback)
+- No shell recipes for routine exploration
+- Reference co-located scripts with relative paths
+- Skill is written once, copied as-is to other platforms
diff --git a/docs/brainstorms/2026-03-23-plan-review-personas-requirements.md b/docs/brainstorms/2026-03-23-plan-review-personas-requirements.md
new file mode 100644
index 0000000..af255b2
--- /dev/null
+++ b/docs/brainstorms/2026-03-23-plan-review-personas-requirements.md
@@ -0,0 +1,84 @@
+---
+date: 2026-03-23
+topic: plan-review-personas
+---
+
+# Persona-Based Plan Review for document-review
+
+## Problem Frame
+
+The `document-review` skill currently uses a single-voice evaluator with five generic criteria (Clarity, Completeness, Specificity, Appropriate Level, YAGNI). This catches surface-level issues but misses role-specific concerns: a security engineer, product leader, and design reviewer each see different problems in the same plan. The ce:review skill already demonstrates that multi-persona review produces richer, more actionable feedback for code. The same architecture should apply to plan review.
+
+## Requirements
+
+- R1. Replace the current single-voice `document-review` with a persona pipeline that dispatches specialized reviewer agents in parallel against the target document.
+
+- R2. Implement 2 always-on personas that run on every document review:
+ - **coherence**: Internal consistency, contradictions, terminology drift, structural issues, ambiguity. Checks whether readers would diverge on interpretation.
+ - **feasibility**: Can this actually be built? Architecture decisions, external dependencies, performance requirements, migration strategies. Absorbs the "tech-plan implementability" angle (can an implementer code from this?).
+
+- R3. Implement 4 conditional personas that activate based on document content analysis:
+ - **product-lens**: Activates when the document contains user-facing features, market claims, scope decisions, or prioritization. Opens with a "premise challenge" -- 3 diagnostic questions that challenge whether the plan solves the right problem. Asks: "What's the 10-star version? What's the narrowest wedge that proves demand?"
+ - **design-lens**: Activates when the document contains UI/UX work, frontend changes, or user flows. Uses a "rate 0-10 and describe what 10 looks like" dimensional rating method. Rates design dimensions concretely, identifies what "great" looks like for each.
+ - **security-lens**: Activates when the document contains auth, data handling, external APIs, or payments. Evaluates threat model at the plan level, not code level. Surfaces what the plan fails to account for.
+ - **scope-guardian**: Activates when the document contains multiple priority levels, unclear boundaries, or goals that don't align with requirements. Absorbs the "skeptic" angle -- challenges unnecessary complexity, premature abstractions, and frameworks ahead of need. Opens with a "what already exists?" check against the codebase.
+
+- R4. The skill auto-detects which conditional personas are relevant by analyzing the document content. No user configuration required for persona selection.
+
+- R5. Hybrid action model after persona findings are synthesized:
+ - **Auto-fix**: Document quality issues (contradictions, terminology drift, structural problems, missing details that can be inferred). These are unambiguously improvements.
+ - **Present for user decision**: Strategic/product questions (problem framing, scope challenges, priority conflicts, "is this the right thing to build?"). These require human judgment.
+
+- R6. Each persona returns structured findings with confidence scores. The orchestrator deduplicates overlapping findings across personas and synthesizes into a single prioritized report.
+
+- R7. Maintain backward compatibility with all existing callers:
+ - `ce-brainstorm` Phase 4 "Review and refine" option
+ - `ce-plan` / `ce-plan-beta` post-generation "Review and refine" option
+ - `deepen-plan-beta` post-deepening "Review and refine" option
+ - Standalone invocation
+ - Returns "Review complete" when done, as callers expect
+
+- R8. Pipeline-compatible: When called from automated pipelines (e.g., future lfg/slfg integration), auto-fixes run silently and only genuinely blocking strategic questions surface to the user.
+
+## Success Criteria
+
+- Running document-review on a plan surfaces role-specific issues that the current single-voice evaluator misses (e.g., security gaps, product framing problems, scope concerns).
+- Conditional personas activate only when relevant -- a backend refactor plan does not spawn design-lens.
+- Auto-fix changes improve the document without requiring user approval for every edit.
+- Strategic findings are presented as clear questions, not vague observations.
+- All existing callers (brainstorm, plan, plan-beta, deepen-plan-beta) work without modification.
+
+## Scope Boundaries
+
+- Not adding new callers or pipeline integrations beyond maintaining existing ones.
+- Not changing how deepen-plan-beta works (it strengthens with research; document-review reviews for issues).
+- Not adding user configuration for persona selection (auto-detection only for now).
+- Not inventing new review frameworks -- incorporating established review patterns (premise challenge, dimensional rating, existing-code check) into the respective personas.
+
+## Key Decisions
+
+- **Replace, don't layer**: document-review is fully replaced by the persona pipeline, not enhanced with an optional mode. Simpler mental model, one behavior.
+- **2 always-on + 4 conditional**: Coherence and feasibility run on every document. Product-lens, design-lens, security-lens, and scope-guardian activate based on content. Keeps cost proportional to document complexity.
+- **Hybrid action model**: Auto-fix document quality issues, present strategic questions. Matches the natural split between what personas surface.
+- **Absorb skeptic into scope-guardian**: Both challenge whether the plan is right-sized. One persona with both angles avoids redundancy.
+- **Absorb tech-plan implementability into feasibility**: Both ask "can this work?" One persona with both angles.
+- **Review patterns as persona behavior, not separate mechanisms**: Premise challenge goes into product-lens, dimensional rating goes into design-lens, existing-code check goes into scope-guardian.
+
+## Dependencies / Assumptions
+
+- Assumes the ce:review agent orchestration pattern (parallel dispatch, synthesis, dedup) can be adapted for plan review without fundamental changes.
+- Assumes plan/requirements documents are text-based and contain enough signal for content-based conditional persona selection.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R6][Technical] What is the exact structured output format for persona findings? Should it mirror ce:review's P1/P2/P3 severity model or use a different classification?
+- [Affects R4][Needs research] What content signals reliably detect each conditional persona's relevance? Need to define the heuristics (keyword-based, section-based, or semantic).
+- [Affects R1][Technical] Should personas be implemented as compound-engineering agents (like code review agents) or as inline prompt sections within the skill? Agents enable parallel dispatch; inline is simpler.
+- [Affects R5][Technical] How should the auto-fix mechanism work -- direct inline edits like current document-review, or a separate "apply fixes" pass after synthesis?
+- [Affects R7][Technical] Do any of the 4 existing callers need minor updates to handle the new output format, or is the "Review complete" contract sufficient?
+
+## Next Steps
+
+-> /ce:plan for structured implementation planning
diff --git a/docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md b/docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md
new file mode 100644
index 0000000..0594edb
--- /dev/null
+++ b/docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md
@@ -0,0 +1,58 @@
+---
+date: 2026-03-24
+topic: todo-path-consolidation
+---
+
+# Consolidate Todo Storage Under `.context/compound-engineering/todos/`
+
+## Problem Frame
+
+The file-based todo system currently stores todos in a top-level `todos/` directory. The plugin has standardized on `.context/compound-engineering/` as the consolidated namespace for CE workflow artifacts (scratch space, run artifacts, etc.). Todos should live there too for consistent organization. PR #345 is already adding the `.gitignore` check for `.context/`.
+
+## Requirements
+
+- R1. All skills that **create** todos must write to `.context/compound-engineering/todos/` instead of `todos/`.
+- R2. All skills that **read** todos must check both `.context/compound-engineering/todos/` and legacy `todos/` to support natural drain of existing items.
+- R3. All skills that **modify or delete** todos must operate on files in-place (wherever the file currently lives).
+- R4. No active migration logic -- existing `todos/` files are resolved and cleaned up through normal workflow usage.
+- R5. Skills that create or manage todos should reference the `file-todos` skill as the authority rather than encoding todo paths/conventions inline. This reduces scattered implementations and makes the path change a single-point update.
+
+## Affected Skills
+
+| Skill | Changes needed |
+|-------|---------------|
+| `file-todos` | Update canonical path, template copy target, all example commands. Add legacy read path. |
+| `resolve-todo-parallel` | Read from both paths, resolve/delete in-place. |
+| `triage` | Read from both paths, delete in-place. |
+| `ce-review` | Replace inline `todos/` paths with delegation to `file-todos` skill. |
+| `ce-review-beta` | Replace inline `todos/` paths with delegation to `file-todos` skill. |
+| `test-browser` | Replace inline `todos/` path with delegation to `file-todos` skill. |
+| `test-xcode` | Replace inline `todos/` path with delegation to `file-todos` skill. |
+
+## Scope Boundaries
+
+- No active file migration (move/copy) of existing todos.
+- No changes to todo file format, naming conventions, or template structure.
+- No removal of legacy `todos/` read support in this change -- that can be cleaned up later once confirmed drained.
+
+## Key Decisions
+
+- **Drain naturally over active migration**: Avoids migration logic, dead code, and conflicts with in-flight branches. Old todos resolve through normal usage.
+
+## Success Criteria
+
+- New todos created by any skill land in `.context/compound-engineering/todos/`.
+- Existing todos in `todos/` are still found and resolvable.
+- No skill references only the old `todos/` path for reads.
+- Skills that create todos delegate to `file-todos` rather than encoding paths inline.
+
+## Outstanding Questions
+
+### Deferred to Planning
+
+- [Affects R2][Technical] Determine the cleanest way to express dual-path reads in `file-todos` example commands (glob both paths vs. a helper pattern).
+- [Affects R2][Needs research] Decide whether to add a follow-up task to remove legacy `todos/` read support after a grace period.
+
+## Next Steps
+
+-> `/ce:plan` for structured implementation planning
diff --git a/docs/plans/2026-03-15-001-feat-ce-ideate-skill-plan.md b/docs/plans/2026-03-15-001-feat-ce-ideate-skill-plan.md
new file mode 100644
index 0000000..59edc49
--- /dev/null
+++ b/docs/plans/2026-03-15-001-feat-ce-ideate-skill-plan.md
@@ -0,0 +1,387 @@
+---
+title: "feat: Add ce:ideate open-ended ideation skill"
+type: feat
+status: completed
+date: 2026-03-15
+origin: docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md
+deepened: 2026-03-16
+---
+
+# feat: Add ce:ideate open-ended ideation skill
+
+## Overview
+
+Add a new `ce:ideate` skill to the compound-engineering plugin that performs open-ended, divergent-then-convergent idea generation for any project. The skill deeply scans the codebase, generates ~30 ideas, self-critiques and filters them, and presents the top 5-7 as a ranked list with structured analysis. It uses agent intelligence to improve the candidate pool without replacing the core prompt mechanism, writes a durable artifact to `docs/ideation/` after the survivors have been reviewed, and hands off selected ideas to `ce:brainstorm`.
+
+## Problem Frame
+
+The ce:* workflow pipeline has a gap at the very beginning. `ce:brainstorm` requires the user to bring an idea — it refines but doesn't generate. Users who want the AI to proactively suggest improvements must resort to ad-hoc prompting, which lacks codebase grounding, structured output, durable artifacts, and pipeline integration. (see origin: docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md)
+
+## Requirements Trace
+
+- R1. Standalone skill in `plugins/compound-engineering/skills/ce-ideate/`
+- R2. Optional freeform argument as focus hint (concept, path, constraint, or empty)
+- R3. Deep codebase scan via research agents before generating ideas
+- R4. Preserve the proven prompt mechanism: many ideas first, then brutal filtering, then detailed survivors
+- R5. Self-critique with explicit rejection reasoning
+- R6. Present top 5-7 with structured analysis (description, rationale, downsides, confidence 0-100%, complexity)
+- R7. Rejection summary (one-line per rejected idea)
+- R8. Durable artifact in `docs/ideation/YYYY-MM-DD--ideation.md`
+- R9. Volume overridable via argument
+- R10. Handoff: brainstorm an idea, refine, share to Proof, or end session
+- R11. Always route to ce:brainstorm for follow-up on selected ideas
+- R12. Offer commit on session end
+- R13. Resume from existing ideation docs (30-day recency window)
+- R14. Present survivors before writing the durable artifact
+- R15. Write artifact before handoff/share/end
+- R16. Update doc in place on refine when preserving refined state
+- R17. Use agent intelligence as support for the core mechanism, not a replacement
+- R18. Use research agents for grounding; ideation/critique sub-agents are prompt-defined roles
+- R19. Pass grounding summary, focus hint, and volume target to ideation sub-agents
+- R20. Focus hints influence both generation and filtering
+- R21. Use standardized structured outputs from ideation sub-agents
+- R22. Orchestrator owns final scoring, ranking, and survivor decisions
+- R23. Use broad prompt-framing methods to encourage creative spread without over-constraining ideation
+- R24. Use the smallest useful set of sub-agents rather than a hardcoded fixed count
+- R25. Mark ideas as "explored" when brainstormed
+
+## Scope Boundaries
+
+- No external research (competitive analysis, similar projects) in v1 (see origin)
+- No configurable depth modes — fixed volume with argument-based override (see origin)
+- No modifications to ce:brainstorm — discovery via skill description only (see origin)
+- No deprecated `workflows:ideate` alias — the `workflows:*` prefix is deprecated
+- No `references/` split — estimated skill length ~300 lines, well under the 500-line threshold
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `plugins/compound-engineering/skills/ce-brainstorm/SKILL.md` — Closest sibling. Mirror: resume behavior (Phase 0.1), artifact frontmatter (date + topic), handoff options via platform question tool, document-review integration, Proof sharing
+- `plugins/compound-engineering/skills/ce-plan/SKILL.md` — Agent dispatch pattern: `Task compound-engineering:research:repo-research-analyst(context)` running in parallel. Phase 0.2 upstream document detection
+- `plugins/compound-engineering/skills/ce-work/SKILL.md` — Session completion: incremental commit pattern, staging specific files, conventional commit format
+- `plugins/compound-engineering/skills/ce-compound/SKILL.md` — Parallel research assembly: subagents return text only, orchestrator writes the single file
+- `plugins/compound-engineering/skills/document-review/SKILL.md` — Utility invocation: "Load the `document-review` skill and apply it to..." Returns "Review complete" signal
+- `plugins/compound-engineering/skills/deepen-plan/SKILL.md` — Broad parallel agent dispatch pattern
+- PR #277 (`fix: codex workflow conversion for compound-engineering`) — establishes the Codex model for canonical `ce:*` workflows: prompt wrappers for canonical entrypoints, transformed intra-workflow handoffs, and omission of deprecated `workflows:*` aliases
+
+### Institutional Learnings
+
+- `docs/solutions/plugin-versioning-requirements.md` — Do not bump versions or cut changelog entries in feature PRs. Do update README counts and plugin.json descriptions.
+- `docs/solutions/codex-skill-prompt-entrypoints.md` (from PR #277) — for compound-engineering workflows in Codex, prompts are the canonical user-facing entrypoints and copied skills are the reusable implementation units underneath them
+
+## Key Technical Decisions
+
+- **Agent dispatch for codebase scan**: Use `repo-research-analyst` + `learnings-researcher` in parallel (matches ce:plan Phase 1.1). Skip `git-history-analyzer` by default — marginal ideation value for the cost. The focus hint (R2) is passed as context to both agents.
+- **Core mechanism first, agents second**: The core design is still the user's proven prompt pattern: generate many ideas, reject aggressively, then explain only the survivors. Agent intelligence improves the candidate pool and critique quality, but does not replace this mechanism.
+- **Prompt-defined ideation and critique sub-agents**: Use prompt-shaped sub-agents with distinct framing methods for ideation and optional skeptical critique, rather than forcing reuse of existing named review agents whose purpose is different.
+- **Orchestrator-owned synthesis and scoring**: The orchestrator merges and dedupes sub-agent outputs, applies one consistent rubric, and decides final scoring/ranking. Sub-agents may emit lightweight local signals, but not authoritative final rankings.
+- **Artifact frontmatter**: `date`, `topic`, `focus` (optional). Minimal, paralleling the brainstorm `date` + `topic` pattern.
+- **Volume override via natural language**: The skill instructions tell Claude to interpret number patterns in the argument ("top 3", "100 ideas") as volume overrides. No formal parsing.
+- **Artifact timing**: Present survivors first, allow brief questions or lightweight clarification, then write/update the durable artifact before any handoff, Proof share, or session end.
+- **No `disable-model-invocation`**: The skill should be auto-loadable when users say things like "what should I improve?", "give me ideas for this project", "ideate on improvements". Following the same pattern as ce:brainstorm.
+- **Commit pattern**: Stage only `docs/ideation/`, use conventional format `docs: add ideation for `, offer but don't force.
+- **Relationship to PR #277**: `ce:ideate` must follow the same Codex workflow model as the other canonical `ce:*` workflows. Why: without #277's prompt-wrapper and handoff-rewrite model, a copied workflow skill can still point at Claude-style slash handoffs that do not exist coherently in Codex. `ce:ideate` should be introduced as another canonical `ce:*` workflow on that same surface, not as a one-off pass-through skill.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Which agents for codebase scan?** → `repo-research-analyst` + `learnings-researcher`. Rationale: same proven pattern as ce:plan, covers both current code and institutional knowledge.
+- **Additional analysis fields per idea?** → Keep as specified in R6. "What this unlocks" bleeds into brainstorm scope. YAGNI.
+- **Volume override detection?** → Natural language interpretation. The skill instructions describe how to detect overrides. No formal parsing needed.
+- **Artifact frontmatter fields?** → `date`, `topic`, `focus` (optional). Follows brainstorm pattern.
+- **Need references/ split?** → No. Estimated ~300 lines, under the 500-line threshold.
+- **Need deprecated alias?** → No. `workflows:*` is deprecated; new skills go straight to `ce:*`.
+- **How should docs regeneration be represented in the plan?** → The checked-in tree does not currently contain the previously assumed generated files (`docs/index.html`, `docs/pages/skills.html`). Treat `/release-docs` as a repo-maintenance validation step that may update tracked generated artifacts, not as a guaranteed edit to predetermined file paths.
+- **How should skill counts be validated across artifacts?** → Do not force one unified count across every surface. The plugin manifests should reflect parser-discovered skill directories, while `plugins/compound-engineering/README.md` should preserve its human-facing taxonomy of workflow commands vs. standalone skills.
+- **What is the dependency on PR #277?** → Treat #277 as an upstream prerequisite for Codex correctness. If it merges first, `ce:ideate` should slot into its canonical `ce:*` workflow model. If it does not merge first, equivalent Codex workflow behavior must be included before `ce:ideate` is considered complete.
+- **How should agent intelligence be applied?** → Research agents are used for grounding, prompt-defined sub-agents are used to widen the candidate pool and critique it, and the orchestrator remains the final judge.
+- **Who should score the ideas?** → The orchestrator, not the ideation sub-agents and not a separate scoring sub-agent by default.
+- **When should the artifact be written?** → After the survivors are presented and reviewed enough to preserve, but always before handoff, sharing, or session end.
+
+### Deferred to Implementation
+
+- **Exact wording of the divergent ideation prompt section**: The plan specifies the structure and mechanisms, but the precise phrasing will be refined during implementation. This is an inherently iterative design element.
+- **Exact wording of the self-critique instructions**: Same — structure is defined, exact prose is implementation-time.
+
+## Implementation Units
+
+- [x] **Unit 1: Create the ce:ideate SKILL.md**
+
+**Goal:** Write the complete skill definition with all phases, the ideation prompt structure, optional sub-agent support, artifact template, and handoff options.
+
+**Requirements:** R1-R25 (all requirements — this is the core deliverable)
+
+**Dependencies:** None
+
+**Files:**
+- Create: `plugins/compound-engineering/skills/ce-ideate/SKILL.md`
+- Test (conditional): `tests/claude-parser.test.ts`, `tests/cli.test.ts`
+
+**Approach:**
+
+- Keep this unit primarily content-only unless implementation discovers a real parser or packaging gap. `loadClaudePlugin()` already discovers any `skills/*/SKILL.md`, and most target converters/writers already pass `plugin.skills` through as `skillDirs`.
+- Do not rely on pure pass-through for Codex. Because PR #277 gives compound-engineering `ce:*` workflows a canonical prompt-wrapper model in Codex, `ce:ideate` must be validated against that model and may require Codex-target updates if #277 is not already present.
+- Treat artifact lifecycle rules as part of the skill contract, not polish: resume detection, present-before-write, refine-in-place, and brainstorm handoff state all live inside this SKILL.md and must be internally consistent.
+- Keep the prompt sections grounded in Phase 1 findings so ideation quality does not collapse into generic product advice.
+- Keep the user's original prompt mechanism as the backbone of the workflow. Extra agent structure should strengthen that mechanism rather than replacing it.
+- When sub-agents are used, keep them prompt-defined and lightweight: shared grounding/focus/volume input, structured output, orchestrator-owned merge/dedupe/scoring.
+
+The skill follows the ce:brainstorm phase structure but with fundamentally different phases:
+
+```
+Phase 0: Resume and Route
+ 0.1 Check docs/ideation/ for recent ideation docs (R13)
+ 0.2 Parse argument — extract focus hint and any volume override (R2, R9)
+ 0.3 If no argument, proceed with fully open ideation (no blocking ask)
+
+Phase 1: Codebase Scan
+ 1.1 Dispatch research agents in parallel (R3):
+ - Task compound-engineering:research:repo-research-analyst(focus context)
+ - Task compound-engineering:research:learnings-researcher(focus context)
+ 1.2 Consolidate scan results into a codebase understanding summary
+
+Phase 2: Divergent Generation (R4, R17-R21, R23-R24)
+ Core ideation instructions tell Claude to:
+ - Generate ~30 ideas (or override amount) as a numbered list
+ - Each idea is a one-liner at this stage
+ - Push past obvious suggestions — the first 10-15 will be safe/obvious,
+ the interesting ones come after
+ - Ground every idea in specific codebase findings from Phase 1
+ - Ideas should span multiple dimensions where justified
+ - If a focus area was provided, weight toward it but don't exclude
+ other strong ideas
+ - Preserve the user's original many-ideas-first mechanism
+ Optional sub-agent support:
+ - If the platform supports it, dispatch a small useful set of ideation
+ sub-agents with the same grounding summary, focus hint, and volume target
+ - Give each one a distinct prompt framing method (e.g. friction, unmet
+ need, inversion, assumption-breaking, leverage, extreme case)
+ - Require structured idea output so the orchestrator can merge and dedupe
+ - Do not use sub-agents to replace the core ideation mechanism
+
+Phase 3: Self-Critique and Filter (R5, R7, R20-R22)
+ Critique instructions tell Claude to:
+ - Go through each idea and evaluate it critically
+ - For each rejection, write a one-line reason
+ - Rejection criteria: not actionable, too vague, too expensive relative
+ to value, already exists, duplicates another idea, not grounded in
+ actual codebase state
+ - Target: keep 5-7 survivors (or override amount)
+ - If more than 7 pass scrutiny, do a second pass with higher bar
+ - If fewer than 5 pass, note this honestly rather than lowering the bar
+ Optional critique sub-agent support:
+ - Skeptical sub-agents may attack the merged list from distinct angles
+ - The orchestrator synthesizes critiques and owns final scoring/ranking
+
+Phase 4: Present Results (R6, R7, R14)
+ - Display ranked survivors with structured analysis per idea:
+ title, description (2-3 sentences), rationale, downsides,
+ confidence (0-100%), estimated complexity (low/medium/high)
+ - Display rejection summary: collapsed section, one-line per rejected idea
+ - Allow brief questions or lightweight clarification before archival write
+
+Phase 5: Write Artifact (R8, R15, R16)
+ - mkdir -p docs/ideation/
+ - Write the ideation doc after survivors are reviewed enough to preserve
+ - Artifact includes: metadata, codebase context summary, ranked
+ survivors with full analysis, rejection summary
+ - Always write/update before brainstorm handoff, Proof share, or session end
+
+Phase 6: Handoff (R10, R11, R12, R15-R16, R25)
+ 6.1 Present options via platform question tool:
+ - Brainstorm an idea (pick by number → feeds to ce:brainstorm) (R11)
+ - Refine (R15)
+ - Share to Proof
+ - End session (R12)
+ 6.2 Handle selection:
+ - Brainstorm: update doc to mark idea as "explored" (R16),
+ then invoke ce:brainstorm with the idea description
+ - Refine: ask what kind of refinement, then route:
+ "add more ideas" / "explore new angles" → return to Phase 2
+ "re-evaluate" / "raise the bar" → return to Phase 3
+ "dig deeper on idea #N" → expand that idea's analysis in place
+ Update doc after each refinement when preserving the refined state (R16)
+ - Share to Proof: upload ideation doc using the standard
+ curl POST pattern (same as ce:brainstorm), return to options
+ - End: offer to commit the ideation doc (R12), display closing summary
+```
+
+Frontmatter:
+```yaml
+---
+name: ce:ideate
+description: 'Generate and critically evaluate improvement ideas for any project through deep codebase analysis and divergent-then-convergent thinking. Use when the user says "what should I improve", "give me ideas", "ideate", "surprise me with improvements", "what would you change about this project", or when they want AI-generated project improvement suggestions rather than refining their own idea.'
+argument-hint: "[optional: focus area, path, or constraint]"
+---
+```
+
+Artifact template:
+```markdown
+---
+date: YYYY-MM-DD
+topic:
+focus:
+---
+
+# Ideation:
+
+## Codebase Context
+[Brief summary of what the scan revealed — project structure, patterns, pain points, opportunities]
+
+## Ranked Ideas
+
+### 1.
+**Description:** [2-3 sentences]
+**Rationale:** [Why this would be a good improvement]
+**Downsides:** [Risks or costs]
+**Confidence:** [0-100%]
+**Complexity:** [Low / Medium / High]
+
+### 2.
+...
+
+## Rejection Summary
+| # | Idea | Reason for Rejection |
+|---|------|---------------------|
+| 1 | ... | ... |
+
+## Session Log
+- [Date]: Initial ideation — [N] generated, [M] survived
+```
+
+**Patterns to follow:**
+- ce:brainstorm SKILL.md — phase structure, frontmatter style, argument handling, resume pattern, handoff options, Proof sharing, interaction rules
+- ce:plan SKILL.md — agent dispatch syntax (`Task compound-engineering:research:*`)
+- ce:work SKILL.md — session completion commit pattern
+- Plugin CLAUDE.md — skill compliance checklist (imperative voice, cross-platform question tool, no second person)
+
+**Test scenarios:**
+- Invoke with no arguments → fully open ideation, generates ideas, presents survivors, then writes artifact when preserving results
+- Invoke with focus area (`/ce:ideate DX improvements`) → weighted ideation toward focus
+- Invoke with path (`/ce:ideate plugins/compound-engineering/skills/`) → scoped scan
+- Invoke with volume override (`/ce:ideate give me your top 3`) → adjusted volume
+- Resume: invoke when recent ideation doc exists → offers to continue or start fresh
+- Resume + refine loop: revisit an existing ideation doc, add more ideas, then re-run critique without creating a duplicate artifact
+- If sub-agents are used: each receives grounding + focus + volume context and returns structured outputs for orchestrator merge
+- If critique sub-agents are used: orchestrator remains final scorer and ranker
+- Brainstorm handoff: pick an idea → doc updated with "explored" marker, ce:brainstorm invoked
+- Refine: ask to dig deeper → doc updated in place with refined analysis
+- End session: offer commit → stages only the ideation doc, conventional message
+- Initial review checkpoint: survivors can be questioned before archival write
+- Codex install path after PR #277: `ce:ideate` is exposed as the canonical `ce:ideate` workflow entrypoint, not only as a copied raw skill
+- Codex intra-workflow handoffs: any copied `SKILL.md` references to `/ce:*` routes resolve to the canonical Codex prompt surface, and no deprecated `workflows:ideate` alias is emitted
+
+**Verification:**
+- SKILL.md is under 500 lines
+- Frontmatter has `name`, `description`, `argument-hint`
+- Description includes trigger phrases for auto-discovery
+- All 25 requirements are addressed in the phase structure
+- Writing style is imperative/infinitive, no second person
+- Cross-platform question tool pattern with fallback
+- No `disable-model-invocation` (auto-loadable)
+- The repository still loads plugin skills normally because `ce:ideate` is discovered as a `skillDirs` entry
+- Codex output follows the compound-engineering workflow model from PR #277 for this new canonical `ce:*` workflow
+
+---
+
+- [x] **Unit 2: Update plugin metadata and documentation**
+
+**Goal:** Update all locations where component counts and skill listings appear.
+
+**Requirements:** R1 (skill exists in the plugin)
+
+**Dependencies:** Unit 1
+
+**Files:**
+- Modify: `plugins/compound-engineering/.claude-plugin/plugin.json` — update description with new skill count
+- Modify: `.claude-plugin/marketplace.json` — update plugin description with new skill count
+- Modify: `plugins/compound-engineering/README.md` — add ce:ideate to skills table/list, update count
+
+**Approach:**
+- Count actual skill directories after adding ce:ideate for manifest-facing descriptions (`plugin.json`, `.claude-plugin/marketplace.json`)
+- Preserve the README's separate human-facing breakdown of `Commands` vs `Skills` instead of forcing it to equal the manifest-level skill-directory count
+- Add ce:ideate to the README skills section with a brief description in the existing table format
+- Do NOT bump version numbers (per plugin versioning requirements)
+- Do NOT add a CHANGELOG.md release entry
+
+**Patterns to follow:**
+- CLAUDE.md checklist: "Updating the Compounding Engineering Plugin"
+- Existing skill entries in README.md for description format
+- `src/parsers/claude.ts` loading model: manifests and targets derive skill inventory from discovered `skills/*/SKILL.md` directories
+
+**Test scenarios:**
+- Manifest descriptions reflect the post-change skill-directory count
+- README component table and skill listing stay internally consistent with the README's own taxonomy
+- JSON files remain valid
+- README skill listing includes ce:ideate
+
+**Verification:**
+- `grep -o "Includes [0-9]* specialized agents" plugins/compound-engineering/.claude-plugin/plugin.json` matches actual agent count
+- Manifest-facing skill count matches the number of skill directories under `plugins/compound-engineering/skills/`
+- README counts and tables are internally consistent, even if they intentionally differ from manifest-facing skill-directory totals
+- `jq . < .claude-plugin/marketplace.json` succeeds
+- `jq . < plugins/compound-engineering/.claude-plugin/plugin.json` succeeds
+
+---
+
+- [x] **Unit 3: Refresh generated docs artifacts if the local docs workflow produces tracked changes**
+
+**Goal:** Keep generated documentation outputs in sync without inventing source-of-truth files that are not present in the current tree.
+
+**Requirements:** R1 (skill visible in docs)
+
+**Dependencies:** Unit 2
+
+**Files:**
+- Modify (conditional): tracked files under `docs/` updated by the local docs release workflow, if any are produced in this checkout
+
+**Approach:**
+- Run the repo-maintenance docs regeneration workflow after the durable source files are updated
+- Review only the tracked artifacts it actually changes instead of assuming specific generated paths
+- If the local docs workflow produces no tracked changes in this checkout, stop without hand-editing guessed HTML files
+
+**Patterns to follow:**
+- CLAUDE.md: "After ANY change to agents, commands, skills, or MCP servers, run `/release-docs`"
+
+**Test scenarios:**
+- Generated docs, if present, pick up ce:ideate and updated counts from the durable sources
+- Docs regeneration does not introduce unrelated count drift across generated artifacts
+
+**Verification:**
+- Any tracked generated docs diffs are mechanically consistent with the updated plugin metadata and README
+- No manual HTML edits are invented for files absent from the working tree
+
+## System-Wide Impact
+
+- **Interaction graph:** `ce:ideate` sits before `ce:brainstorm` and calls into `repo-research-analyst`, `learnings-researcher`, the platform question tool, optional Proof sharing, and optional local commit flow. The plan has to preserve that this is an orchestration skill spanning multiple existing workflow seams rather than a standalone document generator.
+- **Error propagation:** Resume mismatches, write-before-present failures, or refine-in-place write failures can leave the ideation artifact out of sync with what the user saw. The skill should prefer conservative routing and explicit state updates over optimistic wording.
+- **State lifecycle risks:** `docs/ideation/` becomes a new durable state surface. Topic slugging, 30-day resume matching, refinement updates, and the "explored" marker for brainstorm handoff need stable rules so repeated runs do not create duplicate or contradictory ideation records.
+- **API surface parity:** Most targets can continue to rely on copied `skillDirs`, but Codex is now a special-case workflow surface for compound-engineering because of PR #277. `ce:ideate` needs parity with the canonical `ce:*` workflow model there: explicit prompt entrypoint, rewritten intra-workflow handoffs, and no deprecated alias duplication.
+- **Integration coverage:** Unit-level reading of the SKILL.md is not enough. Verification has to cover end-to-end workflow behavior: initial ideation, artifact persistence, resume/refine loops, and handoff to `ce:brainstorm` without dropping ideation state.
+
+## Risks & Dependencies
+
+- **Divergent ideation quality is hard to verify at planning time**: The self-prompting instructions for Phase 2 and Phase 3 are the novel design element. Their effectiveness depends on exact wording and how well Phase 1 findings are fed back into ideation. Mitigation: verify on the real repo with open and focused prompts, then tighten the prompt structure only where groundedness or rejection quality is weak.
+- **Artifact state drift across resume/refine/handoff**: The feature depends on updating the same ideation doc repeatedly. A weak state model could duplicate docs, lose "explored" markers, or present stale survivors after refinement. Mitigation: keep one canonical ideation file per session/topic and make every refine/handoff path explicitly update that file before returning control.
+- **Count taxonomy drift across docs and manifests**: This repo already uses different count semantics across surfaces. A naive "make every number match" implementation could either break manifest descriptions or distort the README taxonomy. Mitigation: validate each artifact against its own intended counting model and document that distinction in the plan.
+- **Dependency on PR #277 for Codex workflow correctness**: `ce:ideate` is another canonical `ce:*` workflow, so its Codex install surface should not regress to the old copied-skill-only behavior. Mitigation: land #277 first or explicitly include the same Codex workflow behavior before considering this feature complete.
+- **Local docs workflow dependency**: `/release-docs` is a repo-maintenance workflow, not part of the distributed plugin. Its generated outputs may differ by environment or may not produce tracked files in the current checkout. Mitigation: treat docs regeneration as conditional maintenance verification after durable source edits, not as the primary source of truth.
+- **Skill length**: Estimated ~300 lines. If the ideation and self-critique instructions need more detail, the skill could approach the 500-line limit. Mitigation: monitor during implementation and split to `references/` only if the final content genuinely needs it.
+
+## Documentation / Operational Notes
+
+- README.md gets updated in Unit 2
+- Generated docs artifacts are refreshed only if the local docs workflow produces tracked changes in this checkout
+- The local `release-docs` workflow exists as a Claude slash command in this repo, but it was not directly runnable from the shell environment used for this implementation pass
+- No CHANGELOG entry for this PR (per versioning requirements)
+- No version bumps (automated release process handles this)
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md](docs/brainstorms/2026-03-15-ce-ideate-skill-requirements.md)
+- Related code: `plugins/compound-engineering/skills/ce-brainstorm/SKILL.md`, `plugins/compound-engineering/skills/ce-plan/SKILL.md`, `plugins/compound-engineering/skills/ce-work/SKILL.md`
+- Related institutional learning: `docs/solutions/plugin-versioning-requirements.md`
+- Related PR: #277 (`fix: codex workflow conversion for compound-engineering`) — upstream Codex workflow model this plan now depends on
+- Related institutional learning: `docs/solutions/codex-skill-prompt-entrypoints.md`
diff --git a/docs/plans/2026-03-16-001-feat-issue-grounded-ideation-plan.md b/docs/plans/2026-03-16-001-feat-issue-grounded-ideation-plan.md
new file mode 100644
index 0000000..a288054
--- /dev/null
+++ b/docs/plans/2026-03-16-001-feat-issue-grounded-ideation-plan.md
@@ -0,0 +1,246 @@
+---
+title: "feat: Add issue-grounded ideation mode to ce:ideate"
+type: feat
+status: active
+date: 2026-03-16
+origin: docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md
+---
+
+# feat: Add issue-grounded ideation mode to ce:ideate
+
+## Overview
+
+Add an issue intelligence agent and integrate it into ce:ideate so that when a user's argument indicates they want issue-tracker data as input, the skill fetches, clusters, and analyzes GitHub issues — then uses the resulting themes to drive ideation frames. The agent is also independently useful outside ce:ideate for understanding a project's issue landscape.
+
+## Problem Statement / Motivation
+
+ce:ideate currently grounds ideation in codebase context and past learnings only. Teams' issue trackers hold rich signal about real user pain, recurring failures, and severity patterns that ideation misses. The goal is strategic improvement ideas grounded in bug patterns ("invest in collaboration reliability") not individual bug fixes ("fix LIVE_DOC_UNAVAILABLE").
+
+(See brainstorm: docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md — R1-R9)
+
+## Proposed Solution
+
+Two deliverables:
+
+1. **New agent**: `issue-intelligence-analyst` in `agents/research/` — fetches GitHub issues via `gh` CLI, clusters by theme, returns structured analysis. Standalone-capable.
+2. **ce:ideate modifications**: detect issue-tracker intent in arguments, dispatch the agent as a third Phase 1 scan, derive Phase 2 ideation frames from issue clusters using a hybrid strategy.
+
+## Technical Approach
+
+### Deliverable 1: Issue Intelligence Analyst Agent
+
+**File**: `plugins/compound-engineering/agents/research/issue-intelligence-analyst.md`
+
+**Frontmatter:**
+```yaml
+---
+name: issue-intelligence-analyst
+description: "Fetches and analyzes GitHub issues to surface recurring themes, pain patterns, and severity trends. Use when understanding a project's issue landscape, analyzing bug patterns for ideation, or summarizing what users are reporting."
+model: inherit
+---
+```
+
+**Agent methodology (in execution order):**
+
+1. **Precondition checks** — verify in order, fail fast with clear message on any failure:
+ - Current directory is a git repo
+ - A GitHub remote exists (prefer `upstream` over `origin` to handle fork workflows)
+ - `gh` CLI is installed
+ - `gh auth status` succeeds
+
+2. **Fetch issues** — priority-aware, minimal fields (no bodies, no comments):
+
+ **Priority-aware open issue fetching:**
+ - First, scan available labels to detect priority signals: `gh label list --json name --limit 100`
+ - If priority/severity labels exist (e.g., `P0`, `P1`, `priority:critical`, `severity:high`, `urgent`):
+ - Fetch high-priority issues first: `gh issue list --state open --label "{high-priority-labels}" --limit 50 --json number,title,labels,createdAt`
+ - Backfill with remaining issues up to 100 total: `gh issue list --state open --limit 100 --json number,title,labels,createdAt` (deduplicate against already-fetched)
+ - This ensures the 50 P0s in a 500-issue repo are always analyzed, not buried under 100 recent P3s
+ - If no priority labels detected, fetch by recency (default `gh` sort) up to 100: `gh issue list --state open --limit 100 --json number,title,labels,createdAt`
+
+ **Recently closed issues:**
+ - `gh issue list --state closed --limit 50 --json number,title,labels,createdAt,stateReason,closedAt` — filter client-side to last 30 days, exclude `stateReason: "not_planned"` and issues with labels matching common won't-fix patterns (`wontfix`, `won't fix`, `duplicate`, `invalid`, `by design`)
+
+3. **First-pass clustering** — the core analytical step. Group issues into themes that represent **areas of systemic weakness or user pain**, not individual bugs. This is what makes the agent's output valuable.
+
+ **Clustering approach:**
+ - Start with labels as strong clustering hints when present (e.g., `subsystem:collab` groups collaboration issues). When labels are absent or inconsistent, cluster by title similarity and inferred problem domain.
+ - Cluster by **root cause or system area**, not by symptom. Example from proof repo: 25 issues mentioning `LIVE_DOC_UNAVAILABLE` and 5 mentioning `PROJECTION_STALE` are symptoms — the theme is "collaboration write path reliability." Cluster at the system level, not the error-message level.
+ - Issues that span multiple themes should be noted in the primary cluster with a cross-reference, not duplicated across clusters.
+ - Distinguish issue sources when relevant: bot/agent-generated issues (e.g., `agent-report` label) often have different signal quality than human-reported issues. Note the source mix per cluster — a theme with 25 agent reports and 0 human reports is different from one with 5 human reports and 2 agent reports.
+ - Separate bugs from enhancement requests. Both are valid input but represent different kinds of signal (current pain vs. desired capability).
+ - Aim for 3-8 themes. Fewer than 3 suggests the issues are too homogeneous or the repo has few issues. More than 8 suggests the clustering is too granular — merge related themes.
+
+ **What makes a good cluster:**
+ - It names a systemic concern, not a specific error or ticket
+ - A product or engineering leader would recognize it as "an area we need to invest in"
+ - It's actionable at a strategic level (could drive an initiative, not just a patch)
+
+4. **Sample body reads** — for each emerging cluster, read the full body of 2-3 representative issues (most recent or most reacted) using individual `gh issue view {number} --json body` calls. Use these to:
+ - Confirm the cluster grouping is correct (titles can be misleading)
+ - Understand the actual user/operator experience behind the symptoms
+ - Identify severity and impact signals not captured in metadata
+ - Surface any proposed solutions or workarounds already discussed
+
+5. **Theme synthesis** — for each cluster, produce:
+ - `theme_title`: short descriptive name
+ - `description`: what the pattern is and what it signals about the system
+ - `why_it_matters`: user impact, severity distribution, frequency
+ - `issue_count`: number of issues in this cluster
+ - `trend_direction`: increasing/stable/decreasing (compare issues opened vs closed in last 30 days within the cluster)
+ - `representative_issues`: top 3 issue numbers with titles
+ - `confidence`: high/medium/low based on label consistency and cluster coherence
+
+6. **Return structured output** — themes ordered by issue count (descending), plus a summary line with total issues analyzed, cluster count, and date range covered.
+
+**Output format (returned to caller):**
+
+```markdown
+## Issue Intelligence Report
+
+**Repo:** {owner/repo}
+**Analyzed:** {N} open + {M} recently closed issues ({date_range})
+**Themes identified:** {K}
+
+### Theme 1: {theme_title}
+**Issues:** {count} | **Trend:** {increasing/stable/decreasing} | **Confidence:** {high/medium/low}
+
+{description — what the pattern is and what it signals}
+
+**Why it matters:** {user impact, severity, frequency}
+
+**Representative issues:** #{num} {title}, #{num} {title}, #{num} {title}
+
+### Theme 2: ...
+
+### Minor / Unclustered
+{Issues that didn't fit any theme, with a brief note}
+```
+
+This format is human-readable (standalone use) and structured enough for orchestrator consumption (ce:ideate use).
+
+**Data source priority:**
+1. **`gh` CLI (preferred)** — most reliable, works in all terminal environments, no MCP dependency
+2. **GitHub MCP server** (fallback) — if `gh` is unavailable but a GitHub MCP server is connected, use its issue listing/reading tools instead. The clustering logic is identical; only the fetch mechanism changes.
+
+If neither is available, fail gracefully per precondition checks.
+
+**Token-efficient fetching:**
+
+The agent runs as a sub-agent with its own context window. Every token of fetched issue data competes with the space needed for clustering reasoning. Minimize input, maximize analysis.
+
+- **Metadata pass (all issues):** Fetch only the fields needed for clustering: `--json number,title,labels,createdAt,stateReason,closedAt`. Omit `body`, `comments`, `assignees`, `milestone` — these are expensive and not needed for initial grouping.
+- **Body reads (samples only):** After clusters emerge, fetch full bodies for 2-3 representative issues per cluster using individual `gh issue view {number} --json body` calls. Pick the most reacted or most recent issue in each cluster.
+- **Never fetch all bodies in bulk.** 100 issue bodies could easily consume 50k+ tokens before any analysis begins.
+
+**Tool guidance** (per AGENTS.md conventions):
+- Use `gh` CLI for issue fetching (one simple command at a time, no chaining)
+- Use native file-search/glob for any repo exploration
+- Use native content-search/grep for label or pattern searches
+- Do not chain shell commands with `&&`, `||`, `;`, or pipes
+
+### Deliverable 2: ce:ideate Skill Modifications
+
+**File**: `plugins/compound-engineering/skills/ce-ideate/SKILL.md`
+
+Four targeted modifications:
+
+#### Mod 1: Phase 0.2 — Add issue-tracker intent detection
+
+After the existing focus context and volume override interpretation, add a third inference:
+
+- **Issue-tracker intent** — detect when the user wants issue data as input
+
+The detection uses the same "reasonable interpretation rather than formal parsing" approach as the existing volume hints. Trigger on arguments whose intent is clearly about issue/bug analysis: `bugs`, `github issues`, `open issues`, `issue patterns`, `what users are reporting`, `bug reports`.
+
+Do NOT trigger on arguments that merely mention bugs as a focus: `bug in auth`, `fix the login issue` — these are focus hints.
+
+When combined with other dimensions (e.g., `top 3 bugs in authentication`): parse issue trigger first, volume override second, remainder is focus hint. The focus hint narrows which issues matter; the volume override controls survivor count.
+
+#### Mod 2: Phase 1 — Add third parallel agent
+
+Add a third numbered item to the Phase 1 parallel dispatch:
+
+```
+3. **Issue intelligence** (conditional) — if issue-tracker intent was detected in Phase 0.2,
+ dispatch `compound-engineering:research:issue-intelligence-analyst` with the focus hint.
+ If a focus hint is present, pass it so the agent can weight its clustering.
+```
+
+Update the grounding summary consolidation to include a separate **Issue Intelligence** section (distinct from codebase context) so that ideation sub-agents can distinguish between code-observed and user-reported pain points.
+
+If the agent returns an error (gh not installed, no remote, auth failure), log a warning to the user ("Issue analysis unavailable: {reason}. Proceeding with standard ideation.") and continue with the existing two-agent grounding.
+
+If the agent returns fewer than 5 issues total, note "Insufficient issue signal for theme analysis" and proceed with default ideation.
+
+#### Mod 3: Phase 2 — Dynamic frame derivation
+
+Add conditional logic before the existing frame assignment (step 8):
+
+When issue-tracker intent is active and the issue intelligence agent returned themes:
+- Each theme with `confidence: high` or `confidence: medium` becomes an ideation frame. The frame prompt uses the theme title and description as the starting bias.
+- If fewer than 4 cluster-derived frames, pad with default frames selected in order: "leverage and compounding effects", "assumption-breaking or reframing", "inversion, removal, or automation of a painful step" (these complement issue-grounded themes best by pushing beyond the reported problems).
+- Cap at 6 total frames (if more than 6 themes, use the top 6 by issue count; remaining themes go into the grounding summary as "minor themes").
+
+When issue-tracker intent is NOT active: existing behavior unchanged.
+
+#### Mod 4: Phase 0.1 — Resume awareness
+
+When checking for recent ideation documents, treat issue-grounded and non-issue ideation as distinct topics. An existing `docs/ideation/YYYY-MM-DD-open-ideation.md` should not be offered as a resume candidate when the current argument indicates issue-tracker intent, and vice versa.
+
+### Files Changed
+
+| File | Change |
+|------|--------|
+| `agents/research/issue-intelligence-analyst.md` | **New file** — the agent |
+| `skills/ce-ideate/SKILL.md` | **Modified** — 4 targeted modifications (Phase 0.1, 0.2, 1, 2) |
+| `.claude-plugin/plugin.json` | **Modified** — increment agent count, add agent to list, update description |
+| `../../.claude-plugin/marketplace.json` | **Modified** — update description with new agent count |
+| `README.md` | **Modified** — add agent to research agents table |
+
+### Not Changed
+
+- Phase 3 (adversarial filtering) — unchanged
+- Phase 4 (presentation) — unchanged, survivors already include a one-line overview
+- Phase 5 (artifact) — unchanged, the grounding summary naturally includes issue context
+- Phase 6 (refine/handoff) — unchanged
+- No other agents modified
+- No new skills
+
+## Acceptance Criteria
+
+- [ ] New agent file exists at `agents/research/issue-intelligence-analyst.md` with correct frontmatter
+- [ ] Agent handles precondition failures gracefully (no gh, no remote, no auth) with clear messages
+- [ ] Agent handles fork workflows (prefers upstream remote over origin)
+- [ ] Agent uses priority-aware fetching (scans for priority/severity labels, fetches high-priority first)
+- [ ] Agent caps fetching at 100 open + 50 recently closed issues
+- [ ] Agent falls back to GitHub MCP when `gh` CLI is unavailable but MCP is connected
+- [ ] Agent clusters issues into themes, not individual bug reports
+- [ ] Agent reads 2-3 sample bodies per cluster for enrichment
+- [ ] Agent output includes theme title, description, why_it_matters, issue_count, trend, representative issues, confidence
+- [ ] Agent is independently useful when dispatched directly (not just as ce:ideate sub-agent)
+- [ ] ce:ideate detects issue-tracker intent from arguments like `bugs`, `github issues`
+- [ ] ce:ideate does NOT trigger issue mode on focus hints like `bug in auth`
+- [ ] ce:ideate dispatches issue intelligence agent as third parallel Phase 1 scan when triggered
+- [ ] ce:ideate falls back to default ideation with warning when agent fails
+- [ ] ce:ideate derives ideation frames from issue clusters (hybrid: clusters + default padding)
+- [ ] ce:ideate caps at 6 frames, padding with defaults when < 4 clusters
+- [ ] Running `/ce:ideate bugs` on proof repo produces clustered themes from 25+ LIVE_DOC_UNAVAILABLE variants, not 25 separate ideas
+- [ ] Surviving ideas are strategic improvements, not individual bug fixes
+- [ ] plugin.json, marketplace.json, README.md updated with correct counts
+
+## Dependencies & Risks
+
+- **`gh` CLI dependency**: The agent requires `gh` installed and authenticated. Mitigated by graceful fallback to standard ideation.
+- **Issue volume**: Repos with thousands of issues could produce noisy clusters. Mitigated by fetch cap (100 open + 50 closed) and frame cap (6 max).
+- **Label quality variance**: Repos without structured labels rely on title/body clustering, which may produce lower-confidence themes. Mitigated by the confidence field and sample body reads.
+- **Context window**: Fetching 150 issues + reading 15-20 bodies could consume significant tokens in the agent's context. Mitigated by metadata-only initial fetch and sample-only body reads.
+- **Priority label detection**: No standard naming convention. Mitigated by scanning available labels and matching common patterns (P0/P1, priority:*, severity:*, urgent, critical). When no priority labels exist, falls back to recency-based fetching.
+
+## Sources & References
+
+- **Origin brainstorm:** [docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md](docs/brainstorms/2026-03-16-issue-grounded-ideation-requirements.md) — Key decisions: pattern-first ideation, hybrid frame strategy, flexible argument detection, additive to Phase 1, standalone agent
+- **Exemplar agent:** `plugins/compound-engineering/agents/research/repo-research-analyst.md` — agent structure pattern
+- **ce:ideate skill:** `plugins/compound-engineering/skills/ce-ideate/SKILL.md` — integration target
+- **Institutional learning:** `docs/solutions/skill-design/compound-refresh-skill-improvements.md` — impact clustering pattern, platform-agnostic tool references, evidence-first interaction
+- **Real-world test repo:** `EveryInc/proof` (555 issues, 25+ LIVE_DOC_UNAVAILABLE duplicates, structured labels)
diff --git a/docs/plans/2026-03-17-001-feat-release-automation-migration-beta-plan.md b/docs/plans/2026-03-17-001-feat-release-automation-migration-beta-plan.md
new file mode 100644
index 0000000..0f4016e
--- /dev/null
+++ b/docs/plans/2026-03-17-001-feat-release-automation-migration-beta-plan.md
@@ -0,0 +1,605 @@
+---
+title: "feat: Migrate repo releases to manual release-please with centralized changelog"
+type: feat
+status: active
+date: 2026-03-17
+origin: docs/brainstorms/2026-03-17-release-automation-requirements.md
+---
+
+# feat: Migrate repo releases to manual release-please with centralized changelog
+
+## Overview
+
+Replace the current single-line `semantic-release` flow and maintainer-local `release-docs` workflow with a repo-owned release system built around `release-please`, a single accumulating release PR, explicit component version ownership, release automation-owned metadata/count updates, and a centralized root `CHANGELOG.md`. The new model keeps release timing manual by making merge of the generated release PR the release action while allowing dry-run previews and automatic release PR maintenance as new merges land on `main`.
+
+## Problem Frame
+
+The current repo mixes one automated root CLI release line with manual plugin release conventions and stale docs/tooling. `publish.yml` publishes on every push to `main`, `.releaserc.json` only understands the root package, `release-docs` still encodes outdated repo structure, and plugin-level version/changelog ownership is inconsistent. The result is drift across root changelog history, plugin manifests, computed counts, and contributor guidance. The origin requirements define a different target: manual release timing, one release PR for the whole repo, independent component versions, no bumps for untouched plugins, centralized changelog ownership, and CI-owned release authority. (see origin: docs/brainstorms/2026-03-17-release-automation-requirements.md)
+
+## Requirements Trace
+
+- R1. Manual release; no publish on every merge to `main`
+- R2. Batched releasable changes may accumulate on `main`
+- R3. One release PR for the whole repo that auto-accumulates releasable merges
+- R4. Independent version bumps for `cli`, `compound-engineering`, `coding-tutor`, and `marketplace`
+- R5. Untouched components do not bump
+- R6. Root `CHANGELOG.md` remains canonical
+- R7. Root changelog uses top-level component-version entries
+- R8. Existing changelog history is preserved
+- R9. `plugins/compound-engineering/CHANGELOG.md` is no longer canonical
+- R10. Retire `release-docs` as release authority
+- R11. Replace `release-docs` with narrow scripts
+- R12. Release automation owns versions, counts, and release metadata
+- R13. Support dry run with no side effects
+- R14. Dry run summarizes proposed component bumps, changelog entries, and blockers
+- R15. Marketplace version bumps only for marketplace-level changes
+- R16. Plugin version changes do not imply marketplace version bumps
+- R17. Plugin-only content changes do not force CLI version bumps
+- R18. Preserve compatibility with current install behavior where the npm CLI fetches plugin content from GitHub at runtime
+- R19. Release flow is triggerable through CI by maintainers or AI agents
+- R20. The model must scale to additional plugins
+- R21. Conventional release intent signals remain required, but component scopes in titles remain optional
+- R22. Component ownership is inferred primarily from changed files, not title scopes alone
+- R23. The repo enforces parseable conventional PR or merge titles without requiring component scope on every change
+- R24. Manual CI release supports explicit bump overrides for exceptional cases without fake commits
+- R25. Bump overrides are per-component rather than repo-wide only
+- R26. Dry run shows inferred bump and applied override clearly
+
+## Scope Boundaries
+
+- No change to how Claude Code consumes marketplace/plugin version fields
+- No end-user auto-update discovery flow for non-Claude harnesses in v1
+- No per-plugin canonical changelog model
+- No fully automatic timed release cadence in v1
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `.github/workflows/publish.yml` currently runs `npx semantic-release` on every push to `main`; this is the behavior being retired.
+- `.releaserc.json` is the current single-line release configuration and only writes `CHANGELOG.md` and `package.json`.
+- `package.json` already exposes repo-maintenance scripts and is the natural place to add release preview/validation script entrypoints.
+- `src/commands/install.ts` resolves named plugin installs by cloning the GitHub repo and reading `plugins/` at runtime; this means plugin content releases can remain independent from npm CLI releases when CLI code is unchanged.
+- `.claude-plugin/marketplace.json`, `plugins/compound-engineering/.claude-plugin/plugin.json`, and `plugins/coding-tutor/.claude-plugin/plugin.json` are the current version-bearing metadata surfaces that need explicit ownership.
+- `.claude/commands/release-docs.md` is stale and mixes docs generation, metadata synchronization, validation, and release guidance; it should be replaced rather than modernized in place.
+- Existing planning docs in `docs/plans/` use one file per plan, frontmatter with `origin`, and dependency-ordered implementation units with explicit file paths; this plan follows that pattern.
+
+### Institutional Learnings
+
+- `docs/solutions/plugin-versioning-requirements.md` already encodes an important constraint: version bumps and changelog entries should be release-owned, not added in routine feature PRs. The migration should preserve that principle while moving the authority into CI.
+
+### External References
+
+- `release-please` release PR model supports maintaining a standing release PR that updates as more work lands on the default branch.
+- `release-please` manifest mode supports multi-component repos and per-component extra file updates, which is a strong fit for plugin manifests and marketplace metadata.
+- GitHub Actions `workflow_dispatch` provides a stable manual trigger surface for dry-run preview workflows.
+
+## Key Technical Decisions
+
+- **Use `release-please` for version planning and release PR lifecycle**: The repo needs one accumulating release PR with multiple independently versioned components; that is closer to `release-please`'s native model than to `semantic-release`.
+- **Keep one centralized root changelog**: The root `CHANGELOG.md` remains the canonical changelog. Release automation must render component-labeled entries into that one file rather than splitting canonical history across plugin-local changelog files.
+- **Use top-level component-version entries in the root changelog**: Each released component version gets its own top-level entry in `CHANGELOG.md`, including the component name, version, and release date in the heading. This keeps one centralized file while preserving readable independent version history.
+- **Treat component versioning and changelog rendering as related but separate concerns**: `release-please` can own component version bumps and release PR state, but root changelog formatting may require repo-specific rendering logic to preserve a single readable canonical file.
+- **Use explicit release scripts for repo-specific logic**: Count computation, metadata sync, dry-run summaries, and root changelog shaping should live in versioned scripts rather than hidden maintainer-local command prompts.
+- **Preserve current plugin delivery assumptions**: Plugin content updates do not force CLI version bumps unless the converter/installer behavior in `src/` changes.
+- **Marketplace is catalog-scoped**: Marketplace version bumps depend on marketplace file changes such as plugin additions/removals or marketplace metadata edits, not routine plugin release version updates.
+- **Use conventional type as release intent, not mandatory component scope**: `feat`, `fix`, and explicit breaking-change markers remain important release signals, but component scope in PR or merge titles is optional and should not be required for common compound-engineering work.
+- **File ownership is authoritative for component selection**: Optional title scope can help notes and validation, but changed-file ownership rules should decide which components bump.
+- **Support manual bump overrides as an explicit escape hatch**: Inferred bumping remains the default, but the CI-driven release flow should allow per-component `patch` / `minor` / `major` overrides for exceptional cases without requiring synthetic commits on `main`.
+- **Deprecate, do not rely on, legacy changelog/docs surfaces**: `plugins/compound-engineering/CHANGELOG.md` and `release-docs` should stop being live authorities; they should be removed, frozen, or reduced to pointer guidance only after the new flow is in place.
+
+## Root Changelog Format
+
+The root `CHANGELOG.md` should remain the only canonical changelog and should use component-version entries rather than repo-wide release-event entries.
+
+### Format Rules
+
+- Each released component gets its own top-level entry.
+- Entry headings include the component name, version, and release date.
+- Entries are ordered newest-first in the single root file.
+- When multiple components release from the same merged release PR, they appear as adjacent entries with the same date.
+- Each entry contains only changes relevant to that component.
+- The file keeps a short header note explaining that it is the canonical changelog for the repo and that versions are component-scoped.
+- Historical root changelog entries remain in place; the migration adds a note and changes formatting only for new entries after cutover.
+
+### Recommended Heading Shape
+
+```md
+## compound-engineering v2.43.0 - 2026-04-10
+
+### Features
+- ...
+
+### Fixes
+- ...
+```
+
+Additional examples:
+
+```md
+## coding-tutor v1.2.2 - 2026-04-18
+
+### Fixes
+- ...
+
+## marketplace v1.3.0 - 2026-04-18
+
+### Changed
+- Added `new-plugin` to the marketplace catalog.
+
+## cli v2.43.1 - 2026-04-21
+
+### Fixes
+- Correct OpenClaw install path handling.
+```
+
+### Migration Rules
+
+- Preserve all existing root changelog history as published.
+- Add a short migration note near the top stating that, starting with the cutover release, entries are recorded per component version in the root file.
+- Do not attempt to rewrite or normalize all older entries into the new structure.
+- `plugins/compound-engineering/CHANGELOG.md` should no longer receive new canonical entries after cutover.
+
+## Component Release Rules
+
+The release system should use explicit file-to-component ownership rules so unchanged components do not bump accidentally.
+
+### Component Definitions
+
+- **`cli`**: The npm-distributed `@every-env/compound-plugin` package and its release-owned root metadata.
+- **`compound-engineering`**: The plugin rooted at `plugins/compound-engineering/`.
+- **`coding-tutor`**: The plugin rooted at `plugins/coding-tutor/`.
+- **`marketplace`**: Marketplace-level metadata rooted at `.claude-plugin/` and any future repo-owned marketplace-only surfaces.
+
+### File-to-Component Mapping
+
+#### `cli`
+
+Changes that should trigger a `cli` release:
+
+- `src/**`
+- `package.json`
+- `bun.lock`
+- CLI-only tests or fixtures that validate root CLI behavior:
+ - `tests/cli.test.ts`
+ - other top-level tests whose subject is the CLI itself
+- Release-owned root files only when they reflect a CLI release rather than another component:
+ - root `CHANGELOG.md` entry generation for the `cli` component
+
+Changes that should **not** trigger `cli` by themselves:
+
+- Plugin content changes under `plugins/**`
+- Marketplace metadata changes under `.claude-plugin/**`
+- Docs or brainstorm/plan documents unless the repo explicitly decides docs-only changes are releasable for the CLI
+
+#### `compound-engineering`
+
+Changes that should trigger a `compound-engineering` release:
+
+- `plugins/compound-engineering/**`
+- Tests or fixtures whose primary purpose is validating compound-engineering content or conversion results derived from that plugin
+- Release-owned metadata updates for the compound-engineering plugin:
+ - `plugins/compound-engineering/.claude-plugin/plugin.json`
+- Root `CHANGELOG.md` entry generation for the `compound-engineering` component
+
+Changes that should **not** trigger `compound-engineering` by themselves:
+
+- `plugins/coding-tutor/**`
+- Root CLI implementation changes in `src/**`
+- Marketplace-only metadata changes
+
+#### `coding-tutor`
+
+Changes that should trigger a `coding-tutor` release:
+
+- `plugins/coding-tutor/**`
+- Tests or fixtures whose primary purpose is validating coding-tutor content or conversion results derived from that plugin
+- Release-owned metadata updates for the coding-tutor plugin:
+ - `plugins/coding-tutor/.claude-plugin/plugin.json`
+- Root `CHANGELOG.md` entry generation for the `coding-tutor` component
+
+Changes that should **not** trigger `coding-tutor` by themselves:
+
+- `plugins/compound-engineering/**`
+- Root CLI implementation changes in `src/**`
+- Marketplace-only metadata changes
+
+#### `marketplace`
+
+Changes that should trigger a `marketplace` release:
+
+- `.claude-plugin/marketplace.json`
+- Future marketplace-only docs or config files if the repo later introduces them
+- Adding a new plugin directory under `plugins/` when that addition is accompanied by marketplace catalog changes
+- Removing a plugin from the marketplace catalog
+- Marketplace metadata changes such as owner info, catalog description, or catalog-level structure changes
+
+Changes that should **not** trigger `marketplace` by themselves:
+
+- Routine version bumps to existing plugin manifests
+- Plugin-only content changes under `plugins/compound-engineering/**` or `plugins/coding-tutor/**`
+- Root CLI implementation changes in `src/**`
+
+### Multi-Component Rules
+
+- A single merged PR may trigger multiple components when it changes files owned by each of those components.
+- A plugin content change plus a CLI behavior change should release both the plugin and `cli`.
+- Adding a new plugin should release at least the new plugin and `marketplace`; it should release `cli` only if the CLI behavior, plugin discovery logic, or install UX also changed.
+- Root `CHANGELOG.md` should not itself be used as the primary signal for component detection; it is a release output, not an input.
+- Release-owned metadata writes generated by the release flow should not recursively cause unrelated component bumps on subsequent runs.
+
+### Release Intent Rules
+
+- The repo should continue to require conventional release intent markers such as `feat:`, `fix:`, and explicit breaking change notation.
+- Component scopes such as `feat(coding-tutor): ...` are optional and should remain optional.
+- When a scope is present, it should be treated as advisory metadata that can improve release note grouping or mismatch detection.
+- When no scope is present, release automation should still work correctly by using changed-file ownership to determine affected components.
+- Docs-only, planning-only, or maintenance-only titles such as `docs:` or `chore:` should remain parseable even when they do not imply a releasable component bump.
+
+### Manual Override Rules
+
+- Automatic bump inference remains the default for all components.
+- The manual CI workflow should support override values of at least `patch`, `minor`, and `major`.
+- Overrides should be selectable per component rather than only as one repo-wide override.
+- Overrides should be treated as exceptional operational controls, not the normal release path.
+- When an override is present, release output should show both:
+ - inferred bump
+ - override-applied bump
+- Overrides should affect the prepared release state without requiring maintainers to add fake commits to `main`.
+
+### Ambiguity Resolution Rules
+
+- If a file exists primarily to support one plugin's content or fixtures, map it to that plugin rather than to `cli`.
+- If a shared utility in `src/` changes behavior for all installs/conversions, treat it as a `cli` change even if the immediate motivation came from one plugin.
+- If a change only updates docs, brainstorms, plans, or repo instructions, default to no release unless the repo intentionally adds docs-only release semantics later.
+- When a new plugin is introduced in the future, add it as its own explicit component rather than folding it into `marketplace` or `cli`.
+
+## Release Workflow Behavior
+
+The release flow should have three distinct modes that share the same component-detection and metadata-rendering logic.
+
+### Release PR Maintenance
+
+- Runs automatically on pushes to `main`.
+- Creates one release PR for the repo if none exists.
+- Updates the existing open release PR when additional releasable changes land on `main`.
+- Includes only components selected by release-intent parsing plus file ownership rules.
+- Updates release-owned files only on the release PR branch, not directly on `main`.
+- Never publishes npm, creates final GitHub releases, or tags versions as part of this maintenance step.
+
+The maintained release PR should make these outputs visible:
+- component version bumps
+- draft root changelog entries
+- release-owned metadata changes such as plugin version fields and computed counts
+
+### Manual Dry Run
+
+- Runs only through `workflow_dispatch`.
+- Computes the same release result the current open release PR would contain, or would create if none exists.
+- Produces a human-readable summary in workflow output and optionally an artifact.
+- Validates component ownership, conventional release intent, metadata sync, count updates, and root changelog rendering.
+- Does not push commits, create or update branches, merge PRs, publish packages, create tags, or create GitHub releases.
+
+The dry-run summary should include:
+- detected releasable components
+- current version -> proposed version for each component
+- draft root changelog entries
+- metadata files that would change
+- blocking validation failures and non-blocking warnings
+
+### Actual Release Execution
+
+- Happens only when the generated release PR is intentionally merged.
+- The merge writes the release-owned version and changelog changes into `main`.
+- Post-merge release automation then performs publish steps only for components included in that merged release.
+- npm publish runs only when the `cli` component is part of the merged release.
+- Non-CLI component releases still update canonical version surfaces and release notes even when no npm publish occurs.
+
+### Safety Rules
+
+- Ordinary feature merges to `main` must never publish by themselves.
+- Dry run must remain side-effect free.
+- Release PR maintenance, dry run, and post-merge release must use the same underlying release-state computation.
+- Release-generated version and metadata writes must not recursively trigger a follow-up release that contains only its own generated churn.
+- The release PR merge remains the auditable manual boundary; do not replace it with direct-to-main release commits from a manual workflow.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Should release timing remain manual?** Yes. The release PR may be maintained automatically, but release happens only when the generated release PR is intentionally merged.
+- **Should the release PR update automatically as more merges land on `main`?** Yes. This is a core batching behavior and should remain automatic.
+- **Should release preview be distinct from release execution?** Yes. Dry run should be a side-effect-free manual workflow that previews the same release state without mutating branches or publishing anything.
+- **Should root changelog history stay centralized?** Yes. The root `CHANGELOG.md` remains canonical to avoid fragmented history.
+- **What changelog structure best fits the centralized model?** Top-level component-version entries in the root changelog are the preferred format. This keeps the file centralized while making independent version history readable.
+- **What should drive component bumps?** Explicit file-to-component ownership rules. `src/**` drives `cli`, each `plugins//**` tree drives its own plugin, and `.claude-plugin/marketplace.json` drives `marketplace`.
+- **How strict should conventional formatting be?** Conventional type should be required strongly enough for release tooling and release-note generation, but component scope should remain optional to match the repo's work style.
+- **Should exceptional manual bumping be supported?** Yes. The release workflow should expose per-component patch/minor/major override controls rather than forcing synthetic commits to manipulate inferred versions.
+- **Should marketplace version bump when only a listed plugin version changes?** No. Marketplace bumps are reserved for marketplace-level changes.
+- **Should `release-docs` remain part of release authority?** No. It should be retired and replaced with narrow scripts.
+
+### Deferred to Implementation
+
+- What exact combination of `release-please` config and custom post-processing yields the chosen root changelog output without fighting the tool too hard?
+- Should conventional-format enforcement happen on PR titles, squash-merge titles, commit messages, or a combination of them?
+- Should `plugins/compound-engineering/CHANGELOG.md` be deleted outright or replaced with a short pointer note after the migration is stable?
+- Should release preview be implemented by invoking `release-please` in dry-run mode directly, or by a repo-owned script that computes the same summary from component rules and current git state?
+- Should final post-merge release execution live in a dedicated publish workflow keyed off merged release PR state, or remain in a renamed/adapted version of the current `publish.yml`?
+- Should override inputs be encoded directly into release workflow inputs only, or also persisted into the generated release PR body for auditability?
+
+## Implementation Units
+
+- [x] **Unit 1: Define the new release component model and config scaffolding**
+
+**Goal:** Replace the single-line semantic-release configuration with release-please-oriented repo configuration that expresses the four release components and their version surfaces.
+
+**Requirements:** R1, R3, R4, R5, R15, R16, R17, R20
+
+**Dependencies:** None
+
+**Files:**
+- Create: `.release-please-config.json`
+- Create: `.release-please-manifest.json`
+- Modify: `package.json`
+- Modify: `.github/workflows/publish.yml`
+- Delete or freeze: `.releaserc.json`
+
+**Approach:**
+- Define components for `cli`, `compound-engineering`, `coding-tutor`, and `marketplace`.
+- Use manifest configuration so version lines are independent and untouched components do not bump.
+- Rework the existing publish workflow so it no longer releases on every push to `main` and instead supports the release-please-driven model.
+- Add package scripts for release preview, metadata sync, and validation so CI can call stable entrypoints instead of embedding release logic inline.
+- Define the repo's release-intent contract: conventional type required, breaking changes explicit, component scope optional, file ownership authoritative.
+- Define the override contract: per-component `auto | patch | minor | major`, with `auto` as the default.
+
+**Patterns to follow:**
+- Existing repo-level config files at the root (`package.json`, `.releaserc.json`, `.github/workflows/*.yml`)
+- Current release ownership documented in `docs/solutions/plugin-versioning-requirements.md`
+
+**Test scenarios:**
+- A plugin-only change maps to that plugin component without implying CLI or marketplace bump.
+- A marketplace metadata/catalog change maps to marketplace only.
+- A `src/` CLI behavior change maps to the CLI component.
+- A combined change yields multiple component updates inside one release PR.
+- A title like `fix: adjust ce:plan-beta wording` remains valid without component scope and still produces the right component mapping from files.
+- A manual override can promote an inferred patch bump for one component to minor without affecting unrelated components.
+
+**Verification:**
+- The repo contains a single authoritative release configuration model for all versioned components.
+- The old automatic-on-push semantic-release path is removed or inert.
+- Package scripts exist for preview/sync/validate entrypoints.
+- Release intent rules are documented without forcing repetitive component scoping on routine CE work.
+
+- [x] **Unit 2: Build repo-owned release scripts for metadata sync, counts, and preview**
+
+**Goal:** Replace `release-docs` and ad-hoc release bookkeeping with explicit scripts that compute release-owned metadata updates and produce dry-run summaries.
+
+**Requirements:** R10, R11, R12, R13, R14, R18, R19
+
+**Dependencies:** Unit 1
+
+**Files:**
+- Create: `scripts/release/sync-metadata.ts`
+- Create: `scripts/release/render-root-changelog.ts`
+- Create: `scripts/release/preview.ts`
+- Create: `scripts/release/validate.ts`
+- Modify: `package.json`
+
+**Approach:**
+- `sync-metadata.ts` should own count calculation and synchronized writes to release-owned metadata fields such as manifest descriptions and version mirrors.
+- `render-root-changelog.ts` should generate the centralized root changelog entries in the agreed component-version format.
+- `preview.ts` should summarize proposed component bumps, generated changelog entries, affected files, and validation blockers without mutating the repo or publishing anything.
+- `validate.ts` should provide a stable CI check for component counts, manifest consistency, and changelog formatting expectations.
+- `preview.ts` should accept optional per-component overrides and display both inferred and effective bump levels in its summary output.
+
+**Patterns to follow:**
+- TypeScript/Bun scripting already used elsewhere in the repo
+- Root package scripts as stable repo entrypoints
+
+**Test scenarios:**
+- Count calculation updates plugin descriptions correctly when agents/skills change.
+- Preview output includes only changed components.
+- Preview mode performs no file writes.
+- Validation fails when manifest counts or version ownership rules drift.
+- Root changelog renderer produces component-version entries with stable ordering and headings.
+- Preview output clearly distinguishes inferred bump from override-applied bump when an override is used.
+
+**Verification:**
+- `release-docs` responsibilities are covered by explicit scripts.
+- Dry run can run in CI without side effects.
+- Metadata/count drift can be detected deterministically before release.
+
+- [x] **Unit 3: Wire release PR maintenance and manual release execution in CI**
+
+**Goal:** Establish one standing release PR for the repo that updates automatically as new releasable work lands, while keeping the actual release action manual.
+
+**Requirements:** R1, R2, R3, R13, R14, R19
+
+**Dependencies:** Units 1-2
+
+**Files:**
+- Create: `.github/workflows/release-pr.yml`
+- Create: `.github/workflows/release-preview.yml`
+- Modify: `.github/workflows/ci.yml`
+- Modify: `.github/workflows/publish.yml`
+
+**Approach:**
+- `release-pr.yml` should run on push to `main` and maintain the standing release PR for the whole repo.
+- The actual release event should remain merge of that generated release PR; no automatic publish should happen on ordinary merges to `main`.
+- `release-preview.yml` should use `workflow_dispatch` with explicit dry-run inputs and publish a human-readable summary to workflow logs and/or artifacts.
+- Decide whether npm publish remains in `publish.yml` or moves into the release-please-driven workflow, but ensure it runs only when the CLI component is actually releasing.
+- Keep normal `ci.yml` focused on verification, not publishing.
+- Add lightweight validation for release-intent formatting on PR or merge titles, without requiring component scopes.
+- Ensure release PR maintenance, dry run, and post-merge publish all call the same underlying release-state computation so they cannot drift.
+- Add workflow inputs for per-component bump overrides and ensure they can shape the prepared release state when explicitly invoked by a maintainer or AI agent.
+
+**Patterns to follow:**
+- Existing GitHub workflow layout in `.github/workflows/`
+- Current manual `workflow_dispatch` presence in `publish.yml`
+
+**Test scenarios:**
+- A normal merge to `main` updates or creates the release PR but does not publish.
+- A manual dry-run workflow produces a summary with no tags, commits, or publishes.
+- Merging the release PR results in release creation for changed components only.
+- A release that excludes CLI does not attempt npm publish.
+- A PR titled `feat: add new plan-beta handoff guidance` passes validation without a component scope.
+- A PR titled with an explicit contradictory scope can be surfaced as a warning or failure if file ownership clearly disagrees.
+- A second releasable merge to `main` updates the existing open release PR instead of creating a competing release PR.
+- A dry run executed while a release PR is open reports the same proposed component set and versions as the PR contents.
+- Merging a release PR does not immediately create a follow-up release PR containing only release-generated metadata churn.
+- A manual workflow can override one component to `major` while leaving other components on inferred `auto`.
+
+**Verification:**
+- Maintainers can inspect the current release PR to see the pending release batch.
+- Dry-run and actual-release paths are distinct and safe.
+- The release system is triggerable through CI without local maintainer-only tooling.
+- The same proposed release state is visible consistently across release PR maintenance, dry run, and post-merge release execution.
+- Exceptional release overrides are possible without synthetic commits on `main`.
+
+- [x] **Unit 4: Centralize changelog ownership and retire plugin-local canonical release history**
+
+**Goal:** Make the root changelog the only canonical changelog while preserving history and preventing future fragmentation.
+
+**Requirements:** R6, R7, R8, R9
+
+**Dependencies:** Units 1-3
+
+**Files:**
+- Modify: `CHANGELOG.md`
+- Modify or replace: `plugins/compound-engineering/CHANGELOG.md`
+- Optionally create: `plugins/coding-tutor/CHANGELOG.md` only if needed as a non-canonical pointer or future placeholder
+
+**Approach:**
+- Add a migration note near the top of the root changelog clarifying that it is the canonical changelog for the repo and future releases.
+- Render future canonical entries into the root file as top-level component-version entries using the agreed heading shape.
+- Stop writing future canonical entries into `plugins/compound-engineering/CHANGELOG.md`.
+- Replace the plugin-local changelog with either a short pointer note or a frozen historical file, depending on the least confusing path discovered during implementation.
+- Keep existing root changelog entries intact; do not attempt to rewrite historical releases into a new structure retroactively.
+
+**Patterns to follow:**
+- Existing Keep a Changelog-style root file
+- Brainstorm decision favoring centralized history over fragmented per-plugin changelogs
+
+**Test scenarios:**
+- Historical root changelog entries remain intact after migration.
+- New generated entries appear in the root changelog in the intended component-version format.
+- Multiple components released on the same day appear as separate adjacent entries rather than being merged into one release-event block.
+- Component-specific notes do not leak unrelated changes into the wrong entry.
+- Plugin-local CE changelog no longer acts as a live release target.
+
+**Verification:**
+- A maintainer reading the repo can identify one canonical changelog without ambiguity.
+- No history is lost or silently rewritten.
+
+- [x] **Unit 5: Remove legacy release guidance and replace it with the new authority model**
+
+**Goal:** Update repo instructions and docs so contributors follow the new release system rather than obsolete semantic-release or `release-docs` guidance.
+
+**Requirements:** R10, R11, R12, R19, R20
+
+**Dependencies:** Units 1-4
+
+**Files:**
+- Modify: `AGENTS.md`
+- Modify: `CLAUDE.md`
+- Modify: `plugins/compound-engineering/AGENTS.md`
+- Modify: `docs/solutions/plugin-versioning-requirements.md`
+- Delete: `.claude/commands/release-docs.md` or replace with a deprecation stub
+
+**Approach:**
+- Update all contributor-facing docs so they describe release PR maintenance, manual release merge, centralized root changelog ownership, and the new scripts for sync/preview/validate.
+- Remove references that tell contributors to run `release-docs` or to rely on stale docs-generation assumptions.
+- Keep the contributor rule that release-owned metadata should not be hand-bumped in ordinary PRs, but point that rule at release automation rather than a local maintainer slash command.
+- Document the release-intent policy explicitly: conventional type required, component scope optional, breaking changes explicit.
+
+**Patterns to follow:**
+- Existing contributor guidance files already used as authoritative workflow docs
+
+**Test scenarios:**
+- No user-facing doc still points to `release-docs` as a required release workflow.
+- No contributor guidance still claims plugin-local changelog authority for CE.
+- Release ownership guidance is consistent across root and plugin-level instruction files.
+
+**Verification:**
+- A new maintainer can understand the release process from docs alone without hidden local workflows.
+- Docs no longer encode obsolete repo structure or stale release surfaces.
+
+- [x] **Unit 6: Add automated coverage for component detection, metadata sync, and release preview**
+
+**Goal:** Protect the new release model against regression by testing the component rules, metadata updates, and preview behavior.
+
+**Requirements:** R4, R5, R12, R13, R14, R15, R16, R17
+
+**Dependencies:** Units 1-5
+
+**Files:**
+- Create: `tests/release-metadata.test.ts`
+- Create: `tests/release-preview.test.ts`
+- Create: `tests/release-components.test.ts`
+- Modify: `package.json`
+
+**Approach:**
+- Add fixture-driven tests for file-change-to-component mapping.
+- Snapshot or assert dry-run summaries for representative release cases.
+- Verify metadata sync updates only expected files and counts.
+- Cover the marketplace-specific rule so plugin-only version changes do not trigger marketplace bumps.
+- Encode ambiguity-resolution cases explicitly so future contributors can add new plugins without guessing which component should bump.
+- Add validation coverage for release-intent parsing so conventional titles remain required but optional scopes remain non-blocking when omitted.
+- Add override-path coverage so manual bump overrides remain scoped, visible, and side-effect free in preview mode.
+
+**Patterns to follow:**
+- Existing top-level Bun test files under `tests/`
+- Current fixture-driven testing style used by converters and writers
+
+**Test scenarios:**
+- Change only `plugins/coding-tutor/**` and confirm only `coding-tutor` bumps.
+- Change only `plugins/compound-engineering/**` and confirm only CE bumps.
+- Change only marketplace catalog metadata and confirm only marketplace bumps.
+- Change only `src/**` and confirm only CLI bumps.
+- Combined `src/**` + plugin change yields both component bumps.
+- Change docs only and confirm no component bumps by default.
+- Add a new plugin directory plus marketplace catalog entry and confirm new-plugin + marketplace bump without forcing unrelated existing plugin bumps.
+- Dry-run preview lists the same components that the component detector identifies.
+- Conventional `fix:` / `feat:` titles without scope pass validation.
+- Explicit breaking-change markers are recognized.
+- Optional scopes, when present, can be compared against file ownership without becoming mandatory.
+- Override one component in preview and confirm only that component's effective bump changes.
+- Override does not create phantom bumps for untouched components.
+
+**Verification:**
+- The release model is covered by automated tests rather than only CI trial runs.
+- Future plugin additions can follow the same component-detection pattern with low risk.
+
+## System-Wide Impact
+
+- **Interaction graph:** Release config, CI workflows, metadata-bearing JSON files, contributor docs, and changelog generation are all coupled. The plan deliberately separates configuration, scripting, release PR maintenance, and documentation cleanup so one layer can change without obscuring another.
+- **Error propagation:** Release metadata drift should fail in preview/validation before a release PR or publish path proceeds. CI needs clear failure reporting because release mistakes affect user-facing version surfaces.
+- **State lifecycle risks:** Partial migration is risky. Running old and new release authorities simultaneously could double-write changelog entries, version fields, or publish flows. The migration should explicitly disable the old path before trusting the new one.
+- **API surface parity:** Contributor-facing workflows in `AGENTS.md`, `CLAUDE.md`, and plugin-level instructions must all describe the same release authority model or maintainers will continue using legacy local commands.
+- **Integration coverage:** Unit tests for scripts are not enough. The workflow interaction between release PR maintenance, dry-run preview, and conditional CLI publish needs at least one integration-level verification path in CI.
+
+## Risks & Dependencies
+
+- `release-please` may not natively express the exact root changelog shape you want; custom rendering may be required.
+- If old semantic-release and new release-please flows overlap during migration, duplicate or conflicting release writes are likely.
+- The distinction between version-bearing metadata and descriptive/count-bearing metadata must stay explicit; otherwise scripts may overwrite user-edited documentation that should remain manual.
+- Release preview quality matters. If dry run is vague or noisy, maintainers will bypass it and the manual batching goal will weaken.
+- Removing `release-docs` may expose other hidden docs/deploy assumptions, especially if GitHub Pages or docs generation still depend on stale paths.
+
+## Documentation / Operational Notes
+
+- Document one canonical release path: release PR maintenance on push to `main`, dry-run preview on manual dispatch, actual release on merge of the generated release PR.
+- Document one canonical changelog: root `CHANGELOG.md`.
+- Document one rule for contributors: ordinary feature PRs do not hand-bump release-owned versions or changelog entries.
+- Add a short migration note anywhere old release instructions are likely to be rediscovered, especially around `plugins/compound-engineering/CHANGELOG.md` and the removed `release-docs` command.
+- After merge, run one live GitHub Actions validation pass to confirm `release-please` tag/output wiring and conditional CLI publish behavior end to end.
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/2026-03-17-release-automation-requirements.md](docs/brainstorms/2026-03-17-release-automation-requirements.md)
+- Existing release workflow: `.github/workflows/publish.yml`
+- Existing semantic-release config: `.releaserc.json`
+- Existing release-owned guidance: `docs/solutions/plugin-versioning-requirements.md`
+- Legacy repo-maintenance command to retire: `.claude/commands/release-docs.md`
+- Install behavior reference: `src/commands/install.ts`
+- External docs: `release-please` manifest and release PR documentation, GitHub Actions `workflow_dispatch`
diff --git a/docs/plans/2026-03-18-001-feat-auto-memory-integration-beta-plan.md b/docs/plans/2026-03-18-001-feat-auto-memory-integration-beta-plan.md
new file mode 100644
index 0000000..fc46d9f
--- /dev/null
+++ b/docs/plans/2026-03-18-001-feat-auto-memory-integration-beta-plan.md
@@ -0,0 +1,163 @@
+---
+title: "feat: Integrate auto memory as data source for ce:compound and ce:compound-refresh"
+type: feat
+status: completed
+date: 2026-03-18
+origin: docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md
+---
+
+# Integrate Auto Memory as Data Source for ce:compound and ce:compound-refresh
+
+## Overview
+
+Add Claude Code's Auto Memory as a supplementary read-only data source for ce:compound and ce:compound-refresh. The orchestrator and investigation subagents check the auto memory directory for relevant notes that enrich documentation or signal drift in existing learnings.
+
+## Problem Frame
+
+Auto memory passively captures debugging insights, fix patterns, and preferences across sessions. After long sessions or compaction, it preserves insights that conversation context lost. For ce:compound-refresh, it may contain newer observations that signal drift without anyone flagging it. Neither skill currently leverages this free data source. (see origin: `docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md`)
+
+## Requirements Trace
+
+- R1. ce:compound uses auto memory as supplementary evidence -- orchestrator pre-reads MEMORY.md, passes relevant content to Context Analyzer and Solution Extractor subagents (see origin: R1)
+- R2. ce:compound-refresh investigation subagents check auto memory for drift signals in the learning's problem domain (see origin: R2)
+- R3. Graceful absence -- if auto memory doesn't exist or is empty, skills proceed unchanged with no errors (see origin: R3)
+
+## Scope Boundaries
+
+- Read-only -- neither skill writes to auto memory (see origin: Scope Boundaries)
+- No new subagents -- existing subagents are augmented (see origin: Key Decisions)
+- No changes to docs/solutions/ output structure (see origin: Scope Boundaries)
+- MEMORY.md only -- topic files deferred to future iteration
+- No changes to auto memory format or location (see origin: Scope Boundaries)
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `plugins/compound-engineering/skills/ce-compound/SKILL.md` -- Phase 1 subagents receive implicit context (conversation history); orchestrator coordinates launch and assembly
+- `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md` -- investigation subagents receive explicit task prompts with tool guidance; each returns evidence + recommended action
+- ce:compound-refresh already has an explicit "When spawning any subagent, include this instruction" block that can be extended naturally
+- ce:plan has a precedent pattern: orchestrator pre-reads source documents before launching agents (Phase 0 requirements doc scan)
+
+### Institutional Learnings
+
+- `docs/solutions/skill-design/compound-refresh-skill-improvements.md` -- replacement subagents pattern, tool guidance convention, context isolation principle
+- Plugin AGENTS.md tool selection rules: describe tools by capability class with platform hints, not by Claude Code-specific tool names alone
+
+## Key Technical Decisions
+
+- **Relevance matching via semantic judgment, not keyword algorithm**: MEMORY.md is max 200 lines. The orchestrator reads it in full and uses Claude's semantic understanding to identify entries related to the problem. No keyword matching logic needed. (Resolves origin: Deferred Q1)
+- **MEMORY.md only for this iteration**: Topic files are deferred. MEMORY.md as an index is sufficient for a first pass. Expanding to topic files adds complexity with uncertain value until the core integration is validated. (Resolves origin: Deferred Q2)
+- **Augment existing subagents, not a new one**: ce:compound-refresh investigation subagents need memory context during their investigation. A separate Memory Scanner subagent would deliver results too late. For ce:compound, the orchestrator pre-reads once and passes excerpts. (see origin: Key Decisions)
+- **Memory drift signals are supplementary, not primary**: A memory note alone cannot trigger Replace or Archive in ce:compound-refresh. Memory signals corroborate codebase evidence or prompt deeper investigation. In autonomous mode, memory-only drift results in stale-marking, not action.
+- **Provenance labeling required**: Memory excerpts passed to subagents must be wrapped in a clearly labeled section so subagents don't conflate them with verified conversation history.
+- **Conversation history is authoritative**: When memory contradicts the current session's verified fix, the fix takes priority. Memory contradictions can be noted as cautionary context.
+- **All partial memory states treated as absent**: No directory, no MEMORY.md, empty MEMORY.md, malformed MEMORY.md -- all result in graceful skip with no error or warning.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Which subagents receive memory in ce:compound?** Only Context Analyzer and Solution Extractor. The Related Docs Finder could benefit but starting narrow is safer. Can expand later.
+- **Compact-safe mode?** Still reads MEMORY.md. 200 lines is negligible context cost even in compact-safe mode. The orchestrator uses memory inline during its single pass.
+- **ce:compound-refresh: who reads MEMORY.md?** Each investigation subagent reads it via its task prompt instructions. The orchestrator does not pre-filter because each subagent knows its own investigation domain and 200 lines per read is cheap.
+- **Observability?** Add a line to ce:compound success output when memory contributed. Tag memory-sourced evidence in ce:compound-refresh reports. No changes to YAML frontmatter schema.
+
+### Deferred to Implementation
+
+- **Exact phrasing of subagent instruction additions**: The precise markdown wording will be refined during implementation to fit naturally with existing SKILL.md prose style.
+- **Whether to also augment the Related Docs Finder**: Deferred until after the initial integration shows whether the current scope is sufficient.
+
+## Implementation Units
+
+- [ ] **Unit 1: Add auto memory integration to ce:compound SKILL.md**
+
+**Goal:** Enable ce:compound to read auto memory and pass relevant notes to subagents as supplementary evidence.
+
+**Requirements:** R1, R3
+
+**Dependencies:** None
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/ce-compound/SKILL.md`
+
+**Approach:**
+- Insert a new "Phase 0.5: Auto Memory Scan" section between the Full Mode critical requirement block and Phase 1. This section instructs the orchestrator to:
+ 1. Read MEMORY.md from the auto memory directory (path known from system prompt context)
+ 2. If absent or empty, skip and proceed to Phase 1 unchanged
+ 3. Scan for entries related to the problem being documented
+ 4. Prepare a labeled excerpt block with provenance marking ("Supplementary notes from auto memory -- treat as additional context, not primary evidence")
+ 5. Pass the block as additional context to Context Analyzer and Solution Extractor task prompts
+- Augment the Context Analyzer description (under Phase 1) to note: incorporate auto memory excerpts as supplementary evidence when identifying problem type, component, and symptoms
+- Augment the Solution Extractor description (under Phase 1) to note: use auto memory excerpts as supplementary evidence; conversation history and the verified fix take priority; note contradictions as cautionary context
+- Add to Compact-Safe Mode step 1: also read MEMORY.md if it exists, use relevant notes as supplementary context inline
+- Add an optional line to the Success Output template: `Auto memory: N relevant entries used as supplementary evidence` (only when N > 0)
+
+**Patterns to follow:**
+- ce:plan's Phase 0 pattern of pre-reading source documents before launching agents
+- ce:compound-refresh's existing "When spawning any subagent" instruction block pattern
+- Plugin AGENTS.md convention: describe tools by capability class with platform hints
+
+**Test scenarios:**
+- Memory present with relevant entries: orchestrator identifies related notes and passes them to 2 subagents; final documentation is enriched
+- Memory present but no relevant entries: orchestrator reads MEMORY.md, finds nothing related, proceeds without passing memory context
+- Memory absent (no directory): skill proceeds exactly as before with no error
+- Memory empty (directory exists, MEMORY.md is empty or boilerplate): skill proceeds exactly as before
+- Compact-safe mode with memory: single-pass flow uses memory inline alongside conversation history
+- Post-compaction session: memory notes about the fix compensate for lost conversation context
+
+**Verification:**
+- The modified SKILL.md reads naturally with the new sections integrated into the existing flow
+- The Phase 0.5 section clearly describes the graceful absence behavior
+- The subagent augmentations specify provenance labeling
+- The success output template shows the optional memory line
+- `bun run release:validate` passes
+
+- [ ] **Unit 2: Add auto memory checking to ce:compound-refresh SKILL.md**
+
+**Goal:** Enable ce:compound-refresh investigation subagents to use auto memory as a supplementary drift signal source.
+
+**Requirements:** R2, R3
+
+**Dependencies:** None (can be done in parallel with Unit 1)
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md`
+
+**Approach:**
+- Add "Auto memory" as a fifth investigation dimension in Phase 1 (after References, Recommended solution, Code examples, Related docs). Instruct: check MEMORY.md from the auto memory directory for notes in the same problem domain. A memory note describing a different approach is a supplementary drift signal. If MEMORY.md doesn't exist or is empty, skip this dimension.
+- Add a paragraph to the Drift Classification section (after Update/Replace territory) explaining memory signal weight: memory drift signals are supplementary; they corroborate codebase-sourced drift or prompt deeper investigation but cannot alone justify Replace or Archive; in autonomous mode, memory-only drift results in stale-marking not action
+- Extend the existing "When spawning any subagent" instruction block to include: read MEMORY.md from auto memory directory if it exists; check for notes related to the learning's problem domain; report memory-sourced drift signals separately, tagged with "(auto memory)" in the evidence section
+- Update the output format guidance to note that memory-sourced findings should be tagged `(auto memory)` to distinguish from codebase-sourced evidence
+
+**Patterns to follow:**
+- The existing investigation dimensions structure in Phase 1 (References, Recommended solution, Code examples, Related docs)
+- The existing "When spawning any subagent" instruction block
+- The existing drift classification guidance style (Update territory vs Replace territory)
+- Plugin AGENTS.md convention: describe tools by capability class with platform hints
+
+**Test scenarios:**
+- Memory contains note contradicting a learning's recommended approach: investigation subagent reports it as "(auto memory)" drift signal alongside codebase evidence
+- Memory contains note confirming the learning's approach: no drift signal, learning stays as Keep
+- Memory-only drift (codebase still matches the learning): in interactive mode, drift is noted but does not alone change classification; in autonomous mode, results in stale-marking
+- Memory absent: investigation proceeds exactly as before, fifth dimension is skipped
+- Broad scope refresh with memory: each parallel investigation subagent independently reads MEMORY.md
+- Report output: memory-sourced evidence is visually distinguishable from codebase evidence
+
+**Verification:**
+- The modified SKILL.md reads naturally with the new dimension and drift guidance integrated
+- The "When spawning any subagent" block cleanly includes memory instructions alongside existing tool guidance
+- The drift classification section clearly states that memory signals are supplementary
+- `bun run release:validate` passes
+
+## Risks & Dependencies
+
+- **Auto memory format changes**: If Claude Code changes the MEMORY.md format in a future release, these skills may need updating. Mitigated by the fact that the skills only instruct Claude to "read MEMORY.md" -- Claude's own semantic understanding handles format interpretation.
+- **Assumption: system prompt contains memory path**: If this assumption breaks, skills would skip memory (graceful absence). The assumption is currently stable across Claude Code versions.
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md](docs/brainstorms/2026-03-18-auto-memory-integration-requirements.md) -- Key decisions: augment existing subagents, read-only, graceful absence, orchestrator pre-read for ce:compound
+- Related code: `plugins/compound-engineering/skills/ce-compound/SKILL.md`, `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md`
+- Institutional learning: `docs/solutions/skill-design/compound-refresh-skill-improvements.md`
+- External docs: https://code.claude.com/docs/en/memory#auto-memory
diff --git a/docs/plans/2026-03-22-001-feat-frontend-design-skill-rewrite-beta-plan.md b/docs/plans/2026-03-22-001-feat-frontend-design-skill-rewrite-beta-plan.md
new file mode 100644
index 0000000..dcf0e07
--- /dev/null
+++ b/docs/plans/2026-03-22-001-feat-frontend-design-skill-rewrite-beta-plan.md
@@ -0,0 +1,190 @@
+---
+title: "feat: Rewrite frontend-design skill with layered architecture and visual verification"
+type: feat
+status: completed
+date: 2026-03-22
+origin: docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md
+---
+
+# feat: Rewrite frontend-design skill with layered architecture and visual verification
+
+## Overview
+
+Rewrite the `frontend-design` skill from a 43-line aesthetic manifesto into a structured, layered skill that detects existing design systems, provides context-specific guidance, and verifies its own output via browser screenshots. Add a surgical trigger in `ce-work-beta` to load the skill for UI tasks without Figma designs.
+
+## Problem Frame
+
+The current skill provides vague creative encouragement ("be bold", "choose a BOLD aesthetic direction") but lacks practical structure. It has no mechanism to detect existing design systems, no context-specific guidance (landing pages vs dashboards vs components in existing apps), no concrete constraints, no accessibility guidance, and no verification step. The beta workflow (`ce:plan-beta` -> `deepen-plan-beta` -> `ce:work-beta`) has no way to invoke it -- the skill is effectively orphaned.
+
+Two external sources informed the redesign: Anthropic's official frontend-design skill (nearly identical to ours, same gaps) and OpenAI's comprehensive frontend skill from March 2026 (see origin: `docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md`).
+
+## Requirements Trace
+
+- R1. Detect existing design systems before applying opinionated guidance (Layer 0)
+- R2. Enforce authority hierarchy: existing design system > user instructions > skill defaults
+- R3. Provide pre-build planning step (visual thesis, content plan, interaction plan)
+- R4. Cover typography, color, composition, motion, accessibility, and imagery with concrete constraints
+- R5. Provide context-specific modules: landing pages, apps/dashboards, components/features
+- R6. Module C (components/features) is the default when working in an existing app
+- R7. Two-tier anti-pattern system: overridable defaults vs quality floor
+- R8. Visual self-verification via browser screenshot with tool cascade
+- R9. Cross-agent compatibility (Claude Code, Codex, Gemini CLI)
+- R10. ce-work-beta loads the skill for UI tasks without Figma designs
+- R11. Verification screenshot reuse -- skill's screenshot satisfies ce-work-beta Phase 4's requirement
+
+## Scope Boundaries
+
+- The `frontend-design` skill itself handles all design guidance and verification. ce-work-beta gets only a trigger.
+- ce-work (non-beta) is not modified.
+- The design-iterator agent is not modified. The skill does not invoke it.
+- The agent-browser skill is upstream-vendored and not modified.
+- The design-iterator's `` block (which duplicates current skill content) is not cleaned up in this plan -- that is a separate follow-up.
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `plugins/compound-engineering/skills/frontend-design/SKILL.md` -- target for full rewrite (43 lines currently)
+- `plugins/compound-engineering/skills/ce-work-beta/SKILL.md` -- target for surgical Phase 2 addition (lines 210-219, between Figma Design Sync and Track Progress)
+- `plugins/compound-engineering/skills/ce-plan-beta/SKILL.md` -- reference for cross-agent interaction patterns (Pattern A: platform's blocking question tool with named equivalents)
+- `plugins/compound-engineering/skills/reproduce-bug/SKILL.md` -- reference for cross-agent patterns
+- `plugins/compound-engineering/skills/agent-browser/SKILL.md` -- upstream-vendored, reference for browser automation CLI
+- `plugins/compound-engineering/agents/design/design-iterator.md` -- contains `` block that overlaps with current skill; new skill will supersede this when both are loaded
+- `plugins/compound-engineering/AGENTS.md` -- skill compliance checklist (cross-platform interaction, tool selection, reference rules)
+
+### Institutional Learnings
+
+- **Cross-platform tool references** (`docs/solutions/skill-design/compound-refresh-skill-improvements.md`): Never hardcode a single tool name with an escape hatch. Use capability-first language with platform examples and plain-text fallback. Anti-pattern table directly applicable.
+- **Beta skills framework** (`docs/solutions/skill-design/beta-skills-framework.md`): frontend-design is NOT a beta skill -- it is a stable skill being improved. ce-work-beta should reference it by its stable name.
+- **Codex skill conversion** (`docs/solutions/codex-skill-prompt-entrypoints.md`): Skills are copied as-is to Codex. Slash references inside SKILL.md are NOT rewritten. Use semantic wording ("load the `agent-browser` skill") rather than slash syntax.
+- **Context token budget** (`docs/plans/2026-02-08-refactor-reduce-plugin-context-token-usage-plan.md`): Description field's only job is discovery. The proposed 6-line description is well-sized for the budget.
+- **Script-first architecture** (`docs/solutions/skill-design/script-first-skill-architecture.md`): When a skill's core value IS the model's judgment, script-first does not apply. Frontend-design is judgment-based. Detection checklist should be inline, not in reference files.
+
+## Key Technical Decisions
+
+- **No `disable-model-invocation`**: The skill should auto-invoke when the model detects frontend work. Current skill does not have it; the rewrite preserves this.
+- **Drop `license` frontmatter field**: Only the current frontend-design skill has this field. No other skill uses it. Drop it for consistency.
+- **Inline everything in SKILL.md**: No reference files or scripts directory. The skill is pure guidance (~300-400 lines of markdown). The detection checklist, context modules, anti-patterns, litmus checks, and verification cascade all live in one file.
+- **Fix ce-work-beta duplicate numbering**: The current Phase 2 has two items numbered "6." (Figma Design Sync and Track Progress). Fix this while inserting the new section.
+- **Framework-conditional animation defaults**: CSS animations as universal baseline. Framer Motion for React, Vue Transition / Motion One for Vue, Svelte transitions for Svelte. Only when no existing animation library is detected.
+- **Semantic skill references only**: Reference agent-browser as "load the `agent-browser` skill" not `/agent-browser`. Per AGENTS.md and Codex conversion learnings.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Should the skill have `disable-model-invocation: true`?** No. It should auto-invoke for frontend work. The current skill does not have it.
+- **Should Module A/B ever apply in an existing app?** No. When working inside an existing app, always default to Module C regardless of what's being built. Modules A and B are for greenfield work.
+- **Should the `license` field be kept?** No. It is unique to this skill and inconsistent with all other skills.
+
+### Deferred to Implementation
+
+- **Exact line count of the rewritten skill**: Estimated 300-400 lines. The implementer should prioritize clarity over brevity but avoid bloat.
+- **Whether the design-iterator's `` block needs updating**: Out of scope. The new skill supersedes it when loaded. Cleanup is a separate follow-up.
+
+## Implementation Units
+
+- [x] **Unit 1: Rewrite frontend-design SKILL.md**
+
+ **Goal:** Replace the 43-line aesthetic manifesto with the full layered skill covering detection, planning, guidance, context modules, anti-patterns, litmus checks, and visual verification.
+
+ **Requirements:** R1, R2, R3, R4, R5, R6, R7, R8, R9
+
+ **Dependencies:** None
+
+ **Files:**
+ - Modify: `plugins/compound-engineering/skills/frontend-design/SKILL.md`
+
+ **Approach:**
+ - Full rewrite preserving only the `name` field from current frontmatter
+ - Use the optimized description from the brainstorm doc (see origin: Section "Skill Description (Optimized)")
+ - Structure as: Frontmatter -> Preamble (authority hierarchy, workflow preview) -> Layer 0 (context detection with concrete checklist, mode classification, cross-platform question pattern) -> Layer 1 (pre-build planning) -> Layer 2 (design guidance core with subsections for typography, color, composition, motion, accessibility, imagery) -> Context Modules (A/B/C) -> Hard Rules & Anti-Patterns (two tiers) -> Litmus Checks -> Visual Verification (tool cascade with scope control)
+ - Carry forward from current skill: anti-AI-slop identity, creative energy for greenfield, tone-picking exercise, differentiation prompt
+ - Apply AGENTS.md skill compliance checklist: imperative voice, capability-first tool references with platform examples, semantic skill references, no shell recipes for exploration, cross-platform question patterns with fallback
+ - All rules framed as defaults that yield to existing design systems and user instructions
+ - Copy guidance uses "Every sentence should earn its place. Default to less copy, not more." (not arbitrary percentage thresholds)
+ - Animation defaults are framework-conditional: CSS baseline, then Framer Motion (React), Vue Transition/Motion One (Vue), Svelte transitions (Svelte)
+ - Visual verification cascade: existing project tooling -> browser MCP tools -> agent-browser CLI (load the `agent-browser` skill for setup) -> mental review as last resort
+ - One verification pass with scope control ("sanity check, not pixel-perfect review")
+ - Note relationship to design-iterator: "For iterative refinement beyond a single pass, see the `design-iterator` agent"
+
+ **Patterns to follow:**
+ - `plugins/compound-engineering/skills/ce-plan-beta/SKILL.md` -- cross-agent interaction pattern (Pattern A)
+ - `plugins/compound-engineering/skills/reproduce-bug/SKILL.md` -- cross-agent tool reference pattern
+ - `plugins/compound-engineering/AGENTS.md` -- skill compliance checklist
+ - `docs/solutions/skill-design/compound-refresh-skill-improvements.md` -- anti-pattern table for tool references
+
+ **Test scenarios:**
+ - Skill passes all items in the AGENTS.md skill compliance checklist
+ - Description field is present and follows "what + when" format
+ - No hardcoded Claude-specific tool names without platform equivalents
+ - No slash references to other skills (uses semantic wording)
+ - No `TodoWrite`/`TodoRead` references
+ - No shell commands for routine file exploration
+ - Cross-platform question pattern includes AskUserQuestion, request_user_input, ask_user, and a fallback
+ - All design rules explicitly framed as defaults (not absolutes)
+ - Layer 0 detection checklist is concrete (specific file patterns and config names)
+ - Mode classification has clear thresholds (4+ signals = existing, 1-3 = partial, 0 = greenfield)
+ - Visual verification section references agent-browser semantically ("load the `agent-browser` skill")
+
+ **Verification:**
+ - `grep -E 'description:' plugins/compound-engineering/skills/frontend-design/SKILL.md` returns the optimized description
+ - `grep -E '^\`(references|assets|scripts)/[^\`]+\`' plugins/compound-engineering/skills/frontend-design/SKILL.md` returns nothing (no unlinked references)
+ - Manual review confirms the layered structure matches the brainstorm doc's "Skill Structure" outline
+ - `bun run release:validate` passes
+
+- [x] **Unit 2: Add frontend-design trigger to ce-work-beta Phase 2**
+
+ **Goal:** Insert a conditional section in ce-work-beta Phase 2 that loads the `frontend-design` skill for UI tasks without Figma designs, and fix the duplicate item numbering.
+
+ **Requirements:** R10, R11
+
+ **Dependencies:** Unit 1 (the skill must exist in its new form for the reference to be meaningful)
+
+ **Files:**
+ - Modify: `plugins/compound-engineering/skills/ce-work-beta/SKILL.md`
+
+ **Approach:**
+ - Insert new section after Figma Design Sync (line 217) and before Track Progress (line 219)
+ - New section titled "Frontend Design Guidance" (if applicable), following the same conditional pattern as Figma Design Sync
+ - Content: UI task detection heuristic (implementation files include views/templates/components/layouts/pages, creates user-visible routes, plan text contains UI/frontend/design language, or task builds something user-visible in browser) + instruction to load the `frontend-design` skill + note that the skill's verification screenshot satisfies Phase 4's screenshot requirement
+ - Fix duplicate "6." numbering: Figma Design Sync = 6, Frontend Design Guidance = 7, Track Progress = 8
+ - Keep the addition to ~10 lines including the heuristic and the verification-reuse note
+ - Use semantic skill reference: "load the `frontend-design` skill" (not slash syntax)
+
+ **Patterns to follow:**
+ - The existing Figma Design Sync section (lines 210-217) -- same conditional "(if applicable)" pattern, same level of brevity
+
+ **Test scenarios:**
+ - New section follows same formatting as Figma Design Sync section
+ - No duplicate item numbers in Phase 2
+ - Semantic skill reference used (no slash syntax for frontend-design)
+ - Verification screenshot reuse is explicit
+ - `bun run release:validate` passes
+
+ **Verification:**
+ - Phase 2 items are numbered sequentially without duplicates
+ - The new section references `frontend-design` skill semantically
+ - The verification-reuse note is present
+ - `bun run release:validate` passes
+
+## System-Wide Impact
+
+- **Interaction graph:** The frontend-design skill is auto-invocable (no `disable-model-invocation`). When loaded, it may interact with: agent-browser CLI (for verification screenshots), browser MCP tools, or existing project browser tooling. ce-work-beta Phase 2 will conditionally trigger the skill load. The design-iterator agent's `` block will be superseded when both the skill and agent are active in the same context.
+- **Error propagation:** If browser tooling is unavailable for verification, the skill falls back to mental review. No hard failure path.
+- **State lifecycle risks:** None. This is markdown document work -- no runtime state, no data, no migrations.
+- **API surface parity:** The skill description change affects how Claude discovers and triggers the skill. The new description is broader (covers existing app modifications) which may increase trigger rate.
+- **Integration coverage:** The primary integration is ce-work-beta -> frontend-design skill -> agent-browser. This flow should be manually tested end-to-end with a UI task in the beta workflow.
+
+## Risks & Dependencies
+
+- **Trigger rate change:** The broader description may cause the skill to trigger for borderline cases (e.g., a task that touches one CSS class). Mitigated by the Layer 0 detection step which will quickly identify "existing system" mode and short-circuit most opinionated guidance.
+- **Skill length:** Estimated 300-400 lines is substantial for a skill body. Mitigated by the layered architecture -- an agent in "existing system" mode can skip Layer 2's opinionated sections entirely.
+- **design-iterator overlap:** The design-iterator's `` block now partially duplicates the skill's Layer 2 content. Not a functional problem (the skill supersedes when loaded) but creates maintenance overhead. Flagged for follow-up cleanup.
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md](docs/brainstorms/2026-03-22-frontend-design-skill-improvement.md)
+- Related code: `plugins/compound-engineering/skills/frontend-design/SKILL.md`, `plugins/compound-engineering/skills/ce-work-beta/SKILL.md`
+- External inspiration: Anthropic official frontend-design skill, OpenAI "Designing Delightful Frontends with GPT-5.4" skill (March 2026)
+- Institutional learnings: `docs/solutions/skill-design/compound-refresh-skill-improvements.md`, `docs/solutions/skill-design/beta-skills-framework.md`, `docs/solutions/codex-skill-prompt-entrypoints.md`
diff --git a/docs/plans/2026-03-23-001-feat-ce-review-beta-pipeline-mode-beta-plan.md b/docs/plans/2026-03-23-001-feat-ce-review-beta-pipeline-mode-beta-plan.md
new file mode 100644
index 0000000..4ef0fbe
--- /dev/null
+++ b/docs/plans/2026-03-23-001-feat-ce-review-beta-pipeline-mode-beta-plan.md
@@ -0,0 +1,316 @@
+---
+title: "feat: Make ce:review-beta autonomous and pipeline-safe"
+type: feat
+status: active
+date: 2026-03-23
+origin: direct user request and planning discussion on ce:review-beta standalone vs. autonomous pipeline behavior
+---
+
+# Make ce:review-beta Autonomous and Pipeline-Safe
+
+## Overview
+
+Redesign `ce:review-beta` from a purely interactive standalone review workflow into a policy-driven review engine that supports three explicit modes: `interactive`, `autonomous`, and `report-only`. The redesign should preserve the current standalone UX for manual review, enable hands-off review and safe autofix in automated workflows, and define a clean residual-work handoff for anything that should not be auto-fixed. This plan remains beta-only; promotion to stable `ce:review` and any `lfg` / `slfg` cutover should happen only in a follow-up plan after the beta behavior is validated.
+
+## Problem Frame
+
+`ce:review-beta` currently mixes three responsibilities in one loop:
+
+1. Review and synthesis
+2. Human approval on what to fix
+3. Local fixing, re-review, and push/PR next steps
+
+That is acceptable for standalone use, but it is the wrong shape for autonomous orchestration:
+
+- `lfg` currently treats review as an upstream producer before downstream resolution and browser testing
+- `slfg` currently runs review and browser testing in parallel, which is only safe if review is non-mutating
+- `resolve-todo-parallel` expects a durable residual-work contract (`todos/`), while `ce:review-beta` currently tries to resolve accepted findings inline
+- The findings schema lacks routing metadata, so severity is doing too much work; urgency and autofix eligibility are distinct concerns
+
+The result is a workflow that is hard to promote safely: it can be interactive, or autonomous, or mutation-owning, but not all three at once without an explicit mode model and clearer ownership boundaries.
+
+## Requirements Trace
+
+- R1. `ce:review-beta` supports explicit execution modes: `interactive` (default), `autonomous`, and `report-only`
+- R2. `autonomous` mode never asks the user questions, never waits for approval, and applies only policy-allowed safe fixes
+- R3. `report-only` mode is strictly read-only and safe to run in parallel with other read-only verification steps
+- R4. Findings are routed by explicit fixability metadata, not by severity alone
+- R5. `ce:review-beta` can run one bounded in-skill autofix pass for `safe_auto` findings and then re-review the changed scope
+- R6. Residual actionable findings are emitted as durable downstream work artifacts; advisory outputs remain report-only
+- R7. CE helper outputs (`learnings`, `agent-native`, `schema-drift`, `deployment-verification`) are preserved but only some become actionable work items
+- R8. The beta contract makes future orchestration constraints explicit so a later `lfg` / `slfg` cutover does not run a mutating review concurrently with browser testing on the same checkout
+- R9. Repeated regression classes around interaction mode, routing, and orchestration boundaries gain lightweight contract coverage
+
+## Scope Boundaries
+
+- Keep the existing persona ensemble, confidence gate, and synthesis model as the base architecture
+- Do not redesign every reviewer persona's prompt beyond the metadata they need to emit
+- Do not introduce a new general-purpose orchestration framework; reuse existing skill patterns where possible
+- Do not auto-fix deployment checklists, residual risks, or other advisory-only outputs
+- Do not attempt broad converter/platform work in this change unless the review skill's frontmatter or references require it
+- Beta remains the only implementation target in this plan; stable promotion is intentionally deferred to a follow-up plan after validation
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+ - Current staged review pipeline with interactive severity acceptance, inline fixer, re-review offer, and post-fix push/PR actions
+- `plugins/compound-engineering/skills/ce-review-beta/references/findings-schema.json`
+ - Structured persona finding contract today; currently missing routing metadata for autonomous handling
+- `plugins/compound-engineering/skills/ce-review/SKILL.md`
+ - Current stable review workflow; creates durable `todos/` artifacts rather than fixing findings inline
+- `plugins/compound-engineering/skills/resolve-todo-parallel/SKILL.md`
+ - Existing residual-work resolver; parallelizes item handling once work has already been externalized
+- `plugins/compound-engineering/skills/file-todos/SKILL.md`
+ - Existing review -> triage -> todo -> resolve integration contract
+- `plugins/compound-engineering/skills/lfg/SKILL.md`
+ - Sequential orchestrator whose future cutover constraints should inform the beta contract, even though this plan does not modify it
+- `plugins/compound-engineering/skills/slfg/SKILL.md`
+ - Swarm orchestrator whose current review/browser parallelism defines an important future integration constraint, even though this plan does not modify it
+- `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md`
+ - Strong repo precedent for explicit `mode:autonomous` argument handling and conservative non-interactive behavior
+- `plugins/compound-engineering/skills/ce-plan/SKILL.md`
+ - Strong repo precedent for pipeline mode skipping interactive questions
+
+### Institutional Learnings
+
+- `docs/solutions/skill-design/compound-refresh-skill-improvements.md`
+ - Explicit autonomous mode beats tool-based auto-detection
+ - Ambiguous cases in autonomous mode should be recorded conservatively, not guessed
+ - Report structure should distinguish applied actions from recommended follow-up
+- `docs/solutions/skill-design/beta-skills-framework.md`
+ - Beta skills should remain isolated until validated
+ - Promotion is the right time to rewire `lfg` / `slfg`, which is out of scope for this plan
+
+### External Research Decision
+
+Skipped. This is a repo-internal orchestration and skill-design change with strong existing local patterns for autonomous mode, beta promotion, and residual-work handling.
+
+## Key Technical Decisions
+
+- **Use explicit mode arguments instead of auto-detection.** Follow `ce:compound-refresh` and require `mode:autonomous` / `mode:report-only` arguments. Interactive remains the default. This avoids conflating "no question tool" with "headless workflow."
+- **Split review from mutation semantically, not by creating two separate skills.** `ce:review-beta` should always perform the same review and synthesis stages. Mutation behavior becomes a mode-controlled phase layered on top.
+- **Route by fixability, not severity.** Add explicit per-finding routing fields such as `autofix_class`, `owner`, and `requires_verification`. Severity remains urgency; it no longer implies who acts.
+- **Keep one in-skill fixer, but only for `safe_auto` findings.** The current "one fixer subagent" rule is still right for consistent-tree edits. The change is that the fixer is selected by policy and routing metadata, not by an interactive severity prompt.
+- **Emit both ephemeral and durable outputs.** Use `.context/compound-engineering/ce-review-beta//` for the per-run machine-readable report and create durable `todos/` items only for unresolved actionable findings that belong downstream.
+- **Treat CE helper outputs by artifact class.**
+ - `learnings-researcher`: contextual/advisory unless a concrete finding corroborates it
+ - `agent-native-reviewer`: often `gated_auto` or `manual`, occasionally `safe_auto` when the fix is purely local and mechanical
+ - `schema-drift-detector`: default `manual` or `gated_auto`; never auto-fix blindly by default
+ - `deployment-verification-agent`: always advisory / operational, never autofix
+- **Design the beta contract so future orchestration cutover is safe.** The beta must make it explicit that mutating review cannot run concurrently with browser testing on the same checkout. That requirement is part of validation and future cutover criteria, not a same-plan rewrite of `slfg`.
+- **Move push / PR creation decisions out of autonomous review.** Interactive standalone mode may still offer next-step prompts. Autonomous and report-only modes should stop after producing fixes and/or residual artifacts; any future parent workflow decides commit, push, and PR timing.
+- **Add lightweight contract tests.** Repeated regressions have come from instruction-boundary drift. String- and structure-level contract tests are justified here even though the behavior is prompt-driven.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Should `ce:review-beta` keep any embedded fix loop?** Yes, but only for `safe_auto` findings under an explicit mode/policy. Residual work is handed off.
+- **Should autonomous mode be inferred from lack of interactivity?** No. Use explicit `mode:autonomous`.
+- **Should `slfg` keep review and browser testing in parallel?** No, not once review can mutate the checkout. Run browser testing after the mutating review phase on the stabilized tree.
+- **Should residual work be `todos/`, `.context/`, or both?** Both. `.context` holds the run artifact; `todos/` is only for durable unresolved actionable work.
+
+### Deferred to Implementation
+
+- Exact metadata field names in `findings-schema.json`
+- Whether `report-only` should imply a different default output template section ordering than `interactive` / `autonomous`
+- Whether residual `todos/` should be created directly by `ce:review-beta` or via a small shared helper/reference template used by both review and resolver flows
+
+## High-Level Technical Design
+
+This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.
+
+```text
+review stages -> synthesize -> classify outputs by autofix_class/owner
+ -> if mode=report-only: emit report + stop
+ -> if mode=interactive: acquire policy from user
+ -> if mode=autonomous: use policy from arguments/defaults
+ -> run single fixer on safe_auto set
+ -> verify tests + focused re-review
+ -> emit residual todos for unresolved actionable items
+ -> emit advisory/report sections for non-actionable outputs
+```
+
+## Implementation Units
+
+- [x] **Unit 1: Add explicit mode handling and routing metadata to ce:review-beta**
+
+**Goal:** Give `ce:review-beta` a clear execution contract for standalone, autonomous, and read-only pipeline use.
+
+**Requirements:** R1, R2, R3, R4, R7
+
+**Dependencies:** None
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/references/findings-schema.json`
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/references/review-output-template.md`
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/references/subagent-template.md` (if routing metadata needs to be spelled out in spawn prompts)
+
+**Approach:**
+- Add a Mode Detection section near the top of `SKILL.md` using the established `mode:autonomous` argument pattern from `ce:compound-refresh`
+- Introduce `mode:report-only` alongside `mode:autonomous`
+- Scope all interactive question instructions so they apply only to interactive mode
+- Extend `findings-schema.json` with routing-oriented fields such as:
+ - `autofix_class`: `safe_auto | gated_auto | manual | advisory`
+ - `owner`: `review-fixer | downstream-resolver | human | release`
+ - `requires_verification`: boolean
+- Update the review output template so the final report can distinguish:
+ - applied fixes
+ - residual actionable work
+ - advisory / operational notes
+
+**Patterns to follow:**
+- `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md` explicit autonomous mode structure
+- `plugins/compound-engineering/skills/ce-plan/SKILL.md` pipeline-mode question skipping
+
+**Test scenarios:**
+- Interactive mode still presents questions and next-step prompts
+- `mode:autonomous` never asks a question and never waits for user input
+- `mode:report-only` performs no edits and no commit/push/PR actions
+- A helper-agent output can be preserved in the final report without being treated as auto-fixable work
+
+**Verification:**
+- `tests/review-skill-contract.test.ts` asserts the three mode markers and interactive scoping rules
+- `bun run release:validate` passes
+
+- [x] **Unit 2: Redesign the fix loop around policy-driven safe autofix and bounded re-review**
+
+**Goal:** Replace the current severity-prompt-centric fix loop with one that works in both interactive and autonomous contexts.
+
+**Requirements:** R2, R4, R5, R7
+
+**Dependencies:** Unit 1
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+- Add: `plugins/compound-engineering/skills/ce-review-beta/references/fix-policy.md` (if the classification and policy table becomes too large for `SKILL.md`)
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/references/review-output-template.md`
+
+**Approach:**
+- Replace "Severity Acceptance" as the primary decision point with a classification stage that groups synthesized findings by `autofix_class`
+- In interactive mode, ask the user only for policy decisions that remain ambiguous after classification
+- In autonomous mode, use conservative defaults:
+ - apply `safe_auto`
+ - leave `gated_auto`, `manual`, and `advisory` unresolved
+- Keep the "exactly one fixer subagent" rule for consistency
+- Bound the loop with `max_rounds` (for example 2) and require targeted verification plus focused re-review after any applied fix set
+- Restrict commit / push / PR creation steps to interactive mode only; autonomous and report-only modes stop after emitting outputs
+
+**Patterns to follow:**
+- `docs/solutions/skill-design/compound-refresh-skill-improvements.md` applied-vs-recommended distinction
+- Existing `ce-review-beta` single-fixer rule
+
+**Test scenarios:**
+- A `safe_auto` testing finding gets fixed and re-reviewed without user input in autonomous mode
+- A `gated_auto` API contract or authz finding is preserved as residual actionable work, not auto-fixed
+- A deployment checklist remains advisory and never enters the fixer queue
+- Zero findings skip the fix phase entirely
+- Re-review is bounded and does not recurse indefinitely
+
+**Verification:**
+- `tests/review-skill-contract.test.ts` asserts that autonomous mode has no mandatory user-question step in the fix path
+- Manual dry run: read the fix-loop prose end-to-end and verify there is no mutation-owning step outside the policy gate
+
+- [x] **Unit 3: Define residual artifact and downstream handoff behavior**
+
+**Goal:** Make autonomous review compatible with downstream workflows instead of competing with them.
+
+**Requirements:** R5, R6, R7
+
+**Dependencies:** Unit 2
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+- Modify: `plugins/compound-engineering/skills/resolve-todo-parallel/SKILL.md`
+- Modify: `plugins/compound-engineering/skills/file-todos/SKILL.md`
+- Add: `plugins/compound-engineering/skills/ce-review-beta/references/residual-work-template.md` (if a dedicated durable-work shape helps keep review prose smaller)
+
+**Approach:**
+- Write a per-run review artifact under `.context/compound-engineering/ce-review-beta//` containing:
+ - synthesized findings
+ - what was auto-fixed
+ - what remains unresolved
+ - advisory-only outputs
+- Create durable `todos/` items only for unresolved actionable findings whose `owner` is downstream resolution
+- Update `resolve-todo-parallel` to acknowledge this source explicitly so residual review work can be picked up without pretending everything came from stable `ce:review`
+- Update `file-todos` integration guidance to reflect the new flow:
+ - review-beta autonomous -> residual todos -> resolve-todo-parallel
+ - advisory-only outputs do not become todos
+
+**Patterns to follow:**
+- `.context/compound-engineering///` scratch-space convention from `AGENTS.md`
+- Existing `file-todos` review/resolution lifecycle
+
+**Test scenarios:**
+- Autonomous review with only advisory outputs creates no todos
+- Autonomous review with 2 unresolved actionable findings creates exactly 2 residual todos
+- Residual work items exclude protected-artifact cleanup suggestions
+- The run artifact is sufficient to explain what the in-skill fixer changed vs. what remains
+
+**Verification:**
+- `tests/review-skill-contract.test.ts` asserts the documented `.context` and `todos/` handoff rules
+- `bun run release:validate` passes after any skill inventory/reference changes
+
+- [x] **Unit 4: Add contract-focused regression coverage for mode, handoff, and future-integration boundaries**
+
+**Goal:** Catch the specific instruction-boundary regressions that have repeatedly escaped manual review.
+
+**Requirements:** R8, R9
+
+**Dependencies:** Units 1-3
+
+**Files:**
+- Add: `tests/review-skill-contract.test.ts`
+- Optionally modify: `package.json` only if a new test entry point is required (prefer using the existing Bun test setup without package changes)
+
+**Approach:**
+- Add a focused test that reads the relevant skill files and asserts contract-level invariants instead of brittle full-file snapshots
+- Cover:
+ - `ce-review-beta` mode markers and mode-specific behavior phrases
+ - absence of unconditional interactive prompts in autonomous/report-only paths
+ - explicit residual-work handoff language
+ - explicit documentation that mutating review must not run concurrently with browser testing on the same checkout
+- Keep assertions semantic and localized; avoid snapshotting large markdown files
+
+**Patterns to follow:**
+- Existing Bun tests that read repository files directly for release/config validation
+
+**Test scenarios:**
+- Missing `mode:autonomous` block fails
+- Reintroduced unconditional "Ask the user" text in the autonomous path fails
+- Missing residual todo handoff text fails
+- Missing future integration constraint around mutating review vs. browser testing fails
+
+**Verification:**
+- `bun test tests/review-skill-contract.test.ts`
+- full `bun test`
+
+## Risks & Dependencies
+
+- **Over-aggressive autofix classification.**
+ - Mitigation: conservative defaults, `gated_auto` bucket, bounded rounds, focused re-review
+- **Dual ownership confusion between `ce:review-beta` and `resolve-todo-parallel`.**
+ - Mitigation: explicit owner/routing metadata and durable residual-work contract
+- **Brittle contract tests.**
+ - Mitigation: assert only boundary invariants, not full markdown snapshots
+- **Promotion churn.**
+ - Mitigation: keep beta isolated until Unit 4 contract coverage and manual verification pass
+
+## Sources & References
+
+- Related skills:
+ - `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+ - `plugins/compound-engineering/skills/ce-review/SKILL.md`
+ - `plugins/compound-engineering/skills/resolve-todo-parallel/SKILL.md`
+ - `plugins/compound-engineering/skills/file-todos/SKILL.md`
+ - `plugins/compound-engineering/skills/lfg/SKILL.md`
+ - `plugins/compound-engineering/skills/slfg/SKILL.md`
+- Institutional learnings:
+ - `docs/solutions/skill-design/compound-refresh-skill-improvements.md`
+ - `docs/solutions/skill-design/beta-skills-framework.md`
+- Supporting pattern reference:
+ - `plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md`
+ - `plugins/compound-engineering/skills/ce-plan/SKILL.md`
diff --git a/docs/plans/2026-03-23-001-feat-plan-review-personas-beta-plan.md b/docs/plans/2026-03-23-001-feat-plan-review-personas-beta-plan.md
new file mode 100644
index 0000000..3a1d6cc
--- /dev/null
+++ b/docs/plans/2026-03-23-001-feat-plan-review-personas-beta-plan.md
@@ -0,0 +1,505 @@
+---
+title: "feat: Replace document-review with persona-based review pipeline"
+type: feat
+status: completed
+date: 2026-03-23
+deepened: 2026-03-23
+origin: docs/brainstorms/2026-03-23-plan-review-personas-requirements.md
+---
+
+# Replace document-review with Persona-Based Review Pipeline
+
+## Overview
+
+Replace the single-voice `document-review` skill with a multi-persona review pipeline that dispatches specialized reviewer agents in parallel. Two always-on personas (coherence, feasibility) run on every review. Four conditional personas (product-lens, design-lens, security-lens, scope-guardian) activate based on document content analysis. Quality issues are auto-fixed; strategic questions are presented to the user.
+
+## Problem Frame
+
+The current `document-review` applies five generic criteria (Clarity, Completeness, Specificity, Appropriate Level, YAGNI) through a single evaluator voice. This misses role-specific concerns: a security engineer, product leader, and design reviewer each see different problems in the same plan. The `ce:review` skill already demonstrates that multi-persona review produces richer, more actionable feedback for code. The same architecture applies to plan/requirements review. (see origin: docs/brainstorms/2026-03-23-plan-review-personas-requirements.md)
+
+## Requirements Trace
+
+- R1. Replace document-review with persona pipeline dispatching specialized agents in parallel
+- R2. 2 always-on personas: coherence, feasibility
+- R3. 4 conditional personas: product-lens, design-lens, security-lens, scope-guardian
+- R4. Auto-detect conditional persona relevance from document content
+- R5. Hybrid action model: auto-fix quality issues, present strategic questions
+- R6. Structured findings with confidence, dedup, synthesized report
+- R7. Backward compatibility with all 4 callers (brainstorm, plan, plan-beta, deepen-plan-beta)
+- R8. Pipeline-compatible for future automated workflows
+
+## Scope Boundaries
+
+- Not adding new callers or pipeline integrations
+- Not changing deepen-plan-beta behavior
+- Not adding user configuration for persona selection
+- Not inventing new review frameworks -- incorporating established review patterns into respective personas
+- Not modifying any of the 4 existing caller skills
+
+## Context & Research
+
+### Relevant Code and Patterns
+
+- `plugins/compound-engineering/skills/ce-review/SKILL.md` -- Multi-agent orchestration reference: parallel dispatch via Task tool, always-on + conditional agents, P1/P2/P3 severity, finding synthesis with dedup
+- `plugins/compound-engineering/skills/document-review/SKILL.md` -- Current single-voice skill to replace. Key contract: "Review complete" terminal signal
+- `plugins/compound-engineering/agents/review/*.md` -- 15 existing review agents. Frontmatter schema: `name`, `description`, `model: inherit`. Body: examples block, role definition, analysis protocol, output format
+- `plugins/compound-engineering/AGENTS.md` -- Agent naming: fully-qualified `compound-engineering::`. Agent placement: `agents//.md`
+
+### Caller Integration Points
+
+All 4 callers use the same contract:
+- `ce-brainstorm/SKILL.md` line 301: "Load the `document-review` skill and apply it to the requirements document"
+- `ce-plan/SKILL.md` line 592: "Load `document-review` skill"
+- `ce-plan-beta/SKILL.md` line 611: "Load the `document-review` skill with the plan path"
+- `deepen-plan-beta/SKILL.md` line 402: "Load the `document-review` skill with the plan path"
+
+All expect "Review complete" as the terminal signal. No callers check for specific output format. No caller changes needed.
+
+### Institutional Learnings
+
+- **Subagent design** (docs/solutions/skill-design/compound-refresh-skill-improvements.md): Each persona agent needs explicit context (file path, scope, output format) -- don't rely on inherited context. Use native file tools, not shell commands. Avoid hardcoded tool names; use capability-first language with platform examples.
+- **Parallel dispatch safety**: Persona reviewers are read-only (analyze the document, don't modify it). Parallel dispatch is safe. This differs from compound-refresh which used sequential subagents because they modified files.
+- **Contradictory findings**: With 6 independent reviewers, findings will conflict (scope-guardian wants to cut; coherence wants to keep for narrative flow). Synthesis needs conflict-resolution rules, not just dedup.
+- **Classification pipeline ordering** (docs/solutions/skill-design/claude-permissions-optimizer-classification-fix.md): Pipeline ordering matters: filter -> normalize -> group -> threshold -> re-classify -> output. Post-grouping safety checks catch misclassified findings. Single source of truth for classification logic.
+- **Beta skills framework** (docs/solutions/skill-design/beta-skills-framework.md): Since we're replacing document-review entirely (not running side-by-side), the beta framework doesn't apply here.
+
+### Research Insights: iterative-engineering plan-review
+
+The iterative-engineering plugin (v1.16.1) implements a mature plan-review skill with persona agents. Key architectural patterns to adopt:
+
+**Structured output contract**: All personas return findings in a consistent JSON-like structure with: title (<=10 words), priority (HIGH/MEDIUM/LOW), section, line, why_it_matters (impact not symptom), confidence (0.0-1.0), evidence (quoted text, minimum 1), and optional suggestion. This consistency enables reliable synthesis.
+
+**Fingerprint-based dedup**: `normalize(section) + line_bucket(line, +/-5) + normalize(title)`. When fingerprints match: keep highest priority, highest confidence, union evidence, note all reviewers. This is more precise than judgment-based dedup.
+
+**Residual concerns**: Findings below the confidence threshold (0.50) are stored separately as residual concerns. During synthesis, residual concerns are promoted to findings if they overlap with findings from other reviewers or describe concrete blocking risks. This catches issues that one persona sees dimly but another confirms.
+
+**Per-persona confidence calibration**: Each persona defines its own confidence bands -- what HIGH (0.80+), MODERATE (0.60-0.79), and LOW mean for that persona's domain. This prevents apples-to-oranges confidence comparisons.
+
+**Explicit suppress conditions**: Each persona lists what it should NOT flag (e.g., coherence suppresses style preferences and missing content; feasibility suppresses implementation style choices). This prevents noise and keeps personas focused.
+
+**Subagent prompt template**: A shared template wraps each persona's identity + output schema + review context. This ensures consistent behavior across all personas without repeating boilerplate in each agent file.
+
+### Established Review Patterns
+
+Three proven review approaches provide the behavioral foundation for specific personas:
+
+**Premise challenge pattern (-> product-lens persona):**
+- Nuclear scope challenge with 3 questions: (1) Is this the right problem? Could a different framing yield a simpler/more impactful solution? (2) What is the actual user/business outcome? Is the plan the most direct path? (3) What happens if we do nothing? Real pain or hypothetical?
+- Implementation alternatives: Produce 2-3 approaches with effort (S/M/L/XL), risk (Low/Med/High), pros/cons
+- Search-before-building: Layer 1 (conventional), Layer 2 (search results), Layer 3 (first principles)
+
+**Dimensional rating pattern (-> design-lens persona):**
+- 0-10 rating loop: Rate dimension -> explain gap ("4 because X; 10 would have Y") -> suggest fix -> re-rate -> repeat
+- 7 evaluation passes: Information architecture, interaction state coverage, user journey/emotional arc, AI slop risk, design system alignment, responsive/a11y, unresolved design decisions
+- AI slop blacklist: 10 recognizable AI-generated patterns to avoid (3-column feature grids, purple gradients, icons in colored circles, uniform border-radius, etc.)
+
+**Existing-code audit pattern (-> scope-guardian + feasibility personas):**
+- "What already exists?" check: (1) What existing code partially/fully solves each sub-problem? (2) What is minimum set of changes for stated goal? (3) Complexity check (>8 files or >2 new classes = smell). (4) Search check per architectural pattern. (5) TODOS cross-reference
+- Completeness principle: With AI, completeness cost is 10-100x cheaper. If shortcut saves human hours but only minutes with AI, recommend complete version
+- Error & rescue map: For every method/codepath that can fail, name the exception class, trigger, handler, and user-visible outcome
+
+## Key Technical Decisions
+
+- **Agents, not inline prompts**: Persona reviewers are implemented as agent files under `agents/review/`. This enables parallel dispatch via Task tool, follows established patterns, and keeps the SKILL.md focused on orchestration. (Resolves deferred question from origin)
+
+- **Structured output contract aligned with ce:review-beta (PR #348)**: Same normalization mechanism -- findings-schema.json, subagent-template.md, review-output-template.md as reference files. Same field names and enums where applicable (severity P0-P3, autofix_class, owner, confidence, evidence). Document-specific adaptations: `section` replaces `file`+`line`, `deferred_questions` replaces `testing_gaps`, drop `pre_existing`. Each persona defines its own confidence calibration and suppress conditions. (Resolves deferred question from origin -- output format)
+
+- **Content-based activation heuristics**: The orchestrator skill checks the document for keyword and structural patterns to select conditional personas. Heuristics are defined in the skill, not in the agents -- this keeps selection logic centralized and agents focused on review. (Resolves deferred question from origin)
+
+- **Separate auto-fix pass after synthesis**: Personas are read-only (produce findings only). After dedup and synthesis, the orchestrator applies auto-fixes for quality issues in a single pass, then presents strategic questions. This prevents conflicting edits from multiple agents. (Resolves deferred question from origin)
+
+- **No caller modifications needed**: The "Review complete" contract is sufficient. All 4 callers reference document-review by skill name and check for the terminal signal. (Resolves deferred question from origin)
+
+- **Fingerprint-based dedup over judgment-based**: Use `normalize(section) + normalize(title)` fingerprinting for deterministic dedup. More reliable than asking the model to "remove duplicates" at synthesis time. When fingerprints match: keep highest priority, highest confidence, union evidence, note all agreeing reviewers.
+
+- **Residual concerns with cross-persona promotion**: Findings below 0.50 confidence are stored as residual concerns. During synthesis, promote to findings if corroborated by another persona or if they describe concrete blocking risks. This catches issues one persona sees dimly but another confirms.
+
+## Open Questions
+
+### Resolved During Planning
+
+- **Agent category**: Place under `agents/review/` alongside existing code review agents. Names are distinct (coherence-reviewer, feasibility-reviewer, etc.) and don't conflict with existing agents. Fully-qualified: `compound-engineering:review:`.
+- **Parallel vs serial dispatch**: Always parallel. We have 2-6 agents per run (under the auto-serial threshold of 5 from ce:review's pattern). Even at max (6), these are document reviewers with bounded scope.
+- **Review pattern integration**: Premise challenge -> product-lens opener. Dimensional rating -> design-lens evaluation method. Existing-code audit -> scope-guardian opener. These are incorporated as agent behavior, not separate orchestration mechanisms.
+- **Output format**: Align with ce:review-beta (PR #348) normalization pattern. Same mechanism: JSON schema reference file, shared subagent template, output template. Same enums (P0-P3 severity, autofix_class, owner). Document-specific field swaps: `section` replaces `file`+`line`, `deferred_questions` replaces `testing_gaps`, drop `pre_existing`.
+
+### Deferred to Implementation
+
+- Exact keyword lists for conditional persona activation -- start with the obvious signals, refine based on real usage
+- Whether the auto-fix pass should re-read the document after applying changes to verify consistency, or trust a single pass
+
+## High-Level Technical Design
+
+> *This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.*
+
+```
+Document Review Pipeline Flow:
+
+1. READ document
+2. CLASSIFY document type (requirements doc vs plan)
+3. ANALYZE content for conditional persona signals
+ - product signals? -> activate product-lens
+ - design/UI signals? -> activate design-lens
+ - security/auth signals? -> activate security-lens
+ - scope/priority signals? -> activate scope-guardian
+4. ANNOUNCE review team with per-conditional justifications
+5. DISPATCH agents in parallel via Task tool
+ - Always: coherence-reviewer, feasibility-reviewer
+ - Conditional: activated personas from step 3
+ - Each receives: subagent-template.md populated with persona + schema + doc content
+6. COLLECT findings from all agents (validate against findings-schema.json)
+7. SYNTHESIZE
+ a. Validate: check structure compliance against schema, drop malformed
+ b. Confidence gate: suppress findings below 0.50
+ c. Deduplicate: fingerprint matching, keep highest severity/confidence
+ d. Promote residual concerns: corroborated or blocking -> promote to finding
+ e. Resolve contradictions: conflicting personas -> combined finding, manual + human
+ f. Route: safe_auto -> apply, everything else -> present
+8. APPLY safe_auto fixes (edit document inline, single pass)
+9. PRESENT remaining findings to user, grouped by severity
+10. FORMAT output using review-output-template.md
+11. OFFER next action: "Refine again" or "Review complete"
+```
+
+**Finding structure (aligned with ce:review-beta PR #348):**
+
+```
+Envelope (per persona):
+ reviewer: Persona name (e.g., "coherence", "product-lens")
+ findings: Array of finding objects
+ residual_risks: Risks noticed but not confirmed as findings
+ deferred_questions: Questions that should be resolved in a later workflow stage
+
+Finding object:
+ title: Short issue title (<=10 words)
+ severity: P0 / P1 / P2 / P3 (same scale as ce:review-beta)
+ section: Document section where issue appears (replaces file+line)
+ why_it_matters: Impact statement (what goes wrong if not addressed)
+ autofix_class: safe_auto / gated_auto / manual / advisory
+ owner: review-fixer / downstream-resolver / human / release
+ requires_verification: Whether fix needs re-review
+ suggested_fix: Optional concrete fix (null if not obvious)
+ confidence: 0.0-1.0 (calibrated per persona)
+ evidence: Quoted text from document (minimum 1)
+
+Severity definitions (same as ce:review-beta):
+ P0: Contradictions or gaps that would cause building the wrong thing. Must fix.
+ P1: Significant gap likely hit during planning/implementation. Should fix.
+ P2: Moderate issue with meaningful downside. Fix if straightforward.
+ P3: Minor improvement. User's discretion.
+
+Autofix classes (same enum as ce:review-beta for schema compatibility):
+ safe_auto: Terminology fix, formatting, cross-reference -- local and deterministic
+ gated_auto: Restructure or edit that changes document meaning -- needs approval
+ manual: Strategic question requiring user judgment -- becomes residual work
+ advisory: Informational finding -- surface in report only
+
+Orchestrator routing (document review simplification):
+ The 4-class enum is preserved for schema compatibility with ce:review-beta,
+ but the orchestrator routes as 2 buckets:
+ safe_auto -> apply automatically
+ gated_auto + manual + advisory -> present to user
+ The gated/manual/advisory distinction is blurry for documents (all need user
+ judgment). Personas still classify precisely; the orchestrator collapses.
+```
+
+## Implementation Units
+
+- [x] **Unit 1: Create always-on persona agents**
+
+**Goal:** Create the coherence and feasibility reviewer agents that run on every document review.
+
+**Requirements:** R2
+
+**Dependencies:** None
+
+**Files:**
+- Create: `plugins/compound-engineering/agents/review/coherence-reviewer.md`
+- Create: `plugins/compound-engineering/agents/review/feasibility-reviewer.md`
+
+**Approach:**
+- Follow existing agent structure: frontmatter (name, description, model: inherit), examples block, role definition, analysis protocol
+- Each agent defines: role identity, analysis protocol, confidence calibration, and suppress conditions
+- Agents do NOT define their own output format -- the shared `references/findings-schema.json` and `references/subagent-template.md` handle output normalization (same pattern as ce:review-beta PR #348)
+
+**coherence-reviewer:**
+- Role: Technical editor who reads for internal consistency
+- Hunts: contradictions between sections, terminology drift (same concept called different names), structural issues (sections that don't flow logically), ambiguity where readers would diverge on interpretation
+- Confidence calibration: HIGH (0.80+) = provable contradictions from text. MODERATE (0.60-0.79) = likely but could be reconciled charitably. Suppress below 0.50.
+- Suppress: style preferences, missing content (other personas handle that), imprecision that isn't actually ambiguity, formatting opinions
+
+**feasibility-reviewer:**
+- Role: Systems architect evaluating whether proposed approaches survive contact with reality
+- Hunts: architecture decisions that conflict with existing patterns, external dependencies without fallback plans, performance requirements without measurement plans, migration strategies with gaps, approaches that won't work with known constraints
+- Absorbs tech-plan implementability: can an implementer read this and start coding? Are file paths, interfaces, and dependencies specific enough?
+- Opens with "what already exists?" check: does the plan acknowledge existing code before proposing new abstractions?
+- Confidence calibration: HIGH (0.80+) = specific technical constraint that blocks approach. MODERATE (0.60-0.79) = constraint likely but depends on specifics not in document.
+- Suppress: implementation style choices, testing strategy details, code organization preferences, theoretical scalability concerns
+
+**Patterns to follow:**
+- `plugins/compound-engineering/agents/review/code-simplicity-reviewer.md` for agent structure and output format conventions
+- `plugins/compound-engineering/agents/review/architecture-strategist.md` for systematic analysis protocol style
+- iterative-engineering agents for confidence calibration and suppress conditions pattern
+
+**Test scenarios:**
+- coherence-reviewer identifies a plan where Section 3 claims "no external dependencies" but Section 5 proposes calling an external API
+- coherence-reviewer flags a document using "pipeline" and "workflow" interchangeably for the same concept
+- coherence-reviewer does NOT flag a minor formatting inconsistency (suppress condition working)
+- feasibility-reviewer identifies a requirement for "sub-millisecond response time" without a measurement or caching strategy
+- feasibility-reviewer identifies that a plan proposes building a custom auth system when the codebase already has one
+- feasibility-reviewer surfaces "what already exists?" when plan doesn't acknowledge existing patterns
+- Both agents produce findings with all required fields (title, priority, section, confidence, evidence, action)
+
+**Verification:**
+- Both agents have valid frontmatter (name, description, model: inherit)
+- Both agents include examples, role definition, analysis protocol, confidence calibration, and suppress conditions
+- Agents rely on shared findings-schema.json for output normalization (no per-agent output format)
+- Suppress conditions are explicit and sensible for each persona's domain
+
+---
+
+- [x] **Unit 2: Create conditional persona agents**
+
+**Goal:** Create the four conditional persona agents that activate based on document content.
+
+**Requirements:** R3
+
+**Dependencies:** Unit 1 (for consistent agent structure)
+
+**Files:**
+- Create: `plugins/compound-engineering/agents/review/product-lens-reviewer.md`
+- Create: `plugins/compound-engineering/agents/review/design-lens-reviewer.md`
+- Create: `plugins/compound-engineering/agents/review/security-lens-reviewer.md`
+- Create: `plugins/compound-engineering/agents/review/scope-guardian-reviewer.md`
+
+**Approach:**
+All four use the same structure established in Unit 1 (frontmatter, examples, role, protocol, confidence calibration, suppress conditions). Output normalization handled by shared reference files.
+
+**product-lens-reviewer:**
+- Role: Senior product leader evaluating whether the plan solves the right problem
+- Opens with premise challenge: 3 diagnostic questions:
+ 1. Is this the right problem to solve? Could a different framing yield a simpler or more impactful solution?
+ 2. What is the actual user/business outcome? Is the plan the most direct path, or is it solving a proxy problem?
+ 3. What would happen if we did nothing? Real pain point or hypothetical?
+- Evaluates: scope decisions and prioritization rationale, implementation alternatives (are there simpler paths?), whether goals connect to requirements
+- Confidence calibration: HIGH (0.80+) = specific text demonstrating misalignment between stated goal and proposed work. MODERATE (0.60-0.79) = likely but depends on business context.
+- Suppress: implementation details, technical specifics, measurement methodology, style
+
+**design-lens-reviewer:**
+- Role: Senior product designer reviewing plans for missing design decisions
+- Uses "rate 0-10 and describe what 10 looks like" dimensional rating method
+- Evaluates design dimensions: information architecture (what does user see first/second/third?), interaction state coverage (loading, empty, error, success, partial), user flow completeness, responsive/accessibility considerations
+- Produces rated findings: "Information architecture: 4/10 -- it's a 4 because [gap]. A 10 would have [what's needed]."
+- AI slop check: flags plans that would produce generic AI-looking interfaces (3-column feature grids, purple gradients, icons in colored circles, uniform border-radius)
+- Confidence calibration: HIGH (0.80+) = missing states or flows that will clearly cause UX problems. MODERATE (0.60-0.79) = design gap exists but skilled designer could resolve from context.
+- Suppress: backend implementation details, performance concerns, security (other persona handles), business strategy
+
+**security-lens-reviewer:**
+- Role: Security architect evaluating threat model at the plan level
+- Evaluates: auth/authz gaps, data exposure risks, API surface vulnerabilities, input validation assumptions, secrets management, third-party trust boundaries, plan-level threat model completeness
+- Distinct from the code-level `security-sentinel` agent -- this reviews whether the PLAN accounts for security, not whether the CODE is secure
+- Confidence calibration: HIGH (0.80+) = plan explicitly introduces attack surface without mentioning mitigation. MODERATE (0.60-0.79) = security concern likely but plan may address it implicitly.
+- Suppress: code quality issues, performance, non-security architecture, business logic
+
+**scope-guardian-reviewer:**
+- Role: Product manager reviewing scope decisions for alignment, plus skeptic evaluating whether complexity earns its keep
+- Opens with "what already exists?" check: (1) What existing code/patterns already solve sub-problems? (2) What is the minimum set of changes for stated goal? (3) Complexity check -- if plan touches many files or introduces many new abstractions, is that justified?
+- Challenges: scope size relative to stated goals, unnecessary complexity, premature abstractions, framework-ahead-of-need, priority dependency conflicts (e.g., core feature depending on nice-to-have), scope boundaries violated by requirements, goals disconnected from requirements
+- Completeness principle check: is the plan taking shortcuts where the complete version would cost little more?
+- Confidence calibration: HIGH (0.80+) = can point to specific text showing scope conflict or unjustified complexity. MODERATE (0.60-0.79) = misalignment likely but depends on interpretation.
+- Suppress: implementation style choices, priority preferences (other persona handles), missing requirements (coherence handles), business strategy
+
+**Patterns to follow:**
+- Unit 1 agents for consistent structure
+- `plugins/compound-engineering/agents/review/security-sentinel.md` for security analysis style (plan-level adaptation)
+
+**Test scenarios:**
+- product-lens-reviewer challenges a plan that builds a complex admin dashboard when the stated goal is "improve user onboarding"
+- product-lens-reviewer produces premise challenge as its opening findings
+- design-lens-reviewer rates a user flow at 6/10 and describes what 10 looks like with specific missing states
+- design-lens-reviewer flags a plan describing "a modern card-based dashboard layout" as AI slop risk
+- security-lens-reviewer flags a plan that adds a public API endpoint without mentioning auth or rate limiting
+- security-lens-reviewer does NOT flag code quality issues (suppress condition working)
+- scope-guardian-reviewer identifies a plan with 12 implementation units when 4 would deliver the core value
+- scope-guardian-reviewer identifies that the plan proposes a custom solution when an existing framework would work
+- All four agents produce findings with all required fields
+
+**Verification:**
+- All four agents have valid frontmatter and follow the same structure as Unit 1
+- product-lens-reviewer includes the 3-question premise challenge
+- design-lens-reviewer includes the "rate 0-10, describe what 10 looks like" evaluation pattern
+- scope-guardian-reviewer includes the "what already exists?" opening check
+- All agents define confidence calibration and suppress conditions
+- All agents rely on shared findings-schema.json for output normalization
+
+---
+
+- [x] **Unit 3: Rewrite document-review skill with persona pipeline**
+
+**Goal:** Replace the current single-voice document-review SKILL.md with the persona pipeline orchestrator.
+
+**Requirements:** R1, R4, R5, R6, R7, R8
+
+**Dependencies:** Unit 1, Unit 2
+
+**Files:**
+- Modify: `plugins/compound-engineering/skills/document-review/SKILL.md`
+- Create: `plugins/compound-engineering/skills/document-review/references/findings-schema.json`
+- Create: `plugins/compound-engineering/skills/document-review/references/subagent-template.md`
+- Create: `plugins/compound-engineering/skills/document-review/references/review-output-template.md`
+
+**Approach:**
+
+**Reference files (aligned with ce:review-beta PR #348 mechanism):**
+- `findings-schema.json`: JSON schema that all persona agents must conform to. Same structure as ce:review-beta with document-specific swaps: `section` replaces `file`+`line`, `deferred_questions` replaces `testing_gaps`, drop `pre_existing`. Same enums for severity, autofix_class, owner.
+- `subagent-template.md`: Shared prompt template with variable slots ({persona_file}, {schema}, {document_content}, {document_path}, {document_type}). Rules: "Return ONLY valid JSON matching the schema", suppress below confidence floor, every finding needs evidence. Adapted from ce:review-beta's template for document context instead of diff context.
+- `review-output-template.md`: Markdown template for synthesized output. Findings grouped by severity (P0-P3), pipe-delimited tables with section, issue, reviewer, confidence, and route (autofix_class -> owner). Adapted from ce:review-beta's template for sections instead of file:line.
+
+The rewritten skill has these phases:
+
+**Phase 1 -- Get and Analyze Document:**
+- Same entry point as current: accept a path or find the most recent doc in `docs/brainstorms/` or `docs/plans/`
+- Read the document
+- Classify document type: requirements doc (from brainstorms/) or plan (from plans/)
+- Analyze content for conditional persona activation signals:
+ - product-lens: user-facing features, market claims, scope decisions, prioritization language, requirements with user/customer focus
+ - design-lens: UI/UX references, frontend components, user flows, wireframes, screen/page/view mentions
+ - security-lens: auth/authorization mentions, API endpoints, data handling, payments, tokens, credentials, encryption
+ - scope-guardian: multiple priority tiers (P0/P1/P2), large requirement count (>8), stretch goals, nice-to-haves, scope boundary language that seems misaligned
+
+**Phase 2 -- Announce and Dispatch Personas:**
+- Announce the review team with per-conditional justifications (e.g., "scope-guardian-reviewer -- plan has 12 requirements across 3 priority levels")
+- Build the agent list: always coherence-reviewer + feasibility-reviewer, plus activated conditional agents
+- Dispatch all agents in parallel via Task tool using fully-qualified names (`compound-engineering:review:`)
+- Pass each agent: document content, document path, document type (requirements vs plan), and the structured output schema
+- Each agent receives the full document -- do not split into sections
+
+**Phase 3 -- Synthesize Findings:**
+Synthesis pipeline (order matters):
+1. **Validate**: Check each agent's output for structural compliance against findings-schema.json. Drop malformed findings but note the agent's name for the coverage section.
+2. **Confidence gate**: Suppress findings below 0.50 confidence. Store them as residual concerns.
+3. **Deduplicate**: Fingerprint each finding using `normalize(section) + normalize(title)`. When fingerprints match: keep highest severity, highest confidence, union evidence, note all agreeing reviewers.
+4. **Promote residual concerns**: Scan residual concerns for overlap with existing findings from other reviewers or concrete blocking risks. Promote to findings at P2 with confidence 0.55-0.65.
+5. **Resolve contradictions**: When personas disagree on the same section (e.g., scope-guardian says cut, coherence says keep for narrative flow), create a combined finding presenting both perspectives with autofix_class `manual` and owner `human` -- let the user decide.
+6. **Route by autofix_class**: `safe_auto` -> apply immediately. Everything else (`gated_auto`, `manual`, `advisory`) -> present to user. Personas classify precisely; the orchestrator collapses to 2 buckets.
+7. **Sort**: P0 -> P1 -> P2 -> P3, then by confidence (descending), then document order.
+
+**Phase 4 -- Apply and Present:**
+- Apply `safe_auto` fixes to the document inline (single pass)
+- Present all other findings (`gated_auto`, `manual`, `advisory`) to the user, grouped by severity
+- Show a brief summary: N auto-fixes applied, M findings to consider
+- Show coverage: which personas ran, any suppressed/residual counts
+- Use the review-output-template.md format for consistent presentation
+
+**Phase 5 -- Next Action:**
+- Use the platform's blocking question tool when available (AskUserQuestion in Claude Code, request_user_input in Codex, ask_user in Gemini). Otherwise present numbered options and wait.
+- Offer: "Refine again" or "Review complete"
+- After 2 refinement passes, recommend completion (carry over from current behavior)
+- "Review complete" as terminal signal for callers
+
+**Pipeline mode:** When called from automated workflows, auto-fixes run silently. Strategic questions are still surfaced (the calling skill decides whether to present them or convert to assumptions).
+
+**Protected artifacts:** Carry over from ce:review -- never flag `docs/brainstorms/`, `docs/plans/`, or `docs/solutions/` files for deletion. Discard any such findings during synthesis.
+
+**What NOT to do section:** Carry over current guardrails:
+- Don't rewrite the entire document
+- Don't add new requirements the user didn't discuss
+- Don't create separate review files or metadata sections
+- Don't over-engineer or add complexity
+- Don't add new sections not discussed in the brainstorm/plan
+
+**Conflict resolution rules for synthesis:**
+- When coherence says "keep for consistency" and scope-guardian says "cut for simplicity" -> combined finding, autofix_class: manual, owner: human
+- When feasibility says "this is impossible" and product-lens says "this is essential" -> P1 finding, autofix_class: manual, owner: human, frame as a tradeoff
+- When multiple personas flag the same issue -> merge into single finding, note consensus, increase confidence
+- When a residual concern from one persona matches a finding from another -> promote the concern, note corroboration
+
+**Patterns to follow:**
+- `plugins/compound-engineering/skills/ce-review/SKILL.md` for agent dispatch and synthesis patterns
+- Current `document-review/SKILL.md` for the entry point, iteration guidance, and "What NOT to Do" guardrails
+- iterative-engineering `plan-review/SKILL.md` for synthesis pipeline ordering and fingerprint dedup
+
+**Test scenarios:**
+- A backend refactor plan triggers only coherence + feasibility (no conditional personas)
+- A plan mentioning "user authentication flow" triggers coherence + feasibility + security-lens
+- A plan with UI mockups and 15 requirements triggers all 6 personas
+- A safe_auto finding correctly updates a terminology inconsistency without user approval
+- A gated_auto finding is presented to the user (not auto-applied) despite having a suggested_fix
+- A contradictory finding (scope-guardian vs coherence) is presented as a combined manual finding, not as two separate findings
+- A residual concern from one persona is promoted when corroborated by another persona's finding
+- Findings below 0.50 confidence are suppressed (not shown to user)
+- Duplicate findings from two personas are merged into one with both reviewer names
+- "Review complete" signal works correctly with a caller context
+- Second refinement pass recommends completion
+- Protected artifacts are not flagged for deletion
+
+**Verification:**
+- Skill has valid frontmatter (name: document-review, description updated to reflect persona pipeline)
+- All agent references use fully-qualified namespace (`compound-engineering:review:`)
+- Entry point matches current skill (path or auto-find)
+- Terminal signal "Review complete" preserved
+- Conditional persona selection logic is centralized in the skill
+- Synthesis pipeline follows the correct ordering (validate -> gate -> dedup -> promote -> resolve -> route -> sort)
+- Reference files exist: findings-schema.json, subagent-template.md, review-output-template.md
+- Cross-platform guidance included (platform question tool with fallback)
+- Protected artifacts section present
+
+---
+
+- [x] **Unit 4: Update README and validate**
+
+**Goal:** Update plugin documentation to reflect the new agents and revised skill.
+
+**Requirements:** R1, R7
+
+**Dependencies:** Unit 1, Unit 2, Unit 3
+
+**Files:**
+- Modify: `plugins/compound-engineering/README.md`
+
+**Approach:**
+- Add 6 new agents to the Review table in README.md (coherence-reviewer, design-lens-reviewer, feasibility-reviewer, product-lens-reviewer, scope-guardian-reviewer, security-lens-reviewer)
+- Update agent count from "25+" to "31+" (or appropriate count after adding 6)
+- Update the document-review description in the skills table if it exists
+- Run `bun run release:validate` to verify consistency
+
+**Patterns to follow:**
+- Existing README.md table formatting
+- Alphabetical ordering within the Review agent table
+
+**Test scenarios:**
+- All 6 new agents appear in README Review table
+- Agent count is accurate
+- `bun run release:validate` passes
+
+**Verification:**
+- README agent count matches actual agent file count
+- All new agents listed with accurate descriptions
+- release:validate passes without errors
+
+## System-Wide Impact
+
+- **Interaction graph:** document-review is called from 4 skills (ce-brainstorm, ce-plan, ce-plan-beta, deepen-plan-beta). The "Review complete" contract is preserved, so no caller changes needed.
+- **Error propagation:** If a persona agent fails or times out during parallel dispatch, the orchestrator should proceed with findings from the agents that completed. Do not block the entire review on a single agent failure. Note the failed agent in the coverage section.
+- **State lifecycle risks:** None -- personas are read-only. Only the orchestrator modifies the document, in a single auto-fix pass.
+- **API surface parity:** The skill name (`document-review`) and terminal signal ("Review complete") remain unchanged. No breaking changes to callers.
+- **Integration coverage:** Verify the skill works when invoked standalone and from each of the 4 caller contexts.
+- **Finding noise risk:** With up to 6 personas, the total finding count could be high. The confidence gate (suppress below 0.50), dedup (fingerprint matching), and suppress conditions (per-persona) are the three mechanisms that control noise. If findings are still too noisy in practice, tighten the confidence gate or add suppress conditions.
+
+## Risks & Dependencies
+
+- **Agent dispatch limit:** ce:review auto-switches to serial mode at >5 agents. Maximum dispatch here is 6 (2 always-on + 4 conditional). If all 6 activate, the orchestrator should still use parallel dispatch since these are lightweight document reviewers reading a single document, not code analyzers scanning a codebase. Document this decision in the skill.
+- **Contradictory findings:** The synthesis phase must handle conflicting persona findings explicitly. The initial implementation should lean toward presenting contradictions (both perspectives as a combined finding) rather than auto-resolving them. This preserves value even if it's slightly noisier.
+- **Finding volume at full activation:** When all 6 personas activate on a large document, the total pre-dedup finding count could exceed 20-30. The synthesis pipeline (confidence gate + dedup + suppress conditions) should reduce this to a manageable set. If it doesn't, the first lever to pull is tightening per-persona suppress conditions.
+- **Persona prompt quality:** The agents are only as good as their prompts. The established review patterns and iterative-engineering references provide battle-tested material, but the compound-engineering versions will be new and may need iteration. Plan for 1-2 rounds of prompt refinement after initial implementation.
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/2026-03-23-plan-review-personas-requirements.md](docs/brainstorms/2026-03-23-plan-review-personas-requirements.md)
+- Related code: `plugins/compound-engineering/skills/ce-review/SKILL.md` (multi-agent orchestration pattern)
+- Related code: `plugins/compound-engineering/skills/document-review/SKILL.md` (current implementation to replace)
+- Related code: `plugins/compound-engineering/agents/review/` (agent structure reference)
+- Related pattern: iterative-engineering `skills/plan-review/SKILL.md` (synthesis pipeline, findings schema, subagent template)
+- Related pattern: iterative-engineering `agents/coherence-reviewer.md`, `feasibility-reviewer.md`, `scope-guardian-reviewer.md`, `prd-reviewer.md`, `tech-plan-reviewer.md`, `skeptic-reviewer.md` (persona prompt design, confidence calibration, suppress conditions)
+- Related learning: `docs/solutions/skill-design/compound-refresh-skill-improvements.md` (subagent design patterns)
+- Related learning: `docs/solutions/skill-design/claude-permissions-optimizer-classification-fix.md` (pipeline ordering, classification correctness)
diff --git a/docs/plans/2026-03-23-001-feat-promote-plan-beta-skills-to-stable-plan.md b/docs/plans/2026-03-23-001-feat-promote-plan-beta-skills-to-stable-plan.md
new file mode 100644
index 0000000..e6a2ee9
--- /dev/null
+++ b/docs/plans/2026-03-23-001-feat-promote-plan-beta-skills-to-stable-plan.md
@@ -0,0 +1,132 @@
+---
+title: "feat: promote ce:plan-beta and deepen-plan-beta to stable"
+type: feat
+status: completed
+date: 2026-03-23
+---
+
+# Promote ce:plan-beta and deepen-plan-beta to stable
+
+## Overview
+
+Replace the stable `ce:plan` and `deepen-plan` skills with their validated beta counterparts, following the documented 9-step promotion path from `docs/solutions/skill-design/beta-skills-framework.md`.
+
+## Problem Statement
+
+The beta versions of `ce:plan` and `deepen-plan` have been tested and are ready for promotion. They currently sit alongside the stable versions as separate skill directories with `disable-model-invocation: true`, meaning users must invoke them manually. Promotion makes them the default for all workflows including `lfg`/`slfg` orchestration.
+
+## Proposed Solution
+
+Follow the beta-skills-framework promotion checklist exactly, applied to both skill pairs simultaneously.
+
+## Implementation Plan
+
+### Phase 1: Replace stable SKILL.md content with beta content
+
+**Files to modify:**
+
+1. **`skills/ce-plan/SKILL.md`** -- Replace entire content with `skills/ce-plan-beta/SKILL.md`
+2. **`skills/deepen-plan/SKILL.md`** -- Replace entire content with `skills/deepen-plan-beta/SKILL.md`
+
+### Phase 2: Restore stable frontmatter and remove beta markers
+
+**In promoted `skills/ce-plan/SKILL.md`:**
+
+- Change `name: ce:plan-beta` to `name: ce:plan`
+- Remove `[BETA] ` prefix from description
+- Remove `disable-model-invocation: true` line
+
+**In promoted `skills/deepen-plan/SKILL.md`:**
+
+- Change `name: deepen-plan-beta` to `name: deepen-plan`
+- Remove `[BETA] ` prefix from description
+- Remove `disable-model-invocation: true` line
+
+### Phase 3: Update all internal references from beta to stable names
+
+**In promoted `skills/ce-plan/SKILL.md`:**
+
+- All references to `/deepen-plan-beta` become `/deepen-plan`
+- All references to `ce:plan-beta` become `ce:plan` (in headings, prose, etc.)
+- All references to `-beta-plan.md` file suffix become `-plan.md`
+- Example filenames using `-beta-plan.md` become `-plan.md`
+
+**In promoted `skills/deepen-plan/SKILL.md`:**
+
+- All references to `ce:plan-beta` become `ce:plan`
+- All references to `deepen-plan-beta` become `deepen-plan`
+- Scratch directory paths: `deepen-plan-beta` becomes `deepen-plan`
+
+### Phase 4: Clean up ce-work-beta cross-reference
+
+**In `skills/ce-work-beta/SKILL.md` (line 450):**
+
+- Remove `ce:plan-beta or ` from the text so it reads just `ce:plan`
+
+### Phase 5: Delete beta skill directories
+
+- Delete `skills/ce-plan-beta/` directory entirely
+- Delete `skills/deepen-plan-beta/` directory entirely
+
+### Phase 6: Update README.md
+
+**In `plugins/compound-engineering/README.md`:**
+
+1. **Update `ce:plan` description** in the Workflow Commands table (line 81): Change from `Create implementation plans` to `Transform features into structured implementation plans grounded in repo patterns`
+2. **Update `deepen-plan` description** in the Utility Commands table (line 93): Description already says `Stress-test plans and deepen weak sections with targeted research` which matches the beta -- verify and keep
+3. **Remove the entire Beta Skills section** (lines 156-165): The `### Beta Skills` heading, explanatory paragraph, table with `ce:plan-beta` and `deepen-plan-beta` rows, and the "To test" line
+4. **Update skill count**: Currently `40+` in the Components table. Removing 2 beta directories decreases the count. Verify with `bun run release:validate` and update if needed
+
+### Phase 7: Validation
+
+1. **Search for remaining `-beta` references**: Grep all files under `plugins/compound-engineering/` for leftover `plan-beta` strings -- every hit is a bug, except historical entries in `CHANGELOG.md` which are expected and must not be modified
+2. **Run `bun run release:validate`**: Check plugin/marketplace consistency, skill counts
+3. **Run `bun test`**: Ensure converter tests still pass (they use skill names as fixtures)
+4. **Verify `lfg`/`slfg` references**: Confirm they reference stable `/ce:plan` and `/deepen-plan` (they already do -- no change needed)
+5. **Verify `ce:brainstorm` handoff**: Confirms it hands off to stable `/ce:plan` (already does -- no change needed)
+6. **Verify `ce:work` compatibility**: Plans from promoted skills use `-plan.md` suffix, same as before
+
+## Files Changed
+
+| File | Action | Notes |
+|------|--------|-------|
+| `skills/ce-plan/SKILL.md` | Replace | Beta content with stable frontmatter |
+| `skills/deepen-plan/SKILL.md` | Replace | Beta content with stable frontmatter |
+| `skills/ce-plan-beta/` | Delete | Entire directory |
+| `skills/deepen-plan-beta/` | Delete | Entire directory |
+| `skills/ce-work-beta/SKILL.md` | Edit | Remove `ce:plan-beta or` reference at line 450 |
+| `README.md` | Edit | Remove Beta Skills section, verify counts and descriptions |
+
+## Files NOT Changed (verified safe)
+
+These files reference stable `ce:plan` or `deepen-plan` and require **no changes** because stable names are preserved:
+
+- `skills/lfg/SKILL.md` -- calls `/ce:plan` and `/deepen-plan`
+- `skills/slfg/SKILL.md` -- calls `/ce:plan` and `/deepen-plan`
+- `skills/ce-brainstorm/SKILL.md` -- hands off to `/ce:plan`
+- `skills/ce-ideate/SKILL.md` -- explains pipeline
+- `skills/document-review/SKILL.md` -- references `/ce:plan`
+- `skills/ce-compound/SKILL.md` -- references `/ce:plan`
+- `skills/ce-review/SKILL.md` -- references `/ce:plan`
+- `AGENTS.md` -- lists `ce:plan`
+- `agents/research/learnings-researcher.md` -- references both
+- `agents/research/git-history-analyzer.md` -- references `/ce:plan`
+- `agents/review/code-simplicity-reviewer.md` -- references `/ce:plan`
+- `plugin.json` / `marketplace.json` -- no individual skill listings
+
+## Acceptance Criteria
+
+- [ ] `skills/ce-plan/SKILL.md` contains the beta planning approach (decision-first, phase-structured)
+- [ ] `skills/deepen-plan/SKILL.md` contains the beta deepening approach (selective stress-test, risk-weighted)
+- [ ] No `disable-model-invocation` in either promoted skill
+- [ ] No `[BETA]` prefix in either description
+- [ ] No remaining `-beta` references in any file under `plugins/compound-engineering/`
+- [ ] `skills/ce-plan-beta/` and `skills/deepen-plan-beta/` directories deleted
+- [ ] README Beta Skills section removed
+- [ ] `bun run release:validate` passes
+- [ ] `bun test` passes
+
+## Sources
+
+- **Promotion checklist:** `docs/solutions/skill-design/beta-skills-framework.md` (steps 1-9)
+- **Versioning rules:** `docs/solutions/plugin-versioning-requirements.md` (no manual version bumps)
diff --git a/docs/plans/2026-03-24-001-refactor-todo-path-consolidation-plan.md b/docs/plans/2026-03-24-001-refactor-todo-path-consolidation-plan.md
new file mode 100644
index 0000000..ac356bb
--- /dev/null
+++ b/docs/plans/2026-03-24-001-refactor-todo-path-consolidation-plan.md
@@ -0,0 +1,151 @@
+---
+title: "refactor: Consolidate todo storage under .context/compound-engineering/todos/"
+type: refactor
+status: completed
+date: 2026-03-24
+origin: docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md
+---
+
+# Consolidate Todo Storage Under `.context/compound-engineering/todos/`
+
+## Overview
+
+Move the file-based todo system's canonical storage path from `todos/` to `.context/compound-engineering/todos/`, consolidating all compound-engineering workflow artifacts under one namespace. Use a "drain naturally" migration strategy: new todos write to the new path, reads check both paths, legacy files resolve through normal usage.
+
+## Problem Statement / Motivation
+
+The compound-engineering plugin standardized on `.context/compound-engineering//` for workflow artifacts. Multiple skills already use this pattern (`ce-review-beta`, `resolve-todo-parallel`, `feature-video`, `deepen-plan-beta`). The todo system is the last major workflow artifact stored at a different top-level path (`todos/`). Consolidation improves discoverability and organization. PR #345 is adding the `.gitignore` check for `.context/`. (see origin: `docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md`)
+
+## Proposed Solution
+
+Update 7 skills to use `.context/compound-engineering/todos/` as the canonical write path while reading from both locations during the legacy drain period. Consolidate inline todo path references in consumer skills to delegate to the `file-todos` skill as the single authority.
+
+## Technical Considerations
+
+### Multi-Session Lifecycle vs. Per-Run Scratch
+
+Todos are gitignored and transient -- they don't survive clones or branch switches. But unlike per-run scratch directories (e.g., `ce-review-beta//`), a todo's lifecycle spans multiple sessions (pending -> triage -> ready -> work -> complete). The `file-todos` skill should note that `.context/compound-engineering/todos/` should not be cleaned up as part of any skill's post-run scratch cleanup. In practice the risk is low since each skill only cleans up its own namespaced subdirectory, but the note prevents misunderstanding.
+
+### ID Sequencing Across Two Directories
+
+During the drain period, issue ID generation must scan BOTH `todos/` and `.context/compound-engineering/todos/` to avoid collisions. Two todos with the same numeric ID would break the dependency system (`dependencies: ["005"]` becomes ambiguous). The `file-todos` skill's "next ID" logic must take the global max across both paths.
+
+### Directory Creation
+
+The new path is 3 levels deep (`.context/compound-engineering/todos/`). Unlike the old single-level `todos/`, this needs an explicit `mkdir -p` before first write. Add this to the "Creating a New Todo" workflow in `file-todos`.
+
+### Git Tracking
+
+Both `todos/` and `.context/` are gitignored. The `git add todos/` command in `ce-review` (line 448) is dead code -- todos in a gitignored directory were never committed through this path. Remove it.
+
+## Acceptance Criteria
+
+- [ ] New todos created by any skill land in `.context/compound-engineering/todos/`
+- [ ] Existing todos in `todos/` are still found and resolvable by `triage` and `resolve-todo-parallel`
+- [ ] Issue ID generation scans both directories to prevent collisions
+- [ ] Consumer skills (`ce-review`, `ce-review-beta`, `test-browser`, `test-xcode`) delegate to `file-todos` rather than encoding paths inline
+- [ ] `ce-review-beta` report-only prohibition uses path-agnostic language
+- [ ] Stale template paths in `ce-review` (`.claude/skills/...`) fixed to use correct relative path
+- [ ] `bun run release:validate` passes
+
+## Implementation Phases
+
+### Phase 1: Update `file-todos` (Foundation)
+
+**File:** `plugins/compound-engineering/skills/file-todos/SKILL.md`
+
+This is the authoritative skill -- all other changes depend on getting this right first.
+
+Changes:
+1. **YAML frontmatter description** (line 3): Update `todos/ directory` to `.context/compound-engineering/todos/`
+2. **Overview section** (lines 10-11): Update canonical path reference
+3. **Directory Structure section**: Update path references
+4. **Creating a New Todo workflow** (line 76-77):
+ - Add `mkdir -p .context/compound-engineering/todos/` as first step
+ - Update `ls todos/` for next-ID to scan both directories: `ls .context/compound-engineering/todos/ todos/ 2>/dev/null | grep -o '^[0-9]\+' | sort -n | tail -1`
+ - Update template copy target to `.context/compound-engineering/todos/`
+5. **Reading/Listing commands** (line 106+): Update `ls` and `grep` commands to scan both paths. Pattern: `ls .context/compound-engineering/todos/*-pending-*.md todos/*-pending-*.md 2>/dev/null`
+6. **Dependency checking** (lines 131-142): Update `[ -f ]` checks and `grep -l` to scan both directories
+7. **Quick Reference Commands** (lines 197-232): Update all commands to use new canonical path for writes, dual-path for reads
+8. **Key Distinctions** (lines 237-253): Update "Markdown files in `todos/` directory" to new path
+9. **Add a Legacy Support note** near the top: "During the transition period, always check both `.context/compound-engineering/todos/` (canonical) and `todos/` (legacy) when reading. Write only to the canonical path. Unlike per-run scratch directories, `.context/compound-engineering/todos/` has a multi-session lifecycle -- do not clean it up as part of post-run scratch cleanup."
+
+### Phase 2: Update Consumer Skills (Parallel -- Independent)
+
+These 4 skills only **create** todos. They should delegate to `file-todos` rather than encoding paths inline (R5).
+
+#### 2a. `ce-review` skill
+
+**File:** `plugins/compound-engineering/skills/ce-review/SKILL.md`
+
+Changes:
+1. **Line 244** (``): Replace `todos/ directory` with `the todo directory defined by the file-todos skill`
+2. **Lines 275, 323, 343**: Fix stale template path `.claude/skills/file-todos/assets/todo-template.md` to correct relative reference (or delegate to "load the `file-todos` skill for the template location")
+3. **Line 435** (`ls todos/*-pending-*.md`): Update to reference file-todos conventions
+4. **Line 448** (`git add todos/`): Remove this dead code (both paths are gitignored)
+
+#### 2b. `ce-review-beta` skill
+
+**File:** `plugins/compound-engineering/skills/ce-review-beta/SKILL.md`
+
+Changes:
+1. **Line 35**: Change `todos/` items to reference file-todos skill conventions
+2. **Line 41** (report-only prohibition): Change `do not create todos/` to `do not create todo files` (path-agnostic -- closes loophole where agent could write to new path thinking old prohibition doesn't apply)
+3. **Line 479**: Update `todos/` reference to delegate to file-todos skill
+
+#### 2c. `test-browser` skill
+
+**File:** `plugins/compound-engineering/skills/test-browser/SKILL.md`
+
+Changes:
+1. **Line 228**: Change `Add to todos/ for later` to `Create a todo using the file-todos skill conventions`
+2. **Line 233**: Update `{id}-pending-p1-browser-test-{description}.md` creation path or delegate to file-todos
+
+#### 2d. `test-xcode` skill
+
+**File:** `plugins/compound-engineering/skills/test-xcode/SKILL.md`
+
+Changes:
+1. **Line 142**: Change `Add to todos/ for later` to `Create a todo using the file-todos skill conventions`
+2. **Line 147**: Update todo creation path or delegate to file-todos
+
+### Phase 3: Update Reader Skills (Sequential after Phase 1)
+
+These skills **read and operate on** existing todos. They need dual-path support.
+
+#### 3a. `triage` skill
+
+**File:** `plugins/compound-engineering/skills/triage/SKILL.md`
+
+Changes:
+1. **Line 9**: Update `todos/ directory` to reference both paths
+2. **Lines 152, 275**: Change "Remove it from todos/ directory" to path-agnostic language ("Remove the todo file from its current location")
+3. **Lines 185-186**: Update summary template from `Removed from todos/` to `Removed`
+4. **Line 193**: Update `Deleted: Todo files for skipped findings removed from todos/ directory`
+5. **Line 200**: Update `ls todos/*-ready-*.md` to scan both directories
+
+#### 3b. `resolve-todo-parallel` skill
+
+**File:** `plugins/compound-engineering/skills/resolve-todo-parallel/SKILL.md`
+
+Changes:
+1. **Line 13**: Change `Get all unresolved TODOs from the /todos/*.md directory` to scan both `.context/compound-engineering/todos/*.md` and `todos/*.md`
+
+## Dependencies & Risks
+
+- **Dependency on PR #345**: That PR adds the `.gitignore` check for `.context/`. This change works regardless (`.context/` is already gitignored at repo root), but #345 adds the validation that consuming projects have it gitignored too.
+- **Risk: Agent literal-copying**: Agents often copy shell commands verbatim from skill files. If dual-path commands are unclear, agents may only check one path. Mitigation: Use explicit dual-path examples in the most critical commands (list, create, ID generation) and add a prominent note about legacy path.
+- **Risk: Other branches with in-flight todo work**: The drain strategy avoids this -- no files are moved, no paths break immediately.
+
+## Sources & References
+
+### Origin
+
+- **Origin document:** [docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md](docs/brainstorms/2026-03-24-todo-path-consolidation-requirements.md) -- Key decisions: drain naturally (no active migration), delegate to file-todos as authority (R5), update all 7 affected skills.
+
+### Internal References
+
+- `plugins/compound-engineering/skills/file-todos/SKILL.md` -- canonical todo system definition
+- `plugins/compound-engineering/skills/file-todos/assets/todo-template.md` -- todo file template
+- `AGENTS.md:27` -- `.context/compound-engineering/` scratch space convention
+- `.gitignore` -- confirms both `todos/` and `.context/` are already ignored
diff --git a/docs/solutions/adding-converter-target-providers.md b/docs/solutions/adding-converter-target-providers.md
index cccda03..0423dfe 100644
--- a/docs/solutions/adding-converter-target-providers.md
+++ b/docs/solutions/adding-converter-target-providers.md
@@ -13,21 +13,22 @@ root_cause: architectural_pattern
## Problem
-When adding support for a new AI platform (e.g., Devin, Cursor, Copilot), the converter CLI architecture requires consistent implementation across types, converters, writers, CLI integration, and tests. Without documented patterns and learnings, new targets take longer to implement and risk architectural inconsistency.
+When adding support for a new AI platform (e.g., Copilot, Windsurf, Qwen), the converter CLI architecture requires consistent implementation across types, converters, writers, CLI integration, and tests. Without documented patterns and learnings, new targets take longer to implement and risk architectural inconsistency.
## Solution
-The compound-engineering-plugin uses a proven **6-phase target provider pattern** that has been successfully applied to 8 targets:
+The compound-engineering-plugin uses a proven **6-phase target provider pattern** that has been successfully applied to 10 targets:
1. **OpenCode** (primary target, reference implementation)
2. **Codex** (second target, established pattern)
3. **Droid/Factory** (workflow/agent conversion)
4. **Pi** (MCPorter ecosystem)
5. **Gemini CLI** (content transformation patterns)
-6. **Cursor** (command flattening, rule formats)
-7. **Copilot** (GitHub native, MCP prefixing)
-8. **Kiro** (limited MCP support)
-9. **Devin** (playbook conversion, knowledge entries)
+6. **Copilot** (GitHub native, MCP prefixing)
+7. **Kiro** (limited MCP support)
+8. **Windsurf** (rules-based format)
+9. **OpenClaw** (open agent format)
+10. **Qwen** (Qwen agent format)
Each implementation follows this architecture precisely, ensuring consistency and maintainability.
@@ -63,14 +64,14 @@ export type {TargetName}Agent = {
**Key Learnings:**
- Always include a `content` field (full file text) rather than decomposed fields — it's simpler and matches how files are written
-- Use intermediate types for complex sections (e.g., `DevinPlaybookSections` in Devin converter) to make section building independently testable
+- Use intermediate types for complex sections to make section building independently testable
- Avoid target-specific fields in the base bundle unless essential — aim for shared structure across targets
- Include a `category` field if the target has file-type variants (agents vs. commands vs. rules)
**Reference Implementations:**
- OpenCode: `src/types/opencode.ts` (command + agent split)
-- Devin: `src/types/devin.ts` (playbooks + knowledge entries)
- Copilot: `src/types/copilot.ts` (agents + skills + MCP)
+- Windsurf: `src/types/windsurf.ts` (rules-based format)
---
@@ -158,7 +159,7 @@ export function transformContentFor{Target}(body: string): string {
**Deduplication Pattern (`uniqueName`):**
-Used when target has flat namespaces (Cursor, Copilot, Devin) or when name collisions occur:
+Used when target has flat namespaces (Copilot, Windsurf) or when name collisions occur:
```typescript
function uniqueName(base: string, used: Set): string {
@@ -197,7 +198,7 @@ function flattenCommandName(name: string): string {
**Key Learnings:**
-1. **Pre-scan for cross-references** — If target requires reference names (macros, URIs, IDs), build a map before conversion. Example: Devin needs macro names like `agent_kieran_rails_reviewer`, so pre-scan builds the map.
+1. **Pre-scan for cross-references** — If target requires reference names (macros, URIs, IDs), build a map before conversion to avoid name collisions and enable deduplication.
2. **Content transformation is fragile** — Test extensively. Patterns that work for slash commands might false-match on file paths. Use negative lookahead to skip `/etc`, `/usr`, `/var`, etc.
@@ -208,15 +209,15 @@ function flattenCommandName(name: string): string {
5. **MCP servers need target-specific handling:**
- **OpenCode:** Merge into `opencode.json` (preserve user keys)
- **Copilot:** Prefix env vars with `COPILOT_MCP_`, emit JSON
- - **Devin:** Write setup instructions file (config is via web UI)
- - **Cursor:** Pass through as-is
+ - **Windsurf:** Write MCP config in target-specific format
+ - **Kiro:** Limited MCP support, check compatibility
6. **Warn on unsupported features** — Hooks, Gemini extensions, Kiro-incompatible MCP types. Emit to stderr and continue conversion.
**Reference Implementations:**
- OpenCode: `src/converters/claude-to-opencode.ts` (most comprehensive)
-- Devin: `src/converters/claude-to-devin.ts` (content transformation + cross-references)
- Copilot: `src/converters/claude-to-copilot.ts` (MCP prefixing pattern)
+- Windsurf: `src/converters/claude-to-windsurf.ts` (rules-based conversion)
---
@@ -328,8 +329,7 @@ export async function backupFile(filePath: string): Promise {
5. **File extensions matter** — Match target conventions exactly:
- Copilot: `.agent.md` (note the dot)
- - Cursor: `.mdc` for rules
- - Devin: `.devin.md` for playbooks
+ - Windsurf: `.md` for rules
- OpenCode: `.md` for commands
6. **Permissions for sensitive files** — MCP config with API keys should use `0o600`:
@@ -340,7 +340,7 @@ export async function backupFile(filePath: string): Promise {
**Reference Implementations:**
- Droid: `src/targets/droid.ts` (simpler pattern, good for learning)
- Copilot: `src/targets/copilot.ts` (double-nesting pattern)
-- Devin: `src/targets/devin.ts` (setup instructions file)
+- Windsurf: `src/targets/windsurf.ts` (rules-based output)
---
@@ -377,7 +377,7 @@ if (targetName === "{target}") {
}
// Update --to flag description
-const toDescription = "Target format (opencode | codex | droid | cursor | copilot | kiro | {target})"
+const toDescription = "Target format (opencode | codex | droid | cursor | pi | copilot | gemini | kiro | windsurf | openclaw | qwen | all)"
```
---
@@ -427,7 +427,7 @@ export async function syncTo{Target}(outputRoot: string): Promise {
```typescript
// Add to validTargets array
-const validTargets = ["opencode", "codex", "droid", "cursor", "pi", "{target}"] as const
+const validTargets = ["opencode", "codex", "droid", "pi", "copilot", "gemini", "kiro", "windsurf", "openclaw", "qwen", "{target}"] as const
// In resolveOutputRoot()
case "{target}":
@@ -614,7 +614,7 @@ Add to supported targets list and include usage examples.
| Pitfall | Solution |
|---------|----------|
-| **Double-nesting** (`.cursor/.cursor/`) | Check `path.basename(outputRoot)` before nesting |
+| **Double-nesting** (`.copilot/.copilot/`) | Check `path.basename(outputRoot)` before nesting |
| **Inconsistent name normalization** | Use single `normalizeName()` function everywhere |
| **Fragile content transformation** | Test regex patterns against edge cases (file paths, URLs) |
| **Heuristic section extraction fails** | Use structural mapping (description → Overview, body → Procedure) instead |
@@ -650,13 +650,12 @@ Use this checklist when adding a new target provider:
### Documentation
- [ ] Create `docs/specs/{target}.md` with format specification
- [ ] Update `README.md` with target in list and usage examples
-- [ ] Update `CHANGELOG.md` with new target
+- [ ] Do not hand-add release notes; release automation owns GitHub release notes and release-owned versions
### Version Bumping
-- [ ] Use a `feat(...)` conventional commit so semantic-release cuts the next minor root CLI release on `main`
-- [ ] Do not hand-start a separate root CLI version line in `package.json`; the root package follows the repo `v*` tags and semantic-release writes that version back after release
-- [ ] Update plugin.json description if component counts changed
-- [ ] Verify CHANGELOG entry is clear
+- [ ] Use a conventional `feat:` or `fix:` title so release automation can infer the right bump
+- [ ] Do not hand-start or hand-bump release-owned version lines in `package.json` or plugin manifests
+- [ ] Run `bun run release:validate` if component counts or descriptions changed
---
@@ -668,7 +667,7 @@ Use this checklist when adding a new target provider:
1. **Droid** (`src/targets/droid.ts`, `src/converters/claude-to-droid.ts`) — Simplest pattern, good learning baseline
2. **Copilot** (`src/targets/copilot.ts`, `src/converters/claude-to-copilot.ts`) — MCP prefixing, double-nesting guard
-3. **Devin** (`src/converters/claude-to-devin.ts`) — Content transformation, cross-references, intermediate types
+3. **Windsurf** (`src/targets/windsurf.ts`, `src/converters/claude-to-windsurf.ts`) — Rules-based conversion
4. **OpenCode** (`src/converters/claude-to-opencode.ts`) — Most comprehensive, handles command structure and config merging
### Key Utilities
@@ -679,7 +678,6 @@ Use this checklist when adding a new target provider:
### Existing Tests
-- `tests/cursor-converter.test.ts` — Comprehensive converter tests
- `tests/copilot-writer.test.ts` — Writer tests with temp directories
- `tests/sync-copilot.test.ts` — Sync pattern with symlinks and config merge
@@ -687,7 +685,7 @@ Use this checklist when adding a new target provider:
## Related Files
-- `/C:/Source/compound-engineering-plugin/.claude-plugin/plugin.json` — Version and component counts
-- `/C:/Source/compound-engineering-plugin/CHANGELOG.md` — Recent additions and patterns
-- `/C:/Source/compound-engineering-plugin/README.md` — Usage examples for all targets
-- `/C:/Source/compound-engineering-plugin/docs/solutions/plugin-versioning-requirements.md` — Checklist for releases
+- `plugins/compound-engineering/.claude-plugin/plugin.json` — Version and component counts
+- `CHANGELOG.md` — Pointer to canonical GitHub release history
+- `README.md` — Usage examples for all targets
+- `docs/solutions/plugin-versioning-requirements.md` — Checklist for releases
diff --git a/docs/solutions/codex-skill-prompt-entrypoints.md b/docs/solutions/codex-skill-prompt-entrypoints.md
new file mode 100644
index 0000000..a0a9aa1
--- /dev/null
+++ b/docs/solutions/codex-skill-prompt-entrypoints.md
@@ -0,0 +1,152 @@
+---
+title: Codex Conversion Skills, Prompts, and Canonical Entry Points
+category: architecture
+tags: [codex, converter, skills, prompts, workflows, deprecation]
+created: 2026-03-15
+severity: medium
+component: codex-target
+problem_type: best_practice
+root_cause: outdated_target_model
+---
+
+# Codex Conversion Skills, Prompts, and Canonical Entry Points
+
+## Problem
+
+The Codex target had two conflicting assumptions:
+
+1. Compound workflow entrypoints like `ce:brainstorm` and `ce:plan` were treated in docs as slash-command-style surfaces.
+2. The Codex converter installed those entries as copied skills, not as generated prompts.
+
+That created an inconsistent runtime for cross-workflow handoffs. Copied skill content still contained Claude-style references like `/ce:plan`, but no Codex-native translation was applied to copied `SKILL.md` files, and there was no clear canonical Codex entrypoint model for those workflow skills.
+
+## What We Learned
+
+### 1. Codex supports both skills and prompts, and they are different surfaces
+
+- Skills are loaded from skill roots such as `~/.codex/skills`, and newer Codex code also supports `.agents/skills`.
+- Prompts are a separate explicit entrypoint surface under `.codex/prompts`.
+- A skill is not automatically a prompt, and a prompt is not automatically a skill.
+
+For this repo, that means a copied skill like `ce:plan` is only a skill unless the converter also generates a prompt wrapper for it.
+
+### 2. Codex skill names come from the directory name
+
+Codex derives the skill name from the skill directory basename, not from our normalized hyphenated converter name.
+
+Implication:
+
+- `~/.codex/skills/ce:plan` loads as the skill `ce:plan`
+- Rewriting that to `ce-plan` is wrong for skill-to-skill references
+
+### 3. The original bug was structural, not just wording
+
+The issue was not that `ce:brainstorm` needed slightly different prose. The real problem was:
+
+- copied skills bypassed Codex-specific transformation
+- workflow handoffs referenced a surface that was not clearly represented in installed Codex artifacts
+
+### 4. Deprecated `workflows:*` aliases add noise in Codex
+
+The `workflows:*` names exist only for backward compatibility in Claude.
+
+Copying them into Codex would:
+
+- duplicate user-facing entrypoints
+- complicate handoff rewriting
+- increase ambiguity around which name is canonical
+
+For Codex, the simpler model is to treat `ce:*` as the only canonical workflow namespace and omit `workflows:*` aliases from installed output.
+
+## Recommended Codex Model
+
+Use a two-layer mapping for workflow entrypoints:
+
+1. **Skills remain the implementation units**
+ - Copy the canonical workflow skills using their exact names, such as `ce:plan`
+ - Preserve exact skill names for any Codex skill references
+
+2. **Prompts are the explicit entrypoint layer**
+ - Generate prompt wrappers for canonical user-facing workflow entrypoints
+ - Use Codex-safe prompt slugs such as `ce-plan`, `ce-work`, `ce-review`
+ - Prompt wrappers delegate to the exact underlying skill name, such as `ce:plan`
+
+This gives Codex one clear manual invocation surface while preserving the real loaded skill names internally.
+
+## Rewrite Rules
+
+When converting copied `SKILL.md` content for Codex:
+
+- References to canonical workflow entrypoints should point to generated prompt wrappers
+ - `/ce:plan` -> `/prompts:ce-plan`
+ - `/ce:work` -> `/prompts:ce-work`
+- References to deprecated aliases should canonicalize to the modern `ce:*` prompt
+ - `/workflows:plan` -> `/prompts:ce-plan`
+- References to non-entrypoint skills should use the exact skill name, not a normalized alias
+- Actual Claude commands that are converted to Codex prompts can continue using `/prompts:...`
+
+### Regression hardening
+
+When rewriting copied `SKILL.md` files, only known workflow and command references should be rewritten.
+
+Do not rewrite arbitrary slash-shaped text such as:
+
+- application routes like `/users` or `/settings`
+- API path segments like `/state` or `/ops`
+- URLs such as `https://www.proofeditor.ai/...`
+
+Unknown slash references should remain unchanged in copied skill content. Otherwise Codex installs silently corrupt unrelated skills while trying to canonicalize workflow handoffs.
+
+Personal skills loaded from `~/.claude/skills` also need tolerant metadata parsing:
+
+- malformed YAML frontmatter should not cause the entire skill to disappear
+- keep the directory name as the stable skill name
+- treat frontmatter metadata as best-effort only
+
+## Future Entry Points
+
+Do not hard-code an allowlist of workflow names in the converter.
+
+Instead, use a stable rule:
+
+- `ce:*` = canonical workflow entrypoint
+ - auto-generate a prompt wrapper
+- `workflows:*` = deprecated alias
+ - omit from Codex output
+ - rewrite references to the canonical `ce:*` target
+- non-`ce:*` skills = skill-only by default
+ - if a non-`ce:*` skill should also be a prompt entrypoint, mark it explicitly with Codex-specific metadata
+
+This means future skills like `ce:ideate` should work without manual converter changes.
+
+## Implementation Guidance
+
+For the Codex target:
+
+1. Parse enough skill frontmatter to distinguish command-like entrypoint skills from background skills
+2. Filter deprecated `workflows:*` alias skills out of Codex installation
+3. Generate prompt wrappers for canonical `ce:*` workflow skills
+4. Apply Codex-specific transformation to copied `SKILL.md` files
+5. Preserve exact Codex skill names internally
+6. Update README language so Codex entrypoints are documented as Codex-native surfaces, not assumed to be identical to Claude slash commands
+
+## Prevention
+
+Before changing the Codex converter again:
+
+1. Verify whether the target surface is a skill, a prompt, or both
+2. Check how Codex derives names from installed artifacts
+3. Decide which names are canonical before copying deprecated aliases
+4. Add tests for copied skill content, not just generated prompt content
+
+## Related Files
+
+- `src/converters/claude-to-codex.ts`
+- `src/targets/codex.ts`
+- `src/types/codex.ts`
+- `tests/codex-converter.test.ts`
+- `tests/codex-writer.test.ts`
+- `README.md`
+- `plugins/compound-engineering/skills/ce-brainstorm/SKILL.md`
+- `plugins/compound-engineering/skills/ce-plan/SKILL.md`
+- `docs/solutions/adding-converter-target-providers.md`
diff --git a/docs/solutions/integrations/agent-browser-chrome-authentication-patterns.md b/docs/solutions/integrations/agent-browser-chrome-authentication-patterns.md
new file mode 100644
index 0000000..f60a070
--- /dev/null
+++ b/docs/solutions/integrations/agent-browser-chrome-authentication-patterns.md
@@ -0,0 +1,147 @@
+---
+title: "Persistent GitHub authentication for agent-browser using named sessions"
+category: integrations
+date: 2026-03-22
+tags:
+ - agent-browser
+ - github
+ - authentication
+ - chrome
+ - session-persistence
+ - lightpanda
+related_to:
+ - plugins/compound-engineering/skills/feature-video/SKILL.md
+ - plugins/compound-engineering/skills/agent-browser/SKILL.md
+ - plugins/compound-engineering/skills/agent-browser/references/authentication.md
+ - plugins/compound-engineering/skills/agent-browser/references/session-management.md
+---
+
+# agent-browser Chrome Authentication for GitHub
+
+## Problem
+
+agent-browser needs authenticated access to GitHub for workflows like the native video
+upload in the feature-video skill. Multiple authentication approaches were evaluated
+before finding one that works reliably with 2FA, SSO, and OAuth.
+
+## Investigation
+
+| Approach | Result |
+|---|---|
+| `--profile` flag | Lightpanda (default engine on some installs) throws "Profiles are not supported with Lightpanda". Must use `--engine chrome`. |
+| Fresh Chrome profile | No GitHub cookies. Shows "Sign up for free" instead of comment form. |
+| `--auto-connect` | Requires Chrome pre-launched with `--remote-debugging-port`. Error: "No running Chrome instance found" in normal use. Impractical. |
+| Auth vault (`auth save`/`auth login`) | Cannot handle 2FA, SSO, or OAuth redirects. Only works for simple username/password forms. |
+| `--session-name` with Chrome engine | Cookies auto-save/restore. One-time headed login handles any auth method. **This works.** |
+
+## Working Solution
+
+### One-time setup (headed, user logs in manually)
+
+```bash
+# Close any running daemon (ignores engine/option changes when reused)
+agent-browser close
+
+# Open GitHub login in headed Chrome with a named session
+agent-browser --engine chrome --headed --session-name github open https://github.com/login
+# User logs in manually -- handles 2FA, SSO, OAuth, any method
+
+# Verify auth
+agent-browser open https://github.com/settings/profile
+# If profile page loads, auth is confirmed
+```
+
+### Session validity check (before each workflow)
+
+```bash
+agent-browser close
+agent-browser --engine chrome --session-name github open https://github.com/settings/profile
+agent-browser get title
+# Title contains username or "Profile" -> session valid, proceed
+# Title contains "Sign in" or URL is github.com/login -> session expired, re-auth
+```
+
+### All subsequent runs (headless, cookies persist)
+
+```bash
+agent-browser --engine chrome --session-name github open https://github.com/...
+```
+
+## Key Findings
+
+### Engine requirement
+
+MUST use `--engine chrome`. Lightpanda does not support profiles, session persistence,
+or state files. Any workflow that uses `--session-name`, `--profile`, `--state`, or
+`state save/load` requires the Chrome engine.
+
+Include `--engine chrome` explicitly in every command that uses an authenticated session.
+Do not rely on environment defaults -- `AGENT_BROWSER_ENGINE` may be set to `lightpanda`
+in some environments.
+
+### Daemon restart
+
+Must run `agent-browser close` before switching engine or session options. A running
+daemon ignores new flags like `--engine`, `--headed`, or `--session-name`.
+
+### Session lifetime
+
+Cookies expire when GitHub invalidates them (typically weeks). Periodic re-authentication
+is required. The feature-video skill handles this by checking session validity before
+the upload step and prompting for re-auth only when needed.
+
+### Auth vault limitations
+
+The auth vault (`agent-browser auth save`/`auth login`) can only handle login forms with
+visible username and password fields. It cannot handle:
+
+- 2FA (TOTP, SMS, push notification)
+- SSO with identity provider redirect
+- OAuth consent flows
+- CAPTCHA
+- Device verification prompts
+
+For GitHub and most modern services, use the one-time headed login approach instead.
+
+### `--auto-connect` viability
+
+Impractical for automated workflows. Requires Chrome to be pre-launched with
+`--remote-debugging-port=9222`, which is not how users normally run Chrome.
+
+## Prevention
+
+### Skills requiring auth must declare engine
+
+State the engine requirement in the Prerequisites section of any skill that needs
+browser auth. Include `--engine chrome` in every `agent-browser` command that touches
+an authenticated session.
+
+### Session check timing
+
+Perform the session check immediately before the step that needs auth, not at skill
+start. A session valid at start may expire during a long workflow (video encoding can
+take minutes).
+
+### Recovery without restart
+
+When expiry is detected at upload time, the video file is already encoded. Recovery:
+re-authenticate, then retry only the upload step. Do not restart from the beginning.
+
+### Concurrent sessions
+
+Use `--session-name` with a semantically descriptive name (e.g., `github`) when multiple
+skills or agents may run concurrently. Two concurrent runs sharing the default session
+will interfere with each other.
+
+### State file security
+
+Session state files in `~/.agent-browser/sessions/` contain cookies in plaintext.
+Do not commit to repositories. Add to `.gitignore` if the session directory is inside
+a repo tree.
+
+## Integration Points
+
+This pattern is used by:
+- `feature-video` skill (GitHub native video upload)
+- Any future skill requiring authenticated GitHub browser access
+- Potential use for other OAuth-protected services (same pattern, different session name)
diff --git a/docs/solutions/integrations/github-native-video-upload-pr-automation.md b/docs/solutions/integrations/github-native-video-upload-pr-automation.md
new file mode 100644
index 0000000..7278996
--- /dev/null
+++ b/docs/solutions/integrations/github-native-video-upload-pr-automation.md
@@ -0,0 +1,141 @@
+---
+title: "GitHub inline video embedding via programmatic browser upload"
+category: integrations
+date: 2026-03-22
+tags:
+ - github
+ - video-embedding
+ - agent-browser
+ - playwright
+ - feature-video
+ - pr-description
+related_to:
+ - plugins/compound-engineering/skills/feature-video/SKILL.md
+ - plugins/compound-engineering/skills/agent-browser/SKILL.md
+ - plugins/compound-engineering/skills/agent-browser/references/authentication.md
+---
+
+# GitHub Native Video Upload for PRs
+
+## Problem
+
+Embedding video demos in GitHub PR descriptions required external storage (R2/rclone)
+or GitHub Release assets. Release asset URLs render as plain download links, not inline
+video players. Only `user-attachments/assets/` URLs render with GitHub's native inline
+video player -- the same result as pasting a video into the PR editor manually.
+
+The distinction is absolute:
+
+| URL namespace | Rendering |
+|---|---|
+| `github.com/releases/download/...` | Plain download link (bad UX, triggers download on mobile) |
+| `github.com/user-attachments/assets/...` | Native inline `
+### Phase 0.5: Auto Memory Scan
+
+Before launching Phase 1 subagents, check the auto memory directory for notes relevant to the problem being documented.
+
+1. Read MEMORY.md from the auto memory directory (the path is known from the system prompt context)
+2. If the directory or MEMORY.md does not exist, is empty, or is unreadable, skip this step and proceed to Phase 1 unchanged
+3. Scan the entries for anything related to the problem being documented -- use semantic judgment, not keyword matching
+4. If relevant entries are found, prepare a labeled excerpt block:
+
+```
+## Supplementary notes from auto memory
+Treat as additional context, not primary evidence. Conversation history
+and codebase findings take priority over these notes.
+
+[relevant entries here]
+```
+
+5. Pass this block as additional context to the Context Analyzer and Solution Extractor task prompts in Phase 1. If any memory notes end up in the final documentation (e.g., as part of the investigation steps or root cause analysis), tag them with "(auto memory [claude])" so their origin is clear to future readers.
+
+If no relevant entries are found, proceed to Phase 1 without passing memory context.
+
### Phase 1: Parallel Research
@@ -46,32 +67,84 @@ Launch these subagents IN PARALLEL. Each returns text data to the orchestrator.
#### 1. **Context Analyzer**
- Extracts conversation history
- Identifies problem type, component, symptoms
- - Validates against schema
- - Returns: YAML frontmatter skeleton
+ - Incorporates auto memory excerpts (if provided by the orchestrator) as supplementary evidence when identifying problem type, component, and symptoms
+ - Validates all enum fields against the schema values below
+ - Maps problem_type to the `docs/solutions/` category directory
+ - Suggests a filename using the pattern `[sanitized-problem-slug]-[date].md`
+ - Returns: YAML frontmatter skeleton (must include `category:` field mapped from problem_type), category directory path, and suggested filename
+
+ **Schema enum values (validate against these exactly):**
+
+ - **problem_type**: build_error, test_failure, runtime_error, performance_issue, database_issue, security_issue, ui_bug, integration_issue, logic_error, developer_experience, workflow_issue, best_practice, documentation_gap
+ - **component**: rails_model, rails_controller, rails_view, service_object, background_job, database, frontend_stimulus, hotwire_turbo, email_processing, brief_system, assistant, authentication, payments, development_workflow, testing_framework, documentation, tooling
+ - **root_cause**: missing_association, missing_include, missing_index, wrong_api, scope_issue, thread_violation, async_timing, memory_leak, config_error, logic_error, test_isolation, missing_validation, missing_permission, missing_workflow_step, inadequate_documentation, missing_tooling, incomplete_setup
+ - **resolution_type**: code_fix, migration, config_change, test_fix, dependency_update, environment_setup, workflow_improvement, documentation_update, tooling_addition, seed_data_update
+ - **severity**: critical, high, medium, low
+
+ **Category mapping (problem_type -> directory):**
+
+ | problem_type | Directory |
+ |---|---|
+ | build_error | build-errors/ |
+ | test_failure | test-failures/ |
+ | runtime_error | runtime-errors/ |
+ | performance_issue | performance-issues/ |
+ | database_issue | database-issues/ |
+ | security_issue | security-issues/ |
+ | ui_bug | ui-bugs/ |
+ | integration_issue | integration-issues/ |
+ | logic_error | logic-errors/ |
+ | developer_experience | developer-experience/ |
+ | workflow_issue | workflow-issues/ |
+ | best_practice | best-practices/ |
+ | documentation_gap | documentation-gaps/ |
#### 2. **Solution Extractor**
- Analyzes all investigation steps
- Identifies root cause
- Extracts working solution with code examples
- - Returns: Solution content block
+ - Incorporates auto memory excerpts (if provided by the orchestrator) as supplementary evidence -- conversation history and the verified fix take priority; if memory notes contradict the conversation, note the contradiction as cautionary context
+ - Develops prevention strategies and best practices guidance
+ - Generates test cases if applicable
+ - Returns: Solution content block including prevention section
+
+ **Expected output sections (follow this structure):**
+
+ - **Problem**: 1-2 sentence description of the issue
+ - **Symptoms**: Observable symptoms (error messages, behavior)
+ - **What Didn't Work**: Failed investigation attempts and why they failed
+ - **Solution**: The actual fix with code examples (before/after when applicable)
+ - **Why This Works**: Root cause explanation and why the solution addresses it
+ - **Prevention**: Strategies to avoid recurrence, best practices, and test cases. Include concrete code examples where applicable (e.g., gem configurations, test assertions, linting rules)
#### 3. **Related Docs Finder**
- Searches `docs/solutions/` for related documentation
- Identifies cross-references and links
- Finds related GitHub issues
- - Returns: Links and relationships
+ - Flags any related learning or pattern docs that may now be stale, contradicted, or overly broad
+ - **Assesses overlap** with the new doc being created across five dimensions: problem statement, root cause, solution approach, referenced files, and prevention rules. Score as:
+ - **High**: 4-5 dimensions match — essentially the same problem solved again
+ - **Moderate**: 2-3 dimensions match — same area but different angle or solution
+ - **Low**: 0-1 dimensions match — related but distinct
+ - Returns: Links, relationships, refresh candidates, and overlap assessment (score + which dimensions matched)
-#### 4. **Prevention Strategist**
- - Develops prevention strategies
- - Creates best practices guidance
- - Generates test cases if applicable
- - Returns: Prevention/testing content
+ **Search strategy (grep-first filtering for efficiency):**
-#### 5. **Category Classifier**
- - Determines optimal `docs/solutions/` category
- - Validates category against schema
- - Suggests filename based on slug
- - Returns: Final path and filename
+ 1. Extract keywords from the problem context: module names, technical terms, error messages, component types
+ 2. If the problem category is clear, narrow search to the matching `docs/solutions//` directory
+ 3. Use the native content-search tool (e.g., Grep in Claude Code) to pre-filter candidate files BEFORE reading any content. Run multiple searches in parallel, case-insensitive, targeting frontmatter fields. These are template patterns -- substitute actual keywords:
+ - `title:.*`
+ - `tags:.*(|)`
+ - `module:.*`
+ - `component:.*`
+ 4. If search returns >25 candidates, re-run with more specific patterns. If <3, broaden to full content search
+ 5. Read only frontmatter (first 30 lines) of candidate files to score relevance
+ 6. Fully read only strong/moderate matches
+ 7. Return distilled links and relationships, not raw file contents
+
+ **GitHub issue search:**
+
+ Prefer the `gh` CLI for searching related issues: `gh issue list --search "" --state all --limit 5`. If `gh` is not installed, fall back to the GitHub MCP tools (e.g., `unblocked` data_retrieval) if available. If neither is available, skip GitHub issue search and note it was skipped in the output.
@@ -84,13 +157,73 @@ Launch these subagents IN PARALLEL. Each returns text data to the orchestrator.
The orchestrating agent (main conversation) performs these steps:
1. Collect all text results from Phase 1 subagents
-2. Assemble complete markdown file from the collected pieces
-3. Validate YAML frontmatter against schema
-4. Create directory if needed: `mkdir -p docs/solutions/[category]/`
-5. Write the SINGLE final file: `docs/solutions/[category]/[filename].md`
+2. **Check the overlap assessment** from the Related Docs Finder before deciding what to write:
+
+ | Overlap | Action |
+ |---------|--------|
+ | **High** — existing doc covers the same problem, root cause, and solution | **Update the existing doc** with fresher context (new code examples, updated references, additional prevention tips) rather than creating a duplicate. The existing doc's path and structure stay the same. |
+ | **Moderate** — same problem area but different angle, root cause, or solution | **Create the new doc** normally. Flag the overlap for Phase 2.5 to recommend consolidation review. |
+ | **Low or none** | **Create the new doc** normally. |
+
+ The reason to update rather than create: two docs describing the same problem and solution will inevitably drift apart. The newer context is fresher and more trustworthy, so fold it into the existing doc rather than creating a second one that immediately needs consolidation.
+
+ When updating an existing doc, preserve its file path and frontmatter structure. Update the solution, code examples, prevention tips, and any stale references. Add a `last_updated: YYYY-MM-DD` field to the frontmatter. Do not change the title unless the problem framing has materially shifted.
+
+3. Assemble complete markdown file from the collected pieces
+4. Validate YAML frontmatter against schema
+5. Create directory if needed: `mkdir -p docs/solutions/[category]/`
+6. Write the file: either the updated existing doc or the new `docs/solutions/[category]/[filename].md`
+### Phase 2.5: Selective Refresh Check
+
+After writing the new learning, decide whether this new solution is evidence that older docs should be refreshed.
+
+`ce:compound-refresh` is **not** a default follow-up. Use it selectively when the new learning suggests an older learning or pattern doc may now be inaccurate.
+
+It makes sense to invoke `ce:compound-refresh` when one or more of these are true:
+
+1. A related learning or pattern doc recommends an approach that the new fix now contradicts
+2. The new fix clearly supersedes an older documented solution
+3. The current work involved a refactor, migration, rename, or dependency upgrade that likely invalidated references in older docs
+4. A pattern doc now looks overly broad, outdated, or no longer supported by the refreshed reality
+5. The Related Docs Finder surfaced high-confidence refresh candidates in the same problem space
+6. The Related Docs Finder reported **moderate overlap** with an existing doc — there may be consolidation opportunities that benefit from a focused review
+
+It does **not** make sense to invoke `ce:compound-refresh` when:
+
+1. No related docs were found
+2. Related docs still appear consistent with the new learning
+3. The overlap is superficial and does not change prior guidance
+4. Refresh would require a broad historical review with weak evidence
+
+Use these rules:
+
+- If there is **one obvious stale candidate**, invoke `ce:compound-refresh` with a narrow scope hint after the new learning is written
+- If there are **multiple candidates in the same area**, ask the user whether to run a targeted refresh for that module, category, or pattern set
+- If context is already tight or you are in compact-safe mode, do not expand into a broad refresh automatically; instead recommend `ce:compound-refresh` as the next step with a scope hint
+
+When invoking or recommending `ce:compound-refresh`, be explicit about the argument to pass. Prefer the narrowest useful scope:
+
+- **Specific file** when one learning or pattern doc is the likely stale artifact
+- **Module or component name** when several related docs may need review
+- **Category name** when the drift is concentrated in one solutions area
+- **Pattern filename or pattern topic** when the stale guidance lives in `docs/solutions/patterns/`
+
+Examples:
+
+- `/ce:compound-refresh plugin-versioning-requirements`
+- `/ce:compound-refresh payments`
+- `/ce:compound-refresh performance-issues`
+- `/ce:compound-refresh critical-patterns`
+
+A single scope hint may still expand to multiple related docs when the change is cross-cutting within one domain, category, or pattern area.
+
+Do not invoke `ce:compound-refresh` without an argument unless the user explicitly wants a broad sweep.
+
+Always capture the new learning first. Refresh is a targeted maintenance follow-up, not a prerequisite for documentation.
+
### Phase 3: Optional Enhancement
**WAIT for Phase 2 to complete before proceeding.**
@@ -119,7 +252,7 @@ When context budget is tight, this mode skips parallel subagents entirely. The o
The orchestrator (main conversation) performs ALL of the following in one sequential pass:
-1. **Extract from conversation**: Identify the problem, root cause, and solution from conversation history
+1. **Extract from conversation**: Identify the problem, root cause, and solution from conversation history. Also read MEMORY.md from the auto memory directory if it exists -- use any relevant notes as supplementary context alongside conversation history. Tag any memory-sourced content incorporated into the final doc with "(auto memory [claude])"
2. **Classify**: Determine category and filename (same categories as full mode)
3. **Write minimal doc**: Create `docs/solutions/[category]/[filename].md` with:
- YAML frontmatter (title, category, date, tags)
@@ -143,6 +276,8 @@ re-run /compound in a fresh session.
**No subagents are launched. No parallel tasks. One file written.**
+In compact-safe mode, the overlap check is skipped (no Related Docs Finder subagent). This means compact-safe mode may create a doc that overlaps with an existing one. That is acceptable — `ce:compound-refresh` will catch it later. Only suggest `ce:compound-refresh` if there is an obvious narrow refresh target. Do not broaden into a large refresh sweep from a compact-safe session.
+
---
## What It Captures
@@ -192,19 +327,20 @@ re-run /compound in a fresh session.
|----------|-----------|
| Subagents write files like `context-analysis.md`, `solution-draft.md` | Subagents return text data; orchestrator writes one final file |
| Research and assembly run in parallel | Research completes → then assembly runs |
-| Multiple files created during workflow | Single file: `docs/solutions/[category]/[filename].md` |
+| Multiple files created during workflow | One file written or updated: `docs/solutions/[category]/[filename].md` |
+| Creating a new doc when an existing doc covers the same problem | Check overlap assessment; update the existing doc when overlap is high |
## Success Output
```
✓ Documentation complete
+Auto memory: 2 relevant entries used as supplementary evidence
+
Subagent Results:
- ✓ Context Analyzer: Identified performance_issue in brief_system
- ✓ Solution Extractor: 3 code fixes
+ ✓ Context Analyzer: Identified performance_issue in brief_system, category: performance-issues/
+ ✓ Solution Extractor: 3 code fixes, prevention strategies
✓ Related Docs Finder: 2 related issues
- ✓ Prevention Strategist: Prevention strategies, test suggestions
- ✓ Category Classifier: `performance-issues`
Specialized Agent Reviews (Auto-Triggered):
✓ performance-oracle: Validated query optimization approach
@@ -226,6 +362,19 @@ What's next?
5. Other
```
+**Alternate output (when updating an existing doc due to high overlap):**
+
+```
+✓ Documentation updated (existing doc refreshed with current context)
+
+Overlap detected: docs/solutions/performance-issues/n-plus-one-queries.md
+ Matched dimensions: problem statement, root cause, solution, referenced files
+ Action: Updated existing doc with fresher code examples and prevention tips
+
+File updated:
+- docs/solutions/performance-issues/n-plus-one-queries.md (added last_updated: 2026-03-24)
+```
+
## The Compounding Philosophy
This creates a compounding knowledge system:
diff --git a/plugins/compound-engineering/skills/ce-ideate/SKILL.md b/plugins/compound-engineering/skills/ce-ideate/SKILL.md
new file mode 100644
index 0000000..4a1d4d0
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-ideate/SKILL.md
@@ -0,0 +1,370 @@
+---
+name: ce:ideate
+description: "Generate and critically evaluate grounded improvement ideas for the current project. Use when asking what to improve, requesting idea generation, exploring surprising improvements, or wanting the AI to proactively suggest strong project directions before brainstorming one in depth. Triggers on phrases like 'what should I improve', 'give me ideas', 'ideate on this project', 'surprise me with improvements', 'what would you change', or any request for AI-generated project improvement suggestions rather than refining the user's own idea."
+argument-hint: "[optional: feature, focus area, or constraint]"
+---
+
+# Generate Improvement Ideas
+
+**Note: The current year is 2026.** Use this when dating ideation documents and checking recent ideation artifacts.
+
+`ce:ideate` precedes `ce:brainstorm`.
+
+- `ce:ideate` answers: "What are the strongest ideas worth exploring?"
+- `ce:brainstorm` answers: "What exactly should one chosen idea mean?"
+- `ce:plan` answers: "How should it be built?"
+
+This workflow produces a ranked ideation artifact in `docs/ideation/`. It does **not** produce requirements, plans, or code.
+
+## Interaction Method
+
+Use the platform's blocking question tool when available (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
+
+Ask one question at a time. Prefer concise single-select choices when natural options exist.
+
+## Focus Hint
+
+ #$ARGUMENTS
+
+Interpret any provided argument as optional context. It may be:
+
+- a concept such as `DX improvements`
+- a path such as `plugins/compound-engineering/skills/`
+- a constraint such as `low-complexity quick wins`
+- a volume hint such as `top 3`, `100 ideas`, or `raise the bar`
+
+If no argument is provided, proceed with open-ended ideation.
+
+## Core Principles
+
+1. **Ground before ideating** - Scan the actual codebase first. Do not generate abstract product advice detached from the repository.
+2. **Diverge before judging** - Generate the full idea set before evaluating any individual idea.
+3. **Use adversarial filtering** - The quality mechanism is explicit rejection with reasons, not optimistic ranking.
+4. **Preserve the original prompt mechanism** - Generate many ideas, critique the whole list, then explain only the survivors in detail. Do not let extra process obscure this pattern.
+5. **Use agent diversity to improve the candidate pool** - Parallel sub-agents are a support mechanism for richer idea generation and critique, not the core workflow itself.
+6. **Preserve the artifact early** - Write the ideation document before presenting results so work survives interruptions.
+7. **Route action into brainstorming** - Ideation identifies promising directions; `ce:brainstorm` defines the selected one precisely enough for planning.
+
+## Execution Flow
+
+### Phase 0: Resume and Scope
+
+#### 0.1 Check for Recent Ideation Work
+
+Look in `docs/ideation/` for ideation documents created within the last 30 days.
+
+Treat a prior ideation doc as relevant when:
+- the topic matches the requested focus
+- the path or subsystem overlaps the requested focus
+- the request is open-ended and there is an obvious recent open ideation doc
+- the issue-grounded status matches: do not offer to resume a non-issue ideation when the current argument indicates issue-tracker intent, or vice versa — treat these as distinct topics
+
+If a relevant doc exists, ask whether to:
+1. continue from it
+2. start fresh
+
+If continuing:
+- read the document
+- summarize what has already been explored
+- preserve previous idea statuses and session log entries
+- update the existing file instead of creating a duplicate
+
+#### 0.2 Interpret Focus and Volume
+
+Infer three things from the argument:
+
+- **Focus context** - concept, path, constraint, or open-ended
+- **Volume override** - any hint that changes candidate or survivor counts
+- **Issue-tracker intent** - whether the user wants issue/bug data as an input source
+
+Issue-tracker intent triggers when the argument's primary intent is about analyzing issue patterns: `bugs`, `github issues`, `open issues`, `issue patterns`, `what users are reporting`, `bug reports`, `issue themes`.
+
+Do NOT trigger on arguments that merely mention bugs as a focus: `bug in auth`, `fix the login issue`, `the signup bug` — these are focus hints, not requests to analyze the issue tracker.
+
+When combined (e.g., `top 3 bugs in authentication`): detect issue-tracker intent first, volume override second, remainder is the focus hint. The focus narrows which issues matter; the volume override controls survivor count.
+
+Default volume:
+- each ideation sub-agent generates about 7-8 ideas (yielding 30-40 raw ideas across agents, ~20-30 after dedupe)
+- keep the top 5-7 survivors
+
+Honor clear overrides such as:
+- `top 3`
+- `100 ideas`
+- `go deep`
+- `raise the bar`
+
+Use reasonable interpretation rather than formal parsing.
+
+### Phase 1: Codebase Scan
+
+Before generating ideas, gather codebase context.
+
+Run agents in parallel in the **foreground** (do not use background dispatch — the results are needed before proceeding):
+
+1. **Quick context scan** — dispatch a general-purpose sub-agent with this prompt:
+
+ > Read the project's AGENTS.md (or CLAUDE.md only as compatibility fallback, then README.md if neither exists), then discover the top-level directory layout using the native file-search/glob tool (e.g., `Glob` with pattern `*` or `*/*` in Claude Code). Return a concise summary (under 30 lines) covering:
+ > - project shape (language, framework, top-level directory layout)
+ > - notable patterns or conventions
+ > - obvious pain points or gaps
+ > - likely leverage points for improvement
+ >
+ > Keep the scan shallow — read only top-level documentation and directory structure. Do not analyze GitHub issues, templates, or contribution guidelines. Do not do deep code search.
+ >
+ > Focus hint: {focus_hint}
+
+2. **Learnings search** — dispatch `compound-engineering:research:learnings-researcher` with a brief summary of the ideation focus.
+
+3. **Issue intelligence** (conditional) — if issue-tracker intent was detected in Phase 0.2, dispatch `compound-engineering:research:issue-intelligence-analyst` with the focus hint. If a focus hint is present, pass it so the agent can weight its clustering toward that area. Run this in parallel with agents 1 and 2.
+
+ If the agent returns an error (gh not installed, no remote, auth failure), log a warning to the user ("Issue analysis unavailable: {reason}. Proceeding with standard ideation.") and continue with the existing two-agent grounding.
+
+ If the agent reports fewer than 5 total issues, note "Insufficient issue signal for theme analysis" and proceed with default ideation frames in Phase 2.
+
+Consolidate all results into a short grounding summary. When issue intelligence is present, keep it as a distinct section so ideation sub-agents can distinguish between code-observed and user-reported signals:
+
+- **Codebase context** — project shape, notable patterns, obvious pain points, likely leverage points
+- **Past learnings** — relevant institutional knowledge from docs/solutions/
+- **Issue intelligence** (when present) — theme summaries from the issue intelligence agent, preserving theme titles, descriptions, issue counts, and trend directions
+
+Do **not** do external research in v1.
+
+### Phase 2: Divergent Ideation
+
+Follow this mechanism exactly:
+
+1. Generate the full candidate list before critiquing any idea.
+2. Each sub-agent targets about 7-8 ideas by default. With 4-6 agents this yields 30-40 raw ideas, which merge and dedupe to roughly 20-30 unique candidates. Adjust the per-agent target when volume overrides apply (e.g., "100 ideas" raises it, "top 3" may lower the survivor count instead).
+3. Push past the safe obvious layer. Each agent's first few ideas tend to be obvious — push past them.
+4. Ground every idea in the Phase 1 scan.
+5. Use this prompting pattern as the backbone:
+ - first generate many ideas
+ - then challenge them systematically
+ - then explain only the survivors in detail
+6. If the platform supports sub-agents, use them to improve diversity in the candidate pool rather than to replace the core mechanism.
+7. Give each ideation sub-agent the same:
+ - grounding summary
+ - focus hint
+ - per-agent volume target (~7-8 ideas by default)
+ - instruction to generate raw candidates only, not critique
+8. When using sub-agents, assign each one a different ideation frame as a **starting bias, not a constraint**. Prompt each agent to begin from its assigned perspective but follow any promising thread wherever it leads — cross-cutting ideas that span multiple frames are valuable, not out of scope.
+
+ **Frame selection depends on whether issue intelligence is active:**
+
+ **When issue-tracker intent is active and themes were returned:**
+ - Each theme with `confidence: high` or `confidence: medium` becomes an ideation frame. The frame prompt uses the theme title and description as the starting bias.
+ - If fewer than 4 cluster-derived frames, pad with default frames in this order: "leverage and compounding effects", "assumption-breaking or reframing", "inversion, removal, or automation of a painful step". These complement issue-grounded themes by pushing beyond the reported problems.
+ - Cap at 6 total frames. If more than 6 themes qualify, use the top 6 by issue count; note remaining themes in the grounding summary as "minor themes" so sub-agents are still aware of them.
+
+ **When issue-tracker intent is NOT active (default):**
+ - user or operator pain and friction
+ - unmet need or missing capability
+ - inversion, removal, or automation of a painful step
+ - assumption-breaking or reframing
+ - leverage and compounding effects
+ - extreme cases, edge cases, or power-user pressure
+9. Ask each ideation sub-agent to return a standardized structure for each idea so the orchestrator can merge and reason over the outputs consistently. Prefer a compact JSON-like structure with:
+ - title
+ - summary
+ - why_it_matters
+ - evidence or grounding hooks
+ - optional local signals such as boldness or focus_fit
+10. Merge and dedupe the sub-agent outputs into one master candidate list.
+11. **Synthesize cross-cutting combinations.** After deduping, scan the merged list for ideas from different frames that together suggest something stronger than either alone. If two or more ideas naturally combine into a higher-leverage proposal, add the combined idea to the list (expect 3-5 additions at most). This synthesis step belongs to the orchestrator because it requires seeing all ideas simultaneously.
+12. Spread ideas across multiple dimensions when justified:
+ - workflow/DX
+ - reliability
+ - extensibility
+ - missing capabilities
+ - docs/knowledge compounding
+ - quality and maintenance
+ - leverage on future work
+13. If a focus was provided, pass it to every ideation sub-agent and weight the merged list toward it without excluding stronger adjacent ideas.
+
+The mechanism to preserve is:
+- generate many ideas first
+- critique the full combined list second
+- explain only the survivors in detail
+
+The sub-agent pattern to preserve is:
+- independent ideation with frames as starting biases first
+- orchestrator merge, dedupe, and cross-cutting synthesis second
+- critique only after the combined and synthesized list exists
+
+### Phase 3: Adversarial Filtering
+
+Review every generated idea critically.
+
+Prefer a two-layer critique:
+1. Have one or more skeptical sub-agents attack the merged list from distinct angles.
+2. Have the orchestrator synthesize those critiques, apply the rubric consistently, score the survivors, and decide the final ranking.
+
+Do not let critique agents generate replacement ideas in this phase unless explicitly refining.
+
+Critique agents may provide local judgments, but final scoring authority belongs to the orchestrator so the ranking stays consistent across different frames and perspectives.
+
+For each rejected idea, write a one-line reason.
+
+Use rejection criteria such as:
+- too vague
+- not actionable
+- duplicates a stronger idea
+- not grounded in the current codebase
+- too expensive relative to likely value
+- already covered by existing workflows or docs
+- interesting but better handled as a brainstorm variant, not a product improvement
+
+Use a consistent survivor rubric that weighs:
+- groundedness in the current repo
+- expected value
+- novelty
+- pragmatism
+- leverage on future work
+- implementation burden
+- overlap with stronger ideas
+
+Target output:
+- keep 5-7 survivors by default
+- if too many survive, run a second stricter pass
+- if fewer than 5 survive, report that honestly rather than lowering the bar
+
+### Phase 4: Present the Survivors
+
+Present the surviving ideas to the user before writing the durable artifact.
+
+This first presentation is a review checkpoint, not the final archived result.
+
+Present only the surviving ideas in structured form:
+
+- title
+- description
+- rationale
+- downsides
+- confidence score
+- estimated complexity
+
+Then include a brief rejection summary so the user can see what was considered and cut.
+
+Keep the presentation concise. The durable artifact holds the full record.
+
+Allow brief follow-up questions and lightweight clarification before writing the artifact.
+
+Do not write the ideation doc yet unless:
+- the user indicates the candidate set is good enough to preserve
+- the user asks to refine and continue in a way that should be recorded
+- the workflow is about to hand off to `ce:brainstorm`, Proof sharing, or session end
+
+### Phase 5: Write the Ideation Artifact
+
+Write the ideation artifact after the candidate set has been reviewed enough to preserve.
+
+Always write or update the artifact before:
+- handing off to `ce:brainstorm`
+- sharing to Proof
+- ending the session
+
+To write the artifact:
+
+1. Ensure `docs/ideation/` exists
+2. Choose the file path:
+ - `docs/ideation/YYYY-MM-DD--ideation.md`
+ - `docs/ideation/YYYY-MM-DD-open-ideation.md` when no focus exists
+3. Write or update the ideation document
+
+Use this structure and omit clearly irrelevant fields only when necessary:
+
+```markdown
+---
+date: YYYY-MM-DD
+topic:
+focus:
+---
+
+# Ideation:
+
+## Codebase Context
+[Grounding summary from Phase 1]
+
+## Ranked Ideas
+
+### 1.
+**Description:** [Concrete explanation]
+**Rationale:** [Why this improves the project]
+**Downsides:** [Tradeoffs or costs]
+**Confidence:** [0-100%]
+**Complexity:** [Low / Medium / High]
+**Status:** [Unexplored / Explored]
+
+## Rejection Summary
+
+| # | Idea | Reason Rejected |
+|---|------|-----------------|
+| 1 | | |
+
+## Session Log
+- YYYY-MM-DD: Initial ideation — generated, survived
+```
+
+If resuming:
+- update the existing file in place
+- append to the session log
+- preserve explored markers
+
+### Phase 6: Refine or Hand Off
+
+After presenting the results, ask what should happen next.
+
+Offer these options:
+1. brainstorm a selected idea
+2. refine the ideation
+3. share to Proof
+4. end the session
+
+#### 6.1 Brainstorm a Selected Idea
+
+If the user selects an idea:
+- write or update the ideation doc first
+- mark that idea as `Explored`
+- note the brainstorm date in the session log
+- invoke `ce:brainstorm` with the selected idea as the seed
+
+Do **not** skip brainstorming and go straight to planning from ideation output.
+
+#### 6.2 Refine the Ideation
+
+Route refinement by intent:
+
+- `add more ideas` or `explore new angles` -> return to Phase 2
+- `re-evaluate` or `raise the bar` -> return to Phase 3
+- `dig deeper on idea #N` -> expand only that idea's analysis
+
+After each refinement:
+- update the ideation document before any handoff, sharing, or session end
+- append a session log entry
+
+#### 6.3 Share to Proof
+
+If requested, share the ideation document using the standard Proof markdown upload pattern already used elsewhere in the plugin.
+
+Return to the next-step options after sharing.
+
+#### 6.4 End the Session
+
+When ending:
+- offer to commit only the ideation doc
+- do not create a branch
+- do not push
+- if the user declines, leave the file uncommitted
+
+## Quality Bar
+
+Before finishing, check:
+
+- the idea set is grounded in the actual repo
+- the candidate list was generated before filtering
+- the original many-ideas -> critique -> survivors mechanism was preserved
+- if sub-agents were used, they improved diversity without replacing the core workflow
+- every rejected idea has a reason
+- survivors are materially better than a naive "give me ideas" list
+- the artifact was written before any handoff, sharing, or session end
+- acting on an idea routes to `ce:brainstorm`, not directly to implementation
diff --git a/plugins/compound-engineering/skills/ce-plan/SKILL.md b/plugins/compound-engineering/skills/ce-plan/SKILL.md
index b5d7e1e..5545f18 100644
--- a/plugins/compound-engineering/skills/ce-plan/SKILL.md
+++ b/plugins/compound-engineering/skills/ce-plan/SKILL.md
@@ -1,16 +1,22 @@
---
name: ce:plan
-description: Transform feature descriptions into well-structured project plans following conventions
-argument-hint: "[feature description, bug report, or improvement idea]"
+description: "Transform feature descriptions or requirements into structured implementation plans grounded in repo patterns and research. Use when the user says 'plan this', 'create a plan', 'write a tech plan', 'plan the implementation', 'how should we build', 'what's the approach for', 'break this down', or when a brainstorm/requirements document is ready for technical planning. Best when requirements are at least roughly defined; for exploratory or ambiguous requests, prefer ce:brainstorm first."
+argument-hint: "[feature description, requirements doc path, or improvement idea]"
---
-# Create a plan for a new feature or bug fix
-
-## Introduction
+# Create Technical Plan
**Note: The current year is 2026.** Use this when dating plans and searching for recent documentation.
-Transform feature descriptions, bug reports, or improvement ideas into well-structured markdown files issues that follow project conventions and best practices. This command provides flexible detail levels to match your needs.
+`ce:brainstorm` defines **WHAT** to build. `ce:plan` defines **HOW** to build it. `ce:work` executes the plan.
+
+This workflow produces a durable implementation plan. It does **not** implement code, run tests, or learn from execution-time results. If the answer depends on changing code and seeing what happens, that belongs in `ce:work`, not here.
+
+## Interaction Method
+
+Use the platform's question tool when available. When asking the user a question, prefer the platform's blocking question tool if one exists (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
+
+Ask one question at a time. Prefer a concise single-select choice when natural options exist.
## Feature Description
@@ -18,578 +24,590 @@ Transform feature descriptions, bug reports, or improvement ideas into well-stru
**If the feature description above is empty, ask the user:** "What would you like to plan? Please describe the feature, bug fix, or improvement you have in mind."
-Do not proceed until you have a clear feature description from the user.
+Do not proceed until you have a clear planning input.
-### 0. Idea Refinement
+## Core Principles
-**Check for brainstorm output first:**
+1. **Use requirements as the source of truth** - If `ce:brainstorm` produced a requirements document, planning should build from it rather than re-inventing behavior.
+2. **Decisions, not code** - Capture approach, boundaries, files, dependencies, risks, and test scenarios. Do not pre-write implementation code or shell command choreography. Pseudo-code sketches or DSL grammars that communicate high-level technical design are welcome when they help a reviewer validate direction — but they must be explicitly framed as directional guidance, not implementation specification.
+3. **Research before structuring** - Explore the codebase, institutional learnings, and external guidance when warranted before finalizing the plan.
+4. **Right-size the artifact** - Small work gets a compact plan. Large work gets more structure. The philosophy stays the same at every depth.
+5. **Separate planning from execution discovery** - Resolve planning-time questions here. Explicitly defer execution-time unknowns to implementation.
+6. **Keep the plan portable** - The plan should work as a living document, review artifact, or issue body without embedding tool-specific executor instructions.
+7. **Carry execution posture lightly when it matters** - If the request, origin document, or repo context clearly implies test-first, characterization-first, or another non-default execution posture, reflect that in the plan as a lightweight signal. Do not turn the plan into step-by-step execution choreography.
-Before asking questions, look for recent brainstorm documents in `docs/brainstorms/` that match this feature:
+## Plan Quality Bar
-```bash
-ls -la docs/brainstorms/*.md 2>/dev/null | head -10
-```
+Every plan should contain:
+- A clear problem frame and scope boundary
+- Concrete requirements traceability back to the request or origin document
+- Exact file paths for the work being proposed
+- Explicit test file paths for feature-bearing implementation units
+- Decisions with rationale, not just tasks
+- Existing patterns or code references to follow
+- Specific test scenarios and verification outcomes
+- Clear dependencies and sequencing
-**Relevance criteria:** A brainstorm is relevant if:
-- The topic (from filename or YAML frontmatter) semantically matches the feature description
-- Created within the last 14 days
-- If multiple candidates match, use the most recent one
+A plan is ready when an implementer can start confidently without needing the plan to write the code for them.
-**If a relevant brainstorm exists:**
-1. Read the brainstorm document **thoroughly** — every section matters
-2. Announce: "Found brainstorm from [date]: [topic]. Using as foundation for planning."
-3. Extract and carry forward **ALL** of the following into the plan:
- - Key decisions and their rationale
- - Chosen approach and why alternatives were rejected
- - Constraints and requirements discovered during brainstorming
- - Open questions (flag these for resolution during planning)
- - Success criteria and scope boundaries
- - Any specific technical choices or patterns discussed
-4. **Skip the idea refinement questions below** — the brainstorm already answered WHAT to build
-5. Use brainstorm content as the **primary input** to research and planning phases
-6. **Critical: The brainstorm is the origin document.** Throughout the plan, reference specific decisions with `(see brainstorm: docs/brainstorms/)` when carrying forward conclusions. Do not paraphrase decisions in a way that loses their original context — link back to the source.
-7. **Do not omit brainstorm content** — if the brainstorm discussed it, the plan must address it (even if briefly). Scan each brainstorm section before finalizing the plan to verify nothing was dropped.
+## Workflow
-**If multiple brainstorms could match:**
-Use **AskUserQuestion tool** to ask which brainstorm to use, or whether to proceed without one.
+### Phase 0: Resume, Source, and Scope
-**If no brainstorm found (or not relevant), run idea refinement:**
+#### 0.1 Resume Existing Plan Work When Appropriate
-Refine the idea through collaborative dialogue using the **AskUserQuestion tool**:
+If the user references an existing plan file or there is an obvious recent matching plan in `docs/plans/`:
+- Read it
+- Confirm whether to update it in place or create a new plan
+- If updating, preserve completed checkboxes and revise only the still-relevant sections
-- Ask questions one at a time to understand the idea fully
-- Prefer multiple choice questions when natural options exist
-- Focus on understanding: purpose, constraints and success criteria
-- Continue until the idea is clear OR user says "proceed"
+#### 0.2 Find Upstream Requirements Document
-**Gather signals for research decision.** During refinement, note:
+Before asking planning questions, search `docs/brainstorms/` for files matching `*-requirements.md`.
-- **User's familiarity**: Do they know the codebase patterns? Are they pointing to examples?
-- **User's intent**: Speed vs thoroughness? Exploration vs execution?
-- **Topic risk**: Security, payments, external APIs warrant more caution
-- **Uncertainty level**: Is the approach clear or open-ended?
+**Relevance criteria:** A requirements document is relevant if:
+- The topic semantically matches the feature description
+- It was created within the last 30 days (use judgment to override if the document is clearly still relevant or clearly stale)
+- It appears to cover the same user problem or scope
-**Skip option:** If the feature description is already detailed, offer:
-"Your description is clear. Should I proceed with research, or would you like to refine it further?"
+If multiple source documents match, ask which one to use using the platform's blocking question tool when available (see Interaction Method). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
-## Main Tasks
+#### 0.3 Use the Source Document as Primary Input
-### 1. Local Research (Always Runs - Parallel)
+If a relevant requirements document exists:
+1. Read it thoroughly
+2. Announce that it will serve as the origin document for planning
+3. Carry forward all of the following:
+ - Problem frame
+ - Requirements and success criteria
+ - Scope boundaries
+ - Key decisions and rationale
+ - Dependencies or assumptions
+ - Outstanding questions, preserving whether they are blocking or deferred
+4. Use the source document as the primary input to planning and research
+5. Reference important carried-forward decisions in the plan with `(see origin: )`
+6. Do not silently omit source content — if the origin document discussed it, the plan must address it even if briefly. Before finalizing, scan each section of the origin document to verify nothing was dropped.
-
-First, I need to understand the project's conventions, existing patterns, and any documented learnings. This is fast and local - it informs whether external research is needed.
-
+If no relevant requirements document exists, planning may proceed from the user's request directly.
-Run these agents **in parallel** to gather local context:
+#### 0.4 No-Requirements-Doc Fallback
-- Task compound-engineering:research:repo-research-analyst(feature_description)
-- Task compound-engineering:research:learnings-researcher(feature_description)
+If no relevant requirements document exists:
+- Assess whether the request is already clear enough for direct technical planning
+- If the ambiguity is mainly product framing, user behavior, or scope definition, recommend `ce:brainstorm` first
+- If the user wants to continue here anyway, run a short planning bootstrap instead of refusing
-**What to look for:**
-- **Repo research:** existing patterns, CLAUDE.md guidance, technology familiarity, pattern consistency
-- **Learnings:** documented solutions in `docs/solutions/` that might apply (gotchas, patterns, lessons learned)
+The planning bootstrap should establish:
+- Problem frame
+- Intended behavior
+- Scope boundaries and obvious non-goals
+- Success criteria
+- Blocking questions or assumptions
-These findings inform the next step.
+Keep this bootstrap brief. It exists to preserve direct-entry convenience, not to replace a full brainstorm.
-### 1.5. Research Decision
+If the bootstrap uncovers major unresolved product questions:
+- Recommend `ce:brainstorm` again
+- If the user still wants to continue, require explicit assumptions before proceeding
-Based on signals from Step 0 and findings from Step 1, decide on external research.
+#### 0.5 Classify Outstanding Questions Before Planning
-**High-risk topics → always research.** Security, payments, external APIs, data privacy. The cost of missing something is too high. This takes precedence over speed signals.
+If the origin document contains `Resolve Before Planning` or similar blocking questions:
+- Review each one before proceeding
+- Reclassify it into planning-owned work **only if** it is actually a technical, architectural, or research question
+- Keep it as a blocker if it would change product behavior, scope, or success criteria
-**Strong local context → skip external research.** Codebase has good patterns, CLAUDE.md has guidance, user knows what they want. External research adds little value.
+If true product blockers remain:
+- Surface them clearly
+- Ask the user, using the platform's blocking question tool when available (see Interaction Method), whether to:
+ 1. Resume `ce:brainstorm` to resolve them
+ 2. Convert them into explicit assumptions or decisions and continue
+- Do not continue planning while true blockers remain unresolved
-**Uncertainty or unfamiliar territory → research.** User is exploring, codebase has no examples, new technology. External perspective is valuable.
+#### 0.6 Assess Plan Depth
-**Announce the decision and proceed.** Brief explanation, then continue. User can redirect if needed.
+Classify the work into one of these plan depths:
-Examples:
-- "Your codebase has solid patterns for this. Proceeding without external research."
-- "This involves payment processing, so I'll research current best practices first."
+- **Lightweight** - small, well-bounded, low ambiguity
+- **Standard** - normal feature or bounded refactor with some technical decisions to document
+- **Deep** - cross-cutting, strategic, high-risk, or highly ambiguous implementation work
-### 1.5b. External Research (Conditional)
+If depth is unclear, ask one targeted question and then continue.
-**Only run if Step 1.5 indicates external research is valuable.**
+### Phase 1: Gather Context
+
+#### 1.1 Local Research (Always Runs)
+
+Prepare a concise planning context summary (a paragraph or two) to pass as input to the research agents:
+- If an origin document exists, summarize the problem frame, requirements, and key decisions from that document
+- Otherwise use the feature description directly
Run these agents in parallel:
-- Task compound-engineering:research:best-practices-researcher(feature_description)
-- Task compound-engineering:research:framework-docs-researcher(feature_description)
+- Task compound-engineering:research:repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary})
+- Task compound-engineering:research:learnings-researcher(planning context summary)
-### 1.6. Consolidate Research
+Collect:
+- Technology stack and versions (used in section 1.2 to make sharper external research decisions)
+- Architectural patterns and conventions to follow
+- Implementation patterns, relevant files, modules, and tests
+- AGENTS.md guidance that materially affects the plan, with CLAUDE.md used only as compatibility fallback when present
+- Institutional learnings from `docs/solutions/`
-After all research steps complete, consolidate findings:
+#### 1.1b Detect Execution Posture Signals
-- Document relevant file paths from repo research (e.g., `app/services/example_service.rb:42`)
-- **Include relevant institutional learnings** from `docs/solutions/` (key insights, gotchas to avoid)
-- Note external documentation URLs and best practices (if external research was done)
-- List related issues or PRs discovered
-- Capture CLAUDE.md conventions
+Decide whether the plan should carry a lightweight execution posture signal.
-**Optional validation:** Briefly summarize findings and ask if anything looks off or missing before proceeding to planning.
+Look for signals such as:
+- The user explicitly asks for TDD, test-first, or characterization-first work
+- The origin document calls for test-first implementation or exploratory hardening of legacy code
+- Local research shows the target area is legacy, weakly tested, or historically fragile, suggesting characterization coverage before changing behavior
+- The user asks for external delegation, says "use codex", "delegate mode", or mentions token conservation -- add `Execution target: external-delegate` to implementation units that are pure code writing
-### 2. Issue Planning & Structure
+When the signal is clear, carry it forward silently in the relevant implementation units.
-
-Think like a product manager - what would make this issue clear and actionable? Consider multiple perspectives
-
+Ask the user only if the posture would materially change sequencing or risk and cannot be responsibly inferred.
-**Title & Categorization:**
+#### 1.2 Decide on External Research
-- [ ] Draft clear, searchable issue title using conventional format (e.g., `feat: Add user authentication`, `fix: Cart total calculation`)
-- [ ] Determine issue type: enhancement, bug, refactor
-- [ ] Convert title to filename: add today's date prefix, determine daily sequence number, strip prefix colon, kebab-case, add `-plan` suffix
- - Scan `docs/plans/` for files matching today's date pattern `YYYY-MM-DD-\d{3}-`
- - Find the highest existing sequence number for today
- - Increment by 1, zero-padded to 3 digits (001, 002, etc.)
- - Example: `feat: Add User Authentication` → `2026-01-21-001-feat-add-user-authentication-plan.md`
- - Keep it descriptive (3-5 words after prefix) so plans are findable by context
+Based on the origin document, user signals, and local findings, decide whether external research adds value.
-**Stakeholder Analysis:**
+**Read between the lines.** Pay attention to signals from the conversation so far:
+- **User familiarity** — Are they pointing to specific files or patterns? They likely know the codebase well.
+- **User intent** — Do they want speed or thoroughness? Exploration or execution?
+- **Topic risk** — Security, payments, external APIs warrant more caution regardless of user signals.
+- **Uncertainty level** — Is the approach clear or still open-ended?
-- [ ] Identify who will be affected by this issue (end users, developers, operations)
-- [ ] Consider implementation complexity and required expertise
+**Leverage repo-research-analyst's technology context:**
-**Content Planning:**
+The repo-research-analyst output includes a structured Technology & Infrastructure summary. Use it to make sharper external research decisions:
-- [ ] Choose appropriate detail level based on issue complexity and audience
-- [ ] List all necessary sections for the chosen template
-- [ ] Gather supporting materials (error logs, screenshots, design mockups)
-- [ ] Prepare code examples or reproduction steps if applicable, name the mock filenames in the lists
+- If specific frameworks and versions were detected (e.g., Rails 7.2, Next.js 14, Go 1.22), pass those exact identifiers to framework-docs-researcher so it fetches version-specific documentation
+- If the feature touches a technology layer the scan found well-established in the repo (e.g., existing Sidekiq jobs when planning a new background job), lean toward skipping external research -- local patterns are likely sufficient
+- If the feature touches a technology layer the scan found absent or thin (e.g., no existing proto files when planning a new gRPC service), lean toward external research -- there are no local patterns to follow
+- If the scan detected deployment infrastructure (Docker, K8s, serverless), note it in the planning context passed to downstream agents so they can account for deployment constraints
+- If the scan detected a monorepo and scoped to a specific service, pass that service's tech context to downstream research agents -- not the aggregate of all services. If the scan surfaced the workspace map without scoping, use the feature description to identify the relevant service before proceeding with research
-### 3. SpecFlow Analysis
+**Always lean toward external research when:**
+- The topic is high-risk: security, payments, privacy, external APIs, migrations, compliance
+- The codebase lacks relevant local patterns
+- The user is exploring unfamiliar territory
+- The technology scan found the relevant layer absent or thin in the codebase
-After planning the issue structure, run SpecFlow Analyzer to validate and refine the feature specification:
+**Skip external research when:**
+- The codebase already shows a strong local pattern
+- The user already knows the intended shape
+- Additional external context would add little practical value
+- The technology scan found the relevant layer well-established with existing examples to follow
-- Task compound-engineering:workflow:spec-flow-analyzer(feature_description, research_findings)
+Announce the decision briefly before continuing. Examples:
+- "Your codebase has solid patterns for this. Proceeding without external research."
+- "This involves payment processing, so I'll research current best practices first."
-**SpecFlow Analyzer Output:**
+#### 1.3 External Research (Conditional)
-- [ ] Review SpecFlow analysis results
-- [ ] Incorporate any identified gaps or edge cases into the issue
-- [ ] Update acceptance criteria based on SpecFlow findings
+If Step 1.2 indicates external research is useful, run these agents in parallel:
-### 4. Choose Implementation Detail Level
+- Task compound-engineering:research:best-practices-researcher(planning context summary)
+- Task compound-engineering:research:framework-docs-researcher(planning context summary)
-Select how comprehensive you want the issue to be, simpler is mostly better.
+#### 1.4 Consolidate Research
-#### 📄 MINIMAL (Quick Issue)
+Summarize:
+- Relevant codebase patterns and file paths
+- Relevant institutional learnings
+- External references and best practices, if gathered
+- Related issues, PRs, or prior art
+- Any constraints that should materially shape the plan
-**Best for:** Simple bugs, small improvements, clear features
+#### 1.5 Flow and Edge-Case Analysis (Conditional)
-**Includes:**
+For **Standard** or **Deep** plans, or when user flow completeness is still unclear, run:
-- Problem statement or feature description
-- Basic acceptance criteria
-- Essential context only
+- Task compound-engineering:workflow:spec-flow-analyzer(planning context summary, research findings)
-**Structure:**
+Use the output to:
+- Identify missing edge cases, state transitions, or handoff gaps
+- Tighten requirements trace or verification strategy
+- Add only the flow details that materially improve the plan
-````markdown
----
-title: [Issue Title]
-type: [feat|fix|refactor]
-status: active
-date: YYYY-MM-DD
-origin: docs/brainstorms/YYYY-MM-DD--brainstorm.md # if originated from brainstorm, otherwise omit
----
+### Phase 2: Resolve Planning Questions
-# [Issue Title]
+Build a planning question list from:
+- Deferred questions in the origin document
+- Gaps discovered in repo or external research
+- Technical decisions required to produce a useful plan
-[Brief problem/feature description]
+For each question, decide whether it should be:
+- **Resolved during planning** - the answer is knowable from repo context, documentation, or user choice
+- **Deferred to implementation** - the answer depends on code changes, runtime behavior, or execution-time discovery
-## Acceptance Criteria
+Ask the user only when the answer materially affects architecture, scope, sequencing, or risk and cannot be responsibly inferred. Use the platform's blocking question tool when available (see Interaction Method).
-- [ ] Core requirement 1
-- [ ] Core requirement 2
+**Do not** run tests, build the app, or probe runtime behavior in this phase. The goal is a strong plan, not partial execution.
-## Context
+### Phase 3: Structure the Plan
-[Any critical information]
+#### 3.1 Title and File Naming
-## MVP
+- Draft a clear, searchable title using conventional format such as `feat: Add user authentication` or `fix: Prevent checkout double-submit`
+- Determine the plan type: `feat`, `fix`, or `refactor`
+- Build the filename following the repository convention: `docs/plans/YYYY-MM-DD-NNN---plan.md`
+ - Create `docs/plans/` if it does not exist
+ - Check existing files for today's date to determine the next sequence number (zero-padded to 3 digits, starting at 001)
+ - Keep the descriptive name concise (3-5 words) and kebab-cased
+ - Examples: `2026-01-15-001-feat-user-authentication-flow-plan.md`, `2026-02-03-002-fix-checkout-race-condition-plan.md`
+ - Avoid: missing sequence numbers, vague names like "new-feature", invalid characters (colons, spaces)
-### test.rb
+#### 3.2 Stakeholder and Impact Awareness
-```ruby
-class Test
- def initialize
- @name = "test"
- end
-end
-```
+For **Standard** or **Deep** plans, briefly consider who is affected by this change — end users, developers, operations, other teams — and how that should shape the plan. For cross-cutting work, note affected parties in the System-Wide Impact section.
-## Sources
+#### 3.3 Break Work into Implementation Units
-- **Origin brainstorm:** [docs/brainstorms/YYYY-MM-DD--brainstorm.md](path) — include if plan originated from a brainstorm
-- Related issue: #[issue_number]
-- Documentation: [relevant_docs_url]
-````
+Break the work into logical implementation units. Each unit should represent one meaningful change that an implementer could typically land as an atomic commit.
-#### 📋 MORE (Standard Issue)
+Good units are:
+- Focused on one component, behavior, or integration seam
+- Usually touching a small cluster of related files
+- Ordered by dependency
+- Concrete enough for execution without pre-writing code
+- Marked with checkbox syntax for progress tracking
-**Best for:** Most features, complex bugs, team collaboration
+Avoid:
+- 2-5 minute micro-steps
+- Units that span multiple unrelated concerns
+- Units that are so vague an implementer still has to invent the plan
-**Includes everything from MINIMAL plus:**
+#### 3.4 High-Level Technical Design (Optional)
-- Detailed background and motivation
-- Technical considerations
-- Success metrics
-- Dependencies and risks
-- Basic implementation suggestions
+Before detailing implementation units, decide whether an overview would help a reviewer validate the intended approach. This section communicates the *shape* of the solution — how pieces fit together — without dictating implementation.
-**Structure:**
+**When to include it:**
+
+| Work involves... | Best overview form |
+|---|---|
+| DSL or API surface design | Pseudo-code grammar or contract sketch |
+| Multi-component integration | Mermaid sequence or component diagram |
+| Data pipeline or transformation | Data flow sketch |
+| State-heavy lifecycle | State diagram |
+| Complex branching logic | Flowchart |
+| Single-component with non-obvious shape | Pseudo-code sketch |
+
+**When to skip it:**
+- Well-patterned work where prose and file paths tell the whole story
+- Straightforward CRUD or convention-following changes
+- Lightweight plans where the approach is obvious
+
+Choose the medium that fits the work. Do not default to pseudo-code when a diagram communicates better, and vice versa.
+
+Frame every sketch with: *"This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce."*
+
+Keep sketches concise — enough to validate direction, not enough to copy-paste into production.
+
+#### 3.5 Define Each Implementation Unit
+
+For each unit, include:
+- **Goal** - what this unit accomplishes
+- **Requirements** - which requirements or success criteria it advances
+- **Dependencies** - what must exist first
+- **Files** - exact file paths to create, modify, or test
+- **Approach** - key decisions, data flow, component boundaries, or integration notes
+- **Execution note** - optional, only when the unit benefits from a non-default execution posture such as test-first, characterization-first, or external delegation
+- **Technical design** - optional pseudo-code or diagram when the unit's approach is non-obvious and prose alone would leave it ambiguous. Frame explicitly as directional guidance, not implementation specification
+- **Patterns to follow** - existing code or conventions to mirror
+- **Test scenarios** - specific behaviors, edge cases, and failure paths to cover
+- **Verification** - how an implementer should know the unit is complete, expressed as outcomes rather than shell command scripts
+
+Every feature-bearing unit should include the test file path in `**Files:**`.
+
+Use `Execution note` sparingly. Good uses include:
+- `Execution note: Start with a failing integration test for the request/response contract.`
+- `Execution note: Add characterization coverage before modifying this legacy parser.`
+- `Execution note: Implement new domain behavior test-first.`
+- `Execution note: Execution target: external-delegate`
+
+Do not expand units into literal `RED/GREEN/REFACTOR` substeps.
+
+#### 3.6 Keep Planning-Time and Implementation-Time Unknowns Separate
+
+If something is important but not knowable yet, record it explicitly under deferred implementation notes rather than pretending to resolve it in the plan.
+
+Examples:
+- Exact method or helper names
+- Final SQL or query details after touching real code
+- Runtime behavior that depends on seeing actual test failures
+- Refactors that may become unnecessary once implementation starts
+
+### Phase 4: Write the Plan
+
+Use one planning philosophy across all depths. Change the amount of detail, not the boundary between planning and execution.
+
+#### 4.1 Plan Depth Guidance
+
+**Lightweight**
+- Keep the plan compact
+- Usually 2-4 implementation units
+- Omit optional sections that add little value
+
+**Standard**
+- Use the full core template, omitting optional sections (including High-Level Technical Design) that add no value for this particular work
+- Usually 3-6 implementation units
+- Include risks, deferred questions, and system-wide impact when relevant
+
+**Deep**
+- Use the full core template plus optional analysis sections where warranted
+- Usually 4-8 implementation units
+- Group units into phases when that improves clarity
+- Include alternatives considered, documentation impacts, and deeper risk treatment when warranted
+
+#### 4.1b Optional Deep Plan Extensions
+
+For sufficiently large, risky, or cross-cutting work, add the sections that genuinely help:
+- **Alternative Approaches Considered**
+- **Success Metrics**
+- **Dependencies / Prerequisites**
+- **Risk Analysis & Mitigation**
+- **Phased Delivery**
+- **Documentation Plan**
+- **Operational / Rollout Notes**
+- **Future Considerations** only when they materially affect current design
+
+Do not add these as boilerplate. Include them only when they improve execution quality or stakeholder alignment.
+
+#### 4.2 Core Plan Template
+
+Omit clearly inapplicable optional sections, especially for Lightweight plans.
```markdown
---
-title: [Issue Title]
+title: [Plan Title]
type: [feat|fix|refactor]
status: active
date: YYYY-MM-DD
-origin: docs/brainstorms/YYYY-MM-DD--brainstorm.md # if originated from brainstorm, otherwise omit
+origin: docs/brainstorms/YYYY-MM-DD--requirements.md # include when planning from a requirements doc
+deepened: YYYY-MM-DD # optional, set later by deepen-plan when the plan is substantively strengthened
---
-# [Issue Title]
+# [Plan Title]
## Overview
-[Comprehensive description]
+[What is changing and why]
-## Problem Statement / Motivation
+## Problem Frame
-[Why this matters]
+[Summarize the user/business problem and context. Reference the origin doc when present.]
-## Proposed Solution
+## Requirements Trace
-[High-level approach]
+- R1. [Requirement or success criterion this plan must satisfy]
+- R2. [Requirement or success criterion this plan must satisfy]
-## Technical Considerations
+## Scope Boundaries
-- Architecture impacts
-- Performance implications
-- Security considerations
+- [Explicit non-goal or exclusion]
-## System-Wide Impact
+## Context & Research
-- **Interaction graph**: [What callbacks/middleware/observers fire when this runs?]
-- **Error propagation**: [How do errors flow across layers? Do retry strategies align?]
-- **State lifecycle risks**: [Can partial failure leave orphaned/inconsistent state?]
-- **API surface parity**: [What other interfaces expose similar functionality and need the same change?]
-- **Integration test scenarios**: [Cross-layer scenarios that unit tests won't catch]
+### Relevant Code and Patterns
-## Acceptance Criteria
+- [Existing file, class, component, or pattern to follow]
-- [ ] Detailed requirement 1
-- [ ] Detailed requirement 2
-- [ ] Testing requirements
+### Institutional Learnings
-## Success Metrics
-
-[How we measure success]
-
-## Dependencies & Risks
-
-[What could block or complicate this]
-
-## Sources & References
-
-- **Origin brainstorm:** [docs/brainstorms/YYYY-MM-DD--brainstorm.md](path) — include if plan originated from a brainstorm
-- Similar implementations: [file_path:line_number]
-- Best practices: [documentation_url]
-- Related PRs: #[pr_number]
-```
-
-#### 📚 A LOT (Comprehensive Issue)
-
-**Best for:** Major features, architectural changes, complex integrations
-
-**Includes everything from MORE plus:**
-
-- Detailed implementation plan with phases
-- Alternative approaches considered
-- Extensive technical specifications
-- Resource requirements and timeline
-- Future considerations and extensibility
-- Risk mitigation strategies
-- Documentation requirements
-
-**Structure:**
-
-```markdown
----
-title: [Issue Title]
-type: [feat|fix|refactor]
-status: active
-date: YYYY-MM-DD
-origin: docs/brainstorms/YYYY-MM-DD--brainstorm.md # if originated from brainstorm, otherwise omit
----
-
-# [Issue Title]
-
-## Overview
-
-[Executive summary]
-
-## Problem Statement
-
-[Detailed problem analysis]
-
-## Proposed Solution
-
-[Comprehensive solution design]
-
-## Technical Approach
-
-### Architecture
-
-[Detailed technical design]
-
-### Implementation Phases
-
-#### Phase 1: [Foundation]
-
-- Tasks and deliverables
-- Success criteria
-- Estimated effort
-
-#### Phase 2: [Core Implementation]
-
-- Tasks and deliverables
-- Success criteria
-- Estimated effort
-
-#### Phase 3: [Polish & Optimization]
-
-- Tasks and deliverables
-- Success criteria
-- Estimated effort
-
-## Alternative Approaches Considered
-
-[Other solutions evaluated and why rejected]
-
-## System-Wide Impact
-
-### Interaction Graph
-
-[Map the chain reaction: what callbacks, middleware, observers, and event handlers fire when this code runs? Trace at least two levels deep. Document: "Action X triggers Y, which calls Z, which persists W."]
-
-### Error & Failure Propagation
-
-[Trace errors from lowest layer up. List specific error classes and where they're handled. Identify retry conflicts, unhandled error types, and silent failure swallowing.]
-
-### State Lifecycle Risks
-
-[Walk through each step that persists state. Can partial failure orphan rows, duplicate records, or leave caches stale? Document cleanup mechanisms or their absence.]
-
-### API Surface Parity
-
-[List all interfaces (classes, DSLs, endpoints) that expose equivalent functionality. Note which need updating and which share the code path.]
-
-### Integration Test Scenarios
-
-[3-5 cross-layer test scenarios that unit tests with mocks would never catch. Include expected behavior for each.]
-
-## Acceptance Criteria
-
-### Functional Requirements
-
-- [ ] Detailed functional criteria
-
-### Non-Functional Requirements
-
-- [ ] Performance targets
-- [ ] Security requirements
-- [ ] Accessibility standards
-
-### Quality Gates
-
-- [ ] Test coverage requirements
-- [ ] Documentation completeness
-- [ ] Code review approval
-
-## Success Metrics
-
-[Detailed KPIs and measurement methods]
-
-## Dependencies & Prerequisites
-
-[Detailed dependency analysis]
-
-## Risk Analysis & Mitigation
-
-[Comprehensive risk assessment]
-
-## Resource Requirements
-
-[Team, time, infrastructure needs]
-
-## Future Considerations
-
-[Extensibility and long-term vision]
-
-## Documentation Plan
-
-[What docs need updating]
-
-## Sources & References
-
-### Origin
-
-- **Brainstorm document:** [docs/brainstorms/YYYY-MM-DD--brainstorm.md](path) — include if plan originated from a brainstorm. Key decisions carried forward: [list 2-3 major decisions from brainstorm]
-
-### Internal References
-
-- Architecture decisions: [file_path:line_number]
-- Similar features: [file_path:line_number]
-- Configuration: [file_path:line_number]
+- [Relevant `docs/solutions/` insight]
### External References
-- Framework documentation: [url]
-- Best practices guide: [url]
-- Industry standards: [url]
+- [Relevant external docs or best-practice source, if used]
-### Related Work
+## Key Technical Decisions
-- Previous PRs: #[pr_numbers]
-- Related issues: #[issue_numbers]
-- Design documents: [links]
+- [Decision]: [Rationale]
+
+## Open Questions
+
+### Resolved During Planning
+
+- [Question]: [Resolution]
+
+### Deferred to Implementation
+
+- [Question or unknown]: [Why it is intentionally deferred]
+
+
+## High-Level Technical Design
+
+> *This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.*
+
+[Pseudo-code grammar, mermaid diagram, data flow sketch, or state diagram — choose the medium that best communicates the solution shape for this work.]
+
+## Implementation Units
+
+- [ ] **Unit 1: [Name]**
+
+**Goal:** [What this unit accomplishes]
+
+**Requirements:** [R1, R2]
+
+**Dependencies:** [None / Unit 1 / external prerequisite]
+
+**Files:**
+- Create: `path/to/new_file`
+- Modify: `path/to/existing_file`
+- Test: `path/to/test_file`
+
+**Approach:**
+- [Key design or sequencing decision]
+
+**Execution note:** [Optional test-first, characterization-first, external-delegate, or other execution posture signal]
+
+**Technical design:** *(optional -- pseudo-code or diagram when the unit's approach is non-obvious. Directional guidance, not implementation specification.)*
+
+**Patterns to follow:**
+- [Existing file, class, or pattern]
+
+**Test scenarios:**
+- [Specific scenario with expected behavior]
+- [Edge case or failure path]
+
+**Verification:**
+- [Outcome that should hold when this unit is complete]
+
+## System-Wide Impact
+
+- **Interaction graph:** [What callbacks, middleware, observers, or entry points may be affected]
+- **Error propagation:** [How failures should travel across layers]
+- **State lifecycle risks:** [Partial-write, cache, duplicate, or cleanup concerns]
+- **API surface parity:** [Other interfaces that may require the same change]
+- **Integration coverage:** [Cross-layer scenarios unit tests alone will not prove]
+
+## Risks & Dependencies
+
+- [Meaningful risk, dependency, or sequencing concern]
+
+## Documentation / Operational Notes
+
+- [Docs, rollout, monitoring, or support impacts when relevant]
+
+## Sources & References
+
+- **Origin document:** [docs/brainstorms/YYYY-MM-DD--requirements.md](path)
+- Related code: [path or symbol]
+- Related PRs/issues: #[number]
+- External docs: [url]
```
-### 5. Issue Creation & Formatting
+For larger `Deep` plans, extend the core template only when useful with sections such as:
-
-Apply best practices for clarity and actionability, making the issue easy to scan and understand
-
+```markdown
+## Alternative Approaches Considered
-**Content Formatting:**
+- [Approach]: [Why rejected or not chosen]
-- [ ] Use clear, descriptive headings with proper hierarchy (##, ###)
-- [ ] Include code examples in triple backticks with language syntax highlighting
-- [ ] Add screenshots/mockups if UI-related (drag & drop or use image hosting)
-- [ ] Use task lists (- [ ]) for trackable items that can be checked off
-- [ ] Add collapsible sections for lengthy logs or optional details using `` tags
-- [ ] Apply appropriate emoji for visual scanning (🐛 bug, ✨ feature, 📚 docs, ♻️ refactor)
+## Success Metrics
-**Cross-Referencing:**
+- [How we will know this solved the intended problem]
-- [ ] Link to related issues/PRs using #number format
-- [ ] Reference specific commits with SHA hashes when relevant
-- [ ] Link to code using GitHub's permalink feature (press 'y' for permanent link)
-- [ ] Mention relevant team members with @username if needed
-- [ ] Add links to external resources with descriptive text
+## Dependencies / Prerequisites
-**Code & Examples:**
+- [Technical, organizational, or rollout dependency]
-````markdown
-# Good example with syntax highlighting and line references
+## Risk Analysis & Mitigation
+- [Risk]: [Mitigation]
-```ruby
-# app/services/user_service.rb:42
-def process_user(user)
+## Phased Delivery
-# Implementation here
+### Phase 1
+- [What lands first and why]
-end
+### Phase 2
+- [What follows and why]
+
+## Documentation Plan
+
+- [Docs or runbooks to update]
+
+## Operational / Rollout Notes
+
+- [Monitoring, migration, feature flag, or rollout considerations]
```
-# Collapsible error logs
+#### 4.3 Planning Rules
-
-Full error stacktrace
+- Prefer path plus class/component/pattern references over brittle line numbers
+- Keep implementation units checkable with `- [ ]` syntax for progress tracking
+- Do not include implementation code — no imports, exact method signatures, or framework-specific syntax
+- Pseudo-code sketches and DSL grammars are allowed in the High-Level Technical Design section and per-unit technical design fields when they communicate design direction. Frame them explicitly as directional guidance, not implementation specification
+- Mermaid diagrams are encouraged when they clarify relationships or flows that prose alone would make hard to follow — ERDs for data model changes, sequence diagrams for multi-service interactions, state diagrams for lifecycle transitions, flowcharts for complex branching logic
+- Do not include git commands, commit messages, or exact test command recipes
+- Do not expand implementation units into micro-step `RED/GREEN/REFACTOR` instructions
+- Do not pretend an execution-time question is settled just to make the plan look complete
-`Error details here...`
+### Phase 5: Final Review, Write File, and Handoff
-
-````
+#### 5.1 Review Before Writing
-**AI-Era Considerations:**
+Before finalizing, check:
+- The plan does not invent product behavior that should have been defined in `ce:brainstorm`
+- If there was no origin document, the bounded planning bootstrap established enough product clarity to plan responsibly
+- Every major decision is grounded in the origin document or research
+- Each implementation unit is concrete, dependency-ordered, and implementation-ready
+- If test-first or characterization-first posture was explicit or strongly implied, the relevant units carry it forward with a lightweight `Execution note`
+- Test scenarios are specific without becoming test code
+- Deferred items are explicit and not hidden as fake certainty
+- If a High-Level Technical Design section is included, it uses the right medium for the work, carries the non-prescriptive framing, and does not contain implementation code (no imports, exact signatures, or framework-specific syntax)
+- Per-unit technical design fields, if present, are concise and directional rather than copy-paste-ready
-- [ ] Account for accelerated development with AI pair programming
-- [ ] Include prompts or instructions that worked well during research
-- [ ] Note which AI tools were used for initial exploration (Claude, Copilot, etc.)
-- [ ] Emphasize comprehensive testing given rapid implementation
-- [ ] Document any AI-generated code that needs human review
+If the plan originated from a requirements document, re-read that document and verify:
+- The chosen approach still matches the product intent
+- Scope boundaries and success criteria are preserved
+- Blocking questions were either resolved, explicitly assumed, or sent back to `ce:brainstorm`
+- Every section of the origin document is addressed in the plan — scan each section to confirm nothing was silently dropped
-### 6. Final Review & Submission
-
-**Brainstorm cross-check (if plan originated from a brainstorm):**
-
-Before finalizing, re-read the brainstorm document and verify:
-- [ ] Every key decision from the brainstorm is reflected in the plan
-- [ ] The chosen approach matches what was decided in the brainstorm
-- [ ] Constraints and requirements from the brainstorm are captured in acceptance criteria
-- [ ] Open questions from the brainstorm are either resolved or flagged
-- [ ] The `origin:` frontmatter field points to the brainstorm file
-- [ ] The Sources section includes the brainstorm with a summary of carried-forward decisions
-
-**Pre-submission Checklist:**
-
-- [ ] Title is searchable and descriptive
-- [ ] Labels accurately categorize the issue
-- [ ] All template sections are complete
-- [ ] Links and references are working
-- [ ] Acceptance criteria are measurable
-- [ ] Add names of files in pseudo code examples and todo lists
-- [ ] Add an ERD mermaid diagram if applicable for new model changes
-
-## Write Plan File
+#### 5.2 Write Plan File
**REQUIRED: Write the plan file to disk before presenting any options.**
-```bash
-mkdir -p docs/plans/
-# Determine daily sequence number
-today=$(date +%Y-%m-%d)
-last_seq=$(ls docs/plans/${today}-*-plan.md 2>/dev/null | grep -oP "${today}-\K\d{3}" | sort -n | tail -1)
-next_seq=$(printf "%03d" $(( ${last_seq:-0} + 1 )))
-```
+Use the Write tool to save the complete plan to:
-Use the Write tool to save the complete plan to `docs/plans/YYYY-MM-DD-NNN---plan.md` (where NNN is `$next_seq` from the bash command above). This step is mandatory and cannot be skipped — even when running as part of LFG/SLFG or other automated pipelines.
-
-Confirm: "Plan written to docs/plans/[filename]"
-
-**Pipeline mode:** If invoked from an automated workflow (LFG, SLFG, or any `disable-model-invocation` context), skip all AskUserQuestion calls. Make decisions automatically and proceed to writing the plan without interactive prompts.
-
-## Output Format
-
-**Filename:** Use the date, daily sequence number, and kebab-case filename from Step 2 Title & Categorization.
-
-```
+```text
docs/plans/YYYY-MM-DD-NNN---plan.md
```
-Examples:
-- ✅ `docs/plans/2026-01-15-001-feat-user-authentication-flow-plan.md`
-- ✅ `docs/plans/2026-02-03-001-fix-checkout-race-condition-plan.md`
-- ✅ `docs/plans/2026-03-10-002-refactor-api-client-extraction-plan.md`
-- ❌ `docs/plans/2026-01-15-feat-thing-plan.md` (missing sequence number, not descriptive)
-- ❌ `docs/plans/2026-01-15-001-feat-new-feature-plan.md` (too vague - what feature?)
-- ❌ `docs/plans/2026-01-15-001-feat: user auth-plan.md` (invalid characters - colon and space)
-- ❌ `docs/plans/feat-user-auth-plan.md` (missing date prefix and sequence number)
+Confirm:
-## Post-Generation Options
+```text
+Plan written to docs/plans/[filename]
+```
-After writing the plan file, use the **AskUserQuestion tool** to present these options:
+**Pipeline mode:** If invoked from an automated workflow such as LFG, SLFG, or any `disable-model-invocation` context, skip interactive questions. Make the needed choices automatically and proceed to writing the plan.
+
+#### 5.3 Post-Generation Options
+
+After writing the plan file, present the options using the platform's blocking question tool when available (see Interaction Method). Otherwise present numbered options in chat and wait for the user's reply before proceeding.
**Question:** "Plan ready at `docs/plans/YYYY-MM-DD-NNN---plan.md`. What would you like to do next?"
**Options:**
1. **Open plan in editor** - Open the plan file for review
-2. **Run `/deepen-plan`** - Enhance each section with parallel research agents (best practices, performance, UI)
-3. **Review and refine** - Improve the document through structured self-review
-4. **Share to Proof** - Upload to Proof for collaborative review and sharing
-5. **Start `/ce:work`** - Begin implementing this plan locally
-6. **Start `/ce:work` on remote** - Begin implementing in Claude Code on the web (use `&` to run in background)
-7. **Create Issue** - Create issue in project tracker (GitHub/Linear)
+2. **Run `/deepen-plan`** - Stress-test weak sections with targeted research when the plan needs more confidence
+3. **Run `document-review` skill** - Improve the plan through structured document review
+4. **Share to Proof** - Upload the plan for collaborative review and sharing
+5. **Start `/ce:work`** - Begin implementing this plan in the current environment
+6. **Start `/ce:work` in another session** - Begin implementing in a separate agent session when the current platform supports it
+7. **Create Issue** - Create an issue in the configured tracker
Based on selection:
-- **Open plan in editor** → Run `open docs/plans/.md` to open the file in the user's default editor
-- **`/deepen-plan`** → Call the /deepen-plan command with the plan file path to enhance with research
-- **Review and refine** → Load `document-review` skill.
-- **Share to Proof** → Upload the plan to Proof:
+- **Open plan in editor** → Open `docs/plans/.md` using the current platform's file-open or editor mechanism (e.g., `open` on macOS, `xdg-open` on Linux, or the IDE's file-open API)
+- **`/deepen-plan`** → Call `/deepen-plan` with the plan path
+- **`document-review` skill** → Load the `document-review` skill with the plan path
+- **Share to Proof** → Upload the plan:
```bash
CONTENT=$(cat docs/plans/.md)
TITLE="Plan: "
@@ -598,44 +616,37 @@ Based on selection:
-d "$(jq -n --arg title "$TITLE" --arg markdown "$CONTENT" --arg by "ai:compound" '{title: $title, markdown: $markdown, by: $by}')")
PROOF_URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
```
- Display: `View & collaborate in Proof: ` — skip silently if curl fails. Then return to options.
-- **`/ce:work`** → Call the /ce:work command with the plan file path
-- **`/ce:work` on remote** → Run `/ce:work docs/plans/.md &` to start work in background for Claude Code web
-- **Create Issue** → See "Issue Creation" section below
-- **Other** (automatically provided) → Accept free text for rework or specific changes
+ Display `View & collaborate in Proof: ` if successful, then return to the options
+- **`/ce:work`** → Call `/ce:work` with the plan path
+- **`/ce:work` in another session** → If the current platform supports launching a separate agent session, start `/ce:work` with the plan path there. Otherwise, explain the limitation briefly and offer to run `/ce:work` in the current session instead.
+- **Create Issue** → Follow the Issue Creation section below
+- **Other** → Accept free text for revisions and loop back to options
-**Note:** If running `/ce:plan` with ultrathink enabled, automatically run `/deepen-plan` after plan creation for maximum depth and grounding.
-
-Loop back to options after Simplify or Other changes until user selects `/ce:work` or another action.
+If running with ultrathink enabled, or the platform's reasoning/effort level is set to max or extra-high, automatically run `/deepen-plan` only when the plan is `Standard` or `Deep`, high-risk, or still shows meaningful confidence gaps in decisions, sequencing, system-wide impact, risks, or verification.
## Issue Creation
-When user selects "Create Issue", detect their project tracker from CLAUDE.md:
+When the user selects "Create Issue", detect their project tracker from `AGENTS.md` or, if needed for compatibility, `CLAUDE.md`:
-1. **Check for tracker preference** in user's CLAUDE.md (global or project):
- - Look for `project_tracker: github` or `project_tracker: linear`
- - Or look for mentions of "GitHub Issues" or "Linear" in their workflow section
-
-2. **If GitHub:**
-
- Use the title and type from Step 2 (already in context - no need to re-read the file):
+1. Look for `project_tracker: github` or `project_tracker: linear`
+2. If GitHub:
```bash
gh issue create --title ": " --body-file
```
-3. **If Linear:**
+3. If Linear:
```bash
linear issue create --title "" --description "$(cat )"
```
-4. **If no tracker configured:**
- Ask user: "Which project tracker do you use? (GitHub/Linear/Other)"
- - Suggest adding `project_tracker: github` or `project_tracker: linear` to their CLAUDE.md
+4. If no tracker is configured:
+ - Ask which tracker they use using the platform's blocking question tool when available (see Interaction Method)
+ - Suggest adding the tracker to `AGENTS.md` for future runs
-5. **After creation:**
- - Display the issue URL
- - Ask if they want to proceed to `/ce:work`
+After issue creation:
+- Display the issue URL
+- Ask whether to proceed to `/ce:work`
-NEVER CODE! Just research and write the plan.
+NEVER CODE! Research, decide, and write the plan.
diff --git a/plugins/compound-engineering/skills/ce-review/SKILL.md b/plugins/compound-engineering/skills/ce-review/SKILL.md
index c25ff51..0ce6a28 100644
--- a/plugins/compound-engineering/skills/ce-review/SKILL.md
+++ b/plugins/compound-engineering/skills/ce-review/SKILL.md
@@ -1,564 +1,503 @@
---
name: ce:review
-description: Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees
-argument-hint: "[PR number, GitHub URL, branch name, or latest] [--serial]"
+description: "Structured code review using tiered persona agents, confidence-gated findings, and a merge/dedup pipeline. Use when reviewing code changes before creating a PR."
+argument-hint: "[mode:autofix|mode:report-only] [PR number, GitHub URL, or branch name]"
---
-# Review Command
+# Code Review
- Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and Git worktrees for deep local inspection.
+Reviews code changes using dynamically selected reviewer personas. Spawns parallel sub-agents that return structured JSON, then merges and deduplicates findings into a single report.
-## Introduction
+## When to Use
-Senior Code Review Architect with expertise in security, performance, architecture, and quality assurance
+- Before creating a PR
+- After completing a task during iterative implementation
+- When feedback is needed on any code changes
+- Can be invoked standalone
+- Can run as a read-only or autofix review step inside larger workflows
-## Prerequisites
+## Mode Detection
-
-- Git repository with GitHub CLI (`gh`) installed and authenticated
-- Clean main/master branch
-- Proper permissions to create worktrees and access the repository
-- For document reviews: Path to a markdown file or document
-
+Check `$ARGUMENTS` for `mode:autofix` or `mode:report-only`. If either token is present, strip it from the remaining arguments before interpreting the rest as the PR number, GitHub URL, or branch name.
-## Main Tasks
+| Mode | When | Behavior |
+|------|------|----------|
+| **Interactive** (default) | No mode token present | Review, present findings, ask for policy decisions when needed, and optionally continue into fix/push/PR next steps |
+| **Autofix** | `mode:autofix` in arguments | No user interaction. Review, apply only policy-allowed `safe_auto` fixes, re-review in bounded rounds, write a run artifact, and emit residual downstream work when needed |
+| **Report-only** | `mode:report-only` in arguments | Strictly read-only. Review and report only, then stop with no edits, artifacts, todos, commits, pushes, or PR actions |
-### 1. Determine Review Target & Setup (ALWAYS FIRST)
+### Autofix mode rules
- #$ARGUMENTS
+- **Skip all user questions.** Never pause for approval or clarification once scope has been established.
+- **Apply only `safe_auto -> review-fixer` findings.** Leave `gated_auto`, `manual`, `human`, and `release` work unresolved.
+- **Write a run artifact** under `.context/compound-engineering/ce-review//` summarizing findings, applied fixes, residual actionable work, and advisory outputs.
+- **Create durable todo files only for unresolved actionable findings** whose final owner is `downstream-resolver`. Load the `todo-create` skill for the canonical directory path and naming convention.
+- **Never commit, push, or create a PR** from autofix mode. Parent workflows own those decisions.
-
-First, I need to determine the review target type and set up the code for analysis.
-
+### Report-only mode rules
-#### Immediate Actions:
+- **Skip all user questions.** Infer intent conservatively if the diff metadata is thin.
+- **Never edit files or externalize work.** Do not write `.context/compound-engineering/ce-review//`, do not create todo files, and do not commit, push, or create a PR.
+- **Safe for parallel read-only verification.** `mode:report-only` is the only mode that is safe to run concurrently with browser testing on the same checkout.
+- **Do not switch the shared checkout.** If the caller passes an explicit PR or branch target, `mode:report-only` must run in an isolated checkout/worktree or stop instead of running `gh pr checkout` / `git checkout`.
+- **Do not overlap mutating review with browser testing on the same checkout.** If a future orchestrator wants fixes, run the mutating review phase after browser testing or in an isolated checkout/worktree.
-
+## Severity Scale
-- [ ] Determine review type: PR number (numeric), GitHub URL, file path (.md), or empty (current branch)
-- [ ] Check current git branch
-- [ ] If ALREADY on the target branch (PR branch, requested branch name, or the branch already checked out for review) → proceed with analysis on current branch
-- [ ] If DIFFERENT branch than the review target → offer to use worktree: "Use git-worktree skill for isolated Call `skill: git-worktree` with branch name"
-- [ ] Fetch PR metadata using `gh pr view --json` for title, body, files, linked issues
-- [ ] Set up language-specific analysis tools
-- [ ] Prepare security scanning environment
-- [ ] Make sure we are on the branch we are reviewing. Use gh pr checkout to switch to the branch or manually checkout the branch.
+All reviewers use P0-P3:
-Ensure that the code is ready for analysis (either in worktree or on current branch). ONLY then proceed to the next step.
+| Level | Meaning | Action |
+|-------|---------|--------|
+| **P0** | Critical breakage, exploitable vulnerability, data loss/corruption | Must fix before merge |
+| **P1** | High-impact defect likely hit in normal usage, breaking contract | Should fix |
+| **P2** | Moderate issue with meaningful downside (edge case, perf regression, maintainability trap) | Fix if straightforward |
+| **P3** | Low-impact, narrow scope, minor improvement | User's discretion |
-
+## Action Routing
-#### Protected Artifacts
+Severity answers **urgency**. Routing answers **who acts next** and **whether this skill may mutate the checkout**.
-
-The following paths are compound-engineering pipeline artifacts and must never be flagged for deletion, removal, or gitignore by any review agent:
+| `autofix_class` | Default owner | Meaning |
+|-----------------|---------------|---------|
+| `safe_auto` | `review-fixer` | Local, deterministic fix suitable for the in-skill fixer when the current mode allows mutation |
+| `gated_auto` | `downstream-resolver` or `human` | Concrete fix exists, but it changes behavior, contracts, permissions, or another sensitive boundary that should not be auto-applied by default |
+| `manual` | `downstream-resolver` or `human` | Actionable work that should be handed off rather than fixed in-skill |
+| `advisory` | `human` or `release` | Report-only output such as learnings, rollout notes, or residual risk |
-- `docs/plans/*.md` — Plan files created by `/ce:plan`. These are living documents that track implementation progress (checkboxes are checked off by `/ce:work`).
-- `docs/solutions/*.md` — Solution documents created during the pipeline.
+Routing rules:
-If a review agent flags any file in these directories for cleanup or removal, discard that finding during synthesis. Do not create a todo for it.
-
+- **Synthesis owns the final route.** Persona-provided routing metadata is input, not the last word.
+- **Choose the more conservative route on disagreement.** A merged finding may move from `safe_auto` to `gated_auto` or `manual`, but never the other way without stronger evidence.
+- **Only `safe_auto -> review-fixer` enters the in-skill fixer queue automatically.**
+- **`requires_verification: true` means a fix is not complete without targeted tests, a focused re-review, or operational validation.**
-#### Load Review Agents
+## Reviewers
-Read `compound-engineering.local.md` in the project root. If found, use `review_agents` from YAML frontmatter. If the markdown body contains review context, pass it to each agent as additional instructions.
+8 personas in two tiers, plus CE-specific agents. See [persona-catalog.md](./references/persona-catalog.md) for the full catalog.
-If no settings file exists, invoke the `setup` skill to create one. Then read the newly created file and continue.
+**Always-on (every review):**
-#### Choose Execution Mode
+| Agent | Focus |
+|-------|-------|
+| `compound-engineering:review:correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation |
+| `compound-engineering:review:testing-reviewer` | Coverage gaps, weak assertions, brittle tests |
+| `compound-engineering:review:maintainability-reviewer` | Coupling, complexity, naming, dead code, abstraction debt |
+| `compound-engineering:review:agent-native-reviewer` | Verify new features are agent-accessible |
+| `compound-engineering:research:learnings-researcher` | Search docs/solutions/ for past issues related to this PR |
-
+**Conditional (selected per diff):**
-Before launching review agents, check for context constraints:
+| Agent | Select when diff touches... |
+|-------|---------------------------|
+| `compound-engineering:review:security-reviewer` | Auth, public endpoints, user input, permissions |
+| `compound-engineering:review:performance-reviewer` | DB queries, data transforms, caching, async |
+| `compound-engineering:review:api-contract-reviewer` | Routes, serializers, type signatures, versioning |
+| `compound-engineering:review:data-migrations-reviewer` | Migrations, schema changes, backfills |
+| `compound-engineering:review:reliability-reviewer` | Error handling, retries, timeouts, background jobs |
-**If `--serial` flag is passed OR conversation is in a long session:**
+**CE conditional (migration-specific):**
-Run agents ONE AT A TIME in sequence. Wait for each agent to complete before starting the next. This uses less context but takes longer.
+| Agent | Select when diff includes migration files |
+|-------|------------------------------------------|
+| `compound-engineering:review:schema-drift-detector` | Cross-references schema.rb against included migrations |
+| `compound-engineering:review:deployment-verification-agent` | Produces deployment checklist with SQL verification queries |
-**Default (parallel):**
+## Review Scope
-Run all agents simultaneously for speed. If you hit context limits, retry with `--serial` flag.
+Every review spawns all 3 always-on personas plus the 2 CE always-on agents, then adds applicable conditionals. The tier model naturally right-sizes: a small config change triggers 0 conditionals = 5 reviewers. A large auth feature triggers security + maybe reliability = 7 reviewers.
-**Auto-detect:** If more than 5 review agents are configured, automatically switch to serial mode and inform the user:
-"Running review agents in serial mode (6+ agents configured). Use --parallel to override."
+## Protected Artifacts
-
+The following paths are compound-engineering pipeline artifacts and must never be flagged for deletion, removal, or gitignore by any reviewer:
-#### Parallel Agents to review the PR:
+- `docs/brainstorms/*` -- requirements documents created by ce:brainstorm
+- `docs/plans/*.md` -- plan files created by ce:plan (living documents with progress checkboxes)
+- `docs/solutions/*.md` -- solution documents created during the pipeline
-
+If a reviewer flags any file in these directories for cleanup or removal, discard that finding during synthesis.
-**IMPORTANT: Do NOT create worktrees per review agent.** A worktree or branch was already set up in Phase 1 (or provided in the original prompt from `/ce:work`). All review agents run in that same checkout. If a worktree path was provided, `cd` into it. Otherwise, find the worktree where the target branch is checked out using `git worktree list`. Never pass `isolation: "worktree"` when spawning review agents — they are read-only and share the existing checkout.
+## How to Run
-
+### Stage 1: Determine scope
-
+Compute the diff range, file list, and diff. Minimize permission prompts by combining into as few commands as possible.
-**Parallel mode (default for ≤5 agents):**
+**If a PR number or GitHub URL is provided as an argument:**
-Run all configured review agents in parallel using Task tool. For each agent in the `review_agents` list:
+If `mode:report-only` is active, do **not** run `gh pr checkout ` on the shared checkout. Tell the caller: "mode:report-only cannot switch the shared checkout to review a PR target. Run it from an isolated worktree/checkout for that PR, or run report-only with no target argument on the already checked out branch." Stop here unless the review is already running in an isolated checkout.
+
+First, verify the worktree is clean before switching branches:
```
-Task {agent-name}(PR content + review context from settings body)
+git status --porcelain
```
-**Serial mode (--serial flag, or auto for 6+ agents):**
+If the output is non-empty, inform the user: "You have uncommitted changes on the current branch. Stash or commit them before reviewing a PR, or use standalone mode (no argument) to review the current branch as-is." Do not proceed with checkout until the worktree is clean.
-Run configured review agents ONE AT A TIME. For each agent in the `review_agents` list, wait for it to complete before starting the next:
+Then check out the PR branch so persona agents can read the actual code (not the current checkout):
```
-For each agent in review_agents:
- 1. Task {agent-name}(PR content + review context)
- 2. Wait for completion
- 3. Collect findings
- 4. Proceed to next agent
+gh pr checkout
```
-Always run these last regardless of mode:
-- Task compound-engineering:review:agent-native-reviewer(PR content) - Verify new features are agent-accessible
-- Task compound-engineering:research:learnings-researcher(PR content) - Search docs/solutions/ for past issues related to this PR's modules and patterns
-
-
-
-#### Conditional Agents (Run if applicable):
-
-
-
-These agents are run ONLY when the PR matches specific criteria. Check the PR files list to determine if they apply:
-
-**MIGRATIONS: If PR contains database migrations, schema.rb, or data backfills:**
-
-- Task compound-engineering:review:schema-drift-detector(PR content) - Detects unrelated schema.rb changes by cross-referencing against included migrations (run FIRST)
-- Task compound-engineering:review:data-migration-expert(PR content) - Validates ID mappings match production, checks for swapped values, verifies rollback safety
-- Task compound-engineering:review:deployment-verification-agent(PR content) - Creates Go/No-Go deployment checklist with SQL verification queries
-
-**When to run:**
-- PR includes files matching `db/migrate/*.rb` or `db/schema.rb`
-- PR modifies columns that store IDs, enums, or mappings
-- PR includes data backfill scripts or rake tasks
-- PR title/body mentions: migration, backfill, data transformation, ID mapping
-
-**What these agents check:**
-- `schema-drift-detector`: Cross-references schema.rb changes against PR migrations to catch unrelated columns/indexes from local database state
-- `data-migration-expert`: Verifies hard-coded mappings match production reality (prevents swapped IDs), checks for orphaned associations, validates dual-write patterns
-- `deployment-verification-agent`: Produces executable pre/post-deploy checklists with SQL queries, rollback procedures, and monitoring plans
-
-
-
-### 2. Ultra-Thinking Deep Dive Phases
-
- For each phase below, spend maximum cognitive effort. Think step by step. Consider all angles. Question assumptions. And bring all reviews in a synthesis to the user.
-
-
-Complete system context map with component interactions
-
-
-#### Phase 1: Stakeholder Perspective Analysis
-
- ULTRA-THINK: Put yourself in each stakeholder's shoes. What matters to them? What are their pain points?
-
-
-
-1. **Developer Perspective**
-
- - How easy is this to understand and modify?
- - Are the APIs intuitive?
- - Is debugging straightforward?
- - Can I test this easily?
-
-2. **Operations Perspective**
-
- - How do I deploy this safely?
- - What metrics and logs are available?
- - How do I troubleshoot issues?
- - What are the resource requirements?
-
-3. **End User Perspective**
-
- - Is the feature intuitive?
- - Are error messages helpful?
- - Is performance acceptable?
- - Does it solve my problem?
-
-4. **Security Team Perspective**
-
- - What's the attack surface?
- - Are there compliance requirements?
- - How is data protected?
- - What are the audit capabilities?
-
-5. **Business Perspective**
- - What's the ROI?
- - Are there legal/compliance risks?
- - How does this affect time-to-market?
- - What's the total cost of ownership?
-
-#### Phase 2: Scenario Exploration
-
- ULTRA-THINK: Explore edge cases and failure scenarios. What could go wrong? How does the system behave under stress?
-
-
-
-- [ ] **Happy Path**: Normal operation with valid inputs
-- [ ] **Invalid Inputs**: Null, empty, malformed data
-- [ ] **Boundary Conditions**: Min/max values, empty collections
-- [ ] **Concurrent Access**: Race conditions, deadlocks
-- [ ] **Scale Testing**: 10x, 100x, 1000x normal load
-- [ ] **Network Issues**: Timeouts, partial failures
-- [ ] **Resource Exhaustion**: Memory, disk, connections
-- [ ] **Security Attacks**: Injection, overflow, DoS
-- [ ] **Data Corruption**: Partial writes, inconsistency
-- [ ] **Cascading Failures**: Downstream service issues
-
-### 3. Multi-Angle Review Perspectives
-
-#### Technical Excellence Angle
-
-- Code craftsmanship evaluation
-- Engineering best practices
-- Technical documentation quality
-- Tooling and automation assessment
-
-#### Business Value Angle
-
-- Feature completeness validation
-- Performance impact on users
-- Cost-benefit analysis
-- Time-to-market considerations
-
-#### Risk Management Angle
-
-- Security risk assessment
-- Operational risk evaluation
-- Compliance risk verification
-- Technical debt accumulation
-
-#### Team Dynamics Angle
-
-- Code review etiquette
-- Knowledge sharing effectiveness
-- Collaboration patterns
-- Mentoring opportunities
-
-### 4. Simplification and Minimalism Review
-
-Run the Task compound-engineering:review:code-simplicity-reviewer() to see if we can simplify the code.
-
-### 5. Findings Synthesis and Todo Creation Using file-todos Skill
-
- ALL findings MUST be stored in the todos/ directory using the file-todos skill. Create todo files immediately after synthesis - do NOT present findings for user approval first. Use the skill for structured todo management.
-
-#### Step 1: Synthesize All Findings
-
-
-Consolidate all agent reports into a categorized list of findings.
-Remove duplicates, prioritize by severity and impact.
-
-
-
-
-- [ ] Collect findings from all parallel agents
-- [ ] Surface learnings-researcher results: if past solutions are relevant, flag them as "Known Pattern" with links to docs/solutions/ files
-- [ ] Discard any findings that recommend deleting or gitignoring files in `docs/plans/` or `docs/solutions/` (see Protected Artifacts above)
-- [ ] Categorize by type: security, performance, architecture, quality, etc.
-- [ ] Assign severity levels: 🔴 CRITICAL (P1), 🟡 IMPORTANT (P2), 🔵 NICE-TO-HAVE (P3)
-- [ ] Remove duplicate or overlapping findings
-- [ ] Estimate effort for each finding (Small/Medium/Large)
-
-
-
-#### Step 2: Create Todo Files Using file-todos Skill
-
- Use the file-todos skill to create todo files for ALL findings immediately. Do NOT present findings one-by-one asking for user approval. Create all todo files in parallel using the skill, then summarize results to user.
-
-**Implementation Options:**
-
-**Option A: Direct File Creation (Fast)**
-
-- Create todo files directly using Write tool
-- All findings in parallel for speed
-- Use standard template from `.claude/skills/file-todos/assets/todo-template.md`
-- Follow naming convention: `{issue_id}-pending-{priority}-{description}.md`
-
-**Option B: Sub-Agents in Parallel (Recommended for Scale)** For large PRs with 15+ findings, use sub-agents to create finding files in parallel:
-
-```bash
-# Launch multiple finding-creator agents in parallel
-Task() - Create todos for first finding
-Task() - Create todos for second finding
-Task() - Create todos for third finding
-etc. for each finding.
-```
-
-Sub-agents can:
-
-- Process multiple findings simultaneously
-- Write detailed todo files with all sections filled
-- Organize findings by severity
-- Create comprehensive Proposed Solutions
-- Add acceptance criteria and work logs
-- Complete much faster than sequential processing
-
-**Execution Strategy:**
-
-1. Synthesize all findings into categories (P1/P2/P3)
-2. Group findings by severity
-3. Launch 3 parallel sub-agents (one per severity level)
-4. Each sub-agent creates its batch of todos using the file-todos skill
-5. Consolidate results and present summary
-
-**Process (Using file-todos Skill):**
-
-1. For each finding:
-
- - Determine severity (P1/P2/P3)
- - Write detailed Problem Statement and Findings
- - Create 2-3 Proposed Solutions with pros/cons/effort/risk
- - Estimate effort (Small/Medium/Large)
- - Add acceptance criteria and work log
-
-2. Use file-todos skill for structured todo management:
-
- ```bash
- skill: file-todos
- ```
-
- The skill provides:
-
- - Template location: `.claude/skills/file-todos/assets/todo-template.md`
- - Naming convention: `{issue_id}-{status}-{priority}-{description}.md`
- - YAML frontmatter structure: status, priority, issue_id, tags, dependencies
- - All required sections: Problem Statement, Findings, Solutions, etc.
-
-3. Create todo files in parallel:
-
- ```bash
- {next_id}-pending-{priority}-{description}.md
- ```
-
-4. Examples:
-
- ```
- 001-pending-p1-path-traversal-vulnerability.md
- 002-pending-p1-api-response-validation.md
- 003-pending-p2-concurrency-limit.md
- 004-pending-p3-unused-parameter.md
- ```
-
-5. Follow template structure from file-todos skill: `.claude/skills/file-todos/assets/todo-template.md`
-
-**Todo File Structure (from template):**
-
-Each todo must include:
-
-- **YAML frontmatter**: status, priority, issue_id, tags, dependencies
-- **Problem Statement**: What's broken/missing, why it matters
-- **Findings**: Discoveries from agents with evidence/location
-- **Proposed Solutions**: 2-3 options, each with pros/cons/effort/risk
-- **Recommended Action**: (Filled during triage, leave blank initially)
-- **Technical Details**: Affected files, components, database changes
-- **Acceptance Criteria**: Testable checklist items
-- **Work Log**: Dated record with actions and learnings
-- **Resources**: Links to PR, issues, documentation, similar patterns
-
-**File naming convention:**
+Then fetch PR metadata. Capture the base branch name and the PR base repository identity, not just the branch name:
```
-{issue_id}-{status}-{priority}-{description}.md
-
-Examples:
-- 001-pending-p1-security-vulnerability.md
-- 002-pending-p2-performance-optimization.md
-- 003-pending-p3-code-cleanup.md
+gh pr view --json title,body,baseRefName,headRefName,url
```
-**Status values:**
+Use the repository portion of the returned PR URL as `` (for example, `EveryInc/compound-engineering-plugin` from `https://github.com/EveryInc/compound-engineering-plugin/pull/348`).
-- `pending` - New findings, needs triage/decision
-- `ready` - Approved by manager, ready to work
-- `complete` - Work finished
-
-**Priority values:**
-
-- `p1` - Critical (blocks merge, security/data issues)
-- `p2` - Important (should fix, architectural/performance)
-- `p3` - Nice-to-have (enhancements, cleanup)
-
-**Tagging:** Always add `code-review` tag, plus: `security`, `performance`, `architecture`, `rails`, `quality`, etc.
-
-#### Step 3: Summary Report
-
-After creating all todo files, present comprehensive summary:
-
-````markdown
-## ✅ Code Review Complete
-
-**Review Target:** PR #XXXX - [PR Title] **Branch:** [branch-name]
-
-### Findings Summary:
-
-- **Total Findings:** [X]
-- **🔴 CRITICAL (P1):** [count] - BLOCKS MERGE
-- **🟡 IMPORTANT (P2):** [count] - Should Fix
-- **🔵 NICE-TO-HAVE (P3):** [count] - Enhancements
-
-### Created Todo Files:
-
-**P1 - Critical (BLOCKS MERGE):**
-
-- `001-pending-p1-{finding}.md` - {description}
-- `002-pending-p1-{finding}.md` - {description}
-
-**P2 - Important:**
-
-- `003-pending-p2-{finding}.md` - {description}
-- `004-pending-p2-{finding}.md` - {description}
-
-**P3 - Nice-to-Have:**
-
-- `005-pending-p3-{finding}.md` - {description}
-
-### Review Agents Used:
-
-- kieran-rails-reviewer
-- security-sentinel
-- performance-oracle
-- architecture-strategist
-- agent-native-reviewer
-- [other agents]
-
-### Next Steps:
-
-1. **Address P1 Findings**: CRITICAL - must be fixed before merge
-
- - Review each P1 todo in detail
- - Implement fixes or request exemption
- - Verify fixes before merging PR
-
-2. **Triage All Todos**:
- ```bash
- ls todos/*-pending-*.md # View all pending todos
- /triage # Use slash command for interactive triage
- ```
-
-3. **Work on Approved Todos**:
-
- ```bash
- /resolve_todo_parallel # Fix all approved items efficiently
- ```
-
-4. **Track Progress**:
- - Rename file when status changes: pending → ready → complete
- - Update Work Log as you work
- - Commit todos: `git add todos/ && git commit -m "refactor: add code review findings"`
-
-### Severity Breakdown:
-
-**🔴 P1 (Critical - Blocks Merge):**
-
-- Security vulnerabilities
-- Data corruption risks
-- Breaking changes
-- Critical architectural issues
-
-**🟡 P2 (Important - Should Fix):**
-
-- Performance issues
-- Significant architectural concerns
-- Major code quality problems
-- Reliability issues
-
-**🔵 P3 (Nice-to-Have):**
-
-- Minor improvements
-- Code cleanup
-- Optimization opportunities
-- Documentation updates
-````
-
-### 6. End-to-End Testing (Optional)
-
-
-
-**First, detect the project type from PR files:**
-
-| Indicator | Project Type |
-|-----------|--------------|
-| `*.xcodeproj`, `*.xcworkspace`, `Package.swift` (iOS) | iOS/macOS |
-| `Gemfile`, `package.json`, `app/views/*`, `*.html.*` | Web |
-| Both iOS files AND web files | Hybrid (test both) |
-
-
-
-
-
-After presenting the Summary Report, offer appropriate testing based on project type:
-
-**For Web Projects:**
-```markdown
-**"Want to run browser tests on the affected pages?"**
-1. Yes - run `/test-browser`
-2. No - skip
-```
-
-**For iOS Projects:**
-```markdown
-**"Want to run Xcode simulator tests on the app?"**
-1. Yes - run `/xcode-test`
-2. No - skip
-```
-
-**For Hybrid Projects (e.g., Rails + Hotwire Native):**
-```markdown
-**"Want to run end-to-end tests?"**
-1. Web only - run `/test-browser`
-2. iOS only - run `/xcode-test`
-3. Both - run both commands
-4. No - skip
-```
-
-
-
-#### If User Accepts Web Testing:
-
-Spawn a subagent to run browser tests (preserves main context):
+Then compute a local diff against the PR's base branch so re-reviews also include local fix commits and uncommitted edits. Substitute the PR base branch from metadata (shown here as ``) and the PR base repository identity derived from the PR URL (shown here as ``). Resolve the base ref from the PR's actual base repository, not by assuming `origin` points at that repo:
```
-Task general-purpose("Run /test-browser for PR #[number]. Test all affected pages, check for console errors, handle failures by creating todos and fixing.")
+PR_BASE_REMOTE=$(git remote -v | awk 'index($2, "github.com:") || index($2, "github.com/") {print $1; exit}')
+if [ -n "$PR_BASE_REMOTE" ]; then PR_BASE_REMOTE_REF="$PR_BASE_REMOTE/"; else PR_BASE_REMOTE_REF=""; fi
+PR_BASE_REF=$(git rev-parse --verify "$PR_BASE_REMOTE_REF" 2>/dev/null || git rev-parse --verify 2>/dev/null || true)
+if [ -z "$PR_BASE_REF" ]; then
+ if [ -n "$PR_BASE_REMOTE_REF" ]; then
+ git fetch --no-tags "$PR_BASE_REMOTE" :refs/remotes/"$PR_BASE_REMOTE"/ 2>/dev/null || git fetch --no-tags "$PR_BASE_REMOTE" 2>/dev/null || true
+ PR_BASE_REF=$(git rev-parse --verify "$PR_BASE_REMOTE_REF" 2>/dev/null || git rev-parse --verify 2>/dev/null || true)
+ else
+ if git fetch --no-tags https://github.com/.git 2>/dev/null; then
+ PR_BASE_REF=$(git rev-parse --verify FETCH_HEAD 2>/dev/null || true)
+ fi
+ if [ -z "$PR_BASE_REF" ]; then PR_BASE_REF=$(git rev-parse --verify 2>/dev/null || true); fi
+ fi
+fi
+if [ -n "$PR_BASE_REF" ]; then BASE=$(git merge-base HEAD "$PR_BASE_REF" 2>/dev/null) || BASE=""; else BASE=""; fi
```
-The subagent will:
-1. Identify pages affected by the PR
-2. Navigate to each page and capture snapshots (using Playwright MCP or agent-browser CLI)
-3. Check for console errors
-4. Test critical interactions
-5. Pause for human verification on OAuth/email/payment flows
-6. Create P1 todos for any failures
-7. Fix and retry until all tests pass
-
-**Standalone:** `/test-browser [PR number]`
-
-#### If User Accepts iOS Testing:
-
-Spawn a subagent to run Xcode tests (preserves main context):
-
```
-Task general-purpose("Run /xcode-test for scheme [name]. Build for simulator, install, launch, take screenshots, check for crashes.")
+if [ -n "$BASE" ]; then echo "BASE:$BASE" && echo "FILES:" && git diff --name-only $BASE && echo "DIFF:" && git diff -U10 $BASE && echo "UNTRACKED:" && git ls-files --others --exclude-standard; else echo "ERROR: Unable to resolve PR base branch locally. Fetch the base branch and rerun so the review scope stays aligned with the PR."; fi
```
-The subagent will:
-1. Verify XcodeBuildMCP is installed
-2. Discover project and schemes
-3. Build for iOS Simulator
-4. Install and launch app
-5. Take screenshots of key screens
-6. Capture console logs for errors
-7. Pause for human verification (Sign in with Apple, push, IAP)
-8. Create P1 todos for any failures
-9. Fix and retry until all tests pass
+Extract PR title/body, base branch, and PR URL from `gh pr view`, then extract the base marker, file list, diff content, and `UNTRACKED:` list from the local command. Do not use `gh pr diff` as the review scope after checkout -- it only reflects the remote PR state and will miss local fix commits until they are pushed. If the base ref still cannot be resolved from the PR's actual base repository after the fetch attempt, stop instead of falling back to `git diff HEAD`; a PR review without the PR base branch is incomplete.
-**Standalone:** `/xcode-test [scheme]`
+**If a branch name is provided as an argument:**
-### Important: P1 Findings Block Merge
+Check out the named branch, then diff it against the base branch. Substitute the provided branch name (shown here as ``).
-Any **🔴 P1 (CRITICAL)** findings must be addressed before merging the PR. Present these prominently and ensure they're resolved before accepting the PR.
+If `mode:report-only` is active, do **not** run `git checkout ` on the shared checkout. Tell the caller: "mode:report-only cannot switch the shared checkout to review another branch. Run it from an isolated worktree/checkout for ``, or run report-only on the current checkout with no target argument." Stop here unless the review is already running in an isolated checkout.
+
+First, verify the worktree is clean before switching branches:
+
+```
+git status --porcelain
+```
+
+If the output is non-empty, inform the user: "You have uncommitted changes on the current branch. Stash or commit them before reviewing another branch, or provide a PR number instead." Do not proceed with checkout until the worktree is clean.
+
+```
+git checkout
+```
+
+Then detect the review base branch before computing the merge-base. When the branch has an open PR, resolve the base ref from the PR's actual base repository (not just `origin`), mirroring the PR-mode logic for fork safety. Fall back to `origin/HEAD`, GitHub metadata, then common branch names:
+
+```
+REVIEW_BASE_BRANCH=""
+PR_BASE_REPO=""
+if command -v gh >/dev/null 2>&1; then
+ PR_META=$(gh pr view --json baseRefName,url 2>/dev/null || true)
+ if [ -n "$PR_META" ]; then
+ REVIEW_BASE_BRANCH=$(echo "$PR_META" | jq -r '.baseRefName // empty')
+ PR_BASE_REPO=$(echo "$PR_META" | jq -r '.url // empty' | sed -n 's#https://github.com/\([^/]*/[^/]*\)/pull/.*#\1#p')
+ fi
+fi
+if [ -z "$REVIEW_BASE_BRANCH" ]; then REVIEW_BASE_BRANCH=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##'); fi
+if [ -z "$REVIEW_BASE_BRANCH" ] && command -v gh >/dev/null 2>&1; then REVIEW_BASE_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null); fi
+if [ -z "$REVIEW_BASE_BRANCH" ]; then
+ for candidate in main master develop trunk; do
+ if git rev-parse --verify "origin/$candidate" >/dev/null 2>&1 || git rev-parse --verify "$candidate" >/dev/null 2>&1; then
+ REVIEW_BASE_BRANCH="$candidate"
+ break
+ fi
+ done
+fi
+if [ -n "$REVIEW_BASE_BRANCH" ]; then
+ if [ -n "$PR_BASE_REPO" ]; then
+ PR_BASE_REMOTE=$(git remote -v | awk "index(\$2, \"github.com:$PR_BASE_REPO\") || index(\$2, \"github.com/$PR_BASE_REPO\") {print \$1; exit}")
+ if [ -n "$PR_BASE_REMOTE" ]; then
+ git rev-parse --verify "$PR_BASE_REMOTE/$REVIEW_BASE_BRANCH" >/dev/null 2>&1 || git fetch --no-tags "$PR_BASE_REMOTE" "$REVIEW_BASE_BRANCH" 2>/dev/null || true
+ BASE_REF=$(git rev-parse --verify "$PR_BASE_REMOTE/$REVIEW_BASE_BRANCH" 2>/dev/null || true)
+ fi
+ fi
+ if [ -z "$BASE_REF" ]; then
+ git rev-parse --verify "origin/$REVIEW_BASE_BRANCH" >/dev/null 2>&1 || git fetch --no-tags origin "$REVIEW_BASE_BRANCH" 2>/dev/null || true
+ BASE_REF=$(git rev-parse --verify "origin/$REVIEW_BASE_BRANCH" 2>/dev/null || git rev-parse --verify "$REVIEW_BASE_BRANCH" 2>/dev/null || true)
+ fi
+ if [ -n "$BASE_REF" ]; then BASE=$(git merge-base HEAD "$BASE_REF" 2>/dev/null) || BASE=""; else BASE=""; fi
+else BASE=""; fi
+```
+
+```
+if [ -n "$BASE" ]; then echo "BASE:$BASE" && echo "FILES:" && git diff --name-only $BASE && echo "DIFF:" && git diff -U10 $BASE && echo "UNTRACKED:" && git ls-files --others --exclude-standard; else echo "ERROR: Unable to resolve review base branch locally. Fetch the base branch and rerun, or provide a PR number so the review scope can be determined from PR metadata."; fi
+```
+
+If the branch has an open PR, the detection above uses the PR's base repository to resolve the merge-base, which handles fork workflows correctly. You may still fetch additional PR metadata with `gh pr view` for title, body, and linked issues, but do not fail if no PR exists. If the base branch still cannot be resolved after the detection and fetch attempts, stop instead of falling back to `git diff HEAD`; a branch review without the base branch would only show uncommitted changes and silently miss all committed work.
+
+**If no argument (standalone on current branch):**
+
+Detect the review base branch before computing the merge-base. When the current branch has an open PR, resolve the base ref from the PR's actual base repository (not just `origin`), mirroring the PR-mode logic for fork safety. Fall back to `origin/HEAD`, GitHub metadata, then common branch names:
+
+```
+REVIEW_BASE_BRANCH=""
+PR_BASE_REPO=""
+if command -v gh >/dev/null 2>&1; then
+ PR_META=$(gh pr view --json baseRefName,url 2>/dev/null || true)
+ if [ -n "$PR_META" ]; then
+ REVIEW_BASE_BRANCH=$(echo "$PR_META" | jq -r '.baseRefName // empty')
+ PR_BASE_REPO=$(echo "$PR_META" | jq -r '.url // empty' | sed -n 's#https://github.com/\([^/]*/[^/]*\)/pull/.*#\1#p')
+ fi
+fi
+if [ -z "$REVIEW_BASE_BRANCH" ]; then REVIEW_BASE_BRANCH=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##'); fi
+if [ -z "$REVIEW_BASE_BRANCH" ] && command -v gh >/dev/null 2>&1; then REVIEW_BASE_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null); fi
+if [ -z "$REVIEW_BASE_BRANCH" ]; then
+ for candidate in main master develop trunk; do
+ if git rev-parse --verify "origin/$candidate" >/dev/null 2>&1 || git rev-parse --verify "$candidate" >/dev/null 2>&1; then
+ REVIEW_BASE_BRANCH="$candidate"
+ break
+ fi
+ done
+fi
+if [ -n "$REVIEW_BASE_BRANCH" ]; then
+ if [ -n "$PR_BASE_REPO" ]; then
+ PR_BASE_REMOTE=$(git remote -v | awk "index(\$2, \"github.com:$PR_BASE_REPO\") || index(\$2, \"github.com/$PR_BASE_REPO\") {print \$1; exit}")
+ if [ -n "$PR_BASE_REMOTE" ]; then
+ git rev-parse --verify "$PR_BASE_REMOTE/$REVIEW_BASE_BRANCH" >/dev/null 2>&1 || git fetch --no-tags "$PR_BASE_REMOTE" "$REVIEW_BASE_BRANCH" 2>/dev/null || true
+ BASE_REF=$(git rev-parse --verify "$PR_BASE_REMOTE/$REVIEW_BASE_BRANCH" 2>/dev/null || true)
+ fi
+ fi
+ if [ -z "$BASE_REF" ]; then
+ git rev-parse --verify "origin/$REVIEW_BASE_BRANCH" >/dev/null 2>&1 || git fetch --no-tags origin "$REVIEW_BASE_BRANCH" 2>/dev/null || true
+ BASE_REF=$(git rev-parse --verify "origin/$REVIEW_BASE_BRANCH" 2>/dev/null || git rev-parse --verify "$REVIEW_BASE_BRANCH" 2>/dev/null || true)
+ fi
+ if [ -n "$BASE_REF" ]; then BASE=$(git merge-base HEAD "$BASE_REF" 2>/dev/null) || BASE=""; else BASE=""; fi
+else BASE=""; fi
+```
+
+```
+if [ -n "$BASE" ]; then echo "BASE:$BASE" && echo "FILES:" && git diff --name-only $BASE && echo "DIFF:" && git diff -U10 $BASE && echo "UNTRACKED:" && git ls-files --others --exclude-standard; else echo "ERROR: Unable to resolve review base branch locally. Fetch the base branch and rerun, or provide a PR number so the review scope can be determined from PR metadata."; fi
+```
+
+Parse: `BASE:` = merge-base SHA, `FILES:` = file list, `DIFF:` = diff, `UNTRACKED:` = files excluded from review scope because they are not staged. Using `git diff $BASE` (without `..HEAD`) diffs the merge-base against the working tree, which includes committed, staged, and unstaged changes together. If the base branch cannot be resolved after the detection and fetch attempts, stop instead of falling back to `git diff HEAD`; a standalone review without the base branch would only show uncommitted changes and silently miss all committed work on the branch.
+
+**Untracked file handling:** Always inspect the `UNTRACKED:` list, even when `FILES:`/`DIFF:` are non-empty. Untracked files are outside review scope until staged. If the list is non-empty, tell the user which files are excluded. If any of them should be reviewed, stop and tell the user to `git add` them first and rerun. Only continue when the user is intentionally reviewing tracked changes only.
+
+### Stage 2: Intent discovery
+
+Understand what the change is trying to accomplish. The source of intent depends on which Stage 1 path was taken:
+
+**PR/URL mode:** Use the PR title, body, and linked issues from `gh pr view` metadata. Supplement with commit messages from the PR if the body is sparse.
+
+**Branch mode:** Run `git log --oneline ${BASE}..` using the resolved merge-base from Stage 1.
+
+**Standalone (current branch):** Run:
+
+```
+echo "BRANCH:" && git rev-parse --abbrev-ref HEAD && echo "COMMITS:" && git log --oneline ${BASE}..HEAD
+```
+
+Combined with conversation context (plan section summary, PR description, caller-provided description), write a 2-3 line intent summary:
+
+```
+Intent: Simplify tax calculation by replacing the multi-tier rate lookup
+with a flat-rate computation. Must not regress edge cases in tax-exempt handling.
+```
+
+Pass this to every reviewer in their spawn prompt. Intent shapes *how hard each reviewer looks*, not which reviewers are selected.
+
+**When intent is ambiguous:**
+
+- **Interactive mode:** Ask one question using the platform's interactive question tool (AskUserQuestion in Claude Code, request_user_input in Codex): "What is the primary goal of these changes?" Do not spawn reviewers until intent is established.
+- **Autofix/report-only modes:** Infer intent conservatively from the branch name, diff, PR metadata, and caller context. Note the uncertainty in Coverage or Verdict reasoning instead of blocking.
+
+### Stage 3: Select reviewers
+
+Read the diff and file list from Stage 1. The 3 always-on personas and 2 CE always-on agents are automatic. For each conditional persona in [persona-catalog.md](./references/persona-catalog.md), decide whether the diff warrants it. This is agent judgment, not keyword matching.
+
+For CE conditional agents, check if the diff includes files matching `db/migrate/*.rb`, `db/schema.rb`, or data backfill scripts.
+
+Announce the team before spawning:
+
+```
+Review team:
+- correctness (always)
+- testing (always)
+- maintainability (always)
+- agent-native-reviewer (always)
+- learnings-researcher (always)
+- security -- new endpoint in routes.rb accepts user-provided redirect URL
+- data-migrations -- adds migration 20260303_add_index_to_orders
+- schema-drift-detector -- migration files present
+```
+
+This is progress reporting, not a blocking confirmation.
+
+### Stage 4: Spawn sub-agents
+
+Spawn each selected persona reviewer as a parallel sub-agent using the template in [subagent-template.md](./references/subagent-template.md). Each persona sub-agent receives:
+
+1. Their persona file content (identity, failure modes, calibration, suppress conditions)
+2. Shared diff-scope rules from [diff-scope.md](./references/diff-scope.md)
+3. The JSON output contract from [findings-schema.json](./references/findings-schema.json)
+4. Review context: intent summary, file list, diff
+
+Persona sub-agents are **read-only**: they review and return structured JSON. They do not edit files or propose refactors.
+
+Read-only here means **non-mutating**, not "no shell access." Reviewer sub-agents may use non-mutating inspection commands when needed to gather evidence or verify scope, including read-oriented `git` / `gh` usage such as `git diff`, `git show`, `git blame`, `git log`, and `gh pr view`. They must not edit files, change branches, commit, push, create PRs, or otherwise mutate the checkout or repository state.
+
+Each persona sub-agent returns JSON matching [findings-schema.json](./references/findings-schema.json):
+
+```json
+{
+ "reviewer": "security",
+ "findings": [...],
+ "residual_risks": [...],
+ "testing_gaps": [...]
+}
+```
+
+**CE always-on agents** (agent-native-reviewer, learnings-researcher) are dispatched as standard Agent calls in parallel with the persona agents. Give them the same review context bundle the personas receive: entry mode, any PR metadata gathered in Stage 1, intent summary, review base branch name when known, `BASE:` marker, file list, diff, and `UNTRACKED:` scope notes. Do not invoke them with a generic "review this" prompt. Their output is unstructured and synthesized separately in Stage 6.
+
+**CE conditional agents** (schema-drift-detector, deployment-verification-agent) are also dispatched as standard Agent calls when applicable. Pass the same review context bundle plus the applicability reason (for example, which migration files triggered the agent). For schema-drift-detector specifically, pass the resolved review base branch explicitly so it never assumes `main`. Their output is unstructured and must be preserved for Stage 6 synthesis just like the CE always-on agents.
+
+### Stage 5: Merge findings
+
+Convert multiple reviewer JSON payloads into one deduplicated, confidence-gated finding set.
+
+1. **Validate.** Check each output against the schema. Drop malformed findings (missing required fields). Record the drop count.
+2. **Confidence gate.** Suppress findings below 0.60 confidence. Record the suppressed count. This matches the persona instructions: findings below 0.60 are noise and should not survive synthesis.
+3. **Deduplicate.** Compute fingerprint: `normalize(file) + line_bucket(line, +/-3) + normalize(title)`. When fingerprints match, merge: keep highest severity, keep highest confidence with strongest evidence, union evidence, note which reviewers flagged it.
+4. **Separate pre-existing.** Pull out findings with `pre_existing: true` into a separate list.
+5. **Normalize routing.** For each merged finding, set the final `autofix_class`, `owner`, and `requires_verification`. If reviewers disagree, keep the most conservative route. Synthesis may narrow a finding from `safe_auto` to `gated_auto` or `manual`, but must not widen it without new evidence.
+6. **Partition the work.** Build three sets:
+ - in-skill fixer queue: only `safe_auto -> review-fixer`
+ - residual actionable queue: unresolved `gated_auto` or `manual` findings whose owner is `downstream-resolver`
+ - report-only queue: `advisory` findings plus anything owned by `human` or `release`
+7. **Sort.** Order by severity (P0 first) -> confidence (descending) -> file path -> line number.
+8. **Collect coverage data.** Union residual_risks and testing_gaps across reviewers.
+9. **Preserve CE agent artifacts.** Keep the learnings, agent-native, schema-drift, and deployment-verification outputs alongside the merged finding set. Do not drop unstructured agent output just because it does not match the persona JSON schema.
+
+### Stage 6: Synthesize and present
+
+Assemble the final report using the template in [review-output-template.md](./references/review-output-template.md):
+
+1. **Header.** Scope, intent, mode, reviewer team with per-conditional justifications.
+2. **Findings.** Grouped by severity (P0, P1, P2, P3). Each finding shows file, issue, reviewer(s), confidence, and synthesized route.
+3. **Applied Fixes.** Include only if a fix phase ran in this invocation.
+4. **Residual Actionable Work.** Include when unresolved actionable findings were handed off or should be handed off.
+5. **Pre-existing.** Separate section, does not count toward verdict.
+6. **Learnings & Past Solutions.** Surface learnings-researcher results: if past solutions are relevant, flag them as "Known Pattern" with links to docs/solutions/ files.
+7. **Agent-Native Gaps.** Surface agent-native-reviewer results. Omit section if no gaps found.
+8. **Schema Drift Check.** If schema-drift-detector ran, summarize whether drift was found. If drift exists, list the unrelated schema objects and the required cleanup command. If clean, say so briefly.
+9. **Deployment Notes.** If deployment-verification-agent ran, surface the key Go/No-Go items: blocking pre-deploy checks, the most important verification queries, rollback caveats, and monitoring focus areas. Keep the checklist actionable rather than dropping it into Coverage.
+10. **Coverage.** Suppressed count, residual risks, testing gaps, failed/timed-out reviewers, and any intent uncertainty carried by non-interactive modes.
+11. **Verdict.** Ready to merge / Ready with fixes / Not ready. Fix order if applicable.
+
+Do not include time estimates.
+
+## Quality Gates
+
+Before delivering the review, verify:
+
+1. **Every finding is actionable.** Re-read each finding. If it says "consider", "might want to", or "could be improved" without a concrete fix, rewrite it with a specific action. Vague findings waste engineering time.
+2. **No false positives from skimming.** For each finding, verify the surrounding code was actually read. Check that the "bug" isn't handled elsewhere in the same function, that the "unused import" isn't used in a type annotation, that the "missing null check" isn't guarded by the caller.
+3. **Severity is calibrated.** A style nit is never P0. A SQL injection is never P3. Re-check every severity assignment.
+4. **Line numbers are accurate.** Verify each cited line number against the file content. A finding pointing to the wrong line is worse than no finding.
+5. **Protected artifacts are respected.** Discard any findings that recommend deleting or gitignoring files in `docs/brainstorms/`, `docs/plans/`, or `docs/solutions/`.
+6. **Findings don't duplicate linter output.** Don't flag things the project's linter/formatter would catch (missing semicolons, wrong indentation). Focus on semantic issues.
+
+## Language-Agnostic
+
+This skill does NOT use language-specific reviewer agents. Persona reviewers adapt their criteria to the language/framework based on project context (loaded automatically). This keeps the skill simple and avoids maintaining parallel reviewers per language.
+
+## After Review
+
+### Mode-Driven Post-Review Flow
+
+After presenting findings and verdict (Stage 6), route the next steps by mode. Review and synthesis stay the same in every mode; only mutation and handoff behavior changes.
+
+#### Step 1: Build the action sets
+
+- **Clean review** means zero findings after suppression and pre-existing separation. Skip the fix/handoff phase when the review is clean.
+- **Fixer queue:** final findings routed to `safe_auto -> review-fixer`.
+- **Residual actionable queue:** unresolved `gated_auto` or `manual` findings whose final owner is `downstream-resolver`.
+- **Report-only queue:** `advisory` findings and any outputs owned by `human` or `release`.
+- **Never convert advisory-only outputs into fix work or todos.** Deployment notes, residual risks, and release-owned items stay in the report.
+
+#### Step 2: Choose policy by mode
+
+**Interactive mode**
+
+- Ask a single policy question only when actionable work exists.
+- Recommended default:
+
+ ```
+ What should I do with the actionable findings?
+ 1. Apply safe_auto fixes and leave the rest as residual work (Recommended)
+ 2. Apply safe_auto fixes only
+ 3. Review report only
+ ```
+
+- Tailor the prompt to the actual action sets. If the fixer queue is empty, do not offer "Apply safe_auto fixes" options. Ask whether to externalize the residual actionable work or keep the review report-only instead.
+- Only include `gated_auto` findings in the fixer queue after the user explicitly approves the specific items. Do not widen the queue based on severity alone.
+
+**Autofix mode**
+
+- Ask no questions.
+- Apply only the `safe_auto -> review-fixer` queue.
+- Leave `gated_auto`, `manual`, `human`, and `release` items unresolved.
+- Prepare residual work only for unresolved actionable findings whose final owner is `downstream-resolver`.
+
+**Report-only mode**
+
+- Ask no questions.
+- Do not build a fixer queue.
+- Do not create residual todos or `.context` artifacts.
+- Stop after Stage 6. Everything remains in the report.
+
+#### Step 3: Apply fixes with one fixer and bounded rounds
+
+- Spawn exactly one fixer subagent for the current fixer queue in the current checkout. That fixer applies all approved changes and runs the relevant targeted tests in one pass against a consistent tree.
+- Do not fan out multiple fixers against the same checkout. Parallel fixers require isolated worktrees/branches and deliberate mergeback.
+- Re-review only the changed scope after fixes land.
+- Bound the loop with `max_rounds: 2`. If issues remain after the second round, stop and hand them off as residual work or report them as unresolved.
+- If any applied finding has `requires_verification: true`, the round is incomplete until the targeted verification runs.
+- Do not start a mutating review round concurrently with browser testing on the same checkout. Future orchestrators that want both must either run `mode:report-only` during the parallel phase or isolate the mutating review in its own checkout/worktree.
+
+#### Step 4: Emit artifacts and downstream handoff
+
+- In interactive and autofix modes, write a per-run artifact under `.context/compound-engineering/ce-review//` containing:
+ - synthesized findings
+ - applied fixes
+ - residual actionable work
+ - advisory-only outputs
+- In autofix mode, create durable todo files only for unresolved actionable findings whose final owner is `downstream-resolver`. Load the `todo-create` skill for the canonical directory path, naming convention, YAML frontmatter structure, and template. Each todo should map the finding's severity to the todo priority (`P0`/`P1` -> `p1`, `P2` -> `p2`, `P3` -> `p3`) and set `status: ready` since these findings have already been triaged by synthesis.
+- Do not create todos for `advisory` findings, `owner: human`, `owner: release`, or protected-artifact cleanup suggestions.
+- If only advisory outputs remain, create no todos.
+- Interactive mode may offer to externalize residual actionable work after fixes, but it is not required to finish the review.
+
+#### Step 5: Final next steps
+
+**Interactive mode only:** after the fix-review cycle completes (clean verdict or the user chose to stop), offer next steps based on the entry mode. Reuse the resolved review base/default branch from Stage 1 when known; do not hard-code only `main`/`master`.
+
+- **PR mode (entered via PR number/URL):**
+ - **Push fixes** -- push commits to the existing PR branch
+ - **Exit** -- done for now
+- **Branch mode (feature branch with no PR, and not the resolved review base/default branch):**
+ - **Create a PR (Recommended)** -- push and open a pull request
+ - **Continue without PR** -- stay on the branch
+ - **Exit** -- done for now
+- **On the resolved review base/default branch:**
+ - **Continue** -- proceed with next steps
+ - **Exit** -- done for now
+
+If "Create a PR": first publish the branch with `git push --set-upstream origin HEAD`, then use `gh pr create` with a title and summary derived from the branch changes.
+If "Push fixes": push the branch with `git push` to update the existing PR.
+
+**Autofix and report-only modes:** stop after the report, artifact emission, and residual-work handoff. Do not commit, push, or create a PR.
+
+## Fallback
+
+If the platform doesn't support parallel sub-agents, run reviewers sequentially. Everything else (stages, output format, merge pipeline) stays the same.
diff --git a/plugins/compound-engineering/skills/ce-review/references/diff-scope.md b/plugins/compound-engineering/skills/ce-review/references/diff-scope.md
new file mode 100644
index 0000000..6c1ce76
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-review/references/diff-scope.md
@@ -0,0 +1,31 @@
+# Diff Scope Rules
+
+These rules apply to every reviewer. They define what is "your code to review" versus pre-existing context.
+
+## Scope Discovery
+
+Determine the diff to review using this priority order:
+
+1. **User-specified scope.** If the caller passed `BASE:`, `FILES:`, or `DIFF:` markers, use that scope exactly.
+2. **Working copy changes.** If there are unstaged or staged changes (`git diff HEAD` is non-empty), review those.
+3. **Unpushed commits vs base branch.** If the working copy is clean, review `git diff $(git merge-base HEAD )..HEAD` where `` is the default branch (main or master).
+
+The scope step in the SKILL.md handles discovery and passes you the resolved diff. You do not need to run git commands yourself.
+
+## Finding Classification Tiers
+
+Every finding you report falls into one of three tiers based on its relationship to the diff:
+
+### Primary (directly changed code)
+
+Lines added or modified in the diff. This is your main focus. Report findings against these lines at full confidence.
+
+### Secondary (immediately surrounding code)
+
+Unchanged code within the same function, method, or block as a changed line. If a change introduces a bug that's only visible by reading the surrounding context, report it -- but note that the issue exists in the interaction between new and existing code.
+
+### Pre-existing (unrelated to this diff)
+
+Issues in unchanged code that the diff didn't touch and doesn't interact with. Mark these as `"pre_existing": true` in your output. They're reported separately and don't count toward the review verdict.
+
+**The rule:** If you'd flag the same issue on an identical diff that didn't include the surrounding file, it's pre-existing. If the diff makes the issue *newly relevant* (e.g., a new caller hits an existing buggy function), it's secondary.
diff --git a/plugins/compound-engineering/skills/ce-review/references/findings-schema.json b/plugins/compound-engineering/skills/ce-review/references/findings-schema.json
new file mode 100644
index 0000000..e7eee5d
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-review/references/findings-schema.json
@@ -0,0 +1,128 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "Code Review Findings",
+ "description": "Structured output schema for code review sub-agents",
+ "type": "object",
+ "required": ["reviewer", "findings", "residual_risks", "testing_gaps"],
+ "properties": {
+ "reviewer": {
+ "type": "string",
+ "description": "Persona name that produced this output (e.g., 'correctness', 'security')"
+ },
+ "findings": {
+ "type": "array",
+ "description": "List of code review findings. Empty array if no issues found.",
+ "items": {
+ "type": "object",
+ "required": [
+ "title",
+ "severity",
+ "file",
+ "line",
+ "why_it_matters",
+ "autofix_class",
+ "owner",
+ "requires_verification",
+ "confidence",
+ "evidence",
+ "pre_existing"
+ ],
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "Short, specific issue title. 10 words or fewer.",
+ "maxLength": 100
+ },
+ "severity": {
+ "type": "string",
+ "enum": ["P0", "P1", "P2", "P3"],
+ "description": "Issue severity level"
+ },
+ "file": {
+ "type": "string",
+ "description": "Relative file path from repository root"
+ },
+ "line": {
+ "type": "integer",
+ "description": "Primary line number of the issue",
+ "minimum": 1
+ },
+ "why_it_matters": {
+ "type": "string",
+ "description": "Impact and failure mode -- not 'what is wrong' but 'what breaks'"
+ },
+ "autofix_class": {
+ "type": "string",
+ "enum": ["safe_auto", "gated_auto", "manual", "advisory"],
+ "description": "Reviewer's conservative recommendation for how this issue should be handled after synthesis"
+ },
+ "owner": {
+ "type": "string",
+ "enum": ["review-fixer", "downstream-resolver", "human", "release"],
+ "description": "Who should own the next action for this finding after synthesis"
+ },
+ "requires_verification": {
+ "type": "boolean",
+ "description": "Whether any fix for this finding must be re-verified with targeted tests or a follow-up review pass"
+ },
+ "suggested_fix": {
+ "type": ["string", "null"],
+ "description": "Concrete minimal fix. Omit or null if no good fix is obvious -- a bad suggestion is worse than none."
+ },
+ "confidence": {
+ "type": "number",
+ "description": "Reviewer confidence in this finding, calibrated per persona",
+ "minimum": 0.0,
+ "maximum": 1.0
+ },
+ "evidence": {
+ "type": "array",
+ "description": "Code-grounded evidence: snippets, line references, or pattern descriptions. At least 1 item.",
+ "items": { "type": "string" },
+ "minItems": 1
+ },
+ "pre_existing": {
+ "type": "boolean",
+ "description": "True if this issue exists in unchanged code unrelated to the current diff"
+ }
+ }
+ }
+ },
+ "residual_risks": {
+ "type": "array",
+ "description": "Risks the reviewer noticed but could not confirm as findings",
+ "items": { "type": "string" }
+ },
+ "testing_gaps": {
+ "type": "array",
+ "description": "Missing test coverage the reviewer identified",
+ "items": { "type": "string" }
+ }
+ },
+
+ "_meta": {
+ "confidence_thresholds": {
+ "suppress": "Below 0.60 -- do not report. Finding is speculative noise.",
+ "flag": "0.60-0.69 -- include only when the persona's calibration says the issue is actionable at that confidence.",
+ "report": "0.70+ -- report with full confidence."
+ },
+ "severity_definitions": {
+ "P0": "Critical breakage, exploitable vulnerability, data loss/corruption. Must fix before merge.",
+ "P1": "High-impact defect likely hit in normal usage, breaking contract. Should fix.",
+ "P2": "Moderate issue with meaningful downside (edge case, perf regression, maintainability trap). Fix if straightforward.",
+ "P3": "Low-impact, narrow scope, minor improvement. User's discretion."
+ },
+ "autofix_classes": {
+ "safe_auto": "Local, deterministic code or test fix suitable for the in-skill fixer in autonomous mode.",
+ "gated_auto": "Concrete fix exists, but it changes behavior, permissions, contracts, or other sensitive areas that deserve explicit approval.",
+ "manual": "Actionable issue that should become residual work rather than an in-skill autofix.",
+ "advisory": "Informational or operational item that should be surfaced in the report only."
+ },
+ "owners": {
+ "review-fixer": "The in-skill fixer can own this when policy allows.",
+ "downstream-resolver": "Turn this into residual work for later resolution.",
+ "human": "A person must make a judgment call before code changes should continue.",
+ "release": "Operational or rollout follow-up; do not convert into code-fix work automatically."
+ }
+ }
+}
diff --git a/plugins/compound-engineering/skills/ce-review/references/persona-catalog.md b/plugins/compound-engineering/skills/ce-review/references/persona-catalog.md
new file mode 100644
index 0000000..ff06b2f
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-review/references/persona-catalog.md
@@ -0,0 +1,63 @@
+# Persona Catalog
+
+13 reviewer personas organized in three tiers, plus CE-specific agents. The orchestrator uses this catalog to select which reviewers to spawn for each review.
+
+## Always-on (3 personas + 2 CE agents)
+
+Spawned on every review regardless of diff content.
+
+**Persona agents (structured JSON output):**
+
+| Persona | Agent | Focus |
+|---------|-------|-------|
+| `correctness` | `compound-engineering:review:correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation, intent compliance |
+| `testing` | `compound-engineering:review:testing-reviewer` | Coverage gaps, weak assertions, brittle tests, missing edge case tests |
+| `maintainability` | `compound-engineering:review:maintainability-reviewer` | Coupling, complexity, naming, dead code, premature abstraction |
+
+**CE agents (unstructured output, synthesized separately):**
+
+| Agent | Focus |
+|-------|-------|
+| `compound-engineering:review:agent-native-reviewer` | Verify new features are agent-accessible |
+| `compound-engineering:research:learnings-researcher` | Search docs/solutions/ for past issues related to this PR's modules and patterns |
+
+## Conditional (5 personas)
+
+Spawned when the orchestrator identifies relevant patterns in the diff. The orchestrator reads the full diff and reasons about selection -- this is agent judgment, not keyword matching.
+
+| Persona | Agent | Select when diff touches... |
+|---------|-------|---------------------------|
+| `security` | `compound-engineering:review:security-reviewer` | Auth middleware, public endpoints, user input handling, permission checks, secrets management |
+| `performance` | `compound-engineering:review:performance-reviewer` | Database queries, ORM calls, loop-heavy data transforms, caching layers, async/concurrent code |
+| `api-contract` | `compound-engineering:review:api-contract-reviewer` | Route definitions, serializer/interface changes, event schemas, exported type signatures, API versioning |
+| `data-migrations` | `compound-engineering:review:data-migrations-reviewer` | Migration files, schema changes, backfill scripts, data transformations |
+| `reliability` | `compound-engineering:review:reliability-reviewer` | Error handling, retry logic, circuit breakers, timeouts, background jobs, async handlers, health checks |
+
+## Language & Framework Conditional (5 personas)
+
+Spawned when the orchestrator identifies language or framework-specific patterns in the diff. These provide deeper domain expertise than the general-purpose personas above.
+
+| Persona | Agent | Select when diff touches... |
+|---------|-------|---------------------------|
+| `python-quality` | `compound-engineering:review:kieran-python-reviewer` | Python files, FastAPI routes, Pydantic models, async/await patterns, SQLAlchemy usage |
+| `fastapi-philosophy` | `compound-engineering:review:tiangolo-fastapi-reviewer` | FastAPI application code, dependency injection, response models, middleware, OpenAPI schemas |
+| `typescript-quality` | `compound-engineering:review:kieran-typescript-reviewer` | TypeScript files, React components, type definitions, generic patterns |
+| `frontend-races` | `compound-engineering:review:julik-frontend-races-reviewer` | Frontend JavaScript, Stimulus controllers, event listeners, async UI code, animations, DOM lifecycle |
+| `architecture` | `compound-engineering:review:architecture-strategist` | New services, module boundaries, dependency graphs, API layer changes, package structure |
+
+## CE Conditional Agents (migration-specific)
+
+These CE-native agents provide specialized analysis beyond what the persona agents cover. Spawn them when the diff includes database migrations, schema.rb, or data backfills.
+
+| Agent | Focus |
+|-------|-------|
+| `compound-engineering:review:schema-drift-detector` | Cross-references schema.rb changes against included migrations to catch unrelated drift |
+| `compound-engineering:review:deployment-verification-agent` | Produces Go/No-Go deployment checklist with SQL verification queries and rollback procedures |
+
+## Selection rules
+
+1. **Always spawn all 3 always-on personas** plus the 2 CE always-on agents.
+2. **For each conditional persona**, the orchestrator reads the diff and decides whether the persona's domain is relevant. This is a judgment call, not a keyword match.
+3. **For language/framework conditional personas**, spawn when the diff contains files matching the persona's language or framework domain. Multiple language personas can be active simultaneously (e.g., both `python-quality` and `typescript-quality` if the diff touches both).
+4. **For CE conditional agents**, spawn when the diff includes migration files (`db/migrate/*.rb`, `db/schema.rb`) or data backfill scripts.
+5. **Announce the team** before spawning with a one-line justification per conditional reviewer selected.
diff --git a/plugins/compound-engineering/skills/ce-review/references/review-output-template.md b/plugins/compound-engineering/skills/ce-review/references/review-output-template.md
new file mode 100644
index 0000000..a2ca65c
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-review/references/review-output-template.md
@@ -0,0 +1,115 @@
+# Code Review Output Template
+
+Use this **exact format** when presenting synthesized review findings. Findings are grouped by severity, not by reviewer.
+
+**IMPORTANT:** Use pipe-delimited markdown tables (`| col | col |`). Do NOT use ASCII box-drawing characters.
+
+## Example
+
+```markdown
+## Code Review Results
+
+**Scope:** merge-base with the review base branch -> working tree (14 files, 342 lines)
+**Intent:** Add order export endpoint with CSV and JSON format support
+**Mode:** autofix
+
+**Reviewers:** correctness, testing, maintainability, security, api-contract
+- security -- new public endpoint accepts user-provided format parameter
+- api-contract -- new /api/orders/export route with response schema
+
+### P0 -- Critical
+
+| # | File | Issue | Reviewer | Confidence | Route |
+|---|------|-------|----------|------------|-------|
+| 1 | `orders_controller.rb:42` | User-supplied ID in account lookup without ownership check | security | 0.92 | `gated_auto -> downstream-resolver` |
+
+### P1 -- High
+
+| # | File | Issue | Reviewer | Confidence | Route |
+|---|------|-------|----------|------------|-------|
+| 2 | `export_service.rb:87` | Loads all orders into memory -- unbounded for large accounts | performance | 0.85 | `safe_auto -> review-fixer` |
+| 3 | `export_service.rb:91` | No pagination -- response size grows linearly with order count | api-contract, performance | 0.80 | `manual -> downstream-resolver` |
+
+### P2 -- Moderate
+
+| # | File | Issue | Reviewer | Confidence | Route |
+|---|------|-------|----------|------------|-------|
+| 4 | `export_service.rb:45` | Missing error handling for CSV serialization failure | correctness | 0.75 | `safe_auto -> review-fixer` |
+
+### P3 -- Low
+
+| # | File | Issue | Reviewer | Confidence | Route |
+|---|------|-------|----------|------------|-------|
+| 5 | `export_helper.rb:12` | Format detection could use early return instead of nested conditional | maintainability | 0.70 | `advisory -> human` |
+
+### Applied Fixes
+
+- `safe_auto`: Added bounded export pagination guard and CSV serialization failure test coverage in this run
+
+### Residual Actionable Work
+
+| # | File | Issue | Route | Next Step |
+|---|------|-------|-------|-----------|
+| 1 | `orders_controller.rb:42` | Ownership check missing on export lookup | `gated_auto -> downstream-resolver` | Create residual todo and require explicit approval before behavior change |
+| 2 | `export_service.rb:91` | Pagination contract needs a broader API decision | `manual -> downstream-resolver` | Create residual todo with contract and client impact details |
+
+### Pre-existing Issues
+
+| # | File | Issue | Reviewer |
+|---|------|-------|----------|
+| 1 | `orders_controller.rb:12` | Broad rescue masking failed permission check | correctness |
+
+### Learnings & Past Solutions
+
+- [Known Pattern] `docs/solutions/export-pagination.md` -- previous export pagination fix applies to this endpoint
+
+### Agent-Native Gaps
+
+- New export endpoint has no CLI/agent equivalent -- agent users cannot trigger exports
+
+### Schema Drift Check
+
+- Clean: schema.rb changes match the migrations in scope
+
+### Deployment Notes
+
+- Pre-deploy: capture baseline row counts before enabling the export backfill
+- Verify: `SELECT COUNT(*) FROM exports WHERE status IS NULL;` should stay at `0`
+- Rollback: keep the old export path available until the backfill has been validated
+
+### Coverage
+
+- Suppressed: 2 findings below 0.60 confidence
+- Residual risks: No rate limiting on export endpoint
+- Testing gaps: No test for concurrent export requests
+
+---
+
+> **Verdict:** Ready with fixes
+>
+> **Reasoning:** 1 critical auth bypass must be fixed. The memory/pagination issues (P1) should be addressed for production safety.
+>
+> **Fix order:** P0 auth bypass -> P1 memory/pagination -> P2 error handling if straightforward
+```
+
+## Formatting Rules
+
+- **Pipe-delimited markdown tables** -- never ASCII box-drawing characters
+- **Severity-grouped sections** -- `### P0 -- Critical`, `### P1 -- High`, `### P2 -- Moderate`, `### P3 -- Low`. Omit empty severity levels.
+- **Always include file:line location** for code review issues
+- **Reviewer column** shows which persona(s) flagged the issue. Multiple reviewers = cross-reviewer agreement.
+- **Confidence column** shows the finding's confidence score
+- **Route column** shows the synthesized handling decision as `` -> ``.
+- **Header includes** scope, intent, and reviewer team with per-conditional justifications
+- **Mode line** -- include `interactive`, `autofix`, or `report-only`
+- **Applied Fixes section** -- include only when a fix phase ran in this review invocation
+- **Residual Actionable Work section** -- include only when unresolved actionable findings were handed off for later work
+- **Pre-existing section** -- separate table, no confidence column (these are informational)
+- **Learnings & Past Solutions section** -- results from learnings-researcher, with links to docs/solutions/ files
+- **Agent-Native Gaps section** -- results from agent-native-reviewer. Omit if no gaps found.
+- **Schema Drift Check section** -- results from schema-drift-detector. Omit if the agent did not run.
+- **Deployment Notes section** -- key checklist items from deployment-verification-agent. Omit if the agent did not run.
+- **Coverage section** -- suppressed count, residual risks, testing gaps, failed reviewers
+- **Summary uses blockquotes** for verdict, reasoning, and fix order
+- **Horizontal rule** (`---`) separates findings from verdict
+- **`###` headers** for each section -- never plain text headers
diff --git a/plugins/compound-engineering/skills/ce-review/references/subagent-template.md b/plugins/compound-engineering/skills/ce-review/references/subagent-template.md
new file mode 100644
index 0000000..bc4f367
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-review/references/subagent-template.md
@@ -0,0 +1,56 @@
+# Sub-agent Prompt Template
+
+This template is used by the orchestrator to spawn each reviewer sub-agent. Variable substitution slots are filled at spawn time.
+
+---
+
+## Template
+
+```
+You are a specialist code reviewer.
+
+
+{persona_file}
+
+
+
+{diff_scope_rules}
+
+
+
+Return ONLY valid JSON matching the findings schema below. No prose, no markdown, no explanation outside the JSON object.
+
+{schema}
+
+Rules:
+- Suppress any finding below your stated confidence floor (see your Confidence calibration section).
+- Every finding MUST include at least one evidence item grounded in the actual code.
+- Set pre_existing to true ONLY for issues in unchanged code that are unrelated to this diff. If the diff makes the issue newly relevant, it is NOT pre-existing.
+- You are operationally read-only. You may use non-mutating inspection commands, including read-oriented `git` / `gh` commands, to gather evidence. Do not edit files, change branches, commit, push, create PRs, or otherwise mutate the checkout or repository state.
+- Set `autofix_class` conservatively. Use `safe_auto` only when the fix is local, deterministic, and low-risk. Use `gated_auto` when a concrete fix exists but changes behavior/contracts/permissions. Use `manual` for actionable residual work. Use `advisory` for report-only items that should not become code-fix work.
+- Set `owner` to the default next actor for this finding: `review-fixer`, `downstream-resolver`, `human`, or `release`.
+- Set `requires_verification` to true whenever the likely fix needs targeted tests, a focused re-review, or operational validation before it should be trusted.
+- suggested_fix is optional. Only include it when the fix is obvious and correct. A bad suggestion is worse than none.
+- If you find no issues, return an empty findings array. Still populate residual_risks and testing_gaps if applicable.
+
+
+
+Intent: {intent_summary}
+
+Changed files: {file_list}
+
+Diff:
+{diff}
+
+```
+
+## Variable Reference
+
+| Variable | Source | Description |
+|----------|--------|-------------|
+| `{persona_file}` | Agent markdown file content | The full persona definition (identity, failure modes, calibration, suppress conditions) |
+| `{diff_scope_rules}` | `references/diff-scope.md` content | Primary/secondary/pre-existing tier rules |
+| `{schema}` | `references/findings-schema.json` content | The JSON schema reviewers must conform to |
+| `{intent_summary}` | Stage 2 output | 2-3 line description of what the change is trying to accomplish |
+| `{file_list}` | Stage 1 output | List of changed files from the scope step |
+| `{diff}` | Stage 1 output | The actual diff content to review |
diff --git a/plugins/compound-engineering/skills/ce-work-beta/SKILL.md b/plugins/compound-engineering/skills/ce-work-beta/SKILL.md
new file mode 100644
index 0000000..0d2694c
--- /dev/null
+++ b/plugins/compound-engineering/skills/ce-work-beta/SKILL.md
@@ -0,0 +1,564 @@
+---
+name: ce:work-beta
+description: "[BETA] Execute work plans with external delegate support. Same as ce:work but includes experimental Codex delegation mode for token-conserving code implementation."
+argument-hint: "[plan file, specification, or todo file path]"
+disable-model-invocation: true
+---
+
+# Work Plan Execution Command
+
+Execute a work plan efficiently while maintaining quality and finishing features.
+
+## Introduction
+
+This command takes a work document (plan, specification, or todo file) and executes it systematically. The focus is on **shipping complete features** by understanding requirements quickly, following existing patterns, and maintaining quality throughout.
+
+## Input Document
+
+ #$ARGUMENTS
+
+## Execution Workflow
+
+### Phase 1: Quick Start
+
+1. **Read Plan and Clarify**
+
+ - Read the work document completely
+ - Treat the plan as a decision artifact, not an execution script
+ - If the plan includes sections such as `Implementation Units`, `Work Breakdown`, `Requirements Trace`, `Files`, `Test Scenarios`, or `Verification`, use those as the primary source material for execution
+ - Check for `Execution note` on each implementation unit — these carry the plan's execution posture signal for that unit (for example, test-first or characterization-first). Note them when creating tasks.
+ - Check for a `Deferred to Implementation` or `Implementation-Time Unknowns` section — these are questions the planner intentionally left for you to resolve during execution. Note them before starting so they inform your approach rather than surprising you mid-task
+ - Check for a `Scope Boundaries` section — these are explicit non-goals. Refer back to them if implementation starts pulling you toward adjacent work
+ - Review any references or links provided in the plan
+ - If the user explicitly asks for TDD, test-first, or characterization-first execution in this session, honor that request even if the plan has no `Execution note`
+ - If anything is unclear or ambiguous, ask clarifying questions now
+ - Get user approval to proceed
+ - **Do not skip this** - better to ask questions now than build the wrong thing
+
+2. **Setup Environment**
+
+ First, check the current branch:
+
+ ```bash
+ current_branch=$(git branch --show-current)
+ default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
+
+ # Fallback if remote HEAD isn't set
+ if [ -z "$default_branch" ]; then
+ default_branch=$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo "main" || echo "master")
+ fi
+ ```
+
+ **If already on a feature branch** (not the default branch):
+ - Ask: "Continue working on `[current_branch]`, or create a new branch?"
+ - If continuing, proceed to step 3
+ - If creating new, follow Option A or B below
+
+ **If on the default branch**, choose how to proceed:
+
+ **Option A: Create a new branch**
+ ```bash
+ git pull origin [default_branch]
+ git checkout -b feature-branch-name
+ ```
+ Use a meaningful name based on the work (e.g., `feat/user-authentication`, `fix/email-validation`).
+
+ **Option B: Use a worktree (recommended for parallel development)**
+ ```bash
+ skill: git-worktree
+ # The skill will create a new branch from the default branch in an isolated worktree
+ ```
+
+ **Option C: Continue on the default branch**
+ - Requires explicit user confirmation
+ - Only proceed after user explicitly says "yes, commit to [default_branch]"
+ - Never commit directly to the default branch without explicit permission
+
+ **Recommendation**: Use worktree if:
+ - You want to work on multiple features simultaneously
+ - You want to keep the default branch clean while experimenting
+ - You plan to switch between branches frequently
+
+3. **Create Todo List**
+ - Use your available task tracking tool (e.g., TodoWrite, task lists) to break the plan into actionable tasks
+ - Derive tasks from the plan's implementation units, dependencies, files, test targets, and verification criteria
+ - Carry each unit's `Execution note` into the task when present
+ - For each unit, read the `Patterns to follow` field before implementing — these point to specific files or conventions to mirror
+ - Use each unit's `Verification` field as the primary "done" signal for that task
+ - Do not expect the plan to contain implementation code, micro-step TDD instructions, or exact shell commands
+ - Include dependencies between tasks
+ - Prioritize based on what needs to be done first
+ - Include testing and quality check tasks
+ - Keep tasks specific and completable
+
+4. **Choose Execution Strategy**
+
+ After creating the task list, decide how to execute based on the plan's size and dependency structure:
+
+ | Strategy | When to use |
+ |----------|-------------|
+ | **Inline** | 1-2 small tasks, or tasks needing user interaction mid-flight |
+ | **Serial subagents** | 3+ tasks with dependencies between them. Each subagent gets a fresh context window focused on one unit — prevents context degradation across many tasks |
+ | **Parallel subagents** | 3+ tasks where some units have no shared dependencies and touch non-overlapping files. Dispatch independent units simultaneously, run dependent units after their prerequisites complete |
+
+ **Subagent dispatch** uses your available subagent or task spawning mechanism. For each unit, give the subagent:
+ - The full plan file path (for overall context)
+ - The specific unit's Goal, Files, Approach, Execution note, Patterns, Test scenarios, and Verification
+ - Any resolved deferred questions relevant to that unit
+
+ After each subagent completes, update the plan checkboxes and task list before dispatching the next dependent unit.
+
+ For genuinely large plans needing persistent inter-agent communication (agents challenging each other's approaches, shared coordination across 10+ tasks), see Swarm Mode below which uses Agent Teams.
+
+### Phase 2: Execute
+
+1. **Task Execution Loop**
+
+ For each task in priority order:
+
+ ```
+ while (tasks remain):
+ - Mark task as in-progress
+ - Read any referenced files from the plan
+ - Look for similar patterns in codebase
+ - Implement following existing conventions
+ - Write tests for new functionality
+ - Run System-Wide Test Check (see below)
+ - Run tests after changes
+ - Mark task as completed
+ - Evaluate for incremental commit (see below)
+ ```
+
+ When a unit carries an `Execution note`, honor it. For test-first units, write the failing test before implementation for that unit. For characterization-first units, capture existing behavior before changing it. For units without an `Execution note`, proceed pragmatically.
+
+ Guardrails for execution posture:
+ - Do not write the test and implementation in the same step when working test-first
+ - Do not skip verifying that a new test fails before implementing the fix or feature
+ - Do not over-implement beyond the current behavior slice when working test-first
+ - Skip test-first discipline for trivial renames, pure configuration, and pure styling work
+
+ **System-Wide Test Check** — Before marking a task done, pause and ask:
+
+ | Question | What to do |
+ |----------|------------|
+ | **What fires when this runs?** Callbacks, middleware, observers, event handlers — trace two levels out from your change. | Read the actual code (not docs) for callbacks on models you touch, middleware in the request chain, `after_*` hooks. |
+ | **Do my tests exercise the real chain?** If every dependency is mocked, the test proves your logic works *in isolation* — it says nothing about the interaction. | Write at least one integration test that uses real objects through the full callback/middleware chain. No mocks for the layers that interact. |
+ | **Can failure leave orphaned state?** If your code persists state (DB row, cache, file) before calling an external service, what happens when the service fails? Does retry create duplicates? | Trace the failure path with real objects. If state is created before the risky call, test that failure cleans up or that retry is idempotent. |
+ | **What other interfaces expose this?** Mixins, DSLs, alternative entry points (Agent vs Chat vs ChatMethods). | Grep for the method/behavior in related classes. If parity is needed, add it now — not as a follow-up. |
+ | **Do error strategies align across layers?** Retry middleware + application fallback + framework error handling — do they conflict or create double execution? | List the specific error classes at each layer. Verify your rescue list matches what the lower layer actually raises. |
+
+ **When to skip:** Leaf-node changes with no callbacks, no state persistence, no parallel interfaces. If the change is purely additive (new helper method, new view partial), the check takes 10 seconds and the answer is "nothing fires, skip."
+
+ **When this matters most:** Any change that touches models with callbacks, error handling with fallback/retry, or functionality exposed through multiple interfaces.
+
+
+2. **Incremental Commits**
+
+ After completing each task, evaluate whether to create an incremental commit:
+
+ | Commit when... | Don't commit when... |
+ |----------------|---------------------|
+ | Logical unit complete (model, service, component) | Small part of a larger unit |
+ | Tests pass + meaningful progress | Tests failing |
+ | About to switch contexts (backend → frontend) | Purely scaffolding with no behavior |
+ | About to attempt risky/uncertain changes | Would need a "WIP" commit message |
+
+ **Heuristic:** "Can I write a commit message that describes a complete, valuable change? If yes, commit. If the message would be 'WIP' or 'partial X', wait."
+
+ If the plan has Implementation Units, use them as a starting guide for commit boundaries — but adapt based on what you find during implementation. A unit might need multiple commits if it's larger than expected, or small related units might land together. Use each unit's Goal to inform the commit message.
+
+ **Commit workflow:**
+ ```bash
+ # 1. Verify tests pass (use project's test command)
+ # Examples: bin/rails test, npm test, pytest, go test, etc.
+
+ # 2. Stage only files related to this logical unit (not `git add .`)
+ git add
+
+ # 3. Commit with conventional message
+ git commit -m "feat(scope): description of this unit"
+ ```
+
+ **Handling merge conflicts:** If conflicts arise during rebasing or merging, resolve them immediately. Incremental commits make conflict resolution easier since each commit is small and focused.
+
+ **Note:** Incremental commits use clean conventional messages without attribution footers. The final Phase 4 commit/PR includes the full attribution.
+
+3. **Follow Existing Patterns**
+
+ - The plan should reference similar code - read those files first
+ - Match naming conventions exactly
+ - Reuse existing components where possible
+ - Follow project coding standards (see AGENTS.md; use CLAUDE.md only if the repo still keeps a compatibility shim)
+ - When in doubt, grep for similar implementations
+
+4. **Test Continuously**
+
+ - Run relevant tests after each significant change
+ - Don't wait until the end to test
+ - Fix failures immediately
+ - Add new tests for new functionality
+ - **Unit tests with mocks prove logic in isolation. Integration tests with real objects prove the layers work together.** If your change touches callbacks, middleware, or error handling — you need both.
+
+5. **Simplify as You Go**
+
+ After completing a cluster of related implementation units (or every 2-3 units), review recently changed files for simplification opportunities — consolidate duplicated patterns, extract shared helpers, and improve code reuse and efficiency. This is especially valuable when using subagents, since each agent works with isolated context and can't see patterns emerging across units.
+
+ Don't simplify after every single unit — early patterns may look duplicated but diverge intentionally in later units. Wait for a natural phase boundary or when you notice accumulated complexity.
+
+ If a `/simplify` skill or equivalent is available, use it. Otherwise, review the changed files yourself for reuse and consolidation opportunities.
+
+6. **Figma Design Sync** (if applicable)
+
+ For UI work with Figma designs:
+
+ - Implement components following design specs
+ - Use figma-design-sync agent iteratively to compare
+ - Fix visual differences identified
+ - Repeat until implementation matches design
+
+7. **Frontend Design Guidance** (if applicable)
+
+ For UI tasks without a Figma design -- where the implementation touches view, template, component, layout, or page files, creates user-visible routes, or the plan contains explicit UI/frontend/design language:
+
+ - Load the `frontend-design` skill before implementing
+ - Follow its detection, guidance, and verification flow
+ - If the skill produced a verification screenshot, it satisfies Phase 4's screenshot requirement -- no need to capture separately. If the skill fell back to mental review (no browser access), Phase 4's screenshot capture still applies
+
+8. **Track Progress**
+ - Keep the task list updated as you complete tasks
+ - Note any blockers or unexpected discoveries
+ - Create new tasks if scope expands
+ - Keep user informed of major milestones
+
+### Phase 3: Quality Check
+
+1. **Run Core Quality Checks**
+
+ Always run before submitting:
+
+ ```bash
+ # Run full test suite (use project's test command)
+ # Examples: bin/rails test, npm test, pytest, go test, etc.
+
+ # Run linting (per AGENTS.md)
+ # Use linting-agent before pushing to origin
+ ```
+
+2. **Consider Reviewer Agents** (Optional)
+
+ Use for complex, risky, or large changes. Read agents from `compound-engineering.local.md` frontmatter (`review_agents`). If no settings file, invoke the `setup` skill to create one.
+
+ Run configured agents in parallel with Task tool. Present findings and address critical issues.
+
+3. **Final Validation**
+ - All tasks marked completed
+ - All tests pass
+ - Linting passes
+ - Code follows existing patterns
+ - Figma designs match (if applicable)
+ - No console errors or warnings
+ - If the plan has a `Requirements Trace`, verify each requirement is satisfied by the completed work
+ - If any `Deferred to Implementation` questions were noted, confirm they were resolved during execution
+
+4. **Prepare Operational Validation Plan** (REQUIRED)
+ - Add a `## Post-Deploy Monitoring & Validation` section to the PR description for every change.
+ - Include concrete:
+ - Log queries/search terms
+ - Metrics or dashboards to watch
+ - Expected healthy signals
+ - Failure signals and rollback/mitigation trigger
+ - Validation window and owner
+ - If there is truly no production/runtime impact, still include the section with: `No additional operational monitoring required` and a one-line reason.
+
+### Phase 4: Ship It
+
+1. **Create Commit**
+
+ ```bash
+ git add .
+ git status # Review what's being committed
+ git diff --staged # Check the changes
+
+ # Commit with conventional format
+ git commit -m "$(cat <<'EOF'
+ feat(scope): description of what and why
+
+ Brief explanation if needed.
+
+ 🤖 Generated with [MODEL] via [HARNESS](HARNESS_URL) + Compound Engineering v[VERSION]
+
+ Co-Authored-By: [MODEL] ([CONTEXT] context, [THINKING])
+ EOF
+ )"
+ ```
+
+ **Fill in at commit/PR time:**
+
+ | Placeholder | Value | Example |
+ |-------------|-------|---------|
+ | Placeholder | Value | Example |
+ |-------------|-------|---------|
+ | `[MODEL]` | Model name | Claude Opus 4.6, GPT-5.4 |
+ | `[CONTEXT]` | Context window (if known) | 200K, 1M |
+ | `[THINKING]` | Thinking level (if known) | extended thinking |
+ | `[HARNESS]` | Tool running you | Claude Code, Codex, Gemini CLI |
+ | `[HARNESS_URL]` | Link to that tool | `https://claude.com/claude-code` |
+ | `[VERSION]` | `plugin.json` → `version` | 2.40.0 |
+
+ Subagents creating commits/PRs are equally responsible for accurate attribution.
+
+2. **Capture and Upload Screenshots for UI Changes** (REQUIRED for any UI work)
+
+ For **any** design changes, new views, or UI modifications, you MUST capture and upload screenshots:
+
+ **Step 1: Start dev server** (if not running)
+ ```bash
+ bin/dev # Run in background
+ ```
+
+ **Step 2: Capture screenshots with agent-browser CLI**
+ ```bash
+ agent-browser open http://localhost:3000/[route]
+ agent-browser snapshot -i
+ agent-browser screenshot output.png
+ ```
+ See the `agent-browser` skill for detailed usage.
+
+ **Step 3: Upload using imgup skill**
+ ```bash
+ skill: imgup
+ # Then upload each screenshot:
+ imgup -h pixhost screenshot.png # pixhost works without API key
+ # Alternative hosts: catbox, imagebin, beeimg
+ ```
+
+ **What to capture:**
+ - **New screens**: Screenshot of the new UI
+ - **Modified screens**: Before AND after screenshots
+ - **Design implementation**: Screenshot showing Figma design match
+
+ **IMPORTANT**: Always include uploaded image URLs in PR description. This provides visual context for reviewers and documents the change.
+
+3. **Create Pull Request**
+
+ ```bash
+ git push -u origin feature-branch-name
+
+ gh pr create --title "Feature: [Description]" --body "$(cat <<'EOF'
+ ## Summary
+ - What was built
+ - Why it was needed
+ - Key decisions made
+
+ ## Testing
+ - Tests added/modified
+ - Manual testing performed
+
+ ## Post-Deploy Monitoring & Validation
+ - **What to monitor/search**
+ - Logs:
+ - Metrics/Dashboards:
+ - **Validation checks (queries/commands)**
+ - `command or query here`
+ - **Expected healthy behavior**
+ - Expected signal(s)
+ - **Failure signal(s) / rollback trigger**
+ - Trigger + immediate action
+ - **Validation window & owner**
+ - Window:
+ - Owner:
+ - **If no operational impact**
+ - `No additional operational monitoring required: `
+
+ ## Before / After Screenshots
+ | Before | After |
+ |--------|-------|
+ |  |  |
+
+ ## Figma Design
+ [Link if applicable]
+
+ ---
+
+ [![Compound Engineering v[VERSION]](https://img.shields.io/badge/Compound_Engineering-v[VERSION]-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
+ 🤖 Generated with [MODEL] ([CONTEXT] context, [THINKING]) via [HARNESS](HARNESS_URL)
+ EOF
+ )"
+ ```
+
+4. **Update Plan Status**
+
+ If the input document has YAML frontmatter with a `status` field, update it to `completed`:
+ ```
+ status: active → status: completed
+ ```
+
+5. **Notify User**
+ - Summarize what was completed
+ - Link to PR
+ - Note any follow-up work needed
+ - Suggest next steps if applicable
+
+---
+
+## Swarm Mode with Agent Teams (Optional)
+
+For genuinely large plans where agents need to communicate with each other, challenge approaches, or coordinate across 10+ tasks with persistent specialized roles, use agent team capabilities if available (e.g., Agent Teams in Claude Code, multi-agent workflows in Codex).
+
+**Agent teams are typically experimental and require opt-in.** Do not attempt to use agent teams unless the user explicitly requests swarm mode or agent teams, and the platform supports it.
+
+### When to Use Agent Teams vs Subagents
+
+| Agent Teams | Subagents (standard mode) |
+|-------------|---------------------------|
+| Agents need to discuss and challenge each other's approaches | Each task is independent — only the result matters |
+| Persistent specialized roles (e.g., dedicated tester running continuously) | Workers report back and finish |
+| 10+ tasks with complex cross-cutting coordination | 3-8 tasks with clear dependency chains |
+| User explicitly requests "swarm mode" or "agent teams" | Default for most plans |
+
+Most plans should use subagent dispatch from standard mode. Agent teams add significant token cost and coordination overhead — use them when the inter-agent communication genuinely improves the outcome.
+
+### Agent Teams Workflow
+
+1. **Create team** — use your available team creation mechanism
+2. **Create task list** — parse Implementation Units into tasks with dependency relationships
+3. **Spawn teammates** — assign specialized roles (implementer, tester, reviewer) based on the plan's needs. Give each teammate the plan file path and their specific task assignments
+4. **Coordinate** — the lead monitors task completion, reassigns work if someone gets stuck, and spawns additional workers as phases unblock
+5. **Cleanup** — shut down all teammates, then clean up the team resources
+
+---
+
+## External Delegate Mode (Optional)
+
+For plans where token conservation matters, delegate code implementation to an external delegate (currently Codex CLI) while keeping planning, review, and git operations in the current agent.
+
+This mode integrates with the existing Phase 1 Step 4 strategy selection as a **task-level modifier** - the strategy (inline/serial/parallel) still applies, but the implementation step within each tagged task delegates to the external tool instead of executing directly.
+
+### When to Use External Delegation
+
+| External Delegation | Standard Mode |
+|---------------------|---------------|
+| Task is pure code implementation | Task requires research or exploration |
+| Plan has clear acceptance criteria | Task is ambiguous or needs iteration |
+| Token conservation matters (e.g., Max20 plan) | Unlimited plan or small task |
+| Files to change are well-scoped | Changes span many interconnected files |
+
+### Enabling External Delegation
+
+External delegation activates when any of these conditions are met:
+- The user says "use codex for this work", "delegate to codex", or "delegate mode"
+- A plan implementation unit contains `Execution target: external-delegate` in its Execution note (set by ce:plan)
+
+The specific delegate tool is resolved at execution time. Currently the only supported delegate is Codex CLI. Future delegates can be added without changing plan files.
+
+### Environment Guard
+
+Before attempting delegation, check whether the current agent is already running inside a delegate's sandbox. Delegation from within a sandbox will fail silently or recurse.
+
+Check for known sandbox indicators:
+- `CODEX_SANDBOX` environment variable is set
+- `CODEX_SESSION_ID` environment variable is set
+- The filesystem is read-only at `.git/` (Codex sandbox blocks git writes)
+
+If any indicator is detected, print "Already running inside a delegate sandbox - using standard mode." and proceed with standard execution for that task.
+
+### External Delegation Workflow
+
+When external delegation is active, follow this workflow for each tagged task. Do not skip delegation because a task seems "small", "simple", or "faster inline". The user or plan explicitly requested delegation.
+
+1. **Check availability**
+
+ Verify the delegate CLI is installed. If not found, print "Delegate CLI not installed - continuing with standard mode." and proceed normally.
+
+2. **Build prompt** — For each task, assemble a prompt from the plan's implementation unit (Goal, Files, Approach, Conventions from `compound-engineering.local.md`). Include rules: no git commits, no PRs, run `git status` and `git diff --stat` when done. Never embed credentials or tokens in the prompt - pass auth through environment variables.
+
+3. **Write prompt to file** — Save the assembled prompt to a unique temporary file to avoid shell quoting issues and cross-task races. Use a unique filename per task.
+
+4. **Delegate** — Run the delegate CLI, piping the prompt file via stdin (not argv expansion, which hits `ARG_MAX` on large prompts). Omit the model flag to use the delegate's default model, which stays current without manual updates.
+
+5. **Review diff** — After the delegate finishes, verify the diff is non-empty and in-scope. Run the project's test/lint commands. If the diff is empty or out-of-scope, fall back to standard mode for that task.
+
+6. **Commit** — The current agent handles all git operations. The delegate's sandbox blocks `.git/index.lock` writes, so the delegate cannot commit. Stage changes and commit with a conventional message.
+
+7. **Error handling** — On any delegate failure (rate limit, error, empty diff), fall back to standard mode for that task. Track consecutive failures - after 3 consecutive failures, disable delegation for remaining tasks and print "Delegate disabled after 3 consecutive failures - completing remaining tasks in standard mode."
+
+### Mixed-Model Attribution
+
+When some tasks are executed by the delegate and others by the current agent, use the following attribution in Phase 4:
+
+- If all tasks used the delegate: attribute to the delegate model
+- If all tasks used standard mode: attribute to the current agent's model
+- If mixed: use `Generated with [CURRENT_MODEL] + [DELEGATE_MODEL] via [HARNESS]` and note which tasks were delegated in the PR description
+
+---
+
+## Key Principles
+
+### Start Fast, Execute Faster
+
+- Get clarification once at the start, then execute
+- Don't wait for perfect understanding - ask questions and move
+- The goal is to **finish the feature**, not create perfect process
+
+### The Plan is Your Guide
+
+- Work documents should reference similar code and patterns
+- Load those references and follow them
+- Don't reinvent - match what exists
+
+### Test As You Go
+
+- Run tests after each change, not at the end
+- Fix failures immediately
+- Continuous testing prevents big surprises
+
+### Quality is Built In
+
+- Follow existing patterns
+- Write tests for new code
+- Run linting before pushing
+- Use reviewer agents for complex/risky changes only
+
+### Ship Complete Features
+
+- Mark all tasks completed before moving on
+- Don't leave features 80% done
+- A finished feature that ships beats a perfect feature that doesn't
+
+## Quality Checklist
+
+Before creating PR, verify:
+
+- [ ] All clarifying questions asked and answered
+- [ ] All tasks marked completed
+- [ ] Tests pass (run project's test command)
+- [ ] Linting passes (use linting-agent)
+- [ ] Code follows existing patterns
+- [ ] Figma designs match implementation (if applicable)
+- [ ] Before/after screenshots captured and uploaded (for UI changes)
+- [ ] Commit messages follow conventional format
+- [ ] PR description includes Post-Deploy Monitoring & Validation section (or explicit no-impact rationale)
+- [ ] PR description includes summary, testing notes, and screenshots
+- [ ] PR description includes Compound Engineered badge with accurate model, harness, and version
+
+## When to Use Reviewer Agents
+
+**Don't use by default.** Use reviewer agents only when:
+
+- Large refactor affecting many files (10+)
+- Security-sensitive changes (authentication, permissions, data access)
+- Performance-critical code paths
+- Complex algorithms or business logic
+- User explicitly requests thorough review
+
+For most features: tests + linting + following patterns is sufficient.
+
+## Common Pitfalls to Avoid
+
+- **Analysis paralysis** - Don't overthink, read the plan and execute
+- **Skipping clarifying questions** - Ask now, not after building wrong thing
+- **Ignoring plan references** - The plan has links for a reason
+- **Testing at the end** - Test continuously or suffer later
+- **Forgetting to track progress** - Update task status as you go or lose track of what's done
+- **80% done syndrome** - Finish the feature, don't move on early
+- **Over-reviewing simple changes** - Save reviewer agents for complex work
diff --git a/plugins/compound-engineering/skills/ce-work/SKILL.md b/plugins/compound-engineering/skills/ce-work/SKILL.md
index 3e09c43..2393005 100644
--- a/plugins/compound-engineering/skills/ce-work/SKILL.md
+++ b/plugins/compound-engineering/skills/ce-work/SKILL.md
@@ -23,7 +23,13 @@ This command takes a work document (plan, specification, or todo file) and execu
1. **Read Plan and Clarify**
- Read the work document completely
+ - Treat the plan as a decision artifact, not an execution script
+ - If the plan includes sections such as `Implementation Units`, `Work Breakdown`, `Requirements Trace`, `Files`, `Test Scenarios`, or `Verification`, use those as the primary source material for execution
+ - Check for `Execution note` on each implementation unit — these carry the plan's execution posture signal for that unit (for example, test-first or characterization-first). Note them when creating tasks.
+ - Check for a `Deferred to Implementation` or `Implementation-Time Unknowns` section — these are questions the planner intentionally left for you to resolve during execution. Note them before starting so they inform your approach rather than surprising you mid-task
+ - Check for a `Scope Boundaries` section — these are explicit non-goals. Refer back to them if implementation starts pulling you toward adjacent work
- Review any references or links provided in the plan
+ - If the user explicitly asks for TDD, test-first, or characterization-first execution in this session, honor that request even if the plan has no `Execution note`
- If anything is unclear or ambiguous, ask clarifying questions now
- Get user approval to proceed
- **Do not skip this** - better to ask questions now than build the wrong thing
@@ -73,12 +79,36 @@ This command takes a work document (plan, specification, or todo file) and execu
- You plan to switch between branches frequently
3. **Create Todo List**
- - Use TodoWrite to break plan into actionable tasks
+ - Use your available task tracking tool (e.g., TodoWrite, task lists) to break the plan into actionable tasks
+ - Derive tasks from the plan's implementation units, dependencies, files, test targets, and verification criteria
+ - Carry each unit's `Execution note` into the task when present
+ - For each unit, read the `Patterns to follow` field before implementing — these point to specific files or conventions to mirror
+ - Use each unit's `Verification` field as the primary "done" signal for that task
+ - Do not expect the plan to contain implementation code, micro-step TDD instructions, or exact shell commands
- Include dependencies between tasks
- Prioritize based on what needs to be done first
- Include testing and quality check tasks
- Keep tasks specific and completable
+4. **Choose Execution Strategy**
+
+ After creating the task list, decide how to execute based on the plan's size and dependency structure:
+
+ | Strategy | When to use |
+ |----------|-------------|
+ | **Inline** | 1-2 small tasks, or tasks needing user interaction mid-flight |
+ | **Serial subagents** | 3+ tasks with dependencies between them. Each subagent gets a fresh context window focused on one unit — prevents context degradation across many tasks |
+ | **Parallel subagents** | 3+ tasks where some units have no shared dependencies and touch non-overlapping files. Dispatch independent units simultaneously, run dependent units after their prerequisites complete |
+
+ **Subagent dispatch** uses your available subagent or task spawning mechanism. For each unit, give the subagent:
+ - The full plan file path (for overall context)
+ - The specific unit's Goal, Files, Approach, Execution note, Patterns, Test scenarios, and Verification
+ - Any resolved deferred questions relevant to that unit
+
+ After each subagent completes, update the plan checkboxes and task list before dispatching the next dependent unit.
+
+ For genuinely large plans needing persistent inter-agent communication (agents challenging each other's approaches, shared coordination across 10+ tasks), see Swarm Mode below which uses Agent Teams.
+
### Phase 2: Execute
1. **Task Execution Loop**
@@ -87,18 +117,25 @@ This command takes a work document (plan, specification, or todo file) and execu
```
while (tasks remain):
- - Mark task as in_progress in TodoWrite
+ - Mark task as in-progress
- Read any referenced files from the plan
- Look for similar patterns in codebase
- Implement following existing conventions
- Write tests for new functionality
- Run System-Wide Test Check (see below)
- Run tests after changes
- - Mark task as completed in TodoWrite
- - Mark off the corresponding checkbox in the plan file ([ ] → [x])
+ - Mark task as completed
- Evaluate for incremental commit (see below)
```
+ When a unit carries an `Execution note`, honor it. For test-first units, write the failing test before implementation for that unit. For characterization-first units, capture existing behavior before changing it. For units without an `Execution note`, proceed pragmatically.
+
+ Guardrails for execution posture:
+ - Do not write the test and implementation in the same step when working test-first
+ - Do not skip verifying that a new test fails before implementing the fix or feature
+ - Do not over-implement beyond the current behavior slice when working test-first
+ - Skip test-first discipline for trivial renames, pure configuration, and pure styling work
+
**System-Wide Test Check** — Before marking a task done, pause and ask:
| Question | What to do |
@@ -113,7 +150,6 @@ This command takes a work document (plan, specification, or todo file) and execu
**When this matters most:** Any change that touches models with callbacks, error handling with fallback/retry, or functionality exposed through multiple interfaces.
- **IMPORTANT**: Always update the original plan document by checking off completed items. Use the Edit tool to change `- [ ]` to `- [x]` for each task you finish. This keeps the plan as a living document showing progress and ensures no checkboxes are left unchecked.
2. **Incremental Commits**
@@ -128,6 +164,8 @@ This command takes a work document (plan, specification, or todo file) and execu
**Heuristic:** "Can I write a commit message that describes a complete, valuable change? If yes, commit. If the message would be 'WIP' or 'partial X', wait."
+ If the plan has Implementation Units, use them as a starting guide for commit boundaries — but adapt based on what you find during implementation. A unit might need multiple commits if it's larger than expected, or small related units might land together. Use each unit's Goal to inform the commit message.
+
**Commit workflow:**
```bash
# 1. Verify tests pass (use project's test command)
@@ -149,7 +187,7 @@ This command takes a work document (plan, specification, or todo file) and execu
- The plan should reference similar code - read those files first
- Match naming conventions exactly
- Reuse existing components where possible
- - Follow project coding standards (see CLAUDE.md)
+ - Follow project coding standards (see AGENTS.md; use CLAUDE.md only if the repo still keeps a compatibility shim)
- When in doubt, grep for similar implementations
4. **Test Continuously**
@@ -160,7 +198,15 @@ This command takes a work document (plan, specification, or todo file) and execu
- Add new tests for new functionality
- **Unit tests with mocks prove logic in isolation. Integration tests with real objects prove the layers work together.** If your change touches callbacks, middleware, or error handling — you need both.
-5. **Figma Design Sync** (if applicable)
+5. **Simplify as You Go**
+
+ After completing a cluster of related implementation units (or every 2-3 units), review recently changed files for simplification opportunities — consolidate duplicated patterns, extract shared helpers, and improve code reuse and efficiency. This is especially valuable when using subagents, since each agent works with isolated context and can't see patterns emerging across units.
+
+ Don't simplify after every single unit — early patterns may look duplicated but diverge intentionally in later units. Wait for a natural phase boundary or when you notice accumulated complexity.
+
+ If a `/simplify` skill or equivalent is available, use it. Otherwise, review the changed files yourself for reuse and consolidation opportunities.
+
+6. **Figma Design Sync** (if applicable)
For UI work with Figma designs:
@@ -170,7 +216,7 @@ This command takes a work document (plan, specification, or todo file) and execu
- Repeat until implementation matches design
6. **Track Progress**
- - Keep TodoWrite updated as you complete tasks
+ - Keep the task list updated as you complete tasks
- Note any blockers or unexpected discoveries
- Create new tasks if scope expands
- Keep user informed of major milestones
@@ -185,7 +231,7 @@ This command takes a work document (plan, specification, or todo file) and execu
# Run full test suite (use project's test command)
# Examples: bin/rails test, npm test, pytest, go test, etc.
- # Run linting (per CLAUDE.md)
+ # Run linting (per AGENTS.md)
# Use linting-agent before pushing to origin
```
@@ -196,12 +242,14 @@ This command takes a work document (plan, specification, or todo file) and execu
Run configured agents in parallel with Task tool. Present findings and address critical issues.
3. **Final Validation**
- - All TodoWrite tasks marked completed
+ - All tasks marked completed
- All tests pass
- Linting passes
- Code follows existing patterns
- Figma designs match (if applicable)
- No console errors or warnings
+ - If the plan has a `Requirements Trace`, verify each requirement is satisfied by the completed work
+ - If any `Deferred to Implementation` questions were noted, confirm they were resolved during execution
4. **Prepare Operational Validation Plan** (REQUIRED)
- Add a `## Post-Deploy Monitoring & Validation` section to the PR description for every change.
@@ -228,13 +276,28 @@ This command takes a work document (plan, specification, or todo file) and execu
Brief explanation if needed.
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
+ 🤖 Generated with [MODEL] via [HARNESS](HARNESS_URL) + Compound Engineering v[VERSION]
- Co-Authored-By: Claude
+ Co-Authored-By: [MODEL] ([CONTEXT] context, [THINKING])
EOF
)"
```
+ **Fill in at commit/PR time:**
+
+ | Placeholder | Value | Example |
+ |-------------|-------|---------|
+ | Placeholder | Value | Example |
+ |-------------|-------|---------|
+ | `[MODEL]` | Model name | Claude Opus 4.6, GPT-5.4 |
+ | `[CONTEXT]` | Context window (if known) | 200K, 1M |
+ | `[THINKING]` | Thinking level (if known) | extended thinking |
+ | `[HARNESS]` | Tool running you | Claude Code, Codex, Gemini CLI |
+ | `[HARNESS_URL]` | Link to that tool | `https://claude.com/claude-code` |
+ | `[VERSION]` | `plugin.json` → `version` | 2.40.0 |
+
+ Subagents creating commits/PRs are equally responsible for accurate attribution.
+
2. **Capture and Upload Screenshots for UI Changes** (REQUIRED for any UI work)
For **any** design changes, new views, or UI modifications, you MUST capture and upload screenshots:
@@ -308,7 +371,8 @@ This command takes a work document (plan, specification, or todo file) and execu
---
- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
+ [![Compound Engineering v[VERSION]](https://img.shields.io/badge/Compound_Engineering-v[VERSION]-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
+ 🤖 Generated with [MODEL] ([CONTEXT] context, [THINKING]) via [HARNESS](HARNESS_URL)
EOF
)"
```
@@ -328,73 +392,30 @@ This command takes a work document (plan, specification, or todo file) and execu
---
-## Swarm Mode (Optional)
+## Swarm Mode with Agent Teams (Optional)
-For complex plans with multiple independent workstreams, enable swarm mode for parallel execution with coordinated agents.
+For genuinely large plans where agents need to communicate with each other, challenge approaches, or coordinate across 10+ tasks with persistent specialized roles, use agent team capabilities if available (e.g., Agent Teams in Claude Code, multi-agent workflows in Codex).
-### When to Use Swarm Mode
+**Agent teams are typically experimental and require opt-in.** Do not attempt to use agent teams unless the user explicitly requests swarm mode or agent teams, and the platform supports it.
-| Use Swarm Mode when... | Use Standard Mode when... |
-|------------------------|---------------------------|
-| Plan has 5+ independent tasks | Plan is linear/sequential |
-| Multiple specialists needed (review + test + implement) | Single-focus work |
-| Want maximum parallelism | Simpler mental model preferred |
-| Large feature with clear phases | Small feature or bug fix |
+### When to Use Agent Teams vs Subagents
-### Enabling Swarm Mode
+| Agent Teams | Subagents (standard mode) |
+|-------------|---------------------------|
+| Agents need to discuss and challenge each other's approaches | Each task is independent — only the result matters |
+| Persistent specialized roles (e.g., dedicated tester running continuously) | Workers report back and finish |
+| 10+ tasks with complex cross-cutting coordination | 3-8 tasks with clear dependency chains |
+| User explicitly requests "swarm mode" or "agent teams" | Default for most plans |
-To trigger swarm execution, say:
+Most plans should use subagent dispatch from standard mode. Agent teams add significant token cost and coordination overhead — use them when the inter-agent communication genuinely improves the outcome.
-> "Make a Task list and launch an army of agent swarm subagents to build the plan"
+### Agent Teams Workflow
-Or explicitly request: "Use swarm mode for this work"
-
-### Swarm Workflow
-
-When swarm mode is enabled, the workflow changes:
-
-1. **Create Team**
- ```
- Teammate({ operation: "spawnTeam", team_name: "work-{timestamp}" })
- ```
-
-2. **Create Task List with Dependencies**
- - Parse plan into TaskCreate items
- - Set up blockedBy relationships for sequential dependencies
- - Independent tasks have no blockers (can run in parallel)
-
-3. **Spawn Specialized Teammates**
- ```
- Task({
- team_name: "work-{timestamp}",
- name: "implementer",
- subagent_type: "general-purpose",
- prompt: "Claim implementation tasks, execute, mark complete",
- run_in_background: true
- })
-
- Task({
- team_name: "work-{timestamp}",
- name: "tester",
- subagent_type: "general-purpose",
- prompt: "Claim testing tasks, run tests, mark complete",
- run_in_background: true
- })
- ```
-
-4. **Coordinate and Monitor**
- - Team lead monitors task completion
- - Spawn additional workers as phases unblock
- - Handle plan approval if required
-
-5. **Cleanup**
- ```
- Teammate({ operation: "requestShutdown", target_agent_id: "implementer" })
- Teammate({ operation: "requestShutdown", target_agent_id: "tester" })
- Teammate({ operation: "cleanup" })
- ```
-
-See the `orchestrating-swarms` skill for detailed swarm patterns and best practices.
+1. **Create team** — use your available team creation mechanism
+2. **Create task list** — parse Implementation Units into tasks with dependency relationships
+3. **Spawn teammates** — assign specialized roles (implementer, tester, reviewer) based on the plan's needs. Give each teammate the plan file path and their specific task assignments
+4. **Coordinate** — the lead monitors task completion, reassigns work if someone gets stuck, and spawns additional workers as phases unblock
+5. **Cleanup** — shut down all teammates, then clean up the team resources
---
@@ -436,7 +457,7 @@ See the `orchestrating-swarms` skill for detailed swarm patterns and best practi
Before creating PR, verify:
- [ ] All clarifying questions asked and answered
-- [ ] All TodoWrite tasks marked completed
+- [ ] All tasks marked completed
- [ ] Tests pass (run project's test command)
- [ ] Linting passes (use linting-agent)
- [ ] Code follows existing patterns
@@ -445,7 +466,7 @@ Before creating PR, verify:
- [ ] Commit messages follow conventional format
- [ ] PR description includes Post-Deploy Monitoring & Validation section (or explicit no-impact rationale)
- [ ] PR description includes summary, testing notes, and screenshots
-- [ ] PR description includes Compound Engineered badge
+- [ ] PR description includes Compound Engineered badge with accurate model, harness, and version
## When to Use Reviewer Agents
@@ -465,6 +486,6 @@ For most features: tests + linting + following patterns is sufficient.
- **Skipping clarifying questions** - Ask now, not after building wrong thing
- **Ignoring plan references** - The plan has links for a reason
- **Testing at the end** - Test continuously or suffer later
-- **Forgetting TodoWrite** - Track progress or lose track of what's done
+- **Forgetting to track progress** - Update task status as you go or lose track of what's done
- **80% done syndrome** - Finish the feature, don't move on early
- **Over-reviewing simple changes** - Save reviewer agents for complex work
diff --git a/plugins/compound-engineering/skills/claude-permissions-optimizer/SKILL.md b/plugins/compound-engineering/skills/claude-permissions-optimizer/SKILL.md
new file mode 100644
index 0000000..9054e22
--- /dev/null
+++ b/plugins/compound-engineering/skills/claude-permissions-optimizer/SKILL.md
@@ -0,0 +1,160 @@
+---
+name: claude-permissions-optimizer
+context: fork
+description: Optimize Claude Code permissions by finding safe Bash commands from session history and auto-applying them to settings.json. Can run from any coding agent but targets Claude Code specifically. Use when experiencing permission fatigue, too many permission prompts, wanting to optimize permissions, or needing to set up allowlists. Triggers on "optimize permissions", "reduce permission prompts", "allowlist commands", "too many permission prompts", "permission fatigue", "permission setup", or complaints about clicking approve too often.
+---
+
+# Claude Permissions Optimizer
+
+Find safe Bash commands that are causing unnecessary permission prompts and auto-allow them in `settings.json` -- evidence-based, not prescriptive.
+
+This skill identifies commands safe to auto-allow based on actual session history. It does not handle requests to allowlist specific dangerous commands. If the user asks to allow something destructive (e.g., `rm -rf`, `git push --force`), explain that this skill optimizes for safe commands only, and that manual allowlist changes can be made directly in settings.json.
+
+## Pre-check: Confirm environment
+
+Determine whether you are currently running inside Claude Code or a different coding agent (Codex, Gemini CLI, Cursor, etc.).
+
+**If running inside Claude Code:** Proceed directly to Step 1.
+
+**If running in a different agent:** Inform the user before proceeding:
+
+> "This skill analyzes Claude Code session history and writes to Claude Code's settings.json. You're currently in [agent name], but I can still optimize your Claude Code permissions from here -- the results will apply next time you use Claude Code."
+
+Then proceed to Step 1 normally. The skill works from any environment as long as `~/.claude/` (or `$CLAUDE_CONFIG_DIR`) exists on the machine.
+
+## Step 1: Choose Analysis Scope
+
+Ask the user how broadly to analyze using the platform's blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the numbered options and wait for the user's reply.
+
+1. **All projects** (Recommended) -- sessions across every project
+2. **This project only** -- sessions for the current working directory
+3. **Custom** -- user specifies constraints (time window, session count, etc.)
+
+Default to **All projects** unless the user explicitly asks for a single project. More data produces better recommendations.
+
+## Step 2: Run Extraction Script
+
+Run the bundled script. It handles everything: loads the current allowlist, scans recent session transcripts (most recent 500 sessions or last 30 days, whichever is more restrictive), filters already-covered commands, applies a min-count threshold (5+), normalizes into `Bash(pattern)` rules, and pre-classifies each as safe/review/dangerous.
+
+**All projects:**
+```bash
+node /scripts/extract-commands.mjs
+```
+
+**This project only** -- pass the project slug (absolute path with every non-alphanumeric char replaced by `-`, e.g., `/Users/tmchow/Code/my-project` becomes `-Users-tmchow-Code-my-project`):
+```bash
+node /scripts/extract-commands.mjs --project-slug
+```
+
+Optional: `--days ` to limit to the last N days. Omit to analyze all available sessions.
+
+The output JSON has:
+- `green`: safe patterns to recommend `{ pattern, count, sessions, examples }`
+- `redExamples`: top 5 blocked dangerous patterns `{ pattern, reason, count }` (or empty)
+- `yellowFootnote`: one-line summary of frequently-used commands that aren't safe to auto-allow (or null)
+- `stats`: `totalExtracted`, `alreadyCovered`, `belowThreshold`, `patternsReturned`, `greenRawCount`, etc.
+
+The model's job is to **present** the script's output, not re-classify.
+
+If the script returns empty results, tell the user their allowlist is already well-optimized or they don't have enough session history yet -- suggest re-running after a few more working sessions.
+
+## Step 3: Present Results
+
+Present in three parts. Keep the formatting clean and scannable.
+
+### Part 1: Analysis summary
+
+Show the work done using the script's `stats`. Reaffirm the scope. Keep it to 4-5 lines.
+
+**Example:**
+```
+## Analysis (compound-engineering-plugin)
+
+Scanned **24 sessions** for this project.
+Found **312 unique Bash commands** across those sessions.
+
+- **245** already covered by your 43 existing allowlist rules (79%)
+- **61** used fewer than 5 times (filtered as noise)
+- **6 commands** remain that regularly trigger permission prompts
+```
+
+### Part 2: Recommendations
+
+Present `green` patterns as a numbered table. If `yellowFootnote` is not null, include it as a line after the table.
+
+```
+### Safe to auto-allow
+| # | Pattern | Evidence |
+|---|---------|----------|
+| 1 | `Bash(bun test *)` | 23 uses across 8 sessions |
+| 2 | `Bash(bun run *)` | 18 uses, covers dev/build/lint scripts |
+| 3 | `Bash(node *)` | 12 uses across 5 sessions |
+
+Also frequently used: bun install, mkdir (not classified as safe to auto-allow but may be worth reviewing)
+```
+
+If `redExamples` is non-empty, show a compact "Blocked" table after the recommendations. This builds confidence that the classifier is doing its job. Show up to 3 examples.
+
+```
+### Blocked from recommendations
+| Pattern | Reason | Uses |
+|---------|--------|------|
+| `rm *` | Irreversible file deletion | 21 |
+| `eval *` | Arbitrary code execution | 14 |
+| `git reset --hard *` | Destroys uncommitted work | 5 |
+```
+
+### Part 3: Bottom line
+
+**One sentence only.** Frame the impact relative to current coverage using the script's stats. Nothing else -- no pattern names, no usage counts, no elaboration. The question tool UI that immediately follows will visually clip any trailing text, so this must fit on a single short line.
+
+```
+Adding 22 rules would bring your allowlist coverage from 65% to 93%.
+```
+
+Compute the percentages from stats:
+- **Before:** `alreadyCovered / totalExtracted * 100`
+- **After:** `(alreadyCovered + greenRawCount) / totalExtracted * 100`
+
+Use `greenRawCount` (the number of unique raw commands the green patterns cover), not `patternsReturned` (which is just the number of normalized patterns).
+
+## Step 4: Get User Confirmation
+
+The recommendations table is already displayed. Use the platform's blocking question tool to ask for the decision:
+
+1. **Apply all to user settings** (`~/.claude/settings.json`)
+2. **Apply all to project settings** (`.claude/settings.json`)
+3. **Skip**
+
+If the user wants to exclude specific items, they can reply in free text (e.g., "all except 3 and 7 to user settings"). The numbered table is already visible for reference -- no need to re-list items in the question tool.
+
+## Step 5: Apply to Settings
+
+For each target settings file:
+
+1. Read the current file (create `{ "permissions": { "allow": [] } }` if it doesn't exist)
+2. Append new patterns to `permissions.allow`, avoiding duplicates
+3. Sort the allow array alphabetically
+4. Write back with 2-space indentation
+5. **Verify the write** -- tell the user you're validating the JSON before running this command, e.g., "Verifying settings.json is valid JSON..." The command looks alarming without context:
+ ```bash
+ node -e "JSON.parse(require('fs').readFileSync('','utf8'))"
+ ```
+ If this fails, the file is invalid JSON. Immediately restore from the content read in step 1 and report the error. Do not continue to other files.
+
+After successful verification:
+
+```
+Applied N rules to ~/.claude/settings.json
+Applied M rules to .claude/settings.json
+
+These commands will no longer trigger permission prompts.
+```
+
+If `.claude/settings.json` was modified and is tracked by git, mention that committing it would benefit teammates.
+
+## Edge Cases
+
+- **No project context** (running outside a project): Only offer user-level settings as write target.
+- **Settings file doesn't exist**: Create it with `{ "permissions": { "allow": [] } }`. For `.claude/settings.json`, also create the `.claude/` directory if needed.
+- **Deny rules**: If a deny rule already blocks a command, warn rather than adding an allow rule (deny takes precedence in Claude Code).
diff --git a/plugins/compound-engineering/skills/claude-permissions-optimizer/scripts/extract-commands.mjs b/plugins/compound-engineering/skills/claude-permissions-optimizer/scripts/extract-commands.mjs
new file mode 100644
index 0000000..ff7a060
--- /dev/null
+++ b/plugins/compound-engineering/skills/claude-permissions-optimizer/scripts/extract-commands.mjs
@@ -0,0 +1,661 @@
+#!/usr/bin/env node
+
+// Extracts, normalizes, and pre-classifies Bash commands from Claude Code sessions.
+// Filters against the current allowlist, groups by normalized pattern, and classifies
+// each pattern as green/yellow/red so the model can review rather than classify from scratch.
+//
+// Usage: node extract-commands.mjs [--days ] [--project-slug ] [--min-count 5]
+// [--settings ] [--settings ] ...
+//
+// Analyzes the most recent sessions, bounded by both count and time.
+// Defaults: last 200 sessions or 30 days, whichever is more restrictive.
+//
+// Output: JSON with { green, yellowFootnote, stats }
+
+import { readdir, readFile, stat } from "node:fs/promises";
+import { join } from "node:path";
+import { homedir } from "node:os";
+
+const args = process.argv.slice(2);
+
+function flag(name, fallback) {
+ const i = args.indexOf(`--${name}`);
+ return i !== -1 && args[i + 1] ? args[i + 1] : fallback;
+}
+
+function flagAll(name) {
+ const results = [];
+ let i = 0;
+ while (i < args.length) {
+ if (args[i] === `--${name}` && args[i + 1]) {
+ results.push(args[i + 1]);
+ i += 2;
+ } else {
+ i++;
+ }
+ }
+ return results;
+}
+
+const days = parseInt(flag("days", "30"), 10);
+const maxSessions = parseInt(flag("max-sessions", "500"), 10);
+const minCount = parseInt(flag("min-count", "5"), 10);
+const projectSlugFilter = flag("project-slug", null);
+const settingsPaths = flagAll("settings");
+const claudeDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
+const projectsDir = join(claudeDir, "projects");
+const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;
+
+// ── Allowlist loading ──────────────────────────────────────────────────────
+
+const allowPatterns = [];
+
+async function loadAllowlist(filePath) {
+ try {
+ const content = await readFile(filePath, "utf-8");
+ const settings = JSON.parse(content);
+ const allow = settings?.permissions?.allow || [];
+ for (const rule of allow) {
+ const match = rule.match(/^Bash\((.+)\)$/);
+ if (match) {
+ allowPatterns.push(match[1]);
+ } else if (rule === "Bash" || rule === "Bash(*)") {
+ allowPatterns.push("*");
+ }
+ }
+ } catch {
+ // file doesn't exist or isn't valid JSON
+ }
+}
+
+if (settingsPaths.length === 0) {
+ settingsPaths.push(join(claudeDir, "settings.json"));
+ settingsPaths.push(join(process.cwd(), ".claude", "settings.json"));
+ settingsPaths.push(join(process.cwd(), ".claude", "settings.local.json"));
+}
+
+for (const p of settingsPaths) {
+ await loadAllowlist(p);
+}
+
+function isAllowed(command) {
+ for (const pattern of allowPatterns) {
+ if (pattern === "*") return true;
+ if (matchGlob(pattern, command)) return true;
+ }
+ return false;
+}
+
+function matchGlob(pattern, command) {
+ const normalized = pattern.replace(/:(\*)$/, " $1");
+ let regexStr;
+ if (normalized.endsWith(" *")) {
+ const base = normalized.slice(0, -2);
+ const escaped = base.replace(/[.+^${}()|[\]\\]/g, "\\$&");
+ regexStr = "^" + escaped + "($| .*)";
+ } else {
+ regexStr =
+ "^" +
+ normalized
+ .replace(/[.+^${}()|[\]\\]/g, "\\$&")
+ .replace(/\*/g, ".*") +
+ "$";
+ }
+ try {
+ return new RegExp(regexStr).test(command);
+ } catch {
+ return false;
+ }
+}
+
+// ── Classification rules ───────────────────────────────────────────────────
+
+// RED: patterns that should never be allowlisted with wildcards.
+// Checked first -- highest priority.
+const RED_PATTERNS = [
+ // Destructive file ops -- all rm variants
+ { test: /^rm\s/, reason: "Irreversible file deletion" },
+ { test: /^sudo\s/, reason: "Privilege escalation" },
+ { test: /^su\s/, reason: "Privilege escalation" },
+ // find with destructive actions (must be before GREEN_BASES check)
+ { test: /\bfind\b.*\s-delete\b/, reason: "find -delete permanently removes files" },
+ { test: /\bfind\b.*\s-exec\s+rm\b/, reason: "find -exec rm permanently removes files" },
+ // ast-grep rewrite modifies files in place
+ { test: /\b(ast-grep|sg)\b.*--rewrite\b/, reason: "ast-grep --rewrite modifies files in place" },
+ // sed -i edits files in place
+ { test: /\bsed\s+.*-i\b/, reason: "sed -i modifies files in place" },
+ // Git irreversible
+ { test: /git\s+(?:\S+\s+)*push\s+.*--force(?!-with-lease)/, reason: "Force push overwrites remote history" },
+ { test: /git\s+(?:\S+\s+)*push\s+.*\s-f\b/, reason: "Force push overwrites remote history" },
+ { test: /git\s+(?:\S+\s+)*push\s+-f\b/, reason: "Force push overwrites remote history" },
+ { test: /git\s+reset\s+--(hard|merge)/, reason: "Destroys uncommitted work" },
+ { test: /git\s+clean\s+.*(-[a-z]*f[a-z]*\b|--force\b)/, reason: "Permanently deletes untracked files" },
+ { test: /git\s+commit\s+.*--no-verify/, reason: "Skips safety hooks" },
+ { test: /git\s+config\s+--system/, reason: "System-wide config change" },
+ { test: /git\s+filter-branch/, reason: "Rewrites entire repo history" },
+ { test: /git\s+filter-repo/, reason: "Rewrites repo history" },
+ { test: /git\s+gc\s+.*--aggressive/, reason: "Can remove recoverable objects" },
+ { test: /git\s+reflog\s+expire/, reason: "Removes recovery safety net" },
+ { test: /git\s+stash\s+clear\b/, reason: "Removes ALL stash entries permanently" },
+ { test: /git\s+branch\s+.*(-D\b|--force\b)/, reason: "Force-deletes without merge check" },
+ { test: /git\s+checkout\s+.*\s--\s/, reason: "Discards uncommitted changes" },
+ { test: /git\s+checkout\s+--\s/, reason: "Discards uncommitted changes" },
+ { test: /git\s+restore\s+(?!.*(-S\b|--staged\b))/, reason: "Discards working tree changes" },
+ // Publishing -- permanent across all ecosystems
+ { test: /\b(npm|yarn|pnpm)\s+publish\b/, reason: "Permanent package publishing" },
+ { test: /\bnpm\s+unpublish\b/, reason: "Permanent package removal" },
+ { test: /\bcargo\s+publish\b/, reason: "Permanent crate publishing" },
+ { test: /\bcargo\s+yank\b/, reason: "Unavails crate version" },
+ { test: /\bgem\s+push\b/, reason: "Permanent gem publishing" },
+ { test: /\bpoetry\s+publish\b/, reason: "Permanent package publishing" },
+ { test: /\btwine\s+upload\b/, reason: "Permanent package publishing" },
+ { test: /\bgh\s+release\s+create\b/, reason: "Permanent release creation" },
+ // Shell injection
+ { test: /\|\s*(sh|bash|zsh)\b/, reason: "Pipe to shell execution" },
+ { test: /\beval\s/, reason: "Arbitrary code execution" },
+ // Docker destructive
+ { test: /docker\s+run\s+.*--privileged/, reason: "Full host access" },
+ { test: /docker\s+system\s+prune\b(?!.*--dry-run)/, reason: "Removes all unused data" },
+ { test: /docker\s+volume\s+(rm|prune)\b/, reason: "Permanent data deletion" },
+ { test: /docker[- ]compose\s+down\s+.*(-v\b|--volumes\b)/, reason: "Removes volumes and data" },
+ { test: /docker[- ]compose\s+down\s+.*--rmi\b/, reason: "Removes all images" },
+ { test: /docker\s+(rm|rmi)\s+.*-[a-z]*f/, reason: "Force removes without confirmation" },
+ // System
+ { test: /^reboot\b/, reason: "System restart" },
+ { test: /^shutdown\b/, reason: "System halt" },
+ { test: /^halt\b/, reason: "System halt" },
+ { test: /\bsystemctl\s+(stop|disable|mask)\b/, reason: "Stops system services" },
+ { test: /\bkill\s+-9\b/, reason: "Force kill without cleanup" },
+ { test: /\bpkill\s+-9\b/, reason: "Force kill by name" },
+ // Disk destructive
+ { test: /\bdd\s+.*\bof=/, reason: "Raw disk write" },
+ { test: /\bmkfs\b/, reason: "Formats disk partition" },
+ // Permissions
+ { test: /\bchmod\s+777\b/, reason: "World-writable permissions" },
+ { test: /\bchmod\s+-R\b/, reason: "Recursive permission change" },
+ { test: /\bchown\s+-R\b/, reason: "Recursive ownership change" },
+ // Database destructive
+ { test: /\bDROP\s+(DATABASE|TABLE|SCHEMA)\b/i, reason: "Permanent data deletion" },
+ { test: /\bTRUNCATE\b/i, reason: "Permanent row deletion" },
+ // Network
+ { test: /^(nc|ncat)\s/, reason: "Raw socket access" },
+ // Credential exposure
+ { test: /\bcat\s+\.env.*\|/, reason: "Credential exposure via pipe" },
+ { test: /\bprintenv\b.*\|/, reason: "Credential exposure via pipe" },
+ // Package removal (from DCG)
+ { test: /\bpip3?\s+uninstall\b/, reason: "Package removal" },
+ { test: /\bapt(?:-get)?\s+(remove|purge|autoremove)\b/, reason: "Package removal" },
+ { test: /\bbrew\s+uninstall\b/, reason: "Package removal" },
+];
+
+// GREEN: base commands that are always read-only / safe.
+// NOTE: `find` is intentionally excluded -- `find -delete` and `find -exec rm`
+// are destructive. Safe find usage is handled via GREEN_COMPOUND instead.
+const GREEN_BASES = new Set([
+ "ls", "cat", "head", "tail", "wc", "file", "tree", "stat", "du",
+ "diff", "grep", "rg", "ag", "ack", "which", "whoami", "pwd", "echo",
+ "printf", "env", "printenv", "uname", "hostname", "jq", "sort", "uniq",
+ "tr", "cut", "less", "more", "man", "type", "realpath", "dirname",
+ "basename", "date", "ps", "top", "htop", "free", "uptime",
+ "id", "groups", "lsof", "open", "xdg-open",
+]);
+
+// GREEN: compound patterns
+const GREEN_COMPOUND = [
+ /--version\s*$/,
+ /--help(\s|$)/,
+ /^git\s+(status|log|diff|show|blame|shortlog|branch\s+-[alv]|remote\s+-v|rev-parse|describe|reflog\b(?!\s+expire))\b/,
+ /^git\s+tag\s+(-l\b|--list\b)/, // tag listing (not creation)
+ /^git\s+stash\s+(list|show)\b/, // stash read-only operations
+ /^(npm|bun|pnpm|yarn)\s+run\s+(test|lint|build|check|typecheck)\b/,
+ /^(npm|bun|pnpm|yarn)\s+(test|lint|audit|outdated|list)\b/,
+ /^(npx|bunx)\s+(vitest|jest|eslint|prettier|tsc)\b/,
+ /^(pytest|jest|cargo\s+test|go\s+test|rspec|bundle\s+exec\s+rspec|make\s+test|rake\s+rspec)\b/,
+ /^(eslint|prettier|rubocop|black|flake8|cargo\s+(clippy|fmt)|gofmt|golangci-lint|tsc(\s+--noEmit)?|mypy|pyright)\b/,
+ /^(cargo\s+(build|check|doc|bench)|go\s+(build|vet))\b/,
+ /^pnpm\s+--filter\s/,
+ /^(npm|bun|pnpm|yarn)\s+(typecheck|format|verify|validate|check|analyze)\b/, // common safe script names
+ /^git\s+-C\s+\S+\s+(status|log|diff|show|branch|remote|rev-parse|describe)\b/, // git -C
+ /^docker\s+(ps|images|logs|inspect|stats|system\s+df)\b/,
+ /^docker[- ]compose\s+(ps|logs|config)\b/,
+ /^systemctl\s+(status|list-|show|is-|cat)\b/,
+ /^journalctl\b/,
+ /^(pg_dump|mysqldump)\b(?!.*--clean)/,
+ /\b--dry-run\b/,
+ /^git\s+clean\s+.*(-[a-z]*n|--dry-run)\b/, // git clean dry run
+ // NOTE: find is intentionally NOT green. Bash(find *) would also match
+ // find -delete and find -exec rm in Claude Code's allowlist glob matching.
+ // Commands with mode-switching flags: only green when the normalized pattern
+ // is narrow enough that the allowlist glob can't match the destructive form.
+ // Bash(sed -n *) is safe; Bash(sed *) would also match sed -i.
+ /^sed\s+-(?!i\b)[a-zA-Z]\s/, // sed with a non-destructive flag (matches normalized sed -n *, sed -e *, etc.)
+ /^(ast-grep|sg)\b(?!.*--rewrite)/, // ast-grep without --rewrite
+ /^find\s+-(?:name|type|path|iname)\s/, // find with safe predicate flag (matches normalized form)
+ // gh CLI read-only operations
+ /^gh\s+(pr|issue|run)\s+(view|list|status|diff|checks)\b/,
+ /^gh\s+repo\s+(view|list|clone)\b/,
+ /^gh\s+api\b/,
+];
+
+// YELLOW: base commands that modify local state but are recoverable
+const YELLOW_BASES = new Set([
+ "mkdir", "touch", "cp", "mv", "tee", "curl", "wget", "ssh", "scp", "rsync",
+ "python", "python3", "node", "ruby", "perl", "make", "just",
+ "awk", // awk can write files; safe forms handled case-by-case if needed
+]);
+
+// YELLOW: compound patterns
+const YELLOW_COMPOUND = [
+ /^git\s+(add|commit(?!\s+.*--no-verify)|checkout(?!\s+--\s)|switch|pull|push(?!\s+.*--force)(?!\s+.*-f\b)|fetch|merge|rebase|stash(?!\s+clear\b)|branch\b(?!\s+.*(-D\b|--force\b))|cherry-pick|tag|clone)\b/,
+ /^git\s+push\s+--force-with-lease\b/,
+ /^git\s+restore\s+.*(-S\b|--staged\b)/, // restore --staged is safe (just unstages)
+ /^git\s+gc\b(?!\s+.*--aggressive)/,
+ /^(npm|bun|pnpm|yarn)\s+install\b/,
+ /^(npm|bun|pnpm|yarn)\s+(add|remove|uninstall|update)\b/,
+ /^(npm|bun|pnpm)\s+run\s+(start|dev|serve)\b/,
+ /^(pip|pip3)\s+install\b(?!\s+https?:)/,
+ /^bundle\s+install\b/,
+ /^(cargo\s+add|go\s+get)\b/,
+ /^docker\s+(build|run(?!\s+.*--privileged)|stop|start)\b/,
+ /^docker[- ]compose\s+(up|down\b(?!\s+.*(-v\b|--volumes\b|--rmi\b)))/,
+ /^systemctl\s+restart\b/,
+ /^kill\s+(?!.*-9)\d/,
+ /^rake\b/,
+ // gh CLI write operations (recoverable)
+ /^gh\s+(pr|issue)\s+(create|edit|comment|close|reopen|merge)\b/,
+ /^gh\s+run\s+(rerun|cancel|watch)\b/,
+];
+
+function classify(command) {
+ // Extract the first command from compound chains (&&, ||, ;) and pipes
+ // so that `cd /dir && git branch -D feat` classifies as green (cd),
+ // not red (git branch -D). This matches what normalize() does.
+ const compoundMatch = command.match(/^(.+?)\s*(&&|\|\||;)\s*(.+)$/);
+ if (compoundMatch) return classify(compoundMatch[1].trim());
+ const pipeMatch = command.match(/^(.+?)\s*\|\s*(.+)$/);
+ if (pipeMatch && !/\|\s*(sh|bash|zsh)\b/.test(command)) {
+ return classify(pipeMatch[1].trim());
+ }
+
+ // RED check first (highest priority)
+ for (const { test, reason } of RED_PATTERNS) {
+ if (test.test(command)) return { tier: "red", reason };
+ }
+
+ // GREEN checks
+ const baseCmd = command.split(/\s+/)[0];
+ if (GREEN_BASES.has(baseCmd)) return { tier: "green" };
+ for (const re of GREEN_COMPOUND) {
+ if (re.test(command)) return { tier: "green" };
+ }
+
+ // YELLOW checks
+ if (YELLOW_BASES.has(baseCmd)) return { tier: "yellow" };
+ for (const re of YELLOW_COMPOUND) {
+ if (re.test(command)) return { tier: "yellow" };
+ }
+
+ // Unclassified -- silently dropped from output
+ return { tier: "unknown" };
+}
+
+// ── Normalization ──────────────────────────────────────────────────────────
+
+// Risk-modifying flags that must NOT be collapsed into wildcards.
+// Global flags are always preserved; context-specific flags only matter
+// for certain base commands.
+const GLOBAL_RISK_FLAGS = new Set([
+ "--force", "--hard", "-rf", "--privileged", "--no-verify",
+ "--system", "--force-with-lease", "-D", "--force-if-includes",
+ "--volumes", "--rmi", "--rewrite", "--delete",
+]);
+
+// Flags that are only risky for specific base commands.
+// -f means force-push in git, force-remove in docker, but pattern-file in grep.
+// -v means remove-volumes in docker-compose, but verbose everywhere else.
+const CONTEXTUAL_RISK_FLAGS = {
+ "-f": new Set(["git", "docker", "rm"]),
+ "-v": new Set(["docker", "docker-compose"]),
+};
+
+function isRiskFlag(token, base) {
+ if (GLOBAL_RISK_FLAGS.has(token)) return true;
+ // Check context-specific flags
+ const contexts = CONTEXTUAL_RISK_FLAGS[token];
+ if (contexts && base && contexts.has(base)) return true;
+ // Combined short flags containing risk chars: -rf, -fr, -fR, etc.
+ if (/^-[a-zA-Z]*[rf][a-zA-Z]*$/.test(token) && token.length <= 4) return true;
+ return false;
+}
+
+function normalize(command) {
+ // Don't normalize shell injection patterns
+ if (/\|\s*(sh|bash|zsh)\b/.test(command)) return command;
+ // Don't normalize sudo -- keep as-is
+ if (/^sudo\s/.test(command)) return "sudo *";
+
+ // Handle pnpm --filter specially
+ const pnpmFilter = command.match(/^pnpm\s+--filter\s+\S+\s+(\S+)/);
+ if (pnpmFilter) return "pnpm --filter * " + pnpmFilter[1] + " *";
+
+ // Handle sed specially -- preserve the mode flag to keep safe patterns narrow.
+ // sed -i (in-place) is destructive; sed -n, sed -e, bare sed are read-only.
+ if (/^sed\s/.test(command)) {
+ if (/\s-i\b/.test(command)) return "sed -i *";
+ const sedFlag = command.match(/^sed\s+(-[a-zA-Z])\s/);
+ return sedFlag ? "sed " + sedFlag[1] + " *" : "sed *";
+ }
+
+ // Handle ast-grep specially -- preserve --rewrite flag.
+ if (/^(ast-grep|sg)\s/.test(command)) {
+ const base = command.startsWith("sg") ? "sg" : "ast-grep";
+ return /\s--rewrite\b/.test(command) ? base + " --rewrite *" : base + " *";
+ }
+
+ // Handle find specially -- preserve key action flags.
+ // find -delete and find -exec rm are destructive; find -name/-type are safe.
+ if (/^find\s/.test(command)) {
+ if (/\s-delete\b/.test(command)) return "find -delete *";
+ if (/\s-exec\s/.test(command)) return "find -exec *";
+ // Extract the first predicate flag for a narrower safe pattern
+ const findFlag = command.match(/\s(-(?:name|type|path|iname))\s/);
+ return findFlag ? "find " + findFlag[1] + " *" : "find *";
+ }
+
+ // Handle git -C -- strip the -C and normalize the git subcommand
+ const gitC = command.match(/^git\s+-C\s+\S+\s+(.+)$/);
+ if (gitC) return normalize("git " + gitC[1]);
+
+ // Split on compound operators -- normalize the first command only
+ const compoundMatch = command.match(/^(.+?)\s*(&&|\|\||;)\s*(.+)$/);
+ if (compoundMatch) {
+ return normalize(compoundMatch[1].trim());
+ }
+
+ // Strip trailing pipe chains for normalization (e.g., `cmd | tail -5`)
+ // but preserve pipe-to-shell (already handled by shell injection check above)
+ const pipeMatch = command.match(/^(.+?)\s*\|\s*(.+)$/);
+ if (pipeMatch) {
+ return normalize(pipeMatch[1].trim());
+ }
+
+ // Strip trailing redirections (2>&1, > file, >> file)
+ const cleaned = command.replace(/\s*[12]?>>?\s*\S+\s*$/, "").replace(/\s*2>&1\s*$/, "").trim();
+
+ const parts = cleaned.split(/\s+/);
+ if (parts.length === 0) return command;
+
+ const base = parts[0];
+
+ // For git/docker/gh/npm etc, include the subcommand
+ const multiWordBases = ["git", "docker", "docker-compose", "gh", "npm", "bun",
+ "pnpm", "yarn", "cargo", "pip", "pip3", "bundle", "systemctl", "kubectl"];
+
+ let prefix = base;
+ let argStart = 1;
+
+ if (multiWordBases.includes(base) && parts.length > 1) {
+ prefix = base + " " + parts[1];
+ argStart = 2;
+ }
+
+ // Preserve risk-modifying flags in the remaining args
+ const preservedFlags = [];
+ for (let i = argStart; i < parts.length; i++) {
+ if (isRiskFlag(parts[i], base)) {
+ preservedFlags.push(parts[i]);
+ }
+ }
+
+ // Build the normalized pattern
+ if (parts.length <= argStart && preservedFlags.length === 0) {
+ return prefix; // no args, no flags: e.g., "git status"
+ }
+
+ const flagStr = preservedFlags.length > 0 ? " " + preservedFlags.join(" ") : "";
+ const hasVaryingArgs = parts.length > argStart + preservedFlags.length;
+
+ if (hasVaryingArgs) {
+ return prefix + flagStr + " *";
+ }
+ return prefix + flagStr;
+}
+
+// ── Session file scanning ──────────────────────────────────────────────────
+
+const commands = new Map();
+let filesScanned = 0;
+const sessionsScanned = new Set();
+
+async function listDirs(dir) {
+ try {
+ const entries = await readdir(dir, { withFileTypes: true });
+ return entries.filter((e) => e.isDirectory()).map((e) => e.name);
+ } catch {
+ return [];
+ }
+}
+
+async function listJsonlFiles(dir) {
+ try {
+ const entries = await readdir(dir, { withFileTypes: true });
+ return entries
+ .filter((e) => e.isFile() && e.name.endsWith(".jsonl"))
+ .map((e) => e.name);
+ } catch {
+ return [];
+ }
+}
+
+async function processFile(filePath, sessionId) {
+ try {
+ filesScanned++;
+ sessionsScanned.add(sessionId);
+
+ const content = await readFile(filePath, "utf-8");
+ for (const line of content.split("\n")) {
+ if (!line.includes('"Bash"')) continue;
+ try {
+ const record = JSON.parse(line);
+ if (record.type !== "assistant") continue;
+ const blocks = record.message?.content;
+ if (!Array.isArray(blocks)) continue;
+ for (const block of blocks) {
+ if (block.type !== "tool_use" || block.name !== "Bash") continue;
+ const cmd = block.input?.command;
+ if (!cmd) continue;
+ const ts = record.timestamp
+ ? new Date(record.timestamp).getTime()
+ : info.mtimeMs;
+ const existing = commands.get(cmd);
+ if (existing) {
+ existing.count++;
+ existing.sessions.add(sessionId);
+ existing.firstSeen = Math.min(existing.firstSeen, ts);
+ existing.lastSeen = Math.max(existing.lastSeen, ts);
+ } else {
+ commands.set(cmd, {
+ count: 1,
+ sessions: new Set([sessionId]),
+ firstSeen: ts,
+ lastSeen: ts,
+ });
+ }
+ }
+ } catch {
+ // skip malformed lines
+ }
+ }
+ } catch {
+ // skip unreadable files
+ }
+}
+
+// Collect all candidate session files, then sort by recency and limit
+const candidates = [];
+const projectSlugs = await listDirs(projectsDir);
+for (const slug of projectSlugs) {
+ if (projectSlugFilter && slug !== projectSlugFilter) continue;
+ const slugDir = join(projectsDir, slug);
+ const jsonlFiles = await listJsonlFiles(slugDir);
+ for (const f of jsonlFiles) {
+ const filePath = join(slugDir, f);
+ try {
+ const info = await stat(filePath);
+ if (info.mtimeMs >= cutoff) {
+ candidates.push({ filePath, sessionId: f.replace(".jsonl", ""), mtime: info.mtimeMs });
+ }
+ } catch {
+ // skip unreadable files
+ }
+ }
+}
+
+// Sort by most recent first, then take at most maxSessions
+candidates.sort((a, b) => b.mtime - a.mtime);
+const toProcess = candidates.slice(0, maxSessions);
+
+await Promise.all(
+ toProcess.map((c) => processFile(c.filePath, c.sessionId))
+);
+
+// ── Filter, normalize, group, classify ─────────────────────────────────────
+
+const totalExtracted = commands.size;
+let alreadyCovered = 0;
+let belowThreshold = 0;
+
+// Group raw commands by normalized pattern, tracking unique sessions per group.
+// Normalize and group FIRST, then apply the min-count threshold to the grouped
+// totals. This prevents many low-frequency variants of the same pattern from
+// being individually discarded as noise when they collectively exceed the threshold.
+const patternGroups = new Map();
+
+for (const [command, data] of commands) {
+ if (isAllowed(command)) {
+ alreadyCovered++;
+ continue;
+ }
+
+ const pattern = "Bash(" + normalize(command) + ")";
+ const { tier, reason } = classify(command);
+
+ const existing = patternGroups.get(pattern);
+ if (existing) {
+ existing.rawCommands.push({ command, count: data.count });
+ existing.totalCount += data.count;
+ // Merge session sets to avoid overcounting
+ for (const s of data.sessions) existing.sessionSet.add(s);
+ // Escalation: highest tier wins
+ if (tier === "red" && existing.tier !== "red") {
+ existing.tier = "red";
+ existing.reason = reason;
+ } else if (tier === "yellow" && existing.tier === "green") {
+ existing.tier = "yellow";
+ } else if (tier === "unknown" && existing.tier === "green") {
+ existing.tier = "unknown";
+ }
+ } else {
+ patternGroups.set(pattern, {
+ rawCommands: [{ command, count: data.count }],
+ totalCount: data.count,
+ sessionSet: new Set(data.sessions),
+ tier,
+ reason: reason || null,
+ });
+ }
+}
+
+// Now filter by min-count on the GROUPED totals
+for (const [pattern, data] of patternGroups) {
+ if (data.totalCount < minCount) {
+ belowThreshold += data.rawCommands.length;
+ patternGroups.delete(pattern);
+ }
+}
+
+// Post-grouping safety check: normalization can broaden a safe command into an
+// unsafe pattern (e.g., "node --version" is green, but normalizes to "node *"
+// which would also match arbitrary code execution). Re-classify the normalized
+// pattern itself and escalate if the broader form is riskier.
+for (const [pattern, data] of patternGroups) {
+ if (data.tier !== "green") continue;
+ if (!pattern.includes("*")) continue;
+ const cmd = pattern.replace(/^Bash\(|\)$/g, "");
+ const { tier, reason } = classify(cmd);
+ if (tier === "red") {
+ data.tier = "red";
+ data.reason = reason;
+ } else if (tier === "yellow") {
+ data.tier = "yellow";
+ } else if (tier === "unknown") {
+ data.tier = "unknown";
+ }
+}
+
+// Only output green (safe) patterns. Yellow, red, and unknown are counted
+// in stats for transparency but not included as arrays.
+const green = [];
+let greenRawCount = 0; // unique raw commands covered by green patterns
+let yellowCount = 0;
+const redBlocked = [];
+let unclassified = 0;
+const yellowNames = []; // brief list for the footnote
+
+for (const [pattern, data] of patternGroups) {
+ switch (data.tier) {
+ case "green":
+ green.push({
+ pattern,
+ count: data.totalCount,
+ sessions: data.sessionSet.size,
+ examples: data.rawCommands
+ .sort((a, b) => b.count - a.count)
+ .slice(0, 3)
+ .map((c) => c.command),
+ });
+ greenRawCount += data.rawCommands.length;
+ break;
+ case "yellow":
+ yellowCount++;
+ yellowNames.push(pattern.replace(/^Bash\(|\)$/g, "").replace(/ \*$/, ""));
+ break;
+ case "red":
+ redBlocked.push({
+ pattern: pattern.replace(/^Bash\(|\)$/g, ""),
+ reason: data.reason,
+ count: data.totalCount,
+ });
+ break;
+ default:
+ unclassified++;
+ }
+}
+
+green.sort((a, b) => b.count - a.count);
+redBlocked.sort((a, b) => b.count - a.count);
+
+const output = {
+ green,
+ redExamples: redBlocked.slice(0, 5),
+ yellowFootnote: yellowNames.length > 0
+ ? `Also frequently used: ${yellowNames.join(", ")} (not classified as safe to auto-allow but may be worth reviewing)`
+ : null,
+ stats: {
+ totalExtracted,
+ alreadyCovered,
+ belowThreshold,
+ unclassified,
+ yellowSkipped: yellowCount,
+ redBlocked: redBlocked.length,
+ patternsReturned: green.length,
+ greenRawCount,
+ sessionsScanned: sessionsScanned.size,
+ filesScanned,
+ allowPatternsLoaded: allowPatterns.length,
+ daysWindow: days,
+ minCount,
+ },
+};
+
+console.log(JSON.stringify(output, null, 2));
diff --git a/plugins/compound-engineering/skills/create-agent-skill/SKILL.md b/plugins/compound-engineering/skills/create-agent-skill/SKILL.md
deleted file mode 100644
index 2b3052b..0000000
--- a/plugins/compound-engineering/skills/create-agent-skill/SKILL.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: create-agent-skill
-description: Create or edit Claude Code skills with expert guidance on structure and best practices
-allowed-tools: Skill(create-agent-skills)
-argument-hint: "[skill description or requirements]"
-disable-model-invocation: true
----
-
-Invoke the create-agent-skills skill for: $ARGUMENTS
diff --git a/plugins/compound-engineering/skills/create-agent-skills/SKILL.md b/plugins/compound-engineering/skills/create-agent-skills/SKILL.md
deleted file mode 100644
index 93eb32d..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/SKILL.md
+++ /dev/null
@@ -1,264 +0,0 @@
----
-name: create-agent-skills
-description: Expert guidance for creating Claude Code skills and slash commands. Use when working with SKILL.md files, authoring new skills, improving existing skills, creating slash commands, or understanding skill structure and best practices.
----
-
-# Creating Skills & Commands
-
-This skill teaches how to create effective Claude Code skills following the official specification from [code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills).
-
-## Commands and Skills Are Now The Same Thing
-
-Custom slash commands have been merged into skills. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way. Existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control invocation, and automatic context loading.
-
-**If a skill and a command share the same name, the skill takes precedence.**
-
-## When To Create What
-
-**Use a command file** (`commands/name.md`) when:
-- Simple, single-file workflow
-- No supporting files needed
-- Task-oriented action (deploy, commit, triage)
-
-**Use a skill directory** (`skills/name/SKILL.md`) when:
-- Need supporting reference files, scripts, or templates
-- Background knowledge Claude should auto-load
-- Complex enough to benefit from progressive disclosure
-
-Both use identical YAML frontmatter and markdown content format.
-
-## Standard Markdown Format
-
-Use YAML frontmatter + markdown body with **standard markdown headings**. Keep it clean and direct.
-
-```markdown
----
-name: my-skill-name
-description: What it does and when to use it
----
-
-# My Skill Name
-
-## Quick Start
-Immediate actionable guidance...
-
-## Instructions
-Step-by-step procedures...
-
-## Examples
-Concrete usage examples...
-```
-
-## Frontmatter Reference
-
-All fields are optional. Only `description` is recommended.
-
-| Field | Required | Description |
-|-------|----------|-------------|
-| `name` | No | Display name. Lowercase letters, numbers, hyphens (max 64 chars). Defaults to directory name. |
-| `description` | Recommended | What it does AND when to use it. Claude uses this for auto-discovery. Max 1024 chars. |
-| `argument-hint` | No | Hint shown during autocomplete. Example: `[issue-number]` |
-| `disable-model-invocation` | No | Set `true` to prevent Claude auto-loading. Use for manual workflows like `/deploy`, `/commit`. Default: `false`. |
-| `user-invocable` | No | Set `false` to hide from `/` menu. Use for background knowledge. Default: `true`. |
-| `allowed-tools` | No | Tools Claude can use without permission prompts. Example: `Read, Bash(git *)` |
-| `model` | No | Model to use. Options: `haiku`, `sonnet`, `opus`. |
-| `context` | No | Set `fork` to run in isolated subagent context. |
-| `agent` | No | Subagent type when `context: fork`. Options: `Explore`, `Plan`, `general-purpose`, or custom agent name. |
-
-### Invocation Control
-
-| Frontmatter | User can invoke | Claude can invoke | When loaded |
-|-------------|----------------|-------------------|-------------|
-| (default) | Yes | Yes | Description always in context, full content loads when invoked |
-| `disable-model-invocation: true` | Yes | No | Description not in context, loads only when user invokes |
-| `user-invocable: false` | No | Yes | Description always in context, loads when relevant |
-
-**Use `disable-model-invocation: true`** for workflows with side effects: `/deploy`, `/commit`, `/triage-prs`, `/send-slack-message`. You don't want Claude deciding to deploy because your code looks ready.
-
-**Use `user-invocable: false`** for background knowledge that isn't a meaningful user action: coding conventions, domain context, legacy system docs.
-
-## Dynamic Features
-
-### Arguments
-
-Use `$ARGUMENTS` placeholder for user input. If not present in content, arguments are appended automatically.
-
-```yaml
----
-name: fix-issue
-description: Fix a GitHub issue
-disable-model-invocation: true
----
-
-Fix GitHub issue $ARGUMENTS following our coding standards.
-```
-
-Access individual args: `$ARGUMENTS[0]` or shorthand `$0`, `$1`, `$2`.
-
-### Dynamic Context Injection
-
-Skills support dynamic context injection: prefix a backtick-wrapped shell command with an exclamation mark, and the preprocessor executes it at load time, replacing the directive with stdout. Write an exclamation mark immediately before the opening backtick of the command you want executed (for example, to inject the current git branch, write the exclamation mark followed by `git branch --show-current` wrapped in backticks).
-
-**Important:** The preprocessor scans the entire SKILL.md as plain text — it does not parse markdown. Directives inside fenced code blocks or inline code spans are still executed. If a skill documents this syntax with literal examples, the preprocessor will attempt to run them, causing load failures. To safely document this feature, describe it in prose (as done here) or place examples in a reference file, which is loaded on-demand by Claude and not preprocessed.
-
-For a concrete example of dynamic context injection in a skill, see [official-spec.md](references/official-spec.md) § "Dynamic Context Injection".
-
-### Running in a Subagent
-
-Add `context: fork` to run in isolation. The skill content becomes the subagent's prompt. It won't have conversation history.
-
-```yaml
----
-name: deep-research
-description: Research a topic thoroughly
-context: fork
-agent: Explore
----
-
-Research $ARGUMENTS thoroughly:
-1. Find relevant files
-2. Analyze the code
-3. Summarize findings
-```
-
-## Progressive Disclosure
-
-Keep SKILL.md under 500 lines. Split detailed content into reference files:
-
-```
-my-skill/
-├── SKILL.md # Entry point (required, overview + navigation)
-├── reference.md # Detailed docs (loaded when needed)
-├── examples.md # Usage examples (loaded when needed)
-└── scripts/
- └── helper.py # Utility script (executed, not loaded)
-```
-
-Link from SKILL.md: `For API details, see [reference.md](reference.md).`
-
-Keep references **one level deep** from SKILL.md. Avoid nested chains.
-
-## Effective Descriptions
-
-The description enables skill discovery. Include both **what** it does and **when** to use it.
-
-**Good:**
-```yaml
-description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
-```
-
-**Bad:**
-```yaml
-description: Helps with documents
-```
-
-## What Would You Like To Do?
-
-1. **Create new skill** - Build from scratch
-2. **Create new command** - Build a slash command
-3. **Audit existing skill** - Check against best practices
-4. **Add component** - Add workflow/reference/example
-5. **Get guidance** - Understand skill design
-
-## Creating a New Skill or Command
-
-### Step 1: Choose Type
-
-Ask: Is this a manual workflow (deploy, commit, triage) or background knowledge (conventions, patterns)?
-
-- **Manual workflow** → command with `disable-model-invocation: true`
-- **Background knowledge** → skill without `disable-model-invocation`
-- **Complex with supporting files** → skill directory
-
-### Step 2: Create the File
-
-**Command:**
-```markdown
----
-name: my-command
-description: What this command does
-argument-hint: [expected arguments]
-disable-model-invocation: true
-allowed-tools: Bash(gh *), Read
----
-
-# Command Title
-
-## Workflow
-
-### Step 1: Gather Context
-...
-
-### Step 2: Execute
-...
-
-## Success Criteria
-- [ ] Expected outcome 1
-- [ ] Expected outcome 2
-```
-
-**Skill:**
-```markdown
----
-name: my-skill
-description: What it does. Use when [trigger conditions].
----
-
-# Skill Title
-
-## Quick Start
-[Immediate actionable example]
-
-## Instructions
-[Core guidance]
-
-## Examples
-[Concrete input/output pairs]
-```
-
-### Step 3: Add Reference Files (If Needed)
-
-Link from SKILL.md to detailed content:
-```markdown
-For API reference, see [reference.md](reference.md).
-For form filling guide, see [forms.md](forms.md).
-```
-
-### Step 4: Test With Real Usage
-
-1. Test with actual tasks, not test scenarios
-2. Invoke directly with `/skill-name` to verify
-3. Check auto-triggering by asking something that matches the description
-4. Refine based on real behavior
-
-## Audit Checklist
-
-- [ ] Valid YAML frontmatter (name + description)
-- [ ] Description includes trigger keywords and is specific
-- [ ] Uses standard markdown headings (not XML tags)
-- [ ] SKILL.md under 500 lines
-- [ ] `disable-model-invocation: true` if it has side effects
-- [ ] `allowed-tools` set if specific tools needed
-- [ ] References one level deep, properly linked
-- [ ] Examples are concrete, not abstract
-- [ ] Tested with real usage
-
-## Anti-Patterns to Avoid
-
-- **XML tags in body** - Use standard markdown headings
-- **Vague descriptions** - Be specific with trigger keywords
-- **Deep nesting** - Keep references one level from SKILL.md
-- **Missing invocation control** - Side-effect workflows need `disable-model-invocation: true`
-- **Too many options** - Provide a default with escape hatch
-- **Punting to Claude** - Scripts should handle errors explicitly
-
-## Reference Files
-
-For detailed guidance, see:
-- [official-spec.md](references/official-spec.md) - Official skill specification
-- [best-practices.md](references/best-practices.md) - Skill authoring best practices
-
-## Sources
-
-- [Extend Claude with skills - Official Docs](https://code.claude.com/docs/en/skills)
-- [GitHub - anthropics/skills](https://github.com/anthropics/skills)
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md b/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md
deleted file mode 100644
index 08ced5f..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md
+++ /dev/null
@@ -1,226 +0,0 @@
-
-When building skills that make API calls requiring credentials (API keys, tokens, secrets), follow this protocol to prevent credentials from appearing in chat.
-
-
-
-Raw curl commands with environment variables expose credentials:
-
-```bash
-# ❌ BAD - API key visible in chat
-curl -H "Authorization: Bearer $API_KEY" https://api.example.com/data
-```
-
-When Claude executes this, the full command with expanded `$API_KEY` appears in the conversation.
-
-
-
-Use `~/.claude/scripts/secure-api.sh` - a wrapper that loads credentials internally.
-
-
-```bash
-# ✅ GOOD - No credentials visible
-~/.claude/scripts/secure-api.sh [args]
-
-# Examples:
-~/.claude/scripts/secure-api.sh facebook list-campaigns
-~/.claude/scripts/secure-api.sh ghl search-contact "email@example.com"
-```
-
-
-
-When building a new skill that requires API calls:
-
-1. **Add operations to the wrapper** (`~/.claude/scripts/secure-api.sh`):
-
-```bash
-case "$SERVICE" in
- yourservice)
- case "$OPERATION" in
- list-items)
- curl -s -G \
- -H "Authorization: Bearer $YOUR_API_KEY" \
- "https://api.yourservice.com/items"
- ;;
- get-item)
- ITEM_ID=$1
- curl -s -G \
- -H "Authorization: Bearer $YOUR_API_KEY" \
- "https://api.yourservice.com/items/$ITEM_ID"
- ;;
- *)
- echo "Unknown operation: $OPERATION" >&2
- exit 1
- ;;
- esac
- ;;
-esac
-```
-
-2. **Add profile support to the wrapper** (if service needs multiple accounts):
-
-```bash
-# In secure-api.sh, add to profile remapping section:
-yourservice)
- SERVICE_UPPER="YOURSERVICE"
- YOURSERVICE_API_KEY=$(eval echo \$${SERVICE_UPPER}_${PROFILE_UPPER}_API_KEY)
- YOURSERVICE_ACCOUNT_ID=$(eval echo \$${SERVICE_UPPER}_${PROFILE_UPPER}_ACCOUNT_ID)
- ;;
-```
-
-3. **Add credential placeholders to `~/.claude/.env`** using profile naming:
-
-```bash
-# Check if entries already exist
-grep -q "YOURSERVICE_MAIN_API_KEY=" ~/.claude/.env 2>/dev/null || \
- echo -e "\n# Your Service - Main profile\nYOURSERVICE_MAIN_API_KEY=\nYOURSERVICE_MAIN_ACCOUNT_ID=" >> ~/.claude/.env
-
-echo "Added credential placeholders to ~/.claude/.env - user needs to fill them in"
-```
-
-4. **Document profile workflow in your SKILL.md**:
-
-```markdown
-## Profile Selection Workflow
-
-**CRITICAL:** Always use profile selection to prevent using wrong account credentials.
-
-### When user requests YourService operation:
-
-1. **Check for saved profile:**
- ```bash
- ~/.claude/scripts/profile-state get yourservice
- ```
-
-2. **If no profile saved, discover available profiles:**
- ```bash
- ~/.claude/scripts/list-profiles yourservice
- ```
-
-3. **If only ONE profile:** Use it automatically and announce:
- ```
- "Using YourService profile 'main' to list items..."
- ```
-
-4. **If MULTIPLE profiles:** Ask user which one:
- ```
- "Which YourService profile: main, clienta, or clientb?"
- ```
-
-5. **Save user's selection:**
- ```bash
- ~/.claude/scripts/profile-state set yourservice
- ```
-
-6. **Always announce which profile before calling API:**
- ```
- "Using YourService profile 'main' to list items..."
- ```
-
-7. **Make API call with profile:**
- ```bash
- ~/.claude/scripts/secure-api.sh yourservice: list-items
- ```
-
-## Secure API Calls
-
-All API calls use profile syntax:
-
-```bash
-~/.claude/scripts/secure-api.sh yourservice: [args]
-
-# Examples:
-~/.claude/scripts/secure-api.sh yourservice:main list-items
-~/.claude/scripts/secure-api.sh yourservice:main get-item
-```
-
-**Profile persists for session:** Once selected, use same profile for subsequent operations unless user explicitly changes it.
-```
-
-
-
-
-
-```bash
-curl -s -G \
- -H "Authorization: Bearer $API_KEY" \
- "https://api.example.com/endpoint"
-```
-
-
-
-```bash
-ITEM_ID=$1
-curl -s -X POST \
- -H "Authorization: Bearer $API_KEY" \
- -H "Content-Type: application/json" \
- -d @- \
- "https://api.example.com/items/$ITEM_ID"
-```
-
-Usage:
-```bash
-echo '{"name":"value"}' | ~/.claude/scripts/secure-api.sh service create-item
-```
-
-
-
-```bash
-curl -s -X POST \
- -F "field1=value1" \
- -F "field2=value2" \
- -F "access_token=$API_TOKEN" \
- "https://api.example.com/endpoint"
-```
-
-
-
-
-**Location:** `~/.claude/.env` (global for all skills, accessible from any directory)
-
-**Format:**
-```bash
-# Service credentials
-SERVICE_API_KEY=your-key-here
-SERVICE_ACCOUNT_ID=account-id-here
-
-# Another service
-OTHER_API_TOKEN=token-here
-OTHER_BASE_URL=https://api.other.com
-```
-
-**Loading in script:**
-```bash
-set -a
-source ~/.claude/.env 2>/dev/null || { echo "Error: ~/.claude/.env not found" >&2; exit 1; }
-set +a
-```
-
-
-
-1. **Never use raw curl with `$VARIABLE` in skill examples** - always use the wrapper
-2. **Add all operations to the wrapper** - don't make users figure out curl syntax
-3. **Auto-create credential placeholders** - add empty fields to `~/.claude/.env` immediately when creating the skill
-4. **Keep credentials in `~/.claude/.env`** - one central location, works everywhere
-5. **Document each operation** - show examples in SKILL.md
-6. **Handle errors gracefully** - check for missing env vars, show helpful error messages
-
-
-
-Test the wrapper without exposing credentials:
-
-```bash
-# This command appears in chat
-~/.claude/scripts/secure-api.sh facebook list-campaigns
-
-# But API keys never appear - they're loaded inside the script
-```
-
-Verify credentials are loaded:
-```bash
-# Check .env exists
-ls -la ~/.claude/.env
-
-# Check specific variables (without showing values)
-grep -q "YOUR_API_KEY=" ~/.claude/.env && echo "API key configured" || echo "API key missing"
-```
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md b/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md
deleted file mode 100644
index 38078e4..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md
+++ /dev/null
@@ -1,531 +0,0 @@
-
-Show your skill to someone with minimal context and ask them to follow the instructions. If they're confused, Claude will likely be too.
-
-
-
-Clarity and directness are fundamental to effective skill authoring. Clear instructions reduce errors, improve execution quality, and minimize token waste.
-
-
-
-
-Give Claude contextual information that frames the task:
-
-- What the task results will be used for
-- What audience the output is meant for
-- What workflow the task is part of
-- The end goal or what successful completion looks like
-
-Context helps Claude make better decisions and produce more appropriate outputs.
-
-
-```xml
-
-This analysis will be presented to investors who value transparency and actionable insights. Focus on financial metrics and clear recommendations.
-
-```
-
-
-
-
-Be specific about what you want Claude to do. If you want code only and nothing else, say so.
-
-**Vague**: "Help with the report"
-**Specific**: "Generate a markdown report with three sections: Executive Summary, Key Findings, Recommendations"
-
-**Vague**: "Process the data"
-**Specific**: "Extract customer names and email addresses from the CSV file, removing duplicates, and save to JSON format"
-
-Specificity eliminates ambiguity and reduces iteration cycles.
-
-
-
-Provide instructions as sequential steps. Use numbered lists or bullet points.
-
-```xml
-
-1. Extract data from source file
-2. Transform to target format
-3. Validate transformation
-4. Save to output file
-5. Verify output correctness
-
-```
-
-Sequential steps create clear expectations and reduce the chance Claude skips important operations.
-
-
-
-
-
-```xml
-
-Please remove all personally identifiable information from these customer feedback messages: {{FEEDBACK_DATA}}
-
-```
-
-**Problems**:
-- What counts as PII?
-- What should replace PII?
-- What format should the output be?
-- What if no PII is found?
-- Should product names be redacted?
-
-
-
-```xml
-
-Anonymize customer feedback for quarterly review presentation.
-
-
-
-
-1. Replace all customer names with "CUSTOMER_[ID]" (e.g., "Jane Doe" → "CUSTOMER_001")
-2. Replace email addresses with "EMAIL_[ID]@example.com"
-3. Redact phone numbers as "PHONE_[ID]"
-4. If a message mentions a specific product (e.g., "AcmeCloud"), leave it intact
-5. If no PII is found, copy the message verbatim
-6. Output only the processed messages, separated by "---"
-
-
-Data to process: {{FEEDBACK_DATA}}
-
-
-
-- All customer names replaced with IDs
-- All emails and phones redacted
-- Product names preserved
-- Output format matches specification
-
-```
-
-**Why this is better**:
-- States the purpose (quarterly review)
-- Provides explicit step-by-step rules
-- Defines output format clearly
-- Specifies edge cases (product names, no PII found)
-- Defines success criteria
-
-
-
-
-The clear version:
-- States the purpose (quarterly review)
-- Provides explicit step-by-step rules
-- Defines output format
-- Specifies edge cases (product names, no PII found)
-- Includes success criteria
-
-The unclear version leaves all these decisions to Claude, increasing the chance of misalignment with expectations.
-
-
-
-
-When format matters, show an example rather than just describing it.
-
-
-
-```xml
-
-Generate commit messages in conventional format with type, scope, and description.
-
-```
-
-
-
-```xml
-
-Generate commit messages following these examples:
-
-
-Added user authentication with JWT tokens
-
-
-
-
-Fixed bug where dates displayed incorrectly in reports
-
-
-
-Follow this style: type(scope): brief description, then detailed explanation.
-
-```
-
-
-
-Examples communicate nuances that text descriptions can't:
-- Exact formatting (spacing, capitalization, punctuation)
-- Tone and style
-- Level of detail
-- Pattern across multiple cases
-
-Claude learns patterns from examples more reliably than from descriptions.
-
-
-
-
-
-Eliminate words and phrases that create ambiguity or leave decisions open.
-
-
-
-❌ **"Try to..."** - Implies optional
-✅ **"Always..."** or **"Never..."** - Clear requirement
-
-❌ **"Should probably..."** - Unclear obligation
-✅ **"Must..."** or **"May optionally..."** - Clear obligation level
-
-❌ **"Generally..."** - When are exceptions allowed?
-✅ **"Always... except when..."** - Clear rule with explicit exceptions
-
-❌ **"Consider..."** - Should Claude always do this or only sometimes?
-✅ **"If X, then Y"** or **"Always..."** - Clear conditions
-
-
-
-❌ **Ambiguous**:
-```xml
-
-You should probably validate the output and try to fix any errors.
-
-```
-
-✅ **Clear**:
-```xml
-
-Always validate output before proceeding:
-
-```bash
-python scripts/validate.py output_dir/
-```
-
-If validation fails, fix errors and re-validate. Only proceed when validation passes with zero errors.
-
-```
-
-
-
-
-
-Anticipate edge cases and define how to handle them. Don't leave Claude guessing.
-
-
-
-```xml
-
-Extract email addresses from the text file and save to a JSON array.
-
-```
-
-**Questions left unanswered**:
-- What if no emails are found?
-- What if the same email appears multiple times?
-- What if emails are malformed?
-- What JSON format exactly?
-
-
-
-```xml
-
-Extract email addresses from the text file and save to a JSON array.
-
-
-- **No emails found**: Save empty array `[]`
-- **Duplicate emails**: Keep only unique emails
-- **Malformed emails**: Skip invalid formats, log to stderr
-- **Output format**: Array of strings, one email per element
-
-
-
-```json
-[
- "user1@example.com",
- "user2@example.com"
-]
-```
-
-
-```
-
-
-
-
-
-When output format matters, specify it precisely. Show examples.
-
-
-
-```xml
-
-```
-
-
-
-```xml
-
-Generate a markdown report with this exact structure:
-
-```markdown
-# Analysis Report: [Title]
-
-## Executive Summary
-[1-2 paragraphs summarizing key findings]
-
-## Key Findings
-- Finding 1 with supporting data
-- Finding 2 with supporting data
-- Finding 3 with supporting data
-
-## Recommendations
-1. Specific actionable recommendation
-2. Specific actionable recommendation
-
-## Appendix
-[Raw data and detailed calculations]
-```
-
-**Requirements**:
-- Use exactly these section headings
-- Executive summary must be 1-2 paragraphs
-- List 3-5 key findings
-- Provide 2-4 recommendations
-- Include appendix with source data
-
-```
-
-
-
-
-
-When Claude must make decisions, provide clear criteria.
-
-
-
-```xml
-
-Analyze the data and decide which visualization to use.
-
-```
-
-**Problem**: What factors should guide this decision?
-
-
-
-```xml
-
-Analyze the data and select appropriate visualization:
-
-
-**Use bar chart when**:
-- Comparing quantities across categories
-- Fewer than 10 categories
-- Exact values matter
-
-**Use line chart when**:
-- Showing trends over time
-- Continuous data
-- Pattern recognition matters more than exact values
-
-**Use scatter plot when**:
-- Showing relationship between two variables
-- Looking for correlations
-- Individual data points matter
-
-
-```
-
-**Benefits**: Claude has objective criteria for making the decision rather than guessing.
-
-
-
-
-
-Clearly separate "must do" from "nice to have" from "must not do".
-
-
-
-```xml
-
-The report should include financial data, customer metrics, and market analysis. It would be good to have visualizations. Don't make it too long.
-
-```
-
-**Problems**:
-- Are all three content types required?
-- Are visualizations optional or required?
-- How long is "too long"?
-
-
-
-```xml
-
-
-- Financial data (revenue, costs, profit margins)
-- Customer metrics (acquisition, retention, lifetime value)
-- Market analysis (competition, trends, opportunities)
-- Maximum 5 pages
-
-
-
-- Charts and visualizations
-- Industry benchmarks
-- Future projections
-
-
-
-- Include confidential customer names
-- Exceed 5 pages
-- Use technical jargon without definitions
-
-
-```
-
-**Benefits**: Clear priorities and constraints prevent misalignment.
-
-
-
-
-
-Define what success looks like. How will Claude know it succeeded?
-
-
-
-```xml
-
-Process the CSV file and generate a report.
-
-```
-
-**Problem**: When is this task complete? What defines success?
-
-
-
-```xml
-
-Process the CSV file and generate a summary report.
-
-
-
-- All rows in CSV successfully parsed
-- No data validation errors
-- Report generated with all required sections
-- Report saved to output/report.md
-- Output file is valid markdown
-- Process completes without errors
-
-```
-
-**Benefits**: Clear completion criteria eliminate ambiguity about when the task is done.
-
-
-
-
-
-Test your instructions by asking: "Could I hand these instructions to a junior developer and expect correct results?"
-
-
-
-1. Read your skill instructions
-2. Remove context only you have (project knowledge, unstated assumptions)
-3. Identify ambiguous terms or vague requirements
-4. Add specificity where needed
-5. Test with someone who doesn't have your context
-6. Iterate based on their questions and confusion
-
-If a human with minimal context struggles, Claude will too.
-
-
-
-
-
-❌ **Unclear**:
-```xml
-
-Clean the data and remove bad entries.
-
-```
-
-✅ **Clear**:
-```xml
-
-
-1. Remove rows where required fields (name, email, date) are empty
-2. Standardize date format to YYYY-MM-DD
-3. Remove duplicate entries based on email address
-4. Validate email format (must contain @ and domain)
-5. Save cleaned data to output/cleaned_data.csv
-
-
-
-- No empty required fields
-- All dates in YYYY-MM-DD format
-- No duplicate emails
-- All emails valid format
-- Output file created successfully
-
-
-```
-
-
-
-❌ **Unclear**:
-```xml
-
-Write a function to process user input.
-
-```
-
-✅ **Clear**:
-```xml
-
-
-Write a Python function with this signature:
-
-```python
-def process_user_input(raw_input: str) -> dict:
- """
- Validate and parse user input.
-
- Args:
- raw_input: Raw string from user (format: "name:email:age")
-
- Returns:
- dict with keys: name (str), email (str), age (int)
-
- Raises:
- ValueError: If input format is invalid
- """
-```
-
-**Requirements**:
-- Split input on colon delimiter
-- Validate email contains @ and domain
-- Convert age to integer, raise ValueError if not numeric
-- Return dictionary with specified keys
-- Include docstring and type hints
-
-
-
-- Function signature matches specification
-- All validation checks implemented
-- Proper error handling for invalid input
-- Type hints included
-- Docstring included
-
-
-```
-
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md b/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md
deleted file mode 100644
index 23c7639..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md
+++ /dev/null
@@ -1,404 +0,0 @@
-# Skill Authoring Best Practices
-
-Source: [platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
-
-## Core Principles
-
-### Concise is Key
-
-The context window is a public good. Your Skill shares the context window with everything else Claude needs to know.
-
-**Default assumption**: Claude is already very smart. Only add context Claude doesn't already have.
-
-Challenge each piece of information:
-- "Does Claude really need this explanation?"
-- "Can I assume Claude knows this?"
-- "Does this paragraph justify its token cost?"
-
-**Good example (concise, ~50 tokens):**
-```markdown
-## Extract PDF text
-
-Use pdfplumber for text extraction:
-
-```python
-import pdfplumber
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-```
-
-**Bad example (too verbose, ~150 tokens):**
-```markdown
-## Extract PDF text
-
-PDF (Portable Document Format) files are a common file format that contains
-text, images, and other content. To extract text from a PDF, you'll need to
-use a library. There are many libraries available...
-```
-
-### Set Appropriate Degrees of Freedom
-
-Match specificity to task fragility and variability.
-
-**High freedom** (multiple valid approaches):
-```markdown
-## Code review process
-
-1. Analyze the code structure and organization
-2. Check for potential bugs or edge cases
-3. Suggest improvements for readability
-4. Verify adherence to project conventions
-```
-
-**Medium freedom** (preferred pattern with variation):
-```markdown
-## Generate report
-
-Use this template and customize as needed:
-
-```python
-def generate_report(data, format="markdown"):
- # Process data
- # Generate output in specified format
-```
-```
-
-**Low freedom** (fragile, exact sequence required):
-```markdown
-## Database migration
-
-Run exactly this script:
-
-```bash
-python scripts/migrate.py --verify --backup
-```
-
-Do not modify the command or add flags.
-```
-
-### Test With All Models
-
-Skills act as additions to models. Test with Haiku, Sonnet, and Opus.
-
-- **Haiku**: Does the Skill provide enough guidance?
-- **Sonnet**: Is the Skill clear and efficient?
-- **Opus**: Does the Skill avoid over-explaining?
-
-## Naming Conventions
-
-Use **gerund form** (verb + -ing) for Skill names:
-
-**Good:**
-- `processing-pdfs`
-- `analyzing-spreadsheets`
-- `managing-databases`
-- `testing-code`
-- `writing-documentation`
-
-**Acceptable alternatives:**
-- Noun phrases: `pdf-processing`, `spreadsheet-analysis`
-- Action-oriented: `process-pdfs`, `analyze-spreadsheets`
-
-**Avoid:**
-- Vague: `helper`, `utils`, `tools`
-- Generic: `documents`, `data`, `files`
-- Reserved: `anthropic-*`, `claude-*`
-
-## Writing Effective Descriptions
-
-**Always write in third person.** The description is injected into the system prompt.
-
-**Be specific and include key terms:**
-
-```yaml
-# PDF Processing skill
-description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
-
-# Excel Analysis skill
-description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
-
-# Git Commit Helper skill
-description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.
-```
-
-**Avoid vague descriptions:**
-```yaml
-description: Helps with documents # Too vague!
-description: Processes data # Too generic!
-description: Does stuff with files # Useless!
-```
-
-## Progressive Disclosure Patterns
-
-### Pattern 1: High-level guide with references
-
-```markdown
----
-name: pdf-processing
-description: Extracts text and tables from PDF files, fills forms, merges documents.
----
-
-# PDF Processing
-
-## Quick start
-
-```python
-import pdfplumber
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-
-## Advanced features
-
-**Form filling**: See [FORMS.md](FORMS.md)
-**API reference**: See [REFERENCE.md](REFERENCE.md)
-**Examples**: See [EXAMPLES.md](EXAMPLES.md)
-```
-
-### Pattern 2: Domain-specific organization
-
-```
-bigquery-skill/
-├── SKILL.md (overview and navigation)
-└── reference/
- ├── finance.md (revenue, billing)
- ├── sales.md (opportunities, pipeline)
- ├── product.md (API usage, features)
- └── marketing.md (campaigns, attribution)
-```
-
-### Pattern 3: Conditional details
-
-```markdown
-# DOCX Processing
-
-## Creating documents
-
-Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
-
-## Editing documents
-
-For simple edits, modify the XML directly.
-
-**For tracked changes**: See [REDLINING.md](REDLINING.md)
-**For OOXML details**: See [OOXML.md](OOXML.md)
-```
-
-## Keep References One Level Deep
-
-Claude may partially read files when they're referenced from other referenced files.
-
-**Bad (too deep):**
-```markdown
-# SKILL.md
-See [advanced.md](advanced.md)...
-
-# advanced.md
-See [details.md](details.md)...
-
-# details.md
-Here's the actual information...
-```
-
-**Good (one level deep):**
-```markdown
-# SKILL.md
-
-**Basic usage**: [in SKILL.md]
-**Advanced features**: See [advanced.md](advanced.md)
-**API reference**: See [reference.md](reference.md)
-**Examples**: See [examples.md](examples.md)
-```
-
-## Workflows and Feedback Loops
-
-### Workflow with Checklist
-
-```markdown
-## Research synthesis workflow
-
-Copy this checklist:
-
-```
-- [ ] Step 1: Read all source documents
-- [ ] Step 2: Identify key themes
-- [ ] Step 3: Cross-reference claims
-- [ ] Step 4: Create structured summary
-- [ ] Step 5: Verify citations
-```
-
-**Step 1: Read all source documents**
-
-Review each document in `sources/`. Note main arguments.
-...
-```
-
-### Feedback Loop Pattern
-
-```markdown
-## Document editing process
-
-1. Make your edits to `word/document.xml`
-2. **Validate immediately**: `python scripts/validate.py unpacked_dir/`
-3. If validation fails:
- - Review the error message
- - Fix the issues
- - Run validation again
-4. **Only proceed when validation passes**
-5. Rebuild: `python scripts/pack.py unpacked_dir/ output.docx`
-```
-
-## Common Patterns
-
-### Template Pattern
-
-```markdown
-## Report structure
-
-Use this template:
-
-```markdown
-# [Analysis Title]
-
-## Executive summary
-[One-paragraph overview]
-
-## Key findings
-- Finding 1 with supporting data
-- Finding 2 with supporting data
-
-## Recommendations
-1. Specific actionable recommendation
-2. Specific actionable recommendation
-```
-```
-
-### Examples Pattern
-
-```markdown
-## Commit message format
-
-**Example 1:**
-Input: Added user authentication with JWT tokens
-Output:
-```
-feat(auth): implement JWT-based authentication
-
-Add login endpoint and token validation middleware
-```
-
-**Example 2:**
-Input: Fixed bug where dates displayed incorrectly
-Output:
-```
-fix(reports): correct date formatting in timezone conversion
-```
-```
-
-### Conditional Workflow Pattern
-
-```markdown
-## Document modification
-
-1. Determine the modification type:
-
- **Creating new content?** → Follow "Creation workflow"
- **Editing existing?** → Follow "Editing workflow"
-
-2. Creation workflow:
- - Use docx-js library
- - Build document from scratch
-
-3. Editing workflow:
- - Unpack existing document
- - Modify XML directly
- - Validate after each change
-```
-
-## Content Guidelines
-
-### Avoid Time-Sensitive Information
-
-**Bad:**
-```markdown
-If you're doing this before August 2025, use the old API.
-```
-
-**Good:**
-```markdown
-## Current method
-
-Use the v2 API endpoint: `api.example.com/v2/messages`
-
-## Old patterns
-
-
-Legacy v1 API (deprecated 2025-08)
-The v1 API used: `api.example.com/v1/messages`
-
-```
-
-### Use Consistent Terminology
-
-**Good - Consistent:**
-- Always "API endpoint"
-- Always "field"
-- Always "extract"
-
-**Bad - Inconsistent:**
-- Mix "API endpoint", "URL", "API route", "path"
-- Mix "field", "box", "element", "control"
-
-## Anti-Patterns to Avoid
-
-### Windows-Style Paths
-
-- **Good**: `scripts/helper.py`, `reference/guide.md`
-- **Avoid**: `scripts\helper.py`, `reference\guide.md`
-
-### Too Many Options
-
-**Bad:**
-```markdown
-You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or...
-```
-
-**Good:**
-```markdown
-Use pdfplumber for text extraction:
-```python
-import pdfplumber
-```
-
-For scanned PDFs requiring OCR, use pdf2image with pytesseract instead.
-```
-
-## Checklist for Effective Skills
-
-### Core Quality
-- [ ] Description is specific and includes key terms
-- [ ] Description includes both what and when
-- [ ] SKILL.md body under 500 lines
-- [ ] Additional details in separate files
-- [ ] No time-sensitive information
-- [ ] Consistent terminology
-- [ ] Examples are concrete
-- [ ] References one level deep
-- [ ] Progressive disclosure used appropriately
-- [ ] Workflows have clear steps
-
-### Code and Scripts
-- [ ] Scripts handle errors explicitly
-- [ ] No "voodoo constants" (all values justified)
-- [ ] Required packages listed
-- [ ] Scripts have clear documentation
-- [ ] No Windows-style paths
-- [ ] Validation steps for critical operations
-- [ ] Feedback loops for quality-critical tasks
-
-### Testing
-- [ ] At least three test scenarios
-- [ ] Tested with Haiku, Sonnet, and Opus
-- [ ] Tested with real usage scenarios
-- [ ] Team feedback incorporated
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md b/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md
deleted file mode 100644
index 4f184f7..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md
+++ /dev/null
@@ -1,595 +0,0 @@
-
-This reference documents common patterns for skill authoring, including templates, examples, terminology consistency, and anti-patterns. All patterns use pure XML structure.
-
-
-
-
-Provide templates for output format. Match the level of strictness to your needs.
-
-
-
-Use when output format must be exact and consistent:
-
-```xml
-
-ALWAYS use this exact template structure:
-
-```markdown
-# [Analysis Title]
-
-## Executive summary
-[One-paragraph overview of key findings]
-
-## Key findings
-- Finding 1 with supporting data
-- Finding 2 with supporting data
-- Finding 3 with supporting data
-
-## Recommendations
-1. Specific actionable recommendation
-2. Specific actionable recommendation
-```
-
-```
-
-**When to use**: Compliance reports, standardized formats, automated processing
-
-
-
-Use when Claude should adapt the format based on context:
-
-```xml
-
-Here is a sensible default format, but use your best judgment:
-
-```markdown
-# [Analysis Title]
-
-## Executive summary
-[Overview]
-
-## Key findings
-[Adapt sections based on what you discover]
-
-## Recommendations
-[Tailor to the specific context]
-```
-
-Adjust sections as needed for the specific analysis type.
-
-```
-
-**When to use**: Exploratory analysis, context-dependent formatting, creative tasks
-
-
-
-
-
-For skills where output quality depends on seeing examples, provide input/output pairs.
-
-
-
-```xml
-
-Generate commit messages following conventional commit format.
-
-
-
-Generate commit messages following these examples:
-
-
-Added user authentication with JWT tokens
-
-
-
-
-Fixed bug where dates displayed incorrectly in reports
-
-
-
-Follow this style: type(scope): brief description, then detailed explanation.
-
-```
-
-
-
-- Output format has nuances that text explanations can't capture
-- Pattern recognition is easier than rule following
-- Examples demonstrate edge cases
-- Multi-shot learning improves quality
-
-
-
-
-
-Choose one term and use it throughout the skill. Inconsistent terminology confuses Claude and reduces execution quality.
-
-
-
-Consistent usage:
-- Always "API endpoint" (not mixing with "URL", "API route", "path")
-- Always "field" (not mixing with "box", "element", "control")
-- Always "extract" (not mixing with "pull", "get", "retrieve")
-
-```xml
-
-Extract data from API endpoints using field mappings.
-
-
-
-1. Identify the API endpoint
-2. Map response fields to your schema
-3. Extract field values
-
-```
-
-
-
-Inconsistent usage creates confusion:
-
-```xml
-
-Pull data from API routes using element mappings.
-
-
-
-1. Identify the URL
-2. Map response boxes to your schema
-3. Retrieve control values
-
-```
-
-Claude must now interpret: Are "API routes" and "URLs" the same? Are "fields", "boxes", "elements", and "controls" the same?
-
-
-
-1. Choose terminology early in skill development
-2. Document key terms in `` or ``
-3. Use find/replace to enforce consistency
-4. Review reference files for consistent usage
-
-
-
-
-
-Provide a default approach with an escape hatch for special cases, not a list of alternatives. Too many options paralyze decision-making.
-
-
-
-Clear default with escape hatch:
-
-```xml
-
-Use pdfplumber for text extraction:
-
-```python
-import pdfplumber
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-
-For scanned PDFs requiring OCR, use pdf2image with pytesseract instead.
-
-```
-
-
-
-Too many options creates decision paralysis:
-
-```xml
-
-You can use any of these libraries:
-
-- **pypdf**: Good for basic extraction
-- **pdfplumber**: Better for tables
-- **PyMuPDF**: Faster but more complex
-- **pdf2image**: For scanned documents
-- **pdfminer**: Low-level control
-- **tabula-py**: Table-focused
-
-Choose based on your needs.
-
-```
-
-Claude must now research and compare all options before starting. This wastes tokens and time.
-
-
-
-1. Recommend ONE default approach
-2. Explain when to use the default (implied: most of the time)
-3. Add ONE escape hatch for edge cases
-4. Link to advanced reference if multiple alternatives truly needed
-
-
-
-
-
-Common mistakes to avoid when authoring skills.
-
-
-
-❌ **BAD**: Using markdown headings in skill body:
-
-```markdown
-# PDF Processing
-
-## Quick start
-Extract text with pdfplumber...
-
-## Advanced features
-Form filling requires additional setup...
-```
-
-✅ **GOOD**: Using pure XML structure:
-
-```xml
-
-PDF processing with text extraction, form filling, and merging capabilities.
-
-
-
-Extract text with pdfplumber...
-
-
-
-Form filling requires additional setup...
-
-```
-
-**Why it matters**: XML provides semantic meaning, reliable parsing, and token efficiency.
-
-
-
-❌ **BAD**:
-```yaml
-description: Helps with documents
-```
-
-✅ **GOOD**:
-```yaml
-description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
-```
-
-**Why it matters**: Vague descriptions prevent Claude from discovering and using the skill appropriately.
-
-
-
-❌ **BAD**:
-```yaml
-description: I can help you process Excel files and generate reports
-```
-
-✅ **GOOD**:
-```yaml
-description: Processes Excel files and generates reports. Use when analyzing spreadsheets or .xlsx files.
-```
-
-**Why it matters**: Skills must use third person. First/second person breaks the skill metadata pattern.
-
-
-
-❌ **BAD**: Directory name doesn't match skill name or verb-noun convention:
-- Directory: `facebook-ads`, Name: `facebook-ads-manager`
-- Directory: `stripe-integration`, Name: `stripe`
-- Directory: `helper-scripts`, Name: `helper`
-
-✅ **GOOD**: Consistent verb-noun convention:
-- Directory: `manage-facebook-ads`, Name: `manage-facebook-ads`
-- Directory: `setup-stripe-payments`, Name: `setup-stripe-payments`
-- Directory: `process-pdfs`, Name: `process-pdfs`
-
-**Why it matters**: Consistency in naming makes skills discoverable and predictable.
-
-
-
-❌ **BAD**:
-```xml
-
-You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or pdfminer, or tabula-py...
-
-```
-
-✅ **GOOD**:
-```xml
-
-Use pdfplumber for text extraction:
-
-```python
-import pdfplumber
-```
-
-For scanned PDFs requiring OCR, use pdf2image with pytesseract instead.
-
-```
-
-**Why it matters**: Decision paralysis. Provide one default approach with escape hatch for special cases.
-
-
-
-❌ **BAD**: References nested multiple levels:
-```
-SKILL.md → advanced.md → details.md → examples.md
-```
-
-✅ **GOOD**: References one level deep from SKILL.md:
-```
-SKILL.md → advanced.md
-SKILL.md → details.md
-SKILL.md → examples.md
-```
-
-**Why it matters**: Claude may only partially read deeply nested files. Keep references one level deep from SKILL.md.
-
-
-
-❌ **BAD**:
-```xml
-
-See scripts\validate.py for validation
-
-```
-
-✅ **GOOD**:
-```xml
-
-See scripts/validate.py for validation
-
-```
-
-**Why it matters**: Always use forward slashes for cross-platform compatibility.
-
-
-
-**Problem**: When showing examples of dynamic context syntax (exclamation mark + backticks) or file references (@ prefix), the skill loader executes these during skill loading.
-
-❌ **BAD** - These execute during skill load:
-```xml
-
-Load current status with: !`git status`
-Review dependencies in: @package.json
-
-```
-
-✅ **GOOD** - Add space to prevent execution:
-```xml
-
-Load current status with: ! `git status` (remove space before backtick in actual usage)
-Review dependencies in: @ package.json (remove space after @ in actual usage)
-
-```
-
-**When this applies**:
-- Skills that teach users about dynamic context (slash commands, prompts)
-- Any documentation showing the exclamation mark prefix syntax or @ file references
-- Skills with example commands or file paths that shouldn't execute during loading
-
-**Why it matters**: Without the space, these execute during skill load, causing errors or unwanted file reads.
-
-
-
-❌ **BAD**: Missing required tags:
-```xml
-
-Use this tool for processing...
-
-```
-
-✅ **GOOD**: All required tags present:
-```xml
-
-Process data files with validation and transformation.
-
-
-
-Use this tool for processing...
-
-
-
-- Input file successfully processed
-- Output file validates without errors
-- Transformation applied correctly
-
-```
-
-**Why it matters**: Every skill must have ``, ``, and `` (or ``).
-
-
-
-❌ **BAD**: Mixing XML tags with markdown headings:
-```markdown
-
-PDF processing capabilities
-
-
-## Quick start
-
-Extract text with pdfplumber...
-
-## Advanced features
-
-Form filling...
-```
-
-✅ **GOOD**: Pure XML throughout:
-```xml
-
-PDF processing capabilities
-
-
-
-Extract text with pdfplumber...
-
-
-
-Form filling...
-
-```
-
-**Why it matters**: Consistency in structure. Either use pure XML or pure markdown (prefer XML).
-
-
-
-❌ **BAD**: Forgetting to close XML tags:
-```xml
-
-Process PDF files
-
-
-Use pdfplumber...
-
-```
-
-✅ **GOOD**: Properly closed tags:
-```xml
-
-Process PDF files
-
-
-
-Use pdfplumber...
-
-```
-
-**Why it matters**: Unclosed tags break XML parsing and create ambiguous boundaries.
-
-
-
-
-
-Keep SKILL.md concise by linking to detailed reference files. Claude loads reference files only when needed.
-
-
-
-```xml
-
-Manage Facebook Ads campaigns, ad sets, and ads via the Marketing API.
-
-
-
-
-See [basic-operations.md](basic-operations.md) for campaign creation and management.
-
-
-
-
-**Custom audiences**: See [audiences.md](audiences.md)
-**Conversion tracking**: See [conversions.md](conversions.md)
-**Budget optimization**: See [budgets.md](budgets.md)
-**API reference**: See [api-reference.md](api-reference.md)
-
-```
-
-**Benefits**:
-- SKILL.md stays under 500 lines
-- Claude only reads relevant reference files
-- Token usage scales with task complexity
-- Easier to maintain and update
-
-
-
-
-
-For skills with validation steps, make validation scripts verbose and specific.
-
-
-
-```xml
-
-After making changes, validate immediately:
-
-```bash
-python scripts/validate.py output_dir/
-```
-
-If validation fails, fix errors before continuing. Validation errors include:
-
-- **Field not found**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
-- **Type mismatch**: "Field 'order_total' expects number, got string"
-- **Missing required field**: "Required field 'customer_name' is missing"
-
-Only proceed when validation passes with zero errors.
-
-```
-
-**Why verbose errors help**:
-- Claude can fix issues without guessing
-- Specific error messages reduce iteration cycles
-- Available options shown in error messages
-
-
-
-
-
-For complex multi-step workflows, provide a checklist Claude can copy and track progress.
-
-
-
-```xml
-
-Copy this checklist and check off items as you complete them:
-
-```
-Task Progress:
-- [ ] Step 1: Analyze the form (run analyze_form.py)
-- [ ] Step 2: Create field mapping (edit fields.json)
-- [ ] Step 3: Validate mapping (run validate_fields.py)
-- [ ] Step 4: Fill the form (run fill_form.py)
-- [ ] Step 5: Verify output (run verify_output.py)
-```
-
-
-**Analyze the form**
-
-Run: `python scripts/analyze_form.py input.pdf`
-
-This extracts form fields and their locations, saving to `fields.json`.
-
-
-
-**Create field mapping**
-
-Edit `fields.json` to add values for each field.
-
-
-
-**Validate mapping**
-
-Run: `python scripts/validate_fields.py fields.json`
-
-Fix any validation errors before continuing.
-
-
-
-**Fill the form**
-
-Run: `python scripts/fill_form.py input.pdf fields.json output.pdf`
-
-
-
-**Verify output**
-
-Run: `python scripts/verify_output.py output.pdf`
-
-If verification fails, return to Step 2.
-
-
-```
-
-**Benefits**:
-- Clear progress tracking
-- Prevents skipping steps
-- Easy to resume after interruption
-
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md b/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md
deleted file mode 100644
index 35313e4..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md
+++ /dev/null
@@ -1,437 +0,0 @@
-
-Core principles guide skill authoring decisions. These principles ensure skills are efficient, effective, and maintainable across different models and use cases.
-
-
-
-
-Skills use pure XML structure for consistent parsing, efficient token usage, and improved Claude performance.
-
-
-
-
-XML enforces consistent structure across all skills. All skills use the same tag names for the same purposes:
-- `` always defines what the skill does
-- `` always provides immediate guidance
-- `` always defines completion
-
-This consistency makes skills predictable and easier to maintain.
-
-
-
-XML provides unambiguous boundaries and semantic meaning. Claude can reliably:
-- Identify section boundaries (where content starts and ends)
-- Understand content purpose (what role each section plays)
-- Skip irrelevant sections (progressive disclosure)
-- Parse programmatically (validation tools can check structure)
-
-Markdown headings are just visual formatting. Claude must infer meaning from heading text, which is less reliable.
-
-
-
-XML tags are more efficient than markdown headings:
-
-**Markdown headings**:
-```markdown
-## Quick start
-## Workflow
-## Advanced features
-## Success criteria
-```
-Total: ~20 tokens, no semantic meaning to Claude
-
-**XML tags**:
-```xml
-
-
-
-
-```
-Total: ~15 tokens, semantic meaning built-in
-
-Savings compound across all skills in the ecosystem.
-
-
-
-Claude performs better with pure XML because:
-- Unambiguous section boundaries reduce parsing errors
-- Semantic tags convey intent directly (no inference needed)
-- Nested tags create clear hierarchies
-- Consistent structure across skills reduces cognitive load
-- Progressive disclosure works more reliably
-
-Pure XML structure is not just a style preference—it's a performance optimization.
-
-
-
-
-**Remove ALL markdown headings (#, ##, ###) from skill body content.** Replace with semantic XML tags. Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
-
-
-
-Every skill MUST have:
-- `` - What the skill does and why it matters
-- `` - Immediate, actionable guidance
-- `` or `` - How to know it worked
-
-See [use-xml-tags.md](use-xml-tags.md) for conditional tags and intelligence rules.
-
-
-
-
-
-The context window is shared. Your skill shares it with the system prompt, conversation history, other skills' metadata, and the actual request.
-
-
-
-Only add context Claude doesn't already have. Challenge each piece of information:
-- "Does Claude really need this explanation?"
-- "Can I assume Claude knows this?"
-- "Does this paragraph justify its token cost?"
-
-Assume Claude is smart. Don't explain obvious concepts.
-
-
-
-**Concise** (~50 tokens):
-```xml
-
-Extract PDF text with pdfplumber:
-
-```python
-import pdfplumber
-
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-
-```
-
-**Verbose** (~150 tokens):
-```xml
-
-PDF files are a common file format used for documents. To extract text from them, we'll use a Python library called pdfplumber. First, you'll need to import the library, then open the PDF file using the open method, and finally extract the text from each page. Here's how to do it:
-
-```python
-import pdfplumber
-
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-
-This code opens the PDF and extracts text from the first page.
-
-```
-
-The concise version assumes Claude knows what PDFs are, understands Python imports, and can read code. All those assumptions are correct.
-
-
-
-Add explanation when:
-- Concept is domain-specific (not general programming knowledge)
-- Pattern is non-obvious or counterintuitive
-- Context affects behavior in subtle ways
-- Trade-offs require judgment
-
-Don't add explanation for:
-- Common programming concepts (loops, functions, imports)
-- Standard library usage (reading files, making HTTP requests)
-- Well-known tools (git, npm, pip)
-- Obvious next steps
-
-
-
-
-
-Match the level of specificity to the task's fragility and variability. Give Claude more freedom for creative tasks, less freedom for fragile operations.
-
-
-
-
-- Multiple approaches are valid
-- Decisions depend on context
-- Heuristics guide the approach
-- Creative solutions welcome
-
-
-
-```xml
-
-Review code for quality, bugs, and maintainability.
-
-
-
-1. Analyze the code structure and organization
-2. Check for potential bugs or edge cases
-3. Suggest improvements for readability and maintainability
-4. Verify adherence to project conventions
-
-
-
-- All major issues identified
-- Suggestions are actionable and specific
-- Review balances praise and criticism
-
-```
-
-Claude has freedom to adapt the review based on what the code needs.
-
-
-
-
-
-- A preferred pattern exists
-- Some variation is acceptable
-- Configuration affects behavior
-- Template can be adapted
-
-
-
-```xml
-
-Generate reports with customizable format and sections.
-
-
-
-Use this template and customize as needed:
-
-```python
-def generate_report(data, format="markdown", include_charts=True):
- # Process data
- # Generate output in specified format
- # Optionally include visualizations
-```
-
-
-
-- Report includes all required sections
-- Format matches user preference
-- Data accurately represented
-
-```
-
-Claude can customize the template based on requirements.
-
-
-
-
-
-- Operations are fragile and error-prone
-- Consistency is critical
-- A specific sequence must be followed
-- Deviation causes failures
-
-
-
-```xml
-
-Run database migration with exact sequence to prevent data loss.
-
-
-
-Run exactly this script:
-
-```bash
-python scripts/migrate.py --verify --backup
-```
-
-**Do not modify the command or add additional flags.**
-
-
-
-- Migration completes without errors
-- Backup created before migration
-- Verification confirms data integrity
-
-```
-
-Claude must follow the exact command with no variation.
-
-
-
-
-The key is matching specificity to fragility:
-
-- **Fragile operations** (database migrations, payment processing, security): Low freedom, exact instructions
-- **Standard operations** (API calls, file processing, data transformation): Medium freedom, preferred pattern with flexibility
-- **Creative operations** (code review, content generation, analysis): High freedom, heuristics and principles
-
-Mismatched specificity causes problems:
-- Too much freedom on fragile tasks → errors and failures
-- Too little freedom on creative tasks → rigid, suboptimal outputs
-
-
-
-
-
-Skills act as additions to models, so effectiveness depends on the underlying model. What works for Opus might need more detail for Haiku.
-
-
-
-Test your skill with all models you plan to use:
-
-
-**Claude Haiku** (fast, economical)
-
-Questions to ask:
-- Does the skill provide enough guidance?
-- Are examples clear and complete?
-- Do implicit assumptions become explicit?
-- Does Haiku need more structure?
-
-Haiku benefits from:
-- More explicit instructions
-- Complete examples (no partial code)
-- Clear success criteria
-- Step-by-step workflows
-
-
-
-**Claude Sonnet** (balanced)
-
-Questions to ask:
-- Is the skill clear and efficient?
-- Does it avoid over-explanation?
-- Are workflows well-structured?
-- Does progressive disclosure work?
-
-Sonnet benefits from:
-- Balanced detail level
-- XML structure for clarity
-- Progressive disclosure
-- Concise but complete guidance
-
-
-
-**Claude Opus** (powerful reasoning)
-
-Questions to ask:
-- Does the skill avoid over-explaining?
-- Can Opus infer obvious steps?
-- Are constraints clear?
-- Is context minimal but sufficient?
-
-Opus benefits from:
-- Concise instructions
-- Principles over procedures
-- High degrees of freedom
-- Trust in reasoning capabilities
-
-
-
-
-Aim for instructions that work well across all target models:
-
-**Good balance**:
-```xml
-
-Use pdfplumber for text extraction:
-
-```python
-import pdfplumber
-with pdfplumber.open("file.pdf") as pdf:
- text = pdf.pages[0].extract_text()
-```
-
-For scanned PDFs requiring OCR, use pdf2image with pytesseract instead.
-
-```
-
-This works for all models:
-- Haiku gets complete working example
-- Sonnet gets clear default with escape hatch
-- Opus gets enough context without over-explanation
-
-**Too minimal for Haiku**:
-```xml
-
-Use pdfplumber for text extraction.
-
-```
-
-**Too verbose for Opus**:
-```xml
-
-PDF files are documents that contain text. To extract that text, we use a library called pdfplumber. First, import the library at the top of your Python file. Then, open the PDF file using the pdfplumber.open() method. This returns a PDF object. Access the pages attribute to get a list of pages. Each page has an extract_text() method that returns the text content...
-
-```
-
-
-
-1. Start with medium detail level
-2. Test with target models
-3. Observe where models struggle or succeed
-4. Adjust based on actual performance
-5. Re-test and iterate
-
-Don't optimize for one model. Find the balance that works across your target models.
-
-
-
-
-
-SKILL.md serves as an overview. Reference files contain details. Claude loads reference files only when needed.
-
-
-
-Progressive disclosure keeps token usage proportional to task complexity:
-
-- Simple task: Load SKILL.md only (~500 tokens)
-- Medium task: Load SKILL.md + one reference (~1000 tokens)
-- Complex task: Load SKILL.md + multiple references (~2000 tokens)
-
-Without progressive disclosure, every task loads all content regardless of need.
-
-
-
-- Keep SKILL.md under 500 lines
-- Split detailed content into reference files
-- Keep references one level deep from SKILL.md
-- Link to references from relevant sections
-- Use descriptive reference file names
-
-See [skill-structure.md](skill-structure.md) for progressive disclosure patterns.
-
-
-
-
-
-Validation scripts are force multipliers. They catch errors that Claude might miss and provide actionable feedback.
-
-
-
-Good validation scripts:
-- Provide verbose, specific error messages
-- Show available valid options when something is invalid
-- Pinpoint exact location of problems
-- Suggest actionable fixes
-- Are deterministic and reliable
-
-See [workflows-and-validation.md](workflows-and-validation.md) for validation patterns.
-
-
-
-
-
-Use pure XML structure for consistency, parseability, and Claude performance. Required tags: objective, quick_start, success_criteria.
-
-
-
-Only add context Claude doesn't have. Assume Claude is smart. Challenge every piece of content.
-
-
-
-Match specificity to fragility. High freedom for creative tasks, low freedom for fragile operations, medium for standard work.
-
-
-
-Test with all target models. Balance detail level to work across Haiku, Sonnet, and Opus.
-
-
-
-Keep SKILL.md concise. Split details into reference files. Load reference files only when needed.
-
-
-
-Make validation scripts verbose and specific. Catch errors early with actionable feedback.
-
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md b/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md
deleted file mode 100644
index 4c9273a..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md
+++ /dev/null
@@ -1,175 +0,0 @@
-
-Even if Claude could write a script, pre-made scripts offer advantages:
-- More reliable than generated code
-- Save tokens (no need to include code in context)
-- Save time (no code generation required)
-- Ensure consistency across uses
-
-
-Make clear whether Claude should:
-- **Execute the script** (most common): "Run `analyze_form.py` to extract fields"
-- **Read it as reference** (for complex logic): "See `analyze_form.py` for the extraction algorithm"
-
-For most utility scripts, execution is preferred.
-
-
-
-When Claude executes a script via bash:
-1. Script code never enters context window
-2. Only script output consumes tokens
-3. Far more efficient than having Claude generate equivalent code
-
-
-
-
-
-**Best practice**: Place all executable scripts in a `scripts/` subdirectory within the skill folder.
-
-```
-skill-name/
-├── SKILL.md
-├── scripts/
-│ ├── main_utility.py
-│ ├── helper_script.py
-│ └── validator.py
-└── references/
- └── api-docs.md
-```
-
-**Benefits**:
-- Keeps skill root clean and organized
-- Clear separation between documentation and executable code
-- Consistent pattern across all skills
-- Easy to reference: `python scripts/script_name.py`
-
-**Reference pattern**: In SKILL.md, reference scripts using the `scripts/` path:
-
-```bash
-python ~/.claude/skills/skill-name/scripts/analyze.py input.har
-```
-
-
-
-
-
-## Utility scripts
-
-**analyze_form.py**: Extract all form fields from PDF
-
-```bash
-python scripts/analyze_form.py input.pdf > fields.json
-```
-
-Output format:
-```json
-{
- "field_name": { "type": "text", "x": 100, "y": 200 },
- "signature": { "type": "sig", "x": 150, "y": 500 }
-}
-```
-
-**validate_boxes.py**: Check for overlapping bounding boxes
-
-```bash
-python scripts/validate_boxes.py fields.json
-# Returns: "OK" or lists conflicts
-```
-
-**fill_form.py**: Apply field values to PDF
-
-```bash
-python scripts/fill_form.py input.pdf fields.json output.pdf
-```
-
-
-
-
-Handle error conditions rather than punting to Claude.
-
-
-```python
-def process_file(path):
- """Process a file, creating it if it doesn't exist."""
- try:
- with open(path) as f:
- return f.read()
- except FileNotFoundError:
- print(f"File {path} not found, creating default")
- with open(path, 'w') as f:
- f.write('')
- return ''
- except PermissionError:
- print(f"Cannot access {path}, using default")
- return ''
-```
-
-
-
-```python
-def process_file(path):
- # Just fail and let Claude figure it out
- return open(path).read()
-```
-
-
-
-Document configuration parameters to avoid "voodoo constants":
-
-
-```python
-# HTTP requests typically complete within 30 seconds
-REQUEST_TIMEOUT = 30
-
-# Three retries balances reliability vs speed
-MAX_RETRIES = 3
-```
-
-
-
-```python
-TIMEOUT = 47 # Why 47?
-RETRIES = 5 # Why 5?
-```
-
-
-
-
-
-
-Skills run in code execution environment with platform-specific limitations:
-- **claude.ai**: Can install packages from npm and PyPI
-- **Anthropic API**: No network access and no runtime package installation
-
-
-
-List required packages in your SKILL.md and verify they're available.
-
-
-Install required package: `pip install pypdf`
-
-Then use it:
-
-```python
-from pypdf import PdfReader
-reader = PdfReader("file.pdf")
-```
-
-
-
-"Use the pdf library to process the file."
-
-
-
-
-
-If your Skill uses MCP (Model Context Protocol) tools, always use fully qualified tool names.
-
-ServerName:tool_name
-
-
-- Use the BigQuery:bigquery_schema tool to retrieve table schemas.
-- Use the GitHub:create_issue tool to create issues.
-
-
-Without the server prefix, Claude may fail to locate the tool, especially when multiple MCP servers are available.
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md b/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md
deleted file mode 100644
index 5d41d53..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md
+++ /dev/null
@@ -1,474 +0,0 @@
-
-Skills improve through iteration and testing. This reference covers evaluation-driven development, Claude A/B testing patterns, and XML structure validation during testing.
-
-
-
-
-Create evaluations BEFORE writing extensive documentation. This ensures your skill solves real problems rather than documenting imagined ones.
-
-
-
-
-**Identify gaps**: Run Claude on representative tasks without a skill. Document specific failures or missing context.
-
-
-
-**Create evaluations**: Build three scenarios that test these gaps.
-
-
-
-**Establish baseline**: Measure Claude's performance without the skill.
-
-
-
-**Write minimal instructions**: Create just enough content to address the gaps and pass evaluations.
-
-
-
-**Iterate**: Execute evaluations, compare against baseline, and refine.
-
-
-
-
-```json
-{
- "skills": ["pdf-processing"],
- "query": "Extract all text from this PDF file and save it to output.txt",
- "files": ["test-files/document.pdf"],
- "expected_behavior": [
- "Successfully reads the PDF file using appropriate library",
- "Extracts text content from all pages without missing any",
- "Saves extracted text to output.txt in clear, readable format"
- ]
-}
-```
-
-
-
-- Prevents documenting imagined problems
-- Forces clarity about what success looks like
-- Provides objective measurement of skill effectiveness
-- Keeps skill focused on actual needs
-- Enables quantitative improvement tracking
-
-
-
-
-
-The most effective skill development uses Claude itself. Work with "Claude A" (expert who helps refine) to create skills used by "Claude B" (agent executing tasks).
-
-
-
-
-
-**Complete task without skill**: Work through problem with Claude A, noting what context you repeatedly provide.
-
-
-
-**Ask Claude A to create skill**: "Create a skill that captures this pattern we just used"
-
-
-
-**Review for conciseness**: Remove unnecessary explanations.
-
-
-
-**Improve architecture**: Organize content with progressive disclosure.
-
-
-
-**Test with Claude B**: Use fresh instance to test on real tasks.
-
-
-
-**Iterate based on observation**: Return to Claude A with specific issues observed.
-
-
-
-
-Claude models understand skill format natively. Simply ask Claude to create a skill and it will generate properly structured SKILL.md content.
-
-
-
-
-
-
-**Use skill in real workflows**: Give Claude B actual tasks.
-
-
-
-**Observe behavior**: Where does it struggle, succeed, or make unexpected choices?
-
-
-
-**Return to Claude A**: Share observations and current SKILL.md.
-
-
-
-**Review suggestions**: Claude A might suggest reorganization, stronger language, or workflow restructuring.
-
-
-
-**Apply and test**: Update skill and test again.
-
-
-
-**Repeat**: Continue based on real usage, not assumptions.
-
-
-
-
-- **Unexpected exploration paths**: Structure might not be intuitive
-- **Missed connections**: Links might need to be more explicit
-- **Overreliance on sections**: Consider moving frequently-read content to main SKILL.md
-- **Ignored content**: Poorly signaled or unnecessary files
-- **Critical metadata**: The name and description in your skill's metadata are critical for discovery
-
-
-
-
-
-
-Test with all models you plan to use. Different models have different strengths and need different levels of detail.
-
-
-
-**Claude Haiku** (fast, economical)
-
-Questions to ask:
-- Does the skill provide enough guidance?
-- Are examples clear and complete?
-- Do implicit assumptions become explicit?
-- Does Haiku need more structure?
-
-Haiku benefits from:
-- More explicit instructions
-- Complete examples (no partial code)
-- Clear success criteria
-- Step-by-step workflows
-
-
-
-**Claude Sonnet** (balanced)
-
-Questions to ask:
-- Is the skill clear and efficient?
-- Does it avoid over-explanation?
-- Are workflows well-structured?
-- Does progressive disclosure work?
-
-Sonnet benefits from:
-- Balanced detail level
-- XML structure for clarity
-- Progressive disclosure
-- Concise but complete guidance
-
-
-
-**Claude Opus** (powerful reasoning)
-
-Questions to ask:
-- Does the skill avoid over-explaining?
-- Can Opus infer obvious steps?
-- Are constraints clear?
-- Is context minimal but sufficient?
-
-Opus benefits from:
-- Concise instructions
-- Principles over procedures
-- High degrees of freedom
-- Trust in reasoning capabilities
-
-
-
-What works for Opus might need more detail for Haiku. Aim for instructions that work well across all target models. Find the balance that serves your target audience.
-
-See [core-principles.md](core-principles.md) for model testing examples.
-
-
-
-
-
-During testing, validate that your skill's XML structure is correct and complete.
-
-
-
-After updating a skill, verify:
-
-
-- ✅ `` tag exists and defines what skill does
-- ✅ `` tag exists with immediate guidance
-- ✅ `` or `` tag exists
-
-
-
-- ✅ No `#`, `##`, or `###` headings in skill body
-- ✅ All sections use XML tags instead
-- ✅ Markdown formatting within tags is preserved (bold, italic, lists, code blocks)
-
-
-
-- ✅ All XML tags properly closed
-- ✅ Nested tags have correct hierarchy
-- ✅ No unclosed tags
-
-
-
-- ✅ Conditional tags match skill complexity
-- ✅ Simple skills use required tags only
-- ✅ Complex skills add appropriate conditional tags
-- ✅ No over-engineering or under-specifying
-
-
-
-- ✅ Reference files also use pure XML structure
-- ✅ Links to reference files are correct
-- ✅ References are one level deep from SKILL.md
-
-
-
-
-When iterating on a skill:
-
-1. Make changes to XML structure
-2. **Validate XML structure** (check tags, nesting, completeness)
-3. Test with Claude on representative tasks
-4. Observe if XML structure aids or hinders Claude's understanding
-5. Iterate structure based on actual performance
-
-
-
-
-
-Iterate based on what you observe, not what you assume. Real usage reveals issues assumptions miss.
-
-
-
-
-Which sections does Claude actually read? Which are ignored? This reveals:
-- Relevance of content
-- Effectiveness of progressive disclosure
-- Whether section names are clear
-
-
-
-Which tasks cause confusion or errors? This reveals:
-- Missing context
-- Unclear instructions
-- Insufficient examples
-- Ambiguous requirements
-
-
-
-Which tasks go smoothly? This reveals:
-- Effective patterns
-- Good examples
-- Clear instructions
-- Appropriate detail level
-
-
-
-What does Claude do that surprises you? This reveals:
-- Unstated assumptions
-- Ambiguous phrasing
-- Missing constraints
-- Alternative interpretations
-
-
-
-
-1. **Observe**: Run Claude on real tasks with current skill
-2. **Document**: Note specific issues, not general feelings
-3. **Hypothesize**: Why did this issue occur?
-4. **Fix**: Make targeted changes to address specific issues
-5. **Test**: Verify fix works on same scenario
-6. **Validate**: Ensure fix doesn't break other scenarios
-7. **Repeat**: Continue with next observed issue
-
-
-
-
-
-Skills don't need to be perfect initially. Start minimal, observe usage, add what's missing.
-
-
-
-Start with:
-- Valid YAML frontmatter
-- Required XML tags: objective, quick_start, success_criteria
-- Minimal working example
-- Basic success criteria
-
-Skip initially:
-- Extensive examples
-- Edge case documentation
-- Advanced features
-- Detailed reference files
-
-
-
-Add through iteration:
-- Examples when patterns aren't clear from description
-- Edge cases when observed in real usage
-- Advanced features when users need them
-- Reference files when SKILL.md approaches 500 lines
-- Validation scripts when errors are common
-
-
-
-- Faster to initial working version
-- Additions solve real needs, not imagined ones
-- Keeps skills focused and concise
-- Progressive disclosure emerges naturally
-- Documentation stays aligned with actual usage
-
-
-
-
-
-Test that Claude can discover and use your skill when appropriate.
-
-
-
-
-Test if Claude loads your skill when it should:
-
-1. Start fresh conversation (Claude B)
-2. Ask question that should trigger skill
-3. Check if skill was loaded
-4. Verify skill was used appropriately
-
-
-
-If skill isn't discovered:
-- Check description includes trigger keywords
-- Verify description is specific, not vague
-- Ensure description explains when to use skill
-- Test with different phrasings of the same request
-
-The description is Claude's primary discovery mechanism.
-
-
-
-
-
-
-**Observation**: Skill works but uses lots of tokens
-
-**Fix**:
-- Remove obvious explanations
-- Assume Claude knows common concepts
-- Use examples instead of lengthy descriptions
-- Move advanced content to reference files
-
-
-
-**Observation**: Claude makes incorrect assumptions or misses steps
-
-**Fix**:
-- Add explicit instructions where assumptions fail
-- Provide complete working examples
-- Define edge cases
-- Add validation steps
-
-
-
-**Observation**: Skill exists but Claude doesn't load it when needed
-
-**Fix**:
-- Improve description with specific triggers
-- Add relevant keywords
-- Test description against actual user queries
-- Make description more specific about use cases
-
-
-
-**Observation**: Claude reads wrong sections or misses relevant content
-
-**Fix**:
-- Use clearer XML tag names
-- Reorganize content hierarchy
-- Move frequently-needed content earlier
-- Add explicit links to relevant sections
-
-
-
-**Observation**: Claude produces outputs that don't match expected pattern
-
-**Fix**:
-- Add more examples showing pattern
-- Make examples more complete
-- Show edge cases in examples
-- Add anti-pattern examples (what not to do)
-
-
-
-
-
-Small, frequent iterations beat large, infrequent rewrites.
-
-
-
-**Good approach**:
-1. Make one targeted change
-2. Test on specific scenario
-3. Verify improvement
-4. Commit change
-5. Move to next issue
-
-Total time: Minutes per iteration
-Iterations per day: 10-20
-Learning rate: High
-
-
-
-**Problematic approach**:
-1. Accumulate many issues
-2. Make large refactor
-3. Test everything at once
-4. Debug multiple issues simultaneously
-5. Hard to know what fixed what
-
-Total time: Hours per iteration
-Iterations per day: 1-2
-Learning rate: Low
-
-
-
-- Isolate cause and effect
-- Build pattern recognition faster
-- Less wasted work from wrong directions
-- Easier to revert if needed
-- Maintains momentum
-
-
-
-
-
-Define how you'll measure if the skill is working. Quantify success.
-
-
-
-- **Success rate**: Percentage of tasks completed correctly
-- **Token usage**: Average tokens consumed per task
-- **Iteration count**: How many tries to get correct output
-- **Error rate**: Percentage of tasks with errors
-- **Discovery rate**: How often skill loads when it should
-
-
-
-- **Output quality**: Does output meet requirements?
-- **Appropriate detail**: Too verbose or too minimal?
-- **Claude confidence**: Does Claude seem uncertain?
-- **User satisfaction**: Does skill solve the actual problem?
-
-
-
-Compare metrics before and after changes:
-- Baseline: Measure without skill
-- Initial: Measure with first version
-- Iteration N: Measure after each change
-
-Track which changes improve which metrics. Double down on effective patterns.
-
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md b/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md
deleted file mode 100644
index d04fbf7..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md
+++ /dev/null
@@ -1,134 +0,0 @@
-# Official Skill Specification (2026)
-
-Source: [code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)
-
-## Commands and Skills Are Merged
-
-Custom slash commands have been merged into skills. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way. Existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control invocation, and automatic context loading.
-
-If a skill and a command share the same name, the skill takes precedence.
-
-## SKILL.md File Structure
-
-Every skill requires a `SKILL.md` file with YAML frontmatter followed by standard markdown instructions.
-
-```markdown
----
-name: your-skill-name
-description: What it does and when to use it
----
-
-# Your Skill Name
-
-## Instructions
-Clear, step-by-step guidance.
-
-## Examples
-Concrete examples of using this skill.
-```
-
-## Complete Frontmatter Reference
-
-All fields are optional. Only `description` is recommended.
-
-| Field | Required | Description |
-|-------|----------|-------------|
-| `name` | No | Display name. Lowercase letters, numbers, hyphens only (max 64 chars). Defaults to directory name if omitted. |
-| `description` | Recommended | What it does AND when to use it (max 1024 chars). Claude uses this to decide when to apply the skill. |
-| `argument-hint` | No | Hint shown during autocomplete. Example: `[issue-number]` or `[filename] [format]` |
-| `disable-model-invocation` | No | Set `true` to prevent Claude from auto-loading. Use for manual workflows. Default: `false` |
-| `user-invocable` | No | Set `false` to hide from `/` menu. Use for background knowledge. Default: `true` |
-| `allowed-tools` | No | Tools Claude can use without permission prompts. Example: `Read, Bash(git *)` |
-| `model` | No | Model to use: `haiku`, `sonnet`, or `opus` |
-| `context` | No | Set `fork` to run in isolated subagent context |
-| `agent` | No | Subagent type when `context: fork`. Options: `Explore`, `Plan`, `general-purpose`, or custom agent name |
-| `hooks` | No | Hooks scoped to this skill's lifecycle |
-
-## Invocation Control
-
-| Frontmatter | User can invoke | Claude can invoke | When loaded into context |
-|-------------|----------------|-------------------|--------------------------|
-| (default) | Yes | Yes | Description always in context, full skill loads when invoked |
-| `disable-model-invocation: true` | Yes | No | Description not in context, full skill loads when you invoke |
-| `user-invocable: false` | No | Yes | Description always in context, full skill loads when invoked |
-
-## Skill Locations & Priority
-
-```
-Enterprise (highest priority) → Personal → Project → Plugin (lowest priority)
-```
-
-| Type | Path | Applies to |
-|------|------|-----------|
-| Enterprise | See managed settings | All users in organization |
-| Personal | `~/.claude/skills//SKILL.md` | You, across all projects |
-| Project | `.claude/skills//SKILL.md` | Anyone working in repository |
-| Plugin | `/skills//SKILL.md` | Where plugin is enabled |
-
-Plugin skills use a `plugin-name:skill-name` namespace, so they cannot conflict with other levels.
-
-## How Skills Work
-
-1. **Discovery**: Claude loads only name and description at startup (2% of context window budget)
-2. **Activation**: When your request matches a skill's description, Claude loads the full content
-3. **Execution**: Claude follows the skill's instructions
-
-## String Substitutions
-
-| Variable | Description |
-|----------|-------------|
-| `$ARGUMENTS` | All arguments passed when invoking |
-| `$ARGUMENTS[N]` | Specific argument by 0-based index |
-| `$N` | Shorthand for `$ARGUMENTS[N]` |
-| `${CLAUDE_SESSION_ID}` | Current session ID |
-
-## Dynamic Context Injection
-
-The `` !`command` `` syntax runs shell commands before content is sent to Claude:
-
-```markdown
-## Context
-- Current branch: !`git branch --show-current`
-- PR diff: !`gh pr diff`
-```
-
-Commands execute immediately and their output replaces the placeholder. Claude only sees the final result.
-
-## Progressive Disclosure
-
-```
-my-skill/
-├── SKILL.md # Entry point (required)
-├── reference.md # Detailed docs (loaded when needed)
-├── examples.md # Usage examples (loaded when needed)
-└── scripts/
- └── helper.py # Utility script (executed, not loaded)
-```
-
-Keep SKILL.md under 500 lines. Link to supporting files:
-```markdown
-For API details, see [reference.md](reference.md).
-```
-
-## Running in a Subagent
-
-Add `context: fork` to run in isolation:
-
-```yaml
----
-name: deep-research
-description: Research a topic thoroughly
-context: fork
-agent: Explore
----
-
-Research $ARGUMENTS thoroughly...
-```
-
-The skill content becomes the subagent's prompt. It won't have access to conversation history.
-
-## Distribution
-
-- **Project skills**: Commit `.claude/skills/` to version control
-- **Plugins**: Add `skills/` directory to plugin
-- **Enterprise**: Deploy organization-wide through managed settings
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md b/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md
deleted file mode 100644
index d39a1d6..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md
+++ /dev/null
@@ -1,168 +0,0 @@
-# Recommended Skill Structure
-
-The optimal structure for complex skills separates routing, workflows, and knowledge.
-
-
-```
-skill-name/
-├── SKILL.md # Router + essential principles (unavoidable)
-├── workflows/ # Step-by-step procedures (how)
-│ ├── workflow-a.md
-│ ├── workflow-b.md
-│ └── ...
-└── references/ # Domain knowledge (what)
- ├── reference-a.md
- ├── reference-b.md
- └── ...
-```
-
-
-
-## Problems This Solves
-
-**Problem 1: Context gets skipped**
-When important principles are in a separate file, Claude may not read them.
-**Solution:** Put essential principles directly in SKILL.md. They load automatically.
-
-**Problem 2: Wrong context loaded**
-A "build" task loads debugging references. A "debug" task loads build references.
-**Solution:** Intake question determines intent → routes to specific workflow → workflow specifies which references to read.
-
-**Problem 3: Monolithic skills are overwhelming**
-500+ lines of mixed content makes it hard to find relevant parts.
-**Solution:** Small router (SKILL.md) + focused workflows + reference library.
-
-**Problem 4: Procedures mixed with knowledge**
-"How to do X" mixed with "What X means" creates confusion.
-**Solution:** Workflows are procedures (steps). References are knowledge (patterns, examples).
-
-
-
-## SKILL.md Template
-
-```markdown
----
-name: skill-name
-description: What it does and when to use it.
----
-
-
-## How This Skill Works
-
-[Inline principles that apply to ALL workflows. Cannot be skipped.]
-
-### Principle 1: [Name]
-[Brief explanation]
-
-### Principle 2: [Name]
-[Brief explanation]
-
-
-
-**Ask the user:**
-
-What would you like to do?
-1. [Option A]
-2. [Option B]
-3. [Option C]
-4. Something else
-
-**Wait for response before proceeding.**
-
-
-
-| Response | Workflow |
-|----------|----------|
-| 1, "keyword", "keyword" | `workflows/option-a.md` |
-| 2, "keyword", "keyword" | `workflows/option-b.md` |
-| 3, "keyword", "keyword" | `workflows/option-c.md` |
-| 4, other | Clarify, then select |
-
-**After reading the workflow, follow it exactly.**
-
-
-
-All domain knowledge in `references/`:
-
-**Category A:** file-a.md, file-b.md
-**Category B:** file-c.md, file-d.md
-
-
-
-| Workflow | Purpose |
-|----------|---------|
-| option-a.md | [What it does] |
-| option-b.md | [What it does] |
-| option-c.md | [What it does] |
-
-```
-
-
-
-## Workflow Template
-
-```markdown
-# Workflow: [Name]
-
-
-**Read these reference files NOW:**
-1. references/relevant-file.md
-2. references/another-file.md
-
-
-
-## Step 1: [Name]
-[What to do]
-
-## Step 2: [Name]
-[What to do]
-
-## Step 3: [Name]
-[What to do]
-
-
-
-This workflow is complete when:
-- [ ] Criterion 1
-- [ ] Criterion 2
-- [ ] Criterion 3
-
-```
-
-
-
-## When to Use This Pattern
-
-**Use router + workflows + references when:**
-- Multiple distinct workflows (build vs debug vs ship)
-- Different workflows need different references
-- Essential principles must not be skipped
-- Skill has grown beyond 200 lines
-
-**Use simple single-file skill when:**
-- One workflow
-- Small reference set
-- Under 200 lines total
-- No essential principles to enforce
-
-
-
-## The Key Insight
-
-**SKILL.md is always loaded. Use this guarantee.**
-
-Put unavoidable content in SKILL.md:
-- Essential principles
-- Intake question
-- Routing logic
-
-Put workflow-specific content in workflows/:
-- Step-by-step procedures
-- Required references for that workflow
-- Success criteria for that workflow
-
-Put reusable knowledge in references/:
-- Patterns and examples
-- Technical details
-- Domain expertise
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md b/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md
deleted file mode 100644
index a48aef7..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md
+++ /dev/null
@@ -1,152 +0,0 @@
-# Skill Structure Reference
-
-Skills have three structural components: YAML frontmatter (metadata), standard markdown body (content), and progressive disclosure (file organization).
-
-## Body Format
-
-Use **standard markdown headings** for structure. Keep markdown formatting within content (bold, italic, lists, code blocks, links).
-
-```markdown
----
-name: my-skill
-description: What it does and when to use it
----
-
-# Skill Name
-
-## Quick Start
-Immediate actionable guidance...
-
-## Instructions
-Step-by-step procedures...
-
-## Examples
-Concrete usage examples...
-
-## Guidelines
-Rules and constraints...
-```
-
-## Recommended Sections
-
-Every skill should have:
-
-- **Quick Start** - Immediate, actionable guidance (minimal working example)
-- **Instructions** - Core step-by-step guidance
-- **Success Criteria** - How to know it worked
-
-Add based on complexity:
-
-- **Context** - Background/situational information
-- **Workflow** - Multi-step procedures
-- **Examples** - Concrete input/output pairs
-- **Advanced Features** - Deep-dive topics (link to reference files)
-- **Anti-Patterns** - Common mistakes to avoid
-- **Guidelines** - Rules and constraints
-
-## YAML Frontmatter
-
-### Required/Recommended Fields
-
-```yaml
----
-name: skill-name-here
-description: What it does and when to use it (specific triggers included)
----
-```
-
-### Name Field
-
-**Validation rules:**
-- Maximum 64 characters
-- Lowercase letters, numbers, hyphens only
-- Must match directory name
-- No reserved words: "anthropic", "claude"
-
-**Examples:**
-- `triage-prs`
-- `deploy-production`
-- `review-code`
-- `setup-stripe-payments`
-
-**Avoid:** `helper`, `utils`, `tools`, generic names
-
-### Description Field
-
-**Validation rules:**
-- Maximum 1024 characters
-- Include what it does AND when to use it
-- Third person voice
-
-**Good:**
-```yaml
-description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
-```
-
-**Bad:**
-```yaml
-description: Helps with documents
-```
-
-### Optional Fields
-
-| Field | Description |
-|-------|-------------|
-| `argument-hint` | Usage hints. Example: `[issue-number]` |
-| `disable-model-invocation` | `true` to prevent auto-loading. Use for side-effect workflows. |
-| `user-invocable` | `false` to hide from `/` menu. Use for background knowledge. |
-| `allowed-tools` | Tools without permission prompts. Example: `Read, Bash(git *)` |
-| `model` | `haiku`, `sonnet`, or `opus` |
-| `context` | `fork` for isolated subagent execution |
-| `agent` | Subagent type: `Explore`, `Plan`, `general-purpose`, or custom |
-
-## Naming Conventions
-
-Use descriptive names that indicate purpose:
-
-| Pattern | Examples |
-|---------|----------|
-| Action-oriented | `triage-prs`, `deploy-production`, `review-code` |
-| Domain-specific | `setup-stripe-payments`, `manage-facebook-ads` |
-| Descriptive | `git-worktree`, `frontend-design`, `dhh-rails-style` |
-
-## Progressive Disclosure
-
-Keep SKILL.md under 500 lines. Split into reference files:
-
-```
-my-skill/
-├── SKILL.md # Entry point (required, overview + navigation)
-├── reference.md # Detailed docs (loaded when needed)
-├── examples.md # Usage examples (loaded when needed)
-└── scripts/
- └── helper.py # Utility script (executed, not loaded)
-```
-
-**Rules:**
-- Keep references one level deep from SKILL.md
-- Add table of contents to reference files over 100 lines
-- Use forward slashes in paths: `scripts/helper.py`
-- Name files descriptively: `form_validation_rules.md` not `doc2.md`
-
-## Validation Checklist
-
-Before finalizing:
-
-- [ ] YAML frontmatter valid (name matches directory, description specific)
-- [ ] Uses standard markdown headings (not XML tags)
-- [ ] Has Quick Start, Instructions, and Success Criteria sections
-- [ ] `disable-model-invocation: true` if skill has side effects
-- [ ] SKILL.md under 500 lines
-- [ ] Reference files linked properly from SKILL.md
-- [ ] File paths use forward slashes
-- [ ] Tested with real usage
-
-## Anti-Patterns
-
-- **XML tags in body** - Use standard markdown headings
-- **Vague descriptions** - Be specific with trigger keywords
-- **Deep nesting** - Keep references one level from SKILL.md
-- **Missing invocation control** - Side-effect workflows need `disable-model-invocation: true`
-- **Inconsistent naming** - Directory name must match `name` field
-- **Windows paths** - Always use forward slashes
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md b/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md
deleted file mode 100644
index 5d8747c..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md
+++ /dev/null
@@ -1,113 +0,0 @@
-# Using Scripts in Skills
-
-
-Scripts are executable code that Claude runs as-is rather than regenerating each time. They ensure reliable, error-free execution of repeated operations.
-
-
-
-Use scripts when:
-- The same code runs across multiple skill invocations
-- Operations are error-prone when rewritten from scratch
-- Complex shell commands or API interactions are involved
-- Consistency matters more than flexibility
-
-Common script types:
-- **Deployment** - Deploy to Vercel, publish packages, push releases
-- **Setup** - Initialize projects, install dependencies, configure environments
-- **API calls** - Authenticated requests, webhook handlers, data fetches
-- **Data processing** - Transform files, batch operations, migrations
-- **Build processes** - Compile, bundle, test runners
-
-
-
-Scripts live in `scripts/` within the skill directory:
-
-```
-skill-name/
-├── SKILL.md
-├── workflows/
-├── references/
-├── templates/
-└── scripts/
- ├── deploy.sh
- ├── setup.py
- └── fetch-data.ts
-```
-
-A well-structured script includes:
-1. Clear purpose comment at top
-2. Input validation
-3. Error handling
-4. Idempotent operations where possible
-5. Clear output/feedback
-
-
-
-```bash
-#!/bin/bash
-# deploy.sh - Deploy project to Vercel
-# Usage: ./deploy.sh [environment]
-# Environments: preview (default), production
-
-set -euo pipefail
-
-ENVIRONMENT="${1:-preview}"
-
-# Validate environment
-if [[ "$ENVIRONMENT" != "preview" && "$ENVIRONMENT" != "production" ]]; then
- echo "Error: Environment must be 'preview' or 'production'"
- exit 1
-fi
-
-echo "Deploying to $ENVIRONMENT..."
-
-if [[ "$ENVIRONMENT" == "production" ]]; then
- vercel --prod
-else
- vercel
-fi
-
-echo "Deployment complete."
-```
-
-
-
-Workflows reference scripts like this:
-
-```xml
-
-## Step 5: Deploy
-
-1. Ensure all tests pass
-2. Run `scripts/deploy.sh production`
-3. Verify deployment succeeded
-4. Update user with deployment URL
-
-```
-
-The workflow tells Claude WHEN to run the script. The script handles HOW the operation executes.
-
-
-
-**Do:**
-- Make scripts idempotent (safe to run multiple times)
-- Include clear usage comments
-- Validate inputs before executing
-- Provide meaningful error messages
-- Use `set -euo pipefail` in bash scripts
-
-**Don't:**
-- Hardcode secrets or credentials (use environment variables)
-- Create scripts for one-off operations
-- Skip error handling
-- Make scripts do too many unrelated things
-- Forget to make scripts executable (`chmod +x`)
-
-
-
-- Never embed API keys, tokens, or secrets in scripts
-- Use environment variables for sensitive configuration
-- Validate and sanitize any user-provided inputs
-- Be cautious with scripts that delete or modify data
-- Consider adding `--dry-run` options for destructive operations
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md b/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md
deleted file mode 100644
index 6afe577..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md
+++ /dev/null
@@ -1,112 +0,0 @@
-# Using Templates in Skills
-
-
-Templates are reusable output structures that Claude copies and fills in. They ensure consistent, high-quality outputs without regenerating structure each time.
-
-
-
-Use templates when:
-- Output should have consistent structure across invocations
-- The structure matters more than creative generation
-- Filling placeholders is more reliable than blank-page generation
-- Users expect predictable, professional-looking outputs
-
-Common template types:
-- **Plans** - Project plans, implementation plans, migration plans
-- **Specifications** - Technical specs, feature specs, API specs
-- **Documents** - Reports, proposals, summaries
-- **Configurations** - Config files, settings, environment setups
-- **Scaffolds** - File structures, boilerplate code
-
-
-
-Templates live in `templates/` within the skill directory:
-
-```
-skill-name/
-├── SKILL.md
-├── workflows/
-├── references/
-└── templates/
- ├── plan-template.md
- ├── spec-template.md
- └── report-template.md
-```
-
-A template file contains:
-1. Clear section markers
-2. Placeholder indicators (use `{{placeholder}}` or `[PLACEHOLDER]`)
-3. Inline guidance for what goes where
-4. Example content where helpful
-
-
-
-```markdown
-# {{PROJECT_NAME}} Implementation Plan
-
-## Overview
-{{1-2 sentence summary of what this plan covers}}
-
-## Goals
-- {{Primary goal}}
-- {{Secondary goals...}}
-
-## Scope
-**In scope:**
-- {{What's included}}
-
-**Out of scope:**
-- {{What's explicitly excluded}}
-
-## Phases
-
-### Phase 1: {{Phase name}}
-**Duration:** {{Estimated duration}}
-**Deliverables:**
-- {{Deliverable 1}}
-- {{Deliverable 2}}
-
-### Phase 2: {{Phase name}}
-...
-
-## Success Criteria
-- [ ] {{Measurable criterion 1}}
-- [ ] {{Measurable criterion 2}}
-
-## Risks
-| Risk | Likelihood | Impact | Mitigation |
-|------|------------|--------|------------|
-| {{Risk}} | {{H/M/L}} | {{H/M/L}} | {{Strategy}} |
-```
-
-
-
-Workflows reference templates like this:
-
-```xml
-
-## Step 3: Generate Plan
-
-1. Read `templates/plan-template.md`
-2. Copy the template structure
-3. Fill each placeholder based on gathered requirements
-4. Review for completeness
-
-```
-
-The workflow tells Claude WHEN to use the template. The template provides WHAT structure to produce.
-
-
-
-**Do:**
-- Keep templates focused on structure, not content
-- Use clear placeholder syntax consistently
-- Include brief inline guidance where sections might be ambiguous
-- Make templates complete but minimal
-
-**Don't:**
-- Put excessive example content that might be copied verbatim
-- Create templates for outputs that genuinely need creative generation
-- Over-constrain with too many required sections
-- Forget to update templates when requirements change
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md b/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md
deleted file mode 100644
index d3fef63..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md
+++ /dev/null
@@ -1,510 +0,0 @@
-
-This reference covers patterns for complex workflows, validation loops, and feedback cycles in skill authoring. All patterns use pure XML structure.
-
-
-
-
-Break complex operations into clear, sequential steps. For particularly complex workflows, provide a checklist.
-
-
-
-```xml
-
-Fill PDF forms with validated data from JSON field mappings.
-
-
-
-Copy this checklist and check off items as you complete them:
-
-```
-Task Progress:
-- [ ] Step 1: Analyze the form (run analyze_form.py)
-- [ ] Step 2: Create field mapping (edit fields.json)
-- [ ] Step 3: Validate mapping (run validate_fields.py)
-- [ ] Step 4: Fill the form (run fill_form.py)
-- [ ] Step 5: Verify output (run verify_output.py)
-```
-
-
-**Analyze the form**
-
-Run: `python scripts/analyze_form.py input.pdf`
-
-This extracts form fields and their locations, saving to `fields.json`.
-
-
-
-**Create field mapping**
-
-Edit `fields.json` to add values for each field.
-
-
-
-**Validate mapping**
-
-Run: `python scripts/validate_fields.py fields.json`
-
-Fix any validation errors before continuing.
-
-
-
-**Fill the form**
-
-Run: `python scripts/fill_form.py input.pdf fields.json output.pdf`
-
-
-
-**Verify output**
-
-Run: `python scripts/verify_output.py output.pdf`
-
-If verification fails, return to Step 2.
-
-
-```
-
-
-
-Use checklist pattern when:
-- Workflow has 5+ sequential steps
-- Steps must be completed in order
-- Progress tracking helps prevent errors
-- Easy resumption after interruption is valuable
-
-
-
-
-
-
-Run validator → fix errors → repeat. This pattern greatly improves output quality.
-
-
-
-```xml
-
-Edit OOXML documents with XML validation at each step.
-
-
-
-
-Make your edits to `word/document.xml`
-
-
-
-**Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/`
-
-
-
-If validation fails:
-- Review the error message carefully
-- Fix the issues in the XML
-- Run validation again
-
-
-
-**Only proceed when validation passes**
-
-
-
-Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx`
-
-
-
-Test the output document
-
-
-
-
-Never skip validation. Catching errors early prevents corrupted output files.
-
-```
-
-
-
-- Catches errors early before changes are applied
-- Machine-verifiable with objective verification
-- Plan can be iterated without touching originals
-- Reduces total iteration cycles
-
-
-
-
-
-When Claude performs complex, open-ended tasks, create a plan in a structured format, validate it, then execute.
-
-Workflow: analyze → **create plan file** → **validate plan** → execute → verify
-
-
-
-```xml
-
-Apply batch updates to spreadsheet with plan validation.
-
-
-
-
-
-Analyze the spreadsheet and requirements
-
-
-
-Create `changes.json` with all planned updates
-
-
-
-
-
-Validate the plan: `python scripts/validate_changes.py changes.json`
-
-
-
-If validation fails:
-- Review error messages
-- Fix issues in changes.json
-- Validate again
-
-
-
-Only proceed when validation passes
-
-
-
-
-
-Apply changes: `python scripts/apply_changes.py changes.json`
-
-
-
-Verify output
-
-
-
-
-
-- Plan validation passes with zero errors
-- All changes applied successfully
-- Output verification confirms expected results
-
-```
-
-
-
-Make validation scripts verbose with specific error messages:
-
-**Good error message**:
-"Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
-
-**Bad error message**:
-"Invalid field"
-
-Specific errors help Claude fix issues without guessing.
-
-
-
-Use plan-validate-execute when:
-- Operations are complex and error-prone
-- Changes are irreversible or difficult to undo
-- Planning can be validated independently
-- Catching errors early saves significant time
-
-
-
-
-
-
-Guide Claude through decision points with clear branching logic.
-
-
-
-```xml
-
-Modify DOCX files using appropriate method based on task type.
-
-
-
-
-Determine the modification type:
-
-**Creating new content?** → Follow "Creation workflow"
-**Editing existing content?** → Follow "Editing workflow"
-
-
-
-Build documents from scratch
-
-
-1. Use docx-js library
-2. Build document from scratch
-3. Export to .docx format
-
-
-
-
-Modify existing documents
-
-
-1. Unpack existing document
-2. Modify XML directly
-3. Validate after each change
-4. Repack when complete
-
-
-
-
-
-- Correct workflow chosen based on task type
-- All steps in chosen workflow completed
-- Output file validated and verified
-
-```
-
-
-
-Use conditional workflows when:
-- Different task types require different approaches
-- Decision points are clear and well-defined
-- Workflows are mutually exclusive
-- Guiding Claude to correct path improves outcomes
-
-
-
-
-
-Validation scripts are force multipliers. They catch errors that Claude might miss and provide actionable feedback for fixing issues.
-
-
-
-
-**Good**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
-
-**Bad**: "Invalid field"
-
-Verbose errors help Claude fix issues in one iteration instead of multiple rounds of guessing.
-
-
-
-**Good**: "Line 47: Expected closing tag `` but found ``"
-
-**Bad**: "XML syntax error"
-
-Specific feedback pinpoints exact location and nature of the problem.
-
-
-
-**Good**: "Required field 'customer_name' is missing. Add: {\"customer_name\": \"value\"}"
-
-**Bad**: "Missing required field"
-
-Actionable suggestions show Claude exactly what to fix.
-
-
-
-When validation fails, show available valid options:
-
-**Good**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
-
-**Bad**: "Invalid status"
-
-Showing valid options eliminates guesswork.
-
-
-
-
-```xml
-
-After making changes, validate immediately:
-
-```bash
-python scripts/validate.py output_dir/
-```
-
-If validation fails, fix errors before continuing. Validation errors include:
-
-- **Field not found**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
-- **Type mismatch**: "Field 'order_total' expects number, got string"
-- **Missing required field**: "Required field 'customer_name' is missing"
-- **Invalid value**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
-
-Only proceed when validation passes with zero errors.
-
-```
-
-
-
-- Catches errors before they propagate
-- Reduces iteration cycles
-- Provides learning feedback
-- Makes debugging deterministic
-- Enables confident execution
-
-
-
-
-
-Many workflows benefit from iteration: generate → validate → refine → validate → finalize.
-
-
-
-```xml
-
-Generate reports with iterative quality improvement.
-
-
-
-
-**Generate initial draft**
-
-Create report based on data and requirements.
-
-
-
-**Validate draft**
-
-Run: `python scripts/validate_report.py draft.md`
-
-Fix any structural issues, missing sections, or data errors.
-
-
-
-**Refine content**
-
-Improve clarity, add supporting data, enhance visualizations.
-
-
-
-**Final validation**
-
-Run: `python scripts/validate_report.py final.md`
-
-Ensure all quality criteria met.
-
-
-
-**Finalize**
-
-Export to final format and deliver.
-
-
-
-
-- Final validation passes with zero errors
-- All quality criteria met
-- Report ready for delivery
-
-```
-
-
-
-Use iterative refinement when:
-- Quality improves with multiple passes
-- Validation provides actionable feedback
-- Time permits iteration
-- Perfect output matters more than speed
-
-
-
-
-
-For long workflows, add checkpoints where Claude can pause and verify progress before continuing.
-
-
-
-```xml
-
-
-**Data collection** (Steps 1-3)
-
-1. Extract data from source
-2. Transform to target format
-3. **CHECKPOINT**: Verify data completeness
-
-Only continue if checkpoint passes.
-
-
-
-**Data processing** (Steps 4-6)
-
-4. Apply business rules
-5. Validate transformations
-6. **CHECKPOINT**: Verify processing accuracy
-
-Only continue if checkpoint passes.
-
-
-
-**Output generation** (Steps 7-9)
-
-7. Generate output files
-8. Validate output format
-9. **CHECKPOINT**: Verify final output
-
-Proceed to delivery only if checkpoint passes.
-
-
-
-
-At each checkpoint:
-1. Run validation script
-2. Review output for correctness
-3. Verify no errors or warnings
-4. Only proceed when validation passes
-
-```
-
-
-
-- Prevents cascading errors
-- Easier to diagnose issues
-- Clear progress indicators
-- Natural pause points for review
-- Reduces wasted work from early errors
-
-
-
-
-
-Design workflows with clear error recovery paths. Claude should know what to do when things go wrong.
-
-
-
-```xml
-
-
-1. Process input file
-2. Validate output
-3. Save results
-
-
-
-**If validation fails in step 2:**
-- Review validation errors
-- Check if input file is corrupted → Return to step 1 with different input
-- Check if processing logic failed → Fix logic, return to step 1
-- Check if output format wrong → Fix format, return to step 2
-
-**If save fails in step 3:**
-- Check disk space
-- Check file permissions
-- Check file path validity
-- Retry save with corrected conditions
-
-
-
-**If error persists after 3 attempts:**
-- Document the error with full context
-- Save partial results if available
-- Report issue to user with diagnostic information
-
-
-```
-
-
-
-Include error recovery when:
-- Workflows interact with external systems
-- File operations could fail
-- Network calls could timeout
-- User input could be invalid
-- Errors are recoverable
-
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md b/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md
deleted file mode 100644
index b2dc762..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md
+++ /dev/null
@@ -1,73 +0,0 @@
----
-name: {{SKILL_NAME}}
-description: {{What it does}} Use when {{trigger conditions}}.
----
-
-
-## {{Core Concept}}
-
-{{Principles that ALWAYS apply, regardless of which workflow runs}}
-
-### 1. {{First principle}}
-{{Explanation}}
-
-### 2. {{Second principle}}
-{{Explanation}}
-
-### 3. {{Third principle}}
-{{Explanation}}
-
-
-
-**Ask the user:**
-
-What would you like to do?
-1. {{First option}}
-2. {{Second option}}
-3. {{Third option}}
-
-**Wait for response before proceeding.**
-
-
-
-| Response | Workflow |
-|----------|----------|
-| 1, "{{keywords}}" | `workflows/{{first-workflow}}.md` |
-| 2, "{{keywords}}" | `workflows/{{second-workflow}}.md` |
-| 3, "{{keywords}}" | `workflows/{{third-workflow}}.md` |
-
-**After reading the workflow, follow it exactly.**
-
-
-
-## {{Skill Name}} Quick Reference
-
-{{Brief reference information always useful to have visible}}
-
-
-
-## Domain Knowledge
-
-All in `references/`:
-- {{reference-1.md}} - {{purpose}}
-- {{reference-2.md}} - {{purpose}}
-
-
-
-## Workflows
-
-All in `workflows/`:
-
-| Workflow | Purpose |
-|----------|---------|
-| {{first-workflow}}.md | {{purpose}} |
-| {{second-workflow}}.md | {{purpose}} |
-| {{third-workflow}}.md | {{purpose}} |
-
-
-
-A well-executed {{skill name}}:
-- {{First criterion}}
-- {{Second criterion}}
-- {{Third criterion}}
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md b/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md
deleted file mode 100644
index 6678fa7..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-name: {{SKILL_NAME}}
-description: {{What it does}} Use when {{trigger conditions}}.
----
-
-
-{{Clear statement of what this skill accomplishes}}
-
-
-
-{{Immediate actionable guidance - what Claude should do first}}
-
-
-
-## Step 1: {{First action}}
-
-{{Instructions for step 1}}
-
-## Step 2: {{Second action}}
-
-{{Instructions for step 2}}
-
-## Step 3: {{Third action}}
-
-{{Instructions for step 3}}
-
-
-
-{{Skill name}} is complete when:
-- [ ] {{First success criterion}}
-- [ ] {{Second success criterion}}
-- [ ] {{Third success criterion}}
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md
deleted file mode 100644
index 4a26adb..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# Workflow: Add a Reference to Existing Skill
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/skill-structure.md
-
-
-
-## Step 1: Select the Skill
-
-```bash
-ls ~/.claude/skills/
-```
-
-Present numbered list, ask: "Which skill needs a new reference?"
-
-## Step 2: Analyze Current Structure
-
-```bash
-cat ~/.claude/skills/{skill-name}/SKILL.md
-ls ~/.claude/skills/{skill-name}/references/ 2>/dev/null
-```
-
-Determine:
-- **Has references/ folder?** → Good, can add directly
-- **Simple skill?** → May need to create references/ first
-- **What references exist?** → Understand the knowledge landscape
-
-Report current references to user.
-
-## Step 3: Gather Reference Requirements
-
-Ask:
-- What knowledge should this reference contain?
-- Which workflows will use it?
-- Is this reusable across workflows or specific to one?
-
-**If specific to one workflow** → Consider putting it inline in that workflow instead.
-
-## Step 4: Create the Reference File
-
-Create `references/{reference-name}.md`:
-
-Use semantic XML tags to structure the content:
-```xml
-
-Brief description of what this reference covers
-
-
-
-## Common Patterns
-[Reusable patterns, examples, code snippets]
-
-
-
-## Guidelines
-[Best practices, rules, constraints]
-
-
-
-## Examples
-[Concrete examples with explanation]
-
-```
-
-## Step 5: Update SKILL.md
-
-Add the new reference to ``:
-```markdown
-**Category:** existing.md, new-reference.md
-```
-
-## Step 6: Update Workflows That Need It
-
-For each workflow that should use this reference:
-
-1. Read the workflow file
-2. Add to its `` section
-3. Verify the workflow still makes sense with this addition
-
-## Step 7: Verify
-
-- [ ] Reference file exists and is well-structured
-- [ ] Reference is in SKILL.md reference_index
-- [ ] Relevant workflows have it in required_reading
-- [ ] No broken references
-
-
-
-Reference addition is complete when:
-- [ ] Reference file created with useful content
-- [ ] Added to reference_index in SKILL.md
-- [ ] Relevant workflows updated to read it
-- [ ] Content is reusable (not workflow-specific)
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md
deleted file mode 100644
index fb77806..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# Workflow: Add a Script to a Skill
-
-
-**Read these reference files NOW:**
-1. references/using-scripts.md
-
-
-
-## Step 1: Identify the Skill
-
-Ask (if not already provided):
-- Which skill needs a script?
-- What operation should the script perform?
-
-## Step 2: Analyze Script Need
-
-Confirm this is a good script candidate:
-- [ ] Same code runs across multiple invocations
-- [ ] Operation is error-prone when rewritten
-- [ ] Consistency matters more than flexibility
-
-If not a good fit, suggest alternatives (inline code in workflow, reference examples).
-
-## Step 3: Create Scripts Directory
-
-```bash
-mkdir -p ~/.claude/skills/{skill-name}/scripts
-```
-
-## Step 4: Design Script
-
-Gather requirements:
-- What inputs does the script need?
-- What should it output or accomplish?
-- What errors might occur?
-- Should it be idempotent?
-
-Choose language:
-- **bash** - Shell operations, file manipulation, CLI tools
-- **python** - Data processing, API calls, complex logic
-- **node/ts** - JavaScript ecosystem, async operations
-
-## Step 5: Write Script File
-
-Create `scripts/{script-name}.{ext}` with:
-- Purpose comment at top
-- Usage instructions
-- Input validation
-- Error handling
-- Clear output/feedback
-
-For bash scripts:
-```bash
-#!/bin/bash
-set -euo pipefail
-```
-
-## Step 6: Make Executable (if bash)
-
-```bash
-chmod +x ~/.claude/skills/{skill-name}/scripts/{script-name}.sh
-```
-
-## Step 7: Update Workflow to Use Script
-
-Find the workflow that needs this operation. Add:
-```xml
-
-...
-N. Run `scripts/{script-name}.sh [arguments]`
-N+1. Verify operation succeeded
-...
-
-```
-
-## Step 8: Test
-
-Invoke the skill workflow and verify:
-- Script runs at the right step
-- Inputs are passed correctly
-- Errors are handled gracefully
-- Output matches expectations
-
-
-
-Script is complete when:
-- [ ] scripts/ directory exists
-- [ ] Script file has proper structure (comments, validation, error handling)
-- [ ] Script is executable (if bash)
-- [ ] At least one workflow references the script
-- [ ] No hardcoded secrets or credentials
-- [ ] Tested with real invocation
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md
deleted file mode 100644
index 8481a2c..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Workflow: Add a Template to a Skill
-
-
-**Read these reference files NOW:**
-1. references/using-templates.md
-
-
-
-## Step 1: Identify the Skill
-
-Ask (if not already provided):
-- Which skill needs a template?
-- What output does this template structure?
-
-## Step 2: Analyze Template Need
-
-Confirm this is a good template candidate:
-- [ ] Output has consistent structure across uses
-- [ ] Structure matters more than creative generation
-- [ ] Filling placeholders is more reliable than blank-page generation
-
-If not a good fit, suggest alternatives (workflow guidance, reference examples).
-
-## Step 3: Create Templates Directory
-
-```bash
-mkdir -p ~/.claude/skills/{skill-name}/templates
-```
-
-## Step 4: Design Template Structure
-
-Gather requirements:
-- What sections does the output need?
-- What information varies between uses? (→ placeholders)
-- What stays constant? (→ static structure)
-
-## Step 5: Write Template File
-
-Create `templates/{template-name}.md` with:
-- Clear section markers
-- `{{PLACEHOLDER}}` syntax for variable content
-- Brief inline guidance where helpful
-- Minimal example content
-
-## Step 6: Update Workflow to Use Template
-
-Find the workflow that produces this output. Add:
-```xml
-
-...
-N. Read `templates/{template-name}.md`
-N+1. Copy template structure
-N+2. Fill each placeholder based on gathered context
-...
-
-```
-
-## Step 7: Test
-
-Invoke the skill workflow and verify:
-- Template is read at the right step
-- All placeholders get filled appropriately
-- Output structure matches template
-- No placeholders left unfilled
-
-
-
-Template is complete when:
-- [ ] templates/ directory exists
-- [ ] Template file has clear structure with placeholders
-- [ ] At least one workflow references the template
-- [ ] Workflow instructions explain when/how to use template
-- [ ] Tested with real invocation
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md
deleted file mode 100644
index cfad9f8..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md
+++ /dev/null
@@ -1,126 +0,0 @@
-# Workflow: Add a Workflow to Existing Skill
-
-## Interaction Method
-
-If `AskUserQuestion` is available, use it for all prompts below.
-
-If not, present each question as a numbered list and wait for a reply before proceeding to the next step. Never skip or auto-configure.
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/workflows-and-validation.md
-
-
-
-## Step 1: Select the Skill
-
-**DO NOT use AskUserQuestion** - there may be many skills.
-
-```bash
-ls ~/.claude/skills/
-```
-
-Present numbered list, ask: "Which skill needs a new workflow?"
-
-## Step 2: Analyze Current Structure
-
-Read the skill:
-```bash
-cat ~/.claude/skills/{skill-name}/SKILL.md
-ls ~/.claude/skills/{skill-name}/workflows/ 2>/dev/null
-```
-
-Determine:
-- **Simple skill?** → May need to upgrade to router pattern first
-- **Already has workflows/?** → Good, can add directly
-- **What workflows exist?** → Avoid duplication
-
-Report current structure to user.
-
-## Step 3: Gather Workflow Requirements
-
-Ask using AskUserQuestion or direct question:
-- What should this workflow do?
-- When would someone use it vs existing workflows?
-- What references would it need?
-
-## Step 4: Upgrade to Router Pattern (if needed)
-
-**If skill is currently simple (no workflows/):**
-
-Ask: "This skill needs to be upgraded to the router pattern first. Should I restructure it?"
-
-If yes:
-1. Create workflows/ directory
-2. Move existing process content to workflows/main.md
-3. Rewrite SKILL.md as router with intake + routing
-4. Verify structure works before proceeding
-
-## Step 5: Create the Workflow File
-
-Create `workflows/{workflow-name}.md`:
-
-```markdown
-# Workflow: {Workflow Name}
-
-
-**Read these reference files NOW:**
-1. references/{relevant-file}.md
-
-
-
-## Step 1: {First Step}
-[What to do]
-
-## Step 2: {Second Step}
-[What to do]
-
-## Step 3: {Third Step}
-[What to do]
-
-
-
-This workflow is complete when:
-- [ ] Criterion 1
-- [ ] Criterion 2
-- [ ] Criterion 3
-
-```
-
-## Step 6: Update SKILL.md
-
-Add the new workflow to:
-
-1. **Intake question** - Add new option
-2. **Routing table** - Map option to workflow file
-3. **Workflows index** - Add to the list
-
-## Step 7: Create References (if needed)
-
-If the workflow needs domain knowledge that doesn't exist:
-1. Create `references/{reference-name}.md`
-2. Add to reference_index in SKILL.md
-3. Reference it in the workflow's required_reading
-
-## Step 8: Test
-
-Invoke the skill:
-- Does the new option appear in intake?
-- Does selecting it route to the correct workflow?
-- Does the workflow load the right references?
-- Does the workflow execute correctly?
-
-Report results to user.
-
-
-
-Workflow addition is complete when:
-- [ ] Skill upgraded to router pattern (if needed)
-- [ ] Workflow file created with required_reading, process, success_criteria
-- [ ] SKILL.md intake updated with new option
-- [ ] SKILL.md routing updated
-- [ ] SKILL.md workflows_index updated
-- [ ] Any needed references created
-- [ ] Tested and working
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md
deleted file mode 100644
index 364f78e..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# Workflow: Audit a Skill
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/skill-structure.md
-3. references/use-xml-tags.md
-
-
-
-## Step 1: List Available Skills
-
-**DO NOT use AskUserQuestion** - there may be many skills.
-
-Enumerate skills in chat as numbered list:
-```bash
-ls ~/.claude/skills/
-```
-
-Present as:
-```
-Available skills:
-1. create-agent-skills
-2. build-macos-apps
-3. manage-stripe
-...
-```
-
-Ask: "Which skill would you like to audit? (enter number or name)"
-
-## Step 2: Read the Skill
-
-After user selects, read the full skill structure:
-```bash
-# Read main file
-cat ~/.claude/skills/{skill-name}/SKILL.md
-
-# Check for workflows and references
-ls ~/.claude/skills/{skill-name}/
-ls ~/.claude/skills/{skill-name}/workflows/ 2>/dev/null
-ls ~/.claude/skills/{skill-name}/references/ 2>/dev/null
-```
-
-## Step 3: Run Audit Checklist
-
-Evaluate against each criterion:
-
-### YAML Frontmatter
-- [ ] Has `name:` field (lowercase-with-hyphens)
-- [ ] Name matches directory name
-- [ ] Has `description:` field
-- [ ] Description says what it does AND when to use it
-- [ ] Description is third person ("Use when...")
-
-### Structure
-- [ ] SKILL.md under 500 lines
-- [ ] Pure XML structure (no markdown headings # in body)
-- [ ] All XML tags properly closed
-- [ ] Has required tags: objective OR essential_principles
-- [ ] Has success_criteria
-
-### Router Pattern (if complex skill)
-- [ ] Essential principles inline in SKILL.md (not in separate file)
-- [ ] Has intake question
-- [ ] Has routing table
-- [ ] All referenced workflow files exist
-- [ ] All referenced reference files exist
-
-### Workflows (if present)
-- [ ] Each has required_reading section
-- [ ] Each has process section
-- [ ] Each has success_criteria section
-- [ ] Required reading references exist
-
-### Content Quality
-- [ ] Principles are actionable (not vague platitudes)
-- [ ] Steps are specific (not "do the thing")
-- [ ] Success criteria are verifiable
-- [ ] No redundant content across files
-
-## Step 4: Generate Report
-
-Present findings as:
-
-```
-## Audit Report: {skill-name}
-
-### ✅ Passing
-- [list passing items]
-
-### ⚠️ Issues Found
-1. **[Issue name]**: [Description]
- → Fix: [Specific action]
-
-2. **[Issue name]**: [Description]
- → Fix: [Specific action]
-
-### 📊 Score: X/Y criteria passing
-```
-
-## Step 5: Offer Fixes
-
-If issues found, ask:
-"Would you like me to fix these issues?"
-
-Options:
-1. **Fix all** - Apply all recommended fixes
-2. **Fix one by one** - Review each fix before applying
-3. **Just the report** - No changes needed
-
-If fixing:
-- Make each change
-- Verify file validity after each change
-- Report what was fixed
-
-
-
-## Common Anti-Patterns to Flag
-
-**Skippable principles**: Essential principles in separate file instead of inline
-**Monolithic skill**: Single file over 500 lines
-**Mixed concerns**: Procedures and knowledge in same file
-**Vague steps**: "Handle the error appropriately"
-**Untestable criteria**: "User is satisfied"
-**Markdown headings in body**: Using # instead of XML tags
-**Missing routing**: Complex skill without intake/routing
-**Broken references**: Files mentioned but don't exist
-**Redundant content**: Same information in multiple places
-
-
-
-Audit is complete when:
-- [ ] Skill fully read and analyzed
-- [ ] All checklist items evaluated
-- [ ] Report presented to user
-- [ ] Fixes applied (if requested)
-- [ ] User has clear picture of skill health
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md
deleted file mode 100644
index 8eaed0c..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md
+++ /dev/null
@@ -1,605 +0,0 @@
-# Workflow: Create Exhaustive Domain Expertise Skill
-
-
-Build a comprehensive execution skill that does real work in a specific domain. Domain expertise skills are full-featured build skills with exhaustive domain knowledge in references, complete workflows for the full lifecycle (build → debug → optimize → ship), and can be both invoked directly by users AND loaded by other skills (like create-plans) for domain knowledge.
-
-
-
-**Regular skill:** "Do one specific task"
-**Domain expertise skill:** "Do EVERYTHING in this domain, with complete practitioner knowledge"
-
-Examples:
-- `expertise/macos-apps` - Build macOS apps from scratch through shipping
-- `expertise/python-games` - Build complete Python games with full game dev lifecycle
-- `expertise/rust-systems` - Build Rust systems programs with exhaustive systems knowledge
-- `expertise/web-scraping` - Build scrapers, handle all edge cases, deploy at scale
-
-Domain expertise skills:
-- ✅ Execute tasks (build, debug, optimize, ship)
-- ✅ Have comprehensive domain knowledge in references
-- ✅ Are invoked directly by users ("build a macOS app")
-- ✅ Can be loaded by other skills (create-plans reads references for planning)
-- ✅ Cover the FULL lifecycle, not just getting started
-
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/core-principles.md
-3. references/use-xml-tags.md
-
-
-
-## Step 1: Identify Domain
-
-Ask user what domain expertise to build:
-
-**Example domains:**
-- macOS/iOS app development
-- Python game development
-- Rust systems programming
-- Machine learning / AI
-- Web scraping and automation
-- Data engineering pipelines
-- Audio processing / DSP
-- 3D graphics / shaders
-- Unity/Unreal game development
-- Embedded systems
-
-Get specific: "Python games" or "Python games with Pygame specifically"?
-
-## Step 2: Confirm Target Location
-
-Explain:
-```
-Domain expertise skills go in: ~/.claude/skills/expertise/{domain-name}/
-
-These are comprehensive BUILD skills that:
-- Execute tasks (build, debug, optimize, ship)
-- Contain exhaustive domain knowledge
-- Can be invoked directly by users
-- Can be loaded by other skills for domain knowledge
-
-Name suggestion: {suggested-name}
-Location: ~/.claude/skills/expertise/{suggested-name}/
-```
-
-Confirm or adjust name.
-
-## Step 3: Identify Workflows
-
-Domain expertise skills cover the FULL lifecycle. Identify what workflows are needed.
-
-**Common workflows for most domains:**
-1. **build-new-{thing}.md** - Create from scratch
-2. **add-feature.md** - Extend existing {thing}
-3. **debug-{thing}.md** - Find and fix bugs
-4. **write-tests.md** - Test for correctness
-5. **optimize-performance.md** - Profile and speed up
-6. **ship-{thing}.md** - Deploy/distribute
-
-**Domain-specific workflows:**
-- Games: `implement-game-mechanic.md`, `add-audio.md`, `polish-ui.md`
-- Web apps: `setup-auth.md`, `add-api-endpoint.md`, `setup-database.md`
-- Systems: `optimize-memory.md`, `profile-cpu.md`, `cross-compile.md`
-
-Each workflow = one complete task type that users actually do.
-
-## Step 4: Exhaustive Research Phase
-
-**CRITICAL:** This research must be comprehensive, not superficial.
-
-### Research Strategy
-
-Run multiple web searches to ensure coverage:
-
-**Search 1: Current ecosystem**
-- "best {domain} libraries 2024 2025 2026"
-- "popular {domain} frameworks comparison"
-- "{domain} tech stack recommendations"
-
-**Search 2: Architecture patterns**
-- "{domain} architecture patterns"
-- "{domain} best practices design patterns"
-- "how to structure {domain} projects"
-
-**Search 3: Lifecycle and tooling**
-- "{domain} development workflow"
-- "{domain} testing debugging best practices"
-- "{domain} deployment distribution"
-
-**Search 4: Common pitfalls**
-- "{domain} common mistakes avoid"
-- "{domain} anti-patterns"
-- "what not to do {domain}"
-
-**Search 5: Real-world usage**
-- "{domain} production examples GitHub"
-- "{domain} case studies"
-- "successful {domain} projects"
-
-### Verification Requirements
-
-For EACH major library/tool/pattern found:
-- **Check recency:** When was it last updated?
-- **Check adoption:** Is it actively maintained? Community size?
-- **Check alternatives:** What else exists? When to use each?
-- **Check deprecation:** Is anything being replaced?
-
-**Red flags for outdated content:**
-- Articles from before 2023 (unless fundamental concepts)
-- Abandoned libraries (no commits in 12+ months)
-- Deprecated APIs or patterns
-- "This used to be popular but..."
-
-### Documentation Sources
-
-Use Context7 MCP when available:
-```
-mcp__context7__resolve-library-id: {library-name}
-mcp__context7__get-library-docs: {library-id}
-```
-
-Focus on official docs, not tutorials.
-
-## Step 5: Organize Knowledge Into Domain Areas
-
-Structure references by domain concerns, NOT by arbitrary categories.
-
-**For game development example:**
-```
-references/
-├── architecture.md # ECS, component-based, state machines
-├── libraries.md # Pygame, Arcade, Panda3D (when to use each)
-├── graphics-rendering.md # 2D/3D rendering, sprites, shaders
-├── physics.md # Collision, physics engines
-├── audio.md # Sound effects, music, spatial audio
-├── input.md # Keyboard, mouse, gamepad, touch
-├── ui-menus.md # HUD, menus, dialogs
-├── game-loop.md # Update/render loop, fixed timestep
-├── state-management.md # Game states, scene management
-├── networking.md # Multiplayer, client-server, P2P
-├── asset-pipeline.md # Loading, caching, optimization
-├── testing-debugging.md # Unit tests, profiling, debugging tools
-├── performance.md # Optimization, profiling, benchmarking
-├── packaging.md # Building executables, installers
-├── distribution.md # Steam, itch.io, app stores
-└── anti-patterns.md # Common mistakes, what NOT to do
-```
-
-**For macOS app development example:**
-```
-references/
-├── app-architecture.md # State management, dependency injection
-├── swiftui-patterns.md # Declarative UI patterns
-├── appkit-integration.md # Using AppKit with SwiftUI
-├── concurrency-patterns.md # Async/await, actors, structured concurrency
-├── data-persistence.md # Storage strategies
-├── networking.md # URLSession, async networking
-├── system-apis.md # macOS-specific frameworks
-├── testing-tdd.md # Testing patterns
-├── testing-debugging.md # Debugging tools and techniques
-├── performance.md # Profiling, optimization
-├── design-system.md # Platform conventions
-├── macos-polish.md # Native feel, accessibility
-├── security-code-signing.md # Signing, notarization
-└── project-scaffolding.md # CLI-based setup
-```
-
-**For each reference file:**
-- Pure XML structure
-- Decision trees: "If X, use Y. If Z, use A instead."
-- Comparison tables: Library vs Library (speed, features, learning curve)
-- Code examples showing patterns
-- "When to use" guidance
-- Platform-specific considerations
-- Current versions and compatibility
-
-## Step 6: Create SKILL.md
-
-Domain expertise skills use router pattern with essential principles:
-
-```yaml
----
-name: build-{domain-name}
-description: Build {domain things} from scratch through shipping. Full lifecycle - build, debug, test, optimize, ship. {Any specific constraints like "CLI-only, no IDE"}.
----
-
-
-## How {This Domain} Works
-
-{Domain-specific principles that ALWAYS apply}
-
-### 1. {First Principle}
-{Critical practice that can't be skipped}
-
-### 2. {Second Principle}
-{Another fundamental practice}
-
-### 3. {Third Principle}
-{Core workflow pattern}
-
-
-
-**Ask the user:**
-
-What would you like to do?
-1. Build a new {thing}
-2. Debug an existing {thing}
-3. Add a feature
-4. Write/run tests
-5. Optimize performance
-6. Ship/release
-7. Something else
-
-**Then read the matching workflow from `workflows/` and follow it.**
-
-
-
-| Response | Workflow |
-|----------|----------|
-| 1, "new", "create", "build", "start" | `workflows/build-new-{thing}.md` |
-| 2, "broken", "fix", "debug", "crash", "bug" | `workflows/debug-{thing}.md` |
-| 3, "add", "feature", "implement", "change" | `workflows/add-feature.md` |
-| 4, "test", "tests", "TDD", "coverage" | `workflows/write-tests.md` |
-| 5, "slow", "optimize", "performance", "fast" | `workflows/optimize-performance.md` |
-| 6, "ship", "release", "deploy", "publish" | `workflows/ship-{thing}.md` |
-| 7, other | Clarify, then select workflow or references |
-
-
-
-## After Every Change
-
-{Domain-specific verification steps}
-
-Example for compiled languages:
-```bash
-# 1. Does it build?
-{build command}
-
-# 2. Do tests pass?
-{test command}
-
-# 3. Does it run?
-{run command}
-```
-
-Report to the user:
-- "Build: ✓"
-- "Tests: X pass, Y fail"
-- "Ready for you to check [specific thing]"
-
-
-
-## Domain Knowledge
-
-All in `references/`:
-
-**Architecture:** {list files}
-**{Domain Area}:** {list files}
-**{Domain Area}:** {list files}
-**Development:** {list files}
-**Shipping:** {list files}
-
-
-
-## Workflows
-
-All in `workflows/`:
-
-| File | Purpose |
-|------|---------|
-| build-new-{thing}.md | Create new {thing} from scratch |
-| debug-{thing}.md | Find and fix bugs |
-| add-feature.md | Add to existing {thing} |
-| write-tests.md | Write and run tests |
-| optimize-performance.md | Profile and speed up |
-| ship-{thing}.md | Deploy/distribute |
-
-```
-
-## Step 7: Write Workflows
-
-For EACH workflow identified in Step 3:
-
-### Workflow Template
-
-```markdown
-# Workflow: {Workflow Name}
-
-
-**Read these reference files NOW before {doing the task}:**
-1. references/{relevant-file}.md
-2. references/{another-relevant-file}.md
-3. references/{third-relevant-file}.md
-
-
-
-## Step 1: {First Action}
-
-{What to do}
-
-## Step 2: {Second Action}
-
-{What to do - actual implementation steps}
-
-## Step 3: {Third Action}
-
-{What to do}
-
-## Step 4: Verify
-
-{How to prove it works}
-
-```bash
-{verification commands}
-```
-
-
-
-Avoid:
-- {Common mistake 1}
-- {Common mistake 2}
-- {Common mistake 3}
-
-
-
-A well-{completed task}:
-- {Criterion 1}
-- {Criterion 2}
-- {Criterion 3}
-- Builds/runs without errors
-- Tests pass
-- Feels {native/professional/correct}
-
-```
-
-**Key workflow characteristics:**
-- Starts with required_reading (which references to load)
-- Contains actual implementation steps (not just "read references")
-- Includes verification steps
-- Has success criteria
-- Documents anti-patterns
-
-## Step 8: Write Comprehensive References
-
-For EACH reference file identified in Step 5:
-
-### Structure Template
-
-```xml
-
-Brief introduction to this domain area
-
-
-
-## Available Approaches/Libraries
-
-
-
-
-
-
-
-## Choosing the Right Approach
-
-**If you need [X]:** Use [Library A]
-**If you need [Y]:** Use [Library B]
-**If you have [constraint Z]:** Use [Library C]
-
-**Avoid [Library D] if:** [specific scenarios]
-
-
-
-## Common Patterns
-
-
-**Use when:** [scenario]
-**Implementation:** [code example]
-**Considerations:** [trade-offs]
-
-
-
-
-## What NOT to Do
-
-
-**Problem:** [what people do wrong]
-**Why it's bad:** [consequences]
-**Instead:** [correct approach]
-
-
-
-
-## Platform-Specific Notes
-
-**Windows:** [considerations]
-**macOS:** [considerations]
-**Linux:** [considerations]
-**Mobile:** [if applicable]
-
-```
-
-### Quality Standards
-
-Each reference must include:
-- **Current information** (verify dates)
-- **Multiple options** (not just one library)
-- **Decision guidance** (when to use each)
-- **Real examples** (working code, not pseudocode)
-- **Trade-offs** (no silver bullets)
-- **Anti-patterns** (what NOT to do)
-
-### Common Reference Files
-
-Most domains need:
-- **architecture.md** - How to structure projects
-- **libraries.md** - Ecosystem overview with comparisons
-- **patterns.md** - Design patterns specific to domain
-- **testing-debugging.md** - How to verify correctness
-- **performance.md** - Optimization strategies
-- **deployment.md** - How to ship/distribute
-- **anti-patterns.md** - Common mistakes consolidated
-
-## Step 9: Validate Completeness
-
-### Completeness Checklist
-
-Ask: "Could a user build a professional {domain thing} from scratch through shipping using just this skill?"
-
-**Must answer YES to:**
-- [ ] All major libraries/frameworks covered?
-- [ ] All architectural approaches documented?
-- [ ] Complete lifecycle addressed (build → debug → test → optimize → ship)?
-- [ ] Platform-specific considerations included?
-- [ ] "When to use X vs Y" guidance provided?
-- [ ] Common pitfalls documented?
-- [ ] Current as of 2024-2026?
-- [ ] Workflows actually execute tasks (not just reference knowledge)?
-- [ ] Each workflow specifies which references to read?
-
-**Specific gaps to check:**
-- [ ] Testing strategy covered?
-- [ ] Debugging/profiling tools listed?
-- [ ] Deployment/distribution methods documented?
-- [ ] Performance optimization addressed?
-- [ ] Security considerations (if applicable)?
-- [ ] Asset/resource management (if applicable)?
-- [ ] Networking (if applicable)?
-
-### Dual-Purpose Test
-
-Test both use cases:
-
-**Direct invocation:** "Can a user invoke this skill and build something?"
-- Intake routes to appropriate workflow
-- Workflow loads relevant references
-- Workflow provides implementation steps
-- Success criteria are clear
-
-**Knowledge reference:** "Can create-plans load references to plan a project?"
-- References contain decision guidance
-- All options compared
-- Complete lifecycle covered
-- Architecture patterns documented
-
-## Step 10: Create Directory and Files
-
-```bash
-# Create structure
-mkdir -p ~/.claude/skills/expertise/{domain-name}
-mkdir -p ~/.claude/skills/expertise/{domain-name}/workflows
-mkdir -p ~/.claude/skills/expertise/{domain-name}/references
-
-# Write SKILL.md
-# Write all workflow files
-# Write all reference files
-
-# Verify structure
-ls -R ~/.claude/skills/expertise/{domain-name}
-```
-
-## Step 11: Document in create-plans
-
-Update `~/.claude/skills/create-plans/SKILL.md` to reference this new domain:
-
-Add to the domain inference table:
-```markdown
-| "{keyword}", "{domain term}" | expertise/{domain-name} |
-```
-
-So create-plans can auto-detect and offer to load it.
-
-## Step 12: Final Quality Check
-
-Review entire skill:
-
-**SKILL.md:**
-- [ ] Name matches directory (build-{domain-name})
-- [ ] Description explains it builds things from scratch through shipping
-- [ ] Essential principles inline (always loaded)
-- [ ] Intake asks what user wants to do
-- [ ] Routing maps to workflows
-- [ ] Reference index complete and organized
-- [ ] Workflows index complete
-
-**Workflows:**
-- [ ] Each workflow starts with required_reading
-- [ ] Each workflow has actual implementation steps
-- [ ] Each workflow has verification steps
-- [ ] Each workflow has success criteria
-- [ ] Workflows cover full lifecycle (build, debug, test, optimize, ship)
-
-**References:**
-- [ ] Pure XML structure (no markdown headings)
-- [ ] Decision guidance in every file
-- [ ] Current versions verified
-- [ ] Code examples work
-- [ ] Anti-patterns documented
-- [ ] Platform considerations included
-
-**Completeness:**
-- [ ] A professional practitioner would find this comprehensive
-- [ ] No major libraries/patterns missing
-- [ ] Full lifecycle covered
-- [ ] Passes the "build from scratch through shipping" test
-- [ ] Can be invoked directly by users
-- [ ] Can be loaded by create-plans for knowledge
-
-
-
-
-Domain expertise skill is complete when:
-
-- [ ] Comprehensive research completed (5+ web searches)
-- [ ] All sources verified for recency (2024-2026)
-- [ ] Knowledge organized by domain areas (not arbitrary)
-- [ ] Essential principles in SKILL.md (always loaded)
-- [ ] Intake routes to appropriate workflows
-- [ ] Each workflow has required_reading + implementation steps + verification
-- [ ] Each reference has decision trees and comparisons
-- [ ] Anti-patterns documented throughout
-- [ ] Full lifecycle covered (build → debug → test → optimize → ship)
-- [ ] Platform-specific considerations included
-- [ ] Located in ~/.claude/skills/expertise/{domain-name}/
-- [ ] Referenced in create-plans domain inference table
-- [ ] Passes dual-purpose test: Can be invoked directly AND loaded for knowledge
-- [ ] User can build something professional from scratch through shipping
-
-
-
-**DON'T:**
-- Copy tutorial content without verification
-- Include only "getting started" material
-- Skip the "when NOT to use" guidance
-- Forget to check if libraries are still maintained
-- Organize by document type instead of domain concerns
-- Make it knowledge-only with no execution workflows
-- Skip verification steps in workflows
-- Include outdated content from old blog posts
-- Skip decision trees and comparisons
-- Create workflows that just say "read the references"
-
-**DO:**
-- Verify everything is current
-- Include complete lifecycle (build → ship)
-- Provide decision guidance
-- Document anti-patterns
-- Make workflows execute real tasks
-- Start workflows with required_reading
-- Include verification in every workflow
-- Make it exhaustive, not minimal
-- Test both direct invocation and knowledge reference use cases
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md
deleted file mode 100644
index 3ef8b4a..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md
+++ /dev/null
@@ -1,197 +0,0 @@
-# Workflow: Create a New Skill
-
-## Interaction Method
-
-If `AskUserQuestion` is available, use it for all prompts below.
-
-If not, present each question as a numbered list and wait for a reply before proceeding to the next step. For multiSelect questions, accept comma-separated numbers (e.g. `1, 3`). Never skip or auto-configure.
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/skill-structure.md
-3. references/core-principles.md
-4. references/use-xml-tags.md
-
-
-
-## Step 1: Adaptive Requirements Gathering
-
-**If user provided context** (e.g., "build a skill for X"):
-→ Analyze what's stated, what can be inferred, what's unclear
-→ Skip to asking about genuine gaps only
-
-**If user just invoked skill without context:**
-→ Ask what they want to build
-
-### Using AskUserQuestion
-
-Ask 2-4 domain-specific questions based on actual gaps. Each question should:
-- Have specific options with descriptions
-- Focus on scope, complexity, outputs, boundaries
-- NOT ask things obvious from context
-
-Example questions:
-- "What specific operations should this skill handle?" (with options based on domain)
-- "Should this also handle [related thing] or stay focused on [core thing]?"
-- "What should the user see when successful?"
-
-### Decision Gate
-
-After initial questions, ask:
-"Ready to proceed with building, or would you like me to ask more questions?"
-
-Options:
-1. **Proceed to building** - I have enough context
-2. **Ask more questions** - There are more details to clarify
-3. **Let me add details** - I want to provide additional context
-
-## Step 2: Research Trigger (If External API)
-
-**When external service detected**, ask using AskUserQuestion:
-"This involves [service name] API. Would you like me to research current endpoints and patterns before building?"
-
-Options:
-1. **Yes, research first** - Fetch current documentation for accurate implementation
-2. **No, proceed with general patterns** - Use common patterns without specific API research
-
-If research requested:
-- Use Context7 MCP to fetch current library documentation
-- Or use WebSearch for recent API documentation
-- Focus on 2024-2026 sources
-- Store findings for use in content generation
-
-## Step 3: Decide Structure
-
-**Simple skill (single workflow, <200 lines):**
-→ Single SKILL.md file with all content
-
-**Complex skill (multiple workflows OR domain knowledge):**
-→ Router pattern:
-```
-skill-name/
-├── SKILL.md (router + principles)
-├── workflows/ (procedures - FOLLOW)
-├── references/ (knowledge - READ)
-├── templates/ (output structures - COPY + FILL)
-└── scripts/ (reusable code - EXECUTE)
-```
-
-Factors favoring router pattern:
-- Multiple distinct user intents (create vs debug vs ship)
-- Shared domain knowledge across workflows
-- Essential principles that must not be skipped
-- Skill likely to grow over time
-
-**Consider templates/ when:**
-- Skill produces consistent output structures (plans, specs, reports)
-- Structure matters more than creative generation
-
-**Consider scripts/ when:**
-- Same code runs across invocations (deploy, setup, API calls)
-- Operations are error-prone when rewritten each time
-
-See references/recommended-structure.md for templates.
-
-## Step 4: Create Directory
-
-```bash
-mkdir -p ~/.claude/skills/{skill-name}
-# If complex:
-mkdir -p ~/.claude/skills/{skill-name}/workflows
-mkdir -p ~/.claude/skills/{skill-name}/references
-# If needed:
-mkdir -p ~/.claude/skills/{skill-name}/templates # for output structures
-mkdir -p ~/.claude/skills/{skill-name}/scripts # for reusable code
-```
-
-## Step 5: Write SKILL.md
-
-**Simple skill:** Write complete skill file with:
-- YAML frontmatter (name, description)
-- ``
-- ``
-- Content sections with pure XML
-- ``
-
-**Complex skill:** Write router with:
-- YAML frontmatter
-- `` (inline, unavoidable)
-- `` (question to ask user)
-- `` (maps answers to workflows)
-- `` and ``
-
-## Step 6: Write Workflows (if complex)
-
-For each workflow:
-```xml
-
-Which references to load for this workflow
-
-
-
-Step-by-step procedure
-
-
-
-How to know this workflow is done
-
-```
-
-## Step 7: Write References (if needed)
-
-Domain knowledge that:
-- Multiple workflows might need
-- Doesn't change based on workflow
-- Contains patterns, examples, technical details
-
-## Step 8: Validate Structure
-
-Check:
-- [ ] YAML frontmatter valid
-- [ ] Name matches directory (lowercase-with-hyphens)
-- [ ] Description says what it does AND when to use it (third person)
-- [ ] No markdown headings (#) in body - use XML tags
-- [ ] Required tags present: objective, quick_start, success_criteria
-- [ ] All referenced files exist
-- [ ] SKILL.md under 500 lines
-- [ ] XML tags properly closed
-
-## Step 9: Create Slash Command
-
-```bash
-cat > ~/.claude/commands/{skill-name}.md << 'EOF'
----
-description: {Brief description}
-argument-hint: [{argument hint}]
-allowed-tools: Skill({skill-name})
----
-
-Invoke the {skill-name} skill for: $ARGUMENTS
-EOF
-```
-
-## Step 10: Test
-
-Invoke the skill and observe:
-- Does it ask the right intake question?
-- Does it load the right workflow?
-- Does the workflow load the right references?
-- Does output match expectations?
-
-Iterate based on real usage, not assumptions.
-
-
-
-Skill is complete when:
-- [ ] Requirements gathered with appropriate questions
-- [ ] API research done if external service involved
-- [ ] Directory structure correct
-- [ ] SKILL.md has valid frontmatter
-- [ ] Essential principles inline (if complex skill)
-- [ ] Intake question routes to correct workflow
-- [ ] All workflows have required_reading + process + success_criteria
-- [ ] References contain reusable domain knowledge
-- [ ] Slash command exists and works
-- [ ] Tested with real invocation
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md
deleted file mode 100644
index 48f7b7d..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# Workflow: Get Guidance on Skill Design
-
-
-**Read these reference files NOW:**
-1. references/core-principles.md
-2. references/recommended-structure.md
-
-
-
-## Step 1: Understand the Problem Space
-
-Ask the user:
-- What task or domain are you trying to support?
-- Is this something you do repeatedly?
-- What makes it complex enough to need a skill?
-
-## Step 2: Determine If a Skill Is Right
-
-**Create a skill when:**
-- Task is repeated across multiple sessions
-- Domain knowledge doesn't change frequently
-- Complex enough to benefit from structure
-- Would save significant time if automated
-
-**Don't create a skill when:**
-- One-off task (just do it directly)
-- Changes constantly (will be outdated quickly)
-- Too simple (overhead isn't worth it)
-- Better as a slash command (user-triggered, no context needed)
-
-Share this assessment with user.
-
-## Step 3: Map the Workflows
-
-Ask: "What are the different things someone might want to do with this skill?"
-
-Common patterns:
-- Create / Read / Update / Delete
-- Build / Debug / Ship
-- Setup / Use / Troubleshoot
-- Import / Process / Export
-
-Each distinct workflow = potential workflow file.
-
-## Step 4: Identify Domain Knowledge
-
-Ask: "What knowledge is needed regardless of which workflow?"
-
-This becomes references:
-- API patterns
-- Best practices
-- Common examples
-- Configuration details
-
-## Step 5: Draft the Structure
-
-Based on answers, recommend structure:
-
-**If 1 workflow, simple knowledge:**
-```
-skill-name/
-└── SKILL.md (everything in one file)
-```
-
-**If 2+ workflows, shared knowledge:**
-```
-skill-name/
-├── SKILL.md (router)
-├── workflows/
-│ ├── workflow-a.md
-│ └── workflow-b.md
-└── references/
- └── shared-knowledge.md
-```
-
-## Step 6: Identify Essential Principles
-
-Ask: "What rules should ALWAYS apply, no matter which workflow?"
-
-These become `` in SKILL.md.
-
-Examples:
-- "Always verify before reporting success"
-- "Never store credentials in code"
-- "Ask before making destructive changes"
-
-## Step 7: Present Recommendation
-
-Summarize:
-- Recommended structure (simple vs router pattern)
-- List of workflows
-- List of references
-- Essential principles
-
-Ask: "Does this structure make sense? Ready to build it?"
-
-If yes → offer to switch to "Create a new skill" workflow
-If no → clarify and iterate
-
-
-
-## Quick Decision Framework
-
-| Situation | Recommendation |
-|-----------|----------------|
-| Single task, repeat often | Simple skill |
-| Multiple related tasks | Router + workflows |
-| Complex domain, many patterns | Router + workflows + references |
-| User-triggered, fresh context | Slash command, not skill |
-| One-off task | No skill needed |
-
-
-
-Guidance is complete when:
-- [ ] User understands if they need a skill
-- [ ] Structure is recommended and explained
-- [ ] Workflows are identified
-- [ ] References are identified
-- [ ] Essential principles are identified
-- [ ] User is ready to build (or decided not to)
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md
deleted file mode 100644
index 26c0d11..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md
+++ /dev/null
@@ -1,161 +0,0 @@
-# Workflow: Upgrade Skill to Router Pattern
-
-
-**Read these reference files NOW:**
-1. references/recommended-structure.md
-2. references/skill-structure.md
-
-
-
-## Step 1: Select the Skill
-
-```bash
-ls ~/.claude/skills/
-```
-
-Present numbered list, ask: "Which skill should be upgraded to the router pattern?"
-
-## Step 2: Verify It Needs Upgrading
-
-Read the skill:
-```bash
-cat ~/.claude/skills/{skill-name}/SKILL.md
-ls ~/.claude/skills/{skill-name}/
-```
-
-**Already a router?** (has workflows/ and intake question)
-→ Tell user it's already using router pattern, offer to add workflows instead
-
-**Simple skill that should stay simple?** (under 200 lines, single workflow)
-→ Explain that router pattern may be overkill, ask if they want to proceed anyway
-
-**Good candidate for upgrade:**
-- Over 200 lines
-- Multiple distinct use cases
-- Essential principles that shouldn't be skipped
-- Growing complexity
-
-## Step 3: Identify Components
-
-Analyze the current skill and identify:
-
-1. **Essential principles** - Rules that apply to ALL use cases
-2. **Distinct workflows** - Different things a user might want to do
-3. **Reusable knowledge** - Patterns, examples, technical details
-
-Present findings:
-```
-## Analysis
-
-**Essential principles I found:**
-- [Principle 1]
-- [Principle 2]
-
-**Distinct workflows I identified:**
-- [Workflow A]: [description]
-- [Workflow B]: [description]
-
-**Knowledge that could be references:**
-- [Reference topic 1]
-- [Reference topic 2]
-```
-
-Ask: "Does this breakdown look right? Any adjustments?"
-
-## Step 4: Create Directory Structure
-
-```bash
-mkdir -p ~/.claude/skills/{skill-name}/workflows
-mkdir -p ~/.claude/skills/{skill-name}/references
-```
-
-## Step 5: Extract Workflows
-
-For each identified workflow:
-
-1. Create `workflows/{workflow-name}.md`
-2. Add required_reading section (references it needs)
-3. Add process section (steps from original skill)
-4. Add success_criteria section
-
-## Step 6: Extract References
-
-For each identified reference topic:
-
-1. Create `references/{reference-name}.md`
-2. Move relevant content from original skill
-3. Structure with semantic XML tags
-
-## Step 7: Rewrite SKILL.md as Router
-
-Replace SKILL.md with router structure:
-
-```markdown
----
-name: {skill-name}
-description: {existing description}
----
-
-
-[Extracted principles - inline, cannot be skipped]
-
-
-
-**Ask the user:**
-
-What would you like to do?
-1. [Workflow A option]
-2. [Workflow B option]
-...
-
-**Wait for response before proceeding.**
-
-
-
-| Response | Workflow |
-|----------|----------|
-| 1, "keywords" | `workflows/workflow-a.md` |
-| 2, "keywords" | `workflows/workflow-b.md` |
-
-
-
-[List all references by category]
-
-
-
-| Workflow | Purpose |
-|----------|---------|
-| workflow-a.md | [What it does] |
-| workflow-b.md | [What it does] |
-
-```
-
-## Step 8: Verify Nothing Was Lost
-
-Compare original skill content against new structure:
-- [ ] All principles preserved (now inline)
-- [ ] All procedures preserved (now in workflows)
-- [ ] All knowledge preserved (now in references)
-- [ ] No orphaned content
-
-## Step 9: Test
-
-Invoke the upgraded skill:
-- Does intake question appear?
-- Does each routing option work?
-- Do workflows load correct references?
-- Does behavior match original skill?
-
-Report any issues.
-
-
-
-Upgrade is complete when:
-- [ ] workflows/ directory created with workflow files
-- [ ] references/ directory created (if needed)
-- [ ] SKILL.md rewritten as router
-- [ ] Essential principles inline in SKILL.md
-- [ ] All original content preserved
-- [ ] Intake question routes correctly
-- [ ] Tested and working
-
diff --git a/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md b/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md
deleted file mode 100644
index ab85743..0000000
--- a/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md
+++ /dev/null
@@ -1,204 +0,0 @@
-# Workflow: Verify Skill Content Accuracy
-
-
-**Read these reference files NOW:**
-1. references/skill-structure.md
-
-
-
-Audit checks structure. **Verify checks truth.**
-
-Skills contain claims about external things: APIs, CLI tools, frameworks, services. These change over time. This workflow checks if a skill's content is still accurate.
-
-
-
-## Step 1: Select the Skill
-
-```bash
-ls ~/.claude/skills/
-```
-
-Present numbered list, ask: "Which skill should I verify for accuracy?"
-
-## Step 2: Read and Categorize
-
-Read the entire skill (SKILL.md + workflows/ + references/):
-```bash
-cat ~/.claude/skills/{skill-name}/SKILL.md
-cat ~/.claude/skills/{skill-name}/workflows/*.md 2>/dev/null
-cat ~/.claude/skills/{skill-name}/references/*.md 2>/dev/null
-```
-
-Categorize by primary dependency type:
-
-| Type | Examples | Verification Method |
-|------|----------|---------------------|
-| **API/Service** | manage-stripe, manage-gohighlevel | Context7 + WebSearch |
-| **CLI Tools** | build-macos-apps (xcodebuild, swift) | Run commands |
-| **Framework** | build-iphone-apps (SwiftUI, UIKit) | Context7 for docs |
-| **Integration** | setup-stripe-payments | WebFetch + Context7 |
-| **Pure Process** | create-agent-skills | No external deps |
-
-Report: "This skill is primarily [type]-based. I'll verify using [method]."
-
-## Step 3: Extract Verifiable Claims
-
-Scan skill content and extract:
-
-**CLI Tools mentioned:**
-- Tool names (xcodebuild, swift, npm, etc.)
-- Specific flags/options documented
-- Expected output patterns
-
-**API Endpoints:**
-- Service names (Stripe, Meta, etc.)
-- Specific endpoints documented
-- Authentication methods
-- SDK versions
-
-**Framework Patterns:**
-- Framework names (SwiftUI, React, etc.)
-- Specific APIs/patterns documented
-- Version-specific features
-
-**File Paths/Structures:**
-- Expected project structures
-- Config file locations
-
-Present: "Found X verifiable claims to check."
-
-## Step 4: Verify by Type
-
-### For CLI Tools
-```bash
-# Check tool exists
-which {tool-name}
-
-# Check version
-{tool-name} --version
-
-# Verify documented flags work
-{tool-name} --help | grep "{documented-flag}"
-```
-
-### For API/Service Skills
-Use Context7 to fetch current documentation:
-```
-mcp__context7__resolve-library-id: {service-name}
-mcp__context7__get-library-docs: {library-id}, topic: {relevant-topic}
-```
-
-Compare skill's documented patterns against current docs:
-- Are endpoints still valid?
-- Has authentication changed?
-- Are there deprecated methods being used?
-
-### For Framework Skills
-Use Context7:
-```
-mcp__context7__resolve-library-id: {framework-name}
-mcp__context7__get-library-docs: {library-id}, topic: {specific-api}
-```
-
-Check:
-- Are documented APIs still current?
-- Have patterns changed?
-- Are there newer recommended approaches?
-
-### For Integration Skills
-WebSearch for recent changes:
-```
-"[service name] API changes 2026"
-"[service name] breaking changes"
-"[service name] deprecated endpoints"
-```
-
-Then Context7 for current SDK patterns.
-
-### For Services with Status Pages
-WebFetch official docs/changelog if available.
-
-## Step 5: Generate Freshness Report
-
-Present findings:
-
-```
-## Verification Report: {skill-name}
-
-### ✅ Verified Current
-- [Claim]: [Evidence it's still accurate]
-
-### ⚠️ May Be Outdated
-- [Claim]: [What changed / newer info found]
- → Current: [what docs now say]
-
-### ❌ Broken / Invalid
-- [Claim]: [Why it's wrong]
- → Fix: [What it should be]
-
-### ℹ️ Could Not Verify
-- [Claim]: [Why verification wasn't possible]
-
----
-**Overall Status:** [Fresh / Needs Updates / Significantly Stale]
-**Last Verified:** [Today's date]
-```
-
-## Step 6: Offer Updates
-
-If issues found:
-
-"Found [N] items that need updating. Would you like me to:"
-
-1. **Update all** - Apply all corrections
-2. **Review each** - Show each change before applying
-3. **Just the report** - No changes
-
-If updating:
-- Make changes based on verified current information
-- Add verification date comment if appropriate
-- Report what was updated
-
-## Step 7: Suggest Verification Schedule
-
-Based on skill type, recommend:
-
-| Skill Type | Recommended Frequency |
-|------------|----------------------|
-| API/Service | Every 1-2 months |
-| Framework | Every 3-6 months |
-| CLI Tools | Every 6 months |
-| Pure Process | Annually |
-
-"This skill should be re-verified in approximately [timeframe]."
-
-
-
-## Quick Verification Commands
-
-**Check if CLI tool exists and get version:**
-```bash
-which {tool} && {tool} --version
-```
-
-**Context7 pattern for any library:**
-```
-1. resolve-library-id: "{library-name}"
-2. get-library-docs: "{id}", topic: "{specific-feature}"
-```
-
-**WebSearch patterns:**
-- Breaking changes: "{service} breaking changes 2026"
-- Deprecations: "{service} deprecated API"
-- Current best practices: "{framework} best practices 2026"
-
-
-
-Verification is complete when:
-- [ ] Skill categorized by dependency type
-- [ ] Verifiable claims extracted
-- [ ] Each claim checked with appropriate method
-- [ ] Freshness report generated
-- [ ] Updates applied (if requested)
-- [ ] User knows when to re-verify
-
diff --git a/plugins/compound-engineering/skills/deepen-plan/SKILL.md b/plugins/compound-engineering/skills/deepen-plan/SKILL.md
index 5e20491..bd44234 100644
--- a/plugins/compound-engineering/skills/deepen-plan/SKILL.md
+++ b/plugins/compound-engineering/skills/deepen-plan/SKILL.md
@@ -1,544 +1,409 @@
---
name: deepen-plan
-description: Enhance a plan with parallel research agents for each section to add depth, best practices, and implementation details
+description: "Stress-test an existing implementation plan and selectively strengthen weak sections with targeted research. Use when a plan needs more confidence around decisions, sequencing, system-wide impact, risks, or verification. Best for Standard or Deep plans, or high-risk topics such as auth, payments, migrations, external APIs, and security. For structural or clarity improvements, prefer document-review instead."
argument-hint: "[path to plan file]"
---
-# Deepen Plan - Power Enhancement Mode
+# Deepen Plan
## Introduction
**Note: The current year is 2026.** Use this when searching for recent documentation and best practices.
-This command takes an existing plan (from `/ce:plan`) and enhances each section with parallel research agents. Each major element gets its own dedicated research sub-agent to find:
-- Best practices and industry patterns
-- Performance optimizations
-- UI/UX improvements (if applicable)
-- Quality enhancements and edge cases
-- Real-world implementation examples
+`ce:plan` does the first planning pass. `deepen-plan` is a second-pass confidence check.
-The result is a deeply grounded, production-ready plan with concrete implementation details.
+Use this skill when the plan already exists and the question is not "Is this document clear?" but rather "Is this plan grounded enough for the complexity and risk involved?"
+
+This skill does **not** turn plans into implementation scripts. It identifies weak sections, runs targeted research only for those sections, and strengthens the plan in place.
+
+`document-review` and `deepen-plan` are different:
+- Use the `document-review` skill when the document needs clarity, simplification, completeness, or scope control
+- Use `deepen-plan` when the document is structurally sound but still needs stronger rationale, sequencing, risk treatment, or system-wide thinking
+
+## Interaction Method
+
+Use the platform's question tool when available. When asking the user a question, prefer the platform's blocking question tool if one exists (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
+
+Ask one question at a time. Prefer a concise single-select choice when natural options exist.
## Plan File
#$ARGUMENTS
-**If the plan path above is empty:**
-1. Check for recent plans: `ls -la docs/plans/`
-2. Ask the user: "Which plan would you like to deepen? Please provide the path (e.g., `docs/plans/2026-01-15-feat-my-feature-plan.md`)."
+If the plan path above is empty:
+1. Check `docs/plans/` for recent files
+2. Ask the user which plan to deepen using the platform's blocking question tool when available (see Interaction Method). Otherwise, present numbered options in chat and wait for the user's reply before proceeding
Do not proceed until you have a valid plan file path.
-## Main Tasks
+## Core Principles
+
+1. **Stress-test, do not inflate** - Deepening should increase justified confidence, not make the plan longer for its own sake.
+2. **Selective depth only** - Focus on the weakest 2-5 sections rather than enriching everything.
+3. **Prefer the simplest execution mode** - Use direct agent synthesis by default. Switch to artifact-backed research only when the selected research scope is large enough that returning all findings inline would create avoidable context pressure.
+4. **Preserve the planning boundary** - No implementation code, no git command choreography, no exact test command recipes.
+5. **Use artifact-contained evidence** - Work from the written plan, its `Context & Research`, `Sources & References`, and its origin document when present.
+6. **Respect product boundaries** - Do not invent new product requirements. If deepening reveals a product-level gap, surface it as an open question or route back to `ce:brainstorm`.
+7. **Prioritize risk and cross-cutting impact** - The more dangerous or interconnected the work, the more valuable another planning pass becomes.
+
+## Workflow
+
+### Phase 0: Load the Plan and Decide Whether Deepening Is Warranted
+
+#### 0.1 Read the Plan and Supporting Inputs
+
+Read the plan file completely.
+
+If the plan frontmatter includes an `origin:` path:
+- Read the origin document too
+- Use it to check whether the plan still reflects the product intent, scope boundaries, and success criteria
+
+#### 0.2 Classify Plan Depth and Topic Risk
+
+Determine the plan depth from the document:
+- **Lightweight** - small, bounded, low ambiguity, usually 2-4 implementation units
+- **Standard** - moderate complexity, some technical decisions, usually 3-6 units
+- **Deep** - cross-cutting, high-risk, or strategically important work, usually 4-8 units or phased delivery
+
+Also build a risk profile. Treat these as high-risk signals:
+- Authentication, authorization, or security-sensitive behavior
+- Payments, billing, or financial flows
+- Data migrations, backfills, or persistent data changes
+- External APIs or third-party integrations
+- Privacy, compliance, or user data handling
+- Cross-interface parity or multi-surface behavior
+- Significant rollout, monitoring, or operational concerns
+
+#### 0.3 Decide Whether to Deepen
+
+Use this default:
+- **Lightweight** plans usually do not need deepening unless they are high-risk or the user explicitly requests it
+- **Standard** plans often benefit when one or more important sections still look thin
+- **Deep** or high-risk plans often benefit from a targeted second pass
+
+If the plan already appears sufficiently grounded:
+- Say so briefly
+- Recommend moving to `/ce:work` or the `document-review` skill
+- If the user explicitly asked to deepen anyway, continue with a light pass and deepen at most 1-2 sections
+
+### Phase 1: Parse the Current `ce:plan` Structure
+
+Map the plan into the current template. Look for these sections, or their nearest equivalents:
+- `Overview`
+- `Problem Frame`
+- `Requirements Trace`
+- `Scope Boundaries`
+- `Context & Research`
+- `Key Technical Decisions`
+- `Open Questions`
+- `High-Level Technical Design` (optional overview — pseudo-code, DSL grammar, mermaid diagram, or data flow)
+- `Implementation Units` (may include per-unit `Technical design` subsections)
+- `System-Wide Impact`
+- `Risks & Dependencies`
+- `Documentation / Operational Notes`
+- `Sources & References`
+- Optional deep-plan sections such as `Alternative Approaches Considered`, `Success Metrics`, `Phased Delivery`, `Risk Analysis & Mitigation`, and `Operational / Rollout Notes`
+
+If the plan was written manually or uses different headings:
+- Map sections by intent rather than exact heading names
+- If a section is structurally present but titled differently, treat it as the equivalent section
+- If the plan truly lacks a section, decide whether that absence is intentional for the plan depth or a confidence gap worth scoring
+
+Also collect:
+- Frontmatter, including existing `deepened:` date if present
+- Number of implementation units
+- Which files and test files are named
+- Which learnings, patterns, or external references are cited
+- Which sections appear omitted because they were unnecessary versus omitted because they are missing
+
+### Phase 2: Score Confidence Gaps
+
+Use a checklist-first, risk-weighted scoring pass.
+
+For each section, compute:
+- **Trigger count** - number of checklist problems that apply
+- **Risk bonus** - add 1 if the topic is high-risk and this section is materially relevant to that risk
+- **Critical-section bonus** - add 1 for `Key Technical Decisions`, `Implementation Units`, `System-Wide Impact`, `Risks & Dependencies`, or `Open Questions` in `Standard` or `Deep` plans
+
+Treat a section as a candidate if:
+- it hits **2+ total points**, or
+- it hits **1+ point** in a high-risk domain and the section is materially important
+
+Choose only the top **2-5** sections by score. If the user explicitly asked to deepen a lightweight plan, cap at **1-2** sections unless the topic is high-risk.
+
+Example:
+- A `Key Technical Decisions` section with 1 checklist trigger and the critical-section bonus scores **2 points** and is a candidate
+- A `Risks & Dependencies` section with 1 checklist trigger in a high-risk migration plan also becomes a candidate because the risk bonus applies
+
+If the plan already has a `deepened:` date:
+- Prefer sections that have not yet been substantially strengthened, if their scores are comparable
+- Revisit an already-deepened section only when it still scores clearly higher than alternatives or the user explicitly asks for another pass on it
+
+#### 2.1 Section Checklists
+
+Use these triggers.
+
+**Requirements Trace**
+- Requirements are vague or disconnected from implementation units
+- Success criteria are missing or not reflected downstream
+- Units do not clearly advance the traced requirements
+- Origin requirements are not clearly carried forward
+
+**Context & Research / Sources & References**
+- Relevant repo patterns are named but never used in decisions or implementation units
+- Cited learnings or references do not materially shape the plan
+- High-risk work lacks appropriate external or internal grounding
+- Research is generic instead of tied to this repo or this plan
+
+**Key Technical Decisions**
+- A decision is stated without rationale
+- Rationale does not explain tradeoffs or rejected alternatives
+- The decision does not connect back to scope, requirements, or origin context
+- An obvious design fork exists but the plan never addresses why one path won
+
+**Open Questions**
+- Product blockers are hidden as assumptions
+- Planning-owned questions are incorrectly deferred to implementation
+- Resolved questions have no clear basis in repo context, research, or origin decisions
+- Deferred items are too vague to be useful later
+
+**High-Level Technical Design (when present)**
+- The sketch uses the wrong medium for the work (e.g., pseudo-code where a sequence diagram would communicate better)
+- The sketch contains implementation code (imports, exact signatures, framework-specific syntax) rather than pseudo-code
+- The non-prescriptive framing is missing or weak
+- The sketch does not connect to the key technical decisions or implementation units
+
+**High-Level Technical Design (when absent)** *(Standard or Deep plans only)*
+- The work involves DSL design, API surface design, multi-component integration, complex data flow, or state-heavy lifecycle
+- Key technical decisions would be easier to validate with a visual or pseudo-code representation
+- The approach section of implementation units is thin and a higher-level technical design would provide context
+
+**Implementation Units**
+- Dependency order is unclear or likely wrong
+- File paths or test file paths are missing where they should be explicit
+- Units are too large, too vague, or broken into micro-steps
+- Approach notes are thin or do not name the pattern to follow
+- Test scenarios or verification outcomes are vague
+
+**System-Wide Impact**
+- Affected interfaces, callbacks, middleware, entry points, or parity surfaces are missing
+- Failure propagation is underexplored
+- State lifecycle, caching, or data integrity risks are absent where relevant
+- Integration coverage is weak for cross-layer work
+
+**Risks & Dependencies / Documentation / Operational Notes**
+- Risks are listed without mitigation
+- Rollout, monitoring, migration, or support implications are missing when warranted
+- External dependency assumptions are weak or unstated
+- Security, privacy, performance, or data risks are absent where they obviously apply
+
+Use the plan's own `Context & Research` and `Sources & References` as evidence. If those sections cite a pattern, learning, or risk that never affects decisions, implementation units, or verification, treat that as a confidence gap.
-### 1. Parse and Analyze Plan Structure
+### Phase 3: Select Targeted Research Agents
-
-First, read and parse the plan to identify each major section that can be enhanced with research.
-
+For each selected section, choose the smallest useful agent set. Do **not** run every agent. Use at most **1-3 agents per section** and usually no more than **8 agents total**.
-**Read the plan file and extract:**
-- [ ] Overview/Problem Statement
-- [ ] Proposed Solution sections
-- [ ] Technical Approach/Architecture
-- [ ] Implementation phases/steps
-- [ ] Code examples and file references
-- [ ] Acceptance criteria
-- [ ] Any UI/UX components mentioned
-- [ ] Technologies/frameworks mentioned (Rails, React, Python, TypeScript, etc.)
-- [ ] Domain areas (data models, APIs, UI, security, performance, etc.)
+Use fully-qualified agent names inside Task calls.
-**Create a section manifest:**
-```
-Section 1: [Title] - [Brief description of what to research]
-Section 2: [Title] - [Brief description of what to research]
-...
-```
+#### 3.1 Deterministic Section-to-Agent Mapping
-### 2. Discover and Apply Available Skills
+**Requirements Trace / Open Questions classification**
+- `compound-engineering:workflow:spec-flow-analyzer` for missing user flows, edge cases, and handoff gaps
+- `compound-engineering:research:repo-research-analyst` (Scope: `architecture, patterns`) for repo-grounded patterns, conventions, and implementation reality checks
-
-Dynamically discover all available skills and match them to plan sections. Don't assume what skills exist - discover them at runtime.
-
+**Context & Research / Sources & References gaps**
+- `compound-engineering:research:learnings-researcher` for institutional knowledge and past solved problems
+- `compound-engineering:research:framework-docs-researcher` for official framework or library behavior
+- `compound-engineering:research:best-practices-researcher` for current external patterns and industry guidance
+- Add `compound-engineering:research:git-history-analyzer` only when historical rationale or prior art is materially missing
-**Step 1: Discover ALL available skills from ALL sources**
+**Key Technical Decisions**
+- `compound-engineering:review:architecture-strategist` for design integrity, boundaries, and architectural tradeoffs
+- Add `compound-engineering:research:framework-docs-researcher` or `compound-engineering:research:best-practices-researcher` when the decision needs external grounding beyond repo evidence
+
+**High-Level Technical Design**
+- `compound-engineering:review:architecture-strategist` for validating that the technical design accurately represents the intended approach and identifying gaps
+- `compound-engineering:research:repo-research-analyst` (Scope: `architecture, patterns`) for grounding the technical design in existing repo patterns and conventions
+- Add `compound-engineering:research:best-practices-researcher` when the technical design involves a DSL, API surface, or pattern that benefits from external validation
-```bash
-# 1. Project-local skills (highest priority - project-specific)
-ls .claude/skills/
+**Implementation Units / Verification**
+- `compound-engineering:research:repo-research-analyst` (Scope: `patterns`) for concrete file targets, patterns to follow, and repo-specific sequencing clues
+- `compound-engineering:review:pattern-recognition-specialist` for consistency, duplication risks, and alignment with existing patterns
+- Add `compound-engineering:workflow:spec-flow-analyzer` when sequencing depends on user flow or handoff completeness
-# 2. User's global skills (~/.claude/)
-ls ~/.claude/skills/
+**System-Wide Impact**
+- `compound-engineering:review:architecture-strategist` for cross-boundary effects, interface surfaces, and architectural knock-on impact
+- Add the specific specialist that matches the risk:
+ - `compound-engineering:review:performance-oracle` for scalability, latency, throughput, and resource-risk analysis
+ - `compound-engineering:review:security-sentinel` for auth, validation, exploit surfaces, and security boundary review
+ - `compound-engineering:review:data-integrity-guardian` for migrations, persistent state safety, consistency, and data lifecycle risks
-# 3. compound-engineering plugin skills
-ls ~/.claude/plugins/cache/*/compound-engineering/*/skills/
+**Risks & Dependencies / Operational Notes**
+- Use the specialist that matches the actual risk:
+ - `compound-engineering:review:security-sentinel` for security, auth, privacy, and exploit risk
+ - `compound-engineering:review:data-integrity-guardian` for persistent data safety, constraints, and transaction boundaries
+ - `compound-engineering:review:data-migration-expert` for migration realism, backfills, and production data transformation risk
+ - `compound-engineering:review:deployment-verification-agent` for rollout checklists, rollback planning, and launch verification
+ - `compound-engineering:review:performance-oracle` for capacity, latency, and scaling concerns
+
+#### 3.2 Agent Prompt Shape
+
+For each selected section, pass:
+- The scope prefix from section 3.1 (e.g., `Scope: architecture, patterns.`) when the agent supports scoped invocation
+- A short plan summary
+- The exact section text
+- Why the section was selected, including which checklist triggers fired
+- The plan depth and risk profile
+- A specific question to answer
+
+Instruct the agent to return:
+- findings that change planning quality
+- stronger rationale, sequencing, verification, risk treatment, or references
+- no implementation code
+- no shell commands
+
+#### 3.3 Choose Research Execution Mode
+
+Use the lightest mode that will work:
+
+- **Direct mode** - Default. Use when the selected section set is small and the parent can safely read the agent outputs inline.
+- **Artifact-backed mode** - Use only when the selected research scope is large enough that inline returns would create unnecessary context pressure.
+
+Signals that justify artifact-backed mode:
+- More than 5 agents are likely to return meaningful findings
+- The selected section excerpts are long enough that repeating them in multiple agent outputs would be wasteful
+- The topic is high-risk and likely to attract bulky source-backed analysis
+- The platform has a history of parent-context instability on large parallel returns
+
+If artifact-backed mode is not clearly warranted, stay in direct mode.
+
+### Phase 4: Run Targeted Research and Review
+
+Launch the selected agents in parallel using the execution mode chosen in Step 3.3. If the current platform does not support parallel dispatch, run them sequentially instead.
+
+Prefer local repo and institutional evidence first. Use external research only when the gap cannot be closed responsibly from repo context or already-cited sources.
+
+If a selected section can be improved by reading the origin document more carefully, do that before dispatching external agents.
-# 4. ALL other installed plugins - check every plugin for skills
-find ~/.claude/plugins/cache -type d -name "skills" 2>/dev/null
+#### 4.1 Direct Mode
+
+Have each selected agent return its findings directly to the parent.
-# 5. Also check installed_plugins.json for all plugin locations
-cat ~/.claude/plugins/installed_plugins.json
-```
+Keep the return payload focused:
+- strongest findings only
+- the evidence or sources that matter
+- the concrete planning improvement implied by the finding
-**Important:** Check EVERY source. Don't assume compound-engineering is the only plugin. Use skills from ANY installed plugin that's relevant.
+If a direct-mode agent starts producing bulky or repetitive output, stop and switch the remaining research to artifact-backed mode instead of letting the parent context bloat.
-**Step 2: For each discovered skill, read its SKILL.md to understand what it does**
+#### 4.2 Artifact-Backed Mode
-```bash
-# For each skill directory found, read its documentation
-cat [skill-path]/SKILL.md
-```
+Use a per-run scratch directory under `.context/compound-engineering/deepen-plan/`, for example `.context/compound-engineering/deepen-plan//` or `.context/compound-engineering/deepen-plan//`.
+
+Use the scratch directory only for the current deepening pass.
+
+For each selected agent:
+- give it the same plan summary, section text, trigger rationale, depth, and risk profile described in Step 3.2
+- instruct it to write one compact artifact file for its assigned section or sections
+- have it return only a short completion summary to the parent
+
+Prefer a compact markdown artifact unless machine-readable structure is clearly useful. Each artifact should contain:
+- target section id and title
+- why the section was selected
+- 3-7 findings that materially improve planning quality
+- source-backed rationale, including whether the evidence came from repo context, origin context, institutional learnings, official docs, or external best practices
+- the specific plan change implied by each finding
+- any unresolved tradeoff that should remain explicit in the plan
+
+Artifact rules:
+- no implementation code
+- no shell commands
+- no checkpoint logs or self-diagnostics
+- no duplicated boilerplate across files
+- no judge or merge sub-pipeline
+
+Before synthesis:
+- quickly verify that each selected section has at least one usable artifact
+- if an artifact is missing or clearly malformed, re-run that agent or fall back to direct-mode reasoning for that section instead of building a validation pipeline
+
+If agent outputs conflict:
+- Prefer repo-grounded and origin-grounded evidence over generic advice
+- Prefer official framework documentation over secondary best-practice summaries when the conflict is about library behavior
+- If a real tradeoff remains, record it explicitly in the plan rather than pretending the conflict does not exist
+
+### Phase 5: Synthesize and Rewrite the Plan
+
+Strengthen only the selected sections. Keep the plan coherent and preserve its overall structure.
+
+If artifact-backed mode was used:
+- read the plan, origin document if present, and the selected section artifacts
+- also incorporate any findings already returned inline from direct-mode agents before a mid-run switch, so early results are not silently dropped
+- synthesize in one pass
+- do not create a separate judge, merge, or quality-review phase unless the user explicitly asks for another pass
-**Step 3: Match skills to plan content**
+Allowed changes:
+- Clarify or strengthen decision rationale
+- Tighten requirements trace or origin fidelity
+- Reorder or split implementation units when sequencing is weak
+- Add missing pattern references, file/test paths, or verification outcomes
+- Expand system-wide impact, risks, or rollout treatment where justified
+- Reclassify open questions between `Resolved During Planning` and `Deferred to Implementation` when evidence supports the change
+- Strengthen, replace, or add a High-Level Technical Design section when the work warrants it and the current representation is weak, uses the wrong medium, or is absent where it would help. Preserve the non-prescriptive framing
+- Strengthen or add per-unit technical design fields where the unit's approach is non-obvious and the current approach notes are thin
+- Add an optional deep-plan section only when it materially improves execution quality
+- Add or update `deepened: YYYY-MM-DD` in frontmatter when the plan was substantively improved
-For each skill discovered:
-- Read its SKILL.md description
-- Check if any plan sections match the skill's domain
-- If there's a match, spawn a sub-agent to apply that skill's knowledge
+Do **not**:
+- Add implementation code — no imports, exact method signatures, or framework-specific syntax. Pseudo-code sketches and DSL grammars are allowed in both the top-level High-Level Technical Design section and per-unit technical design fields
+- Add git commands, commit choreography, or exact test command recipes
+- Add generic `Research Insights` subsections everywhere
+- Rewrite the entire plan from scratch
+- Invent new product requirements, scope changes, or success criteria without surfacing them explicitly
-**Step 4: Spawn a sub-agent for EVERY matched skill**
+If research reveals a product-level ambiguity that should change behavior or scope:
+- Do not silently decide it here
+- Record it under `Open Questions`
+- Recommend `ce:brainstorm` if the gap is truly product-defining
-**CRITICAL: For EACH skill that matches, spawn a separate sub-agent and instruct it to USE that skill.**
+### Phase 6: Final Checks and Write the File
-For each matched skill:
-```
-Task general-purpose: "You have the [skill-name] skill available at [skill-path].
+Before writing:
+- Confirm the plan is stronger in specific ways, not merely longer
+- Confirm the planning boundary is intact
+- Confirm the selected sections were actually the weakest ones
+- Confirm origin decisions were preserved when an origin document exists
+- Confirm the final plan still feels right-sized for its depth
+- If artifact-backed mode was used, confirm the scratch artifacts did not become a second hidden plan format
-YOUR JOB: Use this skill on the plan.
+Update the plan file in place by default.
-1. Read the skill: cat [skill-path]/SKILL.md
-2. Follow the skill's instructions exactly
-3. Apply the skill to this content:
-
-[relevant plan section or full plan]
-
-4. Return the skill's full output
-
-The skill tells you what to do - follow it. Execute the skill completely."
-```
-
-**Spawn ALL skill sub-agents in PARALLEL:**
-- 1 sub-agent per matched skill
-- Each sub-agent reads and uses its assigned skill
-- All run simultaneously
-- 10, 20, 30 skill sub-agents is fine
-
-**Each sub-agent:**
-1. Reads its skill's SKILL.md
-2. Follows the skill's workflow/instructions
-3. Applies the skill to the plan
-4. Returns whatever the skill produces (code, recommendations, patterns, reviews, etc.)
-
-**Example spawns:**
-```
-Task general-purpose: "Use the dhh-rails-style skill at ~/.claude/plugins/.../dhh-rails-style. Read SKILL.md and apply it to: [Rails sections of plan]"
-
-Task general-purpose: "Use the frontend-design skill at ~/.claude/plugins/.../frontend-design. Read SKILL.md and apply it to: [UI sections of plan]"
-
-Task general-purpose: "Use the agent-native-architecture skill at ~/.claude/plugins/.../agent-native-architecture. Read SKILL.md and apply it to: [agent/tool sections of plan]"
-
-Task general-purpose: "Use the security-patterns skill at ~/.claude/skills/security-patterns. Read SKILL.md and apply it to: [full plan]"
-```
-
-**No limit on skill sub-agents. Spawn one for every skill that could possibly be relevant.**
-
-### 3. Discover and Apply Learnings/Solutions
-
-
-Check for documented learnings from /ce:compound. These are solved problems stored as markdown files. Spawn a sub-agent for each learning to check if it's relevant.
-
-
-**LEARNINGS LOCATION - Check these exact folders:**
-
-```
-docs/solutions/ <-- PRIMARY: Project-level learnings (created by /ce:compound)
-├── performance-issues/
-│ └── *.md
-├── debugging-patterns/
-│ └── *.md
-├── configuration-fixes/
-│ └── *.md
-├── integration-issues/
-│ └── *.md
-├── deployment-issues/
-│ └── *.md
-└── [other-categories]/
- └── *.md
-```
-
-**Step 1: Find ALL learning markdown files**
-
-Run these commands to get every learning file:
-
-```bash
-# PRIMARY LOCATION - Project learnings
-find docs/solutions -name "*.md" -type f 2>/dev/null
-
-# If docs/solutions doesn't exist, check alternate locations:
-find .claude/docs -name "*.md" -type f 2>/dev/null
-find ~/.claude/docs -name "*.md" -type f 2>/dev/null
-```
-
-**Step 2: Read frontmatter of each learning to filter**
-
-Each learning file has YAML frontmatter with metadata. Read the first ~20 lines of each file to get:
-
-```yaml
----
-title: "N+1 Query Fix for Briefs"
-category: performance-issues
-tags: [activerecord, n-plus-one, includes, eager-loading]
-module: Briefs
-symptom: "Slow page load, multiple queries in logs"
-root_cause: "Missing includes on association"
----
-```
-
-**For each .md file, quickly scan its frontmatter:**
-
-```bash
-# Read first 20 lines of each learning (frontmatter + summary)
-head -20 docs/solutions/**/*.md
-```
-
-**Step 3: Filter - only spawn sub-agents for LIKELY relevant learnings**
-
-Compare each learning's frontmatter against the plan:
-- `tags:` - Do any tags match technologies/patterns in the plan?
-- `category:` - Is this category relevant? (e.g., skip deployment-issues if plan is UI-only)
-- `module:` - Does the plan touch this module?
-- `symptom:` / `root_cause:` - Could this problem occur with the plan?
-
-**SKIP learnings that are clearly not applicable:**
-- Plan is frontend-only → skip `database-migrations/` learnings
-- Plan is Python → skip `rails-specific/` learnings
-- Plan has no auth → skip `authentication-issues/` learnings
-
-**SPAWN sub-agents for learnings that MIGHT apply:**
-- Any tag overlap with plan technologies
-- Same category as plan domain
-- Similar patterns or concerns
-
-**Step 4: Spawn sub-agents for filtered learnings**
-
-For each learning that passes the filter:
-
-```
-Task general-purpose: "
-LEARNING FILE: [full path to .md file]
-
-1. Read this learning file completely
-2. This learning documents a previously solved problem
-
-Check if this learning applies to this plan:
-
----
-[full plan content]
----
-
-If relevant:
-- Explain specifically how it applies
-- Quote the key insight or solution
-- Suggest where/how to incorporate it
-
-If NOT relevant after deeper analysis:
-- Say 'Not applicable: [reason]'
-"
-```
-
-**Example filtering:**
-```
-# Found 15 learning files, plan is about "Rails API caching"
-
-# SPAWN (likely relevant):
-docs/solutions/performance-issues/n-plus-one-queries.md # tags: [activerecord] ✓
-docs/solutions/performance-issues/redis-cache-stampede.md # tags: [caching, redis] ✓
-docs/solutions/configuration-fixes/redis-connection-pool.md # tags: [redis] ✓
-
-# SKIP (clearly not applicable):
-docs/solutions/deployment-issues/heroku-memory-quota.md # not about caching
-docs/solutions/frontend-issues/stimulus-race-condition.md # plan is API, not frontend
-docs/solutions/authentication-issues/jwt-expiry.md # plan has no auth
-```
-
-**Spawn sub-agents in PARALLEL for all filtered learnings.**
-
-**These learnings are institutional knowledge - applying them prevents repeating past mistakes.**
-
-### 4. Launch Per-Section Research Agents
-
-
-For each major section in the plan, spawn dedicated sub-agents to research improvements. Use the Explore agent type for open-ended research.
-
-
-**For each identified section, launch parallel research:**
-
-```
-Task Explore: "Research best practices, patterns, and real-world examples for: [section topic].
-Find:
-- Industry standards and conventions
-- Performance considerations
-- Common pitfalls and how to avoid them
-- Documentation and tutorials
-Return concrete, actionable recommendations."
-```
-
-**Also use Context7 MCP for framework documentation:**
-
-For any technologies/frameworks mentioned in the plan, query Context7:
-```
-mcp__plugin_compound-engineering_context7__resolve-library-id: Find library ID for [framework]
-mcp__plugin_compound-engineering_context7__query-docs: Query documentation for specific patterns
-```
-
-**Use WebSearch for current best practices:**
-
-Search for recent (2024-2026) articles, blog posts, and documentation on topics in the plan.
-
-### 5. Discover and Run ALL Review Agents
-
-
-Dynamically discover every available agent and run them ALL against the plan. Don't filter, don't skip, don't assume relevance. 40+ parallel agents is fine. Use everything available.
-
-
-**Step 1: Discover ALL available agents from ALL sources**
-
-```bash
-# 1. Project-local agents (highest priority - project-specific)
-find .claude/agents -name "*.md" 2>/dev/null
-
-# 2. User's global agents (~/.claude/)
-find ~/.claude/agents -name "*.md" 2>/dev/null
-
-# 3. compound-engineering plugin agents (all subdirectories)
-find ~/.claude/plugins/cache/*/compound-engineering/*/agents -name "*.md" 2>/dev/null
-
-# 4. ALL other installed plugins - check every plugin for agents
-find ~/.claude/plugins/cache -path "*/agents/*.md" 2>/dev/null
-
-# 5. Check installed_plugins.json to find all plugin locations
-cat ~/.claude/plugins/installed_plugins.json
-
-# 6. For local plugins (isLocal: true), check their source directories
-# Parse installed_plugins.json and find local plugin paths
-```
-
-**Important:** Check EVERY source. Include agents from:
-- Project `.claude/agents/`
-- User's `~/.claude/agents/`
-- compound-engineering plugin (but SKIP workflow/ agents - only use review/, research/, design/, docs/)
-- ALL other installed plugins (agent-sdk-dev, frontend-design, etc.)
-- Any local plugins
-
-**For compound-engineering plugin specifically:**
-- USE: `agents/review/*` (all reviewers)
-- USE: `agents/research/*` (all researchers)
-- USE: `agents/design/*` (design agents)
-- USE: `agents/docs/*` (documentation agents)
-- SKIP: `agents/workflow/*` (these are workflow orchestrators, not reviewers)
-
-**Step 2: For each discovered agent, read its description**
-
-Read the first few lines of each agent file to understand what it reviews/analyzes.
-
-**Step 3: Launch ALL agents in parallel**
-
-For EVERY agent discovered, launch a Task in parallel:
-
-```
-Task [agent-name]: "Review this plan using your expertise. Apply all your checks and patterns. Plan content: [full plan content]"
-```
-
-**CRITICAL RULES:**
-- Do NOT filter agents by "relevance" - run them ALL
-- Do NOT skip agents because they "might not apply" - let them decide
-- Launch ALL agents in a SINGLE message with multiple Task tool calls
-- 20, 30, 40 parallel agents is fine - use everything
-- Each agent may catch something others miss
-- The goal is MAXIMUM coverage, not efficiency
-
-**Step 4: Also discover and run research agents**
-
-Research agents (like `best-practices-researcher`, `framework-docs-researcher`, `git-history-analyzer`, `repo-research-analyst`) should also be run for relevant plan sections.
-
-### 6. Wait for ALL Agents and Synthesize Everything
-
-
-Wait for ALL parallel agents to complete - skills, research agents, review agents, everything. Then synthesize all findings into a comprehensive enhancement.
-
-
-**Collect outputs from ALL sources:**
-
-1. **Skill-based sub-agents** - Each skill's full output (code examples, patterns, recommendations)
-2. **Learnings/Solutions sub-agents** - Relevant documented learnings from /ce:compound
-3. **Research agents** - Best practices, documentation, real-world examples
-4. **Review agents** - All feedback from every reviewer (architecture, security, performance, simplicity, etc.)
-5. **Context7 queries** - Framework documentation and patterns
-6. **Web searches** - Current best practices and articles
-
-**For each agent's findings, extract:**
-- [ ] Concrete recommendations (actionable items)
-- [ ] Code patterns and examples (copy-paste ready)
-- [ ] Anti-patterns to avoid (warnings)
-- [ ] Performance considerations (metrics, benchmarks)
-- [ ] Security considerations (vulnerabilities, mitigations)
-- [ ] Edge cases discovered (handling strategies)
-- [ ] Documentation links (references)
-- [ ] Skill-specific patterns (from matched skills)
-- [ ] Relevant learnings (past solutions that apply - prevent repeating mistakes)
-
-**Deduplicate and prioritize:**
-- Merge similar recommendations from multiple agents
-- Prioritize by impact (high-value improvements first)
-- Flag conflicting advice for human review
-- Group by plan section
-
-### 7. Enhance Plan Sections
-
-
-Merge research findings back into the plan, adding depth without changing the original structure.
-
-
-**Enhancement format for each section:**
-
-```markdown
-## [Original Section Title]
-
-[Original content preserved]
-
-### Research Insights
-
-**Best Practices:**
-- [Concrete recommendation 1]
-- [Concrete recommendation 2]
-
-**Performance Considerations:**
-- [Optimization opportunity]
-- [Benchmark or metric to target]
-
-**Implementation Details:**
-```[language]
-// Concrete code example from research
-```
-
-**Edge Cases:**
-- [Edge case 1 and how to handle]
-- [Edge case 2 and how to handle]
-
-**References:**
-- [Documentation URL 1]
-- [Documentation URL 2]
-```
-
-### 8. Add Enhancement Summary
-
-At the top of the plan, add a summary section:
-
-```markdown
-## Enhancement Summary
-
-**Deepened on:** [Date]
-**Sections enhanced:** [Count]
-**Research agents used:** [List]
-
-### Key Improvements
-1. [Major improvement 1]
-2. [Major improvement 2]
-3. [Major improvement 3]
-
-### New Considerations Discovered
-- [Important finding 1]
-- [Important finding 2]
-```
-
-### 9. Update Plan File
-
-**Write the enhanced plan:**
-- Preserve original filename
-- Add `-deepened` suffix if user prefers a new file
-- Update any timestamps or metadata
-
-## Output Format
-
-Update the plan file in place (or if user requests a separate file, append `-deepened` after `-plan`, e.g., `2026-01-15-feat-auth-plan-deepened.md`).
-
-## Quality Checks
-
-Before finalizing:
-- [ ] All original content preserved
-- [ ] Research insights clearly marked and attributed
-- [ ] Code examples are syntactically correct
-- [ ] Links are valid and relevant
-- [ ] No contradictions between sections
-- [ ] Enhancement summary accurately reflects changes
+If the user explicitly requests a separate file, append `-deepened` before `.md`, for example:
+- `docs/plans/2026-03-15-001-feat-example-plan-deepened.md`
+
+If artifact-backed mode was used and the user did not ask to inspect the scratch files:
+- clean up the temporary scratch directory after the plan is safely written
+- if cleanup is not practical on the current platform, say where the artifacts were left and that they are temporary workflow output
## Post-Enhancement Options
-After writing the enhanced plan, use the **AskUserQuestion tool** to present these options:
+If substantive changes were made, present next steps using the platform's blocking question tool when available (see Interaction Method). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
**Question:** "Plan deepened at `[plan_path]`. What would you like to do next?"
**Options:**
-1. **View diff** - Show what was added/changed
-2. **Start `/ce:work`** - Begin implementing this enhanced plan
-3. **Deepen further** - Run another round of research on specific sections
-4. **Revert** - Restore original plan (if backup exists)
+1. **View diff** - Show what changed
+2. **Run `document-review` skill** - Improve the updated plan through structured document review
+3. **Start `ce:work` skill** - Begin implementing the plan
+4. **Deepen specific sections further** - Run another targeted deepening pass on named sections
Based on selection:
-- **View diff** → Run `git diff [plan_path]` or show before/after
-- **`/ce:work`** → Call the /ce:work command with the plan file path
-- **Deepen further** → Ask which sections need more research, then re-run those agents
-- **Revert** → Restore from git or backup
+- **View diff** -> Show the important additions and changed sections
+- **`document-review` skill** -> Load the `document-review` skill with the plan path
+- **Start `ce:work` skill** -> Call the `ce:work` skill with the plan path
+- **Deepen specific sections further** -> Ask which sections still feel weak and run another targeted pass only for those sections
-## Example Enhancement
+If no substantive changes were warranted:
+- Say that the plan already appears sufficiently grounded
+- Offer the `document-review` skill or `/ce:work` as the next step instead
-**Before (from /workflows:plan):**
-```markdown
-## Technical Approach
-
-Use React Query for data fetching with optimistic updates.
-```
-
-**After (from /workflows:deepen-plan):**
-```markdown
-## Technical Approach
-
-Use React Query for data fetching with optimistic updates.
-
-### Research Insights
-
-**Best Practices:**
-- Configure `staleTime` and `cacheTime` based on data freshness requirements
-- Use `queryKey` factories for consistent cache invalidation
-- Implement error boundaries around query-dependent components
-
-**Performance Considerations:**
-- Enable `refetchOnWindowFocus: false` for stable data to reduce unnecessary requests
-- Use `select` option to transform and memoize data at query level
-- Consider `placeholderData` for instant perceived loading
-
-**Implementation Details:**
-```typescript
-// Recommended query configuration
-const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- staleTime: 5 * 60 * 1000, // 5 minutes
- retry: 2,
- refetchOnWindowFocus: false,
- },
- },
-});
-```
-
-**Edge Cases:**
-- Handle race conditions with `cancelQueries` on component unmount
-- Implement retry logic for transient network failures
-- Consider offline support with `persistQueryClient`
-
-**References:**
-- https://tanstack.com/query/latest/docs/react/guides/optimistic-updates
-- https://tkdodo.eu/blog/practical-react-query
-```
-
-NEVER CODE! Just research and enhance the plan.
+NEVER CODE! Research, challenge, and strengthen the plan.
diff --git a/plugins/compound-engineering/skills/document-review/SKILL.md b/plugins/compound-engineering/skills/document-review/SKILL.md
index 3376c32..ca83d47 100644
--- a/plugins/compound-engineering/skills/document-review/SKILL.md
+++ b/plugins/compound-engineering/skills/document-review/SKILL.md
@@ -1,83 +1,191 @@
---
name: document-review
-description: This skill should be used to refine brainstorm or plan documents before proceeding to the next workflow step. It applies when a brainstorm or plan document exists and the user wants to improve it.
+description: Review requirements or plan documents using parallel persona agents that surface role-specific issues. Use when a requirements document or plan document exists and the user wants to improve it.
---
# Document Review
-Improve brainstorm or plan documents through structured review.
+Review requirements or plan documents through multi-persona analysis. Dispatches specialized reviewer agents in parallel, auto-fixes quality issues, and presents strategic questions for user decision.
-## Step 1: Get the Document
+## Phase 1: Get and Analyze Document
-**If a document path is provided:** Read it, then proceed to Step 2.
+**If a document path is provided:** Read it, then proceed.
-**If no document is specified:** Ask which document to review, or look for the most recent brainstorm/plan in `docs/brainstorms/` or `docs/plans/`.
+**If no document is specified:** Ask which document to review, or find the most recent in `docs/brainstorms/` or `docs/plans/` using a file-search/glob tool (e.g., Glob in Claude Code).
-## Step 2: Assess
+### Classify Document Type
-Read through the document and ask:
+After reading, classify the document:
+- **requirements** -- from `docs/brainstorms/`, focuses on what to build and why
+- **plan** -- from `docs/plans/`, focuses on how to build it with implementation details
-- What is unclear?
-- What is unnecessary?
-- What decision is being avoided?
-- What assumptions are unstated?
-- Where could scope accidentally expand?
+### Select Conditional Personas
-These questions surface issues. Don't fix yet—just note what you find.
+Analyze the document content to determine which conditional personas to activate. Check for these signals:
-## Step 3: Evaluate
+**product-lens** -- activate when the document contains:
+- User-facing features, user stories, or customer-focused language
+- Market claims, competitive positioning, or business justification
+- Scope decisions, prioritization language, or priority tiers with feature assignments
+- Requirements with user/customer/business outcome focus
-Score the document against these criteria:
+**design-lens** -- activate when the document contains:
+- UI/UX references, frontend components, or visual design language
+- User flows, wireframes, screen/page/view mentions
+- Interaction descriptions (forms, buttons, navigation, modals)
+- References to responsive behavior or accessibility
-| Criterion | What to Check |
-|-----------|---------------|
-| **Clarity** | Problem statement is clear, no vague language ("probably," "consider," "try to") |
-| **Completeness** | Required sections present, constraints stated, open questions flagged |
-| **Specificity** | Concrete enough for next step (brainstorm → can plan, plan → can implement) |
-| **YAGNI** | No hypothetical features, simplest approach chosen |
+**security-lens** -- activate when the document contains:
+- Auth/authorization mentions, login flows, session management
+- API endpoints exposed to external clients
+- Data handling, PII, payments, tokens, credentials, encryption
+- Third-party integrations with trust boundary implications
-If invoked within a workflow (after `/ce:brainstorm` or `/ce:plan`), also check:
-- **User intent fidelity** — Document reflects what was discussed, assumptions validated
+**scope-guardian** -- activate when the document contains:
+- Multiple priority tiers (P0/P1/P2, must-have/should-have/nice-to-have)
+- Large requirement count (>8 distinct requirements or implementation units)
+- Stretch goals, nice-to-haves, or "future work" sections
+- Scope boundary language that seems misaligned with stated goals
+- Goals that don't clearly connect to requirements
-## Step 4: Identify the Critical Improvement
+## Phase 2: Announce and Dispatch Personas
-Among everything found in Steps 2-3, does one issue stand out? If something would significantly improve the document's quality, this is the "must address" item. Highlight it prominently.
+### Announce the Review Team
-## Step 5: Make Changes
+Tell the user which personas will review and why. For conditional personas, include the justification:
-Present your findings, then:
+```
+Reviewing with:
+- coherence-reviewer (always-on)
+- feasibility-reviewer (always-on)
+- scope-guardian-reviewer -- plan has 12 requirements across 3 priority levels
+- security-lens-reviewer -- plan adds API endpoints with auth flow
+```
-1. **Auto-fix** minor issues (vague language, formatting) without asking
-2. **Ask approval** before substantive changes (restructuring, removing sections, changing meaning)
-3. **Update** the document inline—no separate files, no metadata sections
+### Build Agent List
-### Simplification Guidance
+Always include:
+- `compound-engineering:document-review:coherence-reviewer`
+- `compound-engineering:document-review:feasibility-reviewer`
-Simplification is purposeful removal of unnecessary complexity, not shortening for its own sake.
+Add activated conditional personas:
+- `compound-engineering:document-review:product-lens-reviewer`
+- `compound-engineering:document-review:design-lens-reviewer`
+- `compound-engineering:document-review:security-lens-reviewer`
+- `compound-engineering:document-review:scope-guardian-reviewer`
-**Simplify when:**
-- Content serves hypothetical future needs, not current ones
-- Sections repeat information already covered elsewhere
-- Detail exceeds what's needed to take the next step
-- Abstractions or structure add overhead without clarity
+### Dispatch
-**Don't simplify:**
-- Constraints or edge cases that affect implementation
-- Rationale that explains why alternatives were rejected
-- Open questions that need resolution
+Dispatch all agents in **parallel** using the platform's task/agent tool (e.g., Agent tool in Claude Code, spawn in Codex). Each agent receives the prompt built from the [subagent template](./references/subagent-template.md) with these variables filled:
-## Step 6: Offer Next Action
+| Variable | Value |
+|----------|-------|
+| `{persona_file}` | Full content of the agent's markdown file |
+| `{schema}` | Content of [findings-schema.json](./references/findings-schema.json) |
+| `{document_type}` | "requirements" or "plan" from Phase 1 classification |
+| `{document_path}` | Path to the document |
+| `{document_content}` | Full text of the document |
-After changes are complete, ask:
+Pass each agent the **full document** -- do not split into sections.
-1. **Refine again** - Another review pass
-2. **Review complete** - Document is ready
+**Error handling:** If an agent fails or times out, proceed with findings from agents that completed. Note the failed agent in the Coverage section. Do not block the entire review on a single agent failure.
-### Iteration Guidance
+**Dispatch limit:** Even at maximum (6 agents), use parallel dispatch. These are document reviewers with bounded scope reading a single document -- parallel is safe and fast.
-After 2 refinement passes, recommend completion—diminishing returns are likely. But if the user wants to continue, allow it.
+## Phase 3: Synthesize Findings
-Return control to the caller (workflow or user) after selection.
+Process findings from all agents through this pipeline. **Order matters** -- each step depends on the previous.
+
+### 3.1 Validate
+
+Check each agent's returned JSON against [findings-schema.json](./references/findings-schema.json):
+- Drop findings missing any required field defined in the schema
+- Drop findings with invalid enum values
+- Note the agent name for any malformed output in the Coverage section
+
+### 3.2 Confidence Gate
+
+Suppress findings below 0.50 confidence. Store them as residual concerns for potential promotion in step 3.4.
+
+### 3.3 Deduplicate
+
+Fingerprint each finding using `normalize(section) + normalize(title)`. Normalization: lowercase, strip punctuation, collapse whitespace.
+
+When fingerprints match across personas:
+- If the findings recommend **opposing actions** (e.g., one says cut, the other says keep), do not merge -- preserve both for contradiction resolution in 3.5
+- Otherwise merge: keep the highest severity, keep the highest confidence, union all evidence arrays, note all agreeing reviewers (e.g., "coherence, feasibility")
+
+### 3.4 Promote Residual Concerns
+
+Scan the residual concerns (findings suppressed in 3.2) for:
+- **Cross-persona corroboration**: A residual concern from Persona A overlaps with an above-threshold finding from Persona B. Promote at P2 with confidence 0.55-0.65.
+- **Concrete blocking risks**: A residual concern describes a specific, concrete risk that would block implementation. Promote at P2 with confidence 0.55.
+
+### 3.5 Resolve Contradictions
+
+When personas disagree on the same section:
+- Create a **combined finding** presenting both perspectives
+- Set `autofix_class: present`
+- Frame as a tradeoff, not a verdict
+
+Specific conflict patterns:
+- Coherence says "keep for consistency" + scope-guardian says "cut for simplicity" -> combined finding, let user decide
+- Feasibility says "this is impossible" + product-lens says "this is essential" -> P1 finding framed as a tradeoff
+- Multiple personas flag the same issue -> merge into single finding, note consensus, increase confidence
+
+### 3.6 Route by Autofix Class
+
+| Autofix Class | Route |
+|---------------|-------|
+| `auto` | Apply automatically -- local deterministic fix (terminology, formatting, cross-references) |
+| `present` | Present to user for judgment |
+
+Demote any `auto` finding that lacks a `suggested_fix` to `present` -- the orchestrator cannot apply a fix without concrete replacement text.
+
+### 3.7 Sort
+
+Sort findings for presentation: P0 -> P1 -> P2 -> P3, then by confidence (descending), then by document order (section position).
+
+## Phase 4: Apply and Present
+
+### Apply Auto-fixes
+
+Apply all `auto` findings to the document in a **single pass**:
+- Edit the document inline using the platform's edit tool
+- Track what was changed for the "Auto-fixes Applied" section
+- Do not ask for approval -- these are unambiguously correct (terminology fixes, formatting, cross-references)
+
+### Present Remaining Findings
+
+Present all other findings to the user using the format from [review-output-template.md](./references/review-output-template.md):
+- Group by severity (P0 -> P3)
+- Include the Coverage table showing which personas ran
+- Show auto-fixes that were applied
+- Include residual concerns and deferred questions if any
+
+Brief summary at the top: "Applied N auto-fixes. M findings to consider (X at P0/P1)."
+
+### Protected Artifacts
+
+During synthesis, discard any finding that recommends deleting or removing files in:
+- `docs/brainstorms/`
+- `docs/plans/`
+- `docs/solutions/`
+
+These are pipeline artifacts and must not be flagged for removal.
+
+## Phase 5: Next Action
+
+Use the platform's blocking question tool when available (AskUserQuestion in Claude Code, request_user_input in Codex, ask_user in Gemini). Otherwise present numbered options and wait for the user's reply.
+
+Offer:
+
+1. **Refine again** -- another review pass
+2. **Review complete** -- document is ready
+
+After 2 refinement passes, recommend completion -- diminishing returns are likely. But if the user wants to continue, allow it.
+
+Return "Review complete" as the terminal signal for callers.
## What NOT to Do
@@ -85,3 +193,8 @@ Return control to the caller (workflow or user) after selection.
- Do not add new sections or requirements the user didn't discuss
- Do not over-engineer or add complexity
- Do not create separate review files or add metadata sections
+- Do not modify any of the 4 caller skills (ce-brainstorm, ce-plan, ce-plan-beta, deepen-plan-beta)
+
+## Iteration Guidance
+
+On subsequent passes, re-dispatch personas and re-synthesize. The auto-fix mechanism and confidence gating prevent the same findings from recurring once fixed. If findings are repetitive across passes, recommend completion.
diff --git a/plugins/compound-engineering/skills/document-review/references/findings-schema.json b/plugins/compound-engineering/skills/document-review/references/findings-schema.json
new file mode 100644
index 0000000..cb9a629
--- /dev/null
+++ b/plugins/compound-engineering/skills/document-review/references/findings-schema.json
@@ -0,0 +1,98 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "Document Review Findings",
+ "description": "Structured output schema for document review persona agents",
+ "type": "object",
+ "required": ["reviewer", "findings", "residual_risks", "deferred_questions"],
+ "properties": {
+ "reviewer": {
+ "type": "string",
+ "description": "Persona name that produced this output (e.g., 'coherence', 'feasibility', 'product-lens')"
+ },
+ "findings": {
+ "type": "array",
+ "description": "List of document review findings. Empty array if no issues found.",
+ "items": {
+ "type": "object",
+ "required": [
+ "title",
+ "severity",
+ "section",
+ "why_it_matters",
+ "autofix_class",
+ "confidence",
+ "evidence"
+ ],
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "Short, specific issue title. 10 words or fewer.",
+ "maxLength": 100
+ },
+ "severity": {
+ "type": "string",
+ "enum": ["P0", "P1", "P2", "P3"],
+ "description": "Issue severity level"
+ },
+ "section": {
+ "type": "string",
+ "description": "Document section where the issue appears (e.g., 'Requirements Trace', 'Implementation Unit 3', 'Overview')"
+ },
+ "why_it_matters": {
+ "type": "string",
+ "description": "Impact statement -- not 'what is wrong' but 'what goes wrong if not addressed'"
+ },
+ "autofix_class": {
+ "type": "string",
+ "enum": ["auto", "present"],
+ "description": "How this issue should be handled. auto = local deterministic fix the orchestrator can apply without asking (terminology, formatting, cross-references). present = requires user judgment."
+ },
+ "suggested_fix": {
+ "type": ["string", "null"],
+ "description": "Concrete fix text. Omit or null if no good fix is obvious -- a bad suggestion is worse than none."
+ },
+ "confidence": {
+ "type": "number",
+ "description": "Reviewer confidence in this finding, calibrated per persona",
+ "minimum": 0.0,
+ "maximum": 1.0
+ },
+ "evidence": {
+ "type": "array",
+ "description": "Quoted text from the document that supports this finding. At least 1 item.",
+ "items": { "type": "string" },
+ "minItems": 1
+ }
+ }
+ }
+ },
+ "residual_risks": {
+ "type": "array",
+ "description": "Risks the reviewer noticed but could not confirm as findings (below confidence threshold)",
+ "items": { "type": "string" }
+ },
+ "deferred_questions": {
+ "type": "array",
+ "description": "Questions that should be resolved in a later workflow stage (planning, implementation)",
+ "items": { "type": "string" }
+ }
+ },
+
+ "_meta": {
+ "confidence_thresholds": {
+ "suppress": "Below 0.50 -- do not report. Finding is speculative noise.",
+ "flag": "0.50-0.69 -- include only when the persona's calibration says the issue is actionable at that confidence.",
+ "report": "0.70+ -- report with full confidence."
+ },
+ "severity_definitions": {
+ "P0": "Contradictions or gaps that would cause building the wrong thing. Must fix before proceeding.",
+ "P1": "Significant gap likely hit during planning or implementation. Should fix.",
+ "P2": "Moderate issue with meaningful downside. Fix if straightforward.",
+ "P3": "Minor improvement. User's discretion."
+ },
+ "autofix_classes": {
+ "auto": "Local, deterministic document fix: terminology consistency, formatting, cross-reference correction. Must be unambiguous and not change the document's meaning.",
+ "present": "Requires user judgment -- strategic questions, tradeoffs, meaning-changing fixes, or informational findings."
+ }
+ }
+}
diff --git a/plugins/compound-engineering/skills/document-review/references/review-output-template.md b/plugins/compound-engineering/skills/document-review/references/review-output-template.md
new file mode 100644
index 0000000..21b03f8
--- /dev/null
+++ b/plugins/compound-engineering/skills/document-review/references/review-output-template.md
@@ -0,0 +1,78 @@
+# Document Review Output Template
+
+Use this **exact format** when presenting synthesized review findings. Findings are grouped by severity, not by reviewer.
+
+**IMPORTANT:** Use pipe-delimited markdown tables (`| col | col |`). Do NOT use ASCII box-drawing characters.
+
+## Example
+
+```markdown
+## Document Review Results
+
+**Document:** docs/plans/2026-03-15-feat-user-auth-plan.md
+**Type:** plan
+**Reviewers:** coherence, feasibility, security-lens, scope-guardian
+- security-lens -- plan adds public API endpoint with auth flow
+- scope-guardian -- plan has 15 requirements across 3 priority levels
+
+### Auto-fixes Applied
+
+- Standardized "pipeline"/"workflow" terminology to "pipeline" throughout (coherence, auto)
+- Fixed cross-reference: Section 4 referenced "Section 3.2" which is actually "Section 3.1" (coherence, auto)
+
+### P0 -- Must Fix
+
+| # | Section | Issue | Reviewer | Confidence | Route |
+|---|---------|-------|----------|------------|-------|
+| 1 | Requirements Trace | Goal states "offline support" but technical approach assumes persistent connectivity | coherence | 0.92 | `present` |
+
+### P1 -- Should Fix
+
+| # | Section | Issue | Reviewer | Confidence | Route |
+|---|---------|-------|----------|------------|-------|
+| 2 | Implementation Unit 3 | Plan proposes custom auth when codebase already uses Devise | feasibility | 0.85 | `present` |
+| 3 | Scope Boundaries | 8 of 12 units build admin infrastructure; only 2 touch stated goal | scope-guardian | 0.80 | `present` |
+
+### P2 -- Consider Fixing
+
+| # | Section | Issue | Reviewer | Confidence | Route |
+|---|---------|-------|----------|------------|-------|
+| 4 | API Design | Public webhook endpoint has no rate limiting mentioned | security-lens | 0.75 | `present` |
+
+### P3 -- Minor
+
+| # | Section | Issue | Reviewer | Confidence | Route |
+|---|---------|-------|----------|------------|-------|
+| 5 | Overview | "Service" used to mean both microservice and business class | coherence | 0.65 | `auto` |
+
+### Residual Concerns
+
+| # | Concern | Source |
+|---|---------|--------|
+| 1 | Migration rollback strategy not addressed for Phase 2 data changes | feasibility |
+
+### Deferred Questions
+
+| # | Question | Source |
+|---|---------|--------|
+| 1 | Should the API use versioned endpoints from launch? | feasibility, security-lens |
+
+### Coverage
+
+| Persona | Status | Findings | Residual |
+|---------|--------|----------|----------|
+| coherence | completed | 2 | 0 |
+| feasibility | completed | 1 | 1 |
+| security-lens | completed | 1 | 0 |
+| scope-guardian | completed | 1 | 0 |
+| product-lens | not activated | -- | -- |
+| design-lens | not activated | -- | -- |
+```
+
+## Section Rules
+
+- **Auto-fixes Applied**: List fixes that were applied automatically (auto class). Omit section if none.
+- **P0-P3 sections**: Only include sections that have findings. Omit empty severity levels.
+- **Residual Concerns**: Findings below confidence threshold that were promoted by cross-persona corroboration, plus unpromoted residual risks. Omit if none.
+- **Deferred Questions**: Questions for later workflow stages. Omit if none.
+- **Coverage**: Always include. Shows which personas ran and their output counts.
diff --git a/plugins/compound-engineering/skills/document-review/references/subagent-template.md b/plugins/compound-engineering/skills/document-review/references/subagent-template.md
new file mode 100644
index 0000000..f21e0f1
--- /dev/null
+++ b/plugins/compound-engineering/skills/document-review/references/subagent-template.md
@@ -0,0 +1,50 @@
+# Document Review Sub-agent Prompt Template
+
+This template is used by the document-review orchestrator to spawn each reviewer sub-agent. Variable substitution slots are filled at dispatch time.
+
+---
+
+## Template
+
+```
+You are a specialist document reviewer.
+
+
+{persona_file}
+
+
+
+Return ONLY valid JSON matching the findings schema below. No prose, no markdown, no explanation outside the JSON object.
+
+{schema}
+
+Rules:
+- Suppress any finding below your stated confidence floor (see your Confidence calibration section).
+- Every finding MUST include at least one evidence item -- a direct quote from the document.
+- You are operationally read-only. Analyze the document and produce findings. Do not edit the document, create files, or make changes. You may use non-mutating tools (file reads, glob, grep, git log) to gather context about the codebase when evaluating feasibility or existing patterns.
+- Set `autofix_class` conservatively:
+ - `auto`: Only for local, deterministic fixes -- terminology corrections, formatting fixes, cross-reference repairs. The fix must be unambiguous and not change the document's meaning.
+ - `present`: Everything else -- strategic questions, tradeoffs, meaning-changing fixes, informational findings.
+- `suggested_fix` is optional. Only include it when the fix is obvious and correct. For `present` findings, frame as a question instead.
+- If you find no issues, return an empty findings array. Still populate residual_risks and deferred_questions if applicable.
+- Use your suppress conditions. Do not flag issues that belong to other personas.
+
+
+
+Document type: {document_type}
+Document path: {document_path}
+
+Document content:
+{document_content}
+
+```
+
+## Variable Reference
+
+| Variable | Source | Description |
+|----------|--------|-------------|
+| `{persona_file}` | Agent markdown file content | The full persona definition (identity, analysis protocol, calibration, suppress conditions) |
+| `{schema}` | `references/findings-schema.json` content | The JSON schema reviewers must conform to |
+| `{document_type}` | Orchestrator classification | Either "requirements" or "plan" |
+| `{document_path}` | Skill input | Path to the document being reviewed |
+| `{document_content}` | File read | The full document text |
diff --git a/plugins/compound-engineering/skills/feature-video/SKILL.md b/plugins/compound-engineering/skills/feature-video/SKILL.md
index 55658dd..348081c 100644
--- a/plugins/compound-engineering/skills/feature-video/SKILL.md
+++ b/plugins/compound-engineering/skills/feature-video/SKILL.md
@@ -1,96 +1,111 @@
---
name: feature-video
-description: Record a video walkthrough of a feature and add it to the PR description
-argument-hint: "[PR number or 'current'] [optional: base URL, default localhost:3000]"
+description: Record a video walkthrough of a feature and add it to the PR description. Use when a PR needs a visual demo for reviewers, when the user asks to demo a feature, create a PR video, record a walkthrough, show what changed visually, or add a video to a pull request.
+argument-hint: "[PR number or 'current' or path/to/video.mp4] [optional: base URL, default localhost:3000]"
---
# Feature Video Walkthrough
-Record a video walkthrough demonstrating a feature, upload it, and add it to the PR description.
-
-## Introduction
-
-Developer Relations Engineer creating feature demo videos
-
-This command creates professional video walkthroughs of features for PR documentation:
-- Records browser interactions using agent-browser CLI
-- Demonstrates the complete user flow
-- Uploads the video for easy sharing
-- Updates the PR description with an embedded video
+Record browser interactions demonstrating a feature, stitch screenshots into an MP4 video, upload natively to GitHub, and embed in the PR description as an inline video player.
## Prerequisites
-
-- Local development server running (e.g., `bin/dev`, `rails server`)
-- agent-browser CLI installed
-- Git repository with a PR to document
+- Local development server running (e.g., `bin/dev`, `npm run dev`, `rails server`)
+- `agent-browser` CLI installed (load the `agent-browser` skill for details)
- `ffmpeg` installed (for video conversion)
-- `rclone` configured (optional, for cloud upload - see rclone skill)
-- Public R2 base URL known (for example, `https://.r2.dev`)
-
-
-## Setup
-
-**Check installation:**
-```bash
-command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"
-```
-
-**Install if needed:**
-```bash
-npm install -g agent-browser && agent-browser install
-```
-
-See the `agent-browser` skill for detailed usage.
+- `gh` CLI authenticated with push access to the repo
+- Git repository on a feature branch (PR optional -- skill can create a draft or record-only)
+- One-time GitHub browser auth (see Step 6 auth check)
## Main Tasks
-### 1. Parse Arguments
-
-
+### 1. Parse Arguments & Resolve PR
**Arguments:** $ARGUMENTS
Parse the input:
-- First argument: PR number or "current" (defaults to current branch's PR)
+- First argument: PR number, "current" (defaults to current branch's PR), or path to an existing `.mp4` file (upload-only resume mode)
- Second argument: Base URL (defaults to `http://localhost:3000`)
+**Upload-only resume:** If the first argument ends in `.mp4` and the file exists, skip Steps 2-5 and proceed directly to Step 6 using that file. Resolve the PR number from the current branch (`gh pr view --json number -q '.number'`).
+
+If an explicit PR number was provided, verify it exists and use it directly:
+
+```bash
+gh pr view [number] --json number -q '.number'
+```
+
+If no explicit PR number was provided (or "current" was specified), check if a PR exists for the current branch:
+
```bash
-# Get PR number for current branch if needed
gh pr view --json number -q '.number'
```
-
+If no PR exists for the current branch, ask the user how to proceed. **Use the platform's blocking question tool** (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini):
+
+```
+No PR found for the current branch.
+
+1. Create a draft PR now and continue (recommended)
+2. Record video only -- save locally and upload later when a PR exists
+3. Cancel
+```
+
+If option 1: create a draft PR with a placeholder title derived from the branch name, then continue with the new PR number:
+
+```bash
+gh pr create --draft --title "[branch-name-humanized]" --body "Draft PR for video walkthrough"
+```
+
+If option 2: set `RECORD_ONLY=true`. Proceed through Steps 2-5 (record and encode), skip Steps 6-7 (upload and PR update), and report the local video path and `[RUN_ID]` at the end.
+
+**Upload-only resume:** To upload a previously recorded video, pass an existing video file path as the first argument (e.g., `/feature-video .context/compound-engineering/feature-video/1711234567/videos/feature-demo.mp4`). When the first argument is a path to an `.mp4` file, skip Steps 2-5 and proceed directly to Step 6 using that file for upload.
+
+### 1b. Verify Required Tools
+
+Before proceeding, check that required CLI tools are installed. Fail early with a clear message rather than failing mid-workflow after screenshots have been recorded:
+
+```bash
+command -v ffmpeg
+```
+
+```bash
+command -v agent-browser
+```
+
+```bash
+command -v gh
+```
+
+If any tool is missing, stop and report which tools need to be installed:
+- `ffmpeg`: `brew install ffmpeg` (macOS) or equivalent
+- `agent-browser`: load the `agent-browser` skill for installation instructions
+- `gh`: `brew install gh` (macOS) or see https://cli.github.com
+
+Do not proceed to Step 2 until all tools are available.
### 2. Gather Feature Context
-
+**If a PR is available**, get PR details and changed files:
-**Get PR details:**
```bash
gh pr view [number] --json title,body,files,headRefName -q '.'
```
-**Get changed files:**
```bash
gh pr view [number] --json files -q '.files[].path'
```
-**Map files to testable routes** (same as playwright-test):
+**If in record-only mode (no PR)**, detect the default branch and derive context from the branch diff. Run both commands in a single block so the variable persists:
-| File Pattern | Route(s) |
-|-------------|----------|
-| `app/views/users/*` | `/users`, `/users/:id`, `/users/new` |
-| `app/controllers/settings_controller.rb` | `/settings` |
-| `app/javascript/controllers/*_controller.js` | Pages using that Stimulus controller |
-| `app/components/*_component.rb` | Pages rendering that component |
+```bash
+DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef -q '.defaultBranchRef.name') && git diff --name-only "$DEFAULT_BRANCH"...HEAD && git log --oneline "$DEFAULT_BRANCH"...HEAD
+```
-
+Map changed files to routes/pages that should be demonstrated. Examine the project's routing configuration (e.g., `routes.rb`, `next.config.js`, `app/` directory structure) to determine which URLs correspond to the changed files.
### 3. Plan the Video Flow
-
-
Before recording, create a shot list:
1. **Opening shot**: Homepage or starting point (2-3 seconds)
@@ -99,12 +114,12 @@ Before recording, create a shot list:
4. **Edge cases**: Error states, validation, etc. (if applicable)
5. **Success state**: Completed action/result
-Ask user to confirm or adjust the flow:
+Present the proposed flow to the user for confirmation before recording.
-```markdown
-**Proposed Video Flow**
+**Use the platform's blocking question tool when available** (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options and wait for the user's reply before proceeding:
-Based on PR #[number]: [title]
+```
+Proposed Video Flow for PR #[number]: [title]
1. Start at: /[starting-route]
2. Navigate to: /[feature-route]
@@ -116,218 +131,221 @@ Based on PR #[number]: [title]
Estimated duration: ~[X] seconds
-Does this look right?
-1. Yes, start recording
+1. Start recording
2. Modify the flow (describe changes)
3. Add specific interactions to demonstrate
```
-
+### 4. Record the Walkthrough
-### 4. Setup Video Recording
+Generate a unique run ID (e.g., timestamp) and create per-run output directories. This prevents stale screenshots from prior runs being spliced into the new video.
-
-
-**Create videos directory:**
-```bash
-mkdir -p tmp/videos
-```
-
-**Recording approach: Use browser screenshots as frames**
-
-agent-browser captures screenshots at key moments, then combine into video using ffmpeg:
+**Important:** Shell variables do not persist across separate code blocks. After generating the run ID, substitute the concrete value into all subsequent commands in this workflow. For example, if the timestamp is `1711234567`, use that literal value in all paths below -- do not rely on `[RUN_ID]` expanding in later blocks.
```bash
-ffmpeg -framerate 2 -pattern_type glob -i 'tmp/screenshots/*.png' -vf "scale=1280:-1" tmp/videos/feature-demo.gif
+date +%s
```
-
+Use the output as RUN_ID. Create the directories with the concrete value:
-### 5. Record the Walkthrough
+```bash
+mkdir -p .context/compound-engineering/feature-video/[RUN_ID]/screenshots
+mkdir -p .context/compound-engineering/feature-video/[RUN_ID]/videos
+```
-
+Execute the planned flow, capturing each step with agent-browser. Number screenshots sequentially for correct frame ordering:
-Execute the planned flow, capturing each step:
-
-**Step 1: Navigate to starting point**
```bash
agent-browser open "[base-url]/[start-route]"
agent-browser wait 2000
-agent-browser screenshot tmp/screenshots/01-start.png
+agent-browser screenshot .context/compound-engineering/feature-video/[RUN_ID]/screenshots/01-start.png
```
-**Step 2: Perform navigation/interactions**
```bash
-agent-browser snapshot -i # Get refs
-agent-browser click @e1 # Click navigation element
+agent-browser snapshot -i
+agent-browser click @e1
agent-browser wait 1000
-agent-browser screenshot tmp/screenshots/02-navigate.png
+agent-browser screenshot .context/compound-engineering/feature-video/[RUN_ID]/screenshots/02-navigate.png
```
-**Step 3: Demonstrate feature**
```bash
-agent-browser snapshot -i # Get refs for feature elements
-agent-browser click @e2 # Click feature element
+agent-browser snapshot -i
+agent-browser click @e2
agent-browser wait 1000
-agent-browser screenshot tmp/screenshots/03-feature.png
+agent-browser screenshot .context/compound-engineering/feature-video/[RUN_ID]/screenshots/03-feature.png
```
-**Step 4: Capture result**
```bash
agent-browser wait 2000
-agent-browser screenshot tmp/screenshots/04-result.png
+agent-browser screenshot .context/compound-engineering/feature-video/[RUN_ID]/screenshots/04-result.png
```
-**Create video/GIF from screenshots:**
+### 5. Create Video
+
+Stitch screenshots into an MP4 using the same `[RUN_ID]` from Step 4:
```bash
-# Create directories
-mkdir -p tmp/videos tmp/screenshots
-
-# Create MP4 video (RECOMMENDED - better quality, smaller size)
-# -framerate 0.5 = 2 seconds per frame (slower playback)
-# -framerate 1 = 1 second per frame
-ffmpeg -y -framerate 0.5 -pattern_type glob -i 'tmp/screenshots/*.png' \
+ffmpeg -y -framerate 0.5 -pattern_type glob -i ".context/compound-engineering/feature-video/[RUN_ID]/screenshots/*.png" \
-c:v libx264 -pix_fmt yuv420p -vf "scale=1280:-2" \
- tmp/videos/feature-demo.mp4
-
-# Create low-quality GIF for preview (small file, for GitHub embed)
-ffmpeg -y -framerate 0.5 -pattern_type glob -i 'tmp/screenshots/*.png' \
- -vf "scale=640:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse" \
- -loop 0 tmp/videos/feature-demo-preview.gif
+ ".context/compound-engineering/feature-video/[RUN_ID]/videos/feature-demo.mp4"
```
-**Note:**
-- The `-2` in MP4 scale ensures height is divisible by 2 (required for H.264)
-- Preview GIF uses 640px width and 128 colors to keep file size small (~100-200KB)
+Notes:
+- `-framerate 0.5` = 2 seconds per frame. Adjust for faster/slower playback.
+- `-2` in scale ensures height is divisible by 2 (required for H.264).
-
+### 6. Authenticate & Upload to GitHub
-### 6. Upload the Video
+Upload produces a `user-attachments/assets/` URL that GitHub renders as a native inline video player -- the same result as pasting a video into the PR editor manually.
-
+The approach: close any existing agent-browser session, start a Chrome-engine session with saved GitHub auth, navigate to the PR page, set the video file on the comment form's hidden file input, wait for GitHub to process the upload, extract the resulting URL, then clear the textarea without submitting.
-**Upload with rclone:**
+#### Check for existing session
+
+First, check if a saved GitHub session already exists:
```bash
-# Check rclone is configured
-rclone listremotes
-
-# Set your public base URL (NO trailing slash)
-PUBLIC_BASE_URL="https://.r2.dev"
-
-# Upload video, preview GIF, and screenshots to cloud storage
-# Use --s3-no-check-bucket to avoid permission errors
-rclone copy tmp/videos/ r2:kieran-claude/pr-videos/pr-[number]/ --s3-no-check-bucket --progress
-rclone copy tmp/screenshots/ r2:kieran-claude/pr-videos/pr-[number]/screenshots/ --s3-no-check-bucket --progress
-
-# List uploaded files
-rclone ls r2:kieran-claude/pr-videos/pr-[number]/
-
-# Build and validate public URLs BEFORE updating PR
-VIDEO_URL="$PUBLIC_BASE_URL/pr-videos/pr-[number]/feature-demo.mp4"
-PREVIEW_URL="$PUBLIC_BASE_URL/pr-videos/pr-[number]/feature-demo-preview.gif"
-
-curl -I "$VIDEO_URL"
-curl -I "$PREVIEW_URL"
-
-# Require HTTP 200 for both URLs; stop if either fails
-curl -I "$VIDEO_URL" | head -n 1 | grep -q ' 200 ' || exit 1
-curl -I "$PREVIEW_URL" | head -n 1 | grep -q ' 200 ' || exit 1
+agent-browser close
+agent-browser --engine chrome --session-name github open https://github.com/settings/profile
+agent-browser get title
```
-
+If the page title contains the user's GitHub username or "Profile", the session is still valid -- skip to "Upload the video" below. If it redirects to the login page, the session has expired or was never created -- proceed to "Auth setup".
+
+#### Auth setup (one-time)
+
+Establish an authenticated GitHub session. This only needs to happen once -- session cookies persist across runs via the `--session-name` flag.
+
+Close the current session and open the GitHub login page in a headed Chrome window:
+
+```bash
+agent-browser close
+agent-browser --engine chrome --headed --session-name github open https://github.com/login
+```
+
+The user must log in manually in the browser window (handles 2FA, SSO, OAuth -- any login method). **Use the platform's blocking question tool** (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present the message and wait for the user's reply before proceeding:
+
+```
+GitHub login required for video upload.
+
+A Chrome window has opened to github.com/login. Please log in manually
+(this handles 2FA/SSO/OAuth automatically). Reply when done.
+```
+
+After login, verify the session works:
+
+```bash
+agent-browser open https://github.com/settings/profile
+```
+
+If the profile page loads, auth is confirmed. The `github` session is now saved and reusable.
+
+#### Upload the video
+
+Navigate to the PR page and scroll to the comment form:
+
+```bash
+agent-browser open "https://github.com/[owner]/[repo]/pull/[number]"
+agent-browser scroll down 5000
+```
+
+Save any existing textarea content before uploading (the comment box may contain an unsent draft):
+
+```bash
+agent-browser eval "document.getElementById('new_comment_field').value"
+```
+
+Store this value as `SAVED_TEXTAREA`. If non-empty, it will be restored after extracting the upload URL.
+
+Upload the video via the hidden file input. Use the caller-provided `.mp4` path if in upload-only resume mode, otherwise use the current run's encoded video:
+
+```bash
+agent-browser upload '#fc-new_comment_field' [VIDEO_FILE_PATH]
+```
+
+Where `[VIDEO_FILE_PATH]` is either:
+- The `.mp4` path passed as the first argument (upload-only resume mode)
+- `.context/compound-engineering/feature-video/[RUN_ID]/videos/feature-demo.mp4` (normal recording flow)
+
+Wait for GitHub to process the upload (typically 3-5 seconds), then read the textarea value:
+
+```bash
+agent-browser wait 5000
+agent-browser eval "document.getElementById('new_comment_field').value"
+```
+
+**Validate the extracted URL.** The value must contain `user-attachments/assets/` to confirm a successful native upload. If the textarea is empty, contains only placeholder text, or the URL does not match, do not proceed to Step 7. Instead:
+
+1. Check `agent-browser get url` -- if it shows `github.com/login`, the session expired. Re-run auth setup.
+2. If still on the PR page, wait an additional 5 seconds and re-read the textarea (GitHub processing can be slow).
+3. If validation still fails after retry, report the failure and the local video path so the user can upload manually.
+
+Restore the original textarea content (or clear if it was empty). A JSON-encoded string is also a valid JavaScript string literal, so assign it directly without `JSON.parse`:
+
+```bash
+agent-browser eval "const ta = document.getElementById('new_comment_field'); ta.value = [SAVED_TEXTAREA_AS_JS_STRING]; ta.dispatchEvent(new Event('input', { bubbles: true }))"
+```
+
+To prepare the value: take the SAVED_TEXTAREA string and produce a JS string literal from it -- escape backslashes, double quotes, and newlines (e.g., `"text with \"quotes\" and\nnewlines"`). If SAVED_TEXTAREA was empty, use `""`. The result is embedded directly as the right-hand side of the assignment -- no `JSON.parse` call needed.
### 7. Update PR Description
-
+Get the current PR body:
-**Get current PR body:**
```bash
gh pr view [number] --json body -q '.body'
```
-**Add video section to PR description:**
-
-If the PR already has a video section, replace it. Otherwise, append:
-
-**IMPORTANT:** GitHub cannot embed external MP4s directly. Use a clickable GIF that links to the video:
+Append a Demo section (or replace an existing one). The video URL renders as an inline player when placed on its own line:
```markdown
## Demo
-[]([video-mp4-url])
+https://github.com/user-attachments/assets/[uuid]
-*Click to view full video*
+*Automated video walkthrough*
```
-Example:
-```markdown
-[](https://.r2.dev/pr-videos/pr-137/feature-demo.mp4)
-```
+Update the PR:
-**Update the PR:**
```bash
-gh pr edit [number] --body "[updated body with video section]"
+gh pr edit [number] --body "[updated body with demo section]"
```
-**Or add as a comment if preferred:**
-```bash
-gh pr comment [number] --body "## Feature Demo
-
-
-
-_Automated walkthrough of the changes in this PR_"
-```
-
-
-
### 8. Cleanup
-
+Ask the user before removing temporary files. If confirmed, clean up only the current run's scratch directory (other runs may still be in progress or awaiting upload).
+
+**If the video was successfully uploaded**, remove the entire run directory:
```bash
-# Optional: Clean up screenshots
-rm -rf tmp/screenshots
-
-# Keep videos for reference
-echo "Video retained at: tmp/videos/feature-demo.gif"
+rm -r .context/compound-engineering/feature-video/[RUN_ID]
```
-
+**If in record-only mode or upload failed**, remove only the screenshots but preserve the video so the user can upload later:
-### 9. Summary
-
-
-
-Present completion summary:
-
-```markdown
-## Feature Video Complete
-
-**PR:** #[number] - [title]
-**Video:** [url or local path]
-**Duration:** ~[X] seconds
-**Format:** [GIF/MP4]
-
-### Shots Captured
-1. [Starting point] - [description]
-2. [Navigation] - [description]
-3. [Feature demo] - [description]
-4. [Result] - [description]
-
-### PR Updated
-- [x] Video section added to PR description
-- [ ] Ready for review
-
-**Next steps:**
-- Review the video to ensure it accurately demonstrates the feature
-- Share with reviewers for context
+```bash
+rm -r .context/compound-engineering/feature-video/[RUN_ID]/screenshots
```
-
+Present a completion summary:
-## Quick Usage Examples
+```
+Feature Video Complete
+
+PR: #[number] - [title]
+Video: [VIDEO_URL]
+
+Shots captured:
+1. [description]
+2. [description]
+3. [description]
+4. [description]
+
+PR description updated with demo section.
+```
+
+## Usage Examples
```bash
# Record video for current branch's PR
@@ -345,7 +363,20 @@ Present completion summary:
## Tips
-- **Keep it short**: 10-30 seconds is ideal for PR demos
-- **Focus on the change**: Don't include unrelated UI
-- **Show before/after**: If fixing a bug, show the broken state first (if possible)
-- **Annotate if needed**: Add text overlays for complex features
+- Keep it short: 10-30 seconds is ideal for PR demos
+- Focus on the change: don't include unrelated UI
+- Show before/after: if fixing a bug, show the broken state first (if possible)
+- The `--session-name github` session expires when GitHub invalidates the cookies (typically weeks). If upload fails with a login redirect, re-run the auth setup.
+- GitHub DOM selectors (`#fc-new_comment_field`, `#new_comment_field`) may change if GitHub updates its UI. If the upload silently fails, inspect the PR page for updated selectors.
+
+## Troubleshooting
+
+| Symptom | Cause | Fix |
+|---|---|---|
+| `ffmpeg: command not found` | ffmpeg not installed | Install via `brew install ffmpeg` (macOS) or equivalent |
+| `agent-browser: command not found` | agent-browser not installed | Load the `agent-browser` skill for installation instructions |
+| Textarea empty after upload wait | Session expired, or GitHub processing slow | Check session validity (Step 6 auth check). If valid, increase wait time and retry. |
+| Textarea empty, URL is `github.com/login` | Session expired | Re-run auth setup (Step 6) |
+| `gh pr view` fails | No PR for current branch | Step 1 handles this -- choose to create a draft PR or record-only mode |
+| Video file too large for upload | Exceeds GitHub's 10MB (free) or 100MB (paid) limit | Re-encode: lower framerate (`-framerate 0.33`), reduce resolution (`scale=960:-2`), or increase CRF (`-crf 28`) |
+| Upload URL does not contain `user-attachments/assets/` | Wrong upload method or GitHub change | Verify the file input selector is still correct by inspecting the PR page |
diff --git a/plugins/compound-engineering/skills/file-todos/SKILL.md b/plugins/compound-engineering/skills/file-todos/SKILL.md
deleted file mode 100644
index 2757631..0000000
--- a/plugins/compound-engineering/skills/file-todos/SKILL.md
+++ /dev/null
@@ -1,259 +0,0 @@
----
-name: file-todos
-description: This skill should be used when managing the file-based todo tracking system in the todos/ directory. It provides workflows for creating todos, managing status and dependencies, conducting triage, and integrating with slash commands and code review processes.
-disable-model-invocation: true
----
-
-# File-Based Todo Tracking Skill
-
-## Overview
-
-The `todos/` directory contains a file-based tracking system for managing code review feedback, technical debt, feature requests, and work items. Each todo is a markdown file with YAML frontmatter and structured sections.
-
-This skill should be used when:
-- Creating new todos from findings or feedback
-- Managing todo lifecycle (pending → ready → complete)
-- Triaging pending items for approval
-- Checking or managing dependencies
-- Converting PR comments or code findings into tracked work
-- Updating work logs during todo execution
-
-## File Naming Convention
-
-Todo files follow this naming pattern:
-
-```
-{issue_id}-{status}-{priority}-{description}.md
-```
-
-**Components:**
-- **issue_id**: Sequential number (001, 002, 003...) - never reused
-- **status**: `pending` (needs triage), `ready` (approved), `complete` (done)
-- **priority**: `p1` (critical), `p2` (important), `p3` (nice-to-have)
-- **description**: kebab-case, brief description
-
-**Examples:**
-```
-001-pending-p1-mailer-test.md
-002-ready-p1-fix-n-plus-1.md
-005-complete-p2-refactor-csv.md
-```
-
-## File Structure
-
-Each todo is a markdown file with YAML frontmatter and structured sections. Use the template at [todo-template.md](./assets/todo-template.md) as a starting point when creating new todos.
-
-**Required sections:**
-- **Problem Statement** - What is broken, missing, or needs improvement?
-- **Assessment (Pressure Test)** - For code review findings: verification results and engineering judgment
-- **Findings** - Investigation results, root cause, key discoveries
-- **Proposed Solutions** - Multiple options with pros/cons, effort, risk
-- **Recommended Action** - Clear plan (filled during triage)
-- **Acceptance Criteria** - Testable checklist items
-- **Work Log** - Chronological record with date, actions, learnings
-
-**Optional sections:**
-- **Technical Details** - Affected files, related components, DB changes
-- **Resources** - Links to errors, tests, PRs, documentation
-- **Notes** - Additional context or decisions
-
-**Assessment section fields (for code review findings):**
-- Assessment: Clear & Correct | Unclear | Likely Incorrect | YAGNI
-- Recommended Action: Fix now | Clarify | Push back | Skip
-- Verified: Code, Tests, Usage, Prior Decisions (Yes/No with details)
-- Technical Justification: Why this finding is valid or should be skipped
-
-**YAML frontmatter fields:**
-```yaml
----
-status: ready # pending | ready | complete
-priority: p1 # p1 | p2 | p3
-issue_id: "002"
-tags: [rails, performance, database]
-dependencies: ["001"] # Issue IDs this is blocked by
----
-```
-
-## Common Workflows
-
-### Creating a New Todo
-
-**To create a new todo from findings or feedback:**
-
-1. Determine next issue ID: `ls todos/ | grep -o '^[0-9]\+' | sort -n | tail -1`
-2. Copy template: `cp assets/todo-template.md todos/{NEXT_ID}-pending-{priority}-{description}.md`
-3. Edit and fill required sections:
- - Problem Statement
- - Findings (if from investigation)
- - Proposed Solutions (multiple options)
- - Acceptance Criteria
- - Add initial Work Log entry
-4. Determine status: `pending` (needs triage) or `ready` (pre-approved)
-5. Add relevant tags for filtering
-
-**When to create a todo:**
-- Requires more than 15-20 minutes of work
-- Needs research, planning, or multiple approaches considered
-- Has dependencies on other work
-- Requires manager approval or prioritization
-- Part of larger feature or refactor
-- Technical debt needing documentation
-
-**When to act immediately instead:**
-- Issue is trivial (< 15 minutes)
-- Complete context available now
-- No planning needed
-- User explicitly requests immediate action
-- Simple bug fix with obvious solution
-
-### Triaging Pending Items
-
-**To triage pending todos:**
-
-1. List pending items: `ls todos/*-pending-*.md`
-2. For each todo:
- - Read Problem Statement and Findings
- - Review Proposed Solutions
- - Make decision: approve, defer, or modify priority
-3. Update approved todos:
- - Rename file: `mv {file}-pending-{pri}-{desc}.md {file}-ready-{pri}-{desc}.md`
- - Update frontmatter: `status: pending` → `status: ready`
- - Fill "Recommended Action" section with clear plan
- - Adjust priority if different from initial assessment
-4. Deferred todos stay in `pending` status
-
-**Use slash command:** `/triage` for interactive approval workflow
-
-### Managing Dependencies
-
-**To track dependencies:**
-
-```yaml
-dependencies: ["002", "005"] # This todo blocked by issues 002 and 005
-dependencies: [] # No blockers - can work immediately
-```
-
-**To check what blocks a todo:**
-```bash
-grep "^dependencies:" todos/003-*.md
-```
-
-**To find what a todo blocks:**
-```bash
-grep -l 'dependencies:.*"002"' todos/*.md
-```
-
-**To verify blockers are complete before starting:**
-```bash
-for dep in 001 002 003; do
- [ -f "todos/${dep}-complete-*.md" ] || echo "Issue $dep not complete"
-done
-```
-
-### Updating Work Logs
-
-**When working on a todo, always add a work log entry:**
-
-```markdown
-### YYYY-MM-DD - Session Title
-
-**By:** Claude Code / Developer Name
-
-**Actions:**
-- Specific changes made (include file:line references)
-- Commands executed
-- Tests run
-- Results of investigation
-
-**Learnings:**
-- What worked / what didn't
-- Patterns discovered
-- Key insights for future work
-```
-
-Work logs serve as:
-- Historical record of investigation
-- Documentation of approaches attempted
-- Knowledge sharing for team
-- Context for future similar work
-
-### Completing a Todo
-
-**To mark a todo as complete:**
-
-1. Verify all acceptance criteria checked off
-2. Update Work Log with final session and results
-3. Rename file: `mv {file}-ready-{pri}-{desc}.md {file}-complete-{pri}-{desc}.md`
-4. Update frontmatter: `status: ready` → `status: complete`
-5. Check for unblocked work: `grep -l 'dependencies:.*"002"' todos/*-ready-*.md`
-6. Commit with issue reference: `feat: resolve issue 002`
-
-## Integration with Development Workflows
-
-| Trigger | Flow | Tool |
-|---------|------|------|
-| Code review | `/ce:review` → Findings → `/triage` → Todos | Review agent + skill |
-| PR comments | `/resolve_pr_parallel` → Individual fixes → Todos | gh CLI + skill |
-| Code TODOs | `/resolve_todo_parallel` → Fixes + Complex todos | Agent + skill |
-| Planning | Brainstorm → Create todo → Work → Complete | Skill |
-| Feedback | Discussion → Create todo → Triage → Work | Skill + slash |
-
-## Quick Reference Commands
-
-**Finding work:**
-```bash
-# List highest priority unblocked work
-grep -l 'dependencies: \[\]' todos/*-ready-p1-*.md
-
-# List all pending items needing triage
-ls todos/*-pending-*.md
-
-# Find next issue ID
-ls todos/ | grep -o '^[0-9]\+' | sort -n | tail -1 | awk '{printf "%03d", $1+1}'
-
-# Count by status
-for status in pending ready complete; do
- echo "$status: $(ls -1 todos/*-$status-*.md 2>/dev/null | wc -l)"
-done
-```
-
-**Dependency management:**
-```bash
-# What blocks this todo?
-grep "^dependencies:" todos/003-*.md
-
-# What does this todo block?
-grep -l 'dependencies:.*"002"' todos/*.md
-```
-
-**Searching:**
-```bash
-# Search by tag
-grep -l "tags:.*rails" todos/*.md
-
-# Search by priority
-ls todos/*-p1-*.md
-
-# Full-text search
-grep -r "payment" todos/
-```
-
-## Key Distinctions
-
-**File-todos system (this skill):**
-- Markdown files in `todos/` directory
-- Development/project tracking
-- Standalone markdown files with YAML frontmatter
-- Used by humans and agents
-
-**Rails Todo model:**
-- Database model in `app/models/todo.rb`
-- User-facing feature in the application
-- Active Record CRUD operations
-- Different from this file-based system
-
-**TodoWrite tool:**
-- In-memory task tracking during agent sessions
-- Temporary tracking for single conversation
-- Not persisted to disk
-- Different from both systems above
diff --git a/plugins/compound-engineering/skills/frontend-design/SKILL.md b/plugins/compound-engineering/skills/frontend-design/SKILL.md
index a8344c4..d3e18b7 100644
--- a/plugins/compound-engineering/skills/frontend-design/SKILL.md
+++ b/plugins/compound-engineering/skills/frontend-design/SKILL.md
@@ -1,42 +1,258 @@
---
name: frontend-design
-description: This skill should be used when creating distinctive, production-grade frontend interfaces with high design quality. It applies when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
-license: Complete terms in LICENSE.txt
+description: 'Build web interfaces with genuine design quality, not AI slop. Use for any frontend work - landing pages, web apps, dashboards, admin panels, components, interactive experiences. Activates for both greenfield builds and modifications to existing applications. Detects existing design systems and respects them. Covers composition, typography, color, motion, and copy. Verifies results via screenshots before declaring done.'
---
-This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
+# Frontend Design
-The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
+Guide creation of distinctive, production-grade frontend interfaces that avoid generic AI aesthetics. This skill covers the full lifecycle: detect what exists, plan the design, build with intention, and verify visually.
-## Design Thinking
+## Authority Hierarchy
-Before coding, understand the context and commit to a BOLD aesthetic direction:
-- **Purpose**: What problem does this interface solve? Who uses it?
-- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
-- **Constraints**: Technical requirements (framework, performance, accessibility).
-- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
+Every rule in this skill is a default, not a mandate.
-**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
+1. **Existing design system / codebase patterns** -- highest priority, always respected
+2. **User's explicit instructions** -- override skill defaults
+3. **Skill defaults** -- apply in greenfield work or when the user asks for design guidance
-Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
-- Production-grade and functional
-- Visually striking and memorable
-- Cohesive with a clear aesthetic point-of-view
-- Meticulously refined in every detail
+When working in an existing codebase with established patterns, follow those patterns. When the user specifies a direction that contradicts a default, follow the user.
-## Frontend Aesthetics Guidelines
+## Workflow
-Focus on:
-- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
-- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
-- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
-- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
-- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
+```
+Detect context -> Plan the design -> Build -> Verify visually
+```
-NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.
+---
-Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
+## Layer 0: Context Detection
-**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
+Before any design work, examine the codebase for existing design signals. This determines how much of the skill's opinionated guidance applies.
-Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
+### What to Look For
+
+- **Design tokens / CSS variables**: `--color-*`, `--spacing-*`, `--font-*` custom properties, theme files
+- **Component libraries**: shadcn/ui, Material UI, Chakra, Ant Design, Radix, or project-specific component directories
+- **CSS frameworks**: `tailwind.config.*`, `styled-components` theme, Bootstrap imports, CSS modules with consistent naming
+- **Typography**: Font imports in HTML/CSS, `@font-face` declarations, Google Fonts links
+- **Color palette**: Defined color scales, brand color files, design token exports
+- **Animation libraries**: Framer Motion, GSAP, anime.js, Motion One, Vue Transition imports
+- **Spacing / layout patterns**: Consistent spacing scale usage, grid systems, layout components
+
+Use the platform's native file-search and content-search tools (e.g., Glob/Grep in Claude Code) to scan for these signals. Do not use shell commands for routine file exploration.
+
+### Mode Classification
+
+Based on detected signals, choose a mode:
+
+- **Existing system** (4+ signals across multiple categories): Defer to it. The skill's aesthetic opinions (typography, color, motion) yield to the established system. Structural guidance (composition, copy, accessibility, verification) still applies.
+- **Partial system** (1-3 signals): Follow what exists; apply skill defaults only for areas where no convention was detected. For example, if Tailwind is configured but no component library exists, follow the Tailwind tokens and apply skill guidance for component structure.
+- **Greenfield** (no signals detected): Full skill guidance applies.
+- **Ambiguous** (signals are contradictory or unclear): Ask the user before proceeding.
+
+### Asking the User
+
+When context is ambiguous, use the platform's blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, assume "partial" mode and proceed conservatively.
+
+Example question: "I found [detected signals]. Should I follow your existing design patterns or create something distinctive?"
+
+---
+
+## Layer 1: Pre-Build Planning
+
+Before writing code, write three short statements. These create coherence and give the user a checkpoint to redirect before code is written.
+
+1. **Visual thesis** -- one sentence describing the mood, material, and energy
+ - Greenfield examples: "Clean editorial feel, lots of whitespace, serif headlines, muted earth tones" or "Dense data-forward dashboard, monospace accents, dark surface hierarchy"
+ - Existing codebase: Describe the *existing* aesthetic and how the new work will extend it
+
+2. **Content plan** -- what goes on the page and in what order
+ - Landing page: hero, support, detail, CTA
+ - App: primary workspace, nav, secondary context
+ - Component: what states it has, what it communicates
+
+3. **Interaction plan** -- 2-3 specific motion ideas that change the feel
+ - Not "add animations" but "staggered fade-in on hero load, parallax on scroll between sections, scale-up on card hover"
+ - In an existing codebase, describe only the interactions being added, using the existing motion library
+
+---
+
+## Layer 2: Design Guidance Core
+
+These principles apply across all context types. Each yields to existing design systems and user instructions per the authority hierarchy.
+
+### Typography
+
+- Choose distinctive, characterful fonts. Avoid the usual suspects (Inter, Roboto, Arial, system defaults) unless the existing codebase uses them.
+- Two typefaces maximum without a clear reason for more. Pair a display/headline font with a body font.
+- *Yields to existing font choices when detected in Layer 0.*
+
+### Color & Theme
+
+- Commit to a cohesive palette using CSS variables. A dominant color with sharp accents outperforms timid, evenly-distributed palettes.
+- No purple-on-white bias, no dark-mode bias. Vary between light and dark based on context.
+- One accent color by default unless the product already has a multi-color system.
+- *Yields to existing color tokens when detected.*
+
+### Composition
+
+- Start with composition, not components. Treat the first viewport as a poster, not a document.
+- Use whitespace, alignment, scale, cropping, and contrast before adding chrome (borders, shadows, cards).
+- Default to cardless layouts. Cards are allowed when they serve as the container for a user interaction (clickable item, draggable unit, selectable option). If removing the card styling would not hurt comprehension, it should not be a card.
+- *All composition rules are defaults. The user can override them.*
+
+### Motion
+
+- Ship 2-3 intentional motions for visually-led work: one entrance sequence, one scroll-linked or depth effect, one hover/reveal transition.
+- Use the project's existing animation library if one is present.
+- When no existing library is found, use framework-conditional defaults:
+ - **CSS animations** as the universal baseline
+ - **Framer Motion** for React projects
+ - **Vue Transition / Motion One** for Vue projects
+ - **Svelte transitions** for Svelte projects
+- Motion should be noticeable in a quick recording, smooth on mobile, and consistent across the page. Remove if purely ornamental.
+
+### Accessibility
+
+- Semantic HTML by default: `nav`, `main`, `section`, `article`, `button` -- not divs for everything.
+- Color contrast meeting WCAG AA minimum.
+- Focus states on all interactive elements.
+- Accessibility and aesthetics are not in tension when done well.
+
+### Imagery
+
+- When images are needed, prefer real or realistic photography over abstract gradients or fake 3D objects.
+- Choose or generate images with a stable tonal area for text overlay.
+- If image generation tools are available in the environment, use them to create contextually appropriate visuals rather than placeholder stock.
+
+---
+
+## Context Modules
+
+Select the module that fits what is being built. When working inside an existing application, default to Module C regardless of what the feature is.
+
+### Module A: Landing Pages & Marketing (Greenfield)
+
+**Default section sequence:**
+1. Hero -- brand/product, promise, CTA, one dominant visual
+2. Support -- one concrete feature, offer, or proof point
+3. Detail -- atmosphere, workflow, product depth, or story
+4. Final CTA -- convert, start, visit, or contact
+
+**Hero rules (defaults):**
+- One composition, not a dashboard. Full-bleed image or dominant visual plane.
+- Brand first, headline second, body third, CTA fourth.
+- Keep the text column narrow and anchored to a calm area of the image.
+- No more than 6 sections total without a clear reason.
+- One H1 headline. One primary CTA above the fold.
+
+**Copy:**
+- Let the headline carry the meaning. Supporting copy is usually one short sentence.
+- Write in product language, not design commentary. No prompt language or AI commentary in the UI.
+- Each section gets one job: explain, prove, deepen, or convert.
+- Every sentence should earn its place. Default to less copy, not more.
+
+### Module B: Apps & Dashboards (Greenfield)
+
+**Default patterns:**
+- Calm surface hierarchy, strong typography and spacing, few colors, dense but readable information, minimal chrome.
+- Organize around: primary workspace, navigation, secondary context/inspector, one clear accent for action or state.
+- Cards only when the card is the interaction (clickable item, draggable unit, selectable option). If a panel can become plain layout without losing meaning, remove the card treatment.
+
+**Copy (utility, not marketing):**
+- Prioritize orientation, status, and action over promise, mood, or brand voice.
+- Section headings should say what the area is or what the user can do there. Good: "Plan status", "Search metrics". Bad: "Unlock Your Potential".
+- If a sentence could appear in a homepage hero, rewrite it until it sounds like product UI.
+- Litmus: if an operator scans only headings, labels, and numbers, can they understand the page immediately?
+
+### Module C: Components & Features (Default in Existing Apps)
+
+For adding to an existing application:
+
+- Match the existing visual language. This module is about making something that belongs, not something that stands out.
+- Inherit spacing scale, border radius, color tokens, and typography from surrounding code.
+- Focus on interaction quality: clear states (default, hover, active, disabled, loading, error), smooth transitions between states, obvious affordances.
+- One new component should not introduce a new design system. If the existing app uses 4px border radius, do not add a component with 8px.
+
+---
+
+## Hard Rules & Anti-Patterns
+
+### Default Against (Overridable)
+
+These are the skill being opinionated. The user can override any of them.
+
+- Generic SaaS card grid as the first impression
+- Purple-on-white color schemes, dark-mode bias
+- Overused fonts (Inter, Roboto, Arial, Space Grotesk, system defaults) in greenfield work
+- Hero sections cluttered with stats, schedules, pill clusters, logo clouds
+- Sections that repeat the same mood statement in different words
+- Carousel with no narrative purpose
+- Multiple competing accent colors
+- Decorative gradients or abstract backgrounds standing in for real visual content
+- Copy that sounds like design commentary ("Experience the seamless integration")
+- Split-screen heroes where text sits on the busy side of an image
+
+### Always Avoid (Quality Floor)
+
+These are genuine quality failures no user would want.
+
+- Prompt language or AI commentary leaking into the UI
+- Broken contrast -- text unreadable over images or backgrounds
+- Interactive elements without visible focus states
+- Semantic div soup when proper HTML elements exist
+
+---
+
+## Litmus Checks
+
+Quick self-review before moving to visual verification. Not all checks apply in every context -- apply judgment about which are relevant.
+
+- Is the brand or product unmistakable in the first screen?
+- Is there one strong visual anchor?
+- Can the page be understood by scanning headlines only?
+- Does each section have one job?
+- Are cards actually necessary where they are used?
+- Does motion improve hierarchy or atmosphere, or is it just there?
+- Would the design feel premium if all decorative shadows were removed?
+- Does the copy sound like the product, not like a prompt?
+- Does the new work match the existing design system? (Module C)
+
+---
+
+## Visual Verification
+
+After implementing, verify visually. This is a sanity check, not a pixel-perfect review. One pass. If there is a glaring issue, fix it. If it looks solid, move on.
+
+### Tool Preference Cascade
+
+Use the first available option:
+
+1. **Existing project browser tooling** -- if Playwright, Puppeteer, Cypress, or similar is already in the project's dependencies, use it. Do not introduce new dependencies just for verification.
+2. **Browser MCP tools** -- if browser automation tools (e.g., claude-in-chrome) are available in the agent's environment, use them.
+3. **agent-browser CLI** -- if nothing else is available, this is the default. Load the `agent-browser` skill for installation and usage instructions.
+4. **Mental review** -- if no browser access is possible (headless CI, no permissions to install), apply the litmus checks as a self-review and note that visual verification was skipped.
+
+### What to Assess
+
+- Does the output match the visual thesis from the pre-build plan?
+- Are there obvious visual problems (broken layout, unreadable text, missing images)?
+- Does it look like the context module intended (landing page feels like a landing page, dashboard feels like a dashboard, component fits its surroundings)?
+
+### Scope Control
+
+One iteration. Take a screenshot, assess against the litmus checks, fix any glaring issues, and move on. Include the screenshot in the deliverable (PR description, conversation output, etc.).
+
+For iterative refinement beyond a single pass (multiple rounds of screenshot-assess-fix), see the `compound-engineering:design:design-iterator` agent.
+
+---
+
+## Creative Energy
+
+This skill provides structure, but the goal is distinctive work that avoids AI slop -- not formulaic output.
+
+For greenfield work, commit to a bold aesthetic direction. Consider the tone: brutally minimal, maximalist, retro-futuristic, organic/natural, luxury/refined, playful, editorial, brutalist, art deco, soft/pastel, industrial -- or invent something that fits the context. There are endless flavors. Use these for inspiration but design one that is true to the project.
+
+Ask: what makes this unforgettable? What is the one thing someone will remember?
+
+Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well, not from intensity.
diff --git a/plugins/compound-engineering/skills/generate_command/SKILL.md b/plugins/compound-engineering/skills/generate_command/SKILL.md
index 47e2cfc..daed156 100644
--- a/plugins/compound-engineering/skills/generate_command/SKILL.md
+++ b/plugins/compound-engineering/skills/generate_command/SKILL.md
@@ -93,7 +93,7 @@ argument-hint: "[what arguments the command accepts]"
## Tips for Effective Commands
- **Use $ARGUMENTS** placeholder for dynamic inputs
-- **Reference CLAUDE.md** patterns and conventions
+- **Reference AGENTS.md** patterns and conventions
- **Include verification steps** - tests, linting, visual checks
- **Be explicit about constraints** - don't modify X, use pattern Y
- **Use XML tags** for structured prompts: ``, ``, ``
@@ -114,7 +114,7 @@ Implement #$ARGUMENTS following these steps:
3. Implement
- Follow existing code patterns (reference specific files)
- Write tests first if doing TDD
- - Ensure code follows CLAUDE.md conventions
+ - Ensure code follows AGENTS.md conventions
4. Verify
- Run tests: `bin/rails test`
diff --git a/plugins/compound-engineering/skills/git-worktree/SKILL.md b/plugins/compound-engineering/skills/git-worktree/SKILL.md
index 19b8806..12c0e29 100644
--- a/plugins/compound-engineering/skills/git-worktree/SKILL.md
+++ b/plugins/compound-engineering/skills/git-worktree/SKILL.md
@@ -16,6 +16,7 @@ This skill provides a unified interface for managing Git worktrees across your d
- **Interactive confirmations** at each step
- **Automatic .gitignore management** for worktree directory
- **Automatic .env file copying** from main repo to new worktrees
+- **Automatic dev tool trusting** for mise and direnv configs with review-safe guardrails
## CRITICAL: Always Use the Manager Script
@@ -23,8 +24,11 @@ This skill provides a unified interface for managing Git worktrees across your d
The script handles critical setup that raw git commands don't:
1. Copies `.env`, `.env.local`, `.env.test`, etc. from main repo
-2. Ensures `.worktrees` is in `.gitignore`
-3. Creates consistent directory structure
+2. Trusts dev tool configs with branch-aware safety rules:
+ - mise: auto-trust only when unchanged from a trusted baseline branch
+ - direnv: auto-allow only for trusted base branches; review worktrees stay manual
+3. Ensures `.worktrees` is in `.gitignore`
+4. Creates consistent directory structure
```bash
# ✅ CORRECT - Always use the script
@@ -95,7 +99,11 @@ bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh creat
2. Updates the base branch from remote
3. Creates new worktree and branch
4. **Copies all .env files from main repo** (.env, .env.local, .env.test, etc.)
-5. Shows path for cd-ing to the worktree
+5. **Trusts dev tool configs** with branch-aware safety rules:
+ - trusted bases (`main`, `develop`, `dev`, `trunk`, `staging`, `release/*`) compare against themselves
+ - other branches compare against the default branch
+ - direnv auto-allow is skipped on non-trusted bases because `.envrc` can source unchecked files
+6. Shows path for cd-ing to the worktree
### `list` or `ls`
diff --git a/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh b/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh
index 181d6d1..3a05944 100755
--- a/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh
+++ b/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh
@@ -65,6 +65,137 @@ copy_env_files() {
echo -e " ${GREEN}✓ Copied $copied environment file(s)${NC}"
}
+# Resolve the repository default branch, falling back to main when origin/HEAD
+# is unavailable (for example in single-branch clones).
+get_default_branch() {
+ local head_ref
+ head_ref=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || true)
+
+ if [[ -n "$head_ref" ]]; then
+ echo "${head_ref#refs/remotes/origin/}"
+ else
+ echo "main"
+ fi
+}
+
+# Auto-trust is only safe when the worktree is created from a long-lived branch
+# the developer already controls. Review/PR branches should fall back to the
+# default branch baseline and require manual direnv approval.
+is_trusted_base_branch() {
+ local branch="$1"
+ local default_branch="$2"
+
+ [[ "$branch" == "$default_branch" ]] && return 0
+
+ case "$branch" in
+ develop|dev|trunk|staging|release/*)
+ return 0
+ ;;
+ *)
+ return 1
+ ;;
+ esac
+}
+
+# Trust development tool configs in a new worktree.
+# Worktrees get a new filesystem path that tools like mise and direnv
+# have never seen. Without trusting, these tools block with interactive
+# prompts or refuse to load configs, which breaks hooks and scripts.
+#
+# Safety: auto-trusts only configs unchanged from a trusted baseline branch.
+# Review/PR branches fall back to the default-branch baseline, and direnv
+# auto-allow is limited to trusted base branches because .envrc can source
+# additional files that direnv does not validate.
+#
+# TOCTOU between hash-check and trust is acceptable for local dev use.
+trust_dev_tools() {
+ local worktree_path="$1"
+ local base_ref="$2"
+ local allow_direnv_auto="$3"
+ local trusted=0
+ local skipped_messages=()
+ local manual_commands=()
+
+ # mise: trust the specific config file if present and unchanged
+ if command -v mise &>/dev/null; then
+ for f in .mise.toml mise.toml .tool-versions; do
+ if [[ -f "$worktree_path/$f" ]]; then
+ if _config_unchanged "$f" "$base_ref" "$worktree_path"; then
+ if (cd "$worktree_path" && mise trust "$f" --quiet); then
+ trusted=$((trusted + 1))
+ else
+ echo -e " ${YELLOW}Warning: 'mise trust $f' failed -- run manually in $worktree_path${NC}"
+ fi
+ else
+ skipped_messages+=("mise trust $f (config differs from $base_ref)")
+ manual_commands+=("mise trust $f")
+ fi
+ break
+ fi
+ done
+ fi
+
+ # direnv: allow .envrc
+ if command -v direnv &>/dev/null; then
+ if [[ -f "$worktree_path/.envrc" ]]; then
+ if [[ "$allow_direnv_auto" != "true" ]]; then
+ skipped_messages+=("direnv allow (.envrc auto-allow is disabled for non-trusted base branches)")
+ manual_commands+=("direnv allow")
+ elif _config_unchanged ".envrc" "$base_ref" "$worktree_path"; then
+ if (cd "$worktree_path" && direnv allow); then
+ trusted=$((trusted + 1))
+ else
+ echo -e " ${YELLOW}Warning: 'direnv allow' failed -- run manually in $worktree_path${NC}"
+ fi
+ else
+ skipped_messages+=("direnv allow (.envrc differs from $base_ref)")
+ manual_commands+=("direnv allow")
+ fi
+ fi
+ fi
+
+ if [[ $trusted -gt 0 ]]; then
+ echo -e " ${GREEN}✓ Trusted $trusted dev tool config(s)${NC}"
+ fi
+
+ if [[ ${#skipped_messages[@]} -gt 0 ]]; then
+ echo -e " ${YELLOW}Skipped auto-trust for config(s) requiring manual review:${NC}"
+ for item in "${skipped_messages[@]}"; do
+ echo -e " - $item"
+ done
+ if [[ ${#manual_commands[@]} -gt 0 ]]; then
+ local joined
+ joined=$(printf ' && %s' "${manual_commands[@]}")
+ echo -e " ${BLUE}Review the diff, then run manually: cd $worktree_path${joined}${NC}"
+ fi
+ fi
+}
+
+# Check if a config file is unchanged from the base branch.
+# Returns 0 (true) if the file is identical to the base branch version.
+# Returns 1 (false) if the file was added or modified by this branch.
+#
+# Note: rev-parse returns the stored blob hash; hash-object on a path applies
+# gitattributes filters. A mismatch causes a false negative (trust skipped),
+# which is the safe direction.
+_config_unchanged() {
+ local file="$1"
+ local base_ref="$2"
+ local worktree_path="$3"
+
+ # Reject symlinks -- trust only regular files with verifiable content
+ [[ -L "$worktree_path/$file" ]] && return 1
+
+ # Get the blob hash directly from git's object database via rev-parse
+ local base_hash
+ base_hash=$(git rev-parse "$base_ref:$file" 2>/dev/null) || return 1
+
+ local worktree_hash
+ worktree_hash=$(git hash-object "$worktree_path/$file") || return 1
+
+ [[ "$base_hash" == "$worktree_hash" ]]
+}
+
# Create a new worktree
create_worktree() {
local branch_name="$1"
@@ -107,6 +238,29 @@ create_worktree() {
# Copy environment files
copy_env_files "$worktree_path"
+ # Trust dev tool configs (mise, direnv) so hooks and scripts work immediately.
+ # Long-lived integration branches can use themselves as the trust baseline,
+ # while review/PR branches fall back to the default branch and require manual
+ # direnv approval.
+ local default_branch
+ default_branch=$(get_default_branch)
+ local trust_branch="$default_branch"
+ local allow_direnv_auto="false"
+ if is_trusted_base_branch "$from_branch" "$default_branch"; then
+ trust_branch="$from_branch"
+ allow_direnv_auto="true"
+ fi
+
+ if ! git fetch origin "$trust_branch" --quiet; then
+ echo -e " ${YELLOW}Warning: could not fetch origin/$trust_branch -- trust check may use stale data${NC}"
+ fi
+ # Skip trust entirely if the baseline ref doesn't exist locally.
+ if git rev-parse --verify "origin/$trust_branch" &>/dev/null; then
+ trust_dev_tools "$worktree_path" "origin/$trust_branch" "$allow_direnv_auto"
+ else
+ echo -e " ${YELLOW}Skipping dev tool trust -- origin/$trust_branch not found locally${NC}"
+ fi
+
echo -e "${GREEN}✓ Worktree created successfully!${NC}"
echo ""
echo "To switch to this worktree:"
@@ -321,6 +475,15 @@ Environment Files:
- Creates .backup files if destination already exists
- Use 'copy-env' to refresh env files after main repo changes
+Dev Tool Trust:
+ - Trusts mise config (.mise.toml, mise.toml, .tool-versions) and direnv (.envrc)
+ - Uses trusted base branches directly (main, develop, dev, trunk, staging, release/*)
+ - Other branches fall back to the default branch as the trust baseline
+ - direnv auto-allow is skipped on non-trusted base branches; review manually first
+ - Modified configs are flagged for manual review
+ - Only runs if the tool is installed and config exists
+ - Prevents hooks/scripts from hanging on interactive trust prompts
+
Examples:
worktree-manager.sh create feature-login
worktree-manager.sh create feature-auth develop
diff --git a/plugins/compound-engineering/skills/heal-skill/SKILL.md b/plugins/compound-engineering/skills/heal-skill/SKILL.md
deleted file mode 100644
index a021f31..0000000
--- a/plugins/compound-engineering/skills/heal-skill/SKILL.md
+++ /dev/null
@@ -1,143 +0,0 @@
----
-name: heal-skill
-description: Fix incorrect SKILL.md files when a skill has wrong instructions or outdated API references
-argument-hint: "[optional: specific issue to fix]"
-allowed-tools: [Read, Edit, Bash(ls:*), Bash(git:*)]
-disable-model-invocation: true
----
-
-
-Update a skill's SKILL.md and related files based on corrections discovered during execution.
-
-Analyze the conversation to detect which skill is running, reflect on what went wrong, propose specific fixes, get user approval, then apply changes with optional commit.
-
-
-
-Skill detection: !`ls -1 ./skills/*/SKILL.md | head -5`
-
-
-
-
-1. **Detect skill** from conversation context (invocation messages, recent SKILL.md references)
-2. **Reflect** on what went wrong and how you discovered the fix
-3. **Present** proposed changes with before/after diffs
-4. **Get approval** before making any edits
-5. **Apply** changes and optionally commit
-
-
-
-
-
-Identify the skill from conversation context:
-
-- Look for skill invocation messages
-- Check which SKILL.md was recently referenced
-- Examine current task context
-
-Set: `SKILL_NAME=[skill-name]` and `SKILL_DIR=./skills/$SKILL_NAME`
-
-If unclear, ask the user.
-
-
-
-Focus on $ARGUMENTS if provided, otherwise analyze broader context.
-
-Determine:
-- **What was wrong**: Quote specific sections from SKILL.md that are incorrect
-- **Discovery method**: Context7, error messages, trial and error, documentation lookup
-- **Root cause**: Outdated API, incorrect parameters, wrong endpoint, missing context
-- **Scope of impact**: Single section or multiple? Related files affected?
-- **Proposed fix**: Which files, which sections, before/after for each
-
-
-
-```bash
-ls -la $SKILL_DIR/
-ls -la $SKILL_DIR/references/ 2>/dev/null
-ls -la $SKILL_DIR/scripts/ 2>/dev/null
-```
-
-
-
-Present changes in this format:
-
-```
-**Skill being healed:** [skill-name]
-**Issue discovered:** [1-2 sentence summary]
-**Root cause:** [brief explanation]
-
-**Files to be modified:**
-- [ ] SKILL.md
-- [ ] references/[file].md
-- [ ] scripts/[file].py
-
-**Proposed changes:**
-
-### Change 1: SKILL.md - [Section name]
-**Location:** Line [X] in SKILL.md
-
-**Current (incorrect):**
-```
-[exact text from current file]
-```
-
-**Corrected:**
-```
-[new text]
-```
-
-**Reason:** [why this fixes the issue]
-
-[repeat for each change across all files]
-
-**Impact assessment:**
-- Affects: [authentication/API endpoints/parameters/examples/etc.]
-
-**Verification:**
-These changes will prevent: [specific error that prompted this]
-```
-
-
-
-```
-Should I apply these changes?
-
-1. Yes, apply and commit all changes
-2. Apply but don't commit (let me review first)
-3. Revise the changes (I'll provide feedback)
-4. Cancel (don't make changes)
-
-Choose (1-4):
-```
-
-**Wait for user response. Do not proceed without approval.**
-
-
-
-Only after approval (option 1 or 2):
-
-1. Use Edit tool for each correction across all files
-2. Read back modified sections to verify
-3. If option 1, commit with structured message showing what was healed
-4. Confirm completion with file list
-
-
-
-
-- Skill correctly detected from conversation context
-- All incorrect sections identified with before/after
-- User approved changes before application
-- All edits applied across SKILL.md and related files
-- Changes verified by reading back
-- Commit created if user chose option 1
-- Completion confirmed with file list
-
-
-
-Before completing:
-
-- Read back each modified section to confirm changes applied
-- Ensure cross-file consistency (SKILL.md examples match references/)
-- Verify git commit created if option 1 was selected
-- Check no unintended files were modified
-
diff --git a/plugins/compound-engineering/skills/lfg/SKILL.md b/plugins/compound-engineering/skills/lfg/SKILL.md
index 46e1485..dd5aadd 100644
--- a/plugins/compound-engineering/skills/lfg/SKILL.md
+++ b/plugins/compound-engineering/skills/lfg/SKILL.md
@@ -5,25 +5,27 @@ argument-hint: "[feature description]"
disable-model-invocation: true
---
-CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any step. Do NOT jump ahead to coding or implementation. The plan phase (steps 2-3) MUST be completed and verified BEFORE any work begins. Violating this order produces bad output.
+CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any required step. Do NOT jump ahead to coding or implementation. The plan phase (step 2, and step 3 when warranted) MUST be completed and verified BEFORE any work begins. Violating this order produces bad output.
-1. **Optional:** If the `ralph-wiggum` skill is available, run `/ralph-wiggum:ralph-loop "finish all slash commands" --completion-promise "DONE"`. If not available or it fails, skip and continue to step 2 immediately.
+1. **Optional:** If the `ralph-loop` skill is available, run `/ralph-loop:ralph-loop "finish all slash commands" --completion-promise "DONE"`. If not available or it fails, skip and continue to step 2 immediately.
2. `/ce:plan $ARGUMENTS`
- GATE: STOP. Verify that `/ce:plan` produced a plan file in `docs/plans/`. If no plan file was created, run `/ce:plan $ARGUMENTS` again. Do NOT proceed to step 3 until a written plan exists.
+ GATE: STOP. Verify that the `ce:plan` workflow produced a plan file in `docs/plans/`. If no plan file was created, run `/ce:plan $ARGUMENTS` again. Do NOT proceed to step 3 until a written plan exists.
-3. `/compound-engineering:deepen-plan`
+3. **Conditionally** run `/compound-engineering:deepen-plan`
- GATE: STOP. Confirm the plan has been deepened and updated. The plan file in `docs/plans/` should now contain additional detail. Do NOT proceed to step 4 without a deepened plan.
+ Run the `deepen-plan` workflow only if the plan is `Standard` or `Deep`, touches a high-risk area (auth, security, payments, migrations, external APIs, significant rollout concerns), or still has obvious confidence gaps in decisions, sequencing, system-wide impact, risks, or verification.
+
+ GATE: STOP. If you ran the `deepen-plan` workflow, confirm the plan was deepened or explicitly judged sufficiently grounded. If you skipped it, briefly note why and proceed to step 4.
4. `/ce:work`
GATE: STOP. Verify that implementation work was performed - files were created or modified beyond the plan. Do NOT proceed to step 5 if no code changes were made.
-5. `/ce:review`
+5. `/ce:review mode:autofix`
-6. `/compound-engineering:resolve_todo_parallel`
+6. `/compound-engineering:todo-resolve`
7. `/compound-engineering:test-browser`
@@ -31,4 +33,4 @@ CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any step. Do N
9. Output `DONE` when video is in PR
-Start with step 2 now (or step 1 if ralph-wiggum is available). Remember: plan FIRST, then work. Never skip the plan.
+Start with step 2 now (or step 1 if ralph-loop is available). Remember: plan FIRST, then work. Never skip the plan.
diff --git a/plugins/compound-engineering/skills/report-bug/SKILL.md b/plugins/compound-engineering/skills/report-bug-ce/SKILL.md
similarity index 64%
rename from plugins/compound-engineering/skills/report-bug/SKILL.md
rename to plugins/compound-engineering/skills/report-bug-ce/SKILL.md
index 2e7ba48..3da76e6 100644
--- a/plugins/compound-engineering/skills/report-bug/SKILL.md
+++ b/plugins/compound-engineering/skills/report-bug-ce/SKILL.md
@@ -1,17 +1,17 @@
---
-name: report-bug
+name: report-bug-ce
description: Report a bug in the compound-engineering plugin
argument-hint: "[optional: brief description of the bug]"
disable-model-invocation: true
---
-# Report a Compounding Engineering Plugin Bug
+# Report a Compound Engineering Plugin Bug
-Report bugs encountered while using the compound-engineering plugin. This command gathers structured information and creates a GitHub issue for the maintainer.
+Report bugs encountered while using the compound-engineering plugin. This skill gathers structured information and creates a GitHub issue for the maintainer.
## Step 1: Gather Bug Information
-Use the AskUserQuestion tool to collect the following information:
+Ask the user the following questions (using the platform's blocking question tool — e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini — or present numbered options and wait for a reply):
**Question 1: Bug Category**
- What type of issue are you experiencing?
@@ -39,18 +39,25 @@ Use the AskUserQuestion tool to collect the following information:
## Step 2: Collect Environment Information
-Automatically gather:
+Automatically gather environment details. Detect the coding agent platform and collect what is available:
+
+**OS info (all platforms):**
```bash
-# Get plugin version
-cat ~/.claude/plugins/installed_plugins.json 2>/dev/null | grep -A5 "compound-engineering" | head -10 || echo "Plugin info not found"
-
-# Get Claude Code version
-claude --version 2>/dev/null || echo "Claude CLI version unknown"
-
-# Get OS info
uname -a
```
+**Plugin version:** Read the plugin manifest or installed plugin metadata. Common locations:
+- Claude Code: `~/.claude/plugins/installed_plugins.json`
+- Codex: `.codex/plugins/` or project config
+- Other platforms: check the platform's plugin registry
+
+**Agent CLI version:** Run the platform's version command:
+- Claude Code: `claude --version`
+- Codex: `codex --version`
+- Other platforms: use the appropriate CLI version flag
+
+If any of these fail, note "unknown" and continue — do not block the report.
+
## Step 3: Format the Bug Report
Create a well-structured bug report with:
@@ -63,8 +70,9 @@ Create a well-structured bug report with:
## Environment
-- **Plugin Version:** [from installed_plugins.json]
-- **Claude Code Version:** [from claude --version]
+- **Plugin Version:** [from plugin manifest/registry]
+- **Agent Platform:** [e.g., Claude Code, Codex, Copilot, Pi, Kilo]
+- **Agent Version:** [from CLI version command]
- **OS:** [from uname]
## What Happened
@@ -83,16 +91,14 @@ Create a well-structured bug report with:
## Error Messages
-```
[Any error output]
-```
## Additional Context
[Any other relevant information]
---
-*Reported via `/report-bug` command*
+*Reported via `/report-bug-ce` skill*
```
## Step 4: Create GitHub Issue
@@ -125,7 +131,7 @@ After the issue is created:
## Output Format
```
-✅ Bug report submitted successfully!
+Bug report submitted successfully!
Issue: https://github.com/EveryInc/compound-engineering-plugin/issues/[NUMBER]
Title: [compound-engineering] Bug: [description]
@@ -136,16 +142,16 @@ The maintainer will review your report and respond as soon as possible.
## Error Handling
-- If `gh` CLI is not authenticated: Prompt user to run `gh auth login` first
-- If issue creation fails: Display the formatted report so user can manually create the issue
-- If required information is missing: Re-prompt for that specific field
+- If `gh` CLI is not installed or not authenticated: prompt the user to install/authenticate first
+- If issue creation fails: display the formatted report so the user can manually create the issue
+- If required information is missing: re-prompt for that specific field
## Privacy Notice
-This command does NOT collect:
+This skill does NOT collect:
- Personal information
- API keys or credentials
-- Private code from your projects
+- Private code from projects
- File paths beyond basic OS info
Only technical information about the bug is included in the report.
diff --git a/plugins/compound-engineering/skills/reproduce-bug/SKILL.md b/plugins/compound-engineering/skills/reproduce-bug/SKILL.md
index 23cf15d..978247d 100644
--- a/plugins/compound-engineering/skills/reproduce-bug/SKILL.md
+++ b/plugins/compound-engineering/skills/reproduce-bug/SKILL.md
@@ -1,100 +1,194 @@
---
name: reproduce-bug
-description: Reproduce and investigate a bug using logs, console inspection, and browser screenshots
-argument-hint: "[GitHub issue number]"
-disable-model-invocation: true
+description: Systematically reproduce and investigate a bug from a GitHub issue. Use when the user provides a GitHub issue number or URL for a bug they want reproduced or investigated.
+argument-hint: "[GitHub issue number or URL]"
---
-# Reproduce Bug Command
+# Reproduce Bug
-Look at github issue #$ARGUMENTS and read the issue description and comments.
+A framework-agnostic, hypothesis-driven workflow for reproducing and investigating bugs from issue reports. Works across any language, framework, or project type.
-## Phase 1: Log Investigation
+## Phase 1: Understand the Issue
-Run the following agents in parallel to investigate the bug:
+Fetch and analyze the bug report to extract structured information before touching the codebase.
-1. Task rails-console-explorer(issue_description)
-2. Task appsignal-log-investigator(issue_description)
+### Fetch the issue
-Think about the places it could go wrong looking at the codebase. Look for logging output we can look for.
+If no issue number or URL was provided as an argument, ask the user for one before proceeding (using the platform's question tool -- e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini -- or present a prompt and wait for a reply).
-Run the agents again to find any logs that could help us reproduce the bug.
-
-Keep running these agents until you have a good idea of what is going on.
-
-## Phase 2: Visual Reproduction with Playwright
-
-If the bug is UI-related or involves user flows, use Playwright to visually reproduce it:
-
-### Step 1: Verify Server is Running
-
-```
-mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000" })
-mcp__plugin_compound-engineering_pw__browser_snapshot({})
+```bash
+gh issue view $ARGUMENTS --json title,body,comments,labels,assignees
```
-If server not running, inform user to start `bin/dev`.
+If the argument is a URL rather than a number, extract the issue number or pass the URL directly to `gh`.
-### Step 2: Navigate to Affected Area
+### Extract key details
-Based on the issue description, navigate to the relevant page:
+Read the issue and comments, then identify:
-```
-mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000/[affected_route]" })
-mcp__plugin_compound-engineering_pw__browser_snapshot({})
+- **Reported symptoms** -- what the user observed (error message, wrong output, visual glitch, crash)
+- **Expected behavior** -- what should have happened instead
+- **Reproduction steps** -- any steps the reporter provided
+- **Environment clues** -- browser, OS, version, user role, data conditions
+- **Frequency** -- always reproducible, intermittent, or one-time
+
+If the issue lacks reproduction steps or is ambiguous, note what is missing -- this shapes the investigation strategy.
+
+## Phase 2: Hypothesize
+
+Before running anything, form theories about the root cause. This focuses the investigation and prevents aimless exploration.
+
+### Search for relevant code
+
+Use the native content-search tool (e.g., Grep in Claude Code) to find code paths related to the reported symptoms. Search for:
+
+- Error messages or strings mentioned in the issue
+- Feature names, route paths, or UI labels described in the report
+- Related model/service/controller names
+
+### Form hypotheses
+
+Based on the issue details and code search results, write down 2-3 plausible hypotheses. Each should identify:
+
+- **What** might be wrong (e.g., "race condition in session refresh", "nil check missing on optional field")
+- **Where** in the codebase (specific files and line ranges)
+- **Why** it would produce the reported symptoms
+
+Rank hypotheses by likelihood. Start investigating the most likely one first.
+
+## Phase 3: Reproduce
+
+Attempt to trigger the bug. The reproduction strategy depends on the bug type.
+
+### Route A: Test-based reproduction (backend, logic, data bugs)
+
+Write or find an existing test that exercises the suspected code path:
+
+1. Search for existing test files covering the affected code using the native file-search tool (e.g., Glob in Claude Code)
+2. Run existing tests to see if any already fail
+3. If no test covers the scenario, write a minimal failing test that demonstrates the reported behavior
+4. A failing test that matches the reported symptoms confirms the bug
+
+### Route B: Browser-based reproduction (UI, visual, interaction bugs)
+
+Use the `agent-browser` CLI for browser automation. Do not use any alternative browser MCP integration or built-in browser-control tool. See the `agent-browser` skill for setup and detailed CLI usage.
+
+#### Verify server is running
+
+```bash
+agent-browser open http://localhost:${PORT:-3000}
+agent-browser snapshot -i
```
-### Step 3: Capture Screenshots
+If the server is not running, ask the user to start their development server and provide the correct port.
-Take screenshots at each step of reproducing the bug:
+To detect the correct port, check project instruction files (`AGENTS.md`, `CLAUDE.md`) for port references, then `package.json` dev scripts, then `.env` files, falling back to `3000`.
-```
-mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-step-1.png" })
+#### Follow reproduction steps
+
+Navigate to the affected area and execute the steps from the issue:
+
+```bash
+agent-browser open "http://localhost:${PORT}/[affected_route]"
+agent-browser snapshot -i
```
-### Step 4: Follow User Flow
+Use `agent-browser` commands to interact with the page:
+- `agent-browser click @ref` -- click elements
+- `agent-browser fill @ref "text"` -- fill form fields
+- `agent-browser snapshot -i` -- capture current state
+- `agent-browser screenshot bug-evidence.png` -- save visual evidence
-Reproduce the exact steps from the issue:
+#### Capture the bug state
-1. **Read the issue's reproduction steps**
-2. **Execute each step using Playwright:**
- - `browser_click` for clicking elements
- - `browser_type` for filling forms
- - `browser_snapshot` to see the current state
- - `browser_take_screenshot` to capture evidence
+When the bug is reproduced:
+1. Take a screenshot of the error state
+2. Check for console errors: look at browser output and any visible error messages
+3. Record the exact sequence of steps that triggered it
-3. **Check for console errors:**
- ```
- mcp__plugin_compound-engineering_pw__browser_console_messages({ level: "error" })
- ```
+### Route C: Manual / environment-specific reproduction
-### Step 5: Capture Bug State
+For bugs that require specific data conditions, user roles, external service state, or cannot be automated:
-When you reproduce the bug:
+1. Document what conditions are needed
+2. Ask the user (using the platform's question tool -- e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini -- or present options and wait for a reply) whether they can set up the required conditions
+3. Guide them through manual reproduction steps if needed
-1. Take a screenshot of the bug state
-2. Capture console errors
-3. Document the exact steps that triggered it
+### If reproduction fails
+
+If the bug cannot be reproduced after trying the most likely hypotheses:
+
+1. Revisit the remaining hypotheses
+2. Check if the bug is environment-specific (version, OS, browser, data-dependent)
+3. Search the codebase for recent changes to the affected area: `git log --oneline -20 -- [affected_files]`
+4. Document what was tried and what conditions might be missing
+
+## Phase 4: Investigate
+
+Dig deeper into the root cause using whatever observability the project offers.
+
+### Check logs and traces
+
+Search for errors, warnings, or unexpected behavior around the time of reproduction. What to check depends on the bug and what the project has available:
+
+- **Application logs** -- search local log output (dev server stdout, log files) for error patterns, stack traces, or warnings using the native content-search tool
+- **Error tracking** -- check for related exceptions in the project's error tracker (Sentry, AppSignal, Bugsnag, Datadog, etc.)
+- **Browser console** -- for UI bugs, check developer console output for JavaScript errors, failed network requests, or CORS issues
+- **Database state** -- if the bug involves data, inspect relevant records for unexpected values, missing associations, or constraint violations
+- **Request/response cycle** -- check server logs for the specific request: status codes, params, timing, middleware behavior
+
+### Trace the code path
+
+Starting from the entry point identified in Phase 2, trace the execution path:
+
+1. Read the relevant source files using the native file-read tool
+2. Identify where the behavior diverges from expectations
+3. Check edge cases: nil/null values, empty collections, boundary conditions, race conditions
+4. Look for recent changes that may have introduced the bug: `git log --oneline -10 -- [file]`
+
+## Phase 5: Document Findings
+
+Summarize everything discovered during the investigation.
+
+### Compile the report
+
+Organize findings into:
+
+1. **Root cause** -- what is actually wrong and where (with file paths and line numbers, e.g., `app/services/example_service.rb:42`)
+2. **Reproduction steps** -- verified steps to trigger the bug (mark as confirmed or unconfirmed)
+3. **Evidence** -- screenshots, test output, log excerpts, console errors
+4. **Suggested fix** -- if a fix is apparent, describe it with the specific code changes needed
+5. **Open questions** -- anything still unclear or needing further investigation
+
+### Present to user before any external action
+
+Present the full report to the user. Do not post comments to the GitHub issue or take any external action without explicit confirmation.
+
+Ask the user (using the platform's question tool, or present options and wait):
```
-mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-reproduced.png" })
+Investigation complete. How to proceed?
+
+1. Post findings to the issue as a comment
+2. Start working on a fix
+3. Just review the findings (no external action)
```
-## Phase 3: Document Findings
+If the user chooses to post to the issue:
-**Reference Collection:**
+```bash
+gh issue comment $ARGUMENTS --body "$(cat <<'EOF'
+## Bug Investigation
-- [ ] Document all research findings with specific file paths (e.g., `app/services/example_service.rb:42`)
-- [ ] Include screenshots showing the bug reproduction
-- [ ] List console errors if any
-- [ ] Document the exact reproduction steps
+**Root Cause:** [summary]
-## Phase 4: Report Back
+**Reproduction Steps (verified):**
+1. [step]
+2. [step]
-Add a comment to the issue with:
+**Relevant Code:** [file:line references]
-1. **Findings** - What you discovered about the cause
-2. **Reproduction Steps** - Exact steps to reproduce (verified)
-3. **Screenshots** - Visual evidence of the bug (upload captured screenshots)
-4. **Relevant Code** - File paths and line numbers
-5. **Suggested Fix** - If you have one
+**Suggested Fix:** [description if applicable]
+EOF
+)"
+```
diff --git a/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md b/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md
index e040fba..d7f18c1 100644
--- a/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md
+++ b/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md
@@ -12,7 +12,7 @@ Resolve all unresolved PR review comments by spawning parallel agents for each t
## Context Detection
-Claude Code automatically detects git context:
+Detect git context from the current working directory:
- Current branch and associated PR
- All PR comments and review threads
- Works with any PR by specifying the number
@@ -21,10 +21,10 @@ Claude Code automatically detects git context:
### 1. Analyze
-Fetch unresolved review threads using the GraphQL script:
+Fetch unresolved review threads using the GraphQL script at [scripts/get-pr-comments](scripts/get-pr-comments):
```bash
-bash ${CLAUDE_PLUGIN_ROOT}/skills/resolve-pr-parallel/scripts/get-pr-comments PR_NUMBER
+bash scripts/get-pr-comments PR_NUMBER
```
This returns only **unresolved, non-outdated** threads with file paths, line numbers, and comment bodies.
@@ -37,7 +37,7 @@ gh api repos/{owner}/{repo}/pulls/PR_NUMBER/comments
### 2. Plan
-Create a TodoWrite list of all unresolved items grouped by type:
+Create a task list of all unresolved items grouped by type (e.g., `TaskCreate` in Claude Code, `update_plan` in Codex):
- Code changes requested
- Questions to answer
- Style/convention fixes
@@ -45,23 +45,27 @@ Create a TodoWrite list of all unresolved items grouped by type:
### 3. Implement (PARALLEL)
-Spawn a `pr-comment-resolver` agent for each unresolved item in parallel.
+Spawn a `compound-engineering:workflow:pr-comment-resolver` agent for each unresolved item.
-If there are 3 comments, spawn 3 agents:
+If there are 3 comments, spawn 3 agents — one per comment. Prefer running all agents in parallel; if the platform does not support parallel dispatch, run them sequentially.
-1. Task pr-comment-resolver(comment1)
-2. Task pr-comment-resolver(comment2)
-3. Task pr-comment-resolver(comment3)
+Keep parent-context pressure bounded:
+- If there are 1-4 unresolved items, direct parallel returns are fine
+- If there are 5+ unresolved items, launch in batches of at most 4 agents at a time
+- Require each resolver agent to return a short status summary to the parent: comment/thread handled, files changed, tests run or skipped, any blocker that still needs human attention, and for question-only threads the substantive reply text so the parent can post or verify it
-Always run all in parallel subagents/Tasks for each Todo item.
+If the PR is large enough that even batched short returns are likely to get noisy, use a per-run scratch directory such as `.context/compound-engineering/resolve-pr-parallel//`:
+- Have each resolver write a compact artifact for its thread there
+- Return only a completion summary to the parent
+- Re-read only the artifacts that are needed to resolve threads, answer reviewer questions, or summarize the batch
### 4. Commit & Resolve
- Commit changes with a clear message referencing the PR feedback
-- Resolve each thread programmatically:
+- Resolve each thread programmatically using [scripts/resolve-pr-thread](scripts/resolve-pr-thread):
```bash
-bash ${CLAUDE_PLUGIN_ROOT}/skills/resolve-pr-parallel/scripts/resolve-pr-thread THREAD_ID
+bash scripts/resolve-pr-thread THREAD_ID
```
- Push to remote
@@ -71,11 +75,13 @@ bash ${CLAUDE_PLUGIN_ROOT}/skills/resolve-pr-parallel/scripts/resolve-pr-thread
Re-fetch comments to confirm all threads are resolved:
```bash
-bash ${CLAUDE_PLUGIN_ROOT}/skills/resolve-pr-parallel/scripts/get-pr-comments PR_NUMBER
+bash scripts/get-pr-comments PR_NUMBER
```
Should return an empty array `[]`. If threads remain, repeat from step 1.
+If a scratch directory was used and the user did not ask to inspect it, clean it up after verification succeeds.
+
## Scripts
- [scripts/get-pr-comments](scripts/get-pr-comments) - GraphQL query for unresolved review threads
diff --git a/plugins/compound-engineering/skills/resolve_parallel/SKILL.md b/plugins/compound-engineering/skills/resolve_parallel/SKILL.md
deleted file mode 100644
index 33a3e2f..0000000
--- a/plugins/compound-engineering/skills/resolve_parallel/SKILL.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-name: resolve_parallel
-description: Resolve all TODO comments using parallel processing
-argument-hint: "[optional: specific TODO pattern or file]"
-disable-model-invocation: true
----
-
-Resolve all TODO comments using parallel processing.
-
-## Workflow
-
-### 1. Analyze
-
-Gather the things todo from above.
-
-### 2. Plan
-
-Create a TodoWrite list of all unresolved items grouped by type.Make sure to look at dependencies that might occur and prioritize the ones needed by others. For example, if you need to change a name, you must wait to do the others. Output a mermaid flow diagram showing how we can do this. Can we do everything in parallel? Do we need to do one first that leads to others in parallel? I'll put the to-dos in the mermaid diagram flow‑wise so the agent knows how to proceed in order.
-
-### 3. Implement (PARALLEL)
-
-Spawn a pr-comment-resolver agent for each unresolved item in parallel.
-
-So if there are 3 comments, it will spawn 3 pr-comment-resolver agents in parallel. liek this
-
-1. Task pr-comment-resolver(comment1)
-2. Task pr-comment-resolver(comment2)
-3. Task pr-comment-resolver(comment3)
-
-Always run all in parallel subagents/Tasks for each Todo item.
-
-### 4. Commit & Resolve
-
-- Commit changes
-- Push to remote
diff --git a/plugins/compound-engineering/skills/resolve_todo_parallel/SKILL.md b/plugins/compound-engineering/skills/resolve_todo_parallel/SKILL.md
deleted file mode 100644
index 86b6a7a..0000000
--- a/plugins/compound-engineering/skills/resolve_todo_parallel/SKILL.md
+++ /dev/null
@@ -1,39 +0,0 @@
----
-name: resolve_todo_parallel
-description: Resolve all pending CLI todos using parallel processing
-argument-hint: "[optional: specific todo ID or pattern]"
----
-
-Resolve all TODO comments using parallel processing.
-
-## Workflow
-
-### 1. Analyze
-
-Get all unresolved TODOs from the /todos/\*.md directory
-
-If any todo recommends deleting, removing, or gitignoring files in `docs/plans/` or `docs/solutions/`, skip it and mark it as `wont_fix`. These are compound-engineering pipeline artifacts that are intentional and permanent.
-
-### 2. Plan
-
-Create a TodoWrite list of all unresolved items grouped by type.Make sure to look at dependencies that might occur and prioritize the ones needed by others. For example, if you need to change a name, you must wait to do the others. Output a mermaid flow diagram showing how we can do this. Can we do everything in parallel? Do we need to do one first that leads to others in parallel? I'll put the to-dos in the mermaid diagram flow‑wise so the agent knows how to proceed in order.
-
-### 3. Implement (PARALLEL)
-
-**IMPORTANT: Do NOT create worktrees per todo item.** A worktree or branch was already set up before this command was invoked (typically by `/ce:work`). If a worktree path was provided in the original prompt, `cd` into it. Otherwise, find the worktree where the working branch is checked out using `git worktree list`. All agents work in that single checkout — never pass `isolation: "worktree"` when spawning agents.
-
-Spawn a pr-comment-resolver agent for each unresolved item in parallel.
-
-So if there are 3 comments, it will spawn 3 pr-comment-resolver agents in parallel. Like this:
-
-1. Task pr-comment-resolver(comment1)
-2. Task pr-comment-resolver(comment2)
-3. Task pr-comment-resolver(comment3)
-
-Always run all in parallel subagents/Tasks for each Todo item.
-
-### 4. Commit & Resolve
-
-- Commit changes
-- Remove the TODO from the file, and mark it as resolved.
-- Push to remote
diff --git a/plugins/compound-engineering/skills/setup/SKILL.md b/plugins/compound-engineering/skills/setup/SKILL.md
index 73fc0fb..189995f 100644
--- a/plugins/compound-engineering/skills/setup/SKILL.md
+++ b/plugins/compound-engineering/skills/setup/SKILL.md
@@ -8,26 +8,20 @@ disable-model-invocation: true
## Interaction Method
-If `AskUserQuestion` is available, use it for all prompts below.
+Ask the user each question below using the platform's blocking question tool (e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no structured question tool is available, present each question as a numbered list and wait for a reply before proceeding. For multiSelect questions, accept comma-separated numbers (e.g. `1, 3`). Never skip or auto-configure.
-If not, present each question as a numbered list and wait for a reply before proceeding to the next step. For multiSelect questions, accept comma-separated numbers (e.g. `1, 3`). Never skip or auto-configure.
-
-Interactive setup for `compound-engineering.local.md` — configures which agents run during `/ce:review` and `/ce:work`.
+Interactive setup for `compound-engineering.local.md` — configures which agents run during `ce:review` and `ce:work`.
## Step 1: Check Existing Config
-Read `compound-engineering.local.md` in the project root. If it exists, display current settings summary and use AskUserQuestion:
+Read `compound-engineering.local.md` in the project root. If it exists, display current settings and ask:
```
-question: "Settings file already exists. What would you like to do?"
-header: "Config"
-options:
- - label: "Reconfigure"
- description: "Run the interactive setup again from scratch"
- - label: "View current"
- description: "Show the file contents, then stop"
- - label: "Cancel"
- description: "Keep current settings"
+Settings file already exists. What would you like to do?
+
+1. Reconfigure - Run the interactive setup again from scratch
+2. View current - Show the file contents, then stop
+3. Cancel - Keep current settings
```
If "View current": read and display the file, then stop.
@@ -47,16 +41,13 @@ test -f requirements.txt && echo "python" || \
echo "general"
```
-Use AskUserQuestion:
+Ask:
```
-question: "Detected {type} project. How would you like to configure?"
-header: "Setup"
-options:
- - label: "Auto-configure (Recommended)"
- description: "Use smart defaults for {type}. Done in one click."
- - label: "Customize"
- description: "Choose stack, focus areas, and review depth."
+Detected {type} project. How would you like to configure?
+
+1. Auto-configure (Recommended) - Use smart defaults for {type}. Done in one click.
+2. Customize - Choose stack, focus areas, and review depth.
```
### If Auto-configure → Skip to Step 4 with defaults:
@@ -73,50 +64,35 @@ options:
**a. Stack** — confirm or override:
```
-question: "Which stack should we optimize for?"
-header: "Stack"
-options:
- - label: "{detected_type} (Recommended)"
- description: "Auto-detected from project files"
- - label: "Rails"
- description: "Ruby on Rails — adds DHH-style and Rails-specific reviewers"
- - label: "Python"
- description: "Python — adds Pythonic pattern reviewer"
- - label: "TypeScript"
- description: "TypeScript — adds type safety reviewer"
+Which stack should we optimize for?
+
+1. {detected_type} (Recommended) - Auto-detected from project files
+2. Rails - Ruby on Rails, adds DHH-style and Rails-specific reviewers
+3. Python - Adds Pythonic pattern reviewer
+4. TypeScript - Adds type safety reviewer
```
Only show options that differ from the detected type.
-**b. Focus areas** — multiSelect:
+**b. Focus areas** — multiSelect (user picks one or more):
```
-question: "Which review areas matter most?"
-header: "Focus"
-multiSelect: true
-options:
- - label: "Security"
- description: "Vulnerability scanning, auth, input validation (security-sentinel)"
- - label: "Performance"
- description: "N+1 queries, memory leaks, complexity (performance-oracle)"
- - label: "Architecture"
- description: "Design patterns, SOLID, separation of concerns (architecture-strategist)"
- - label: "Code simplicity"
- description: "Over-engineering, YAGNI violations (code-simplicity-reviewer)"
+Which review areas matter most? (comma-separated, e.g. 1, 3)
+
+1. Security - Vulnerability scanning, auth, input validation (security-sentinel)
+2. Performance - N+1 queries, memory leaks, complexity (performance-oracle)
+3. Architecture - Design patterns, SOLID, separation of concerns (architecture-strategist)
+4. Code simplicity - Over-engineering, YAGNI violations (code-simplicity-reviewer)
```
**c. Depth:**
```
-question: "How thorough should reviews be?"
-header: "Depth"
-options:
- - label: "Thorough (Recommended)"
- description: "Stack reviewers + all selected focus agents."
- - label: "Fast"
- description: "Stack reviewers + code simplicity only. Less context, quicker."
- - label: "Comprehensive"
- description: "All above + git history, data integrity, agent-native checks."
+How thorough should reviews be?
+
+1. Thorough (Recommended) - Stack reviewers + all selected focus agents.
+2. Fast - Stack reviewers + code simplicity only. Less context, quicker.
+3. Comprehensive - All above + git history, data integrity, agent-native checks.
```
## Step 4: Build Agent List and Write File
@@ -151,7 +127,7 @@ plan_review_agents: [{computed plan agent list}]
# Review Context
Add project-specific review instructions here.
-These notes are passed to all review agents during /ce:review and /ce:work.
+These notes are passed to all review agents during ce:review and ce:work.
Examples:
- "We use Turbo Frames heavily — check for frame-busting issues"
diff --git a/plugins/compound-engineering/skills/slfg/SKILL.md b/plugins/compound-engineering/skills/slfg/SKILL.md
index 32d2e76..453727a 100644
--- a/plugins/compound-engineering/skills/slfg/SKILL.md
+++ b/plugins/compound-engineering/skills/slfg/SKILL.md
@@ -9,24 +9,31 @@ Swarm-enabled LFG. Run these steps in order, parallelizing where indicated. Do n
## Sequential Phase
-1. **Optional:** If the `ralph-wiggum` skill is available, run `/ralph-wiggum:ralph-loop "finish all slash commands" --completion-promise "DONE"`. If not available or it fails, skip and continue to step 2 immediately.
+1. **Optional:** If the `ralph-loop` skill is available, run `/ralph-loop:ralph-loop "finish all slash commands" --completion-promise "DONE"`. If not available or it fails, skip and continue to step 2 immediately.
2. `/ce:plan $ARGUMENTS`
-3. `/compound-engineering:deepen-plan`
+3. **Conditionally** run `/compound-engineering:deepen-plan`
+ - Run the `deepen-plan` workflow only if the plan is `Standard` or `Deep`, touches a high-risk area (auth, security, payments, migrations, external APIs, significant rollout concerns), or still has obvious confidence gaps in decisions, sequencing, system-wide impact, risks, or verification
+ - If you run the `deepen-plan` workflow, confirm the plan was deepened or explicitly judged sufficiently grounded before moving on
+ - If you skip it, note why and continue to step 4
4. `/ce:work` — **Use swarm mode**: Make a Task list and launch an army of agent swarm subagents to build the plan
## Parallel Phase
After work completes, launch steps 5 and 6 as **parallel swarm agents** (both only need code to be written):
-5. `/ce:review` — spawn as background Task agent
+5. `/ce:review mode:report-only` — spawn as background Task agent
6. `/compound-engineering:test-browser` — spawn as background Task agent
Wait for both to complete before continuing.
+## Autofix Phase
+
+7. `/ce:review mode:autofix` — run sequentially after the parallel phase so it can safely mutate the checkout, apply `safe_auto` fixes, and emit residual todos for step 8
+
## Finalize Phase
-7. `/compound-engineering:resolve_todo_parallel` — resolve any findings from the review
-8. `/compound-engineering:feature-video` — record the final walkthrough and add to PR
-9. Output `DONE` when video is in PR
+8. `/compound-engineering:todo-resolve` — resolve findings, compound on learnings, clean up completed todos
+9. `/compound-engineering:feature-video` — record the final walkthrough and add to PR
+10. Output `DONE` when video is in PR
Start with step 1 now.
diff --git a/plugins/compound-engineering/skills/test-browser/SKILL.md b/plugins/compound-engineering/skills/test-browser/SKILL.md
index f9f46e3..a1d0675 100644
--- a/plugins/compound-engineering/skills/test-browser/SKILL.md
+++ b/plugins/compound-engineering/skills/test-browser/SKILL.md
@@ -4,56 +4,45 @@ description: Run browser tests on pages affected by current PR or branch
argument-hint: "[PR number, branch name, 'current', or --port PORT]"
---
-# Browser Test Command
+# Browser Test Skill
-Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.
+Run end-to-end browser tests on pages affected by a PR or branch changes using the `agent-browser` CLI.
-## CRITICAL: Use agent-browser CLI Only
+## Use `agent-browser` Only For Browser Automation
-**DO NOT use Chrome MCP tools (mcp__claude-in-chrome__*).**
+This workflow uses the `agent-browser` CLI exclusively. Do not use any alternative browser automation system, browser MCP integration, or built-in browser-control tool. If the platform offers multiple ways to control a browser, always choose `agent-browser`.
-This command uses the `agent-browser` CLI exclusively. The agent-browser CLI is a Bash-based tool from Vercel that runs headless Chromium. It is NOT the same as Chrome browser automation via MCP.
+Use `agent-browser` for: opening pages, clicking elements, filling forms, taking screenshots, and scraping rendered content.
-If you find yourself calling `mcp__claude-in-chrome__*` tools, STOP. Use `agent-browser` Bash commands instead.
-
-## Introduction
-
-QA Engineer specializing in browser-based end-to-end testing
-
-This command tests affected pages in a real browser, catching issues that unit tests miss:
-- JavaScript integration bugs
-- CSS/layout regressions
-- User workflow breakages
-- Console errors
+Platform-specific hints:
+- In Claude Code, do not use Chrome MCP tools (`mcp__claude-in-chrome__*`).
+- In Codex, do not substitute unrelated browsing tools.
## Prerequisites
-
- Local development server running (e.g., `bin/dev`, `rails server`, `npm run dev`)
-- agent-browser CLI installed (see Setup below)
+- `agent-browser` CLI installed (see Setup below)
- Git repository with changes to test
-
## Setup
-**Check installation:**
```bash
command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"
```
-**Install if needed:**
+Install if needed:
```bash
npm install -g agent-browser
-agent-browser install # Downloads Chromium (~160MB)
+agent-browser install
```
See the `agent-browser` skill for detailed usage.
-## Main Tasks
+## Workflow
-### 0. Verify agent-browser Installation
+### 1. Verify Installation
-Before starting ANY browser testing, verify agent-browser is installed:
+Before starting, verify `agent-browser` is available:
```bash
command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing..." && npm install -g agent-browser && agent-browser install)
@@ -61,27 +50,20 @@ command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing...
If installation fails, inform the user and stop.
-### 1. Ask Browser Mode
+### 2. Ask Browser Mode
-
+Ask the user whether to run headed or headless (using the platform's question tool — e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini — or present options and wait for a reply):
-Before starting tests, ask user if they want to watch the browser:
+```
+Do you want to watch the browser tests run?
-Use AskUserQuestion with:
-- Question: "Do you want to watch the browser tests run?"
-- Options:
- 1. **Headed (watch)** - Opens visible browser window so you can see tests run
- 2. **Headless (faster)** - Runs in background, faster but invisible
+1. Headed (watch) - Opens visible browser window so you can see tests run
+2. Headless (faster) - Runs in background, faster but invisible
+```
-Store the choice and use `--headed` flag when user selects "Headed".
+Store the choice and use the `--headed` flag when the user selects option 1.
-
-
-### 2. Determine Test Scope
-
- $ARGUMENTS
-
-
+### 3. Determine Test Scope
**If PR number provided:**
```bash
@@ -98,11 +80,7 @@ git diff --name-only main...HEAD
git diff --name-only main...[branch]
```
-
-
-### 3. Map Files to Routes
-
-
+### 4. Map Files to Routes
Map changed files to testable routes:
@@ -120,45 +98,23 @@ Map changed files to testable routes:
Build a list of URLs to test based on the mapping.
-
+### 5. Detect Dev Server Port
-### 4. Detect Dev Server Port
+Determine the dev server port using this priority:
-
-
-Determine the dev server port using this priority order:
-
-**Priority 1: Explicit argument**
-If the user passed a port number (e.g., `/test-browser 5000` or `/test-browser --port 5000`), use that port directly.
-
-**Priority 2: CLAUDE.md / project instructions**
-```bash
-# Check CLAUDE.md for port references
-grep -Eio '(port\s*[:=]\s*|localhost:)([0-9]{4,5})' CLAUDE.md 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1
-```
-
-**Priority 3: package.json scripts**
-```bash
-# Check dev/start scripts for --port flags
-grep -Eo '\-\-port[= ]+[0-9]{4,5}' package.json 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1
-```
-
-**Priority 4: Environment files**
-```bash
-# Check .env, .env.local, .env.development for PORT=
-grep -h '^PORT=' .env .env.local .env.development 2>/dev/null | tail -1 | cut -d= -f2
-```
-
-**Priority 5: Default fallback**
-If none of the above yields a port, default to `3000`.
-
-Store the result in a `PORT` variable for use in all subsequent steps.
+1. **Explicit argument** — if the user passed `--port 5000`, use that directly
+2. **Project instructions** — check `AGENTS.md`, `CLAUDE.md`, or other instruction files for port references
+3. **package.json** — check dev/start scripts for `--port` flags
+4. **Environment files** — check `.env`, `.env.local`, `.env.development` for `PORT=`
+5. **Default** — fall back to `3000`
```bash
-# Combined detection (run this)
PORT="${EXPLICIT_PORT:-}"
if [ -z "$PORT" ]; then
- PORT=$(grep -Eio '(port\s*[:=]\s*|localhost:)([0-9]{4,5})' CLAUDE.md 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1)
+ PORT=$(grep -Eio '(port\s*[:=]\s*|localhost:)([0-9]{4,5})' AGENTS.md 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1)
+ if [ -z "$PORT" ]; then
+ PORT=$(grep -Eio '(port\s*[:=]\s*|localhost:)([0-9]{4,5})' CLAUDE.md 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1)
+ fi
fi
if [ -z "$PORT" ]; then
PORT=$(grep -Eo '\-\-port[= ]+[0-9]{4,5}' package.json 2>/dev/null | grep -Eo '[0-9]{4,5}' | head -1)
@@ -170,77 +126,64 @@ PORT="${PORT:-3000}"
echo "Using dev server port: $PORT"
```
-
-
-### 5. Verify Server is Running
-
-
-
-Before testing, verify the local server is accessible using the detected port:
+### 6. Verify Server is Running
```bash
agent-browser open http://localhost:${PORT}
agent-browser snapshot -i
```
-If server is not running, inform user:
-```markdown
-**Server not running on port ${PORT}**
+If the server is not running, inform the user:
+
+```
+Server not running on port ${PORT}
Please start your development server:
- Rails: `bin/dev` or `rails server`
- Node/Next.js: `npm run dev`
-- Custom port: `/test-browser --port `
+- Custom port: run this skill again with `--port `
-Then run `/test-browser` again.
+Then re-run this skill.
```
-
+### 7. Test Each Affected Page
-### 6. Test Each Affected Page
+For each affected route:
-
-
-For each affected route, use agent-browser CLI commands (NOT Chrome MCP):
-
-**Step 1: Navigate and capture snapshot**
+**Navigate and capture snapshot:**
```bash
agent-browser open "http://localhost:${PORT}/[route]"
agent-browser snapshot -i
```
-**Step 2: For headed mode (visual debugging)**
+**For headed mode:**
```bash
agent-browser --headed open "http://localhost:${PORT}/[route]"
agent-browser --headed snapshot -i
```
-**Step 3: Verify key elements**
+**Verify key elements:**
- Use `agent-browser snapshot -i` to get interactive elements with refs
- Page title/heading present
- Primary content rendered
- No error messages visible
- Forms have expected fields
-**Step 4: Test critical interactions**
+**Test critical interactions:**
```bash
-agent-browser click @e1 # Use ref from snapshot
+agent-browser click @e1
agent-browser snapshot -i
```
-**Step 5: Take screenshots**
+**Take screenshots:**
```bash
agent-browser screenshot page-name.png
-agent-browser screenshot --full page-name-full.png # Full page
+agent-browser screenshot --full page-name-full.png
```
-
+### 8. Human Verification (When Required)
-### 7. Human Verification (When Required)
-
-
-
-Pause for human input when testing touches:
+Pause for human input when testing touches flows that require external interaction:
| Flow Type | What to Ask |
|-----------|-------------|
@@ -250,11 +193,12 @@ Pause for human input when testing touches:
| SMS | "Verify you received the SMS code" |
| External APIs | "Confirm the [service] integration is working" |
-Use AskUserQuestion:
-```markdown
-**Human Verification Needed**
+Ask the user (using the platform's question tool, or present numbered options and wait):
-This test touches the [flow type]. Please:
+```
+Human Verification Needed
+
+This test touches [flow type]. Please:
1. [Action to take]
2. [What to verify]
@@ -263,11 +207,7 @@ Did it work correctly?
2. No - describe the issue
```
-
-
-### 8. Handle Failures
-
-
+### 9. Handle Failures
When a test fails:
@@ -275,40 +215,27 @@ When a test fails:
- Screenshot the error state: `agent-browser screenshot error.png`
- Note the exact reproduction steps
-2. **Ask user how to proceed:**
- ```markdown
- **Test Failed: [route]**
+2. **Ask the user how to proceed:**
+
+ ```
+ Test Failed: [route]
Issue: [description]
Console errors: [if any]
How to proceed?
1. Fix now - I'll help debug and fix
- 2. Create todo - Add to todos/ for later
+ 2. Create todo - Add a todo for later (using the todo-create skill)
3. Skip - Continue testing other pages
```
-3. **If "Fix now":**
- - Investigate the issue
- - Propose a fix
- - Apply fix
- - Re-run the failing test
+3. **If "Fix now":** investigate, propose a fix, apply, re-run the failing test
+4. **If "Create todo":** load the `todo-create` skill and create a todo with priority p1 and description `browser-test-{description}`, continue
+5. **If "Skip":** log as skipped, continue
-4. **If "Create todo":**
- - Create `{id}-pending-p1-browser-test-{description}.md`
- - Continue testing
+### 10. Test Summary
-5. **If "Skip":**
- - Log as skipped
- - Continue testing
-
-
-
-### 9. Test Summary
-
-
-
-After all tests complete, present summary:
+After all tests complete, present a summary:
```markdown
## Browser Test Results
@@ -341,8 +268,6 @@ After all tests complete, present summary:
### Result: [PASS / FAIL / PARTIAL]
```
-
-
## Quick Usage Examples
```bash
@@ -361,8 +286,6 @@ After all tests complete, present summary:
## agent-browser CLI Reference
-**ALWAYS use these Bash commands. NEVER use mcp__claude-in-chrome__* tools.**
-
```bash
# Navigation
agent-browser open # Navigate to URL
diff --git a/plugins/compound-engineering/skills/test-xcode/SKILL.md b/plugins/compound-engineering/skills/test-xcode/SKILL.md
index 10cba1b..0c54813 100644
--- a/plugins/compound-engineering/skills/test-xcode/SKILL.md
+++ b/plugins/compound-engineering/skills/test-xcode/SKILL.md
@@ -5,167 +5,81 @@ argument-hint: "[scheme name or 'current' to use default]"
disable-model-invocation: true
---
-# Xcode Test Command
+# Xcode Test Skill
-Build, install, and test iOS apps on the simulator using XcodeBuildMCP. Captures screenshots, logs, and verifies app behavior.
-
-## Introduction
-
-iOS QA Engineer specializing in simulator-based testing
-
-This command tests iOS/macOS apps by:
-- Building for simulator
-- Installing and launching the app
-- Taking screenshots of key screens
-- Capturing console logs for errors
-- Supporting human verification for external flows
+Build, install, and test iOS apps on the simulator using XcodeBuildMCP. Captures screenshots, logs, and verifies app behavior.
## Prerequisites
-
- Xcode installed with command-line tools
-- XcodeBuildMCP server connected
+- XcodeBuildMCP MCP server connected
- Valid Xcode project or workspace
- At least one iOS Simulator available
-
-## Main Tasks
+## Workflow
-### 0. Verify XcodeBuildMCP is Installed
+### 0. Verify XcodeBuildMCP is Available
-
+Check that the XcodeBuildMCP MCP server is connected by calling its `list_simulators` tool.
-**First, check if XcodeBuildMCP tools are available.**
+MCP tool names vary by platform:
+- Claude Code: `mcp__xcodebuildmcp__list_simulators`
+- Other platforms: use the equivalent MCP tool call for the `XcodeBuildMCP` server's `list_simulators` method
+
+If the tool is not found or errors, inform the user they need to add the XcodeBuildMCP MCP server:
-Try calling:
```
-mcp__xcodebuildmcp__list_simulators({})
+XcodeBuildMCP not installed
+
+Install via Homebrew:
+ brew tap getsentry/xcodebuildmcp && brew install xcodebuildmcp
+
+Or via npx (no global install needed):
+ npx -y xcodebuildmcp@latest mcp
+
+Then add "XcodeBuildMCP" as an MCP server in your agent configuration
+and restart your agent.
```
-**If the tool is not found or errors:**
-
-Tell the user:
-```markdown
-**XcodeBuildMCP not installed**
-
-Please install the XcodeBuildMCP server first:
-
-\`\`\`bash
-claude mcp add XcodeBuildMCP -- npx xcodebuildmcp@latest
-\`\`\`
-
-Then restart Claude Code and run `/xcode-test` again.
-```
-
-**Do NOT proceed** until XcodeBuildMCP is confirmed working.
-
-
+Do NOT proceed until XcodeBuildMCP is confirmed working.
### 1. Discover Project and Scheme
-
+Call XcodeBuildMCP's `discover_projs` tool to find available projects, then `list_schemes` with the project path to get available schemes.
-**Find available projects:**
-```
-mcp__xcodebuildmcp__discover_projs({})
-```
-
-**List schemes for the project:**
-```
-mcp__xcodebuildmcp__list_schemes({ project_path: "/path/to/Project.xcodeproj" })
-```
-
-**If argument provided:**
-- Use the specified scheme name
-- Or "current" to use the default/last-used scheme
-
-
+If an argument was provided, use that scheme name. If "current", use the default/last-used scheme.
### 2. Boot Simulator
-
+Call `list_simulators` to find available simulators. Boot the preferred simulator (iPhone 15 Pro recommended) using `boot_simulator` with the simulator's UUID.
-**List available simulators:**
-```
-mcp__xcodebuildmcp__list_simulators({})
-```
-
-**Boot preferred simulator (iPhone 15 Pro recommended):**
-```
-mcp__xcodebuildmcp__boot_simulator({ simulator_id: "[uuid]" })
-```
-
-**Wait for simulator to be ready:**
-Check simulator state before proceeding with installation.
-
-
+Wait for the simulator to be ready before proceeding.
### 3. Build the App
-
+Call `build_ios_sim_app` with the project path and scheme name.
-**Build for iOS Simulator:**
-```
-mcp__xcodebuildmcp__build_ios_sim_app({
- project_path: "/path/to/Project.xcodeproj",
- scheme: "[scheme_name]"
-})
-```
-
-**Handle build failures:**
+**On failure:**
- Capture build errors
-- Create P1 todo for each build error
+- Create a P1 todo for each build error
- Report to user with specific error details
**On success:**
- Note the built app path for installation
-- Proceed to installation step
-
-
+- Proceed to step 4
### 4. Install and Launch
-
-
-**Install app on simulator:**
-```
-mcp__xcodebuildmcp__install_app_on_simulator({
- app_path: "/path/to/built/App.app",
- simulator_id: "[uuid]"
-})
-```
-
-**Launch the app:**
-```
-mcp__xcodebuildmcp__launch_app_on_simulator({
- bundle_id: "[app.bundle.id]",
- simulator_id: "[uuid]"
-})
-```
-
-**Start capturing logs:**
-```
-mcp__xcodebuildmcp__capture_sim_logs({
- simulator_id: "[uuid]",
- bundle_id: "[app.bundle.id]"
-})
-```
-
-
+1. Call `install_app_on_simulator` with the built app path and simulator UUID
+2. Call `launch_app_on_simulator` with the bundle ID and simulator UUID
+3. Call `capture_sim_logs` with the simulator UUID and bundle ID to start log capture
### 5. Test Key Screens
-
-
For each key screen in the app:
**Take screenshot:**
-```
-mcp__xcodebuildmcp__take_screenshot({
- simulator_id: "[uuid]",
- filename: "screen-[name].png"
-})
-```
+Call `take_screenshot` with the simulator UUID and a descriptive filename (e.g., `screen-home.png`).
**Review screenshot for:**
- UI elements rendered correctly
@@ -174,23 +88,15 @@ mcp__xcodebuildmcp__take_screenshot({
- Layout looks correct
**Check logs for errors:**
-```
-mcp__xcodebuildmcp__get_sim_logs({ simulator_id: "[uuid]" })
-```
-
-Look for:
+Call `get_sim_logs` with the simulator UUID. Look for:
- Crashes
- Exceptions
- Error-level log messages
- Failed network requests
-
-
### 6. Human Verification (When Required)
-
-
-Pause for human input when testing touches:
+Pause for human input when testing touches flows that require device interaction.
| Flow Type | What to Ask |
|-----------|-------------|
@@ -200,9 +106,10 @@ Pause for human input when testing touches:
| Camera/Photos | "Grant permissions and verify camera works" |
| Location | "Allow location access and verify map updates" |
-Use AskUserQuestion:
-```markdown
-**Human Verification Needed**
+Ask the user (using the platform's question tool — e.g., `AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini — or present numbered options and wait):
+
+```
+Human Verification Needed
This test requires [flow type]. Please:
1. [Action to take on simulator]
@@ -213,12 +120,8 @@ Did it work correctly?
2. No - describe the issue
```
-
-
### 7. Handle Failures
-
-
When a test fails:
1. **Document the failure:**
@@ -226,60 +129,52 @@ When a test fails:
- Capture console logs
- Note reproduction steps
-2. **Ask user how to proceed:**
- ```markdown
- **Test Failed: [screen/feature]**
+2. **Ask the user how to proceed:**
+
+ ```
+ Test Failed: [screen/feature]
Issue: [description]
Logs: [relevant error messages]
How to proceed?
1. Fix now - I'll help debug and fix
- 2. Create todo - Add to todos/ for later
+ 2. Create todo - Add a todo for later (using the todo-create skill)
3. Skip - Continue testing other screens
```
-3. **If "Fix now":**
- - Investigate the issue in code
- - Propose a fix
- - Rebuild and retest
-
-4. **If "Create todo":**
- - Create `{id}-pending-p1-xcode-{description}.md`
- - Continue testing
-
-
+3. **If "Fix now":** investigate, propose a fix, rebuild and retest
+4. **If "Create todo":** load the `todo-create` skill and create a todo with priority p1 and description `xcode-{description}`, continue
+5. **If "Skip":** log as skipped, continue
### 8. Test Summary
-
-
-After all tests complete, present summary:
+After all tests complete, present a summary:
```markdown
-## 📱 Xcode Test Results
+## Xcode Test Results
**Project:** [project name]
**Scheme:** [scheme name]
**Simulator:** [simulator name]
-### Build: ✅ Success / ❌ Failed
+### Build: Success / Failed
### Screens Tested: [count]
| Screen | Status | Notes |
|--------|--------|-------|
-| Launch | ✅ Pass | |
-| Home | ✅ Pass | |
-| Settings | ❌ Fail | Crash on tap |
-| Profile | ⏭️ Skip | Requires login |
+| Launch | Pass | |
+| Home | Pass | |
+| Settings | Fail | Crash on tap |
+| Profile | Skip | Requires login |
### Console Errors: [count]
- [List any errors found]
### Human Verifications: [count]
-- Sign in with Apple: ✅ Confirmed
-- Push notifications: ✅ Confirmed
+- Sign in with Apple: Confirmed
+- Push notifications: Confirmed
### Failures: [count]
- Settings screen - crash on navigation
@@ -290,43 +185,26 @@ After all tests complete, present summary:
### Result: [PASS / FAIL / PARTIAL]
```
-
-
### 9. Cleanup
-
-
After testing:
-**Stop log capture:**
-```
-mcp__xcodebuildmcp__stop_log_capture({ simulator_id: "[uuid]" })
-```
-
-**Optionally shut down simulator:**
-```
-mcp__xcodebuildmcp__shutdown_simulator({ simulator_id: "[uuid]" })
-```
-
-
+1. Call `stop_log_capture` with the simulator UUID
+2. Optionally call `shutdown_simulator` with the simulator UUID
## Quick Usage Examples
```bash
# Test with default scheme
-/xcode-test
+/test-xcode
# Test specific scheme
-/xcode-test MyApp-Debug
+/test-xcode MyApp-Debug
# Test after making changes
-/xcode-test current
+/test-xcode current
```
-## Integration with /ce:review
+## Integration with ce:review
-When reviewing PRs that touch iOS code, the `/ce:review` command can spawn this as a subagent:
-
-```
-Task general-purpose("Run /xcode-test for scheme [name]. Build, install on simulator, test key screens, check for crashes.")
-```
+When reviewing PRs that touch iOS code, the `ce:review` workflow can spawn an agent to run this skill, build on the simulator, test key screens, and check for crashes.
diff --git a/plugins/compound-engineering/skills/todo-create/SKILL.md b/plugins/compound-engineering/skills/todo-create/SKILL.md
new file mode 100644
index 0000000..ffb9a6d
--- /dev/null
+++ b/plugins/compound-engineering/skills/todo-create/SKILL.md
@@ -0,0 +1,110 @@
+---
+name: todo-create
+description: Use when creating durable work items, managing todo lifecycle, or tracking findings across sessions in the file-based todo system
+disable-model-invocation: true
+---
+
+# File-Based Todo Tracking
+
+## Overview
+
+The `.context/compound-engineering/todos/` directory is a file-based tracking system for code review feedback, technical debt, feature requests, and work items. Each todo is a markdown file with YAML frontmatter.
+
+> **Legacy support:** Always check both `.context/compound-engineering/todos/` (canonical) and `todos/` (legacy) when reading. Write new todos only to the canonical path. This directory has a multi-session lifecycle -- do not clean it up as scratch.
+
+## Directory Paths
+
+| Purpose | Path |
+|---------|------|
+| **Canonical (write here)** | `.context/compound-engineering/todos/` |
+| **Legacy (read-only)** | `todos/` |
+
+## File Naming Convention
+
+```
+{issue_id}-{status}-{priority}-{description}.md
+```
+
+- **issue_id**: Sequential number (001, 002, ...) -- never reused
+- **status**: `pending` | `ready` | `complete`
+- **priority**: `p1` (critical) | `p2` (important) | `p3` (nice-to-have)
+- **description**: kebab-case, brief
+
+**Example:** `002-ready-p1-fix-n-plus-1.md`
+
+## File Structure
+
+Each todo has YAML frontmatter and structured sections. Use the template at [todo-template.md](./assets/todo-template.md) when creating new todos.
+
+```yaml
+---
+status: ready
+priority: p1
+issue_id: "002"
+tags: [rails, performance]
+dependencies: ["001"] # Issue IDs this is blocked by
+---
+```
+
+**Required sections:** Problem Statement, Findings, Proposed Solutions, Recommended Action (filled during triage), Acceptance Criteria, Work Log.
+
+**Required for code review findings:** Assessment (Pressure Test) — verify the finding before acting on it.
+
+- **Assessment**: Clear & Correct | Unclear | Likely Incorrect | YAGNI
+- **Recommended Action**: Fix now | Clarify | Push back | Skip
+- **Verified**: Code, Tests, Usage, Prior Decisions (Yes/No with details)
+- **Technical Justification**: Why this finding is valid or should be skipped
+
+**Optional sections:** Technical Details, Resources, Notes.
+
+## Workflows
+
+> **Tool preference:** Use native file-search/glob and content-search tools instead of shell commands for finding and reading todo files. Shell only for operations with no native equivalent (`mv`, `mkdir -p`).
+
+### Creating a New Todo
+
+1. `mkdir -p .context/compound-engineering/todos/`
+2. Search both paths for `[0-9]*-*.md`, find the highest numeric prefix, increment, zero-pad to 3 digits.
+3. Read [todo-template.md](./assets/todo-template.md), write to canonical path as `{NEXT_ID}-pending-{priority}-{description}.md`.
+4. Fill Problem Statement, Findings, Proposed Solutions, Acceptance Criteria, and initial Work Log entry.
+5. Set status: `pending` (needs triage) or `ready` (pre-approved).
+
+**Create a todo when** the work needs more than ~15 minutes, has dependencies, requires planning, or needs prioritization. **Act immediately instead** when the fix is trivial, obvious, and self-contained.
+
+### Triaging Pending Items
+
+1. Glob `*-pending-*.md` in both paths.
+2. Review each todo's Problem Statement, Findings, and Proposed Solutions.
+3. Approve: rename `pending` -> `ready` in filename and frontmatter, fill Recommended Action.
+4. Defer: leave as `pending`.
+
+Load the `todo-triage` skill for an interactive approval workflow.
+
+### Managing Dependencies
+
+```yaml
+dependencies: ["002", "005"] # Blocked by these issues
+dependencies: [] # No blockers
+```
+
+To check blockers: search for `{dep_id}-complete-*.md` in both paths. Missing matches = incomplete blockers.
+
+### Completing a Todo
+
+1. Verify all acceptance criteria.
+2. Update Work Log with final session.
+3. Rename `ready` -> `complete` in filename and frontmatter.
+4. Check for unblocked work: search for files containing `dependencies:.*"{issue_id}"`.
+
+## Integration with Workflows
+
+| Trigger | Flow |
+|---------|------|
+| Code review | `/ce:review` -> Findings -> `/todo-triage` -> Todos |
+| Autonomous review | `/ce:review mode:autofix` -> Residual todos -> `/todo-resolve` |
+| Code TODOs | `/todo-resolve` -> Fixes + Complex todos |
+| Planning | Brainstorm -> Create todo -> Work -> Complete |
+
+## Key Distinction
+
+This skill manages **durable, cross-session work items** persisted as markdown files. For temporary in-session step tracking, use platform task tools (`TaskCreate`/`TaskUpdate` in Claude Code, `update_plan` in Codex) instead.
diff --git a/plugins/compound-engineering/skills/file-todos/assets/todo-template.md b/plugins/compound-engineering/skills/todo-create/assets/todo-template.md
similarity index 100%
rename from plugins/compound-engineering/skills/file-todos/assets/todo-template.md
rename to plugins/compound-engineering/skills/todo-create/assets/todo-template.md
diff --git a/plugins/compound-engineering/skills/todo-resolve/SKILL.md b/plugins/compound-engineering/skills/todo-resolve/SKILL.md
new file mode 100644
index 0000000..81f4b8c
--- /dev/null
+++ b/plugins/compound-engineering/skills/todo-resolve/SKILL.md
@@ -0,0 +1,70 @@
+---
+name: todo-resolve
+description: Use when batch-resolving approved todos, especially after code review or triage sessions
+argument-hint: "[optional: specific todo ID or pattern]"
+---
+
+Resolve approved todos using parallel processing, document lessons learned, then clean up.
+
+Only `ready` todos are resolved. `pending` todos are skipped — they haven't been triaged yet. If pending todos exist, list them at the end so the user knows what was left behind.
+
+## Workflow
+
+### 1. Analyze
+
+Scan `.context/compound-engineering/todos/*.md` and legacy `todos/*.md`. Partition by status:
+
+- **`ready`** (status field or `-ready-` in filename): resolve these.
+- **`pending`**: skip. Report them at the end.
+- **`complete`**: ignore, already done.
+
+If a specific todo ID or pattern was passed as an argument, filter to matching todos only (still must be `ready`).
+
+Residual actionable work from `ce:review mode:autofix` after its `safe_auto` pass will already be `ready`.
+
+Skip any todo that recommends deleting, removing, or gitignoring files in `docs/brainstorms/`, `docs/plans/`, or `docs/solutions/` — these are intentional pipeline artifacts.
+
+### 2. Plan
+
+Create a task list grouped by type (e.g., `TaskCreate` in Claude Code, `update_plan` in Codex). Analyze dependencies -- items that others depend on run first. Output a mermaid diagram showing execution order and parallelism.
+
+### 3. Implement (PARALLEL)
+
+**Do NOT create worktrees per todo item.** A worktree or branch was already set up before this skill was invoked (typically by `/ce:work`). All agents work in the existing single checkout — never pass `isolation: "worktree"` when spawning agents.
+
+Spawn a `compound-engineering:workflow:pr-comment-resolver` agent per item. Prefer parallel; fall back to sequential respecting dependency order.
+
+**Batching:** 1-4 items: direct parallel returns. 5+ items: batches of 4, each returning only a short status summary (todo handled, files changed, tests run/skipped, blockers).
+
+For large sets, use a scratch directory at `.context/compound-engineering/todo-resolve//` for per-resolver artifacts. Return only completion summaries to parent.
+
+### 4. Commit & Resolve
+
+Commit changes, mark todos resolved, push to remote.
+
+GATE: STOP. Verify todos resolved and changes committed before proceeding.
+
+### 5. Compound on Lessons Learned
+
+Load the `ce:compound` skill to document what was learned. Todo resolutions often surface patterns and architectural insights worth capturing.
+
+GATE: STOP. Verify the compound skill produced a solution document in `docs/solutions/`. If none (user declined or no learnings), continue.
+
+### 6. Clean Up
+
+Delete completed/resolved todo files from both paths. If a scratch directory was created at `.context/compound-engineering/todo-resolve//`, delete it (unless user asked to inspect).
+
+```
+Todos resolved: [count]
+Pending (skipped): [count, or "none"]
+Lessons documented: [path to solution doc, or "skipped"]
+Todos cleaned up: [count deleted]
+```
+
+If pending todos were skipped, list them:
+
+```
+Skipped pending todos (run /todo-triage to approve):
+ - 003-pending-p2-missing-index.md
+ - 005-pending-p3-rename-variable.md
+```
diff --git a/plugins/compound-engineering/skills/todo-triage/SKILL.md b/plugins/compound-engineering/skills/todo-triage/SKILL.md
new file mode 100644
index 0000000..a4fec55
--- /dev/null
+++ b/plugins/compound-engineering/skills/todo-triage/SKILL.md
@@ -0,0 +1,70 @@
+---
+name: todo-triage
+description: Use when reviewing pending todos for approval, prioritizing code review findings, or interactively categorizing work items
+argument-hint: "[findings list or source type]"
+disable-model-invocation: true
+---
+
+# Todo Triage
+
+Interactive workflow for reviewing pending todos one by one and deciding whether to approve, skip, or modify each.
+
+**Do not write code during triage.** This is purely for review and prioritization -- implementation happens in `/todo-resolve`.
+
+- First set the /model to Haiku
+- Read all pending todos from `.context/compound-engineering/todos/` and legacy `todos/` directories
+
+## Workflow
+
+### 1. Present Each Finding
+
+For each pending todo, present it clearly with severity, category, description, location, problem scenario, proposed solution, and effort estimate. Then ask:
+
+```
+Do you want to add this to the todo list?
+1. yes - approve and mark ready
+2. next - skip (deletes the todo file)
+3. custom - modify before approving
+```
+
+Use severity levels: 🔴 P1 (CRITICAL), 🟡 P2 (IMPORTANT), 🔵 P3 (NICE-TO-HAVE).
+
+Include progress tracking in each header: `Progress: 3/10 completed`
+
+### 2. Handle Decision
+
+**yes:** Rename file from `pending` -> `ready` in both filename and frontmatter. Fill the Recommended Action section. If creating a new todo (not updating existing), use the naming convention from the `todo-create` skill.
+
+Priority mapping: 🔴 P1 -> `p1`, 🟡 P2 -> `p2`, 🔵 P3 -> `p3`
+
+Confirm: "✅ Approved: `{filename}` (Issue #{issue_id}) - Status: **ready**"
+
+**next:** Delete the todo file. Log as skipped for the final summary.
+
+**custom:** Ask what to modify, update, re-present, ask again.
+
+### 3. Final Summary
+
+After all items processed:
+
+```markdown
+## Triage Complete
+
+**Total Items:** [X] | **Approved (ready):** [Y] | **Skipped:** [Z]
+
+### Approved Todos (Ready for Work):
+- `042-ready-p1-transaction-boundaries.md` - Transaction boundary issue
+
+### Skipped (Deleted):
+- Item #5: [reason]
+```
+
+### 4. Next Steps
+
+```markdown
+What would you like to do next?
+
+1. run /todo-resolve to resolve the todos
+2. commit the todos
+3. nothing, go chill
+```
diff --git a/plugins/compound-engineering/skills/triage/SKILL.md b/plugins/compound-engineering/skills/triage/SKILL.md
deleted file mode 100644
index 8262c02..0000000
--- a/plugins/compound-engineering/skills/triage/SKILL.md
+++ /dev/null
@@ -1,311 +0,0 @@
----
-name: triage
-description: Triage and categorize findings for the CLI todo system
-argument-hint: "[findings list or source type]"
-disable-model-invocation: true
----
-
-- First set the /model to Haiku
-- Then read all pending todos in the todos/ directory
-
-Present all findings, decisions, or issues here one by one for triage. The goal is to go through each item and decide whether to add it to the CLI todo system.
-
-**IMPORTANT: DO NOT CODE ANYTHING DURING TRIAGE!**
-
-This command is for:
-
-- Triaging code review findings
-- Processing security audit results
-- Reviewing performance analysis
-- Handling any other categorized findings that need tracking
-
-## Workflow
-
-### Step 1: Present Each Finding
-
-For each finding, present in this format:
-
-```
----
-Issue #X: [Brief Title]
-
-Severity: 🔴 P1 (CRITICAL) / 🟡 P2 (IMPORTANT) / 🔵 P3 (NICE-TO-HAVE)
-
-Category: [Security/Performance/Architecture/Bug/Feature/etc.]
-
-Description:
-[Detailed explanation of the issue or improvement]
-
-Location: [file_path:line_number]
-
-Problem Scenario:
-[Step by step what's wrong or could happen]
-
-Proposed Solution:
-[How to fix it]
-
-Estimated Effort: [Small (< 2 hours) / Medium (2-8 hours) / Large (> 8 hours)]
-
----
-Do you want to add this to the todo list?
-1. yes - create todo file
-2. next - skip this item
-3. custom - modify before creating
-```
-
-### Step 2: Handle User Decision
-
-**When user says "yes":**
-
-1. **Update existing todo file** (if it exists) or **Create new filename:**
-
- If todo already exists (from code review):
-
- - Rename file from `{id}-pending-{priority}-{desc}.md` → `{id}-ready-{priority}-{desc}.md`
- - Update YAML frontmatter: `status: pending` → `status: ready`
- - Keep issue_id, priority, and description unchanged
-
- If creating new todo:
-
- ```
- {next_id}-ready-{priority}-{brief-description}.md
- ```
-
- Priority mapping:
-
- - 🔴 P1 (CRITICAL) → `p1`
- - 🟡 P2 (IMPORTANT) → `p2`
- - 🔵 P3 (NICE-TO-HAVE) → `p3`
-
- Example: `042-ready-p1-transaction-boundaries.md`
-
-2. **Update YAML frontmatter:**
-
- ```yaml
- ---
- status: ready # IMPORTANT: Change from "pending" to "ready"
- priority: p1 # or p2, p3 based on severity
- issue_id: "042"
- tags: [category, relevant-tags]
- dependencies: []
- ---
- ```
-
-3. **Populate or update the file:**
-
- ```yaml
- # [Issue Title]
-
- ## Problem Statement
- [Description from finding]
-
- ## Findings
- - [Key discoveries]
- - Location: [file_path:line_number]
- - [Scenario details]
-
- ## Proposed Solutions
-
- ### Option 1: [Primary solution]
- - **Pros**: [Benefits]
- - **Cons**: [Drawbacks if any]
- - **Effort**: [Small/Medium/Large]
- - **Risk**: [Low/Medium/High]
-
- ## Recommended Action
- [Filled during triage - specific action plan]
-
- ## Technical Details
- - **Affected Files**: [List files]
- - **Related Components**: [Components affected]
- - **Database Changes**: [Yes/No - describe if yes]
-
- ## Resources
- - Original finding: [Source of this issue]
- - Related issues: [If any]
-
- ## Acceptance Criteria
- - [ ] [Specific success criteria]
- - [ ] Tests pass
- - [ ] Code reviewed
-
- ## Work Log
-
- ### {date} - Approved for Work
- **By:** Claude Triage System
- **Actions:**
- - Issue approved during triage session
- - Status changed from pending → ready
- - Ready to be picked up and worked on
-
- **Learnings:**
- - [Context and insights]
-
- ## Notes
- Source: Triage session on {date}
- ```
-
-4. **Confirm approval:** "✅ Approved: `{new_filename}` (Issue #{issue_id}) - Status: **ready** → Ready to work on"
-
-**When user says "next":**
-
-- **Delete the todo file** - Remove it from todos/ directory since it's not relevant
-- Skip to the next item
-- Track skipped items for summary
-
-**When user says "custom":**
-
-- Ask what to modify (priority, description, details)
-- Update the information
-- Present revised version
-- Ask again: yes/next/custom
-
-### Step 3: Continue Until All Processed
-
-- Process all items one by one
-- Track using TodoWrite for visibility
-- Don't wait for approval between items - keep moving
-
-### Step 4: Final Summary
-
-After all items processed:
-
-````markdown
-## Triage Complete
-
-**Total Items:** [X] **Todos Approved (ready):** [Y] **Skipped:** [Z]
-
-### Approved Todos (Ready for Work):
-
-- `042-ready-p1-transaction-boundaries.md` - Transaction boundary issue
-- `043-ready-p2-cache-optimization.md` - Cache performance improvement ...
-
-### Skipped Items (Deleted):
-
-- Item #5: [reason] - Removed from todos/
-- Item #12: [reason] - Removed from todos/
-
-### Summary of Changes Made:
-
-During triage, the following status updates occurred:
-
-- **Pending → Ready:** Filenames and frontmatter updated to reflect approved status
-- **Deleted:** Todo files for skipped findings removed from todos/ directory
-- Each approved file now has `status: ready` in YAML frontmatter
-
-### Next Steps:
-
-1. View approved todos ready for work:
- ```bash
- ls todos/*-ready-*.md
- ```
-````
-
-2. Start work on approved items:
-
- ```bash
- /resolve_todo_parallel # Work on multiple approved items efficiently
- ```
-
-3. Or pick individual items to work on
-
-4. As you work, update todo status:
- - Ready → In Progress (in your local context as you work)
- - In Progress → Complete (rename file: ready → complete, update frontmatter)
-
-```
-
-## Example Response Format
-
-```
-
----
-
-Issue #5: Missing Transaction Boundaries for Multi-Step Operations
-
-Severity: 🔴 P1 (CRITICAL)
-
-Category: Data Integrity / Security
-
-Description: The google_oauth2_connected callback in GoogleOauthCallbacks concern performs multiple database operations without transaction protection. If any step fails midway, the database is left in an inconsistent state.
-
-Location: app/controllers/concerns/google_oauth_callbacks.rb:13-50
-
-Problem Scenario:
-
-1. User.update succeeds (email changed)
-2. Account.save! fails (validation error)
-3. Result: User has changed email but no associated Account
-4. Next login attempt fails completely
-
-Operations Without Transaction:
-
-- User confirmation (line 13)
-- Waitlist removal (line 14)
-- User profile update (line 21-23)
-- Account creation (line 28-37)
-- Avatar attachment (line 39-45)
-- Journey creation (line 47)
-
-Proposed Solution: Wrap all operations in ApplicationRecord.transaction do ... end block
-
-Estimated Effort: Small (30 minutes)
-
----
-
-Do you want to add this to the todo list?
-
-1. yes - create todo file
-2. next - skip this item
-3. custom - modify before creating
-
-```
-
-## Important Implementation Details
-
-### Status Transitions During Triage
-
-**When "yes" is selected:**
-1. Rename file: `{id}-pending-{priority}-{desc}.md` → `{id}-ready-{priority}-{desc}.md`
-2. Update YAML frontmatter: `status: pending` → `status: ready`
-3. Update Work Log with triage approval entry
-4. Confirm: "✅ Approved: `{filename}` (Issue #{issue_id}) - Status: **ready**"
-
-**When "next" is selected:**
-1. Delete the todo file from todos/ directory
-2. Skip to next item
-3. No file remains in the system
-
-### Progress Tracking
-
-Every time you present a todo as a header, include:
-- **Progress:** X/Y completed (e.g., "3/10 completed")
-- **Estimated time remaining:** Based on how quickly you're progressing
-- **Pacing:** Monitor time per finding and adjust estimate accordingly
-
-Example:
-```
-
-Progress: 3/10 completed | Estimated time: ~2 minutes remaining
-
-```
-
-### Do Not Code During Triage
-
-- ✅ Present findings
-- ✅ Make yes/next/custom decisions
-- ✅ Update todo files (rename, frontmatter, work log)
-- ❌ Do NOT implement fixes or write code
-- ❌ Do NOT add detailed implementation details
-- ❌ That's for /resolve_todo_parallel phase
-```
-
-When done give these options
-
-```markdown
-What would you like to do next?
-
-1. run /resolve_todo_parallel to resolve the todos
-2. commit the todos
-3. nothing, go chill
-```
diff --git a/plugins/compound-engineering/skills/workflows-brainstorm/SKILL.md b/plugins/compound-engineering/skills/workflows-brainstorm/SKILL.md
deleted file mode 100644
index d421810..0000000
--- a/plugins/compound-engineering/skills/workflows-brainstorm/SKILL.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: workflows:brainstorm
-description: "[DEPRECATED] Use /ce:brainstorm instead — renamed for clarity."
-argument-hint: "[feature idea or problem to explore]"
-disable-model-invocation: true
----
-
-NOTE: /workflows:brainstorm is deprecated. Please use /ce:brainstorm instead. This alias will be removed in a future version.
-
-/ce:brainstorm $ARGUMENTS
diff --git a/plugins/compound-engineering/skills/workflows-compound/SKILL.md b/plugins/compound-engineering/skills/workflows-compound/SKILL.md
deleted file mode 100644
index aedbc9f..0000000
--- a/plugins/compound-engineering/skills/workflows-compound/SKILL.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: workflows:compound
-description: "[DEPRECATED] Use /ce:compound instead — renamed for clarity."
-argument-hint: "[optional: brief context about the fix]"
-disable-model-invocation: true
----
-
-NOTE: /workflows:compound is deprecated. Please use /ce:compound instead. This alias will be removed in a future version.
-
-/ce:compound $ARGUMENTS
diff --git a/plugins/compound-engineering/skills/workflows-plan/SKILL.md b/plugins/compound-engineering/skills/workflows-plan/SKILL.md
deleted file mode 100644
index d2407ea..0000000
--- a/plugins/compound-engineering/skills/workflows-plan/SKILL.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: workflows:plan
-description: "[DEPRECATED] Use /ce:plan instead — renamed for clarity."
-argument-hint: "[feature description, bug report, or improvement idea]"
-disable-model-invocation: true
----
-
-NOTE: /workflows:plan is deprecated. Please use /ce:plan instead. This alias will be removed in a future version.
-
-/ce:plan $ARGUMENTS
diff --git a/plugins/compound-engineering/skills/workflows-review/SKILL.md b/plugins/compound-engineering/skills/workflows-review/SKILL.md
deleted file mode 100644
index 7897e85..0000000
--- a/plugins/compound-engineering/skills/workflows-review/SKILL.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: workflows:review
-description: "[DEPRECATED] Use /ce:review instead — renamed for clarity."
-argument-hint: "[PR number, GitHub URL, branch name, or latest]"
-disable-model-invocation: true
----
-
-NOTE: /workflows:review is deprecated. Please use /ce:review instead. This alias will be removed in a future version.
-
-/ce:review $ARGUMENTS
diff --git a/plugins/compound-engineering/skills/workflows-work/SKILL.md b/plugins/compound-engineering/skills/workflows-work/SKILL.md
deleted file mode 100644
index 16b38d5..0000000
--- a/plugins/compound-engineering/skills/workflows-work/SKILL.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: workflows:work
-description: "[DEPRECATED] Use /ce:work instead — renamed for clarity."
-argument-hint: "[plan file, specification, or todo file path]"
-disable-model-invocation: true
----
-
-NOTE: /workflows:work is deprecated. Please use /ce:work instead. This alias will be removed in a future version.
-
-/ce:work $ARGUMENTS
diff --git a/scripts/release/preview.ts b/scripts/release/preview.ts
new file mode 100644
index 0000000..4cf9bb6
--- /dev/null
+++ b/scripts/release/preview.ts
@@ -0,0 +1,92 @@
+#!/usr/bin/env bun
+import { buildReleasePreview } from "../../src/release/components"
+import type { BumpOverride, ReleaseComponent } from "../../src/release/types"
+
+function parseArgs(argv: string[]): {
+ title: string
+ files: string[]
+ overrides: Partial>
+ json: boolean
+} {
+ let title = ""
+ const files: string[] = []
+ const overrides: Partial> = {}
+ let json = false
+
+ for (let index = 0; index < argv.length; index += 1) {
+ const arg = argv[index]
+ if (arg === "--title") {
+ title = argv[index + 1] ?? ""
+ index += 1
+ continue
+ }
+ if (arg === "--file") {
+ const file = argv[index + 1]
+ if (file) files.push(file)
+ index += 1
+ continue
+ }
+ if (arg === "--override") {
+ const raw = argv[index + 1] ?? ""
+ const [component, value] = raw.split("=")
+ if (component && value) {
+ overrides[component as ReleaseComponent] = value as BumpOverride
+ }
+ index += 1
+ continue
+ }
+ if (arg === "--json") {
+ json = true
+ }
+ }
+
+ return { title, files, overrides, json }
+}
+
+function formatPreview(preview: Awaited>): string {
+ const lines: string[] = []
+ lines.push(`Release intent: ${preview.intent.raw || "(missing title)"}`)
+ if (preview.intent.type) {
+ lines.push(
+ `Parsed as: type=${preview.intent.type}${preview.intent.scope ? `, scope=${preview.intent.scope}` : ""}${preview.intent.breaking ? ", breaking=true" : ""}`,
+ )
+ }
+
+ if (preview.warnings.length > 0) {
+ lines.push("", "Warnings:")
+ for (const warning of preview.warnings) {
+ lines.push(`- ${warning}`)
+ }
+ }
+
+ if (preview.components.length === 0) {
+ lines.push("", "No releasable components detected.")
+ return lines.join("\n")
+ }
+
+ lines.push("", "Components:")
+ for (const component of preview.components) {
+ lines.push(`- ${component.component}`)
+ lines.push(` current: ${component.currentVersion}`)
+ lines.push(` inferred bump: ${component.inferredBump ?? "none"}`)
+ lines.push(` override: ${component.override}`)
+ lines.push(` effective bump: ${component.effectiveBump ?? "none"}`)
+ lines.push(` next: ${component.nextVersion ?? "unchanged"}`)
+ lines.push(` files: ${component.files.join(", ")}`)
+ }
+
+ return lines.join("\n")
+}
+
+const args = parseArgs(process.argv.slice(2))
+const preview = await buildReleasePreview({
+ title: args.title,
+ files: args.files,
+ overrides: args.overrides,
+})
+
+if (args.json) {
+ console.log(JSON.stringify(preview, null, 2))
+} else {
+ console.log(formatPreview(preview))
+}
diff --git a/scripts/release/sync-metadata.ts b/scripts/release/sync-metadata.ts
new file mode 100644
index 0000000..6fc9c0b
--- /dev/null
+++ b/scripts/release/sync-metadata.ts
@@ -0,0 +1,24 @@
+#!/usr/bin/env bun
+import { syncReleaseMetadata } from "../../src/release/metadata"
+
+const write = process.argv.includes("--write")
+const versionArgs = process.argv
+ .slice(2)
+ .filter((arg) => arg.startsWith("--version:"))
+ .map((arg) => arg.replace("--version:", ""))
+
+const componentVersions = Object.fromEntries(
+ versionArgs.map((entry) => {
+ const [component, version] = entry.split("=")
+ return [component, version]
+ }),
+)
+
+const result = await syncReleaseMetadata({
+ componentVersions,
+ write,
+})
+
+for (const update of result.updates) {
+ console.log(`${update.changed ? "update" : "keep"} ${update.path}`)
+}
diff --git a/scripts/release/validate.ts b/scripts/release/validate.ts
new file mode 100644
index 0000000..25bcbf6
--- /dev/null
+++ b/scripts/release/validate.ts
@@ -0,0 +1,49 @@
+#!/usr/bin/env bun
+import path from "path"
+import { validateReleasePleaseConfig } from "../../src/release/config"
+import { getCompoundEngineeringCounts, syncReleaseMetadata } from "../../src/release/metadata"
+import { readJson } from "../../src/utils/files"
+
+type ReleasePleaseManifest = Record
+
+const releasePleaseConfig = await readJson<{ packages: Record }>(
+ path.join(process.cwd(), ".github", "release-please-config.json"),
+)
+const manifest = await readJson(
+ path.join(process.cwd(), ".github", ".release-please-manifest.json"),
+)
+const configErrors = validateReleasePleaseConfig(releasePleaseConfig)
+const counts = await getCompoundEngineeringCounts(process.cwd())
+const result = await syncReleaseMetadata({
+ write: false,
+ componentVersions: {
+ marketplace: manifest[".claude-plugin"],
+ "cursor-marketplace": manifest[".cursor-plugin"],
+ },
+})
+const changed = result.updates.filter((update) => update.changed)
+
+if (configErrors.length === 0 && changed.length === 0) {
+ console.log(
+ `Release metadata is in sync. compound-engineering currently has ${counts.agents} agents, ${counts.skills} skills, and ${counts.mcpServers} MCP server${counts.mcpServers === 1 ? "" : "s"}.`,
+ )
+ process.exit(0)
+}
+
+if (configErrors.length > 0) {
+ console.error("Release configuration errors detected:")
+ for (const error of configErrors) {
+ console.error(`- ${error}`)
+ }
+}
+
+if (changed.length > 0) {
+ console.error("Release metadata drift detected:")
+ for (const update of changed) {
+ console.error(`- ${update.path}`)
+ }
+ console.error(
+ `Current compound-engineering counts: ${counts.agents} agents, ${counts.skills} skills, ${counts.mcpServers} MCP server${counts.mcpServers === 1 ? "" : "s"}.`,
+ )
+}
+process.exit(1)
diff --git a/src/converters/claude-to-codex.ts b/src/converters/claude-to-codex.ts
index c98eedb..238ca19 100644
--- a/src/converters/claude-to-codex.ts
+++ b/src/converters/claude-to-codex.ts
@@ -1,7 +1,12 @@
import { formatFrontmatter } from "../utils/frontmatter"
-import type { ClaudeAgent, ClaudeCommand, ClaudePlugin } from "../types/claude"
+import type { ClaudeAgent, ClaudeCommand, ClaudePlugin, ClaudeSkill } from "../types/claude"
import type { CodexBundle, CodexGeneratedSkill } from "../types/codex"
import type { ClaudeToOpenCodeOptions } from "./claude-to-opencode"
+import {
+ normalizeCodexName,
+ transformContentForCodex,
+ type CodexInvocationTargets,
+} from "../utils/codex-content"
export type ClaudeToCodexOptions = ClaudeToOpenCodeOptions
@@ -11,42 +16,102 @@ export function convertClaudeToCodex(
plugin: ClaudePlugin,
_options: ClaudeToCodexOptions,
): CodexBundle {
- const promptNames = new Set()
- const skillDirs = plugin.skills.map((skill) => ({
+ const invocableCommands = plugin.commands.filter((command) => !command.disableModelInvocation)
+ const applyCompoundWorkflowModel = shouldApplyCompoundWorkflowModel(plugin)
+ const canonicalWorkflowSkills = applyCompoundWorkflowModel
+ ? plugin.skills.filter((skill) => isCanonicalCodexWorkflowSkill(skill.name))
+ : []
+ const deprecatedWorkflowAliases = applyCompoundWorkflowModel
+ ? plugin.skills.filter((skill) => isDeprecatedCodexWorkflowAlias(skill.name))
+ : []
+ const copiedSkills = applyCompoundWorkflowModel
+ ? plugin.skills.filter((skill) => !isDeprecatedCodexWorkflowAlias(skill.name))
+ : plugin.skills
+ const skillDirs = copiedSkills.map((skill) => ({
name: skill.name,
sourceDir: skill.sourceDir,
}))
+ const promptNames = new Set()
+ const usedSkillNames = new Set(skillDirs.map((skill) => normalizeCodexName(skill.name)))
+
+ const commandPromptNames = new Map()
+ for (const command of invocableCommands) {
+ commandPromptNames.set(
+ command.name,
+ uniqueName(normalizeCodexName(command.name), promptNames),
+ )
+ }
+
+ const workflowPromptNames = new Map()
+ for (const skill of canonicalWorkflowSkills) {
+ workflowPromptNames.set(
+ skill.name,
+ uniqueName(normalizeCodexName(skill.name), promptNames),
+ )
+ }
+
+ const promptTargets: Record = {}
+ for (const [commandName, promptName] of commandPromptNames) {
+ promptTargets[normalizeCodexName(commandName)] = promptName
+ }
+ for (const [skillName, promptName] of workflowPromptNames) {
+ promptTargets[normalizeCodexName(skillName)] = promptName
+ }
+ for (const alias of deprecatedWorkflowAliases) {
+ const canonicalName = toCanonicalWorkflowSkillName(alias.name)
+ const promptName = canonicalName ? workflowPromptNames.get(canonicalName) : undefined
+ if (promptName) {
+ promptTargets[normalizeCodexName(alias.name)] = promptName
+ }
+ }
+
+ const skillTargets: Record = {}
+ for (const skill of copiedSkills) {
+ if (applyCompoundWorkflowModel && isCanonicalCodexWorkflowSkill(skill.name)) continue
+ skillTargets[normalizeCodexName(skill.name)] = skill.name
+ }
+
+ const invocationTargets: CodexInvocationTargets = { promptTargets, skillTargets }
- const usedSkillNames = new Set(skillDirs.map((skill) => normalizeName(skill.name)))
const commandSkills: CodexGeneratedSkill[] = []
- const invocableCommands = plugin.commands.filter((command) => !command.disableModelInvocation)
const prompts = invocableCommands.map((command) => {
- const promptName = uniqueName(normalizeName(command.name), promptNames)
- const commandSkill = convertCommandSkill(command, usedSkillNames)
+ const promptName = commandPromptNames.get(command.name)!
+ const commandSkill = convertCommandSkill(command, usedSkillNames, invocationTargets)
commandSkills.push(commandSkill)
- const content = renderPrompt(command, commandSkill.name)
+ const content = renderPrompt(command, commandSkill.name, invocationTargets)
return { name: promptName, content }
})
+ const workflowPrompts = canonicalWorkflowSkills.map((skill) => ({
+ name: workflowPromptNames.get(skill.name)!,
+ content: renderWorkflowPrompt(skill),
+ }))
- const agentSkills = plugin.agents.map((agent) => convertAgent(agent, usedSkillNames))
+ const agentSkills = plugin.agents.map((agent) =>
+ convertAgent(agent, usedSkillNames, invocationTargets),
+ )
const generatedSkills = [...commandSkills, ...agentSkills]
return {
- prompts,
+ prompts: [...prompts, ...workflowPrompts],
skillDirs,
generatedSkills,
+ invocationTargets,
mcpServers: plugin.mcpServers,
}
}
-function convertAgent(agent: ClaudeAgent, usedNames: Set): CodexGeneratedSkill {
- const name = uniqueName(normalizeName(agent.name), usedNames)
+function convertAgent(
+ agent: ClaudeAgent,
+ usedNames: Set,
+ invocationTargets: CodexInvocationTargets,
+): CodexGeneratedSkill {
+ const name = uniqueName(normalizeCodexName(agent.name), usedNames)
const description = sanitizeDescription(
agent.description ?? `Converted from Claude agent ${agent.name}`,
)
const frontmatter: Record = { name, description }
- let body = transformContentForCodex(agent.body.trim())
+ let body = transformContentForCodex(agent.body.trim(), invocationTargets)
if (agent.capabilities && agent.capabilities.length > 0) {
const capabilities = agent.capabilities.map((capability) => `- ${capability}`).join("\n")
body = `## Capabilities\n${capabilities}\n\n${body}`.trim()
@@ -59,8 +124,12 @@ function convertAgent(agent: ClaudeAgent, usedNames: Set): CodexGenerate
return { name, content }
}
-function convertCommandSkill(command: ClaudeCommand, usedNames: Set): CodexGeneratedSkill {
- const name = uniqueName(normalizeName(command.name), usedNames)
+function convertCommandSkill(
+ command: ClaudeCommand,
+ usedNames: Set,
+ invocationTargets: CodexInvocationTargets,
+): CodexGeneratedSkill {
+ const name = uniqueName(normalizeCodexName(command.name), usedNames)
const frontmatter: Record = {
name,
description: sanitizeDescription(
@@ -74,95 +143,55 @@ function convertCommandSkill(command: ClaudeCommand, usedNames: Set): Co
if (command.allowedTools && command.allowedTools.length > 0) {
sections.push(`## Allowed tools\n${command.allowedTools.map((tool) => `- ${tool}`).join("\n")}`)
}
- // Transform Task agent calls to Codex skill references
- const transformedBody = transformTaskCalls(command.body.trim())
+ const transformedBody = transformContentForCodex(command.body.trim(), invocationTargets)
sections.push(transformedBody)
const body = sections.filter(Boolean).join("\n\n").trim()
const content = formatFrontmatter(frontmatter, body.length > 0 ? body : command.body)
return { name, content }
}
-/**
- * Transform Claude Code content to Codex-compatible content.
- *
- * Handles multiple syntax differences:
- * 1. Task agent calls: Task agent-name(args) → Use the $agent-name skill to: args
- * 2. Slash commands: /command-name → /prompts:command-name
- * 3. Agent references: @agent-name → $agent-name skill
- *
- * This bridges the gap since Claude Code and Codex have different syntax
- * for invoking commands, agents, and skills.
- */
-function transformContentForCodex(body: string): string {
- let result = body
-
- // 1. Transform Task agent calls
- // Match: Task repo-research-analyst(feature_description)
- // Match: - Task learnings-researcher(args)
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
- result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- const skillName = normalizeName(agentName)
- const trimmedArgs = args.trim()
- return `${prefix}Use the $${skillName} skill to: ${trimmedArgs}`
- })
-
- // 2. Transform slash command references
- // Match: /command-name or /workflows:command but NOT /path/to/file or URLs
- // Look for slash commands in contexts like "Run /command", "use /command", etc.
- // Avoid matching file paths (contain multiple slashes) or URLs (contain ://)
- const slashCommandPattern = /(? {
- // Skip if it looks like a file path (contains /)
- if (commandName.includes('/')) return match
- // Skip common non-command patterns
- if (['dev', 'tmp', 'etc', 'usr', 'var', 'bin', 'home'].includes(commandName)) return match
- // Transform to Codex prompt syntax
- const normalizedName = normalizeName(commandName)
- return `/prompts:${normalizedName}`
- })
-
- // 3. Rewrite .claude/ paths to .codex/
- result = result
- .replace(/~\/\.claude\//g, "~/.codex/")
- .replace(/\.claude\//g, ".codex/")
-
- // 4. Transform @agent-name references
- // Match: @agent-name in text (not emails)
- const agentRefPattern = /@([a-z][a-z0-9-]*-(?:agent|reviewer|researcher|analyst|specialist|oracle|sentinel|guardian|strategist))/gi
- result = result.replace(agentRefPattern, (_match, agentName: string) => {
- const skillName = normalizeName(agentName)
- return `$${skillName} skill`
- })
-
- return result
-}
-
-// Alias for backward compatibility
-const transformTaskCalls = transformContentForCodex
-
-function renderPrompt(command: ClaudeCommand, skillName: string): string {
+function renderPrompt(
+ command: ClaudeCommand,
+ skillName: string,
+ invocationTargets: CodexInvocationTargets,
+): string {
const frontmatter: Record = {
description: command.description,
"argument-hint": command.argumentHint,
}
const instructions = `Use the $${skillName} skill for this command and follow its instructions.`
- // Transform Task calls in prompt body too (not just skill body)
- const transformedBody = transformTaskCalls(command.body)
+ const transformedBody = transformContentForCodex(command.body, invocationTargets)
const body = [instructions, "", transformedBody].join("\n").trim()
return formatFrontmatter(frontmatter, body)
}
-function normalizeName(value: string): string {
- const trimmed = value.trim()
- if (!trimmed) return "item"
- const normalized = trimmed
- .toLowerCase()
- .replace(/[\\/]+/g, "-")
- .replace(/[:\s]+/g, "-")
- .replace(/[^a-z0-9_-]+/g, "-")
- .replace(/-+/g, "-")
- .replace(/^-+|-+$/g, "")
- return normalized || "item"
+function renderWorkflowPrompt(skill: ClaudeSkill): string {
+ const frontmatter: Record = {
+ description: skill.description,
+ "argument-hint": skill.argumentHint,
+ }
+ const body = [
+ `Use the ${skill.name} skill for this workflow and follow its instructions exactly.`,
+ "Treat any text after the prompt name as the workflow context to pass through.",
+ ].join("\n\n")
+ return formatFrontmatter(frontmatter, body)
+}
+
+function isCanonicalCodexWorkflowSkill(name: string): boolean {
+ return name.startsWith("ce:")
+}
+
+function isDeprecatedCodexWorkflowAlias(name: string): boolean {
+ return name.startsWith("workflows:")
+}
+
+function toCanonicalWorkflowSkillName(name: string): string | null {
+ if (!isDeprecatedCodexWorkflowAlias(name)) return null
+ return `ce:${name.slice("workflows:".length)}`
+}
+
+function shouldApplyCompoundWorkflowModel(plugin: ClaudePlugin): boolean {
+ return plugin.manifest.name === "compound-engineering"
}
function sanitizeDescription(value: string, maxLength = CODEX_DESCRIPTION_MAX_LENGTH): string {
diff --git a/src/converters/claude-to-copilot.ts b/src/converters/claude-to-copilot.ts
index 6a7722c..8ea573a 100644
--- a/src/converters/claude-to-copilot.ts
+++ b/src/converters/claude-to-copilot.ts
@@ -53,7 +53,7 @@ function convertAgent(agent: ClaudeAgent, usedNames: Set): CopilotAgent
infer: true,
}
- if (agent.model) {
+ if (agent.model && agent.model !== "inherit") {
frontmatter.model = agent.model
}
@@ -106,11 +106,15 @@ function convertCommandToSkill(
export function transformContentForCopilot(body: string): string {
let result = body
- // 1. Transform Task agent calls
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
+ // 1. Transform Task agent calls (supports namespaced names like compound-engineering:research:agent-name)
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- const skillName = normalizeName(agentName)
- return `${prefix}Use the ${skillName} skill to: ${args.trim()}`
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const skillName = normalizeName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Use the ${skillName} skill to: ${trimmedArgs}`
+ : `${prefix}Use the ${skillName} skill`
})
// 2. Transform slash command references (replace colons with hyphens)
diff --git a/src/converters/claude-to-droid.ts b/src/converters/claude-to-droid.ts
index 547a23d..43fd41f 100644
--- a/src/converters/claude-to-droid.ts
+++ b/src/converters/claude-to-droid.ts
@@ -75,7 +75,10 @@ function convertAgent(agent: ClaudeAgent): DroidAgentFile {
const frontmatter: Record = {
name,
description: agent.description,
- model: agent.model && agent.model !== "inherit" ? agent.model : "inherit",
+ }
+
+ if (agent.model && agent.model !== "inherit") {
+ frontmatter.model = agent.model
}
const tools = mapAgentTools(agent)
@@ -119,15 +122,19 @@ function mapAgentTools(agent: ClaudeAgent): string[] | undefined {
* 2. Task agent calls: Task agent-name(args) → Task agent-name: args
* 3. Agent references: @agent-name → the agent-name droid
*/
-function transformContentForDroid(body: string): string {
+export function transformContentForDroid(body: string): string {
let result = body
// 1. Transform Task agent calls
- // Match: Task repo-research-analyst(feature_description)
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
+ // Match: Task repo-research-analyst(args) or Task compound-engineering:research:repo-research-analyst(args)
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- const name = normalizeName(agentName)
- return `${prefix}Task ${name}: ${args.trim()}`
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const name = normalizeName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Task ${name}: ${trimmedArgs}`
+ : `${prefix}Task ${name}`
})
// 2. Transform slash command references
diff --git a/src/converters/claude-to-gemini.ts b/src/converters/claude-to-gemini.ts
index 7dc4389..561cfd4 100644
--- a/src/converters/claude-to-gemini.ts
+++ b/src/converters/claude-to-gemini.ts
@@ -86,11 +86,15 @@ function convertCommand(command: ClaudeCommand, usedNames: Set): GeminiC
export function transformContentForGemini(body: string): string {
let result = body
- // 1. Transform Task agent calls
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
+ // 1. Transform Task agent calls (supports namespaced names like compound-engineering:research:agent-name)
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- const skillName = normalizeName(agentName)
- return `${prefix}Use the ${skillName} skill to: ${args.trim()}`
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const skillName = normalizeName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Use the ${skillName} skill to: ${trimmedArgs}`
+ : `${prefix}Use the ${skillName} skill`
})
// 2. Rewrite .claude/ paths to .gemini/
diff --git a/src/converters/claude-to-kiro.ts b/src/converters/claude-to-kiro.ts
index 2711267..3e8d622 100644
--- a/src/converters/claude-to-kiro.ts
+++ b/src/converters/claude-to-kiro.ts
@@ -53,10 +53,10 @@ export function convertClaudeToKiro(
convertCommandToSkill(command, usedSkillNames, agentNames),
)
- // Convert MCP servers (stdio only)
+ // Convert MCP servers (stdio and remote)
const mcpServers = convertMcpServers(plugin.mcpServers)
- // Build steering files from CLAUDE.md
+ // Build steering files from repo instruction files, preferring AGENTS.md.
const steeringFiles = buildSteeringFiles(plugin, agentNames)
// Warn about hooks
@@ -135,10 +135,15 @@ function convertCommandToSkill(
export function transformContentForKiro(body: string, knownAgentNames: string[] = []): string {
let result = body
- // 1. Transform Task agent calls
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
+ // 1. Transform Task agent calls (supports namespaced names like compound-engineering:research:agent-name)
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- return `${prefix}Use the use_subagent tool to delegate to the ${normalizeName(agentName)} agent: ${args.trim()}`
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const agentRef = normalizeName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Use the use_subagent tool to delegate to the ${agentRef} agent: ${trimmedArgs}`
+ : `${prefix}Use the use_subagent tool to delegate to the ${agentRef} agent`
})
// 2. Rewrite .claude/ paths to .kiro/ (with word-boundary-like lookbehind)
@@ -177,30 +182,31 @@ function convertMcpServers(
const result: Record = {}
for (const [name, server] of Object.entries(servers)) {
- if (!server.command) {
+ if (server.command) {
+ const entry: KiroMcpServer = { command: server.command }
+ if (server.args && server.args.length > 0) entry.args = server.args
+ if (server.env && Object.keys(server.env).length > 0) entry.env = server.env
+ result[name] = entry
+ } else if (server.url) {
+ const entry: KiroMcpServer = { url: server.url }
+ if (server.headers && Object.keys(server.headers).length > 0) entry.headers = server.headers
+ result[name] = entry
+ } else {
console.warn(
- `Warning: MCP server "${name}" has no command (HTTP/SSE transport). Kiro only supports stdio. Skipping.`,
+ `Warning: MCP server "${name}" has no command or url. Skipping.`,
)
- continue
}
-
- const entry: KiroMcpServer = { command: server.command }
- if (server.args && server.args.length > 0) entry.args = server.args
- if (server.env && Object.keys(server.env).length > 0) entry.env = server.env
-
- console.log(`MCP server "${name}" will execute: ${server.command}${server.args ? " " + server.args.join(" ") : ""}`)
- result[name] = entry
}
return result
}
function buildSteeringFiles(plugin: ClaudePlugin, knownAgentNames: string[]): KiroSteeringFile[] {
- const claudeMdPath = path.join(plugin.root, "CLAUDE.md")
- if (!existsSync(claudeMdPath)) return []
+ const instructionPath = resolveInstructionPath(plugin.root)
+ if (!instructionPath) return []
let content: string
try {
- content = readFileSync(claudeMdPath, "utf8")
+ content = readFileSync(instructionPath, "utf8")
} catch {
return []
}
@@ -211,6 +217,16 @@ function buildSteeringFiles(plugin: ClaudePlugin, knownAgentNames: string[]): Ki
return [{ name: "compound-engineering", content: transformed }]
}
+function resolveInstructionPath(root: string): string | null {
+ const agentsPath = path.join(root, "AGENTS.md")
+ if (existsSync(agentsPath)) return agentsPath
+
+ const claudePath = path.join(root, "CLAUDE.md")
+ if (existsSync(claudePath)) return claudePath
+
+ return null
+}
+
function normalizeName(value: string): string {
const trimmed = value.trim()
if (!trimmed) return "item"
diff --git a/src/converters/claude-to-opencode.ts b/src/converters/claude-to-opencode.ts
index feea6cb..3f81e7a 100644
--- a/src/converters/claude-to-opencode.ts
+++ b/src/converters/claude-to-opencode.ts
@@ -264,7 +264,7 @@ function rewriteClaudePaths(body: string): string {
// Update these when new model generations are released.
const CLAUDE_FAMILY_ALIASES: Record = {
haiku: "claude-haiku-4-5",
- sonnet: "claude-sonnet-4-5",
+ sonnet: "claude-sonnet-4-6",
opus: "claude-opus-4-6",
}
diff --git a/src/converters/claude-to-pi.ts b/src/converters/claude-to-pi.ts
index e266abd..9225990 100644
--- a/src/converters/claude-to-pi.ts
+++ b/src/converters/claude-to-pi.ts
@@ -90,22 +90,25 @@ function convertAgent(agent: ClaudeAgent, usedNames: Set): PiGeneratedSk
}
}
-function transformContentForPi(body: string): string {
+export function transformContentForPi(body: string): string {
let result = body
- // Task repo-research-analyst(feature_description)
+ // Task repo-research-analyst(feature_description) or Task compound-engineering:research:repo-research-analyst(args)
// -> Run subagent with agent="repo-research-analyst" and task="feature_description"
- const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9-]*)\(([^)]+)\)/gm
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
- const skillName = normalizeName(agentName)
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const skillName = normalizeName(finalSegment)
const trimmedArgs = args.trim().replace(/\s+/g, " ")
- return `${prefix}Run subagent with agent=\"${skillName}\" and task=\"${trimmedArgs}\".`
+ return trimmedArgs
+ ? `${prefix}Run subagent with agent=\"${skillName}\" and task=\"${trimmedArgs}\".`
+ : `${prefix}Run subagent with agent=\"${skillName}\".`
})
// Claude-specific tool references
result = result.replace(/\bAskUserQuestion\b/g, "ask_user_question")
- result = result.replace(/\bTodoWrite\b/g, "file-based todos (todos/ + /skill:file-todos)")
- result = result.replace(/\bTodoRead\b/g, "file-based todos (todos/ + /skill:file-todos)")
+ result = result.replace(/\bTodoWrite\b/g, "file-based todos (todos/ + /skill:todo-create)")
+ result = result.replace(/\bTodoRead\b/g, "file-based todos (todos/ + /skill:todo-create)")
// /command-name or /workflows:command-name -> /workflows-command-name
const slashCommandPattern = /(? {
- return `${prefix}Use the @${normalizeName(agentName)} skill: ${args.trim()}`
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const skillRef = normalizeName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Use the @${skillRef} skill: ${trimmedArgs}`
+ : `${prefix}Use the @${skillRef} skill`
})
return result
diff --git a/src/parsers/claude-home.ts b/src/parsers/claude-home.ts
index efc1732..5731875 100644
--- a/src/parsers/claude-home.ts
+++ b/src/parsers/claude-home.ts
@@ -41,8 +41,18 @@ async function loadPersonalSkills(skillsDir: string): Promise {
const sourceDir = entry.isSymbolicLink()
? await fs.realpath(entryPath)
: entryPath
+ let data: Record = {}
+ try {
+ const raw = await fs.readFile(skillPath, "utf8")
+ data = parseFrontmatter(raw).data
+ } catch {
+ // Keep syncing the skill even if frontmatter is malformed.
+ }
skills.push({
name: entry.name,
+ description: data.description as string | undefined,
+ argumentHint: data["argument-hint"] as string | undefined,
+ disableModelInvocation: data["disable-model-invocation"] === true ? true : undefined,
sourceDir,
skillPath,
})
diff --git a/src/parsers/claude.ts b/src/parsers/claude.ts
index 0d3f0b3..247f616 100644
--- a/src/parsers/claude.ts
+++ b/src/parsers/claude.ts
@@ -110,6 +110,7 @@ async function loadSkills(skillsDirs: string[]): Promise {
skills.push({
name,
description: data.description as string | undefined,
+ argumentHint: data["argument-hint"] as string | undefined,
disableModelInvocation,
sourceDir: path.dirname(file),
skillPath: file,
@@ -158,7 +159,8 @@ async function loadMcpServers(
const mcpPath = path.join(root, ".mcp.json")
if (await pathExists(mcpPath)) {
- return readJson>(mcpPath)
+ const raw = await readJson>(mcpPath)
+ return unwrapMcpServers(raw)
}
return undefined
@@ -232,12 +234,20 @@ async function loadMcpPaths(
for (const entry of toPathList(value)) {
const resolved = resolveWithinRoot(root, entry, "mcpServers path")
if (await pathExists(resolved)) {
- configs.push(await readJson>(resolved))
+ const raw = await readJson>(resolved)
+ configs.push(unwrapMcpServers(raw))
}
}
return configs
}
+function unwrapMcpServers(raw: Record): Record {
+ if (raw.mcpServers && typeof raw.mcpServers === "object") {
+ return raw.mcpServers as Record
+ }
+ return raw as Record
+}
+
function mergeMcpConfigs(configs: Record[]): Record {
return configs.reduce((acc, config) => ({ ...acc, ...config }), {})
}
diff --git a/src/release/components.ts b/src/release/components.ts
new file mode 100644
index 0000000..cd77cc2
--- /dev/null
+++ b/src/release/components.ts
@@ -0,0 +1,237 @@
+import { readJson } from "../utils/files"
+import type {
+ BumpLevel,
+ BumpOverride,
+ ComponentDecision,
+ ParsedReleaseIntent,
+ ReleaseComponent,
+ ReleasePreview,
+} from "./types"
+
+const RELEASE_COMPONENTS: ReleaseComponent[] = [
+ "cli",
+ "compound-engineering",
+ "coding-tutor",
+ "marketplace",
+ "cursor-marketplace",
+]
+
+const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[] }> = [
+ {
+ component: "cli",
+ prefixes: ["src/", "package.json", "bun.lock", "tests/cli.test.ts"],
+ },
+ {
+ component: "compound-engineering",
+ prefixes: ["plugins/compound-engineering/"],
+ },
+ {
+ component: "coding-tutor",
+ prefixes: ["plugins/coding-tutor/"],
+ },
+ {
+ component: "marketplace",
+ prefixes: [".claude-plugin/marketplace.json"],
+ },
+ {
+ component: "cursor-marketplace",
+ prefixes: [".cursor-plugin/marketplace.json"],
+ },
+]
+
+const SCOPES_TO_COMPONENTS: Record = {
+ cli: "cli",
+ compound: "compound-engineering",
+ "compound-engineering": "compound-engineering",
+ "coding-tutor": "coding-tutor",
+ marketplace: "marketplace",
+ "cursor-marketplace": "cursor-marketplace",
+}
+
+const NON_RELEASABLE_TYPES = new Set(["docs", "chore", "test", "ci", "build", "style"])
+const PATCH_TYPES = new Set(["fix", "perf", "refactor", "revert"])
+
+type VersionSources = Record
+
+type RootPackageJson = {
+ version: string
+}
+
+type PluginManifest = {
+ version: string
+}
+
+type MarketplaceManifest = {
+ metadata: {
+ version: string
+ }
+}
+
+export function parseReleaseIntent(rawTitle: string): ParsedReleaseIntent {
+ const trimmed = rawTitle.trim()
+ const match = /^(?[a-z]+)(?:\((?[^)]+)\))?(?!)?:\s+(?.+)$/.exec(trimmed)
+
+ if (!match?.groups) {
+ return {
+ raw: rawTitle,
+ type: null,
+ scope: null,
+ description: null,
+ breaking: false,
+ }
+ }
+
+ return {
+ raw: rawTitle,
+ type: match.groups.type ?? null,
+ scope: match.groups.scope ?? null,
+ description: match.groups.description ?? null,
+ breaking: match.groups.bang === "!",
+ }
+}
+
+export function inferBumpFromIntent(intent: ParsedReleaseIntent): BumpLevel | null {
+ if (intent.breaking) return "major"
+ if (!intent.type) return null
+ if (intent.type === "feat") return "minor"
+ if (PATCH_TYPES.has(intent.type)) return "patch"
+ if (NON_RELEASABLE_TYPES.has(intent.type)) return null
+ return null
+}
+
+export function detectComponentsFromFiles(files: string[]): Map {
+ const componentFiles = new Map()
+
+ for (const component of RELEASE_COMPONENTS) {
+ componentFiles.set(component, [])
+ }
+
+ for (const file of files) {
+ for (const mapping of FILE_COMPONENT_MAP) {
+ if (mapping.prefixes.some((prefix) => file === prefix || file.startsWith(prefix))) {
+ componentFiles.get(mapping.component)!.push(file)
+ }
+ }
+ }
+
+ for (const [component, matchedFiles] of componentFiles.entries()) {
+ if (component === "cli" && matchedFiles.length === 0) continue
+ if (component !== "cli" && matchedFiles.length === 0) continue
+ }
+
+ return componentFiles
+}
+
+export function resolveComponentWarnings(
+ intent: ParsedReleaseIntent,
+ detectedComponents: ReleaseComponent[],
+): string[] {
+ const warnings: string[] = []
+
+ if (!intent.type) {
+ warnings.push("Title does not match the expected conventional format: (optional-scope): description")
+ return warnings
+ }
+
+ if (intent.scope) {
+ const normalized = intent.scope.trim().toLowerCase()
+ const expected = SCOPES_TO_COMPONENTS[normalized]
+ if (expected && detectedComponents.length > 0 && !detectedComponents.includes(expected)) {
+ warnings.push(
+ `Optional scope "${intent.scope}" does not match the detected component set: ${detectedComponents.join(", ")}`,
+ )
+ }
+ }
+
+ if (detectedComponents.length === 0 && inferBumpFromIntent(intent) !== null) {
+ warnings.push("No releasable component files were detected for this change")
+ }
+
+ return warnings
+}
+
+export function applyOverride(
+ inferred: BumpLevel | null,
+ override: BumpOverride,
+): BumpLevel | null {
+ if (override === "auto") return inferred
+ return override
+}
+
+export function bumpVersion(version: string, bump: BumpLevel | null): string | null {
+ if (!bump) return null
+
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version)
+ if (!match) {
+ throw new Error(`Unsupported version format: ${version}`)
+ }
+
+ const major = Number(match[1])
+ const minor = Number(match[2])
+ const patch = Number(match[3])
+
+ switch (bump) {
+ case "major":
+ return `${major + 1}.0.0`
+ case "minor":
+ return `${major}.${minor + 1}.0`
+ case "patch":
+ return `${major}.${minor}.${patch + 1}`
+ }
+}
+
+export async function loadCurrentVersions(cwd = process.cwd()): Promise {
+ const root = await readJson(`${cwd}/package.json`)
+ const ce = await readJson(`${cwd}/plugins/compound-engineering/.claude-plugin/plugin.json`)
+ const codingTutor = await readJson(`${cwd}/plugins/coding-tutor/.claude-plugin/plugin.json`)
+ const marketplace = await readJson(`${cwd}/.claude-plugin/marketplace.json`)
+ const cursorMarketplace = await readJson(`${cwd}/.cursor-plugin/marketplace.json`)
+
+ return {
+ cli: root.version,
+ "compound-engineering": ce.version,
+ "coding-tutor": codingTutor.version,
+ marketplace: marketplace.metadata.version,
+ "cursor-marketplace": cursorMarketplace.metadata.version,
+ }
+}
+
+export async function buildReleasePreview(options: {
+ title: string
+ files: string[]
+ overrides?: Partial>
+ cwd?: string
+}): Promise {
+ const intent = parseReleaseIntent(options.title)
+ const inferredBump = inferBumpFromIntent(intent)
+ const componentFilesMap = detectComponentsFromFiles(options.files)
+ const currentVersions = await loadCurrentVersions(options.cwd)
+
+ const detectedComponents = RELEASE_COMPONENTS.filter(
+ (component) => (componentFilesMap.get(component) ?? []).length > 0,
+ )
+
+ const warnings = resolveComponentWarnings(intent, detectedComponents)
+
+ const components: ComponentDecision[] = detectedComponents.map((component) => {
+ const override = options.overrides?.[component] ?? "auto"
+ const effectiveBump = applyOverride(inferredBump, override)
+ const currentVersion = currentVersions[component]
+
+ return {
+ component,
+ files: componentFilesMap.get(component) ?? [],
+ currentVersion,
+ inferredBump,
+ effectiveBump,
+ override,
+ nextVersion: bumpVersion(currentVersion, effectiveBump),
+ }
+ })
+
+ return {
+ intent,
+ warnings,
+ components,
+ }
+}
diff --git a/src/release/config.ts b/src/release/config.ts
new file mode 100644
index 0000000..e2e74ca
--- /dev/null
+++ b/src/release/config.ts
@@ -0,0 +1,29 @@
+import path from "path"
+
+type ReleasePleasePackageConfig = {
+ "changelog-path"?: string
+ "skip-changelog"?: boolean
+}
+
+type ReleasePleaseConfig = {
+ packages: Record
+}
+
+export function validateReleasePleaseConfig(config: ReleasePleaseConfig): string[] {
+ const errors: string[] = []
+
+ for (const [packagePath, packageConfig] of Object.entries(config.packages)) {
+ const changelogPath = packageConfig["changelog-path"]
+ if (!changelogPath) continue
+
+ const normalized = path.posix.normalize(changelogPath)
+ const segments = normalized.split("/")
+ if (segments.includes("..")) {
+ errors.push(
+ `Package "${packagePath}" uses an unsupported changelog-path "${changelogPath}". release-please does not allow upward-relative paths like "../".`,
+ )
+ }
+ }
+
+ return errors
+}
diff --git a/src/release/metadata.ts b/src/release/metadata.ts
new file mode 100644
index 0000000..e574b29
--- /dev/null
+++ b/src/release/metadata.ts
@@ -0,0 +1,235 @@
+import { promises as fs } from "fs"
+import path from "path"
+import { readJson, readText, writeJson, writeText } from "../utils/files"
+import type { ReleaseComponent } from "./types"
+
+type ClaudePluginManifest = {
+ version: string
+ description?: string
+ mcpServers?: Record
+}
+
+type CursorPluginManifest = {
+ version: string
+ description?: string
+}
+
+type MarketplaceManifest = {
+ metadata: {
+ version: string
+ description?: string
+ }
+ plugins: Array<{
+ name: string
+ version?: string
+ description?: string
+ }>
+}
+
+type SyncOptions = {
+ root?: string
+ componentVersions?: Partial>
+ write?: boolean
+}
+
+type FileUpdate = {
+ path: string
+ changed: boolean
+}
+
+export type MetadataSyncResult = {
+ updates: FileUpdate[]
+}
+
+export type CompoundEngineeringCounts = {
+ agents: number
+ skills: number
+ mcpServers: number
+}
+
+const COMPOUND_ENGINEERING_DESCRIPTION =
+ "AI-powered development tools for code review, research, design, and workflow automation."
+
+const COMPOUND_ENGINEERING_MARKETPLACE_DESCRIPTION =
+ "AI-powered development tools that get smarter with every use. Make each unit of engineering work easier than the last."
+
+function resolveExpectedVersion(
+ explicitVersion: string | undefined,
+ fallbackVersion: string,
+): string {
+ return explicitVersion ?? fallbackVersion
+}
+
+export async function countMarkdownFiles(root: string): Promise {
+ const entries = await fs.readdir(root, { withFileTypes: true })
+ let total = 0
+
+ for (const entry of entries) {
+ const fullPath = path.join(root, entry.name)
+ if (entry.isDirectory()) {
+ total += await countMarkdownFiles(fullPath)
+ continue
+ }
+ if (entry.isFile() && entry.name.endsWith(".md")) {
+ total += 1
+ }
+ }
+
+ return total
+}
+
+export async function countSkillDirectories(root: string): Promise {
+ const entries = await fs.readdir(root, { withFileTypes: true })
+ let total = 0
+
+ for (const entry of entries) {
+ if (!entry.isDirectory()) continue
+ const skillPath = path.join(root, entry.name, "SKILL.md")
+ try {
+ await fs.access(skillPath)
+ total += 1
+ } catch {
+ // Ignore non-skill directories.
+ }
+ }
+
+ return total
+}
+
+export async function countMcpServers(pluginRoot: string): Promise {
+ const mcpPath = path.join(pluginRoot, ".mcp.json")
+ const manifest = await readJson<{ mcpServers?: Record }>(mcpPath)
+ return Object.keys(manifest.mcpServers ?? {}).length
+}
+
+export async function getCompoundEngineeringCounts(root: string): Promise {
+ const pluginRoot = path.join(root, "plugins", "compound-engineering")
+ const [agents, skills, mcpServers] = await Promise.all([
+ countMarkdownFiles(path.join(pluginRoot, "agents")),
+ countSkillDirectories(path.join(pluginRoot, "skills")),
+ countMcpServers(pluginRoot),
+ ])
+
+ return { agents, skills, mcpServers }
+}
+
+export async function buildCompoundEngineeringDescription(_root: string): Promise {
+ return COMPOUND_ENGINEERING_DESCRIPTION
+}
+
+export async function buildCompoundEngineeringMarketplaceDescription(_root: string): Promise {
+ return COMPOUND_ENGINEERING_MARKETPLACE_DESCRIPTION
+}
+
+export async function syncReleaseMetadata(options: SyncOptions = {}): Promise {
+ const root = options.root ?? process.cwd()
+ const write = options.write ?? false
+ const versions = options.componentVersions ?? {}
+ const updates: FileUpdate[] = []
+
+ const compoundDescription = await buildCompoundEngineeringDescription(root)
+ const compoundMarketplaceDescription = await buildCompoundEngineeringMarketplaceDescription(root)
+
+ const compoundClaudePath = path.join(root, "plugins", "compound-engineering", ".claude-plugin", "plugin.json")
+ const compoundCursorPath = path.join(root, "plugins", "compound-engineering", ".cursor-plugin", "plugin.json")
+ const codingTutorClaudePath = path.join(root, "plugins", "coding-tutor", ".claude-plugin", "plugin.json")
+ const codingTutorCursorPath = path.join(root, "plugins", "coding-tutor", ".cursor-plugin", "plugin.json")
+ const marketplaceClaudePath = path.join(root, ".claude-plugin", "marketplace.json")
+ const marketplaceCursorPath = path.join(root, ".cursor-plugin", "marketplace.json")
+
+ const compoundClaude = await readJson(compoundClaudePath)
+ const compoundCursor = await readJson(compoundCursorPath)
+ const codingTutorClaude = await readJson(codingTutorClaudePath)
+ const codingTutorCursor = await readJson(codingTutorCursorPath)
+ const marketplaceClaude = await readJson(marketplaceClaudePath)
+ const marketplaceCursor = await readJson(marketplaceCursorPath)
+ const expectedCompoundVersion = resolveExpectedVersion(
+ versions["compound-engineering"],
+ compoundClaude.version,
+ )
+ const expectedCodingTutorVersion = resolveExpectedVersion(
+ versions["coding-tutor"],
+ codingTutorClaude.version,
+ )
+
+ let changed = false
+ if (compoundClaude.version !== expectedCompoundVersion) {
+ compoundClaude.version = expectedCompoundVersion
+ changed = true
+ }
+ if (compoundClaude.description !== compoundDescription) {
+ compoundClaude.description = compoundDescription
+ changed = true
+ }
+ updates.push({ path: compoundClaudePath, changed })
+ if (write && changed) await writeJson(compoundClaudePath, compoundClaude)
+
+ changed = false
+ if (compoundCursor.version !== expectedCompoundVersion) {
+ compoundCursor.version = expectedCompoundVersion
+ changed = true
+ }
+ if (compoundCursor.description !== compoundDescription) {
+ compoundCursor.description = compoundDescription
+ changed = true
+ }
+ updates.push({ path: compoundCursorPath, changed })
+ if (write && changed) await writeJson(compoundCursorPath, compoundCursor)
+
+ changed = false
+ if (codingTutorClaude.version !== expectedCodingTutorVersion) {
+ codingTutorClaude.version = expectedCodingTutorVersion
+ changed = true
+ }
+ updates.push({ path: codingTutorClaudePath, changed })
+ if (write && changed) await writeJson(codingTutorClaudePath, codingTutorClaude)
+
+ changed = false
+ if (codingTutorCursor.version !== expectedCodingTutorVersion) {
+ codingTutorCursor.version = expectedCodingTutorVersion
+ changed = true
+ }
+ updates.push({ path: codingTutorCursorPath, changed })
+ if (write && changed) await writeJson(codingTutorCursorPath, codingTutorCursor)
+
+ changed = false
+ if (versions.marketplace && marketplaceClaude.metadata.version !== versions.marketplace) {
+ marketplaceClaude.metadata.version = versions.marketplace
+ changed = true
+ }
+
+ for (const plugin of marketplaceClaude.plugins) {
+ if (plugin.name === "compound-engineering") {
+ if (plugin.description !== compoundMarketplaceDescription) {
+ plugin.description = compoundMarketplaceDescription
+ changed = true
+ }
+ }
+ // Plugin versions are not synced in marketplace.json -- the canonical
+ // version lives in each plugin's own plugin.json. Duplicating versions
+ // here creates drift that release-please can't maintain.
+ }
+
+ updates.push({ path: marketplaceClaudePath, changed })
+ if (write && changed) await writeJson(marketplaceClaudePath, marketplaceClaude)
+
+ changed = false
+ if (versions["cursor-marketplace"] && marketplaceCursor.metadata.version !== versions["cursor-marketplace"]) {
+ marketplaceCursor.metadata.version = versions["cursor-marketplace"]
+ changed = true
+ }
+
+ for (const plugin of marketplaceCursor.plugins) {
+ if (plugin.name === "compound-engineering") {
+ if (plugin.description !== compoundMarketplaceDescription) {
+ plugin.description = compoundMarketplaceDescription
+ changed = true
+ }
+ }
+ }
+
+ updates.push({ path: marketplaceCursorPath, changed })
+ if (write && changed) await writeJson(marketplaceCursorPath, marketplaceCursor)
+
+ return { updates }
+}
diff --git a/src/release/types.ts b/src/release/types.ts
new file mode 100644
index 0000000..be27067
--- /dev/null
+++ b/src/release/types.ts
@@ -0,0 +1,43 @@
+export type ReleaseComponent = "cli" | "compound-engineering" | "coding-tutor" | "marketplace" | "cursor-marketplace"
+
+export type BumpLevel = "patch" | "minor" | "major"
+
+export type BumpOverride = BumpLevel | "auto"
+
+export type ConventionalReleaseType =
+ | "feat"
+ | "fix"
+ | "perf"
+ | "refactor"
+ | "docs"
+ | "chore"
+ | "test"
+ | "ci"
+ | "build"
+ | "revert"
+ | "style"
+ | string
+
+export type ParsedReleaseIntent = {
+ raw: string
+ type: ConventionalReleaseType | null
+ scope: string | null
+ description: string | null
+ breaking: boolean
+}
+
+export type ComponentDecision = {
+ component: ReleaseComponent
+ files: string[]
+ currentVersion: string
+ inferredBump: BumpLevel | null
+ effectiveBump: BumpLevel | null
+ override: BumpOverride
+ nextVersion: string | null
+}
+
+export type ReleasePreview = {
+ intent: ParsedReleaseIntent
+ warnings: string[]
+ components: ComponentDecision[]
+}
diff --git a/src/targets/codex.ts b/src/targets/codex.ts
index 9e8ba8b..f52902a 100644
--- a/src/targets/codex.ts
+++ b/src/targets/codex.ts
@@ -1,7 +1,8 @@
import path from "path"
-import { backupFile, copyDir, ensureDir, writeText } from "../utils/files"
+import { backupFile, copySkillDir, ensureDir, writeText } from "../utils/files"
import type { CodexBundle } from "../types/codex"
import type { ClaudeMcpServer } from "../types/claude"
+import { transformContentForCodex } from "../utils/codex-content"
export async function writeCodexBundle(outputRoot: string, bundle: CodexBundle): Promise {
const codexRoot = resolveCodexRoot(outputRoot)
@@ -17,7 +18,13 @@ export async function writeCodexBundle(outputRoot: string, bundle: CodexBundle):
if (bundle.skillDirs.length > 0) {
const skillsRoot = path.join(codexRoot, "skills")
for (const skill of bundle.skillDirs) {
- await copyDir(skill.sourceDir, path.join(skillsRoot, skill.name))
+ await copySkillDir(
+ skill.sourceDir,
+ path.join(skillsRoot, skill.name),
+ (content) => transformContentForCodex(content, bundle.invocationTargets, {
+ unknownSlashBehavior: "preserve",
+ }),
+ )
}
}
diff --git a/src/targets/copilot.ts b/src/targets/copilot.ts
index d0d1b1c..6c5195e 100644
--- a/src/targets/copilot.ts
+++ b/src/targets/copilot.ts
@@ -1,5 +1,6 @@
import path from "path"
-import { backupFile, copyDir, ensureDir, writeJson, writeText } from "../utils/files"
+import { backupFile, copySkillDir, ensureDir, writeJson, writeText } from "../utils/files"
+import { transformContentForCopilot } from "../converters/claude-to-copilot"
import type { CopilotBundle } from "../types/copilot"
export async function writeCopilotBundle(outputRoot: string, bundle: CopilotBundle): Promise {
@@ -23,7 +24,7 @@ export async function writeCopilotBundle(outputRoot: string, bundle: CopilotBund
if (bundle.skillDirs.length > 0) {
const skillsDir = path.join(paths.githubDir, "skills")
for (const skill of bundle.skillDirs) {
- await copyDir(skill.sourceDir, path.join(skillsDir, skill.name))
+ await copySkillDir(skill.sourceDir, path.join(skillsDir, skill.name), transformContentForCopilot)
}
}
diff --git a/src/targets/droid.ts b/src/targets/droid.ts
index 23bd46e..7b3ce49 100644
--- a/src/targets/droid.ts
+++ b/src/targets/droid.ts
@@ -1,5 +1,6 @@
import path from "path"
-import { copyDir, ensureDir, resolveCommandPath, writeText } from "../utils/files"
+import { copySkillDir, ensureDir, resolveCommandPath, writeText } from "../utils/files"
+import { transformContentForDroid } from "../converters/claude-to-droid"
import type { DroidBundle } from "../types/droid"
export async function writeDroidBundle(outputRoot: string, bundle: DroidBundle): Promise {
@@ -24,7 +25,7 @@ export async function writeDroidBundle(outputRoot: string, bundle: DroidBundle):
if (bundle.skillDirs.length > 0) {
await ensureDir(paths.skillsDir)
for (const skill of bundle.skillDirs) {
- await copyDir(skill.sourceDir, path.join(paths.skillsDir, skill.name))
+ await copySkillDir(skill.sourceDir, path.join(paths.skillsDir, skill.name), transformContentForDroid)
}
}
}
diff --git a/src/targets/gemini.ts b/src/targets/gemini.ts
index 0df7d51..accecb7 100644
--- a/src/targets/gemini.ts
+++ b/src/targets/gemini.ts
@@ -1,5 +1,6 @@
import path from "path"
-import { backupFile, copyDir, ensureDir, pathExists, readJson, resolveCommandPath, writeJson, writeText } from "../utils/files"
+import { backupFile, copySkillDir, ensureDir, pathExists, readJson, resolveCommandPath, writeJson, writeText } from "../utils/files"
+import { transformContentForGemini } from "../converters/claude-to-gemini"
import type { GeminiBundle } from "../types/gemini"
export async function writeGeminiBundle(outputRoot: string, bundle: GeminiBundle): Promise {
@@ -14,7 +15,7 @@ export async function writeGeminiBundle(outputRoot: string, bundle: GeminiBundle
if (bundle.skillDirs.length > 0) {
for (const skill of bundle.skillDirs) {
- await copyDir(skill.sourceDir, path.join(paths.skillsDir, skill.name))
+ await copySkillDir(skill.sourceDir, path.join(paths.skillsDir, skill.name), transformContentForGemini)
}
}
diff --git a/src/targets/kiro.ts b/src/targets/kiro.ts
index 3597951..64de9fc 100644
--- a/src/targets/kiro.ts
+++ b/src/targets/kiro.ts
@@ -1,5 +1,6 @@
import path from "path"
-import { backupFile, copyDir, ensureDir, pathExists, readJson, writeJson, writeText } from "../utils/files"
+import { backupFile, copySkillDir, ensureDir, pathExists, readJson, writeJson, writeText } from "../utils/files"
+import { transformContentForKiro } from "../converters/claude-to-kiro"
import type { KiroBundle } from "../types/kiro"
export async function writeKiroBundle(outputRoot: string, bundle: KiroBundle): Promise {
@@ -50,7 +51,10 @@ export async function writeKiroBundle(outputRoot: string, bundle: KiroBundle): P
continue
}
- await copyDir(skill.sourceDir, destDir)
+ const knownAgentNames = bundle.agents.map((a) => a.name)
+ await copySkillDir(skill.sourceDir, destDir, (content) =>
+ transformContentForKiro(content, knownAgentNames),
+ )
}
}
diff --git a/src/targets/pi.ts b/src/targets/pi.ts
index 93ba286..61c5375 100644
--- a/src/targets/pi.ts
+++ b/src/targets/pi.ts
@@ -1,13 +1,14 @@
import path from "path"
import {
backupFile,
- copyDir,
+ copySkillDir,
ensureDir,
pathExists,
readText,
writeJson,
writeText,
} from "../utils/files"
+import { transformContentForPi } from "../converters/claude-to-pi"
import type { PiBundle } from "../types/pi"
const PI_AGENTS_BLOCK_START = ""
@@ -37,7 +38,7 @@ export async function writePiBundle(outputRoot: string, bundle: PiBundle): Promi
}
for (const skill of bundle.skillDirs) {
- await copyDir(skill.sourceDir, path.join(paths.skillsDir, skill.name))
+ await copySkillDir(skill.sourceDir, path.join(paths.skillsDir, skill.name), transformContentForPi)
}
for (const skill of bundle.generatedSkills) {
diff --git a/src/targets/windsurf.ts b/src/targets/windsurf.ts
index ee96045..54b0ced 100644
--- a/src/targets/windsurf.ts
+++ b/src/targets/windsurf.ts
@@ -1,6 +1,7 @@
import path from "path"
-import { backupFile, copyDir, ensureDir, pathExists, readJson, writeJsonSecure, writeText } from "../utils/files"
+import { backupFile, copySkillDir, ensureDir, pathExists, readJson, writeJsonSecure, writeText } from "../utils/files"
import { formatFrontmatter } from "../utils/frontmatter"
+import { transformContentForWindsurf } from "../converters/claude-to-windsurf"
import type { WindsurfBundle } from "../types/windsurf"
import type { TargetScope } from "./index"
@@ -58,7 +59,10 @@ export async function writeWindsurfBundle(outputRoot: string, bundle: WindsurfBu
continue
}
- await copyDir(skill.sourceDir, destDir)
+ const knownAgentNames = bundle.agentSkills.map((s) => s.name)
+ await copySkillDir(skill.sourceDir, destDir, (content) =>
+ transformContentForWindsurf(content, knownAgentNames),
+ )
}
}
diff --git a/src/types/claude.ts b/src/types/claude.ts
index e29ae97..9e00f7f 100644
--- a/src/types/claude.ts
+++ b/src/types/claude.ts
@@ -47,6 +47,7 @@ export type ClaudeCommand = {
export type ClaudeSkill = {
name: string
description?: string
+ argumentHint?: string
disableModelInvocation?: boolean
sourceDir: string
skillPath: string
diff --git a/src/types/codex.ts b/src/types/codex.ts
index edf0d94..8ed494c 100644
--- a/src/types/codex.ts
+++ b/src/types/codex.ts
@@ -1,4 +1,5 @@
import type { ClaudeMcpServer } from "./claude"
+import type { CodexInvocationTargets } from "../utils/codex-content"
export type CodexPrompt = {
name: string
@@ -19,5 +20,6 @@ export type CodexBundle = {
prompts: CodexPrompt[]
skillDirs: CodexSkillDir[]
generatedSkills: CodexGeneratedSkill[]
+ invocationTargets?: CodexInvocationTargets
mcpServers?: Record
}
diff --git a/src/utils/codex-agents.ts b/src/utils/codex-agents.ts
index 23cc05a..8c8bcf7 100644
--- a/src/utils/codex-agents.ts
+++ b/src/utils/codex-agents.ts
@@ -20,7 +20,7 @@ Tool mapping:
- WebFetch/WebSearch: use curl or Context7 for library docs
- AskUserQuestion/Question: present choices as a numbered list in chat and wait for a reply number. For multi-select (multiSelect: true), accept comma-separated numbers. Never skip or auto-configure — always wait for the user's response before proceeding.
- Task/Subagent/Parallel: run sequentially in main thread; use multi_tool_use.parallel for tool calls
-- TodoWrite/TodoRead: use file-based todos in todos/ with file-todos skill
+- TodoWrite/TodoRead: use file-based todos in todos/ with todo-create skill
- Skill: open the referenced SKILL.md and follow it
- ExitPlanMode: ignore
`
diff --git a/src/utils/codex-content.ts b/src/utils/codex-content.ts
new file mode 100644
index 0000000..e773d72
--- /dev/null
+++ b/src/utils/codex-content.ts
@@ -0,0 +1,86 @@
+export type CodexInvocationTargets = {
+ promptTargets: Record
+ skillTargets: Record
+}
+
+export type CodexTransformOptions = {
+ unknownSlashBehavior?: "prompt" | "preserve"
+}
+
+/**
+ * Transform Claude Code content to Codex-compatible content.
+ *
+ * Handles multiple syntax differences:
+ * 1. Task agent calls: Task agent-name(args) -> Use the $agent-name skill to: args
+ * 2. Slash command references:
+ * - known prompt entrypoints -> /prompts:prompt-name
+ * - known skills -> the exact skill name
+ * - unknown slash refs -> /prompts:command-name
+ * 3. Agent references: @agent-name -> $agent-name skill
+ * 4. Claude config paths: .claude/ -> .codex/
+ */
+export function transformContentForCodex(
+ body: string,
+ targets?: CodexInvocationTargets,
+ options: CodexTransformOptions = {},
+): string {
+ let result = body
+ const promptTargets = targets?.promptTargets ?? {}
+ const skillTargets = targets?.skillTargets ?? {}
+ const unknownSlashBehavior = options.unknownSlashBehavior ?? "prompt"
+
+ const taskPattern = /^(\s*-?\s*)Task\s+([a-z][a-z0-9:-]*)\(([^)]*)\)/gm
+ result = result.replace(taskPattern, (_match, prefix: string, agentName: string, args: string) => {
+ // For namespaced calls like "compound-engineering:research:repo-research-analyst",
+ // use only the final segment as the skill name.
+ const finalSegment = agentName.includes(":") ? agentName.split(":").pop()! : agentName
+ const skillName = normalizeCodexName(finalSegment)
+ const trimmedArgs = args.trim()
+ return trimmedArgs
+ ? `${prefix}Use the $${skillName} skill to: ${trimmedArgs}`
+ : `${prefix}Use the $${skillName} skill`
+ })
+
+ const slashCommandPattern = /(? {
+ if (commandName.includes("/")) return match
+ if (["dev", "tmp", "etc", "usr", "var", "bin", "home"].includes(commandName)) return match
+
+ const normalizedName = normalizeCodexName(commandName)
+ if (promptTargets[normalizedName]) {
+ return `/prompts:${promptTargets[normalizedName]}`
+ }
+ if (skillTargets[normalizedName]) {
+ return `the ${skillTargets[normalizedName]} skill`
+ }
+ if (unknownSlashBehavior === "preserve") {
+ return match
+ }
+ return `/prompts:${normalizedName}`
+ })
+
+ result = result
+ .replace(/~\/\.claude\//g, "~/.codex/")
+ .replace(/\.claude\//g, ".codex/")
+
+ const agentRefPattern = /@([a-z][a-z0-9-]*-(?:agent|reviewer|researcher|analyst|specialist|oracle|sentinel|guardian|strategist))/gi
+ result = result.replace(agentRefPattern, (_match, agentName: string) => {
+ const skillName = normalizeCodexName(agentName)
+ return `$${skillName} skill`
+ })
+
+ return result
+}
+
+export function normalizeCodexName(value: string): string {
+ const trimmed = value.trim()
+ if (!trimmed) return "item"
+ const normalized = trimmed
+ .toLowerCase()
+ .replace(/[\\/]+/g, "-")
+ .replace(/[:\s]+/g, "-")
+ .replace(/[^a-z0-9_-]+/g, "-")
+ .replace(/-+/g, "-")
+ .replace(/^-+|-+$/g, "")
+ return normalized || "item"
+}
diff --git a/src/utils/files.ts b/src/utils/files.ts
index 8ca608a..9acf95f 100644
--- a/src/utils/files.ts
+++ b/src/utils/files.ts
@@ -104,3 +104,34 @@ export async function copyDir(sourceDir: string, targetDir: string): Promise string,
+): Promise {
+ await ensureDir(targetDir)
+ const entries = await fs.readdir(sourceDir, { withFileTypes: true })
+
+ for (const entry of entries) {
+ const sourcePath = path.join(sourceDir, entry.name)
+ const targetPath = path.join(targetDir, entry.name)
+
+ if (entry.isDirectory()) {
+ await copySkillDir(sourcePath, targetPath, transformSkillContent)
+ } else if (entry.isFile()) {
+ if (entry.name === "SKILL.md" && transformSkillContent) {
+ const content = await readText(sourcePath)
+ await writeText(targetPath, transformSkillContent(content))
+ } else {
+ await ensureDir(path.dirname(targetPath))
+ await fs.copyFile(sourcePath, targetPath)
+ }
+ }
+ }
+}
diff --git a/tests/claude-home.test.ts b/tests/claude-home.test.ts
index 499160d..23937d1 100644
--- a/tests/claude-home.test.ts
+++ b/tests/claude-home.test.ts
@@ -43,4 +43,40 @@ describe("loadClaudeHome", () => {
expect(config.commands?.find((command) => command.name === "custom-command")?.allowedTools).toEqual(["Bash", "Read"])
expect(config.mcpServers.context7?.url).toBe("https://mcp.context7.com/mcp")
})
+
+ test("keeps personal skill directory names stable even when frontmatter name differs", async () => {
+ const tempHome = await fs.mkdtemp(path.join(os.tmpdir(), "claude-home-skill-name-"))
+ const skillDir = path.join(tempHome, "skills", "reviewer")
+
+ await fs.mkdir(skillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(skillDir, "SKILL.md"),
+ "---\nname: ce:plan\ndescription: Reviewer skill\nargument-hint: \"[topic]\"\n---\nReview things.\n",
+ )
+
+ const config = await loadClaudeHome(tempHome)
+
+ expect(config.skills).toHaveLength(1)
+ expect(config.skills[0]?.name).toBe("reviewer")
+ expect(config.skills[0]?.description).toBe("Reviewer skill")
+ expect(config.skills[0]?.argumentHint).toBe("[topic]")
+ })
+
+ test("keeps personal skills when frontmatter is malformed", async () => {
+ const tempHome = await fs.mkdtemp(path.join(os.tmpdir(), "claude-home-skill-yaml-"))
+ const skillDir = path.join(tempHome, "skills", "reviewer")
+
+ await fs.mkdir(skillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(skillDir, "SKILL.md"),
+ "---\nname: ce:plan\nfoo: [unterminated\n---\nReview things.\n",
+ )
+
+ const config = await loadClaudeHome(tempHome)
+
+ expect(config.skills).toHaveLength(1)
+ expect(config.skills[0]?.name).toBe("reviewer")
+ expect(config.skills[0]?.description).toBeUndefined()
+ expect(config.skills[0]?.argumentHint).toBeUndefined()
+ })
})
diff --git a/tests/codex-converter.test.ts b/tests/codex-converter.test.ts
index b6650b1..a82c187 100644
--- a/tests/codex-converter.test.ts
+++ b/tests/codex-converter.test.ts
@@ -31,6 +31,7 @@ const fixturePlugin: ClaudePlugin = {
{
name: "existing-skill",
description: "Existing skill",
+ argumentHint: "[ITEM]",
sourceDir: "/tmp/plugin/skills/existing-skill",
skillPath: "/tmp/plugin/skills/existing-skill/SKILL.md",
},
@@ -78,6 +79,81 @@ describe("convertClaudeToCodex", () => {
expect(parsedSkill.body).toContain("Threat modeling")
})
+ test("generates prompt wrappers for canonical ce workflow skills and omits workflows aliases", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ manifest: { name: "compound-engineering", version: "1.0.0" },
+ commands: [],
+ agents: [],
+ skills: [
+ {
+ name: "ce:plan",
+ description: "Planning workflow",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/ce-plan",
+ skillPath: "/tmp/plugin/skills/ce-plan/SKILL.md",
+ },
+ {
+ name: "workflows:plan",
+ description: "Deprecated planning alias",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/workflows-plan",
+ skillPath: "/tmp/plugin/skills/workflows-plan/SKILL.md",
+ },
+ ],
+ }
+
+ const bundle = convertClaudeToCodex(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ expect(bundle.prompts).toHaveLength(1)
+ expect(bundle.prompts[0]?.name).toBe("ce-plan")
+
+ const parsedPrompt = parseFrontmatter(bundle.prompts[0]!.content)
+ expect(parsedPrompt.data.description).toBe("Planning workflow")
+ expect(parsedPrompt.data["argument-hint"]).toBe("[feature]")
+ expect(parsedPrompt.body).toContain("Use the ce:plan skill")
+
+ expect(bundle.skillDirs.map((skill) => skill.name)).toEqual(["ce:plan"])
+ })
+
+ test("does not apply compound workflow canonicalization to other plugins", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ manifest: { name: "other-plugin", version: "1.0.0" },
+ commands: [],
+ agents: [],
+ skills: [
+ {
+ name: "ce:plan",
+ description: "Custom CE-namespaced skill",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/ce-plan",
+ skillPath: "/tmp/plugin/skills/ce-plan/SKILL.md",
+ },
+ {
+ name: "workflows:plan",
+ description: "Custom workflows-namespaced skill",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/workflows-plan",
+ skillPath: "/tmp/plugin/skills/workflows-plan/SKILL.md",
+ },
+ ],
+ }
+
+ const bundle = convertClaudeToCodex(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ expect(bundle.prompts).toHaveLength(0)
+ expect(bundle.skillDirs.map((skill) => skill.name)).toEqual(["ce:plan", "workflows:plan"])
+ })
+
test("passes through MCP servers", () => {
const bundle = convertClaudeToCodex(fixturePlugin, {
agentMode: "subagent",
@@ -131,6 +207,76 @@ Task best-practices-researcher(topic)`,
expect(parsed.body).not.toContain("Task learnings-researcher")
})
+ test("transforms namespaced Task agent calls to skill references using final segment", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ commands: [
+ {
+ name: "plan",
+ description: "Planning with namespaced agents",
+ body: `Run these agents in parallel:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+
+Then consolidate findings.
+
+Task compound-engineering:review:security-reviewer(code_diff)`,
+ sourcePath: "/tmp/plugin/commands/plan.md",
+ },
+ ],
+ agents: [],
+ skills: [],
+ }
+
+ const bundle = convertClaudeToCodex(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const commandSkill = bundle.generatedSkills.find((s) => s.name === "plan")
+ expect(commandSkill).toBeDefined()
+ const parsed = parseFrontmatter(commandSkill!.content)
+
+ // Namespaced Task calls should use only the final segment as the skill name
+ expect(parsed.body).toContain("Use the $repo-research-analyst skill to: feature_description")
+ expect(parsed.body).toContain("Use the $learnings-researcher skill to: feature_description")
+ expect(parsed.body).toContain("Use the $security-reviewer skill to: code_diff")
+
+ // Original namespaced Task syntax should not remain
+ expect(parsed.body).not.toContain("Task compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ commands: [
+ {
+ name: "review",
+ description: "Review code",
+ body: `- Task compound-engineering:review:code-simplicity-reviewer()`,
+ sourcePath: "/tmp/plugin/commands/review.md",
+ },
+ ],
+ agents: [],
+ skills: [],
+ }
+
+ const bundle = convertClaudeToCodex(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const commandSkill = bundle.generatedSkills.find((s) => s.name === "review")
+ expect(commandSkill).toBeDefined()
+ const parsed = parseFrontmatter(commandSkill!.content)
+ expect(parsed.body).toContain("Use the $code-simplicity-reviewer skill")
+ expect(parsed.body).not.toContain("compound-engineering:")
+ expect(parsed.body).not.toContain("skill to:")
+ })
+
test("transforms slash commands to prompts syntax", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
@@ -172,6 +318,61 @@ Don't confuse with file paths like /tmp/output.md or /dev/null.`,
expect(parsed.body).toContain("/dev/null")
})
+ test("transforms canonical workflow slash commands to Codex prompt references", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ manifest: { name: "compound-engineering", version: "1.0.0" },
+ commands: [
+ {
+ name: "review",
+ description: "Review command",
+ body: `After the brainstorm, run /ce:plan.
+
+If planning is complete, continue with /ce:work.`,
+ sourcePath: "/tmp/plugin/commands/review.md",
+ },
+ ],
+ agents: [],
+ skills: [
+ {
+ name: "ce:plan",
+ description: "Planning workflow",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/ce-plan",
+ skillPath: "/tmp/plugin/skills/ce-plan/SKILL.md",
+ },
+ {
+ name: "ce:work",
+ description: "Implementation workflow",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/ce-work",
+ skillPath: "/tmp/plugin/skills/ce-work/SKILL.md",
+ },
+ {
+ name: "workflows:work",
+ description: "Deprecated implementation alias",
+ argumentHint: "[feature]",
+ sourceDir: "/tmp/plugin/skills/workflows-work",
+ skillPath: "/tmp/plugin/skills/workflows-work/SKILL.md",
+ },
+ ],
+ }
+
+ const bundle = convertClaudeToCodex(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const commandSkill = bundle.generatedSkills.find((s) => s.name === "review")
+ expect(commandSkill).toBeDefined()
+ const parsed = parseFrontmatter(commandSkill!.content)
+
+ expect(parsed.body).toContain("/prompts:ce-plan")
+ expect(parsed.body).toContain("/prompts:ce-work")
+ expect(parsed.body).not.toContain("the ce:plan skill")
+ })
+
test("excludes commands with disable-model-invocation from prompts and skills", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
diff --git a/tests/codex-writer.test.ts b/tests/codex-writer.test.ts
index 3aeb42e..4487171 100644
--- a/tests/codex-writer.test.ts
+++ b/tests/codex-writer.test.ts
@@ -105,4 +105,163 @@ describe("writeCodexBundle", () => {
const backupContent = await fs.readFile(path.join(codexRoot, backupFileName!), "utf8")
expect(backupContent).toBe(originalContent)
})
+
+ test("transforms copied SKILL.md files using Codex invocation targets", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:brainstorm
+description: Brainstorm workflow
+---
+
+Continue with /ce:plan when ready.
+Or use /workflows:plan if you're following an older doc.
+Use /deepen-plan for deeper research.
+`,
+ )
+ await fs.writeFile(
+ path.join(sourceSkillDir, "notes.md"),
+ "Reference docs still mention /ce:plan here.\n",
+ )
+
+ const bundle: CodexBundle = {
+ prompts: [],
+ skillDirs: [{ name: "ce:brainstorm", sourceDir: sourceSkillDir }],
+ generatedSkills: [],
+ invocationTargets: {
+ promptTargets: {
+ "ce-plan": "ce-plan",
+ "workflows-plan": "ce-plan",
+ "deepen-plan": "deepen-plan",
+ },
+ skillTargets: {},
+ },
+ }
+
+ await writeCodexBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".codex", "skills", "ce:brainstorm", "SKILL.md"),
+ "utf8",
+ )
+ expect(installedSkill).toContain("/prompts:ce-plan")
+ expect(installedSkill).not.toContain("/workflows:plan")
+ expect(installedSkill).toContain("/prompts:deepen-plan")
+
+ const notes = await fs.readFile(
+ path.join(tempRoot, ".codex", "skills", "ce:brainstorm", "notes.md"),
+ "utf8",
+ )
+ expect(notes).toContain("/ce:plan")
+ })
+
+ test("transforms namespaced Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-ns-task-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+
+Also run bare agents:
+
+- Task best-practices-researcher(topic)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: CodexBundle = {
+ prompts: [],
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ generatedSkills: [],
+ invocationTargets: {
+ promptTargets: {},
+ skillTargets: {},
+ },
+ }
+
+ await writeCodexBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".codex", "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ // Namespaced Task calls should be rewritten using the final segment
+ expect(installedSkill).toContain("Use the $repo-research-analyst skill to: feature_description")
+ expect(installedSkill).toContain("Use the $learnings-researcher skill to: feature_description")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+
+ // Bare Task calls should still be rewritten
+ expect(installedSkill).toContain("Use the $best-practices-researcher skill to: topic")
+ expect(installedSkill).not.toContain("Task best-practices-researcher")
+
+ // Zero-arg Task calls should be rewritten without trailing "to:"
+ expect(installedSkill).toContain("Use the $code-simplicity-reviewer skill")
+ expect(installedSkill).not.toContain("code-simplicity-reviewer skill to:")
+ })
+
+ test("preserves unknown slash text in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-skill-preserve-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: proof
+description: Proof skill
+---
+
+Route examples:
+- /users
+- /settings
+
+API examples:
+- https://www.proofeditor.ai/api/agent/{slug}/state
+- https://www.proofeditor.ai/share/markdown
+
+Workflow handoff:
+- /ce:plan
+`,
+ )
+
+ const bundle: CodexBundle = {
+ prompts: [],
+ skillDirs: [{ name: "proof", sourceDir: sourceSkillDir }],
+ generatedSkills: [],
+ invocationTargets: {
+ promptTargets: {
+ "ce-plan": "ce-plan",
+ },
+ skillTargets: {},
+ },
+ }
+
+ await writeCodexBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".codex", "skills", "proof", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("/users")
+ expect(installedSkill).toContain("/settings")
+ expect(installedSkill).toContain("https://www.proofeditor.ai/api/agent/{slug}/state")
+ expect(installedSkill).toContain("https://www.proofeditor.ai/share/markdown")
+ expect(installedSkill).toContain("/prompts:ce-plan")
+ expect(installedSkill).not.toContain("/prompts:users")
+ expect(installedSkill).not.toContain("/prompts:settings")
+ expect(installedSkill).not.toContain("https://prompts:www.proofeditor.ai")
+ })
})
diff --git a/tests/copilot-converter.test.ts b/tests/copilot-converter.test.ts
index 22f7973..1bc790e 100644
--- a/tests/copilot-converter.test.ts
+++ b/tests/copilot-converter.test.ts
@@ -444,6 +444,27 @@ Task best-practices-researcher(topic)`
expect(result).not.toContain("Task repo-research-analyst(")
})
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const input = `Run agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:review:security-reviewer(code_diff)`
+
+ const result = transformContentForCopilot(input)
+ expect(result).toContain("Use the repo-research-analyst skill to: feature_description")
+ expect(result).toContain("Use the security-reviewer skill to: code_diff")
+ expect(result).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const input = `- Task compound-engineering:review:code-simplicity-reviewer()`
+
+ const result = transformContentForCopilot(input)
+ expect(result).toContain("Use the code-simplicity-reviewer skill")
+ expect(result).not.toContain("compound-engineering:")
+ expect(result).not.toContain("skill to:")
+ })
+
test("replaces colons with hyphens in slash commands", () => {
const input = `1. Run /deepen-plan to enhance
2. Start /workflows:work to implement
diff --git a/tests/copilot-writer.test.ts b/tests/copilot-writer.test.ts
index 6c430a1..36777e1 100644
--- a/tests/copilot-writer.test.ts
+++ b/tests/copilot-writer.test.ts
@@ -165,6 +165,44 @@ describe("writeCopilotBundle", () => {
expect(backupFiles.length).toBeGreaterThanOrEqual(1)
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "copilot-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: CopilotBundle = {
+ agents: [],
+ generatedSkills: [],
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ }
+
+ await writeCopilotBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".github", "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("Use the repo-research-analyst skill to: feature_description")
+ expect(installedSkill).toContain("Use the learnings-researcher skill to: feature_description")
+ expect(installedSkill).toContain("Use the code-simplicity-reviewer skill")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("creates skill directories with SKILL.md", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "copilot-genskill-"))
const bundle: CopilotBundle = {
diff --git a/tests/droid-converter.test.ts b/tests/droid-converter.test.ts
index 9c37e0b..36e158a 100644
--- a/tests/droid-converter.test.ts
+++ b/tests/droid-converter.test.ts
@@ -89,7 +89,7 @@ describe("convertClaudeToDroid", () => {
expect(bundle.skillDirs[0].sourceDir).toBe("/tmp/plugin/skills/existing-skill")
})
- test("sets model to inherit when not specified", () => {
+ test("omits model when set to inherit", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
agents: [
@@ -110,7 +110,7 @@ describe("convertClaudeToDroid", () => {
})
const parsed = parseFrontmatter(bundle.droids[0].content)
- expect(parsed.data.model).toBe("inherit")
+ expect(parsed.data.model).toBeUndefined()
})
test("transforms Task agent calls to droid-compatible syntax", () => {
@@ -148,6 +148,63 @@ Task best-practices-researcher(topic)`,
expect(parsed.body).not.toContain("Task repo-research-analyst(")
})
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ commands: [
+ {
+ name: "plan",
+ description: "Planning with namespaced agents",
+ body: `Run agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:review:security-reviewer(code_diff)`,
+ sourcePath: "/tmp/plugin/commands/plan.md",
+ },
+ ],
+ agents: [],
+ skills: [],
+ }
+
+ const bundle = convertClaudeToDroid(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const parsed = parseFrontmatter(bundle.commands[0].content)
+ expect(parsed.body).toContain("Task repo-research-analyst: feature_description")
+ expect(parsed.body).toContain("Task security-reviewer: code_diff")
+ expect(parsed.body).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ commands: [
+ {
+ name: "review",
+ description: "Review code",
+ body: `- Task compound-engineering:review:code-simplicity-reviewer()`,
+ sourcePath: "/tmp/plugin/commands/review.md",
+ },
+ ],
+ agents: [],
+ skills: [],
+ }
+
+ const bundle = convertClaudeToDroid(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const parsed = parseFrontmatter(bundle.commands[0].content)
+ expect(parsed.body).toContain("Task code-simplicity-reviewer")
+ expect(parsed.body).not.toContain("compound-engineering:")
+ expect(parsed.body).not.toContain("()")
+ })
+
test("transforms slash commands by flattening namespaces", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
diff --git a/tests/droid-writer.test.ts b/tests/droid-writer.test.ts
index f8ecf6c..19eb7c0 100644
--- a/tests/droid-writer.test.ts
+++ b/tests/droid-writer.test.ts
@@ -47,6 +47,44 @@ describe("writeDroidBundle", () => {
expect(droidContent).toContain("Droid content")
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "droid-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: DroidBundle = {
+ commands: [],
+ droids: [],
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ }
+
+ await writeDroidBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".factory", "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("Task repo-research-analyst: feature_description")
+ expect(installedSkill).toContain("Task learnings-researcher: feature_description")
+ expect(installedSkill).toContain("Task code-simplicity-reviewer")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("writes directly into a .factory output root", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "droid-home-"))
const factoryRoot = path.join(tempRoot, ".factory")
diff --git a/tests/gemini-converter.test.ts b/tests/gemini-converter.test.ts
index bd9675a..db923ac 100644
--- a/tests/gemini-converter.test.ts
+++ b/tests/gemini-converter.test.ts
@@ -338,6 +338,27 @@ Task best-practices-researcher(topic)`
expect(result).not.toContain("Task repo-research-analyst")
})
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const input = `Run agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:review:security-reviewer(code_diff)`
+
+ const result = transformContentForGemini(input)
+ expect(result).toContain("Use the repo-research-analyst skill to: feature_description")
+ expect(result).toContain("Use the security-reviewer skill to: code_diff")
+ expect(result).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const input = `- Task compound-engineering:review:code-simplicity-reviewer()`
+
+ const result = transformContentForGemini(input)
+ expect(result).toContain("Use the code-simplicity-reviewer skill")
+ expect(result).not.toContain("compound-engineering:")
+ expect(result).not.toContain("skill to:")
+ })
+
test("transforms @agent references to skill references", () => {
const result = transformContentForGemini("Ask @security-sentinel for a review.")
expect(result).toContain("the security-sentinel skill")
diff --git a/tests/gemini-writer.test.ts b/tests/gemini-writer.test.ts
index a6a9df3..25f9bfb 100644
--- a/tests/gemini-writer.test.ts
+++ b/tests/gemini-writer.test.ts
@@ -66,6 +66,44 @@ describe("writeGeminiBundle", () => {
expect(settingsContent.mcpServers.playwright.command).toBe("npx")
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "gemini-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: GeminiBundle = {
+ generatedSkills: [],
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ commands: [],
+ }
+
+ await writeGeminiBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".gemini", "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("Use the repo-research-analyst skill to: feature_description")
+ expect(installedSkill).toContain("Use the learnings-researcher skill to: feature_description")
+ expect(installedSkill).toContain("Use the code-simplicity-reviewer skill")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("namespaced commands create subdirectories", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "gemini-ns-"))
const bundle: GeminiBundle = {
diff --git a/tests/kiro-converter.test.ts b/tests/kiro-converter.test.ts
index e638f71..4a743ff 100644
--- a/tests/kiro-converter.test.ts
+++ b/tests/kiro-converter.test.ts
@@ -1,3 +1,6 @@
+import { mkdtempSync, rmSync, writeFileSync } from "fs"
+import os from "os"
+import path from "path"
import { describe, expect, test } from "bun:test"
import { convertClaudeToKiro, transformContentForKiro } from "../src/converters/claude-to-kiro"
import { parseFrontmatter } from "../src/utils/frontmatter"
@@ -174,11 +177,7 @@ describe("convertClaudeToKiro", () => {
expect(bundle.mcpServers.local.args).toEqual(["hello"])
})
- test("MCP HTTP servers skipped with warning", () => {
- const warnings: string[] = []
- const originalWarn = console.warn
- console.warn = (msg: string) => warnings.push(msg)
-
+ test("MCP HTTP servers converted with url", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
mcpServers: {
@@ -189,11 +188,32 @@ describe("convertClaudeToKiro", () => {
skills: [],
}
+ const bundle = convertClaudeToKiro(plugin, defaultOptions)
+
+ expect(Object.keys(bundle.mcpServers)).toHaveLength(1)
+ expect(bundle.mcpServers.httpServer).toEqual({ url: "https://example.com/mcp" })
+ })
+
+ test("MCP servers with no command or url skipped with warning", () => {
+ const warnings: string[] = []
+ const originalWarn = console.warn
+ console.warn = (msg: string) => warnings.push(msg)
+
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ mcpServers: {
+ broken: {} as any,
+ },
+ agents: [],
+ commands: [],
+ skills: [],
+ }
+
const bundle = convertClaudeToKiro(plugin, defaultOptions)
console.warn = originalWarn
expect(Object.keys(bundle.mcpServers)).toHaveLength(0)
- expect(warnings.some((w) => w.includes("no command") || w.includes("HTTP"))).toBe(true)
+ expect(warnings.some((w) => w.includes("no command or url"))).toBe(true)
})
test("plugin with zero agents produces empty agents array", () => {
@@ -257,7 +277,7 @@ describe("convertClaudeToKiro", () => {
expect(warnings.some((w) => w.includes("Kiro"))).toBe(true)
})
- test("steering file not generated when CLAUDE.md missing", () => {
+ test("steering file not generated when repo instruction files are missing", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
root: "/tmp/nonexistent-plugin-dir",
@@ -270,6 +290,27 @@ describe("convertClaudeToKiro", () => {
expect(bundle.steeringFiles).toHaveLength(0)
})
+ test("steering file prefers AGENTS.md over CLAUDE.md", () => {
+ const root = mkdtempSync(path.join(os.tmpdir(), "kiro-steering-"))
+ writeFileSync(path.join(root, "AGENTS.md"), "# AGENTS\nUse AGENTS instructions.")
+ writeFileSync(path.join(root, "CLAUDE.md"), "# CLAUDE\nUse CLAUDE instructions.")
+
+ const plugin: ClaudePlugin = {
+ ...fixturePlugin,
+ root,
+ agents: [],
+ commands: [],
+ skills: [],
+ }
+
+ const bundle = convertClaudeToKiro(plugin, defaultOptions)
+ rmSync(root, { recursive: true, force: true })
+
+ expect(bundle.steeringFiles).toHaveLength(1)
+ expect(bundle.steeringFiles[0].content).toContain("Use AGENTS instructions.")
+ expect(bundle.steeringFiles[0].content).not.toContain("Use CLAUDE instructions.")
+ })
+
test("name normalization handles various inputs", () => {
const plugin: ClaudePlugin = {
...fixturePlugin,
@@ -350,6 +391,27 @@ Task best-practices-researcher(topic)`
expect(result).not.toContain("Task repo-research-analyst")
})
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const input = `Run agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:review:security-reviewer(code_diff)`
+
+ const result = transformContentForKiro(input)
+ expect(result).toContain("Use the use_subagent tool to delegate to the repo-research-analyst agent: feature_description")
+ expect(result).toContain("Use the use_subagent tool to delegate to the security-reviewer agent: code_diff")
+ expect(result).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const input = `- Task compound-engineering:review:code-simplicity-reviewer()`
+
+ const result = transformContentForKiro(input)
+ expect(result).toContain("Use the use_subagent tool to delegate to the code-simplicity-reviewer agent")
+ expect(result).not.toContain("compound-engineering:")
+ expect(result).not.toContain("code-simplicity-reviewer agent:")
+ })
+
test("transforms @agent references for known agents only", () => {
const result = transformContentForKiro("Ask @security-sentinel for a review.", ["security-sentinel"])
expect(result).toContain("the security-sentinel agent")
diff --git a/tests/kiro-writer.test.ts b/tests/kiro-writer.test.ts
index 301dcb6..500d03b 100644
--- a/tests/kiro-writer.test.ts
+++ b/tests/kiro-writer.test.ts
@@ -99,6 +99,43 @@ describe("writeKiroBundle", () => {
expect(mcpContent.mcpServers.playwright.command).toBe("npx")
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "kiro-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: KiroBundle = {
+ ...emptyBundle,
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ }
+
+ await writeKiroBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, ".kiro", "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("Use the use_subagent tool to delegate to the repo-research-analyst agent: feature_description")
+ expect(installedSkill).toContain("Use the use_subagent tool to delegate to the learnings-researcher agent: feature_description")
+ expect(installedSkill).toContain("Use the use_subagent tool to delegate to the code-simplicity-reviewer agent")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("does not double-nest when output root is .kiro", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "kiro-home-"))
const kiroRoot = path.join(tempRoot, ".kiro")
diff --git a/tests/pi-converter.test.ts b/tests/pi-converter.test.ts
index d7edf95..c10cb3d 100644
--- a/tests/pi-converter.test.ts
+++ b/tests/pi-converter.test.ts
@@ -82,7 +82,71 @@ describe("convertClaudeToPi", () => {
expect(parsedPrompt.body).toContain("ask_user_question")
expect(parsedPrompt.body).toContain("/workflows-work")
expect(parsedPrompt.body).toContain("/deepen-plan")
- expect(parsedPrompt.body).toContain("file-based todos (todos/ + /skill:file-todos)")
+ expect(parsedPrompt.body).toContain("file-based todos (todos/ + /skill:todo-create)")
+ })
+
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const plugin: ClaudePlugin = {
+ root: "/tmp/plugin",
+ manifest: { name: "fixture", version: "1.0.0" },
+ agents: [],
+ commands: [
+ {
+ name: "plan",
+ description: "Planning with namespaced agents",
+ body: [
+ "Run agents:",
+ "- Task compound-engineering:research:repo-research-analyst(feature_description)",
+ "- Task compound-engineering:review:security-reviewer(code_diff)",
+ ].join("\n"),
+ sourcePath: "/tmp/plugin/commands/plan.md",
+ },
+ ],
+ skills: [],
+ hooks: undefined,
+ mcpServers: undefined,
+ }
+
+ const bundle = convertClaudeToPi(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const parsedPrompt = parseFrontmatter(bundle.prompts[0].content)
+ expect(parsedPrompt.body).toContain('Run subagent with agent="repo-research-analyst" and task="feature_description".')
+ expect(parsedPrompt.body).toContain('Run subagent with agent="security-reviewer" and task="code_diff".')
+ expect(parsedPrompt.body).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const plugin: ClaudePlugin = {
+ root: "/tmp/plugin",
+ manifest: { name: "fixture", version: "1.0.0" },
+ agents: [],
+ commands: [
+ {
+ name: "review",
+ description: "Review code",
+ body: "- Task compound-engineering:review:code-simplicity-reviewer()",
+ sourcePath: "/tmp/plugin/commands/review.md",
+ },
+ ],
+ skills: [],
+ hooks: undefined,
+ mcpServers: undefined,
+ }
+
+ const bundle = convertClaudeToPi(plugin, {
+ agentMode: "subagent",
+ inferTemperature: false,
+ permissions: "none",
+ })
+
+ const parsedPrompt = parseFrontmatter(bundle.prompts[0].content)
+ expect(parsedPrompt.body).toContain('Run subagent with agent="code-simplicity-reviewer".')
+ expect(parsedPrompt.body).not.toContain("compound-engineering:")
+ expect(parsedPrompt.body).not.toContain("()")
})
test("appends MCPorter compatibility note when command references MCP", () => {
diff --git a/tests/pi-writer.test.ts b/tests/pi-writer.test.ts
index 5af7ea6..eec28d9 100644
--- a/tests/pi-writer.test.ts
+++ b/tests/pi-writer.test.ts
@@ -50,6 +50,46 @@ describe("writePiBundle", () => {
expect(agentsContent).toContain("MCPorter")
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "pi-skill-transform-"))
+ const outputRoot = path.join(tempRoot, ".pi")
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: PiBundle = {
+ prompts: [],
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ generatedSkills: [],
+ extensions: [],
+ }
+
+ await writePiBundle(outputRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(outputRoot, "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain('Run subagent with agent="repo-research-analyst" and task="feature_description".')
+ expect(installedSkill).toContain('Run subagent with agent="learnings-researcher" and task="feature_description".')
+ expect(installedSkill).toContain('Run subagent with agent="code-simplicity-reviewer".')
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("writes to ~/.pi/agent style roots without nesting under .pi", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "pi-agent-root-"))
const outputRoot = path.join(tempRoot, "agent")
diff --git a/tests/release-components.test.ts b/tests/release-components.test.ts
new file mode 100644
index 0000000..4d7691c
--- /dev/null
+++ b/tests/release-components.test.ts
@@ -0,0 +1,111 @@
+import { describe, expect, test } from "bun:test"
+import {
+ applyOverride,
+ bumpVersion,
+ detectComponentsFromFiles,
+ inferBumpFromIntent,
+ parseReleaseIntent,
+ resolveComponentWarnings,
+} from "../src/release/components"
+
+describe("release component detection", () => {
+ test("maps plugin-only changes to the matching plugin component", () => {
+ const components = detectComponentsFromFiles([
+ "plugins/compound-engineering/skills/ce-plan/SKILL.md",
+ ])
+
+ expect(components.get("compound-engineering")).toEqual([
+ "plugins/compound-engineering/skills/ce-plan/SKILL.md",
+ ])
+ expect(components.get("cli")).toEqual([])
+ expect(components.get("coding-tutor")).toEqual([])
+ expect(components.get("marketplace")).toEqual([])
+ })
+
+ test("maps cli and plugin changes independently", () => {
+ const components = detectComponentsFromFiles([
+ "src/commands/install.ts",
+ "plugins/coding-tutor/.claude-plugin/plugin.json",
+ ])
+
+ expect(components.get("cli")).toEqual(["src/commands/install.ts"])
+ expect(components.get("coding-tutor")).toEqual([
+ "plugins/coding-tutor/.claude-plugin/plugin.json",
+ ])
+ })
+
+ test("maps claude marketplace metadata without bumping plugin components", () => {
+ const components = detectComponentsFromFiles([".claude-plugin/marketplace.json"])
+ expect(components.get("marketplace")).toEqual([".claude-plugin/marketplace.json"])
+ expect(components.get("cursor-marketplace")).toEqual([])
+ expect(components.get("compound-engineering")).toEqual([])
+ expect(components.get("coding-tutor")).toEqual([])
+ })
+
+ test("maps cursor marketplace metadata to cursor-marketplace component", () => {
+ const components = detectComponentsFromFiles([".cursor-plugin/marketplace.json"])
+ expect(components.get("cursor-marketplace")).toEqual([".cursor-plugin/marketplace.json"])
+ expect(components.get("marketplace")).toEqual([])
+ expect(components.get("compound-engineering")).toEqual([])
+ expect(components.get("coding-tutor")).toEqual([])
+ })
+})
+
+describe("release intent parsing", () => {
+ test("parses conventional titles with optional scope and breaking marker", () => {
+ const parsed = parseReleaseIntent("feat(coding-tutor)!: add tutor reset flow")
+ expect(parsed.type).toBe("feat")
+ expect(parsed.scope).toBe("coding-tutor")
+ expect(parsed.breaking).toBe(true)
+ expect(parsed.description).toBe("add tutor reset flow")
+ })
+
+ test("supports conventional titles without scope", () => {
+ const parsed = parseReleaseIntent("fix: adjust ce:plan-beta wording")
+ expect(parsed.type).toBe("fix")
+ expect(parsed.scope).toBeNull()
+ expect(parsed.breaking).toBe(false)
+ })
+
+ test("infers bump levels from parsed intent", () => {
+ expect(inferBumpFromIntent(parseReleaseIntent("feat: add release preview"))).toBe("minor")
+ expect(inferBumpFromIntent(parseReleaseIntent("fix: correct preview output"))).toBe("patch")
+ expect(inferBumpFromIntent(parseReleaseIntent("docs: update requirements"))).toBeNull()
+ expect(inferBumpFromIntent(parseReleaseIntent("refactor!: break compatibility"))).toBe("major")
+ })
+})
+
+describe("override handling", () => {
+ test("keeps inferred bump when override is auto", () => {
+ expect(applyOverride("patch", "auto")).toBe("patch")
+ })
+
+ test("promotes inferred bump when override is explicit", () => {
+ expect(applyOverride("patch", "minor")).toBe("minor")
+ expect(applyOverride(null, "major")).toBe("major")
+ })
+
+ test("increments semver versions", () => {
+ expect(bumpVersion("2.42.0", "patch")).toBe("2.42.1")
+ expect(bumpVersion("2.42.0", "minor")).toBe("2.43.0")
+ expect(bumpVersion("2.42.0", "major")).toBe("3.0.0")
+ })
+})
+
+describe("scope mismatch warnings", () => {
+ test("does not require scope when omitted", () => {
+ const warnings = resolveComponentWarnings(
+ parseReleaseIntent("fix: update ce plan copy"),
+ ["compound-engineering"],
+ )
+ expect(warnings).toEqual([])
+ })
+
+ test("warns when explicit scope contradicts detected files", () => {
+ const warnings = resolveComponentWarnings(
+ parseReleaseIntent("fix(cli): update coding tutor text"),
+ ["coding-tutor"],
+ )
+ expect(warnings[0]).toContain('Optional scope "cli" does not match')
+ })
+})
diff --git a/tests/release-config.test.ts b/tests/release-config.test.ts
new file mode 100644
index 0000000..4b2a746
--- /dev/null
+++ b/tests/release-config.test.ts
@@ -0,0 +1,39 @@
+import { describe, expect, test } from "bun:test"
+import { validateReleasePleaseConfig } from "../src/release/config"
+
+describe("release-please config validation", () => {
+ test("rejects upward-relative changelog paths", () => {
+ const errors = validateReleasePleaseConfig({
+ packages: {
+ ".": {
+ "changelog-path": "CHANGELOG.md",
+ },
+ "plugins/compound-engineering": {
+ "changelog-path": "../../CHANGELOG.md",
+ },
+ },
+ })
+
+ expect(errors).toHaveLength(1)
+ expect(errors[0]).toContain('Package "plugins/compound-engineering"')
+ expect(errors[0]).toContain("../../CHANGELOG.md")
+ })
+
+ test("allows package-local changelog paths and skipped changelogs", () => {
+ const errors = validateReleasePleaseConfig({
+ packages: {
+ ".": {
+ "changelog-path": "CHANGELOG.md",
+ },
+ "plugins/compound-engineering": {
+ "skip-changelog": true,
+ },
+ ".claude-plugin": {
+ "changelog-path": "CHANGELOG.md",
+ },
+ },
+ })
+
+ expect(errors).toEqual([])
+ })
+})
diff --git a/tests/release-metadata.test.ts b/tests/release-metadata.test.ts
new file mode 100644
index 0000000..0c2c79c
--- /dev/null
+++ b/tests/release-metadata.test.ts
@@ -0,0 +1,135 @@
+import { mkdtemp, mkdir, writeFile } from "fs/promises"
+import os from "os"
+import path from "path"
+import { afterEach, describe, expect, test } from "bun:test"
+import {
+ buildCompoundEngineeringDescription,
+ getCompoundEngineeringCounts,
+ syncReleaseMetadata,
+} from "../src/release/metadata"
+
+const tempRoots: string[] = []
+
+afterEach(async () => {
+ for (const root of tempRoots.splice(0, tempRoots.length)) {
+ await Bun.$`rm -rf ${root}`.quiet()
+ }
+})
+
+async function makeFixtureRoot(): Promise {
+ const root = await mkdtemp(path.join(os.tmpdir(), "release-metadata-"))
+ tempRoots.push(root)
+
+ await mkdir(path.join(root, "plugins", "compound-engineering", "agents", "review"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, "plugins", "compound-engineering", "skills", "ce-plan"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, "plugins", "compound-engineering", ".claude-plugin"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, "plugins", "compound-engineering", ".cursor-plugin"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, "plugins", "coding-tutor", ".claude-plugin"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, "plugins", "coding-tutor", ".cursor-plugin"), {
+ recursive: true,
+ })
+ await mkdir(path.join(root, ".claude-plugin"), { recursive: true })
+ await mkdir(path.join(root, ".cursor-plugin"), { recursive: true })
+
+ await writeFile(
+ path.join(root, "plugins", "compound-engineering", "agents", "review", "agent.md"),
+ "# Review Agent\n",
+ )
+ await writeFile(
+ path.join(root, "plugins", "compound-engineering", "skills", "ce-plan", "SKILL.md"),
+ "# ce:plan\n",
+ )
+ await writeFile(
+ path.join(root, "plugins", "compound-engineering", ".mcp.json"),
+ JSON.stringify({ mcpServers: { context7: { command: "ctx7" } } }, null, 2),
+ )
+ await writeFile(
+ path.join(root, "plugins", "compound-engineering", ".claude-plugin", "plugin.json"),
+ JSON.stringify({ version: "2.42.0", description: "old" }, null, 2),
+ )
+ await writeFile(
+ path.join(root, "plugins", "compound-engineering", ".cursor-plugin", "plugin.json"),
+ JSON.stringify({ version: "2.33.0", description: "old" }, null, 2),
+ )
+ await writeFile(
+ path.join(root, "plugins", "coding-tutor", ".claude-plugin", "plugin.json"),
+ JSON.stringify({ version: "1.2.1" }, null, 2),
+ )
+ await writeFile(
+ path.join(root, "plugins", "coding-tutor", ".cursor-plugin", "plugin.json"),
+ JSON.stringify({ version: "1.2.1" }, null, 2),
+ )
+ await writeFile(
+ path.join(root, ".claude-plugin", "marketplace.json"),
+ JSON.stringify(
+ {
+ metadata: { version: "1.0.0", description: "marketplace" },
+ plugins: [
+ { name: "compound-engineering", version: "2.41.0", description: "old" },
+ { name: "coding-tutor", version: "1.2.0", description: "old" },
+ ],
+ },
+ null,
+ 2,
+ ),
+ )
+ await writeFile(
+ path.join(root, ".cursor-plugin", "marketplace.json"),
+ JSON.stringify(
+ {
+ metadata: { version: "1.0.0", description: "marketplace" },
+ plugins: [
+ { name: "compound-engineering", version: "2.41.0", description: "old" },
+ { name: "coding-tutor", version: "1.2.0", description: "old" },
+ ],
+ },
+ null,
+ 2,
+ ),
+ )
+
+ return root
+}
+
+describe("release metadata", () => {
+ test("reports current compound-engineering counts from the repo", async () => {
+ const counts = await getCompoundEngineeringCounts(process.cwd())
+
+ expect(counts).toEqual({
+ agents: expect.any(Number),
+ skills: expect.any(Number),
+ mcpServers: expect.any(Number),
+ })
+ expect(counts.agents).toBeGreaterThan(0)
+ expect(counts.skills).toBeGreaterThan(0)
+ expect(counts.mcpServers).toBeGreaterThanOrEqual(0)
+ })
+
+ test("builds a stable compound-engineering manifest description", async () => {
+ const description = await buildCompoundEngineeringDescription(process.cwd())
+
+ expect(description).toBe(
+ "AI-powered development tools for code review, research, design, and workflow automation.",
+ )
+ })
+
+ test("detects cross-surface version drift even without explicit override versions", async () => {
+ const root = await makeFixtureRoot()
+ const result = await syncReleaseMetadata({ root, write: false })
+ const changedPaths = result.updates.filter((update) => update.changed).map((update) => update.path)
+
+ expect(changedPaths).toContain(path.join(root, "plugins", "compound-engineering", ".cursor-plugin", "plugin.json"))
+ expect(changedPaths).toContain(path.join(root, ".claude-plugin", "marketplace.json"))
+ expect(changedPaths).toContain(path.join(root, ".cursor-plugin", "marketplace.json"))
+ })
+})
diff --git a/tests/release-preview.test.ts b/tests/release-preview.test.ts
new file mode 100644
index 0000000..ff51d06
--- /dev/null
+++ b/tests/release-preview.test.ts
@@ -0,0 +1,43 @@
+import { describe, expect, test } from "bun:test"
+import { buildReleasePreview, bumpVersion, loadCurrentVersions } from "../src/release/components"
+
+describe("release preview", () => {
+ test("uses changed files to determine affected components and next versions", async () => {
+ const versions = await loadCurrentVersions()
+ const preview = await buildReleasePreview({
+ title: "fix: adjust ce:plan-beta wording",
+ files: ["plugins/compound-engineering/skills/ce-plan-beta/SKILL.md"],
+ })
+
+ expect(preview.components).toHaveLength(1)
+ expect(preview.components[0].component).toBe("compound-engineering")
+ expect(preview.components[0].inferredBump).toBe("patch")
+ expect(preview.components[0].nextVersion).toBe(bumpVersion(versions["compound-engineering"], "patch"))
+ })
+
+ test("supports per-component overrides without affecting unrelated components", async () => {
+ const versions = await loadCurrentVersions()
+ const preview = await buildReleasePreview({
+ title: "fix: update coding tutor prompts",
+ files: ["plugins/coding-tutor/README.md"],
+ overrides: {
+ "coding-tutor": "minor",
+ },
+ })
+
+ expect(preview.components).toHaveLength(1)
+ expect(preview.components[0].component).toBe("coding-tutor")
+ expect(preview.components[0].inferredBump).toBe("patch")
+ expect(preview.components[0].effectiveBump).toBe("minor")
+ expect(preview.components[0].nextVersion).toBe(bumpVersion(versions["coding-tutor"], "minor"))
+ })
+
+ test("docs-only changes remain non-releasable by default", async () => {
+ const preview = await buildReleasePreview({
+ title: "docs: update release planning notes",
+ files: ["docs/plans/2026-03-17-001-feat-release-automation-migration-beta-plan.md"],
+ })
+
+ expect(preview.components).toHaveLength(0)
+ })
+})
diff --git a/tests/review-skill-contract.test.ts b/tests/review-skill-contract.test.ts
new file mode 100644
index 0000000..efddd7a
--- /dev/null
+++ b/tests/review-skill-contract.test.ts
@@ -0,0 +1,118 @@
+import { readFile } from "fs/promises"
+import path from "path"
+import { describe, expect, test } from "bun:test"
+
+async function readRepoFile(relativePath: string): Promise {
+ return readFile(path.join(process.cwd(), relativePath), "utf8")
+}
+
+describe("ce-review contract", () => {
+ test("documents explicit modes and orchestration boundaries", async () => {
+ const content = await readRepoFile("plugins/compound-engineering/skills/ce-review/SKILL.md")
+
+ expect(content).toContain("## Mode Detection")
+ expect(content).toContain("mode:autofix")
+ expect(content).toContain("mode:report-only")
+ expect(content).toContain(".context/compound-engineering/ce-review//")
+ expect(content).toContain("Do not create residual todos or `.context` artifacts.")
+ expect(content).toContain(
+ "Do not start a mutating review round concurrently with browser testing on the same checkout.",
+ )
+ expect(content).toContain("mode:report-only cannot switch the shared checkout to review a PR target")
+ expect(content).toContain("mode:report-only cannot switch the shared checkout to review another branch")
+ expect(content).toContain("Resolve the base ref from the PR's actual base repository, not by assuming `origin`")
+ expect(content).not.toContain("Which severities should I fix?")
+ })
+
+ test("documents policy-driven routing and residual handoff", async () => {
+ const content = await readRepoFile("plugins/compound-engineering/skills/ce-review/SKILL.md")
+
+ expect(content).toContain("## Action Routing")
+ expect(content).toContain("Only `safe_auto -> review-fixer` enters the in-skill fixer queue automatically.")
+ expect(content).toContain(
+ "Only include `gated_auto` findings in the fixer queue after the user explicitly approves the specific items.",
+ )
+ expect(content).toContain(
+ 'If the fixer queue is empty, do not offer "Apply safe_auto fixes" options.',
+ )
+ expect(content).toContain(
+ "In autofix mode, create durable todo files only for unresolved actionable findings whose final owner is `downstream-resolver`.",
+ )
+ expect(content).toContain("If only advisory outputs remain, create no todos.")
+ expect(content).toContain("**On the resolved review base/default branch:**")
+ expect(content).toContain("git push --set-upstream origin HEAD")
+ expect(content).not.toContain("**On main/master:**")
+ })
+
+ test("keeps findings schema and downstream docs aligned", async () => {
+ const rawSchema = await readRepoFile(
+ "plugins/compound-engineering/skills/ce-review/references/findings-schema.json",
+ )
+ const schema = JSON.parse(rawSchema) as {
+ _meta: { confidence_thresholds: { suppress: string } }
+ properties: {
+ findings: {
+ items: {
+ properties: {
+ autofix_class: { enum: string[] }
+ owner: { enum: string[] }
+ requires_verification: { type: string }
+ }
+ required: string[]
+ }
+ }
+ }
+ }
+
+ expect(schema.properties.findings.items.required).toEqual(
+ expect.arrayContaining(["autofix_class", "owner", "requires_verification"]),
+ )
+ expect(schema.properties.findings.items.properties.autofix_class.enum).toEqual([
+ "safe_auto",
+ "gated_auto",
+ "manual",
+ "advisory",
+ ])
+ expect(schema.properties.findings.items.properties.owner.enum).toEqual([
+ "review-fixer",
+ "downstream-resolver",
+ "human",
+ "release",
+ ])
+ expect(schema.properties.findings.items.properties.requires_verification.type).toBe("boolean")
+ expect(schema._meta.confidence_thresholds.suppress).toContain("0.60")
+
+ const fileTodos = await readRepoFile("plugins/compound-engineering/skills/todo-create/SKILL.md")
+ expect(fileTodos).toContain("/ce:review mode:autofix")
+ expect(fileTodos).toContain("/todo-resolve")
+
+ const resolveTodos = await readRepoFile("plugins/compound-engineering/skills/todo-resolve/SKILL.md")
+ expect(resolveTodos).toContain("ce:review mode:autofix")
+ expect(resolveTodos).toContain("safe_auto")
+ })
+
+ test("fails closed when merge-base is unresolved instead of falling back to git diff HEAD", async () => {
+ const content = await readRepoFile("plugins/compound-engineering/skills/ce-review/SKILL.md")
+
+ // No scope path should fall back to `git diff HEAD` or `git diff --cached` — those only
+ // show uncommitted changes and silently produce empty diffs on clean feature branches.
+ expect(content).not.toContain("git diff --name-only HEAD")
+ expect(content).not.toContain("git diff -U10 HEAD")
+ expect(content).not.toContain("git diff --cached")
+
+ // All three scope paths must emit ERROR when BASE is unresolved
+ const errorMatches = content.match(/echo "ERROR: Unable to resolve/g)
+ expect(errorMatches?.length).toBe(3) // PR mode, branch mode, standalone mode
+ })
+
+ test("orchestration callers pass explicit mode flags", async () => {
+ const lfg = await readRepoFile("plugins/compound-engineering/skills/lfg/SKILL.md")
+ expect(lfg).toContain("/ce:review mode:autofix")
+
+ const slfg = await readRepoFile("plugins/compound-engineering/skills/slfg/SKILL.md")
+ // slfg uses report-only for the parallel phase (safe with browser testing)
+ // then autofix sequentially after to emit fixes and todos
+ expect(slfg).toContain("/ce:review mode:report-only")
+ expect(slfg).toContain("/ce:review mode:autofix")
+ })
+})
diff --git a/tests/windsurf-converter.test.ts b/tests/windsurf-converter.test.ts
index 4264a17..5f76a25 100644
--- a/tests/windsurf-converter.test.ts
+++ b/tests/windsurf-converter.test.ts
@@ -508,6 +508,27 @@ Task best-practices-researcher(topic)`
expect(result).not.toContain("Task repo-research-analyst")
})
+ test("transforms namespaced Task agent calls using final segment", () => {
+ const input = `Run agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:review:security-reviewer(code_diff)`
+
+ const result = transformContentForWindsurf(input)
+ expect(result).toContain("Use the @repo-research-analyst skill: feature_description")
+ expect(result).toContain("Use the @security-reviewer skill: code_diff")
+ expect(result).not.toContain("compound-engineering:")
+ })
+
+ test("transforms zero-argument Task calls", () => {
+ const input = `- Task compound-engineering:review:code-simplicity-reviewer()`
+
+ const result = transformContentForWindsurf(input)
+ expect(result).toContain("Use the @code-simplicity-reviewer skill")
+ expect(result).not.toContain("compound-engineering:")
+ expect(result).not.toContain("code-simplicity-reviewer skill:")
+ })
+
test("keeps @agent references as-is for known agents (Windsurf skill invocation syntax)", () => {
const result = transformContentForWindsurf("Ask @security-sentinel for a review.", ["security-sentinel"])
expect(result).toContain("@security-sentinel")
diff --git a/tests/windsurf-writer.test.ts b/tests/windsurf-writer.test.ts
index 9d1129c..fdeb9a7 100644
--- a/tests/windsurf-writer.test.ts
+++ b/tests/windsurf-writer.test.ts
@@ -85,6 +85,43 @@ describe("writeWindsurfBundle", () => {
expect(mcpContent.mcpServers.local).toEqual({ command: "echo", args: ["hello"] })
})
+ test("transforms Task calls in copied SKILL.md files", async () => {
+ const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "windsurf-skill-transform-"))
+ const sourceSkillDir = path.join(tempRoot, "source-skill")
+ await fs.mkdir(sourceSkillDir, { recursive: true })
+ await fs.writeFile(
+ path.join(sourceSkillDir, "SKILL.md"),
+ `---
+name: ce:plan
+description: Planning workflow
+---
+
+Run these research agents:
+
+- Task compound-engineering:research:repo-research-analyst(feature_description)
+- Task compound-engineering:research:learnings-researcher(feature_description)
+- Task compound-engineering:review:code-simplicity-reviewer()
+`,
+ )
+
+ const bundle: WindsurfBundle = {
+ ...emptyBundle,
+ skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
+ }
+
+ await writeWindsurfBundle(tempRoot, bundle)
+
+ const installedSkill = await fs.readFile(
+ path.join(tempRoot, "skills", "ce:plan", "SKILL.md"),
+ "utf8",
+ )
+
+ expect(installedSkill).toContain("Use the @repo-research-analyst skill: feature_description")
+ expect(installedSkill).toContain("Use the @learnings-researcher skill: feature_description")
+ expect(installedSkill).toContain("Use the @code-simplicity-reviewer skill")
+ expect(installedSkill).not.toContain("Task compound-engineering:")
+ })
+
test("writes directly into outputRoot without nesting", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "windsurf-direct-"))
const bundle: WindsurfBundle = {