Claude Code Mastra — Testing skill for Claude Code
Claude Code SDK integration for Mastra Framework - TypeScript Agent implementation with comprehensive testing.
How to install Claude Code Mastra
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open t3ta/claude-code-mastra and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Mastra does
Claude Code SDK integration for Mastra Framework - TypeScript Agent implementation with comprehensive testing.
Alternatives in Testing
- Fix Issue — by metabase - Addresses GitHub issues by taking issue number as parameter, analyzing context, implementing sol 46.5k ★
- Debug — You are tasked with helping debug issues during manual testing or implementation 10k ★
- OpenAgentsControl — AI agent framework for plan-first development workflows with approval-based execution 4.8k ★
README
Claude Code × Mastra Agent Integration
This library integrates the Claude Code TypeScript SDK as an Agent within the Mastra framework.
Overview
This library adapts the Claude Code SDK to the Mastra Agent interface, enabling powerful coding assistance features of Claude Code within the Mastra framework.
Features
- Mastra Agent Compatible: Fully implements the Mastra Framework Agent interface
- Custom Tools: Supports Mastra Agent's tools feature
- MCP External Tools: Integrates external tools via Model Context Protocol
- Streaming Support: Real-time response processing
- Session Management: Tracks session state and manages resources
- Error Handling: Robust error handling mechanisms
- Configurable: Supports Claude Code-specific options
- Type Safe: Complete TypeScript type definitions
Installation
npm install @anthropic-ai/claude-code @mastra/core
Basic Usage
Simple Generation
import { ClaudeCodeAgent } from './claude-code-agent.js';
const agent = new ClaudeCodeAgent({
maxTurns: 3,
permissionMode: 'default'
});
const response = await agent.generate(
'Write a TypeScript function to calculate fibonacci numbers'
);
console.log(response.content);
console.log(response.metadata); // Session info, cost, etc.
Streaming
for await (const chunk of agent.stream('Create a REST API with Express.js')) {
if (chunk.type === 'content') {
console.log('Content:', chunk.data.content);
} else if (chunk.type === 'complete') {
console.log('Total cost:', chunk.data.totalCost);
}
}
Configuration Options
interface ClaudeCodeAgentOptions {
maxTurns?: number; // Max turns (default: 10)
allowedTools?: string[]; // Allowed tools
permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions';
workingDirectory?: string; // Working directory
timeout?: number; // Timeout (ms,
Related Skills
Twin Sparrow Expert Engineer
Multi-domain engineering skill covering backend, frontend, TypeScript, debugging, architecture, performance, t
Speck.Transform Upstream
Transform upstream spec-kit release into Speck's Bun TypeScript implementation
Cfn Arch
SPARC Architecture phase. Define component boundaries, interface contracts, integration points, DRY reuse BEFO
Claude Agent SDK Demo
Claude Agent SDK experiment for testing usage with Max Subscription.
Reference Agents
Reference agents for AgentMesh: one Ring member per framework (CrewAI, LangChain, Google ADK, Mastra) and harn
Inkline
by inkline - Structures development workflow using pnpm with emphasis on TypeScript and Vue 3 Composition API,
Related Agents
Agent SDK Verifier TS
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best prac
SDK Verifier
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best prac
Impl Testing
Reviews implementation plans from a testing strategy perspective. Use when evaluating test coverage, mock desi