skills/coding/coding-julia/SKILL.md
Julia: multiple dispatch, type system, metaprogramming, Pkg, scientific computing, GPU CUDA.jl
npx skillsauth add alphaonedev/openclaw-graph coding-juliaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill equips the AI to handle Julia programming tasks, focusing on high-performance scientific computing, data analysis, and GPU acceleration using features like multiple dispatch and metaprogramming.
Use this skill for numerical simulations, data science workflows, GPU-accelerated computations, or when you need efficient type systems and package management. Apply it in scenarios requiring fast prototyping, such as machine learning models or large-scale data processing, especially with libraries like CUDA.jl.
To accomplish tasks, invoke Julia via the REPL or scripts. For interactive sessions, start with julia in the terminal. Use project environments for isolation: create one with julia --project=. and activate via using Pkg; Pkg.activate("."). For metaprogramming, define macros to automate repetitive code. When handling data, load packages first, e.g., using DataFrames for tabular data, then perform operations in a loop or function. Always specify types for performance, like function compute(x::Float64) ... end.
using Pkg; Pkg.add("CUDA") to install CUDA.jl; remove with Pkg.rm("CUDA").julia, then use ?function_name for help; exit with Ctrl+D.julia --project=env_name script.jl to use a specific environment; add -O3 for optimization.function add(a::Int, b::Int) return a + b end; add(1, 2) # Returns 3.using LinearAlgebra; A = rand(3,3); eigenvalues = eigen(A).values.[deps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"; use Manifest.toml for exact versions.Integrate Julia into projects by embedding it in Jupyter notebooks via IJulia.jl: first, install with using Pkg; Pkg.add("IJulia"), then launch with julia -i -e 'using IJulia; notebook()' from the terminal. For external tools, link Julia with C libraries using ccall, e.g., ccall((:function_name, "libname"), ReturnType, (ArgTypes,), args...). If using GPU, ensure CUDA drivers are installed and set the environment variable for paths, like $CUDA_PATH=/usr/local/cuda. For web services, pass API keys via env vars, e.g., ENV["API_KEY"] = $SERVICE_API_KEY before making requests with HTTP.jl.
To handle errors, use try-catch blocks: try; risky_operation(); catch e; println("Error: ", e) end. Check assertions with @assert condition "Message", which throws an error if false. For package issues, run Pkg.status() to verify dependencies; resolve conflicts by updating with Pkg.update(). In GPU code, check CUDA errors via CUDA.device_synchronize() after kernel launches. Always log errors for debugging, e.g., use Logging.jl: using Logging; @info "Starting computation".
function multiply(A::Matrix, B::Matrix) return A * B end; A = rand(1000,1000); result = multiply(A, A) # Handles large arrays via dispatch.using Pkg; Pkg.add("CUDA"); using CUDA; d_a = CuArray([1,2,3]); result = sum(d_a) # Offloads to GPU for speed.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui