Skip to content

fix(caffeine-app): scaffold new projects from the moc 2 template - #430

Open
Kamirus wants to merge 1 commit into
dfinity:mainfrom
Kamirus:fix/caffeine-app-moc2-template
Open

Kamirus wants to merge 1 commit into
dfinity:mainfrom
Kamirus:fix/caffeine-app-moc2-template

Conversation

@Kamirus

@Kamirus Kamirus commented Oct 19, 2026 •

Copy link
Copy Markdown

Agents following this skill write a mops.toml that fails on every new Caffeine project. All new projects now use the moc 2 build template, which this skill didn't know about:

  • It required --default-persistent-actors and --generate-view-queries. moc 2.0 removed both, so every compile fails with unknown option.
  • It required skipIfMissing = true on check-stable. mops deprecated that in 2.13.2, and caffeine preview rejects it, so a project built from scratch couldn't be uploaded.
  • It required --actor-idl=src/backend/system-idl and a system-idl/ directory, which the template replaced with the ic mops package in August.
  • Its starting main.mo used the data-viewer mixin, which the template removed in July.

This syncs skills/caffeine-app/ from its source of truth, caffeinelabs/caffeine-cli at main (cd0968a), which fixed it in caffeinelabs/caffeine-cli#175. The skill now mirrors the template's minimal-backend variant rendered for moc 2: moc 2.0.0, lintoko 0.12.0, the Expose mixin from caffeineai-oql, the enhanced-migration chain seeded with a no-op 00000000.mo, and an empty-actor .old/src/backend/dist/backend.most baseline.

Checked locally because the PR workflow is waiting for maintainer approval on this fork: skill-validator 1.5.1 (the CI-pinned version) reports no errors and the same warnings as main, scripts/check-project.js passes, and npm run build builds all 36 pages. A scratch project built from the skill's mops.toml, migration, and worked backend example, with no system-idl/ directory, passes mops check (type check, stable check, and lint) and mops build on moc 2.0.0 with mops 3.4.2.

Before / After

mops.toml in the skill, abridged:

# Before
[canisters.backend.check-stable]
path = ".old/src/backend/dist/backend.most"
skipIfMissing = true

[toolchain]
moc = "1.8.1"

[moc]
args = ["--default-persistent-actors", "--actor-idl=src/backend/system-idl", "--generate-view-queries", ...]

[dependencies]
core = "2.5.0"
caffeineai-data-viewer = "0.1.0"
# After
[canisters.backend.check-stable]
path = ".old/src/backend/dist/backend.most"

[toolchain]
moc = "2.0.0"

[moc]
args = ["--implicit-package=core", "-no-check-ir", "-E=M0254", "-W=M0235,M0223,M0236,M0237", "-A=M0241"]

[dependencies]
core = "2.6.1"
ic = "4.2.0"
caffeineai-lints = "0.1.0"
caffeineai-oql = "0.8.0"

[canisters.backend.migrations]
chain = "src/backend/migrations"
check-limit = 1

What is unchanged

  • Companion-skill references keep the icskills name writing-motoko. The source repo still says motoko, which skills.internetcomputer.org redirects; a change in caffeinelabs/caffeine-cli is switching it to writing-motoko, so future syncs need no rename.
  • The sync also brings over two CLI notes the source gained since the last sync: CAFFEINE_VERBOSE=1, and custom domains in caffeine projects show.
  • Two eval cases change with the guidance: the mops.toml case now expects moc 2 without the removed flags, and the missing-baseline case expects the seeded empty actor instead of skipIfMissing.

🤖 Generated with Claude Code

Sync skills/caffeine-app from caffeinelabs/caffeine-cli main (cd0968a).
New Caffeine projects use the moc 2 build template, so the skill's mops.toml
moves to moc 2.0.0 with the enhanced-migration chain and the Expose mixin,
drops the moc 1.x flags and system-idl, and seeds the stable baseline with an
empty actor instead of the deprecated skipIfMissing. Companion-skill
references keep the icskills name writing-motoko.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kamirus
Kamirus marked this pull request as ready for review October 19, 2026 13:25
@Kamirus
Kamirus requested review from a team and JoshDFN as code owners October 19, 2026 13:25
@raymondk
raymondk enabled auto-merge (squash) October 23, 2026 12:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants