reviewing-motoko
Installation
SKILL.md
Reviewing Motoko
This skill judges whether Motoko code is well designed. It does not teach the language — load writing-motoko for syntax, mo:core APIs, and mechanical rules, and migrating-motoko-actors before changing anything that is stable state.
Four questions decide a review, in this order — the first three because each can invalidate the next, the fourth last because it is the least consequential:
- Is every invariant the code relies on encoded in a type? Where the type system can rule out a bad state, leaving that to a runtime check or a comment is a defect, not a style preference.
- Is state declared with the right persistence? Under enhanced migration, stable and transient are separate worlds. Blurring them produces state that silently stops updating.
- Does the code live in the right files?
types.mo/lib//mixins//main.mois a contract about what may depend on what, not a folder convention. - Does it read like Motoko? Contextual dot notation, inferred implicits, no annotation the call already supplies, no classes.
mops check --fixhandles most of this; only what it cannot see is the reviewer's job.
Procedure
Run the mechanical pass first — do not spend review attention on what the compiler already reports.
mops check --fix