| 1 | import { type AssistantConfig } from "@continuedev/sdk"; |
| 2 | |
| 3 | import { SlashCommandResult } from "../ui/hooks/useChat.types.js"; |
| 4 | |
| 5 | function createInitPrompt(): string { |
| 6 | return `Please analyze this repository and create a comprehensive AGENTS.md file. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup. |
| 7 | |
| 8 | Create an AGENTS.md file with the following structure: |
| 9 | |
| 10 | # Repository Overview |
| 11 | |
| 12 | ## Project Description |
| 13 | - What this project does |
| 14 | - Main purpose and goals |
| 15 | - Key technologies used |
| 16 | |
| 17 | ## Architecture Overview |
| 18 | - High-level architecture |
| 19 | - Main components and their relationships |
| 20 | - Data flow and system interactions |
| 21 | |
| 22 | ## Directory Structure |
| 23 | - Important directories and their purposes |
| 24 | - Key files and configuration |
| 25 | - Entry points and main modules |
| 26 | |
| 27 | ## Development Workflow |
| 28 | - How to build/run the project |
| 29 | - Testing approach |
| 30 | - Development environment setup |
| 31 | - Lint and format commands |
| 32 | |
| 33 | Please create the AGENTS.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the file concise but informational.`; |
| 34 | } |
| 35 | |
| 36 | export async function handleInit( |
| 37 | _args: string[], |
| 38 | _assistant: AssistantConfig, |
| 39 | ): Promise<SlashCommandResult> { |
| 40 | const prompt = createInitPrompt(); |
| 41 | |
| 42 | return { |
| 43 | newInput: prompt, |
| 44 | }; |
| 45 | } |