feat(ce-setup): unified setup skill with dependency management and config bootstrapping (#345)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
156
plugins/compound-engineering/skills/ce-setup/SKILL.md
Normal file
156
plugins/compound-engineering/skills/ce-setup/SKILL.md
Normal file
@@ -0,0 +1,156 @@
|
||||
---
|
||||
name: ce-setup
|
||||
description: "Diagnose and configure compound-engineering environment. Checks CLI dependencies, plugin version, and repo-local config. Offers guided installation for missing tools. Use when troubleshooting missing tools, verifying setup, or before onboarding."
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
# Compound Engineering Setup
|
||||
|
||||
## Interaction Method
|
||||
|
||||
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.
|
||||
|
||||
Interactive setup for compound-engineering — diagnoses environment health, cleans obsolete repo-local CE config, and helps configure required tools. Review agent selection is handled automatically by `ce:review`; project-specific review guidance belongs in `CLAUDE.md` or `AGENTS.md`.
|
||||
|
||||
## Phase 1: Diagnose
|
||||
|
||||
### Step 1: Determine Plugin Version
|
||||
|
||||
Detect the installed compound-engineering plugin version by reading the plugin metadata or manifest. This is platform-specific -- use whatever mechanism is available (e.g., reading `plugin.json` from the plugin root or cache directory). If the version cannot be determined, skip this step.
|
||||
|
||||
If a version is found, pass it to the check script via `--version`. Otherwise omit the flag.
|
||||
|
||||
### Step 2: Run the Health Check Script
|
||||
|
||||
Before running the script, display: "Compound Engineering -- checking your environment..."
|
||||
|
||||
Run the bundled check script. Do not perform manual dependency checks -- the script handles all CLI tools, repo-local CE file checks, and `.gitignore` guidance in one pass.
|
||||
|
||||
```bash
|
||||
bash scripts/check-health --version VERSION
|
||||
```
|
||||
|
||||
Or without version if Step 1 could not determine it:
|
||||
|
||||
```bash
|
||||
bash scripts/check-health
|
||||
```
|
||||
|
||||
Script reference: `scripts/check-health`
|
||||
|
||||
Display the script's output to the user.
|
||||
|
||||
### Step 3: Evaluate Results
|
||||
|
||||
**Platform detection (pre-resolved):** !`[ -n "${CLAUDE_PLUGIN_ROOT}" ] && echo "CLAUDE_CODE" || echo "OTHER"`
|
||||
|
||||
If the line above resolved to `CLAUDE_CODE`, this is a Claude Code session and `/ce-update` is available. Otherwise, omit any `/ce-update` references from output.
|
||||
|
||||
After the diagnostic report, check whether:
|
||||
|
||||
- any dependencies are missing (reported as yellow in the script output)
|
||||
- `compound-engineering.local.md` is present and needs cleanup
|
||||
- `.compound-engineering/config.local.yaml` does not exist or is not safely gitignored
|
||||
- `.compound-engineering/config.local.example.yaml` is missing or outdated
|
||||
|
||||
If everything is installed, no repo-local cleanup is needed, and `.compound-engineering/config.local.yaml` already exists and is gitignored, display the tool list and completion message. Parse the tool names from the script output and list each with a green circle:
|
||||
|
||||
```
|
||||
✅ Compound Engineering setup complete
|
||||
|
||||
Tools: 🟢 agent-browser 🟢 gh 🟢 jq 🟢 vhs 🟢 silicon 🟢 ffmpeg
|
||||
Config: ✅
|
||||
|
||||
Run /ce-setup anytime to re-check.
|
||||
```
|
||||
|
||||
If this is a Claude Code session, append to the message: "Run /ce-update to grab the latest plugin version."
|
||||
|
||||
Stop here.
|
||||
|
||||
Otherwise proceed to Phase 2 to resolve any issues. Handle repo-local cleanup (Step 4) first, then config bootstrapping (Step 5), then missing dependencies (Step 6).
|
||||
|
||||
## Phase 2: Fix
|
||||
|
||||
### Step 4: Resolve Repo-Local CE Issues
|
||||
|
||||
Resolve the repository root (`git rev-parse --show-toplevel`). If `compound-engineering.local.md` exists at the repo root, explain that it is obsolete because review-agent selection is automatic and CE now uses `.compound-engineering/config.local.yaml` for any surviving machine-local state. Ask whether to delete it now. Use the repo-root path when deleting.
|
||||
|
||||
### Step 5: Bootstrap Project Config
|
||||
|
||||
Resolve the repository root (`git rev-parse --show-toplevel`). All paths below are relative to the repo root, not the current working directory.
|
||||
|
||||
**Example file (always refresh):** Copy `references/config-template.yaml` to `<repo-root>/.compound-engineering/config.local.example.yaml`, creating the directory if needed. This file is committed to the repo and always overwritten with the latest template so teammates can see available settings.
|
||||
|
||||
**Local config (create once):** If `.compound-engineering/config.local.yaml` does not exist, ask whether to create it:
|
||||
|
||||
```
|
||||
Set up a local config file for this project?
|
||||
This saves your Compound Engineering preferences (like which tools to use and how workflows behave).
|
||||
Everything starts commented out -- you only enable what you need.
|
||||
|
||||
1. Yes, create it (Recommended)
|
||||
2. No thanks
|
||||
```
|
||||
|
||||
If the user approves, copy `references/config-template.yaml` to `<repo-root>/.compound-engineering/config.local.yaml`. If `.compound-engineering/config.local.yaml` is not already covered by `.gitignore`, offer to add the entry:
|
||||
|
||||
```text
|
||||
.compound-engineering/*.local.yaml
|
||||
```
|
||||
|
||||
If the local config already exists, check whether it is safely gitignored. If not, offer to add the `.gitignore` entry as above.
|
||||
|
||||
### Step 6: Offer Installation
|
||||
|
||||
Present the missing dependencies using a multiSelect question with all items pre-selected. Use the install commands and URLs from the script's diagnostic output.
|
||||
|
||||
```
|
||||
The following tools are missing. Select which to install:
|
||||
(All items are pre-selected)
|
||||
|
||||
Recommended:
|
||||
[x] agent-browser - Browser automation for testing and screenshots
|
||||
[x] gh - GitHub CLI for issues and PRs
|
||||
[x] jq - JSON processor
|
||||
[x] vhs (charmbracelet/vhs) - Create GIFs from CLI output
|
||||
[x] silicon (Aloxaf/silicon) - Generate code screenshots
|
||||
[x] ffmpeg - Video processing for feature demos
|
||||
```
|
||||
|
||||
Only show dependencies that are actually missing. Omit installed ones.
|
||||
|
||||
### Step 7: Install Selected Dependencies
|
||||
|
||||
For each selected dependency, in order:
|
||||
|
||||
1. **Show the install command** (from the diagnostic output) and ask for approval:
|
||||
|
||||
```
|
||||
Install agent-browser?
|
||||
Command: CI=true npm install -g agent-browser --no-audit --no-fund --loglevel=error && agent-browser install && npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser -g -y
|
||||
|
||||
1. Run this command
|
||||
2. Skip - I'll install it manually
|
||||
```
|
||||
|
||||
2. **If approved:** Run the install command using a shell execution tool. After the command completes, verify installation by running the dependency's check command (e.g., `command -v agent-browser`).
|
||||
|
||||
3. **If verification succeeds:** Report success.
|
||||
|
||||
4. **If verification fails or install errors:** Display the project URL as fallback and continue to the next dependency.
|
||||
|
||||
### Step 8: Summary
|
||||
|
||||
Display a brief summary:
|
||||
|
||||
```
|
||||
✅ Compound Engineering setup complete
|
||||
|
||||
Installed: agent-browser, gh, jq
|
||||
Skipped: rtk
|
||||
|
||||
Run /ce-setup anytime to re-check.
|
||||
```
|
||||
|
||||
If this is a Claude Code session (per platform detection in Step 3), append: "Run /ce-update to grab the latest plugin version."
|
||||
@@ -0,0 +1,12 @@
|
||||
# Compound Engineering -- local config
|
||||
# Copy to .compound-engineering/config.local.yaml in your project root.
|
||||
# All settings are optional. Invalid values fall through to defaults.
|
||||
|
||||
# --- Work delegation (Codex) ---
|
||||
|
||||
# work_delegate: codex # codex | false (default: false)
|
||||
# work_delegate_consent: true # true | false (default: false)
|
||||
# work_delegate_sandbox: yolo # yolo | full-auto (default: yolo)
|
||||
# work_delegate_decision: auto # auto | ask (default: auto)
|
||||
# work_delegate_model: gpt-5.4 # any valid codex model (default: gpt-5.4)
|
||||
# work_delegate_effort: high # minimal | low | medium | high | xhigh (default: high)
|
||||
179
plugins/compound-engineering/skills/ce-setup/scripts/check-health
Executable file
179
plugins/compound-engineering/skills/ce-setup/scripts/check-health
Executable file
@@ -0,0 +1,179 @@
|
||||
#!/usr/bin/env bash
|
||||
# Compound Engineering environment health check
|
||||
# Outputs a formatted diagnostic report in one pass
|
||||
|
||||
set -o pipefail
|
||||
|
||||
# =====================================================
|
||||
# Dependency config
|
||||
# =====================================================
|
||||
# Format: name|tier|install_cmd|url
|
||||
# Tiers: recommended (flagged if missing), optional (noted if missing)
|
||||
# To add a dependency: add a line here. No other changes needed.
|
||||
|
||||
deps=(
|
||||
"agent-browser|recommended|CI=true npm install -g agent-browser --no-audit --no-fund --loglevel=error && agent-browser install && npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser -g -y|https://github.com/vercel-labs/agent-browser"
|
||||
"gh|recommended|NONINTERACTIVE=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install -q gh|https://cli.github.com"
|
||||
"jq|recommended|NONINTERACTIVE=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install -q jq|https://jqlang.github.io/jq/"
|
||||
"vhs|recommended|NONINTERACTIVE=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install -q vhs|https://github.com/charmbracelet/vhs"
|
||||
"silicon|recommended|NONINTERACTIVE=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install -q silicon|https://github.com/Aloxaf/silicon"
|
||||
"ffmpeg|recommended|NONINTERACTIVE=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install -q ffmpeg|https://ffmpeg.org/download.html"
|
||||
)
|
||||
|
||||
# =====================================================
|
||||
# Args
|
||||
# =====================================================
|
||||
# --version VERSION (optional) plugin version to display (passed by the agent)
|
||||
|
||||
plugin_version=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--version) [ -n "$2" ] && plugin_version="$2" && shift 2 || shift ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# =====================================================
|
||||
# Helpers
|
||||
# =====================================================
|
||||
|
||||
ok() { echo " 🟢 $1"; }
|
||||
fail() { echo " 🔴 $1"; }
|
||||
warn() { echo " 🟡 $1"; }
|
||||
skip() { echo " ➖ $1"; }
|
||||
detail() { echo " $1"; }
|
||||
section() { echo ""; echo " $1"; }
|
||||
|
||||
has_brew=$(command -v brew >/dev/null 2>&1 && echo "yes" || echo "no")
|
||||
in_repo=$(git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "yes" || echo "no")
|
||||
|
||||
# =====================================================
|
||||
# Check tools
|
||||
# =====================================================
|
||||
|
||||
cli_ok=0; cli_total=0; issues=0
|
||||
|
||||
results=()
|
||||
for entry in "${deps[@]}"; do
|
||||
IFS='|' read -r name tier install_cmd url <<< "$entry"
|
||||
cli_total=$((cli_total + 1))
|
||||
if command -v "$name" >/dev/null 2>&1; then
|
||||
cli_ok=$((cli_ok + 1))
|
||||
results+=("$name|$tier|ok|$install_cmd|$url")
|
||||
else
|
||||
results+=("$name|$tier|missing|$install_cmd|$url")
|
||||
fi
|
||||
done
|
||||
|
||||
# =====================================================
|
||||
# Project checks (repo only)
|
||||
# =====================================================
|
||||
|
||||
legacy_cfg="skip"
|
||||
repo_cfg_gitignore="skip"
|
||||
example_cfg="skip"
|
||||
|
||||
if [ "$in_repo" = "yes" ]; then
|
||||
repo_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
legacy_cfg="missing"
|
||||
[ -f "$repo_root/compound-engineering.local.md" ] && legacy_cfg="present"
|
||||
|
||||
if [ -e "$repo_root/.compound-engineering/config.local.yaml" ] || [ -d "$repo_root/.compound-engineering" ]; then
|
||||
if git check-ignore -q "$repo_root/.compound-engineering/config.local.yaml" 2>/dev/null; then
|
||||
repo_cfg_gitignore="ok"
|
||||
else
|
||||
repo_cfg_gitignore="missing"
|
||||
fi
|
||||
fi
|
||||
|
||||
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
template="$script_dir/../references/config-template.yaml"
|
||||
example="$repo_root/.compound-engineering/config.local.example.yaml"
|
||||
if [ ! -f "$example" ]; then
|
||||
example_cfg="missing"
|
||||
elif [ -f "$template" ] && ! diff -q "$template" "$example" >/dev/null 2>&1; then
|
||||
example_cfg="outdated"
|
||||
else
|
||||
example_cfg="ok"
|
||||
fi
|
||||
fi
|
||||
|
||||
# =====================================================
|
||||
# Output
|
||||
# =====================================================
|
||||
|
||||
echo ""
|
||||
if [ -n "$plugin_version" ]; then
|
||||
ok "Plugin version v${plugin_version}"
|
||||
fi
|
||||
|
||||
# --- Tools ---
|
||||
|
||||
section "Tools ${cli_ok}/${cli_total}"
|
||||
|
||||
for result in "${results[@]}"; do
|
||||
IFS='|' read -r name tier status install_cmd url <<< "$result"
|
||||
if [ "$status" = "ok" ]; then
|
||||
ok "$name"
|
||||
else
|
||||
warn "$name"
|
||||
issues=$((issues + 1))
|
||||
case "$install_cmd" in
|
||||
*brew\ install*)
|
||||
if [ "$has_brew" = "yes" ]; then detail "$install_cmd"
|
||||
else detail "$url"; fi ;;
|
||||
*)
|
||||
detail "$install_cmd"
|
||||
detail "$url" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
# --- Project ---
|
||||
|
||||
if [ "$in_repo" = "yes" ]; then
|
||||
has_project_issues="no"
|
||||
|
||||
if [ "$legacy_cfg" = "present" ]; then
|
||||
has_project_issues="yes"
|
||||
fi
|
||||
if [ "$repo_cfg_gitignore" = "missing" ]; then
|
||||
has_project_issues="yes"
|
||||
fi
|
||||
if [ "$example_cfg" = "missing" ] || [ "$example_cfg" = "outdated" ]; then
|
||||
has_project_issues="yes"
|
||||
fi
|
||||
|
||||
if [ "$has_project_issues" = "yes" ]; then
|
||||
section "Project"
|
||||
|
||||
if [ "$legacy_cfg" = "present" ]; then
|
||||
warn "Outdated Compound Engineering config in this repo"
|
||||
issues=$((issues + 1))
|
||||
fi
|
||||
|
||||
if [ "$repo_cfg_gitignore" = "missing" ]; then
|
||||
warn "Local config not safely gitignored"
|
||||
issues=$((issues + 1))
|
||||
fi
|
||||
|
||||
if [ "$example_cfg" = "missing" ]; then
|
||||
warn "Example config missing (.compound-engineering/config.local.example.yaml)"
|
||||
issues=$((issues + 1))
|
||||
elif [ "$example_cfg" = "outdated" ]; then
|
||||
warn "Example config outdated (new settings available)"
|
||||
issues=$((issues + 1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- Bottom line ---
|
||||
|
||||
echo ""
|
||||
if [ "$issues" -eq 0 ]; then
|
||||
echo " ✅ All clear ${cli_ok}/${cli_total} tools"
|
||||
else
|
||||
echo " ⚠️ ${issues} issue(s) found ${cli_ok}/${cli_total} tools"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: setup
|
||||
description: Configure project-level settings for compound-engineering workflows. Currently a placeholder — review agent selection is handled automatically by ce:review.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
# Compound Engineering Setup
|
||||
|
||||
Project-level configuration for compound-engineering workflows.
|
||||
|
||||
## Current State
|
||||
|
||||
Review agent selection is handled automatically by the `ce:review` skill, which uses intelligent tiered selection based on diff content. No per-project configuration is needed for code reviews.
|
||||
|
||||
If this skill is invoked, inform the user:
|
||||
|
||||
> Review agent configuration is no longer needed — `ce:review` automatically selects the right reviewers based on your diff. Project-specific review context (e.g., "we serve 10k req/s" or "watch for N+1 queries") belongs in your project's CLAUDE.md or AGENTS.md, where all agents already read it.
|
||||
|
||||
## Future Use
|
||||
|
||||
This skill is reserved for future project-level configuration needs beyond review agent selection.
|
||||
Reference in New Issue
Block a user