skills/hanafsky/julia-skills/julia-vibe-coding

julia-vibe-coding

SKILL.md

Julia Vibe Coding Skill

Workflow for Julia × claude-code (julia-mcp): avoid TTFX, keep code in Literate.jl format.

How julia-mcp works

Keeps a julia -i process alive per project directory. Code is sent via stdin/stdout pipe. Variables, loaded packages, and function definitions persist across julia_eval calls.

Available MCP tools:

  • julia_eval(code, env_path?, timeout?) — execute code (main tool)
  • julia_restart(env_path?) — force session reset (last resort only)
  • julia_list_sessions() — list active sessions

Rules (always follow)

1. Write to file first, then include

# ❌ Inline execution (except 1-liners)
julia_eval("result = some_complex_calculation()")

# ✅ Write to scripts/, then include
julia_eval('include("scripts/explore_topic.jl")', env_path="/abs/path/to/project")

Exception: single-line checks like julia_eval("versioninfo()") are OK inline.

2. Write all .jl files in Literate.jl format

See references/literate_format.md for full syntax. Key rules:

  • # prefix → Markdown text
  • # # Title → H1, # ## Section → H2
  • No prefix → Julia code block
  • expr #hide → executed but hidden in output

3. Always specify env_path explicitly

julia_eval(code, env_path="/abs/path/to/project")

Omitting env_path creates a throwaway session without the project environment.

4. Trust Revise.jl

julia-mcp auto-loads using Revise on startup. After editing src/, do not call julia_restart — Revise handles it.

5. Never touch Pkg (humans only)

# ❌ Absolutely forbidden
julia_eval('import Pkg; Pkg.add("Plots")')

If a package is missing, stop and notify the human:

⚠️ Package not installed. Please run in Julia REPL:
] add SomePackage
Resume when done.

File layout

project/
├── Project.toml
├── Manifest.toml
├── src/          # package code (watched by Revise)
├── scripts/      # exploration scripts (Literate.jl format)
├── notebooks/    # Literate.jl output (.md)
└── test/
  • Exploration code → scripts/ (Literate format)
  • Reusable logic → src/
  • Generated notes → notebooks/

Typical workflow

  1. Create scripts/explore_xxx.jl in Literate format
  2. julia_eval('include("scripts/explore_xxx.jl")', env_path=...)
  3. Edit the file, re-include
  4. Extract stable logic to src/
  5. Export note: Literate.markdown("scripts/explore_xxx.jl", "notebooks/")

Common mistakes

Situation Wrong Right
Want to try code Inline julia_eval("...") Write to scripts/, include
Got an error Call julia_restart Read the error, fix the code
Package missing Pkg.add in julia_eval Notify human with ] add PkgName
Edited src/ Call julia_restart Let Revise handle it

References

  • references/literate_format.md — Literate.jl syntax and examples
  • references/julia_mcp_setup.md — julia-mcp setup instructions
Weekly Installs
3
First Seen
9 days ago
Installed on
opencode3
claude-code3
github-copilot3
codex3
kimi-cli3
gemini-cli3