🔄 Cross-Platform Translator Skill
When to use this skill
Use this skill when a new automation script is created in one shell language, and the workspace Constitution requires its equivalent to be generated for cross-platform compliance.
Instructions
- Analyze Source: Read the source script (e.g.,
tools/myscript.ps1) to understand its exact logical flow, variable assignments, standard output formats, and error handling. - Determine Target: If the source is
.ps1, the target is.sh(Bash). If the source is.sh, the target is.ps1(PowerShell). - Translation Rules:
- Banners: Preserve the exact DSOM banner text and colors (using ANSI escape codes in Bash, or
Write-Host -ForegroundColorin PowerShell). - Paths: Ensure path separators are idiomatic (use
/or\appropriately, though PowerShell often accepts/). - Error Handling: Map PowerShell's
try/catchor$ErrorActionPreference = "Stop"to Bash'sset -eor specificif ! command; then ... fichecks. - Dependencies: If the script calls another script, ensure it calls the correct extension for its platform (e.g., a
.ps1script should callreanimate.ps1, notreanimate.sh). - Output Generation: Write the translated script to the target file.
- Update Documentation: If the script is documented in
docs/tools/, ensure the documentation accurately lists both the.ps1and.shfile names.
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-04 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0