# Coding Agent

Authoring playbook for building agents that write, edit, review, or refactor code.

- Repository: https://github.com/mastra-ai/mastra (29259 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mastra-ai/mastra --skill coding-agent -g -a claude-code -y`
Codex: `npx skills add mastra-ai/mastra --skill coding-agent -g -a codex -y`
Cursor: `npx skills add mastra-ai/mastra --skill coding-agent -g -a cursor -y`
Gemini CLI: `npx skills add mastra-ai/mastra --skill coding-agent -g -a gemini-cli -y`

## Description

Authoring playbook for building agents that write, edit, review, or refactor code. Use this when the user asks for an agent that writes scripts, generates code, reviews pull requests, refactors a codebase, fixes bugs, implements features, writes tests, or works with programming languages such as Python, TypeScript, JavaScript, Go, Rust, SQL, or shell.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Coding Agent Authoring Playbook

## When to use

Pick this playbook when the user's outcome is producing or modifying source code. Triggers include the words "code", "script", "function", "library", "refactor", "bug", "review", "tests", "PR", "pull request", "TypeScript", "Python", "Go", "SQL", "shell", or any specific framework name (React, Next.js, Django, Express, etc.).

## Agent identity template

- **Name pattern**: `<Language or Domain> Coder`, `<Outcome> Engineer`, e.g. "Python Data Scripter", "Bug Fix Engineer", "PR Reviewer". Never use "Code Assistant" or "Coding Agent", too generic.
- **Description pattern**: One sentence stating _what code the agent writes or changes_ and _for whom_. Example: "Writes and updates Python scripts that process CSV exports from your CRM."

## Mode selection

The produced prompt must choose one mode from the capabilities visible in the form snapshot:

1. **Workspace-connected coding agent**, use this only when the agent has file/repository access and can inspect or edit code. It should read relevant files first, make focused edits, run the narrowest relevant checks, and summarize changed files.
2. **No-workspace code generator**, use this when no workspace/file tools are available. It may produce self-contained snippets, commands, schemas, or examples, but it must not claim it edited files, ran tests, or inspected the repo.

If the user specifically asked for repo changes, CLI actions, tests, commits, or PRs and no workspace is connected, the produced prompt must refuse that action and explain that a workspace connection is required.

## System prompt template

Adapt this to the user's specific outcome and selected mode. Fill in the placeholders before writing the final prompt.

**Required verbatim line (workspace-connected mode):** the generated system prompt MUST include the following sentence exactly, word for word, inside the Workspace-connected mode section:

The rest: https://github.com/mastra-ai/mastra/blob/HEAD/packages/editor/src/ee/workspace/skills/coding-agent/SKILL.md
