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

Code before:
  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(' ')}`,
  )
  .join('\n')}

### Managing Skills

\`\`\`bash
# List all installed skills

Review comment (security):
```suggestion
## 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.                                                                               |
| \`src/mastra/agents\`    | Define and configure your agents - their behavior, goals, and tools.                                                                     |
| \`src/mastra/workflows\` | Define multi-step workflows that orchestrate agents and tools together.                                                                  |
| \`src/mastra/tools\`     | Create reusable tools that your agents can call                                                                                          |
| \`src/mastra/mcp\`       | (Optional) Implement custom MCP servers to share your tools with external agents                                                         |
| \`src/mastra/scorers\`   | (Optional) Define scorers for evaluating agent performance over time                                                                     |
| \`src/mastra/public\`    | (Optional) Contents are copied into the `.build/output` directory during the build process, making them available for serving at runtime |

### Top-level files

Top-level files define how your Mastra project is configured, built, and connected to its environment.

| File                  | Description                                                                                                       |
| --------------------- | ----------------------------------------------------------------------------------------------------------------- |
| \`src/mastra/index.ts\` | Central entry point where you configure and initialize Mastra.                                                    |
| \`.env.example\`        | Template for environment variables - copy and rename to `.env` to add your secret [model provider](/models) keys. |
| \`package.json\`        | Defines project metadata, dependencies, and available npm scripts.                                                |
| \`tsconfig.json\`       | Configures TypeScript options such as path aliases, compiler settings, and build output.                          |
```

Code after:
  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.                                                                               |
| \`src/mastra/agents\`    | Define and configure your agents - their behavior, goals, and tools.                                                                     |
| \`src/mastra/workflows\` | Define multi-step workflows that orchestrate agents and tools together.                                                                  |
| \`src/mastra/tools\`     | Create reusable tools that your agents can call                                                                                          |
| \`src/mastra/mcp\`       | (Optional) Implement custom MCP servers to share your tools with external agents                                                         |
| \`src/mastra/scorers\`   | (Optional) Define scorers for evaluating agent performance over time                                                                     |
| \`src/mastra/public\`    | (Optional) Contents are copied into the \`.build/output\` directory during the build process, making them available for serving at runtime |