Back to Prompt Library
planning
Mastra AI Agent System Setup
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Accelerated Code Dev & Review Agent
Format
Code-aware
Lines
17
Sections
5
Linked challenge
Accelerated Code Dev & Review Agent
Prompt source
Original prompt text with formatting preserved for inspection.
17 lines
5 sections
No variables
1 code block
Initialize a Mastra AI project. Define two agents: a 'CodeGenerator' agent and a 'CodeReviewer' agent. The CodeGenerator should use Claude Sonnet 4 and be equipped with tools to write files to a simulated filesystem. The CodeReviewer should use Llama 3 8B Instruct (via a custom tool calling Hugging Face Inference Endpoints) and tools to read files and provide feedback. Outline their initial roles and a simple interaction flow for generating a function and getting it reviewed.
```typescript
import { createAgent, createTool, Workflow } from '@mastra-ai/core';
const codeGenerator = createAgent({
id: 'code-generator',
model: 'claude-sonnet-4',
// ... other configs
});
const codeReviewer = createAgent({
id: 'code-reviewer',
model: 'llama-3-8b-instruct-hf-endpoint', // Placeholder for custom endpoint
// ... other configs
});
// Define a workflow
const workflow = new Workflow();
// ... Add steps for agents to interact
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.
Tune next
Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.
Verify after
Check whether the prompt asks for the right evidence, confidence signal, and escalation path.