| name | orcaflex-model-sanitization |
| version | 1.0.0 |
| category | engineering |
| description | Sanitize OrcaFlex models by stripping client-identifiable references, converting binary .dat to YAML .yml, and organizing into the reference model library. |
| type | reference |
| invocation | /orcaflex-model-sanitization |
| applies-to | ["claude","codex","gemini"] |
| auto_generated | true |
| source | incoming/digitalmodel/orcaflex-model-sanitization |
| promoted | "2026-02-18T00:00:00.000Z" |
| capabilities | [] |
| requires | [] |
| see_also | [] |
| tags | [] |
OrcaFlex Model Sanitization Skill
Description
Sanitize OrcaFlex models from client projects by stripping identifiable references (project names, vessel names, operator codes, user/machine metadata), converting binary .dat to YAML .yml, deduplicating, and organizing into the reference model library.
When to Use
- Importing OrcaFlex models from external/client sources
- Converting
.dat (binary) to .yml (YAML) format
- Stripping client-identifiable references before committing
- Organizing models into the
docs/modules/orcaflex/ library structure
- Deduplicating model collections (hash-based)
Sanitization Pipeline
Overview
Source .dat/.yml → Dedup → Convert → Sanitize Text → Strip Metadata → Organize → Legal Scan → Extract Spec
Step 1: Inventory & Dedup
- Walk source directory for
.dat and .yml files
- Compute SHA-256 hash for each file
- Skip files with identical content (keep first occurrence)
- Exclude: oversized files (>50MB), non-model files (CAD, reports, scripts)
Step 2: Format Conversion (.dat → .yml)
import OrcFxAPI
model = OrcFxAPI.Model(str(dat_path))
model.SaveData(str(output_yml_path))
Gotchas:
SaveData() embeds User:, Machine:, File: metadata in YAML header
SaveData() exports ALL properties including dormant ones
- Binary
.dat files may reference external DLLs or data files
- Large models (>50MB) may timeout — skip and log
Step 3: Text-Based Sanitization
Apply regex replacements using a mapping table:
SANITIZATION_MAP = {
"ClientProject": "generic_project_a",
"VesselName": "installation_vessel_01",
}
sorted_keys = (SANITIZATION_MAP.keys(), key=, reverse=)
text = Path(yml_file).read_text(encoding=, errors=)
key sorted_keys:
replacement = SANITIZATION_MAP[key]
text = text.replace(key, replacement)