Imported from knnmelprop/YAADO (
AGENTS.md). Install upstream withnpx skills add knnmelprop/YAADO. Copyright stays with the author.
YAADO β System Prompt & Context for Agents
This file provides critical context, repository architecture, and mandatory rules for all AI agents operating in the YAADO (Yet Another Aerospace Design Optimizer) repository.
π§ New agent session? First, read
CONTRIBUTING.mdandONBOARDING.md. They contain the full handoff: data-status discipline, branching rules, and conventions.
Project Scope (Crucial Context)
YAADO is a general, vehicle-agnostic preliminary design and MDO framework intended for use by Polish Science Clubs. It acts as a strict, user-friendly superstructure over complex physics engines (SUAVE, SU2, pyCycle).
- Do NOT hardcode solvers to specific vehicles.
- Do NOT import from
Hangar/insideYAADO_Core/.
While the repository currently contains reference configurations in Hangar/examples/ (like the AGM-84 Harpoon and ALVRJ), the core framework (YAADO_Core/) must remain entirely generic and capable of analyzing any vehicle defined by the Pydantic schemas.
Architecture
βββ YAADO_Core/ # Core Framework
β βββ Foundation/ # BaseVehicleConfig, BaseAnalysis, FidelityLevel (L0βL3)
β βββ FlightDeck/ # Mission & Optimization Orchestrator
β βββ ComponentStore/ # Pydantic v2 schemas (strict type validation)
β βββ modules/ # Swappable physics solvers
β β βββ wind_tunnel/ # AVL, XFOIL, SU2, empirical correlations
β β βββ powerplant/ # pyCycle, generic engine maps
β β βββ flight_dynamics/ # Trajectory simulators
β β βββ stability_control/# Datcom, Barrowman
β β βββ airframe/ # Geometry generation (OpenVSP) and meshing (Gmsh)
β
βββ tests/ # Pytest unit suite mirroring entire repo structure
βββ Terminal/ # CLI, vehicle assembly, template generation
βββ Hangar/ # User workspace: Declarative vehicle TOML configs
βββ FlightLogs/ # User workspace: Output data, logs, and custom study scripts
βββ external/ # Git submodules (SUAVE, pyCycle, SU2, OpenVSP)
General Project Rules (Mandatory)
- Always use SI units. All internal variables, solvers, and Pydantic schema fields store canonical SI units as floats without unit suffixes in field names (
thrust,span,total_mass). Component schemas declare canonical units viaUNITS: ClassVar[dict[str, str]], andAnalysisResultscarries units in a dedicatedunits: dict[str, str]dictionary. Unit conversion for user input at the CLI boundary might useopenmdao.utils.units(do not use Pint). - Type hints are required on all public functions.
- Google-style docstrings (in English) for every public class and method.
- Inheritance for Solvers, Composition for Data: Extend solvers by inheriting from
BaseAnalysis. However, vehicles and Pydantic schemas must be built using Composition (Lego bricks), not deep inheritance trees. - After every change, run tests:
uv run pytest --tb=short.
Obligatory Coding Principles (Mandatory)
These are necessary to keep the repository scalabale and maintainable.
-
Kill untyped dictionaries; use typed containers:
- Do not use untyped dictionaries for internal state or multi-variable returns. Use typed, frozen dataclasses (e.g.
TrajectorySamples,TrajectoryMetrics). - Remove dictionary emulation methods (
to_dict,from_dict,__getitem__,get,__contains__) and "backwards compatibility" shims. The framework does not need them;FlightLogger/YaadoJSONEncoderserializes dataclasses natively viaasdict(). - Do not churn metadata dictionaries in loops. Sweeps and ODE routines should only extract and return the raw numbers or dataclasses needed, avoiding repeated 40-key documentation dict allocations.
- Strip out filler comments, self-evident docstrings, and essays in comments.
- Do not use untyped dictionaries for internal state or multi-variable returns. Use typed, frozen dataclasses (e.g.
-
Single source of truth & centralized constants:
- Import universal physics constants (
G0,R_AIR,P0_ISA, etc.) fromYAADO_Core.Foundation.constants. Do not define loose duplicates at the top of files. If any constants are missing they must be added toYAADO_Core.Foundation.constants. - ALWAYS centralized atmosphere models from
YAADO_Core.Foundation.atmosphere(isa_atmospherefor scalar,isa_atmosphere_arrayfor vectorized).
- Import universal physics constants (
-
Component resolving (no hardcoded schemas):
- Scripts must operate on generic registry tuples and union types in
ComponentStore(e.g.BOOSTER_COMPONENTS/AnyBoosterComponent,BODY_COMPONENTS/AnyBodyComponent,AERO_COMPONENTS/AnyAeroComponent). - NEVER hardcode specific leaf classes (like
SolidMotororFuselage) in logic or type annotations. Subsystem discovery must useisinstance(comp, SUBSYSTEM_COMPONENTS). - NEVER import vehicle schemas from
Hangar/intoYAADO_Core/.
- Scripts must operate on generic registry tuples and union types in
-
Strict data contracts & mypy/ruff compliance:
- AVOID dual-path typing: NEVER accept
T | Mapping[str, Any]and NEVER writeif isinstance(x, dict): ... else: ...to accommodate loose mock tests. Fix the tests to supply the typed dataclass/model. - AVOID redundant runtime type casting (e.g. unnecessary
float(...)orint(...)calls in hot ODE loops). If Mypy complains about types, fix the upstream return signatures (e.g. separating scalar vs. vectorized functions). - When external libraries require function attributes (like SciPy's
solve_ivpevent callablesterminalanddirection), attach them viasetattr()to satisfy static checkers cleanly. - The scripts must pass mypy and ruff checks with zero errors.
- AVOID dual-path typing: NEVER accept
-
Single entry-point:
- No standalone
argparseblocks, CLI scripts, or runnableif __name__ == "__main__":blocks. All execution goes through the main YAADO CLI (Terminal/).
- No standalone
-
Verification on real TOML configurations:
- Make sure the method can actually run by testing it on an actual TOML file from
Hangar/examples/(or via vehicle factory), not just synthetic unit mocks. - Ensure the full test suite passes:
uv run pytest --tb=short. - The
pytesttest suite MUST NOT involve generation of any files inFlightLogs/.
- Make sure the method can actually run by testing it on an actual TOML file from
Running Tests
uv run pytest --tb=short
Dev dependencies are managed via uv. Submodules in external/ are required for full execution, but core tests mock or gracefully handle missing binaries where possible.