Skip to content

/initialize - Add Orchestre to Existing Projects

Purpose

The /initialize prompt adds Orchestre capabilities to existing projects without disruption. Unlike /create which starts new projects, this command retrofits Orchestre into your current codebase, preserving all existing code and configurations.

How It Actually Works

  1. Project Discovery: Identifies project type (Node.js, Python, Go, etc.)
  2. Calls MCP Tool: Invokes mcp__orchestre__initialize_project with template: "custom"
  3. Creates Infrastructure: Sets up .orchestre/ directory structure
  4. Installs Prompts: Makes all 20 essential prompts available
  5. Preserves Existing: Doesn't modify any existing code or configs

Key Difference from /create

  • /create: For NEW projects with templates or repositories
  • /initialize: For EXISTING projects, adds Orchestre without disruption

Use Cases

  1. Legacy Project Enhancement: Add Orchestre to established codebases
  2. Team Onboarding: Set up Orchestre for team members
  3. Project Standardization: Apply Orchestre patterns to existing work
  4. Tool Migration: Move from other tools to Orchestre
  5. Incremental Adoption: Gradually introduce Orchestre features

Argument Structure

/initialize [project-path]

Arguments

  1. project-path (optional)
    • Path to existing project
    • Defaults to current directory (".")
    • Can be relative or absolute

Examples

bash
# Initialize current directory
/initialize

# Initialize specific project
/initialize ../my-existing-app

# With path
/initialize /Users/me/projects/my-app

Technical Details

MCP Tool Integration

Calls mcp__orchestre__initialize_project with:

  • projectName: "." (uses existing directory)
  • template: "custom" (for existing projects)
  • targetPath: Specified path or current directory
  • description: Brief project description

What Gets Created

existing-project/
├── .orchestre/                  # NEW: Orchestration directory
│   ├── CLAUDE.md               # Orchestration memory
│   ├── prompts.json            # Available prompts configuration
│   ├── templates/              # Memory templates
│   ├── knowledge/              # Discovery insights
│   ├── plans/                  # Development plans
│   ├── tasks/                  # Task tracking
│   └── sessions/               # Session history
└── CLAUDE.md                   # NEW: Project context (if missing)

Available Prompts After Initialization

All 20 essential prompts become available:

  • /orchestrate - Analyze and plan from requirements
  • /execute-task - Implement with context awareness
  • /compose-saas-mvp - Rapid prototyping
  • /generate-implementation-tutorial - Comprehensive implementation guides
  • /add-enterprise-feature - Production features
  • /migrate-to-teams - Multi-tenancy
  • /security-audit - Vulnerability scanning
  • /document-feature - Contextual documentation
  • /discover-context - Codebase analysis
  • /review - Multi-LLM code review
  • /create - New project creation
  • /initialize - (Already used)

## Adaptation Strategies

### Project Discovery
The prompt analyzes:

1. **Technology Stack**
   - Package.json dependencies
   - Framework configurations
   - Build tool setup
   - Language preferences

2. **Project Structure**
   - Directory organization
   - File naming conventions
   - Module patterns
   - Architecture style

3. **Existing Patterns**
   - Code style
   - Component structure
   - API patterns
   - Testing approach

4. **Team Practices**
   - Git workflow
   - Documentation style
   - Development scripts
   - CI/CD configuration

### Intelligent Configuration
Based on discoveries:
- Selects appropriate command set
- Configures memory templates
- Adapts to existing conventions
- Preserves team workflows

### Non-Invasive Setup
The prompt ensures:
- No overwriting of existing files
- Respect for current structure
- Minimal configuration changes
- Gradual adoption path

## Memory Usage

### Created Memory Structure

existing-project/ ├── CLAUDE.md # Project context (if not exists) ├── .orchestre/ │ ├── CLAUDE.md # Orchestre-specific memory │ ├── discovery/ # Project analysis results │ │ ├── structure.md # Discovered structure │ │ ├── patterns.md # Identified patterns │ │ └── stack.md # Technology analysis │ └── templates/ # Adapted templates └── .claude/ └── commands/ # Carefully selected commands


### Discovery Documentation
```markdown
# Project Discovery: legacy-saas

## Technology Stack
- Framework: Next.js 13 (Pages Router)
- State: Redux Toolkit
- Database: PostgreSQL with Prisma
- Auth: NextAuth.js
- Styling: Styled Components

## Project Patterns
- Feature-based organization
- Container/Component pattern
- Custom hooks for data fetching
- Centralized API client

## Existing Conventions
- TypeScript with strict mode
- ESLint + Prettier configuration
- Jest + React Testing Library
- Conventional commits

## Recommended Adaptations
- Use MakerKit-compatible commands
- Preserve existing auth flow
- Adapt to Redux patterns
- Maintain testing structure

Workflow Examples

Legacy SaaS Enhancement

bash
# 1. Initialize Orchestre
/initialize ./legacy-saas

# 2. Discover existing patterns
/discover-context ./src --depth=comprehensive

# 3. Add modern features
/add-enterprise-feature "audit-logs" "Track all user actions with Redux middleware"

# 4. Improve security
/security-audit

Microservice Setup

bash
# 1. Minimal initialization
/initialize ./user-service --minimal

# 2. Understand service structure
/discover-context ./src/api

# 3. Add observability
/execute-task "Add OpenTelemetry tracing to existing endpoints"

Mobile App Migration

bash
# 1. Initialize React Native project
/initialize ./mobile-app "react-native"

# 2. Analyze current implementation
/discover-context ./src/screens

# 3. Modernize gradually
/execute-task "Migrate class components to hooks incrementally"

Intelligent Features

Compatibility Detection

  • Identifies potential conflicts
  • Suggests resolution strategies
  • Adapts to existing tools
  • Preserves developer experience

Command Selection

Intelligently chooses commands based on:

  • Project type (web, mobile, API)
  • Technology stack
  • Team size indicators
  • Existing patterns

Configuration Preservation

  • Backs up existing configs
  • Merges with Orchestre needs
  • Maintains tool compatibility
  • Documents all changes

Migration Assistance

For projects using other tools:

  • Maps existing commands
  • Translates configurations
  • Preserves muscle memory
  • Provides transition guide

Setup Variations

1. Minimal Setup

bash
/initialize --minimal

Installs only:

  • Core orchestration commands
  • Basic development commands
  • Essential documentation tools

2. Standard Setup

bash
/initialize

Includes:

  • Detected relevant commands
  • Template-specific tools
  • Memory templates
  • Integration helpers

3. Full Setup

bash
/initialize --full

Provides:

  • All available commands
  • Complete template library
  • Advanced workflows
  • Enterprise features

4. Custom Setup

bash
/initialize ./project "custom-api-framework"

Adapts to:

  • Unique frameworks
  • Custom architectures
  • Proprietary patterns
  • Special requirements

Integration Points

With Other Prompts

  • → /discover-context: Natural next step
  • → /orchestrate: Plan enhancements
  • → /document-feature: Document existing features
  • → /execute-task: Start improvements

With Existing Tools

  • Complements existing CLIs
  • Works with current build tools
  • Respects IDE configurations
  • Enhances Git workflows

Best Practices

  1. Start with Discovery

    bash
    # Initialize first
    /initialize
    
    # Then discover deeply
    /discover-context ./src --depth=comprehensive
  2. Preserve Existing Work

    bash
    # Safe initialization
    /initialize --preserve
    
    # Review changes before committing
    git diff
  3. Gradual Adoption

    bash
    # Start minimal
    /initialize --minimal
    
    # Add features as needed
    /install-commands additional-features

Common Scenarios

Monorepo Initialization

bash
# Initialize at root
/initialize ./monorepo

# Set up individual packages
/initialize ./packages/web "nextjs"
/initialize ./packages/api "express"
/initialize ./packages/shared --minimal

CI/CD Integration

bash
# Initialize with CI awareness
/initialize

# Add CI-friendly commands
/execute-task "Create Orchestre CI workflow"

Team Migration

bash
# Initialize with team focus
/initialize --preserve

# Document for team
/document-feature "Orchestre Setup and Usage"

# Create onboarding guide
/execute-task "Create team onboarding documentation"

Troubleshooting

Common Issues

  1. Existing Commands Conflict

    • Prompt detects conflicts
    • Suggests alternatives
    • Offers prefixed versions
    • Documents resolution
  2. Complex Project Structure

    • Handles nested projects
    • Respects workspaces
    • Adapts to monorepos
    • Supports custom layouts
  3. Permission Issues

    • Guides permission fixes
    • Suggests alternative locations
    • Works with restricted access
    • Documents requirements

Tips

  1. Run from Project Root: Best discovery results
  2. Review Before Committing: Check all changes
  3. Use Template Hints: Better command selection
  4. Document the Setup: Help your team adapt
  5. Start Small: You can always add more later

Built with ❤️ for the AI Coding community, by Praney Behl