motoko-core-code-improvements

Automate safe Motoko code cleanups for mo:core projects.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/research-ag/motoko-skills --skill motoko-core-code-improvements
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: motoko-core-code-improvements
Source: https://github.com/research-ag/motoko-skills/tree/main/skills/code-improvements
Command: npx skills add https://github.com/research-ag/motoko-skills --skill motoko-core-code-improvements

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams improve readability and consistency in mo:core Motoko projects by applying mechanical, semantics-preserving cleanups without changing behavior.

Core Features & Use Cases

  • Aggregate imports into sections (mo:core, other mo:*/..., local modules) and sort each section alphabetically per file
  • Prefer dot‑notation where available in mo:core, and clean up truly unused imports with safety checks
  • Remove redundant return statements in single-expression functions and automate secure refactors
  • Provide audit checks, category guidelines, and restartable steps to ensure safe, incremental changes

Quick Start

Run the skill against your Motoko project to apply automated code-cleanup recipes (no-ops are safe and isolated per category).

Frequently Asked Questions about motoko-core-code-improvements

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Motoko code cleanup for mo:core projects?▼

Automated Motoko code cleanup applies mechanical, semantics-preserving refactoring to mo:core projects, enforcing import sections, dot-notation, and unused import removal without changing behavior.

How do I aggregate and sort Motoko imports alphabetically per file?▼

Aggregate and sort Motoko imports by grouping them into three sections: mo:core, other mo:*/..., and local modules, then sorting each section alphabetically per file for readability.

Can I safely remove unused imports in Motoko without changing behavior?▼

Yes, you can safely remove unused imports in Motoko using safety checks that ensure the cleanup is a no-op if the import is still referenced, preserving the original semantics.

What is the best way to enforce dot-notation in mo:core Motoko modules?▼

Enforcing dot-notation in mo:core Motoko modules is done by applying automated refactoring recipes that prefer dot-notation where available, ensuring deterministic and audit-friendly improvements.

Does automated Motoko refactoring support incremental and restartable steps?▼

Automated Motoko refactoring supports incremental and restartable steps, providing audit checks and category guidelines to ensure safe, isolated changes across modules per category.

When should I not use automated code cleanup for Motoko?▼

Avoid automated code cleanup for Motoko when custom import structures or non-standard dot-notation usage exists, as the skill enforces strict mo:core import sections and style standardization.