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?
I think I'm missing a few details. I don't really understand who would use this or why.
Is this the LLM thing? for an agentic workflow
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.
I think it's nice to have a standardized prompt for this kind of thing
it reminds me debug configs for vscode. it's nice to have a template, it's annoying to configure it on your own
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
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
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)
fuzzer can generate loads of valid code as an example for llms. just joking :smile:
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.
Now we are writing books for AI...
would be great if documentation was based on tests. otherwise I worry about hallucinations
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
That would probably be better for discoverability
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.
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.
I'm not necessarily thinking HTML, maybe it's a markdown (or similar) format with URL's in it maybe.
I'm more spitballing the general direction I feel things are heading in.
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
so like /docs/ai or something
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
also have a top-level explanation of how the language works, syntax, etc
Zig documentation is just a single big file. We can render the whole roc docs in a plain txt in the same manner
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
yeah but as discussed having it all in one giant file blows up the context window :sweat_smile:
Yeah, both is good
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.
And for new users learning Roc, they want to be able to put the whole thing (all builtin docs) into gemini
could be yeah
Last updated: Jun 16 2026 at 16:19 UTC