Agent Coding Update: Teaching Agents Our Primitives
A few months ago, I wrote about vibe coding and the challenge of shipping quickly-created prototypes. I ended that post suggesting we could “teach” coding agents about our platform primitives through instruction files and MCP servers. At my day job (League), we’ve been putting this idea into practice, and the results have been very encouraging.
Building a Knowledge Base for Agents
A cross-functional team has created a structured knowledge base repository—a collection of markdown documents covering both frontend and backend aspects of the League platform. Think of it as documentation specifically designed for agent consumption. These aren’t just API references or code comments; they’re curated explanations of our patterns, primitives, and platform conventions.
The knowledge base includes information about:
- UI frameworks and component patterns we use
- Backend integration patterns and workflows
- API structures and authentication mechanisms
- Routing and state management patterns
- Testing strategies and common utilities
Making Knowledge Discoverable and Actionable
Documentation is only useful if it can be found. The team built an MCP server that gives agents access to some useful capabilities:
- Search – Agents can query the knowledge base by topic, finding relevant documents from our extensive collection without needing to know exactly what exists.
- Read - Agents can fetch the contents of the relevant documents for use in the current working session.
- Write – Most importantly, agents can contribute back to the knowledge base. When an agent, working with a developer, discovers a successful pattern or solves a problem in a novel way, it can propose new documentation via pull request.
This bidirectional flow transforms the knowledge base from static documentation into a living, growing resource. The agents aren’t just consuming our platform knowledge, they’re helping to build it.
Local Workflows Enable Faster Iteration
One of our key learnings has been that making more of the developer workflow “local” dramatically improves agent effectiveness. When an agent can not only write code but also test the changes immediately, the feedback loop tightens significantly. The agent, and developer, learns what works faster and produces better outcomes with less back-and-forth.
This local-first approach also makes agents better at completing tasks. As they experiment and validate patterns, they can immediately capture that knowledge and push it back into the knowledge base. Good patterns get documented while they’re fresh. Failed approaches can be noted before anyone else tries them.
From Prototype to Production, Faster
The combination of searchable platform knowledge and local testing capabilities has transformed how quickly we can go from idea to working feature. Developers, working with agents, now vibe code using our primitives from the start. There’s less “throw away the prototype and rebuild it properly” and more “this is already using our patterns, let’s polish and ship.”
The code that emerges from the agent looks like it could have been written by someone familiar with League’s platform conventions because in a very real sense, it was. The agent had access to our collective knowledge about what good League platform code looks like.
If you think it’s fun to vibe code green-field prototypes built on default frameworks not connected to your own system, I can tell you it’s even more fun to quickly prototype and craft solutions using your own primitives, ready to be added into your products.
What We’re Learning
This approach isn’t without challenges. We’re still discovering:
- What level of detail makes documentation most useful for agents versus overwhelming the context window. Developer curation plays a critical role.
- How to structure the knowledge base so relevant information surfaces easily. Again, developer curation along with solid search capabilities should help.
- When to trust agent-written documentation versus requiring developer review. At this point, we’re always requiring developer review, and that might be the case permanently.
- How to balance comprehensiveness with maintainability as the knowledge base grows.
But the core insight holds: when you give agents knowledge of your platform primitives and enable them to both test and contribute, they become far more effective collaborators. The coding isn’t just faster, it’s actually aligned with how you build software.
Where We’re Headed
We’re still early in this exploration, but the path is promising. As the knowledge base grows and agents contribute more successful patterns, we’re creating a virtuous cycle. Each successful feature makes the next one easier. Each documented pattern helps future agents avoid past mistakes. The main goal to help developers get more done without as much cognitive load.
The future of agentic development won’t be about replacing developers. It will be about building systems where developer knowledge and machine capability amplify each other. Where the tribal knowledge that usually lives in senior developers’ heads gets captured, structured, and made accessible at the moment it’s needed.