Skip to content

Commit 769da76

Browse files
authored
Merge pull request #72 from ryanmac/improve-conductor-installer-for-claude
feat: Add automatic PR creation to installer for better visibility
2 parents 0ebc187 + b462e73 commit 769da76

File tree

4 files changed

+240
-22
lines changed

4 files changed

+240
-22
lines changed

CLAUDE_CODE_PROMPT.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ I need to move faster. Install Code Conductor into this project so we can run mu
1212
This will transform our development workflow from single-threaded to massively parallel. Instead of one AI doing tasks sequentially, we'll have specialized agents working simultaneously—frontend, backend, testing, DevOps—all coordinated through GitHub Issues.
1313
1414
Please install Code Conductor now:
15-
1. Run: bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
16-
2. When prompted, select options that match our tech stack
17-
3. After installation, run: ./conductor start dev
15+
1. Run: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
16+
2. Wait for the PR to be created and auto-merge
17+
3. After the PR merges, run: ./conductor start dev
1818
4. Complete the [INIT] task to map our entire codebase
1919
5. Submit with: ./conductor complete
2020
@@ -33,8 +33,8 @@ Our current setup is good, but the latest version includes:
3333
- Better error recovery and diagnostics
3434
3535
Upgrade now:
36-
1. Run: bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
37-
2. Choose option 1 (Upgrade) when prompted
36+
1. Run: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --upgrade --create-pr --auto-merge
37+
2. Wait for the upgrade PR to be created and auto-merge
3838
3. Review what's new in the upgrade summary
3939
4. Verify with: ./conductor status
4040
5. If any issues: ./conductor diagnose
@@ -55,17 +55,16 @@ I want you to:
5555
5656
Execute this transformation:
5757
58-
# Install Code Conductor
59-
bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
58+
# Install Code Conductor with automatic PR creation
59+
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
6060
61-
# Installation choices:
62-
- Existing installation? Choose 2 (Reinstall)
63-
- Copy examples? Press Enter (Yes)
64-
- Agent roles? Select all that apply to our stack, then 0
65-
- Demo tasks? Type n (No - we'll generate real ones)
66-
- Auto-commit? Press Enter (Yes)
67-
- Environment? Choose 3 (IDE)
68-
- Start agent? Press Enter (Yes)
61+
# The installer will automatically:
62+
- Configure based on detected tech stack
63+
- Create all necessary files
64+
- Commit changes
65+
- Create and push a PR
66+
- Enable auto-merge
67+
- Complete installation once PR merges
6968
7069
After installation:
7170
1. Claim the [INIT] discovery task automatically
@@ -83,8 +82,8 @@ In under 5 minutes, we'll have a fully mapped codebase with prioritized tasks re
8382
```
8483
Level up our IDE workflow with agentic development. Install Code Conductor to enable parallel AI agents in our familiar environment.
8584
86-
Execute: bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
87-
Choose: Option 3 (IDE) for seamless integration
85+
Execute: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
86+
Automatic: Configures for IDE integration and creates PR
8887
Launch: ./conductor start [role] to unleash specialized agents
8988
9089
Transform your IDE into a multi-agent powerhouse.
@@ -94,8 +93,8 @@ Transform your IDE into a multi-agent powerhouse.
9493
```
9594
Command-line mastery meets agentic development. Set up Code Conductor for terminal-based parallel execution.
9695
97-
Execute: bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
98-
Choose: Option 2 (Terminal) for CLI excellence
96+
Execute: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
97+
Automatic: Configures for terminal workflow and creates PR
9998
Launch: ./conductor start [role] to deploy your agent army
10099
101100
Because the best interface is no interface—just results.
@@ -105,8 +104,8 @@ Because the best interface is no interface—just results.
105104
```
106105
Experience the future of development with the native Conductor app. One-click agent orchestration.
107106
108-
Execute: bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh)
109-
Choose: Option 1 (Conductor) for the premium experience
107+
Execute: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
108+
Automatic: Configures for Conductor app and creates PR
110109
Launch: Open Conductor.app and add this project as a workspace
111110
112111
Visual agent management. Real-time progress. Pure productivity.

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ The installer auto-detects your stack (React, Python, Go, etc.) and configures e
3939
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto
4040
```
4141

42+
**With automatic PR creation and auto-merge:**
43+
```bash
44+
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
45+
```
46+
4247
**Or paste this prompt into Claude Code:**
4348
```
4449
I need to move faster. Install Code Conductor into this project so we can run multiple Claude Code agents at once.
4550
46-
Execute: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto
51+
Execute: curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
4752
```
4853

4954
## See It In Action

conductor-init.sh

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ FORCE_REINSTALL=false
1616
SKIP_EXAMPLES=false
1717
SKIP_COMMIT=false
1818
SKIP_AGENT_START=false
19+
CREATE_PR=false
20+
AUTO_MERGE_PR=false
21+
PR_BRANCH=""
1922

2023
# Parse command-line arguments
2124
while [[ $# -gt 0 ]]; do
@@ -49,6 +52,24 @@ while [[ $# -gt 0 ]]; do
4952
SKIP_AGENT_START=true
5053
shift
5154
;;
55+
--create-pr)
56+
CREATE_PR=true
57+
shift
58+
;;
59+
--auto-merge)
60+
AUTO_MERGE_PR=true
61+
CREATE_PR=true # Auto-merge implies creating a PR
62+
shift
63+
;;
64+
--pr-branch)
65+
if [[ -n "$2" && ! "$2" =~ ^-- ]]; then
66+
PR_BRANCH="$2"
67+
shift 2
68+
else
69+
echo "Error: --pr-branch requires a branch name"
70+
exit 1
71+
fi
72+
;;
5273
--help)
5374
echo "Code Conductor Universal Installer"
5475
echo ""
@@ -62,6 +83,9 @@ while [[ $# -gt 0 ]]; do
6283
echo " --skip-examples Skip copying example configurations"
6384
echo " --skip-commit Skip auto-committing changes to Git"
6485
echo " --skip-agent-start Skip starting a dev agent after installation"
86+
echo " --create-pr Create a pull request after installation"
87+
echo " --auto-merge Enable auto-merge on the created PR (implies --create-pr)"
88+
echo " --pr-branch <name> Specify branch name for PR (default: auto-generated)"
6589
echo " --help Show this help message"
6690
echo ""
6791
echo "Examples:"
@@ -73,6 +97,9 @@ while [[ $# -gt 0 ]]; do
7397
echo ""
7498
echo " # Force upgrade in non-interactive mode"
7599
echo " curl -fsSL ... | bash -s -- --auto --upgrade"
100+
echo ""
101+
echo " # Create PR with auto-merge after installation"
102+
echo " curl -fsSL ... | bash -s -- --auto --create-pr --auto-merge"
76103
exit 0
77104
;;
78105
*)
@@ -610,6 +637,147 @@ else
610637
fi
611638
fi
612639

640+
# Step 7.5: Create Pull Request if requested
641+
if [ "$CREATE_PR" = true ] && [ "$SKIP_COMMIT" = false ]; then
642+
echo ""
643+
echo -e "${YELLOW}🔄 Creating pull request...${NC}"
644+
645+
# Check if GitHub CLI is available and authenticated
646+
if ! command -v gh >/dev/null 2>&1; then
647+
echo -e "${RED}❌ GitHub CLI (gh) not found. Cannot create PR.${NC}"
648+
echo "Install GitHub CLI and run 'gh auth login' to enable PR creation."
649+
CREATE_PR=false
650+
elif ! gh auth status >/dev/null 2>&1; then
651+
echo -e "${RED}❌ GitHub CLI not authenticated. Cannot create PR.${NC}"
652+
echo "Run 'gh auth login' to authenticate, then try again."
653+
CREATE_PR=false
654+
else
655+
# Check if we have changes committed
656+
CURRENT_BRANCH=$(git branch --show-current)
657+
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
658+
659+
# Generate PR branch name if not provided
660+
if [ -z "$PR_BRANCH" ]; then
661+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
662+
if [ "$IS_UPGRADE" = true ]; then
663+
PR_BRANCH="conductor-upgrade-$NEW_VERSION-$TIMESTAMP"
664+
else
665+
PR_BRANCH="conductor-setup-$TIMESTAMP"
666+
fi
667+
fi
668+
669+
# Check if we're on the default branch
670+
if [ "$CURRENT_BRANCH" = "$DEFAULT_BRANCH" ]; then
671+
echo -e "${YELLOW}📝 Creating new branch for PR: $PR_BRANCH${NC}"
672+
git checkout -b "$PR_BRANCH" || {
673+
echo -e "${RED}❌ Failed to create branch.${NC}"
674+
CREATE_PR=false
675+
}
676+
else
677+
# Already on a feature branch, use it
678+
PR_BRANCH="$CURRENT_BRANCH"
679+
echo -e "${YELLOW}📝 Using current branch for PR: $PR_BRANCH${NC}"
680+
fi
681+
682+
if [ "$CREATE_PR" = true ]; then
683+
# Push the branch
684+
echo -e "${YELLOW}📤 Pushing branch to origin...${NC}"
685+
git push -u origin "$PR_BRANCH" || {
686+
echo -e "${RED}❌ Failed to push branch.${NC}"
687+
CREATE_PR=false
688+
}
689+
690+
if [ "$CREATE_PR" = true ]; then
691+
# Create the PR
692+
if [ "$IS_UPGRADE" = true ]; then
693+
PR_TITLE="🔧 Upgrade Code Conductor from $CURRENT_VERSION to $NEW_VERSION"
694+
PR_BODY="## Summary
695+
This PR upgrades Code Conductor to version $NEW_VERSION.
696+
697+
### Changes
698+
- Updated core scripts and utilities
699+
- Updated role definitions
700+
- Updated GitHub workflows
701+
- Preserved existing configuration
702+
703+
### Testing
704+
- [ ] Installation/upgrade completed successfully
705+
- [ ] Conductor commands work as expected
706+
- [ ] GitHub integration functional
707+
708+
### Auto-generated
709+
This PR was automatically created by the Code Conductor installer."
710+
else
711+
PR_TITLE="🚀 Initialize Code Conductor for AI agent orchestration"
712+
PR_BODY="## Summary
713+
This PR sets up Code Conductor to enable multiple AI agents to work on this codebase simultaneously.
714+
715+
### What is Code Conductor?
716+
Code Conductor is an AI agent coordination system that:
717+
- Enables multiple AI coding agents (Claude Code, Conductor, Warp) to work in parallel
718+
- Uses GitHub Issues as a task queue with automatic conflict prevention
719+
- Provides isolated git worktrees for each agent
720+
- Includes AI-powered code reviews on all PRs
721+
722+
### Changes
723+
- Added \`.conductor\` directory with scripts and configuration
724+
- Added GitHub workflows for automation
725+
- Configured agent roles based on detected technology stack
726+
- Created initial tasks for agents to claim
727+
728+
### Next Steps
729+
1. Merge this PR to enable Code Conductor
730+
2. AI agents can start claiming and working on tasks
731+
3. Monitor progress via GitHub Issues labeled \`conductor:task\`
732+
733+
### Auto-generated
734+
This PR was automatically created by the Code Conductor installer."
735+
fi
736+
737+
echo -e "${YELLOW}📝 Creating pull request...${NC}"
738+
PR_URL=$(gh pr create \
739+
--title "$PR_TITLE" \
740+
--body "$PR_BODY" \
741+
--base "$DEFAULT_BRANCH" \
742+
--head "$PR_BRANCH" 2>&1) || {
743+
echo -e "${RED}❌ Failed to create PR: $PR_URL${NC}"
744+
CREATE_PR=false
745+
}
746+
747+
if [ "$CREATE_PR" = true ]; then
748+
echo -e "${GREEN}✅ Pull request created successfully!${NC}"
749+
echo -e "${GREEN}📎 PR URL: $PR_URL${NC}"
750+
751+
# Enable auto-merge if requested
752+
if [ "$AUTO_MERGE_PR" = true ]; then
753+
echo -e "${YELLOW}🤖 Enabling auto-merge...${NC}"
754+
gh pr merge --auto --merge "$PR_URL" || {
755+
echo -e "${YELLOW}⚠️ Could not enable auto-merge. You may need to:${NC}"
756+
echo " 1. Ensure branch protection rules allow auto-merge"
757+
echo " 2. Wait for required checks to be configured"
758+
echo " 3. Enable auto-merge manually with: gh pr merge --auto $PR_URL"
759+
}
760+
fi
761+
762+
# Add labels
763+
gh pr edit "$PR_URL" --add-label "conductor:setup,automation" 2>/dev/null || true
764+
765+
echo ""
766+
echo -e "${GREEN}🎉 Next steps:${NC}"
767+
echo " 1. Review the PR: $PR_URL"
768+
if [ "$AUTO_MERGE_PR" = false ]; then
769+
echo " 2. Merge the PR to activate Code Conductor"
770+
echo " 3. Other agents can then see and use the system"
771+
else
772+
echo " 2. PR will auto-merge once checks pass"
773+
echo " 3. Other agents will then see and use the system"
774+
fi
775+
fi
776+
fi
777+
fi
778+
fi
779+
fi
780+
613781
# Step 8: Development Environment Selection - skip for upgrades
614782
if [ "$IS_UPGRADE" = false ]; then
615783
if [ "$AUTO_MODE" = true ]; then

docs/INSTALLATION.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ Use the `--auto` flag for non-interactive installation (perfect for Claude Code)
2424
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto
2525
```
2626

27+
**Recommended: Create PR with auto-merge for immediate activation:**
28+
```bash
29+
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
30+
```
31+
32+
This creates a pull request that:
33+
- Makes Code Conductor visible to all agents and developers
34+
- Auto-merges once CI checks pass (if configured)
35+
- Provides a clear installation record in your git history
36+
2737
### Installation Options
2838

2939
The installer supports various command-line flags for customization:
@@ -40,10 +50,15 @@ bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/
4050
--skip-examples # Skip copying example configurations
4151
--skip-commit # Skip auto-committing changes to Git
4252
--skip-agent-start # Skip starting a dev agent after installation
53+
--create-pr # Create a pull request after installation
54+
--auto-merge # Enable auto-merge on the created PR (implies --create-pr)
55+
--pr-branch <name> # Specify branch name for PR (default: auto-generated)
4356

4457
# Examples:
4558
curl -fsSL ... | bash -s -- --auto --upgrade # Auto-upgrade
4659
curl -fsSL ... | bash -s -- --auto --skip-commit # Install without committing
60+
curl -fsSL ... | bash -s -- --auto --create-pr # Install and create PR
61+
curl -fsSL ... | bash -s -- --auto --auto-merge # Install, create PR, and auto-merge
4762
```
4863

4964
### Installation Notes
@@ -56,6 +71,37 @@ curl -fsSL ... | bash -s -- --auto --skip-commit # Install without committing
5671
<img width="1084" height="350" alt="One-line Install" src="https://github.com/user-attachments/assets/3a04506f-982f-457a-b8ea-98b6448c0219" />
5772
<img width="1084" height="540" alt="Happy orchestrating" src="https://github.com/user-attachments/assets/1c7bb744-1194-471f-a12c-9672d208dbf3" />
5873

74+
### Pull Request Workflow
75+
76+
**Why create a PR during installation?**
77+
78+
When Code Conductor is installed locally, the `.conductor` directory only exists in your working copy. Other agents or developers won't see it until these changes are merged into the main branch. The `--create-pr` option solves this by:
79+
80+
1. **Automatic Branch Creation**: If you're on the main branch, creates a new feature branch
81+
2. **Push and PR Creation**: Pushes changes and creates a PR with detailed description
82+
3. **Optional Auto-Merge**: With `--auto-merge`, the PR merges automatically once CI passes
83+
4. **Visibility**: Makes Code Conductor immediately visible to all agents and collaborators
84+
85+
**Example workflow:**
86+
```bash
87+
# Install and create PR in one command
88+
curl -fsSL https://raw.githubusercontent.com/ryanmac/code-conductor/main/conductor-init.sh | bash -s -- --auto --create-pr --auto-merge
89+
90+
# The installer will:
91+
# 1. Install Code Conductor locally
92+
# 2. Commit all changes
93+
# 3. Create branch "conductor-setup-20240125-143022" (or use custom with --pr-branch)
94+
# 4. Push to origin
95+
# 5. Create PR with comprehensive description
96+
# 6. Enable auto-merge (if --auto-merge specified)
97+
# 7. Add labels "conductor:setup" and "automation"
98+
```
99+
100+
**Requirements:**
101+
- GitHub CLI (`gh`) must be installed and authenticated
102+
- Repository must have a remote origin configured
103+
- For auto-merge: repository must have branch protection that allows it
104+
59105
## Option 2: Poetry (For Cloned Repo)
60106
```bash
61107
# Clone the repository

0 commit comments

Comments
 (0)