Agent skill
orcaflex-yaml-gotchas-safe-yaml-builder-pattern
Sub-skill of orcaflex-yaml-gotchas: Safe YAML Builder Pattern (+1).
Install this agent skill to your Project
npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/engineering/marine-offshore/orcaflex-yaml-gotchas/safe-yaml-builder-pattern
SKILL.md
Safe YAML Builder Pattern (+1)
Safe YAML Builder Pattern
When generating OrcaFlex YAML programmatically, use this pattern to avoid dormant property traps:
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
# 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-complete-milestone
Archive completed milestone and prepare for next version
gsd-reapply-patches
Reapply local modifications after a GSD update
gsd-verify-work
Validate built features through conversational UAT
gsd-thread
Manage persistent context threads for cross-session work
clinical-trial-protocol
Generate clinical trial protocols for medical devices or drugs through a modular, waypoint-based architecture with research-only and full protocol modes.
single-cell-rna-qc
Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations.
Didn't find tool you were looking for?