Stream: ideas

Topic: roc prompt subcommand


view this post on Zulip Anton (Jun 30 2025 at 10:49):

It would be nice for people to have an easily accessible up to date prompt for writing and fixing Roc code.
So I propose a new CLI subcommand:

$ roc prompt
 Important instructions:
    - To execute an effectful function for every item in a list:
      - Use `List.for_each!` if the function you want to pass returns `{}`.
      - Use `List.for_each_try!` if the function you want to pass returns a `Result {} someerr`.
      - Use `List.map_try!` if you want to return a Result where the success case is not `{}`.
    - Don't use `List.walk_try!` if you can achieve the same thing with one of the cleaner alternatives above.
    - `Task` has been removed from Roc, use `Result` instead.
    - ...
Workarounds for bugs:
    ...
example Roc code:
``roc
app [main!] {
    cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br",
}

import cli.Stdout
...
``

What do you think?

view this post on Zulip Luke Boswell (Jun 30 2025 at 11:02):

I think I'm missing a few details. I don't really understand who would use this or why.

view this post on Zulip Luke Boswell (Jun 30 2025 at 11:02):

Is this the LLM thing? for an agentic workflow

view this post on Zulip Anton (Jun 30 2025 at 11:44):

I don't really understand who would use this or why.

Anyone who wants to use an LLM to write/debug Roc. It's an easy place to get the instructions for writing Roc, fixing errors, etc. for your specific version.

view this post on Zulip Anthony Bullard (Jun 30 2025 at 11:48):

I think it's nice to have a standardized prompt for this kind of thing

view this post on Zulip Kiryl Dziamura (Jun 30 2025 at 11:49):

it reminds me debug configs for vscode. it's nice to have a template, it's annoying to configure it on your own

view this post on Zulip Anthony Bullard (Jun 30 2025 at 11:49):

just put "If I'm editing a .roc file, follow the instructions from running roc prompt to help you` or something of the sort in your .rules file

view this post on Zulip Luke Boswell (Jun 30 2025 at 11:50):

I've been experimenting a fair bit lately... and I'm starting to form the opinion good documentation in a hypermedia style will be the killer feature

view this post on Zulip Luke Boswell (Jun 30 2025 at 11:50):

I sometimes want Claude to help me with Zig docs... but it's like 150k tokens to load the website because it's all in a single page (which I've done accidentally one two occasions now)

view this post on Zulip Kiryl Dziamura (Jun 30 2025 at 11:50):

fuzzer can generate loads of valid code as an example for llms. just joking :smile:

view this post on Zulip Luke Boswell (Jun 30 2025 at 11:52):

I'd like to explore the idea of an LLM generating docs, in a book format - similar to the Rust book for example. I think that would be super useful for an agent to work with.

view this post on Zulip Anthony Bullard (Jun 30 2025 at 11:54):

Now we are writing books for AI...

view this post on Zulip Kiryl Dziamura (Jun 30 2025 at 11:54):

would be great if documentation was based on tests. otherwise I worry about hallucinations

view this post on Zulip Anton (Jun 30 2025 at 11:57):

Luke Boswell said:

I've been experimenting a fair bit lately... and I'm starting to form the opinion good documentation in a hypermedia style will be the killer feature

Yeah, we could just as well add the prompt to https://www.roc-lang.org/builtins

view this post on Zulip Anton (Jun 30 2025 at 11:58):

That would probably be better for discoverability

view this post on Zulip Anton (Jun 30 2025 at 12:05):

good documentation in a hypermedia style will be the killer feature

Hmm, LLMs currently don't interface well with clicking stuff though. With ever increasing context windows, it seems better to have it all right there in something like markdown.

view this post on Zulip Luke Boswell (Jun 30 2025 at 12:06):

LLMs currently don't interface well with clicking stuff though

Claude seems happy to fetch URL content. I'm not sure if it is capable of digging deeper though yet.

view this post on Zulip Luke Boswell (Jun 30 2025 at 12:07):

I'm not necessarily thinking HTML, maybe it's a markdown (or similar) format with URL's in it maybe.

view this post on Zulip Luke Boswell (Jun 30 2025 at 12:08):

I'm more spitballing the general direction I feel things are heading in.

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:28):

yeah I think something like what we have right now for builtins - https://www.roc-lang.org/builtins

would actually be nicer to have a whole section of the docs for llms

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:28):

so like /docs/ai or something

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:28):

and they're all concise markdown instead of html, and designed so that it's like just the docs for one particular builtin fn per URL

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:29):

also have a top-level explanation of how the language works, syntax, etc

view this post on Zulip Kiryl Dziamura (Jun 30 2025 at 12:34):

Zig documentation is just a single big file. We can render the whole roc docs in a plain txt in the same manner

view this post on Zulip Anton (Jun 30 2025 at 12:34):

Richard Feldman said:

so like /docs/ai or something

We currently have https://www.roc-lang.org/builtins/llms.txt
llms.txt seems to be emerging as a sort of standard

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:35):

yeah but as discussed having it all in one giant file blows up the context window :sweat_smile:

view this post on Zulip Anton (Jun 30 2025 at 12:35):

Yeah, both is good

view this post on Zulip Anton (Jun 30 2025 at 12:36):

Like when I want Claude to find a List function I can use, I don't need it to know about all the other builtins.

view this post on Zulip Anton (Jun 30 2025 at 12:36):

And for new users learning Roc, they want to be able to put the whole thing (all builtin docs) into gemini

view this post on Zulip Richard Feldman (Jun 30 2025 at 12:37):

could be yeah

view this post on Zulip Anton (Jun 30 2025 at 14:37):

#7912


Last updated: Jun 16 2026 at 16:19 UTC