Skip to content

generate_plan

The generate_plan tool creates intelligent, phased development plans based on project requirements and analysis. It leverages Gemini AI to break down complex projects into manageable phases with clear deliverables.

Overview

  • Purpose: Create actionable development plans with phases and tasks
  • AI Model: Gemini 2.0 Flash Thinking (gemini-2.0-flash-thinking-exp-1219)
  • Typical Duration: 3-7 seconds
  • Source: src/tools/generatePlan.ts

Input Schema

typescript
{
  requirements: string;           // Project requirements
  analysis?: AnalysisResult;      // Optional analysis from analyze_project
  template?: string;              // Optional template context
  preferences?: {
    methodology?: 'agile' | 'waterfall' | 'iterative';
    teamSize?: number;
    sprintLength?: number;        // For agile (in weeks)
    prioritization?: 'mvp' | 'full-featured' | 'quality-first';
  }
}

Output Format

json
{
  "success": true,
  "plan": {
    "overview": "Comprehensive plan for building a SaaS platform",
    "methodology": "agile",
    "totalDuration": "12-16 weeks",
    "phases": [
      {
        "id": 1,
        "name": "Foundation & Setup",
        "duration": "2-3 weeks",
        "objectives": [
          "Set up development environment",
          "Initialize project structure",
          "Configure CI/CD pipeline"
        ],
        "tasks": [
          {
            "id": "1.1",
            "title": "Project initialization",
            "description": "Set up monorepo with Turborepo",
            "effort": "4 hours",
            "dependencies": [],
            "assignee": "senior-dev",
            "priority": "HIGH"
          },
          {
            "id": "1.2",
            "title": "Database design",
            "description": "Design schema for multi-tenant architecture",
            "effort": "8 hours",
            "dependencies": ["1.1"],
            "assignee": "architect",
            "priority": "HIGH"
          }
        ],
        "deliverables": [
          "Development environment ready",
          "Database schema designed",
          "CI/CD pipeline configured"
        ],
        "risks": [
          {
            "description": "Technology stack decisions",
            "mitigation": "Research and POC in week 1"
          }
        ]
      }
    ],
    "milestones": [
      {
        "name": "MVP Launch",
        "date": "Week 8",
        "criteria": ["Core features complete", "Basic UI functional", "Auth working"]
      }
    ],
    "resources": {
      "required": [
        { "role": "Full-stack developer", "count": 2, "skills": ["React", "Node.js"] },
        { "role": "UI/UX designer", "count": 1, "skills": ["Figma", "Design systems"] }
      ],
      "optional": [
        { "role": "DevOps engineer", "count": 1, "skills": ["K8s", "AWS"] }
      ]
    },
    "dependencies": {
      "external": ["Stripe API access", "Domain name", "SSL certificates"],
      "internal": ["Design system", "API specifications", "Test data"]
    },
    "parallelization": [
      {
        "phase": 2,
        "parallel_tracks": [
          { "track": "Frontend", "tasks": ["2.1", "2.2", "2.3"] },
          { "track": "Backend", "tasks": ["2.4", "2.5", "2.6"] }
        ]
      }
    ]
  },
  "metadata": {
    "planningTime": 4532,
    "modelUsed": "gemini-2.0-flash-thinking-exp-1219",
    "complexity": 7.5,
    "confidence": 0.88
  }
}

Usage Examples

Basic Planning

typescript
// Generate plan from requirements
@mcp__orchestre__generate_plan({
  requirements: "Build a task management application with team collaboration"
})

With Analysis Context

typescript
// Use analysis for informed planning
const analysis = await analyze_project({ requirements });

@mcp__orchestre__generate_plan({
  requirements: requirements,
  analysis: analysis,
  preferences: {
    methodology: 'agile',
    teamSize: 4,
    sprintLength: 2,
    prioritization: 'mvp'
  }
})

Template-Specific Planning

typescript
// Plan for specific template
@mcp__orchestre__generate_plan({
  requirements: "E-commerce platform with subscriptions",
  template: "makerkit",
  preferences: {
    prioritization: 'full-featured'
  }
})

Plan Components

Phases

Each phase represents a major development stage:

json
{
  "id": 2,
  "name": "Core Features",
  "duration": "3-4 weeks",
  "objectives": [
    "Implement user authentication",
    "Build product catalog",
    "Create shopping cart"
  ],
  "prerequisites": ["Phase 1 complete", "Design approved"],
  "parallelizable": true
}

Tasks

Detailed work items within phases:

json
{
  "id": "2.3",
  "title": "Implement JWT authentication",
  "description": "Set up JWT-based auth with refresh tokens",
  "effort": "16 hours",
  "complexity": "MEDIUM",
  "skills": ["Node.js", "Security", "JWT"],
  "dependencies": ["2.1", "2.2"],
  "acceptance_criteria": [
    "Users can register and login",
    "Tokens expire and refresh properly",
    "Secure password storage"
  ]
}

Milestones

Key checkpoints in the project:

json
{
  "name": "Beta Release",
  "date": "Week 10",
  "criteria": [
    "All core features implemented",
    "Testing coverage > 80%",
    "Performance benchmarks met"
  ],
  "dependencies": ["Phase 1", "Phase 2", "Phase 3"]
}

Planning Strategies

Methodology Adaptation

The tool adapts to different methodologies:

Agile Planning

  • Breaks into sprints
  • Includes story points
  • Defines acceptance criteria
  • Plans for retrospectives

Waterfall Planning

  • Sequential phases
  • Detailed requirements upfront
  • Clear phase gates
  • Comprehensive documentation

Iterative Planning

  • Quick iterations
  • Continuous refinement
  • Flexible scope
  • Regular releases

Prioritization Strategies

MVP First

json
{
  "phase1": "Essential features only",
  "phase2": "Nice-to-have features",
  "phase3": "Polish and optimization"
}
json
{
  "phase1": "Foundation and architecture",
  "phase2": "Complete feature set",
  "phase3": "Integration and testing"
}

Quality First

json
{
  "phase1": "Robust foundation with tests",
  "phase2": "Features with comprehensive testing",
  "phase3": "Performance and security hardening"
}

Advanced Features

Parallel Track Planning

Identifies opportunities for parallel development:

json
{
  "parallel_tracks": [
    {
      "track": "Frontend Team",
      "tasks": ["UI components", "State management", "API integration"],
      "dependencies": ["API contracts defined"]
    },
    {
      "track": "Backend Team",
      "tasks": ["API development", "Database setup", "Authentication"],
      "dependencies": ["Schema designed"]
    }
  ]
}

Risk-Aware Planning

Incorporates risk mitigation:

json
{
  "phase": 2,
  "risks": [
    {
      "risk": "Third-party API changes",
      "impact": "HIGH",
      "mitigation": "Abstract API layer, version lock",
      "contingency": "Build minimal internal solution"
    }
  ]
}

Resource Optimization

Balances resources across phases:

json
{
  "resource_allocation": {
    "phase1": {
      "developers": 2,
      "designers": 1,
      "allocation": "100%"
    },
    "phase2": {
      "developers": 4,
      "designers": 0.5,
      "allocation": "100%"
    }
  }
}

AI Model Capabilities

Gemini's Planning Intelligence

The tool leverages Gemini's capabilities for:

  • Dependency Analysis: Understanding task relationships
  • Time Estimation: Realistic effort predictions
  • Risk Assessment: Identifying potential blockers
  • Resource Planning: Optimal team composition

Prompt Structure

typescript
const planningPrompt = `Given these requirements and analysis:
1. Break down into logical phases
2. Identify dependencies between tasks
3. Estimate realistic timelines
4. Suggest parallel work streams
5. Identify risks and mitigation strategies
6. Recommend team composition`;

Best Practices

1. Provide Complete Context

Include:

  • Clear requirements
  • Technical constraints
  • Team capabilities
  • Timeline constraints
  • Budget considerations

2. Use Analysis Results

typescript
// Always analyze before planning
const analysis = await analyze_project({ requirements });
const plan = await generate_plan({
  requirements,
  analysis,  // Provides complexity insights
  preferences: {
    teamSize: actualTeamSize
  }
});

3. Iterate on Plans

Plans aren't set in stone:

typescript
// After phase 1 completion
const updatedPlan = await generate_plan({
  requirements: updatedRequirements,
  analysis: newAnalysis,
  preferences: {
    completedPhases: [1],
    learnings: "Authentication took longer than expected"
  }
});

Performance Considerations

Response Time

Factors affecting performance:

  • Requirement complexity: +1-2s
  • Analysis inclusion: +0.5s
  • Preference detail: +0.5s

Optimization Tips

  1. Cache plans for identical inputs
  2. Batch planning for related projects
  3. Reuse analysis when possible
  4. Limit requirement length to essentials

Error Handling

Common Errors

ErrorCauseSolution
REQUIREMENTS_UNCLEARVague requirementsAdd specific details
PLANNING_TIMEOUTToo complexBreak into sub-projects
INVALID_PREFERENCESWrong preference formatCheck schema
GEMINI_QUOTA_EXCEEDEDAPI limit reachedWait or upgrade

Recovery Strategies

typescript
try {
  const plan = await generate_plan(args);
} catch (error) {
  if (error.code === 'PLANNING_TIMEOUT') {
    // Simplify and retry
    const simplifiedPlan = await generate_plan({
      ...args,
      requirements: summarize(args.requirements)
    });
  }
}

Integration Patterns

With Orchestration Flow

typescript
// Complete orchestration workflow
const analysis = await analyze_project({ requirements });
const plan = await generate_plan({ requirements, analysis });

// Execute phases
for (const phase of plan.phases) {
  await execute_phase(phase);
  await review_phase(phase);
}

With Task Distribution

typescript
// Distribute tasks from plan
const plan = await generate_plan({ requirements });
const parallelTasks = plan.parallelization;

await distribute_tasks({
  tasks: parallelTasks,
  team: availableTeam
});

Limitations

Current Constraints

  1. English only for requirements
  2. Web/mobile focus - less accurate for embedded systems
  3. Team size limit - Best for teams < 20
  4. Single project - No multi-project planning

Future Enhancements

  • Multi-language support
  • Domain-specific planning
  • Resource leveling
  • Cost estimation
  • Gantt chart generation

API Reference

Type Definitions

typescript
interface GeneratePlanArgs {
  requirements: string;
  analysis?: AnalysisResult;
  template?: string;
  preferences?: PlanPreferences;
}

interface PlanPreferences {
  methodology?: 'agile' | 'waterfall' | 'iterative';
  teamSize?: number;
  sprintLength?: number;
  prioritization?: 'mvp' | 'full-featured' | 'quality-first';
  completedPhases?: number[];
  learnings?: string;
}

interface PlanResult {
  overview: string;
  methodology: string;
  totalDuration: string;
  phases: Phase[];
  milestones: Milestone[];
  resources: ResourceRequirements;
  dependencies: Dependencies;
  parallelization: ParallelTracks[];
}

interface Phase {
  id: number;
  name: string;
  duration: string;
  objectives: string[];
  tasks: Task[];
  deliverables: string[];
  risks: Risk[];
  prerequisites?: string[];
  parallelizable?: boolean;
}

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