chore(writing-motoko): sync caffeinelabs/skills 02e5316 → 6173cbc (null coalesce ??, break/continue) - #350
Merged
Conversation
…ll coalesce ??, break/continue) Sync writing-motoko from upstream commit 6173cbc (version 0.1.5). Adds null-coalesce `??` guidance (unwrap-or-default / unwrap-or-trap, prefer over two-arm switch on ?T) and documents that plain `break`/`continue` work in for/while/loop (previously the skill claimed break was reserved and required labeled loops). - SKILL.md: ALWAYS-use bullets, new "Null Coalesce (??)" section, rewritten Option Handling, Common Operations, best practice #4, Additional References control-flow link. - references/control-flow.md: restructured — Null Coalesce first, switch narrowed to variants/transforms, Labeled Loops replaced with Break and Continue. - references/examples.md: createPost uses `?? Runtime.trap(...)`. - .claude/upstream.md: pin all three caffeinelabs/skills entries to 6173cbc. - evaluations/writing-motoko.json: +2 cases (?? unwrap-or-trap; break/continue in loops). Both WITH 3/3, WITHOUT 1/3. migrating-motoko-actors and troubleshooting-motoko-migrations: no content changes upstream; commit pin bumped only. Closes #349
Skill Validation ReportValidating skill: /home/runner/work/icskills/icskills/skills/writing-motokoStructure
Frontmatter
Tokens
Markdown
Tokens
Content Analysis
References Content Analysis
Contamination Analysis
References Contamination Analysis
Result: 2 warnings Project Checks |
raymondk
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #349
Syncs
writing-motokofromcaffeinelabs/skills02e5316→6173cbc(upstreamversion:0.1.3 → 0.1.5). Onlywriting-motokochanged content upstream;migrating-motoko-actorsandtroubleshooting-motoko-migrationsshare the pinned commit and get a pin bump only.What upstream added
??for unwrap-or-default / unwrap-or-trap (opt ?? default,opt ?? Runtime.trap(...)), preferred over a two-armswitchthat only peels?T. Requiresmoc >= 1.7.0.break/continuenow documented as working insidefor/while/loop— replacing the old (incorrect) claim thatbreakis unsupported and requires labeled loops or a helper with earlyreturn.Files changed
skills/writing-motoko/SKILL.md— two new "ALWAYS use" bullets, new Null Coalesce (??) section, rewritten Option Handling, updated Common Operations line, best-practice Fix verified issues across 8 skills from multi-agent audit #4, and the control-flow Additional-References link.skills/writing-motoko/references/control-flow.md— restructured:??first,switchnarrowed to variants/transforms, "Labeled Loops" replaced by Break and Continue.skills/writing-motoko/references/examples.md—createPostuses?? Runtime.trap(...)..claude/upstream.md— all threecaffeinelabs/skillsentries pinned to6173cbc,Last synced→ 2026-08-12,writing-motokoupstream version → 0.1.5.evaluations/writing-motoko.json— +2 cases for the new behaviors.icskills-owned sections
Preserved per
.claude/upstream.md: frontmatter (our schema, tuneddescription), themops-clicross-ref rewrite,## Additional Referencesrename +mops toolingbullet, andreferences/paths. No owned section is now covered by upstream, so none were dropped.compatibilityunchanged — our floormoc >= 1.11.2already exceeds the??requirement of 1.7.0.Compiler verification
Validated the two new behaviors against
mocdirectly (not just trusting the newer prose):break/continuein aforloopopt ?? 0M0001syntax errorConfirms break/continue work and the
?? requires moc >= 1.7.0note is accurate.Known upstream defect (not patched locally)
Upstream added the working break/continue guidance but left a now-contradictory row in the Common Compile Error Patterns table:
Compiler-verified: plain
breakin a loop compiles fine;unexpected token 'break'only occurs whenbreakis used as an identifier, whose correct fix is "rename the identifier" (not a helper). Our file matches upstream verbatim; per repo policy this is flagged upstream rather than diverged locally. Upstream issue: caffeinelabs/skills (linked once filed).Evals
Added 2 cases (
??unwrap-or-trap;break/continuein loops), each run with baseline.Eval results (with-skill vs baseline)
npm run validate: all 27 skills pass (warnings only).