Guidelines
akash-network/node
Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.
Refactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions.
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install golemcloud/golem moonbit-refactoring --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .claude/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .claude/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoringType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install golemcloud/golem moonbit-refactoring --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .agents/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .agents/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install golemcloud/golem moonbit-refactoring --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .cursor/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .cursor/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/golemcloud/golem.git --path .agents/skills/moonbit-refactoring--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install golemcloud/golem moonbit-refactoring --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .gemini/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .gemini/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install golemcloud/golem moonbit-refactoringInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .github/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .github/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add golemcloud/golem --skill moonbit-refactoring -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install golemcloud/golem moonbit-refactoring --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/golemcloud/golem.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/moonbit-refactoring .opencode/skills/moonbit-refactoring && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "moonbit-refactoring" agent skill from https://github.com/golemcloud/golem/tree/main/.agents/skills/moonbit-refactoring into .opencode/skills/moonbit-refactoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "moonbit-refactoring", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
moonbit-refactoringRefactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions.
Moonbit Refactoring is an agent skill from golemcloud/golem. Refactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions. Use when updating MoonBit packages or refactoring MoonBit APIs, modules, or tests.
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.
It sits in Development, covering Refactoring. The repository describes itself as: Golem Cloud is the agent-native platform for building AI agents and distributed applications that never lose state, never duplicate work, and never require you to build… The licence is MIT.
7 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit c6a3029. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are mbt and bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Moonbit Refactoring loads about 2.2k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 782 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from golemcloud/golem at commit c6a3029, republished under its MIT licence (© golemcloud). 782 words, ~2,238 tokens.
.claude/skills/moonbit-refactoring/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Start broad, then refine locally:
moon ide doc, moon ide find-references).moon check, then moon test.Avoid local cleanups (renaming, pattern matching) until the high-level structure is sound.
Treat files in MoonBit as organizational units; move code freely within a package as long as each file stays focused on one concept.
When spinning off package A into A and B:
Create the new package and re-export temporarily:
// In package B
using @A { ... } // re-export A's APIsEnsure moon check passes before proceeding.
Find and update all call sites:
moon ide find-references <symbol>Replace bare f with @B.f.
Remove the use statement once all call sites are updated.
Audit and remove newly-unused pub APIs from both packages.
internal/ package for helpers that shouldn't leak.pub from helpers; keep only required exports.internal/ packages to block external imports... for fluent, mutating chains when it reads clearly.Example:
// Before
fn reader_next(r : Reader) -> Char? { ... }
let ch = reader_next(r)
// After
#as_free_fn(reader_next, deprecated="Use Reader::next instead")
fn Reader::next(self : Reader) -> Char? { ... }
let ch = r.next()To make the transition smooth, place #as_free_fn(old_name, ...) on the method; it emits a deprecated free function
old_name that forwards to the method.
Then you can check call sites and update them gradually by looking at warnings.
Example (chaining):
buf..write_string("#\\")..write_char(ch)@pkg.fn instead of using when clarity matters.Example:
let n = @parser.parse_number(token)When the expected type is known from context, you can omit the full package path for enum constructors:
Examples:
// Pattern matching - annotate the value being matched
let tree : @pkga.Tree = ...
match tree {
Leaf(x) => x
Node(left~, x, right~) => left.sum() + x + right.sum()
}
// Nested constructors - only outer needs full path
let x = @pkga.Tree::Node(left=Leaf(1), x=2, right=Leaf(3))
// Return type provides context
fn make_tree() -> @pkga.Tree {
Node(left=Leaf(1), x=2, right=Leaf(3))
}
// Collections - type annotation on the array
let trees : Array[@pkga.Tree] = [Leaf(1), Node(left=Leaf(2), x=3, right=Leaf(4))].. in the middle to match prefix and suffix at once.Array[Char].String/StringView indexing yields UInt16 code units. Use for ch in s for Unicode-aware iteration.For example,
match gen_results.get(0) {
Some(value) => Iter::singleton(value)
None => Iter::empty()
}We can pattern match directly; it is often clearer and equally readable:
match gen_results {
[value, ..] => Iter::singleton(value)
[] => Iter::empty()
}MoonBit pattern matching is pretty expressive, here are some more examples:
match items {
[] => ()
[head, ..tail] => handle(head, tail)
[..prefix, mid, ..suffix] => handle_mid(prefix, mid, suffix)
}match s {
"" => ()
[.."let", ..rest] => handle_let(rest)
_ => ()
}Use char literal overloading for Char, UInt16, and Int; the examples below rely on it. This is handy when matching String indexing results (UInt16) against a char range.
test {
let a_int : Int = 'b'
if (a_int is 'a'..<'z') { () } else { () }
let a_u16 : UInt16 = 'b'
if (a_u16 is 'a'..<'z') { () } else { () }
let a_char : Char = 'b'
if (a_char is 'a'..<'z') { () } else { () }
}isis patterns inside if/guard to keep branches concise.Example:
match token {
Some(Ident([.."@", ..rest])) if process(rest) is Some(x) => handle_at(rest)
Some(Ident(name)) => handle_ident(name)
None => ()
}Example:
// Before
let mut a = 1
let mut b = 2
for i = 0 {
if i >= n {
break
}
a = a + b
b = b + a
continue i + 1
}for i = 0, a = 1, b = 2 {
if i >= n {
break a
}
continue i + 1, b, b + a
}for _ in 0..<n; a = 1, b = 2 {
continue b, a + b
} nobreak {
a
}for i in start..<end { ... }, for i in start..<=end { ... }, for i in large>..small, or for i in large>=..small for simple index loops.for x in xs {...} if xs is an iterator(e.g, Array) or for i,x in xs {...} if you also want to use the indexfor loops for algorithms that update state.Example:
// Before
for i = 0; i < len; i = i + 1{
items.push(fill)
}
// After
for i in 0..<len {
items.push(fill)
}for x in xs loops.Example:
for i = 0, acc = 0; i < xs.length(); {
acc = acc + xs[i]
i = i + 1
} nobreak { acc }
where {
invariant: 0 <= i <= xs.length(),
reasoning: (
#| ... rigorous explanation ...
#| ...
)
}*_test.mbt or *.mbt.md.mbt check fenced blocks for public APIs, and verify with moon check && moon test.Example:
///|
/// Return the last element of a non-empty array.
///
/// # Example
/// ```mbt check
/// test {
/// inspect(last([1, 2, 3]), content="3")
/// }
/// ```
pub fn last(xs : Array[Int]) -> Int { ... }Commands:
moon coverage analyze -- -f summary
moon coverage analyze -- -f caret -F path/to/file.mbtmoon ide doc "<query>"
moon ide outline <dir|file>
moon ide find-references <symbol>
moon ide peek-def <symbol>
moon ide rename <symbol> <new_name>
moon ide analyze [path]
moon check
moon test
moon infoUse these commands for reliable refactoring.
Example: spinning off package_b from package_a.
Temporary import in package_b:
using @package_a { a, type B }Steps:
moon ide find-references <symbol> to find all call sites of a and B.@package_a.a and @package_a.B.using statement and run moon check.© golemcloud, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in .agents/skills/moonbit-refactoring of golemcloud/golem.
Open the folder on GitHubat commit c6a3029
Moonbit Refactoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Moonbit Refactoring this skillgolemcloud/golem | 1.5k | — | ~2.2k | Automated safety check: Pass | MIT | |
| Guidelinesakash-network/node | 1.1k | 22 repos | ~577 | Automated safety check: Pass | MIT | |
| Component Refactoringlangflow-ai/langflow | 156k | — | ~3.5k | Automated safety check: Pass | MIT | |
| Migrate Core Code to Submodulestinyhumansai/openhuman | 42k | — | ~2.6k | Automated safety check: Pass | GPL-3.0 | |
| Systematic Code Refactoringluongnv89/claude-howto | 42k | — | ~3k | Automated safety check: Pass | MIT | |
| Codexskills-directory/skill-codex | 1.5k | 3 repos | ~1.8k | Automated safety check: Pass | MIT |
akash-network/node
Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.
langflow-ai/langflow
Refactor high-complexity React components in Langflow frontend.
tinyhumansai/openhuman
Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
skills-directory/skill-codex
A skill your agent uses when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
DavidObando/gsharp
Forces the laziest solution that actually works, simplest, shortest, most minimal.
golemcloud/golem
Guide for writing MoonBit bindings to C libraries using native FFI.
golemcloud/golem
Adding or updating crate dependencies in the Golem workspace.
golemcloud/golem
Analysing GitHub Actions CI failures from a run URL. An agent skill from golemcloud/golem.
golemcloud/golem
Adds a built-in WASM plugin that is externally released and provisioned by the registry service.
golemcloud/golem
Writing database migration SQL scripts. An agent skill from golemcloud/golem.
golemcloud/golem
Diagnosing and fixing hanging worker executor or integration tests.
Categories
Refactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions. Moonbit Refactoring is an agent skill from golemcloud/golem. Refactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions.
Moonbit Refactoring fits situations like: updating MoonBit packages; refactoring MoonBit APIs.
Run `npx skills add golemcloud/golem --skill moonbit-refactoring -a claude-code`. Or copy the skill folder (.agents/skills/moonbit-refactoring in golemcloud/golem) into .claude/skills/moonbit-refactoring in your project. Claude Code loads it when a task matches its description.
Run `npx skills add golemcloud/golem --skill moonbit-refactoring -a codex`. Or copy the skill folder (.agents/skills/moonbit-refactoring in golemcloud/golem) into .agents/skills/moonbit-refactoring in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add golemcloud/golem --skill moonbit-refactoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/moonbit-refactoring, .gemini/skills/moonbit-refactoring, .github/skills/moonbit-refactoring and .opencode/skills/moonbit-refactoring in your project.
SKILL.md names no scripts, command-line tools or credentials: Moonbit Refactoring is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Moonbit Refactoring is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Moonbit Refactoring: Guidelines (akash-network/node, 1.1k stars), Component Refactoring (langflow-ai/langflow, 156k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars) and Systematic Code Refactoring (luongnv89/claude-howto, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
golemcloud (a GitHub organization) maintains it in golemcloud/golem, which has 1,507 GitHub stars. The repository holds 289 skills in this directory. The repository was last updated on October 8, 2026.
Source: golemcloud/golem on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.