Agent skill

Select Solver

by PINA-org in PINA-org/PINA

Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits.

MITAuto-check passedAI & LLM Engineering

Install Select Solver

skills CLI
$ npx skills add PINA-org/PINA --skill select-solver -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PINA-org/PINA select-solver --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PINA-org/PINA.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/select-solver .claude/skills/select-solver && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
select-solver
GitHub stars
797
Token cost
~2.9k tokens
SKILL.md length
852 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits.

  • Works in 4 steps: Understand the conditions → Let the conditions drive the choice → Assemble the solver → …
  • The user asks what solver should I use
  • SKILL.md covers Step 1 — Understand the…, Step 2 — Let the conditions…, Step 3 — Assemble the solver and Step 4 — Creating a custom…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Select Solver is an agent skill from PINA-org/PINA. Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits. Use when the user asks "what solver should I use", "how do I train this", "which solver", "choose a solver", "pick a solver", "solver selection", "how do I set up training", "what's the right solver", or similar. Also triggers when the user mentions specific solver names (PINN, CausalPINN, SelfAdaptivePINN, SupervisedSolver, etc.) or asks about custom training loops / custom solvers.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: opencode, codex, claude

It sits in AI & LLM Engineering, covering Deep learning. The repository describes itself as: Physics-Informed Neural networks for Advanced modeling. The licence is MIT.

When your agent uses it

  • The user asks what solver should I use
  • How do I train this
  • Choose a solver
  • Solver selection

Example prompts

  • “what solver should I use”
  • “how do I train this”
  • “which solver”
  • “/select-solver”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): opencode, codex, claude

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Understand the conditions
  2. Let the conditions drive the choice
  3. Assemble the solver
  4. Creating a custom solver

What it can do on your machine

Read from SKILL.md and the folder at commit 0cd8afb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode, codex, claude

    From compatibility in the SKILL.md frontmatter.

Context cost

Select Solver loads about 2.9k tokens when it runs. Until then it costs about 131 tokens; SKILL.md has 852 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~131
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PINA-org/PINA at commit 0cd8afb, republished under its MIT licence (© PINA-org). 852 words, ~2,907 tokens.

Download SKILL.mdSave it as .claude/skills/select-solver/SKILL.md (or your agent's skills folder).
name
select-solver
description
Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits. Use when the user asks "what solver should I use", "how do I train this", "which solver", "choose a solver", "pick a solver", "solver selection", "how do I set up training", "what's the right solver", or similar. Also triggers when the user mentions specific solver names (PINN, CausalPINN, SelfAdaptivePINN, SupervisedSolver, etc.) or asks about custom training loops / custom solvers.
compatibility
opencode, codex, claude
license
MIT
metadata.audience
users
metadata.workflow
solver-selection

Select a Solver for a PINA Problem

[!IMPORTANT] Read RULES.md before using this skill — it applies to all skills.

Use this skill to pick the correct PINA solver — or design a custom one — based on your problem type, conditions, and training requirements.

PINA solvers are driven by conditions (data format) and model count (single vs ensemble). The condition types in your problem.conditions dictate which solver families are compatible; additional requirements (causality, gradient enhancement, adaptive weighting) narrow the choice further.

Step 1 — Understand the conditions

Start by identifying what kind of data your problem works with. Ask conversationally if the user hasn't already built their problem object:

  • Time series? — Your conditions use n_windows and unroll_length. The data has a sequential structure and the model rolls out predictions step by step.
  • Input → Target? — You have input points and known target values. This is standard supervised / regression data: Condition(input=..., target=...).
  • PDE equations + domains? — Your conditions reference equations and domains/spatial points: Condition(domain=..., equation=...) or Condition(input=..., equation=...).
  • Mixed? — Many physics-informed problems mix equation conditions (for the PDE interior) with target conditions (for boundary data or observations).

You can inspect an existing problem object directly:

python
for name, cond in problem.conditions.items():
    print(name, type(cond).__name__)

If the user hasn't defined conditions yet, ask if you can help setting up the problem.

Step 2 — Let the conditions drive the choice

Once the condition types are clear, map them to solver families. This is a decision tree, not a menu — work through it with the user.

Time series conditions

If every condition is (or includes) a TimeSeriesCondition:

→ AutoregressiveSingleModelSolver  (one model)
→ AutoregressiveEnsembleSolver     (multiple models, averaged)

No other solver family handles TimeSeriesCondition.

Key parameters:

  • eps — noise injected during unrolling (regularisation)
  • unroll_length — number of steps per forward pass
Input → Target conditions only

If all conditions are InputTargetCondition (no equations, no domains):

→ SupervisedSingleModelSolver  (one model)
→ SupervisedEnsembleSolver     (N models with deep ensemble)

The Ensemble variant trains N independent copies and averages their predictions at inference.

Equation conditions (physics-informed)

If conditions include InputEquationCondition or DomainEquationCondition, you're in the physics-informed family. Now ask two follow-up questions:

1. How many models: one or multiple?
CountOptions
Single modelPhysicsInformedSingleModelSolver (base) + its specialisations below
Multiple models (ensemble)PhysicsInformedEnsembleSolver

Multiple models trains N independent copies and averages predictions.

2. Any special training requirement?

For the single-model physics-informed case, ask the user about these. Each maps to a distinct solver:

RequirementSolverWhat it does
Standard (no special needs)PhysicsInformedSingleModelSolverPlain PINN training
Gradient-enhancedGradientPhysicsInformedSingleModelSolverAdds gradient norm penalty — regularises the solution's derivatives. Requires SpatialProblem (needs .spatial_variables).
Causality in timeCausalPhysicsInformedSingleModelSolverApplies causal temporal weighting so the solver learns forward in time. Requires TimeDependentProblem.
Per-point residual attentionRBAPhysicsInformedSingleModelSolverRe-weights collocation points by residual magnitude across epochs (focus on hard regions).
Per-parameter adaptive weightsSelfAdaptivePhysicsInformedSolverLearns a per-point weight through a second model (min-max optimisation).
Adversarial discriminatorCompetitivePhysicsInformedSolverA discriminator model bets on point residuals; solver must fool it — minimax game.

Self-adaptive and competitive are not single-model solvers — they manage multiple optimisers internally. SelfAdaptive trains a weight network alongside the model; Competitive trains a discriminator.

Ensemble + special requirements? The PhysicsInformedEnsembleSolver does not layer gradient/causal/self-adaptive on top. For those combinations, create a custom solver (Step 4).

Step 3 — Assemble the solver

Once the solver is chosen, the construction pattern is consistent:

python
from pina.solver import PhysicsInformedSingleModelSolver
# or any other solver

solver = PhysicsInformedSingleModelSolver(
    problem=problem,
    model=model,
    learning_rate=0.001,
    # optional:
    # loss=torch.nn.MSELoss(),
    # weighting=my_weighting,
    # scheduler=torch.optim.lr_scheduler.CosineAnnealingLR(...),
    # batch_size=32,
)

Step 4 — Creating a custom solver

When no built-in solver matches your requirements, PINA's architecture makes it straightforward to compose one. The key building blocks are mixins — reusable training_step and _compute_condition_loss overrides.

Show full SKILL.md (376 more words)Show less
When to create a custom solver
  • You need a combination PINA doesn't provide (e.g., causal weighting + ensemble, or gradient-enhanced + competitive)
  • Your loss computation has custom per-condition logic not covered by the existing _compute_condition_loss overrides
  • You need a multi-model setup that isn't just an ensemble (e.g., two models exchanging information in a non-adversarial way)
  • You need to override training_step for a non-standard optimiser loop
How PINA solvers are composed

Every solver is a class hierarchy:

BaseSolver
 ├── training/val/test_step
 ├── _compute_condition_loss
 ├── _prepare_condition_data
 ├── _regularize_condition_loss
 └── _loss_from_residual

SingleModelSolver(BaseSolver)
 └── automatic_optimization=True, single forward

MultiModelSolver(BaseSolver)
 └── automatic_optimization=False, multiple optimisers

EnsembleSolver(BaseSolver)          — uses MultiModelSolver internally
 └── automatic_optimization=False, averages N models

Mixins override specific methods:

MixinOverridesPurpose
PhysicsInformedMixinvalidation_step, test_stepEnables autograd in no-grad contexts
GradientEnhancedMixin_prepare_condition_data, _regularize_condition_lossGradient penalty regularisation
ResidualBasedAttentionMixin_regularize_condition_lossPer-point attention weights
AutoregressiveMixin_loss_from_residualStep-wise adaptive loss
ManualOptimizationMixintraining_stepDisables automatic optimisation
ConditionAggregatorMixintraining_stepIterates conditions, aggregates losses
Custom solver recipe
  1. Pick a base: SingleModelSolver (auto-optim) or MultiModelSolver (manual optim for multiple optimisers) or EnsembleSolver (N-model avg).

  2. Mix in behaviours by inheriting the mixins in the right order (mixins first so their method overrides take priority):

    python
    from pina.solver import SingleModelSolver
    from pina.solver.mixin import GradientEnhancedMixin, PhysicsInformedMixin
    
    class MyCustomSolver(
        PhysicsInformedMixin,      # 1st — ensures autograd in val/test
        GradientEnhancedMixin,     # 2nd — adds gradient penalty
        SingleModelSolver,         # 3rd — base training loop
    ):
        def __init__(self, problem, model, **kwargs):
            super().__init__(problem=problem, model=model, **kwargs)
  3. Override _compute_condition_loss if you need custom per-condition logic (e.g., different loss functions per condition, special weighting). The signature is:

    python
    def _compute_condition_loss(self, condition, data, batch_idx):
        # data is a dict like {"input": tensor, "target": tensor}
        # condition is the Condition object
        ...
        return scalar_tensor
  4. Override training_step only for fundamental changes to the optimiser loop (e.g., alternating min-max, multi-stage schedules):

    python
    def training_step(self, batch, batch_idx):
        # Custom loop: zero_grad → compute loss → manual_backward → step
        ...
Example: Causal ensemble
python
from pina.solver import EnsembleSolver

class CausalEnsemblePINN(EnsembleSolver):
    """Ensemble of models with causal temporal weighting."""
    def _compute_condition_loss(self, condition, data, batch_idx):
        # Inject causal weighting logic here
        # (iterate over time segments, apply causal mask)
        ...

When guiding a user through creating a custom solver, discuss their specific need, identify which existing mixin or base class covers most of it, and then describe only the method they need to override. Avoid generating the full solver class unless the user explicitly asks for it.

Templates

Choosing from conditions

Use this pattern when the problem object already exists:

python
from pina.solver import (
    SupervisedSingleModelSolver,
    PhysicsInformedSingleModelSolver,
    AutoregressiveSingleModelSolver,
    PhysicsInformedEnsembleSolver,
)

condition_types = {type(c).__name__ for _, c in problem.conditions.items()}

if "TimeSeriesCondition" in condition_types:
    solver = AutoregressiveSingleModelSolver(problem=problem, model=model)
elif "InputTargetCondition" in condition_types and not \
     ("InputEquationCondition" in condition_types or
      "DomainEquationCondition" in condition_types):
    solver = SupervisedSingleModelSolver(problem=problem, model=model)
else:
    solver = PhysicsInformedSingleModelSolver(problem=problem, model=model)
Custom solver stub
python
from pina.solver import SingleModelSolver

class MySolver(SingleModelSolver):
    """Custom solver for specialised loss logic."""

    def _compute_condition_loss(self, condition, data, batch_idx):
        # Your custom loss computation
        # data keys: "input", "target" (if InputTargetCondition)
        #            "input", "equation" (if InputEquationCondition)
        ...
        return loss

    def training_step(self, batch, batch_idx):
        # Only if you need a custom optimiser loop
        ...

Checklist

  • Condition types identified (time series / supervised / physics-informed / mixed)
  • Condition-to-solver-family mapping discussed with the user
  • Single-model vs ensemble decision made
  • Special training requirements assessed (causality, gradient, adaptive, competitive)
  • If custom solver: mixin composition pattern understood, only necessary overrides discussed
  • Solver constructed with correct signature (problem, model/models, extra params)

© PINA-org, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/select-solver of PINA-org/PINA.

Open the folder on GitHubat commit 0cd8afb

Compare with similar skills

Select Solver next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Select Solver compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Select Solver this skillPINA-org/PINA797—~2.9kAutomated safety check: PassMIT
Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs13k9 repos~3.3kAutomated safety check: PassMIT
Add Oponnx/onnx22k—~1.2kAutomated safety check: PassApache-2.0
Add Function Bodyonnx/onnx22k—~1.1kAutomated safety check: PassApache-2.0
Add Shape Inferenceonnx/onnx22k—~1.3kAutomated safety check: PassApache-2.0
Onnxtxtonnx/onnx22k—~1.3kAutomated safety check: PassApache-2.0

Similar skills

  • Segment Anything Model Guide

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.

    13k GitHub starsUsed in 9 repos~3.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Op

    onnx/onnx

    Add a new ONNX operator or update an existing operator to a new opset version.

    22k GitHub stars~1.2k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Add a function body definition to an ONNX operator, defining how it decomposes into simpler ops.

    22k GitHub stars~1.1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Add or update type and shape inference for an ONNX operator.

    22k GitHub stars~1.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Onnxtxt

    onnx/onnx

    Read or write ONNX text format ("onnxtxt"). An agent skill from onnx/onnx.

    22k GitHub stars~1.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Scaffold Example

    comet-ml/comet-examples

    Scaffold a brand-new Comet example in this repo from the canonical template under templates/integration-example/.

    175 GitHub stars~1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from PINA-org/PINA

All 10 skills in this repo
  • Create Skill

    PINA-org/PINA

    Create, modify, and improve PINA skills. An agent skill from PINA-org/PINA.

    797 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Pina Workflow

    PINA-org/PINA

    Orchestrates a complete session from problem definition through trained solver.

    797 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Select Model

    PINA-org/PINA

    Guides users through selecting, configuring, or creating a PyTorch model for a PINA problem.

    797 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Select Trainer

    PINA-org/PINA

    Guides users through configuring the PINA Trainer for solver training, including batching strategy, data splitting, and Lightning options.

    797 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Skill Sync Checker

    PINA-org/PINA

    Audits SKILL.md files in this repo's skills directory for references to functions, classes, or modules (mentioned by name in prose, e.g.

    797 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Condition Setup

    PINA-org/PINA

    Set up conditions for PINA problems. An agent skill from PINA-org/PINA.

    797 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed

Questions about Select Solver

What does Select Solver do?

Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits. Select Solver is an agent skill from PINA-org/PINA. Guides users through selecting the right PINA solver for their problem, or creating a custom solver when no built-in fits.

When should I use Select Solver?

Select Solver fits situations like: the user asks what solver should I use; how do I train this; choose a solver; solver selection.

How do I install Select Solver in Claude Code?

Run `npx skills add PINA-org/PINA --skill select-solver -a claude-code`. Or copy the skill folder (.opencode/skills/select-solver in PINA-org/PINA) into .claude/skills/select-solver in your project. Claude Code loads it when a task matches its description.

How do I install Select Solver in Codex?

Run `npx skills add PINA-org/PINA --skill select-solver -a codex`. Or copy the skill folder (.opencode/skills/select-solver in PINA-org/PINA) into .agents/skills/select-solver in your project. Codex loads it when a task matches its description.

Can I use Select Solver in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PINA-org/PINA --skill select-solver -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/select-solver, .gemini/skills/select-solver, .github/skills/select-solver and .opencode/skills/select-solver in your project.

What does Select Solver need to run?

SKILL.md names no scripts, command-line tools or credentials: Select Solver is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): opencode, codex, claude.

Does Select Solver access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Select Solver safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Select Solver use?

Select Solver is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Select Solver use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Select Solver?

Skills that share tags, products or a category with Select Solver: Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars), Add Op (onnx/onnx, 22k stars), Add Function Body (onnx/onnx, 22k stars) and Add Shape Inference (onnx/onnx, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Select Solver?

PINA-org (a GitHub organization) maintains it in PINA-org/PINA, which has 797 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 6, 2026.

Source: PINA-org/PINA on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.