Here at Encore, we're passionate about making it easier to build great applications. This is a moving target, and as LLM powered tools get more powerful, we're seeing more and more people use them to build Encore applications. Stands to reason, we therefore need to ensure LLMs also have an easy time when building Encore applications.
Encore is a framework designed to streamline backend development, offering unique features and conventions. However, without having the luxury of 10 years+ of mass adoption and the open-source training data that comes with it, mainstream LLMs often struggled to:
This makes sense since Encore is a relatively new backend framework, so it's not surprising that LLMs aren't as good at Encore as they are at React for instance. It's an important developer experience problem however, since developers are increasingly expecting to use LLMs to generate code.
To address this, we created a tailored set of instructions specifically designed for LLMs. Here's how we approached the problem:
Rewriting Documentation for LLMs: Using Claude from Anthropic, we rewrote our framework documentation and SDK reference following Anthropic’s guidelines for formatting instructions for LLMs. This ensured clarity and precision, making it easier for models to understand and apply Encore’s principles.
Adding Conventions and Rules: Beyond basic documentation, we developed a set of conventions and general rules that LLMs can follow. These include coding standards, recommended practices, and specific tips for leveraging Encore’s unique features.
Packaging the Instructions: The result was a comprehensive file of approximately 1,500 lines that encapsulates everything an LLM needs to know about building with Encore. This file can be added directly to your repository, giving your LLM tool automatic context about Encore.
For users of the Cursor IDE, simply rename the file to .cursorrules
enables automatic integration.
We're thrilled to share that the LLM instructions for both Encore.ts and Encore.go are now open source and available on GitHub (TypeScript instructions | Go instructions).
This initial release has already shown a significant boost in LLM performance for generating Encore-compatible code. Most of the time when using tools like Cursor, you can now generate an Encore applications with multiple services and infrastructure, immediately on the first try.
However, we’re not stopping here. We invite the community to share feedback and contribute through pull requests to help us refine and expand these instructions further. Explore the instructions and contribute on GitHub.
1. Download the instructions
2. Add the instructions to your app
.cursorrules
..github/copilot-instructions.md
.By giving LLMs this detailed guidance, we’ve bridged the gap between Encore’s powerful framework for building backends with declarative infrastructure and the growing potential of AI-powered development tools. We’re super excited to see how you will use these enhanced capabilities to create even better Encore applications.
Beyond providing instructions, we're also working on tools LLM powered code generation for Encore. If you're interested make sure to sign up for our newsletter below and follow us on Twitter for updates.