Skip to content

Instantly share code, notes, and snippets.

@anurag-arjun
Last active November 30, 2025 08:02
Show Gist options
  • Select an option

  • Save anurag-arjun/5b1b60a1f8e2ee79eb48dc780f4bbe4b to your computer and use it in GitHub Desktop.

Select an option

Save anurag-arjun/5b1b60a1f8e2ee79eb48dc780f4bbe4b to your computer and use it in GitHub Desktop.
Setup compounding-engineering plugin for Claude Code + Droid CLI

Compounding Engineering Plugin Setup

Setup script for installing the compounding-engineering plugin with both Claude Code and Droid CLI compatibility.

Quick Install

curl -fsSL https://gist.githubusercontent.com/anurag-arjun/5b1b60a1f8e2ee79eb48dc780f4bbe4b/raw/setup-compounding-engineering.sh | bash

What It Does

  1. Fetches the latest plugin from GitHub
  2. Installs for Claude Code (if available)
  3. Converts and installs for Droid CLI:
    • Flattens nested directories
    • Adds required model and tools fields
    • Converts argument syntax

What Gets Installed

Location Contents
~/.factory/commands/ 19 slash commands
~/.factory/droids/ 24 custom droids
Claude Code Full plugin with skills

Key Commands

  • /plan - Transform ideas into structured plans
  • /work - Execute plans systematically
  • /review - Multi-agent code review
  • /compound - Document solved problems

After Installation

For Droid CLI:

  1. Start Droid: droid
  2. Enable Custom Droids: /settings → Experimental → Custom Droids
  3. Use commands like /plan, /work, /review

For Claude Code:

  • Plugin is auto-installed, commands available immediately

Update

Run the script again to pull the latest version from upstream.

#!/usr/bin/env bash
# Setup compounding-engineering plugin for both Claude Code and Droid CLI
#
# Usage: ./setup-compounding-engineering.sh
#
# This script:
# 1. Fetches the latest plugin from GitHub
# 2. Converts it to Droid CLI compatible format
# 3. Installs it for both Claude Code and Droid CLI
#
# Run this anytime to update to the latest version from upstream.
set -euo pipefail
PLUGIN_REPO="EveryInc/compounding-engineering-plugin"
PLUGIN_NAME="compounding-engineering"
TEMP_DIR=$(mktemp -d)
FACTORY_DIR="${FACTORY_DIR:-$HOME/.factory}"
cleanup() {
rm -rf "$TEMP_DIR"
}
trap cleanup EXIT
echo "=== Compounding Engineering Plugin Setup ==="
echo ""
# Step 1: Fetch plugin from GitHub
echo "1. Fetching latest plugin from GitHub..."
git clone --depth 1 "https://github.com/$PLUGIN_REPO.git" "$TEMP_DIR/plugin" 2>/dev/null
PLUGIN_SOURCE="$TEMP_DIR/plugin/plugins/$PLUGIN_NAME"
if [ ! -d "$PLUGIN_SOURCE" ]; then
echo "Error: Plugin not found at expected location"
exit 1
fi
echo " Found plugin version: $(grep -o '"version": "[^"]*"' "$PLUGIN_SOURCE/.claude-plugin/plugin.json" | head -1 | cut -d'"' -f4)"
# Step 2: Install for Claude Code (if available)
echo ""
echo "2. Checking Claude Code..."
if command -v claude &> /dev/null; then
echo " Claude Code detected. Installing plugin..."
# Check if marketplace is added
if ! claude plugin list 2>/dev/null | grep -q "$PLUGIN_NAME"; then
echo " Adding marketplace and installing..."
claude plugin marketplace add "https://github.com/$PLUGIN_REPO" 2>/dev/null || true
claude plugin install "$PLUGIN_NAME" 2>/dev/null || echo " (May need manual install via /plugin install)"
else
echo " Plugin already installed in Claude Code"
fi
else
echo " Claude Code not found. Skipping Claude Code installation."
echo " To install later: /plugin marketplace add https://github.com/$PLUGIN_REPO"
fi
# Step 3: Convert and install for Droid CLI
echo ""
echo "3. Setting up for Droid CLI..."
DROID_COMMANDS="$FACTORY_DIR/commands"
DROID_DROIDS="$FACTORY_DIR/droids"
mkdir -p "$DROID_COMMANDS" "$DROID_DROIDS"
# Flatten and copy commands
echo " Converting commands..."
cmd_count=0
find "$PLUGIN_SOURCE/commands" -name "*.md" -type f | while read -r cmd_file; do
filename=$(basename "$cmd_file")
# Replace #$ARGUMENTS with $ARGUMENTS for Droid compatibility
sed 's/#\$ARGUMENTS/$ARGUMENTS/g' "$cmd_file" > "$DROID_COMMANDS/$filename"
echo " - $filename"
done
cmd_count=$(find "$PLUGIN_SOURCE/commands" -name "*.md" -type f | wc -l)
# Flatten and copy agents as droids
echo " Converting agents to droids..."
agent_count=0
find "$PLUGIN_SOURCE/agents" -name "*.md" -type f | while read -r agent_file; do
filename=$(basename "$agent_file")
content=$(cat "$agent_file")
# Add model and tools fields if missing (required by Droid CLI)
if [[ "$content" == ---* ]]; then
# Extract frontmatter
frontmatter=$(echo "$content" | sed -n '2,/^---$/p' | sed '$d')
body=$(echo "$content" | sed -n '/^---$/,/^---$/d' | tail -n +1)
# Add model if missing
if ! echo "$frontmatter" | grep -q "^model:"; then
frontmatter="$frontmatter
model: inherit"
fi
# Add tools if missing
if ! echo "$frontmatter" | grep -q "^tools:"; then
frontmatter="$frontmatter
tools: []"
fi
printf -- "---\n%s\n---\n%s" "$frontmatter" "$body" > "$DROID_DROIDS/$filename"
else
cp "$agent_file" "$DROID_DROIDS/$filename"
fi
echo " - $filename"
done
agent_count=$(find "$PLUGIN_SOURCE/agents" -name "*.md" -type f | wc -l)
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Installed:"
echo " Commands: $(find "$DROID_COMMANDS" -name "*.md" -newer "$TEMP_DIR" 2>/dev/null | wc -l || echo $cmd_count) → $DROID_COMMANDS"
echo " Droids: $(find "$DROID_DROIDS" -name "*.md" -newer "$TEMP_DIR" 2>/dev/null | wc -l || echo $agent_count) → $DROID_DROIDS"
echo ""
echo "To use with Droid CLI:"
echo " 1. Start Droid: droid"
echo " 2. Enable Custom Droids: /settings → Experimental → Custom Droids"
echo " 3. Use commands: /plan, /work, /review, /compound"
echo ""
echo "To update to latest version, run this script again."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment