claude-coordination-template.shā¢4.58 kB
#!/bin/bash
# Claude Coordination Setup Script - Reusable for any project
PROJECT_NAME=${1:-"MyProject"}
PROJECT_PATH=${2:-$(pwd)}
echo "Setting up Claude coordination for: $PROJECT_NAME at $PROJECT_PATH"
# Create directory structure
mkdir -p "$PROJECT_PATH"/{docs/{analysis,tasks,progress,references},scripts,.claude}
# Create START HERE file
cat > "$PROJECT_PATH/CLAUDE_START_HERE.md" << EOF
# š START HERE - Claude Coordination for $PROJECT_NAME
## Project Overview
This is the $PROJECT_NAME project, coordinating work between Claude Code and Claude Desktop.
**Claude Desktop Role**: Analysis, planning, documentation review, architecture decisions
**Claude Code Role**: Implementation, file operations, testing, debugging
## For Claude Desktop
If you're reading this via Project Knowledge, you're already aware of the coordination protocol!
### Your Workflow:
1. Check latest context: Run \`cat CLAUDE_DESKTOP_CONTEXT.md\`
2. Review coordination rules in \`CLAUDE_DESKTOP_README.md\`
3. Analyze key documents in \`docs/references/\`
4. Create analysis documents in \`docs/analysis/\`
5. Leave implementation tasks in \`docs/tasks/\`
## For Claude Code
Run these commands to get started:
\`\`\`bash
cat CLAUDE.md
./scripts/claude-sync.sh
\`\`\`
EOF
# Create Desktop README
cat > "$PROJECT_PATH/CLAUDE_DESKTOP_README.md" << EOF
# Claude Desktop Instructions for $PROJECT_NAME
## Your Role
You (Claude Desktop) are responsible for:
- Analyzing requirements and specifications
- Creating architectural designs
- Planning implementation strategies
- Reviewing code quality
- Writing documentation
## Coordination Protocol
### Starting a Session
1. Ask user to share: \`cat CLAUDE_DESKTOP_CONTEXT.md\`
2. Review current progress and todos
3. Focus on analysis and planning tasks
### During Work
- Create findings in markdown files under docs/analysis/
- Suggest code structures (don't implement)
- Document decisions in docs/references/
- Create tasks for Claude Code in docs/tasks/
### Task File Format
\`\`\`markdown
# Task: [Descriptive Name]
**Priority**: High/Medium/Low
**Created**: YYYY-MM-DD
## Objective
[Clear description]
## Requirements
- [ ] Specific requirement 1
- [ ] Specific requirement 2
## Implementation Notes
[Any helpful context or constraints]
\`\`\`
EOF
# Create sync script
cat > "$PROJECT_PATH/scripts/claude-sync.sh" << 'EOF'
#!/bin/bash
# Claude Desktop <-> Claude Code Synchronization Script
# Create directories if they don't exist
mkdir -p docs/progress docs/analysis docs/tasks
# Update latest progress link (create file if doesn't exist)
touch "docs/progress/$(date +%Y-%m-%d).md"
ln -sf "$(date +%Y-%m-%d).md" docs/progress/latest.md
# Generate session context
cat > CLAUDE_DESKTOP_CONTEXT.md << EOC
# Claude Desktop Context - $(date)
## Current Working Files
$(find . -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.md" | grep -v node_modules | grep -v ".git" | head -15)
## Recent Git Activity
$(git log --oneline -5 2>/dev/null || echo "No git history")
## Active Todos
$(cat docs/progress/active-todos.md 2>/dev/null || echo "No active todos")
## Recent Analysis Files
$(ls -la docs/analysis/ 2>/dev/null | tail -5 || echo "No analysis files yet")
## Pending Tasks
$(ls -la docs/tasks/ 2>/dev/null | grep -v "completed" | tail -5 || echo "No pending tasks")
EOC
echo "Context updated for Claude Desktop coordination"
EOF
chmod +x "$PROJECT_PATH/scripts/claude-sync.sh"
# Create transition helper
cp "$(dirname "$0")/transition.sh" "$PROJECT_PATH/scripts/" 2>/dev/null || echo "Transition script not copied"
# Create initial CLAUDE.md
cat > "$PROJECT_PATH/CLAUDE.md" << EOF
# $PROJECT_NAME - Claude Code Context
## Quick Start
1. Run \`./scripts/claude-sync.sh\` to sync with Claude Desktop
2. Check \`docs/tasks/\` for pending implementation tasks
3. Update progress in \`docs/progress/$(date +%Y-%m-%d).md\`
4. Use \`./scripts/transition.sh\` for smooth handoffs
## Project Structure
- \`docs/analysis/\` - Claude Desktop's analysis documents
- \`docs/tasks/\` - Implementation tasks
- \`docs/progress/\` - Daily progress logs
- \`docs/references/\` - Project documentation
## Coordination Protocol
- Claude Desktop: Analysis & Planning
- Claude Code: Implementation & Testing
EOF
echo "ā
Claude coordination setup complete for $PROJECT_NAME!"
echo ""
echo "š Add these files to Claude Desktop's Project Knowledge:"
echo " - $PROJECT_PATH/CLAUDE_START_HERE.md"
echo " - $PROJECT_PATH/CLAUDE_DESKTOP_README.md"
echo " - [Your key reference documents]"
echo ""
echo "š Ready to use!"