writing-roc
Skill2 starsChanged 4 months agoMITView on GitHub
Write, test, review or debug Roc language code using the project's actual compiler and platform versions. Provides current syntax, old-compiler traps and pure-core/platform-boundary guidance. Use for Roc source or Roc platform work, not merely for invoking an existing Roc executable.
In this repository27 other files it gives its agents.
- capture-collaboration-evidenceSkill
- clarify-before-buildingSkill
- cross-platform-project-build-archSkill
- deep-code-reviewSkill
- dispatchSkill
- erect-agent-stackSkill
- fix-zig-deps-hashSkill
- gather-project-intentionsSkill
- handoffSkill
- i18nSkill
- lean4-developmentSkill
- llvm-guided-optimizationSkill
- mechatron-ciSkill
- memoriesSkill
- mficSkill
- no-ai-slopSkill
- onboardSkill
- performance-profilingSkill
- planning-workSkill
- scaffold-zig-projectSkill
- shipSkill
- test-isolationSkill
- universal-app-frontendSkill
- walking-decisionsSkill
- writing-bendSkill
- writing-nixSkill
- zig-microbenchmarksSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read the project's intent, toolchain pin, app/package header and platform sources.
- Very specific: line 15
Use its pinned Nix development environment for tool inspection.
- Distinctive: line 26
Read syntax.md when writing Roc expressions, types, error handling or tests.
- Distinctive: line 32
Keep domain transformations pure.
- Very specific: line 43
Use immutable values by default.
- Very specific: line 52
Prefer the project's complete ./test entry point.
- Distinctive: line 62
Check every exit status. The compiler can continue running code with errors.
- Distinctive: line 83
If a repeated issue exposes a missing or misleading Roc rule, an agent may make a small update to this shared skill.
- Distinctive: line 92
Check these again when the project changes compiler generation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing Roc
An agent quick reference for the new Zig-based Roc compiler. Roc is still pre-0.1; old Rust-compiler tutorials often describe incompatible syntax.
Establish the dialect first
Read the project's intent, toolchain pin, app/package header and platform
sources. Run the project-provided roc version and consult its --help.
Use its pinned Nix development environment for tool inspection; do not silently
upgrade the compiler or platform to make an example compile. Project builds
require nix build, with Roc invoked inside the derivation. Follow
cross-platform-project-build-arch; a devShell-only compile or optional direct
backend does not satisfy the build contract.
This reference was researched on 2026-10-04, against official upstream
revision 1a4df199210309bbb6befb1322f7435361bd01e1. It describes that compiler
generation, not a released stability guarantee. For an older project, follow
its actual dialect and identify the differences before changing source.
Read syntax.md when writing Roc expressions, types, error handling or tests. Read modules.md for imports, public APIs, platform boundaries or dependency/version diagnosis.
Architecture that fits functional projects
Keep domain transformations pure. Pass clocks, deterministic RNG state and external results as values; keep I/O in effectful boundary functions. This fits a functional core with dependency-injected adapters. Roc's platform owns I/O primitives and the host ABI; do not invent a standard-library file API or assume an arbitrary C FFI is callable from app code.
-> marks a pure function type; => marks an effectful one. Name effectful
functions with !. Purity does not prove termination or prevent crash,
allocation failure or diagnostic dbg/expect. A deterministic algorithm
implemented in Roc still needs behavioral tests or a separate proof.
Use immutable values by default. Local var $name state is available for loops
and does not automatically make a function effectful. Match known error cases
explicitly; report failures with Try and tags rather than crash.
Sources: functions, platforms.
Verify with the actual compiler
Prefer the project's complete ./test entry point. Typical underlying checks
for this generation are:
roc version
roc check main.roc
roc test main.roc
roc fmt --check .Check every exit status. The compiler can continue running code with errors; printed results do not establish a passing build. Warnings may also produce a nonzero status. Keep check/test failures visible to the complete test runner.
Top-level expects run with roc test. Expectations inside executed functions
are developer checks and may be omitted in optimized execution. Never implement
license, security or input-validation enforcement with expect.
The runnable example and its type module
exercise the quick reference without downloading a platform. Run check/test on
examples/main.roc using the project's compatible compiler, then formatting
checks on examples. This example uses the built-in Echo platform; real app
entrypoint types come from the selected platform.
Example evidence: check, tests, run and formatting must be recorded separately from source review. syntax.md records the observed compiler and limits. Shared skill installation tests do not establish Roc compiler conformance.
Keep this reference useful
If a repeated issue exposes a missing or misleading Roc rule, an agent may make a small update to this shared skill. First reproduce or verify it against the affected compiler/platform, include a source or regression example and label version-specific behavior. Prefer correcting existing text over adding another rule. Routine mistakes and one-off project quirks need no skill edit; this is permission to learn from recurrence, not a required maintenance step.
Latest documentation: official language reference and new-compiler tutorial. Check these again when the project changes compiler generation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

