Files
Claude-Code-Workflow/.claude/scripts/plan-executor.sh
catlog22 445ac823ba Initial release: Claude Code Workflow (CCW) v2.0
🚀 Revolutionary AI-powered development workflow orchestration system

## 🔥 Core Innovations
- **Document-State Separation**: Markdown for planning, JSON for execution state
- **Progressive Complexity Management**: Level 0-2 adaptive workflow depth
- **5-Agent Orchestration**: Specialized AI agents with context preservation
- **Session-First Architecture**: Auto-discovery and state inheritance

## 🏗️ Key Features
- Intelligent workflow orchestration (Simple/Medium/Complex patterns)
- Real-time document-state synchronization with conflict resolution
- Hierarchical task management with 3-level JSON structure
- Gemini CLI integration with 12+ specialized templates
- Comprehensive file output generation for all workflow commands

## 📦 Installation
Remote one-liner installation:
```
iex (iwr -useb https://raw.githubusercontent.com/catlog22/Claude-CCW/main/install-remote.ps1)
```

## 🎯 System Architecture
4-layer intelligent development architecture:
1. Command Layer - Smart routing and version management
2. Agent Layer - 5 specialized development agents
3. Workflow Layer - Gemini templates and task orchestration
4. Memory Layer - Distributed documentation and auto-sync

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 17:39:54 +08:00

101 lines
3.1 KiB
Bash

#!/bin/bash
# plan-executor.sh - DMSFlow Planning Template Loader
# Returns role-specific planning templates for Claude processing
set -e
# Define paths
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEMPLATE_DIR="${SCRIPT_DIR}/../planning-templates"
# Parse arguments
COMMAND="$1"
ROLE="$2"
# Handle version check
if [ "$COMMAND" = "--version" ] || [ "$COMMAND" = "-v" ]; then
echo "DMSFlow plan-executor v2.0"
echo "Semantic-based planning role system"
exit 0
fi
# List all available planning roles
if [ "$COMMAND" = "--list" ]; then
echo "Available Planning Roles:"
echo "========================"
for file in "$TEMPLATE_DIR"/*.md; do
if [ -f "$file" ]; then
# Extract name and description from YAML frontmatter
name=$(grep "^name:" "$file" | head -1 | cut -d: -f2 | sed 's/^ *//' | sed 's/ *$//')
desc=$(grep "^description:" "$file" | head -1 | cut -d: -f2- | sed 's/^ *//' | sed 's/ *$//')
if [ -n "$name" ] && [ -n "$desc" ]; then
printf "%-20s - %s\n" "$name" "$desc"
fi
fi
done
exit 0
fi
# Load specific planning role
if [ "$COMMAND" = "--load" ] && [ -n "$ROLE" ]; then
TEMPLATE_PATH="${TEMPLATE_DIR}/${ROLE}.md"
if [ -f "$TEMPLATE_PATH" ]; then
# Output content, skipping YAML frontmatter
awk '
BEGIN { in_yaml = 0; yaml_ended = 0 }
/^---$/ {
if (!yaml_ended) {
if (in_yaml) yaml_ended = 1
else in_yaml = 1
next
}
}
yaml_ended { print }
' "$TEMPLATE_PATH"
else
>&2 echo "Error: Planning role '$ROLE' not found"
>&2 echo "Use --list to see available planning roles"
exit 1
fi
exit 0
fi
# Handle legacy usage (direct role name)
if [ -n "$COMMAND" ] && [ "$COMMAND" != "--help" ] && [ "$COMMAND" != "--list" ] && [ "$COMMAND" != "--load" ]; then
TEMPLATE_PATH="${TEMPLATE_DIR}/${COMMAND}.md"
if [ -f "$TEMPLATE_PATH" ]; then
# Output content, skipping YAML frontmatter
awk '
BEGIN { in_yaml = 0; yaml_ended = 0 }
/^---$/ {
if (!yaml_ended) {
if (in_yaml) yaml_ended = 1
else in_yaml = 1
next
}
}
yaml_ended { print }
' "$TEMPLATE_PATH"
exit 0
else
>&2 echo "Error: Planning role '$COMMAND' not found"
>&2 echo "Use --list to see available planning roles"
exit 1
fi
fi
# Show help
echo "Usage:"
echo " plan-executor.sh --list List all available planning roles with descriptions"
echo " plan-executor.sh --load <role> Load specific planning role template"
echo " plan-executor.sh <role> Load specific role template (legacy format)"
echo " plan-executor.sh --help Show this help message"
echo " plan-executor.sh --version Show version information"
echo ""
echo "Examples:"
echo " plan-executor.sh --list"
echo " plan-executor.sh --load system-architect"
echo " plan-executor.sh feature-planner"