From spectacular
Validates CLAUDE.md for required setup commands (install, optional postinstall) before creating worktrees or executing tasks, with clear error messages and examples if missing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spectacular:validating-setup-commandsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Worktrees require dependency installation before tasks can execute.** Projects MUST define setup commands in CLAUDE.md.
Worktrees require dependency installation before tasks can execute. Projects MUST define setup commands in CLAUDE.md.
This skill validates setup commands exist BEFORE creating worktrees, preventing cryptic failures later.
Use this skill when:
Use early: Validate during setup phase, not during task execution.
Without validation:
With validation:
Announce: "Validating CLAUDE.md setup commands before creating worktrees."
# Get repo root
REPO_ROOT=$(git rev-parse --show-toplevel)
# Check if CLAUDE.md exists
if [ ! -f "$REPO_ROOT/CLAUDE.md" ]; then
echo "❌ Error: CLAUDE.md not found in repository root"
echo ""
echo "Spectacular requires CLAUDE.md to define setup commands."
echo "See: https://docs.claude.com/claude-code"
exit 1
fi
Why fail fast: No CLAUDE.md = no command configuration. Stop before creating any worktrees.
# Parse CLAUDE.md for setup section
INSTALL_CMD=$(grep -A 10 "^### Setup" "$REPO_ROOT/CLAUDE.md" | grep "^- \*\*install\*\*:" | sed 's/.*: `\(.*\)`.*/\1/')
if [ -z "$INSTALL_CMD" ]; then
echo "❌ Error: Setup commands not defined in CLAUDE.md"
echo ""
echo "Worktrees require dependency installation before tasks can execute."
echo ""
echo "Add this section to CLAUDE.md:"
echo ""
echo "## Development Commands"
echo ""
echo "### Setup"
echo "- **install**: \`npm install\` (or your package manager)"
echo "- **postinstall**: \`npx prisma generate\` (optional - any codegen)"
echo ""
echo "Example for different package managers:"
echo "- Node.js: npm install, pnpm install, yarn, or bun install"
echo "- Python: pip install -r requirements.txt"
echo "- Rust: cargo build"
echo "- Go: go mod download"
echo ""
echo "See: https://docs.claude.com/claude-code"
echo ""
echo "Execution stopped. Add setup commands to CLAUDE.md and retry."
exit 1
fi
# Extract postinstall command (optional)
POSTINSTALL_CMD=$(grep -A 10 "^### Setup" "$REPO_ROOT/CLAUDE.md" | grep "^- \*\*postinstall\*\*:" | sed 's/.*: `\(.*\)`.*/\1/')
Parsing logic:
### Setup header**install**: command (required)**postinstall**: command (optional)# Report detected commands
echo "✅ Setup commands found in CLAUDE.md"
echo " install: $INSTALL_CMD"
if [ -n "$POSTINSTALL_CMD" ]; then
echo " postinstall: $POSTINSTALL_CMD"
fi
Store for later use:
INSTALL_CMD to callerPOSTINSTALL_CMD (may be empty)The skill expects this exact format:
## Development Commands
### Setup
- **install**: `npm install`
- **postinstall**: `npx prisma generate` (optional)
Format requirements:
### Setup (exactly)- **install**: command`` (required)- **postinstall**: command`` (optional)Multi-language examples:
### Setup
- **install**: `npm install` # Node.js
- **install**: `pip install -r requirements.txt` # Python
- **install**: `cargo build` # Rust
- **install**: `go mod download` # Go
- **install**: `bundle install` # Ruby
❌ Error: CLAUDE.md not found in repository root
Spectacular requires CLAUDE.md to define setup commands.
See: https://docs.claude.com/claude-code
User action: Create CLAUDE.md in repository root.
❌ Error: Setup commands not defined in CLAUDE.md
Worktrees require dependency installation before tasks can execute.
Add this section to CLAUDE.md:
## Development Commands
### Setup
- **install**: `npm install` (or your package manager)
- **postinstall**: `npx prisma generate` (optional - any codegen)
Example for different package managers:
- Node.js: npm install, pnpm install, yarn, or bun install
- Python: pip install -r requirements.txt
- Rust: cargo build
- Go: go mod download
See: https://docs.claude.com/claude-code
Execution stopped. Add setup commands to CLAUDE.md and retry.
User action: Add Setup section with at least install command.
How commands use this skill:
# In execute.md or spec.md:
# Step 1.5: Validate Setup Commands
# Use validating-setup-commands skill to extract and verify
INSTALL_CMD=$(validate_setup_commands_install)
POSTINSTALL_CMD=$(validate_setup_commands_postinstall)
# Step 3: Create worktrees
git worktree add .worktrees/{runid}-task-1
# Step 4: Install dependencies using validated commands
cd .worktrees/{runid}-task-1
$INSTALL_CMD
if [ -n "$POSTINSTALL_CMD" ]; then
$POSTINSTALL_CMD
fi
Reusable across:
/spectacular:spec - Validates before creating main worktree/spectacular:execute - Validates before creating task worktreesWrong: Create worktrees, then validate Right: Validate BEFORE creating ANY worktrees
Why: Failed validation after worktrees exist leaves orphaned directories.
Wrong: "Error: Add setup commands" Right: "Error: Add setup commands. Here's the exact format: [example]"
Why: Users need to know WHAT to add and WHERE.
Wrong: Fail if postinstall missing Right: Postinstall is optional (codegen only needed in some projects)
Why: Not all projects have codegen (Prisma, GraphQL, etc.).
Validation sequence:
### Setup sectioninstall command (exit if missing)postinstall command (optional)Exit points:
Format validated:
### Setup header- **install**: command``- **postinstall**: command`` (optional)Validate setup commands BEFORE creating worktrees.
Early validation with clear error messages prevents confusing failures during task execution.
The skill provides users with exact examples of what to add, making fixes easy.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin arittr-spectacularValidates CLAUDE.md files for structure, completeness, required/recommended sections, secrets, command accuracy, and freshness; generates reports and offers auto-fixes.
Initializes project configuration by auto-detecting framework, replacing CLAUDE.md placeholders, and installing rules, hooks, and scripts.