Introducing Coding Agent Helper for Mastra
You can now use createCodingAgent to develop your own coding agent with all the essentials it needs. Configure it with a model, instructions, and memory. It can read files, run commands, fix bugs, and track its own progress.
If you’re building a coding agent, the createCodingAgent helper starts you off with the right primitives: a sandbox for reading and writing files, a task list the agent can work through and complete, and a goal-judge prompt to validate the changes. Agents created with createCodingAgent are like any other Mastra agent, they work with AgentController, and use the same primitives Mastra Code runs on.
Use the buildBasePrompt to define your agent’s behavior. Point it at your repo with projectPath, and set a branch using gitBranch. Use a mode to plan and propose changes, or build when it should implement them. Pass instructions as a function that accesses requestContext to modify behavior per request.