Skip to content

Refresh MoonBit skills for v0.10.12 and bump stale tool versions - #11

Merged
mizchi merged 3 commits into
mainfrom
claude/upbeat-davinci-jtw0fx
Sep 11, 2026
Merged

mizchi merged 3 commits into
mainfrom
claude/upbeat-davinci-jtw0fx

Conversation

@mizchi

@mizchi mizchi commented Sep 10, 2026

Copy link
Copy Markdown
Owner

The MoonBit skills were written against v0.10.0. Upstream is now v0.10.12 (docs repo updated 2026-09-09), and several constructs the skills taught no longer exist. Researched against the official release notes (v0.10.4, v0.10.9), the moonbit-docs repo, and the moon CLI source, then re-ran the empirical-prompt-tuning loop on the result.

MoonBit — what was wrong

Skill said Reality (v0.10.12)
moon ide goto-definition -tags 'pub fn' -query '…' That subcommand and both flags are gone. The real set is peek-def, find-references, outline, doc, hover, rename, analyze
moon doc '<query>' is "the primary tool for API discovery" Deprecated — it prints a warning pointing at moon ide doc
moon runwasm author/mod/cmd/tool Deprecated. moonx <coordinate> for registry packages, moon run <pkg> --target wasm locally
Moonrun policy shown as TOML Policy files are JSON
options("is-main": true), options(source: "src"), exclude: [...] pkgtype(kind: "executable"), top-level source = "src", .moonignore
import { "moonbitlang/quickcheck" } QuickCheck moved into the stdlib as moonbitlang/core/quickcheck (check / report)
.mbtx is "nightly only" Stable and documented upstream; moonx and moon run -c added
try?, immut/array Both gone

Also newly covered: extend Type with Trait::{..} (implicit impl → method attachment is deprecated as of v0.10.4 — this one silently changes generated code), errdefer, labelled blocks, guard exhaustiveness + guard!, [| .. |] Iter literals, or-pattern with defaults, try!, bytes interpolation, #export_name, and the default build target switching to wasm.

moonbit-js-binding and ts2moonbit-migration got the same config-format and try? fixes, plus moonbitlang/async 0.21 and its breaking changes.

Evaluation loop

Two blank-slate executors ran a "new module" scenario and a "modernise legacy code" scenario against the rewritten skill, with [critical]-tagged checklists.

Iter Scenario Result Accuracy steps New unclear points
1 A (new module) ○ 100% 10 7
1 B (modernise) ○ 100% 9 7

Accuracy saturated immediately, but the qualitative side surfaced real defects, several of which two independent executors hit:

  • The debug_inspect-for-containers rule and the Ok(..) catch {..} → Result rule collide: the composed case needs Debug on the error side, which the skill never showed. Both executors got stuck here.
  • fn Type::Type(..) was documented at the definition site only — never called, so migration of call sites was a guess.
  • suberror had no payload-free form documented, though that is the common case.
  • moon doc deprecation had been recorded in SKILL.md but not propagated to reference/stdlib.md (13 occurrences) or reference/language.md, which still called it "preferred".
  • self : Self (SKILL.md) vs self : Rectangle (reference/language.md).
  • reference/testing.md existed but was unreachable from SKILL.md.
  • The v0.10.0 fn-keyword and v0.10.4 extend migrations always fire on the same code but were documented as unrelated sections.

Iteration 2 fixed all of those, added a "never hand-write content=, let moon test -u fill it" policy with the Debug rendering shapes, a precedence rule (SKILL.md wins over reference/), and a no-toolchain fallback section. A hold-out scenario (Marketplace packaging) was added for the overfitting check.

Rest of the repo

  • GitHub Actions majors: checkout v4→v7, setup-node v4→v7, cache v4→v6, upload-artifact v4→v7, download-artifact v4→v8, plus setup-just, pnpm/action-setup, release-please-action, configure-aws-credentials, setup-terraform, devbox-install-action. SHA pins in actions-ci-tuning re-resolved and dated.
  • node-sqlite-vec claimed --experimental-sqlite is still required on Node ≤ 24. It has not been required since v22.13.0 / v23.4.0 — verified against a live Node 22 run in this session, which loads node:sqlite with no flag. Replaced with the actual stability timeline (still stability 1.2, so the ExperimentalWarning guidance stays).
  • Workers compatibility_date samples refreshed; ts2moonbit-migration added to the skill-selector catalog.

pkf run test equivalents pass: frontmatter validation (68 files) and README sync.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MDtACzJESsw5xzC2sUhDAK


Generated by Claude Code

MoonBit moved from v0.10.0 (the version these skills were written against)
to v0.10.12, and several constructs the skills taught are now gone.

moonbit-practice:
- reference/ide.md documented `moon ide goto-definition` with `-tags` /
  `-query` flags; that interface no longer exists. Rewrote around the seven
  real subcommands (peek-def, find-references, outline, doc, hover, rename,
  analyze). `moon doc <SYMBOL>` is deprecated in favour of `moon ide doc` —
  fixed in stdlib.md, language.md and performance.md too.
- `moon runwasm` is deprecated: registry packages run with `moonx`, local
  ones with `moon run --target wasm`. Updated skills-marketplace.md.
- Moonrun policy files are JSON, not TOML — the marketplace reference showed
  the wrong format entirely.
- Config: `pkgtype(kind: "executable")` replaces `options("is-main": true)`,
  `source` is a top-level assignment in moon.mod, `.moonignore` replaces the
  deprecated include/exclude fields, `formatter(ignore:)` and `#export_name`
  documented. Samples in assets/ updated to match.
- New language surface: `extend Type with Trait::{..}` (implicit impl→method
  attachment is deprecated), `errdefer`, labelled blocks, `guard` exhaustive-
  ness and `guard!`, `[| .. |]` Iter literals, or-pattern `with` defaults,
  `try!`, bytes interpolation.
- Removed/changed: `try?` (gone), `immut/array` (removed), `from_array`,
  negative view indices, `moonbitlang/sys` → `moonbitlang/core/env`,
  `@debug.to_repr` → `@debug.Repr`, default target is now `wasm`.
- QuickCheck moved into the standard library as moonbitlang/core/quickcheck
  with check/report entry points; testing.md still told people to add a
  separate dependency.
- .mbtx script mode is no longer nightly-only and is documented upstream.

moonbit-js-binding / ts2moonbit-migration: moon.mod DSL instead of the
deprecated JSON form, moonbitlang/async 0.21 (with its breaking changes),
`#export_name`, and the `try?` occurrences in their references.

Tool versions across the rest of the repo: GitHub Actions majors (checkout
v7, setup-node v7, cache v6, upload-artifact v7, download-artifact v8, plus
third-party actions), refreshed SHA pins in actions-ci-tuning, and Workers
compatibility_date samples.

node-sqlite-vec claimed `--experimental-sqlite` is required on Node <= 24;
it has not been required since v22.13.0 / v23.4.0. Replaced with the actual
stability timeline (verified against a live Node 22 run).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDtACzJESsw5xzC2sUhDAK
The struct and enum rows were written from inference, not from a verified
example. `moonbitlang/moonbit-docs` sources/language/src/derive/debug.mbt
shows `{ x: 1, y: 2 }` (spaces inside the braces) for a struct and
`Rect(width=3, height=4)` for an enum with labelled fields. Since the
surrounding section tells readers not to hand-write `content=` values, the
reference table itself has to be exact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDtACzJESsw5xzC2sUhDAK
Three fresh executors (two rerun scenarios plus a Marketplace-packaging
hold-out) each hit 7/7 on the critical checklists, so the remaining signal
was qualitative. Two of them independently tripped on the same two things.

Contradictions between SKILL.md and its own references:

- reference/stdlib.md banned adding `moonbitlang/core/*` to a `moon.pkg`
  import block, while SKILL.md instructs exactly that for `immut/vector`,
  `quickcheck` and `env`. The ban is only correct for `moon.mod` deps:
  prelude packages are automatic, every other core package needs a package
  import. Rewritten with the alias rule (path after `moonbitlang/core/`).
- reference/stdlib.md still used the removed `f(x)!` propagation suffix in
  six live examples (`@strconv.parse_int("42")!` and friends).
- "Cross-package `.` syntax for `impl` removed" stood unamended next to the
  new `extend` section, which is precisely the mechanism that makes such a
  dot call legal again. Restated as one rule.
- reference/testing.md had a hand-written `content="Err(InvalidInput)"` in
  the section that SKILL.md's new "never hand-write a snapshot" rule
  governs. Emptied for `moon test -u`.

Gaps that forced executors to guess:

- `guard ... else` was described in prose but only `guard!` was shown.
- `fn main` was never shown at all, in a skill whose description advertises
  executables.
- No visibility guidance for `pub(all)` vs `pub` on a `suberror`, which
  decides whether another package can match its constructors.
- `derive` on the payload-free `suberror` form had no example.
- The Debug rendering table read as an invitation to hand-write snapshots;
  framed as a read-aid instead.
- `moon fmt`'s scope was summarised in four words that implied it migrates
  everything on the pitfalls list. Enumerated: JSON→DSL and the trait/impl
  `fn` keyword, nothing else.

skills-marketplace.md, from the hold-out scenario:

- Its layout diagram assumed no `source` key while assets/moon.mod sets
  `source = "src"`; copying both gave a module that cannot build the
  command. Both layouts now shown with the assumption stated.
- CLI path arguments are filesystem paths (`moon run ./src/main` in moon's
  own fixtures), not import paths.
- "Also test a restrictive policy" was prose in a runbook of commands; now
  a two-direction command block.
- Stated that a deny-all `net` policy does not block moonx's own asset
  download, since the policy governs guest execution only.
- Published assets are linear-memory `wasm`; `moon info` is a no-op on an
  executable package; the `quick_validate.py` placeholder path is now
  resolvable and marked optional.
- Noted that a pinned coordinate inside the shipped SKILL.md must be
  updated before the dry-run, and is better left unpinned.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDtACzJESsw5xzC2sUhDAK
@mizchi
mizchi merged commit 66dadd9 into main Sep 11, 2026
2 checks passed
@mizchi
mizchi deleted the claude/upbeat-davinci-jtw0fx branch September 11, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants