motoko-dot-notation-migration

Convert Motoko core function calls from self-first parameters to dot notation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Converts Motoko core function calls from a self-first parameter style to dot notation to streamline and modernize codebases using mo:core.

Core Features & Use Cases

  • Converts zero-argument self functions such as Module.func(self) to self.func()
  • Converts multi-argument self function calls while preserving type parameters and nested expressions
  • Respects operator precedence and type-parameter angle-bracket depth to avoid breaking code
  • Applicable when migrating from mo:base to mo:core or upgrading core versions, and when you want to modernize Motoko call syntax

Quick Start

Process a Motoko project with mo:core to migrate relevant self-first function calls to dot notation.

Frequently Asked Questions about motoko-dot-notation-migration

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

FAQPage Schema
How do I convert Motoko core function calls to dot notation?

To convert Motoko core function calls to dot notation, this tool transforms self-first parameters like Module.func(self) into self.func(). It preserves type parameters, respects operator precedence, and tracks angle-bracket depth during parsing.

When do I need to migrate Motoko code from mo:base to mo:core?

Migrating Motoko code from mo:base to mo:core is necessary when upgrading core versions or modernizing call syntax. This conversion shifts self-first parameter functions to dot notation while preserving nested expressions and type parameters.

Does the dot notation migration handle multi-argument function calls in Motoko?

Yes, dot notation migration handles multi-argument self function calls in Motoko. It converts them while preserving type parameters and nested expressions, respecting operator precedence and type-parameter angle-bracket depth to avoid breaking code.

What is the best way to modernize Motoko call syntax across a project?

The best way to modernize Motoko call syntax is converting self-first parameter style functions to dot notation. This process applies conversion rules for functions whose first parameter is named self, ensuring zero-argument and multi-argument calls are updated correctly.

Are there limitations when converting zero-argument self functions to dot notation?

A key limitation is that conversion strictly applies to functions whose first parameter is named self. It respects operator precedence and tracks angle-bracket depth during parsing to prevent breaking code, but only targets applicable mo:core-based code.