Europe 2026
Replacing 12K LoC with a 200 LoC Skill — David Gomes, Cursor
Overview
This talk details how Cursor refactored a complex feature, originally spanning 12,000 lines of code, into a concise 200-line skill. This transformation leveraged existing primitives like agent skills and sub-agents, primarily using markdown to redefine functionality. The refactoring aimed to reduce maintenance overhead and improve user experience for advanced features.
Who should watch
- AI engineers and builders looking to simplify complex features.
- Product Managers interested in efficient development strategies.
- Developers exploring the use of markdown for agent logic.
- Users of Cursor or similar AI-assisted coding environments.
- Those interested in agent isolation and parallel task execution.
Key takeaways
- Complex features can be significantly reduced in size by abstracting logic into agent skills, often using markdown.
- Cursor's Git worktrees and best-of-N features were reimplemented using agent skills and sub-agents, drastically cutting down codebase size.
- Agent skills and sub-agents, combined with markdown, can effectively manage isolated environments like Git worktrees for parallel agent tasks.
- The new implementation allows users to switch into a worktree mid-chat and supports multi-repo setups, which were limitations of the previous version.
- A key challenge with the skill-based approach is ensuring the agent consistently stays within its designated worktree, relying on aggressive prompting.
- Discoverability of advanced features like worktrees can decrease when they move from UI elements to slash commands.
- Improving agent adherence to worktree boundaries is an ongoing effort, utilizing evaluations (evals) and reinforcement learning (RL) for model training.
- Cursor is exploring alternative parallelization primitives beyond Git worktrees to address limitations like speed, disk space, and Git-only repository support.
Notable quotes
*We recently replaced a lot of code in the Cursor application with just markdown, just a skill.*
*The new implementation of the feature is almost as good as the previous one and it is much much more lightweight in terms of us to maintain it.*
*The biggest problem right now is that the agent is not really always staying on track.*
Up next · Coding agents in production
Watch next
The harness is the product — humans steer, agents execute.
Harness Engineering: How to Build Software When Humans Steer, Agents Execute — Ryan Lopopolo, OpenAIUnofficial community note. Prefer the recording for nuance.