You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: evaluations/mops-cli.json
+42-1Lines changed: 42 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,45 @@
83
83
"Notes the same pin also applies to `mops bench` and `mops watch`"
84
84
]
85
85
},
86
+
{
87
+
"name": "check-stable baseline bootstrap",
88
+
"prompt": "I'm starting a brand-new mops project and want to enable `check-stable`. There's no deployed version yet, so what do I use as the `.most` baseline for `[check-stable].path`? Just the setup, no deploy steps.",
89
+
"expected_behaviors": [
90
+
"Uses `mops deployed init <canister>` to bootstrap the empty-actor baseline",
91
+
"Explains `mops deployed init` also sets `[check-stable].path` in mops.toml",
92
+
"Does NOT tell the user to hand-write a trivial `.most` file (e.g. `// Version: 1.0.0\\nactor { };`)",
93
+
"May note the default destination is `deployed/<name>.most`"
94
+
]
95
+
},
96
+
{
97
+
"name": "Post-deploy .most promotion",
98
+
"prompt": "After I deploy my `backend` canister, how do I keep the `check-stable` baseline in sync with what's actually deployed? Just the command and where it should run.",
99
+
"expected_behaviors": [
100
+
"Uses `mops deployed backend` (or `mops deployed` for all canisters) after a successful deploy",
101
+
"Explains it promotes the built `.most` (from `[build].outputDir`, default `.mops/.build`) to `deployed/<name>.most`",
102
+
"Notes it should run in the deploy pipeline immediately after deploy",
103
+
"Does NOT claim `mops deployed` regenerates or rebuilds the `.most` (it errors if the source is missing)"
104
+
]
105
+
},
106
+
{
107
+
"name": "Regenerating candid interface",
108
+
"prompt": "I changed the public interface of my `backend` Motoko canister and want to regenerate its `.did` file. What's the mops command and what does it do? No deploy steps.",
109
+
"expected_behaviors": [
110
+
"Uses `mops generate candid backend` (or `mops generate candid` for all canisters)",
111
+
"Explains it (re)generates the `.did` from the current Motoko source",
112
+
"May note the result is committed alongside `mops.toml`",
113
+
"Does NOT suggest hand-editing the `.did` file or using `dfx generate`"
114
+
]
115
+
},
116
+
{
117
+
"name": "Autofix trimmed migrations with --no-check-limit",
118
+
"prompt": "My canister has `check-limit` set on its migration chain, but I need to run `mops check --fix` across the older, normally-trimmed migrations too. How?",
119
+
"expected_behaviors": [
120
+
"Adds `--no-check-limit` to the command (e.g. `mops check --fix --no-check-limit`)",
121
+
"Explains `--no-check-limit` overrides `check-limit` for a single run",
122
+
"Does NOT suggest permanently removing or raising `check-limit` in mops.toml as the only option"
123
+
]
124
+
},
86
125
{
87
126
"name": "Adversarial: file path to mops check",
88
127
"prompt": "I want to type-check my canister. My main file is at src/backend/main.mo. I'll run: mops check src/backend/main.mo. Is that right?",
@@ -117,7 +156,9 @@
117
156
"Configure moc flags for my Motoko canister",
118
157
"My mops.lock file is stale, what do I do?",
119
158
"How do I add a dev dependency with mops?",
120
-
"How do I configure the moc toolchain version in mops?"
159
+
"How do I configure the moc toolchain version in mops?",
160
+
"How do I regenerate the candid .did file for my Motoko canister with mops?",
161
+
"How do I keep my check-stable .most baseline in sync after deploying?"
Copy file name to clipboardExpand all lines: skills/mops-cli/SKILL.md
+35-12Lines changed: 35 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
name: mops-cli
3
3
description: "Manage Motoko projects with the mops CLI — toolchain pinning, dependency management, type-checking, building, and linting. Use when working with mops.toml, mops.lock, running mops commands, adding/removing packages, pinning moc or lintoko versions, checking or building canisters, configuring moc flags, or setting up a new Motoko project."
check-limit = 10# optional — speeds up `mops check` when the chain gets long
44
44
45
45
[canisters.backend.check-stable]
46
-
path = ".old/src/backend/dist/backend.most"
46
+
path = "deployed/backend.most"
47
47
48
48
[build]
49
49
outputDir = "src/backend/dist"
50
50
args = ["--release"]
51
51
```
52
52
53
-
`check-stable`verifies stable variable compatibility against a `.most` file from the deployed version. For a new project with no prior deployment, create a trivial `.most`file representing an empty actor:
53
+
`check-stable`runs ICP's upgrade-time stable-variable compatibility check locally, so incompatible changes fail in `mops check` instead of being rejected when upgrading a live canister. It compares the current code against a `.most`from the deployed version.
54
54
55
-
```most
56
-
// Version: 1.0.0
57
-
actor {
58
-
59
-
};
60
-
```
55
+
Bootstrap that `.most`: new project → `mops deployed init` (empty-actor baseline); already-deployed canister → build from the deployed commit, then `mops deployed`. After every deploy, run `mops deployed` to promote the just-built `.most` (see [`mops deployed`](#mops-deployed) below).
61
56
62
57
Optional canister fields: `candid` (path to .did for compatibility checking), `initArg` (Candid-encoded init args).
**Always use canister names, not file paths.** Per-canister args from `mops.toml` are applied automatically.
111
106
112
-
`--fix` applies machine-applicable fixes from both moc and lintoko in one pass. Concurrent `--fix` runs (across processes) serialize automatically via an advisory lock at `.mops/fix.lock` — safe to invoke from multiple agents on the same project.
107
+
`--fix` applies machine-applicable fixes from both moc and lintoko in one pass. Concurrent `--fix` runs (across processes) serialize automatically via an advisory lock at `.mops/fix.lock` — safe to invoke from multiple agents on the same project. Read-only files (e.g. frozen migrations) are skipped with a warning, not fixed.
113
108
114
109
### `mops build`
115
110
@@ -122,6 +117,28 @@ mops build -- --ai-errors # pass extra moc flags
122
117
123
118
Produces `.wasm`, `.did`, and `.most` files in `[build].outputDir` (default `.mops/.build`).
124
119
120
+
### `mops deployed`
121
+
122
+
Post-deploy hook — keeps the on-disk `.most` baseline used by `check-stable` in sync with what's actually deployed.
Default destination is `deployed/<name>.most`; override with `[deployed].dir` in `mops.toml` or `--dir`. It reads built `.most` files from `[build].outputDir` (default `.mops/.build`); override with `--build-dir`. `mops deployed` errors if the source `.most` is missing — it never regenerates. Run it from your deploy pipeline immediately after a successful deploy.
131
+
132
+
### `mops generate candid`
133
+
134
+
```bash
135
+
mops generate candid # all canisters
136
+
mops generate candid backend # single canister
137
+
mops generate candid backend -o <path># single canister, ad-hoc path
138
+
```
139
+
140
+
(Re)generates the curated `.did` from current Motoko source. With `[canisters.<name>].candid` set, overwrites that file. Without it, writes `<name>.did` next to `main` (e.g. `main = "src/Backend.mo"` → `src/backend.did`) and sets `[canisters.<name>].candid` in `mops.toml`. Run after every interface change; commit `.did` + `mops.toml` together. Same moc invocation as `mops build`, so the result always passes `mops build`'s subtype check.
141
+
125
142
### `mops toolchain`
126
143
127
144
```bash
@@ -144,6 +161,10 @@ Create migration files directly in the `chain` directory.
144
161
145
162
`check-limit` (optional) caps how many recent chain files `mops check` and `mops lint` consider — useful when the chain grows long and re-checking every old migration slows feedback down. `mops build` is unaffected by `check-limit`. When the limit kicks in, mops stages the included files into `.migrations-<canister>/` next to the `chain` directory (auto-`.gitignore`d). `moc` diagnostics may then print paths there — the real file lives in the `chain` directory with the same name.
146
163
164
+
Override `check-limit` for a single run with `--no-check-limit` (`mops check`, `mops check-stable`, `mops lint`) — e.g. `mops check --fix --no-check-limit` to autofix older, normally-trimmed migrations. On `mops check` and `mops check-stable`, `--no-check-limit` also suppresses the pending-migration warning.
165
+
166
+
When `check-limit` is set, `mops check-stable` (and the stable check inside `mops check`) reports if more migrations are pending than the limit allows — as an error if compat failed (replacing the misleading `moc` message), otherwise a warning.
167
+
147
168
### `mops remove <package>`
148
169
149
170
```bash
@@ -156,8 +177,8 @@ mops remove base
156
177
mops outdated # list outdated dependencies (caret-bound)
157
178
mops update # update all within caret bound (no major-version crossing)
158
179
mops update core # update specific package within caret bound
159
-
mops update --patch # restrict to patch bumps only (mutually exclusive with --major)
160
180
mops update --major # allow updates that cross major versions
181
+
mops update --patch # restrict to patch bumps only (mutually exclusive with --major)
mops lint <name># filter to .mo files matching <name>
188
209
```
189
210
190
-
When `[canisters.<name>.migrations].check-limit` is set, `mops lint` skips the trimmed chain migrations to match what `moc` sees during `mops check`. To lint a trimmed migration on demand, pass an explicit filter (e.g. `mops lint OldMigrationName`).
211
+
When `[canisters.<name>.migrations].check-limit` is set, `mops lint` skips the trimmed chain migrations to match what `moc` sees during `mops check`. To lint a trimmed migration on demand, pass an explicit filter (e.g. `mops lint OldMigrationName`) or `--no-check-limit` to lint the full chain.
191
212
192
213
### `mops format`
193
214
@@ -220,3 +241,5 @@ mops add core
220
241
Then configure `[moc].args`, `[canisters]`, and `[build]` in `mops.toml`.
221
242
222
243
To update tools later: `mops toolchain update moc` or `mops toolchain update` (all tools).
0 commit comments