Musify MooreThreads
v0.1.0Convert CUDA code to MUSA (Moore Threads GPU) using the musify tool. Use when migrating CUDA codebases to MUSA platform, converting CUDA kernels/APIs to MUSA...
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description match the instructions: the SKILL.md documents running a musify-text conversion tool over CUDA source files and contains expected options and mappings. There are no unrelated credentials, binaries, or config paths requested.
Instruction Scope
Instructions remain within the conversion task (running musify-text, finding source files, options, exclusion markers). They explicitly include in-place modification operations and batch file selection (find/rg), which is appropriate for a migration tool but increases risk to source if run without backups or vetting. The doc advises backing up code; it does not instruct reading or exfiltrating unrelated system files or credentials.
Install Mechanism
There is no automated install spec in the skill (instruction-only), which limits what is written to disk. The doc suggests pip install ahocorapy and that musify-text should come from the MUSA toolkit; pip-installing introduces normal package-source risk (typo-squatting or malicious package) but that is expected for a tool relying on Python packages.
Credentials
No environment variables, credentials, or config paths are requested. The declared requirements map cleanly to the tool's stated functionality.
Persistence & Privilege
Skill is not marked always:true and is user-invocable only. It does not request persistent platform-wide access or modify other skills' configurations.
Assessment
This SKILL.md is coherent with a code-migration tool, but take these precautions before running it: 1) Do a full backup or ensure version control before using --inplace; prefer --create or printing to stdout for an initial pass. 2) Verify the origin of musify-text and the ahocorapy package (install from official MooreThreads releases or the project's GitHub, not a similarly named pip package). 3) Test conversion on a small subset of files and run the MUSA compiler/tests before committing changes. 4) Avoid running automated bulk commands (find/rg piped into --inplace) until you're confident the mappings and exclusion markers behave as expected.Like a lobster shell, security has layers — review code before you run it.
latest
Musify - CUDA to MUSA Code Conversion
Musify converts CUDA code to MUSA (Moore Threads GPU architecture) using text-based API mapping.
Installation
# Install dependencies
pip install ahocorapy
# musify-text should be available in MUSA toolkit
Basic Usage
# Convert files in-place (CUDA -> MUSA)
musify-text --inplace -- file1.cu file2.cpp
# Convert and create new files (default)
musify-text --create -- a.cu b.cpp
# Print to stdout
musify-text -t -- file.cu
Batch Conversion
# Find and convert all CUDA/C++ files in directory
musify-text --inplace -- $(find /path/to/project -name '*.cu' -o -name '*.cuh' -o -name '*.cpp' -o -name '*.h')
# Using ripgrep (recommended)
musify-text --inplace -- $(rg --files -g '*.cu' -g '*.cuh' -g '*.cpp' -g '*.h' /path/to/project)
Options
| Option | Description |
|---|---|
-t, --terminal | Print output to stdout |
-c, --create | Create new files with converted code (default) |
-i, --inplace | Modify files in-place |
-d {c2m,m2c} | Conversion direction: c2m (CUDA→MUSA, default), m2c (MUSA→CUDA) |
-m <file.json> | Custom API mapping file (can specify multiple) |
--clear-mapping | Clear default mapping, use only custom mappings |
-l {DEBUG,INFO,WARNING} | Log level |
Exclusion Markers
Prevent specific code sections from being converted:
// MUSIFY_EXCL_LINE - Exclude this line
char *str = "cudaMalloc"; // MUSIFY_EXCL_LINE
// MUSIFY_EXCL_START - Start exclusion block
char *apis[] = {
"cudaInit",
"cudaFree"
};
// MUSIFY_EXCL_STOP - End exclusion block
Common CUDA → MUSA Mappings
| CUDA | MUSA |
|---|---|
cuda prefix | musa prefix |
CUDA | MUSA |
cu prefix (driver API) | mu prefix |
__cuda | __musa |
cudaMalloc | musaMalloc |
cudaFree | musaFree |
cudaMemcpy | musaMemcpy |
cudaLaunchKernel | musaLaunchKernel |
__global__ | __global__ (unchanged) |
__device__ | __device__ (unchanged) |
__shared__ | __shared__ (unchanged) |
Workflow
- Backup code before conversion
- Run musify on target files
- Review changes - text-based conversion may need manual fixes
- Compile with MUSA compiler (
mcc) to verify - Test on MUSA device
References
Comments
Loading comments...
