/aa-jl:developing-julia-packagefrom aa-jl
Guides Julia package development: module/include layout, multiple dispatch, type stability, exports discipline, formatting, and docstrings. Use when implementing or editing code inside an existing Julia package.
Ships in aa-jl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Notes on developing Julia packages.
Assume the package is named MyPkg. Substitute your actual package name wherever MyPkg appears.
Use src/MyPkg.jl as the package entry point. Keep the module declaration, exports, and include list there; put substantial implementation in focused files under src/.
module MyPkg
export fit_model, FitResult, GaussianModel
include("models.jl")
include("fit.jl")
include("preprocess.jl")
end
Split files to improve readability, not to recreate Python-style class or submodule hierarchies. Prefer one public module unless there is a real user-facing namespace boundary.
Guidelines below.
exportsTo audit and clean up an existing package's exports (for example, helpers
exported only so Pkg.test can reach them), see [[fixing-julia-exports]].
export helpers that are only used internally just so tests can reach them. Prefer importing explicitly in tests:# test/runtests.jl
using Test
using MyPkg: <internal-only helper>
Test public behavior through the public API first. Import internals only when the helper has meaningful behavior that is hard to exercise through the public path:
using Test
using MyPkg
using MyPkg: initial_guess
@testset "fit_model" begin
result = fit_model(x, y; model = GaussianModel())
@test result isa FitResult
end
@testset "initial_guess" begin
@test initial_guess(x, y, GaussianModel()) isa NamedTuple
end
Prefer splitting behavior across methods instead of a large if/elseif chain on isa, unlike typical Python style.
# Do not write if else end
function f(x)
if x isa Integer
return 2x
else
return x
end
end
Instead, use multiple dispatch:
f(x) = x # generic implementation
f(x::Integer) = 2x # specialized implementation for x::Integer
For package APIs, make the dispatch object explicit and keep symbol options as a thin compatibility layer if needed:
abstract type AbstractModel end
struct GaussianModel <: AbstractModel
baseline::Bool
end
GaussianModel(; baseline = true) = GaussianModel(baseline)
fit_model(x, y; model::AbstractModel = GaussianModel()) =
fit_model(model, x, y)
function fit_model(model::GaussianModel, x, y)
guess = initial_guess(x, y, model)
# gaussian-specific implementation
end
Use a marker or configuration struct for the model choice, and use a separate result struct for fitted values. Do not mutate a model type into a mixed "algorithm plus fitted state" object unless that is clearly the public contract.
struct FitResult{P,T}
params::P
residuals::Vector{T}
converged::Bool
end
This keeps GaussianModel() as the method-selection/configuration value and FitResult as the returned fitted state.
.JuliaFormatter.toml at the repository root (or rely on defaults) so everyone applies the same rules.From the package root:
using JuliaFormatter
format(".") # formats src/, test/, etc. under the current directory
Run formatting before merging substantive edits; wire the same command into CI or pre-commit hooks if the team wants enforcement.
@benchmark / @btime from BenchmarkTools.jl rather than a single @time, which is dominated by variance and one-time effects.ArgumentError, DomainError, or other appropriate exceptions; messages should tell the caller what to fix.@doc when you attach documentation programmatically.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub atelierarith/atelier-arith-julia-development-skills --plugin aa-jl14 skills in this plugin
/auditing-julia-package-practicesUse when you review an existing or in-progress Julia package against this repository's development practices and want prioritized, evidence-based findings and concrete remediation suggestions/creating-julia-appUse when you create a CLI written in Julia packages or MCP servers/debugging-juliaUse when Julia code errors, throws an exception, produces wrong results, or crashes and you need to find the cause from the command line: capturing and reading stack traces, locating the failing method with @which/@code_warntype/@code_typed, finding potential runtime errors with JET.jl, and narrowing to a minimal reproduction/developing-julia-rust-bindingsUse when implementing or debugging Julia bindings to a Rust library with RustCall.jl or a native ABI. Covers memory ownership, Julia dispatch, reproducible builds, and isolating upstream failures with executable reproductions./documenting-julia-packageUse when you add, build, or publish documentation for a Julia package with Documenter.jl: the `docs/` layout, `docs/Project.toml`, `makedocs`/`deploydocs`, `@docs` and docstring blocks, doctests, and GitHub Pages deployment/finding-latest-julia-versionUse when you need the latest stable JuliaLang version number (e.g., to fill `VERSION=` in an install script) instead of hard-coding a value