agentleFS
pmarreckpmarreck/llm_skills/writing-roc/SKILL.md

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.

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
  1. Very specific:

    Read the project's intent, toolchain pin, app/package header and platform sources.

    line 13
  2. Very specific:

    Use its pinned Nix development environment for tool inspection.

    line 15
  3. Distinctive:

    Read syntax.md when writing Roc expressions, types, error handling or tests.

    line 26
  4. Distinctive:

    Keep domain transformations pure.

    line 32
  5. Very specific:

    Use immutable values by default.

    line 43
  6. Very specific:

    Prefer the project's complete ./test entry point.

    line 52
  7. Distinctive:

    Check every exit status. The compiler can continue running code with errors.

    line 62
  8. Distinctive:

    If a repeated issue exposes a missing or misleading Roc rule, an agent may make a small update to this shared skill.

    line 83
  9. Distinctive:

    Check these again when the project changes compiler generation.

    line 92

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.