Skip to content
Back to skills

Safe Yaml Builder Pattern

ASecurity

Sub-skill of orcaflex-yaml-gotchas: Safe YAML Builder Pattern (+1).

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
documentationpythongo

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill safe-yaml-builder-pattern --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Safe Yaml Builder Pattern?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Safe Yaml Builder Pattern
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-safe-yaml-builder-pattern/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-safe-yaml-builder-pattern)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: orcaflex-yaml-gotchas-safe-yaml-builder-pattern
description: 'Sub-skill of orcaflex-yaml-gotchas: Safe YAML Builder Pattern (+1).'
version: 1.0.0
category: engineering
type: reference
scripts_exempt: true
---

# Safe YAML Builder Pattern (+1)

## Safe YAML Builder Pattern


When generating OrcaFlex YAML programmatically, use this pattern to avoid dormant property traps:

```python
def build_environment_section(spec):
    """Build environment YAML with safe defaults first, then overlay."""
    # Start with safe defaults that won't trigger dormant property errors
    env = {
        "SeabedModel": "Elastic",
        "MultipleCurrentDataCanBeDefined": False,
        "CurrentModel": "Variation scheme",
        "WindType": "Constant",
        "WaveType": "None",
    }

    # Overlay specific values from spec
    if spec.waves:
        env["WaveType"] = spec.waves.type
        if spec.waves.type in ("JONSWAP", "Pierson-Moskowitz"):
            env["WaveHs"] = spec.waves.Hs
            env["WaveTp"] = spec.waves.Tp
            if spec.waves.type == "JONSWAP":
                env["WaveGamma"] = spec.waves.gamma

    return {"Environment": env}
```


## Section Ordering Template


```python
# Emit sections in this order to avoid reference errors
_SECTION_ORDER = [
    "General", "VariableData", "ExpansionTables",
    "RayleighDampingCoefficients", "FrictionCoefficients", "LineContactData",
    "LineTypes", "VesselTypes", "ClumpTypes", "StiffenerTypes", "SupportTypes",
    "Vessels", "Lines", "Shapes", "6DBuoys", "3DBuoys",
    "Constraints", "Links", "Winches", "FlexJoints",
    "MultibodyGroups", "BrowserGroups", "Groups",
]

def order_sections(model_dict):
    """Reorder model dict to match OrcaFlex dependency order."""
    ordered = {}
    for key in _SECTION_ORDER:
        if key in model_dict:
            ordered[key] = model_dict[key]
    # Append any unknown sections at the end
    for key in model_dict:
        if key not in ordered:
            ordered[key] = model_dict[key]
    return ordered
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.