pymoo

davila7/claude-code-templates · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/davila7/claude-code-templates --skill pymoo
0 commentsdiscussion
summary

Pymoo is a comprehensive Python framework for optimization with emphasis on multi-objective problems. Solve single and multi-objective optimization using state-of-the-art algorithms (NSGA-II/III, MOEA/D), benchmark problems (ZDT, DTLZ), customizable genetic operators, and multi-criteria decision making methods. Excels at finding trade-off solutions (Pareto fronts) for problems with conflicting objectives.

skill.md

Pymoo - Multi-Objective Optimization in Python

Overview

Pymoo is a comprehensive Python framework for optimization with emphasis on multi-objective problems. Solve single and multi-objective optimization using state-of-the-art algorithms (NSGA-II/III, MOEA/D), benchmark problems (ZDT, DTLZ), customizable genetic operators, and multi-criteria decision making methods. Excels at finding trade-off solutions (Pareto fronts) for problems with conflicting objectives.

When to Use This Skill

This skill should be used when:

  • Solving optimization problems with one or multiple objectives
  • Finding Pareto-optimal solutions and analyzing trade-offs
  • Implementing evolutionary algorithms (GA, DE, PSO, NSGA-II/III)
  • Working with constrained optimization problems
  • Benchmarking algorithms on standard test problems (ZDT, DTLZ, WFG)
  • Customizing genetic operators (crossover, mutation, selection)
  • Visualizing high-dimensional optimization results
  • Making decisions from multiple competing solutions
  • Handling binary, discrete, continuous, or mixed-variable problems

Core Concepts

The Unified Interface

Pymoo uses a consistent minimize() function for all optimization tasks:

from pymoo.optimize import minimize

result = minimize(
    problem,        # What to optimize
    algorithm,      # How to optimize
    termination,    # When to stop
    seed=1,
    verbose=True
)

Result object contains:

  • result.X: Decision variables of optimal solution(s)
  • result.F: Objective values of optimal solution(s)
  • result.G: Constraint violations (if constrained)
  • result.algorithm: Algorithm object with history

Problem Types

Single-objective: One objective to minimize/maximize Multi-objective: 2-3 conflicting objectives → Pareto front Many-objective: 4+ objectives → High-dimensional Pareto front Constrained: Objectives + inequality/equality constraints Dynamic: Time-varying objectives or constraints

Quick Start Workflows

Workflow 1: Single-Objective Optimization

When: Optimizing one objective function

Steps:

  1. Define or select problem
  2. Choose single-objective algorithm (GA, DE, PSO, CMA-ES)
  3. Configure termination criteria
  4. Run optimization
  5. Extract best solution

Example:

from pymoo.algorithms.soo.nonconvex.ga import GA
from pymoo.problems import get_problem
from pymoo.optimize import minimize

# Built-in problem
problem = get_problem("rastrigin", n_var=10)

# Configure Genetic Algorithm
algorithm = GA(
    pop_size=100,
    eliminate_duplicates=True
)

# Optimize
result = minimize(
    problem,
    algorithm,
    ('n_gen', 200),
    seed=1,
    verbose=True
)

print(f"Best solution: {result.X}")
print(f"Best objective: {result.F[0]}")

See: scripts/single_objective_example.py for complete example

Workflow 2: Multi-Objective Optimization (2-3 objectives)

When: Optimizing 2-3 conflicting objectives, need Pareto front

Algorithm choice: NSGA-II (standard for bi/tri-objective)

Steps:

  1. Define multi-objective problem
  2. Configure NSGA-II
  3. Run optimization to obtain Pareto front
  4. Visualize trade-offs
  5. Apply decision making (optional)

Example:

from pymoo.algorithms.moo.nsga2 import NSGA2
from pymoo.problems import get_problem
from pymoo.optimize import minimize
from pymoo.visualization.scatter import Scatter

# Bi-objective benchmark problem
problem = get_problem("zdt1")

# NSGA-II algorithm
algorithm = NSGA2(pop_size=100)

# Optimize
result = minimize(problem, algorithm, ('n_gen', 200), seed=1)

# Visualize Pareto front
plot = Scatter()
plot.add(result.F, label="Obtained Front")
plot.add(problem.pareto_front(), label="True Front", alpha=0.3)
plot.show()

print(f"Found {len(result.F)} Pareto-optimal solutions")

See: scripts/multi_objective_example.py for complete example

Workflow 3: Many-Objective Optimization (4+ objectives)

When: Optimizing 4 or more objectives

Algorithm choice: NSGA-III (designed for many objectives)

Key difference: Must provide reference directions for population guidance

Steps:

  1. Define many-objective problem
  2. Generate reference directions
  3. Configure NSGA-III with reference directions
  4. Run optimization
  5. Visualize using Parallel Coordinate Plot

Example:

from pymoo.algorithms.moo.nsga3 import NSGA3
from pymoo.problems import get_problem
from pymoo.optimize import minimize
from pymoo.util.ref_dirs import get_reference_directions
from pymoo.visualization.pcp import PCP

# Many-objective problem (5 objectives)
problem = get_problem("dtlz2", n_obj=5)

# Generate reference directions (required for NSGA-III)
ref_dirs = get_reference_directions("das-dennis", n_dim=5, n_partitions=12)

# Configure NSGA-III
algorithm = NSGA3(ref_dirs=ref_dirs)

# Optimize
result = minimize(problem, algorithm, ('n_gen', 300), seed=1)

# Visualize with Parallel Coordinates
plot = PCP(labels=[f"f{i+1}" for i in range(5)])
plot.add(result.F, alpha=0.3)
plot.show()

See: scripts/many_objective_example.py for complete example

Workflow 4: Custom Problem Definition

When: Solving domain-specific optimization problem

Steps:

  1. Extend ElementwiseProblem class
  2. Define __init__ with problem dimensions and bounds
  3. Implement _evaluate method for objectives (and constraints)
  4. Use with any algorithm

Unconstrained example:

from pymoo.core.problem import ElementwiseProblem
import numpy as np

class MyProblem(ElementwiseProblem):
    def __init__(self):
        super().__init__(
            n_var=2,              # Number of variables
            n_obj=2,              # Number of objectives
            xl=np.array([0, 0]),  # Lower bounds
            xu=np.array([5, 5])   # Upper bounds
        )

    def _evaluate(self, x, out, *args, **kwargs):
        # Define objectives
        f1 = x[0]**2 + x[1]**2
        f2 = (x[0]-1)**2 + (x[1]-1)**2

        out["F"] = [f1, f2]

Constrained example:

class ConstrainedProblem(ElementwiseProblem):
    def __init__(self)
how to use pymoo

How to use pymoo on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add pymoo
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/davila7/claude-code-templates --skill pymoo

The skills CLI fetches pymoo from GitHub repository davila7/claude-code-templates and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/pymoo

Reload or restart Cursor to activate pymoo. Access the skill through slash commands (e.g., /pymoo) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.647 reviews
  • Chaitanya Patil· Dec 24, 2024

    pymoo reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Valentina Reddy· Dec 20, 2024

    Registry listing for pymoo matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Benjamin Gill· Dec 4, 2024

    pymoo fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Benjamin Ramirez· Nov 23, 2024

    pymoo has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Piyush G· Nov 15, 2024

    I recommend pymoo for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Valentina Bhatia· Nov 11, 2024

    Useful defaults in pymoo — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Mei Sanchez· Oct 14, 2024

    Solid pick for teams standardizing on skills: pymoo is focused, and the summary matches what you get after install.

  • Shikha Mishra· Oct 6, 2024

    Useful defaults in pymoo — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Mateo Torres· Oct 2, 2024

    I recommend pymoo for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Yash Thakker· Sep 25, 2024

    pymoo has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 47

1 / 5