Skip to content

Commit c2cee47

Browse files
ryanmacclaude
andcommitted
feat: Auto-configure all roles during installation
Simplifies the installation process by automatically configuring all available roles instead of prompting users to select which ones they want. This change: - Removes the interactive role selection prompt - Automatically adds all 8 specialized roles during setup - Updates output messages to reflect automatic configuration - Reduces installation friction and complexity Users can simply ignore roles they don't need. Having all roles available doesn't impose any overhead and ensures maximum flexibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 149dc91 commit c2cee47

File tree

1 file changed

+27
-88
lines changed

1 file changed

+27
-88
lines changed

conductor-init.sh

Lines changed: 27 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ else
340340
echo ""
341341
fi
342342

343-
# Step 5: Interactive Role Configuration (improved: numbered menu) - skip for upgrades
343+
# Step 5: Auto-configure All Roles - skip for upgrades
344344
if [ "$IS_UPGRADE" = false ]; then
345345
echo -e "${YELLOW}🎭 Configuring agent roles...${NC}"
346346

@@ -364,100 +364,39 @@ except:
364364
echo -e "📊 Detected technology stacks: ${GREEN}$DETECTED_STACKS${NC}"
365365
fi
366366

367-
# Get configured roles
368-
CONFIGURED_ROLES=$(python3 -c "
367+
# Define all available roles
368+
ALL_ROLES=("code-reviewer" "frontend" "mobile" "devops" "security" "ml-engineer" "ui-designer" "data")
369+
370+
# Automatically configure all roles
371+
echo -e "${YELLOW}📝 Configuring all available roles...${NC}"
372+
373+
# Update config.yaml with all roles
374+
python3 - <<EOF
369375
import yaml
370-
try:
371-
with open('.conductor/config.yaml', 'r') as f:
372-
config = yaml.safe_load(f)
373-
roles = config.get('roles', {}).get('specialized', [])
374-
print(' '.join(roles))
375-
except:
376-
print('code-reviewer')
377-
" 2>/dev/null)
378376
379-
echo -e "🎯 Configured specialized roles: ${GREEN}$CONFIGURED_ROLES${NC}"
380-
echo ""
377+
# Define all available roles
378+
all_roles = ["code-reviewer", "frontend", "mobile", "devops", "security", "ml-engineer", "ui-designer", "data"]
381379
382-
# Parse current roles and filter suggestions
383-
ALL_ROLES=("code-reviewer" "frontend" "mobile" "devops" "security" "ml-engineer" "ui-designer" "data")
384-
ROLE_DESCRIPTIONS=(
385-
"AI-powered PR reviews"
386-
"React, Vue, Angular development"
387-
"React Native, Flutter development"
388-
"CI/CD, deployments, infrastructure"
389-
"Security audits, vulnerability scanning"
390-
"Machine learning tasks"
391-
"Design systems, UI/UX"
392-
"Data pipelines, analytics"
393-
)
394-
395-
# Get array of current roles
396-
IFS=' ' read -ra CURRENT_ROLES_ARRAY <<< "$CONFIGURED_ROLES"
397-
398-
# Build suggested roles (exclude already configured)
399-
SUGGESTED_ROLES=()
400-
SUGGESTED_INDICES=()
401-
for i in "${!ALL_ROLES[@]}"; do
402-
role="${ALL_ROLES[$i]}"
403-
if [[ ! " ${CURRENT_ROLES_ARRAY[@]} " =~ " ${role} " ]]; then
404-
SUGGESTED_ROLES+=("$role")
405-
SUGGESTED_INDICES+=("$i")
406-
fi
407-
done
408-
409-
# Ask if user wants to adjust roles
410-
if [ ${#SUGGESTED_ROLES[@]} -eq 0 ]; then
411-
echo -e "${GREEN}✅ All available roles are already configured.${NC}"
412-
else
413-
echo "Available roles to add:"
414-
for i in "${!SUGGESTED_ROLES[@]}"; do
415-
idx=${SUGGESTED_INDICES[$i]}
416-
echo " $((i+1))) ${SUGGESTED_ROLES[$i]} - ${ROLE_DESCRIPTIONS[$idx]}"
417-
done
418-
echo ""
419-
read -p "Select roles to add (comma-separated numbers, or Enter to skip): " -r ROLE_SELECTION
420-
421-
if [ -n "$ROLE_SELECTION" ]; then
422-
# Parse selected numbers and build role list
423-
SELECTED_ROLES=()
424-
IFS=',' read -ra SELECTIONS <<< "$ROLE_SELECTION"
425-
for num in "${SELECTIONS[@]}"; do
426-
num=$(echo $num | tr -d ' ') # Trim spaces
427-
if [[ $num =~ ^[0-9]+$ ]] && [ "$num" -ge 1 ] && [ "$num" -le "${#SUGGESTED_ROLES[@]}" ]; then
428-
SELECTED_ROLES+=("${SUGGESTED_ROLES[$((num-1))]}")
429-
fi
430-
done
431-
432-
if [ ${#SELECTED_ROLES[@]} -gt 0 ]; then
433-
# Update config.yaml with selected roles (robust JSON passing)
434-
if ! command -v jq >/dev/null 2>&1; then
435-
echo -e "${RED}❌ jq is required for robust role selection. Please install jq and try again.${NC}"
436-
exit 1
437-
fi
438-
ROLES_TO_ADD_JSON=$(printf '%s\n' "${SELECTED_ROLES[@]}" | jq -R . | jq -s .)
439-
python3 - "$ROLES_TO_ADD_JSON" <<EOF
440-
import sys, json, yaml
380+
# Read current config
441381
with open('.conductor/config.yaml', 'r') as f:
442382
config = yaml.safe_load(f)
443-
current_roles = config.get('roles', {}).get('specialized', [])
444-
new_roles = json.loads(sys.argv[1])
445-
combined_roles = list(set(current_roles + new_roles))
446-
config['roles']['specialized'] = combined_roles
383+
384+
# Update roles to include all available roles
385+
config['roles']['specialized'] = all_roles
386+
387+
# Write updated config
447388
with open('.conductor/config.yaml', 'w') as f:
448389
yaml.dump(config, f, default_flow_style=False)
449-
print(f'✅ Roles added: {", ".join(new_roles)}')
390+
391+
print(f'✅ All {len(all_roles)} roles configured: {", ".join(all_roles)}')
450392
EOF
451-
if [ $? -ne 0 ]; then
452-
echo -e "${YELLOW}⚠️ Could not update roles automatically.${NC}"
453-
fi
454-
else
455-
echo -e "${YELLOW}⚠️ No valid selections made.${NC}"
456-
fi
457-
else
458-
echo -e "${GREEN}✅ Keeping current role configuration.${NC}"
459-
fi
393+
394+
if [ $? -ne 0 ]; then
395+
echo -e "${YELLOW}⚠️ Could not configure roles automatically. Continuing anyway...${NC}"
396+
else
397+
echo -e "${GREEN}✅ All agent roles are now available for use!${NC}"
460398
fi
399+
echo ""
461400
else
462401
echo -e "${GREEN}✅ Existing role configuration preserved.${NC}"
463402
fi
@@ -708,7 +647,7 @@ elif [ "$ENV_CHOICE" != "1" ]; then
708647
echo " ✅ Auto-detected technology stack"
709648
fi
710649
echo " ✅ AI code-reviewer for all PRs"
711-
echo "Specialized roles: ${CONFIGURED_ROLES}"
650+
echo "All specialized roles configured (frontend, backend, devops, security, etc.)"
712651
echo " ✅ Demo tasks ready to claim"
713652
echo -e " ${GREEN}✅ No GitHub token setup required${NC}"
714653
echo -e " ${GREEN}✅ No Python CI/CD workflows added${NC}"
@@ -737,7 +676,7 @@ else
737676
echo " ✅ Auto-detected technology stack"
738677
fi
739678
echo " ✅ AI code-reviewer for all PRs"
740-
echo "Specialized roles: ${CONFIGURED_ROLES}"
679+
echo "All specialized roles configured (frontend, backend, devops, security, etc.)"
741680
echo " ✅ Demo tasks ready in Conductor"
742681
echo -e " ${GREEN}✅ No GitHub token setup required${NC}"
743682
echo -e " ${GREEN}✅ No Python CI/CD workflows added${NC}"

0 commit comments

Comments
 (0)