Repository: mastra-ai/mastra
File: packages/cli/src/commands/init/utils.ts (TypeScript)

Code before:
  }
};

/**
 * Generate content for AGENTS.md file
 */
export function generateAgentsMarkdown({ skills, mcpServer }: { skills?: string[]; mcpServer?: Editor }): string {
  const hasSkills = skills && skills.length > 0;
  const hasMcp = !!mcpServer;

  let content = `# AI Agents Guide

This guide helps AI agents work efficiently with this Mastra project.

## Quick Start

\`\`\`bash
# Install dependencies
npm install

# Run development server
npm run dev

# Build the project
npm run build
\`\`\`

## Project Structure

- \`src/mastra/\` - Main Mastra configuration and components
- \`src/mastra/agents/\` - AI agent definitions
- \`src/mastra/tools/\` - Tool implementations
- \`src/mastra/workflows/\` - Workflow definitions

`;

  // Add skills section if skills were installed
  if (hasSkills) {
    content += `## Mastra Skills

Skills are modular capabilities that extend agent functionalities. They provide pre-built tools, integrations, and workflows that agents can leverage to accomplish tasks more effectively.

This project has skills installed for the following agents:

${skills
  .map(
    agent =>
      `- ${agent
        .split('-')
        .map(w => w.charAt(0).toUpperCase() + w.slice(1))
        .join(' ')}`,

Review comment (suggestion):
```suggestion
## Commands

Use these commands to interact with the project.

### Installation

\`\`\`bash
npm install
\`\`\`

### Development

Start the Mastra Studio at localhost:4111 by running the \`dev\` script:

\`\`\`bash
npm run dev
\`\`\`

### Build

In order to build a production-ready server, run the \`build\` script:

\`\`\`bash
npm run build
\`\`\`
```

Code after:
  }
};

/**
 * Generate content for AGENTS.md file
 */
export function generateAgentsMarkdown({ skills, mcpServer }: { skills?: string[]; mcpServer?: Editor }): string {
  const hasSkills = skills && skills.length > 0;
  const hasMcp = !!mcpServer;

  let content = `# AGENTS.md

This document provides guidance for AI coding agents working in this repository.

## Project Overview

This is a **Mastra** project written in TypeScript. Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

## Commands

Use these commands to interact with the project.

### Installation

\`\`\`bash
npm install
\`\`\`

### Development

Start the Mastra Studio at localhost:4111 by running the \`dev\` script:

\`\`\`bash
npm run dev
\`\`\`

### Build

In order to build a production-ready server, run the \`build\` script:

\`\`\`bash
npm run build
\`\`\`

## Project Structure

Folders organize your agent's resources, like agents, tools, and workflows.

| Folder                 | Description                                                                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| \`src/mastra\`           | Entry point for all Mastra-related code and configuration.                                                                               |