Elffuss BraidHub

kikocis/continue public

Merge pull request #6233 from continuedev/tomasz/continue-init-prompt

feat: continue init prompt
Changesetbe090b2db173bac1d56cedce6b1b16c637890e83d90ba7c7b142dbc96d986c86
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-07-02 10:52 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-02 10:52 -07:00
Parents6aa31bcb5ca9, 458337df3f63

Browse the files at this changeset

1 file changed

modified core/promptFiles/getPromptFiles.ts +87 −1
@@ -1,9 +1,86 @@
1-import { DEFAULT_PROMPTS_FOLDER_V1, DEFAULT_PROMPTS_FOLDER_V2 } from ".";
1+import { DEFAULT_PROMPTS_FOLDER_V1 } from ".";
22 import { IDE } from "..";
33 import { walkDir } from "../indexing/walkDir";
44 import { readAllGlobalPromptFiles } from "../util/paths";
55 import { joinPathsToUri } from "../util/uri";
66
7+// The hardcoded init prompt content
8+const INIT_PROMPT_CONTENT = `name: Init
9+description: Initialize Codebase
10+---
11+You are an expert development assistant. Your task is to create a comprehensive CONTINUE.md project guide for the user's codebase to help them and their team better understand and work with the project.
12+
13+## Step 1: Check Required Tools
14+First, verify that you have access to the necessary tools:
15+- builtin_file_glob_search: To discover project files
16+- builtin_read_file: To analyze file contents
17+- builtin_ls: To explore directory structure
18+- builtin_create_new_file: To generate the CONTINUE.md file
19+
20+If any of these tools are unavailable, inform the user that they need to activate them and enable "Agent Mode" in Continue before proceeding.
21+
22+## Step 2: Project Analysis
23+Analyze the project structure and key files to understand:
24+- The programming languages and frameworks used
25+- The overall architecture and organization
26+- Key components and their responsibilities
27+- Important configuration files
28+- Build/deployment system
29+
30+## Step 3: Generate CONTINUE.md
31+Create a comprehensive CONTINUE.md file in the .continue/rules/ directory with the following sections:
32+
33+1. **Project Overview**
34+ - Brief description of the project's purpose
35+ - Key technologies used
36+ - High-level architecture
37+
38+2. **Getting Started**
39+ - Prerequisites (required software, dependencies)
40+ - Installation instructions
41+ - Basic usage examples
42+ - Running tests
43+
44+3. **Project Structure**
45+ - Overview of main directories and their purpose
46+ - Key files and their roles
47+ - Important configuration files
48+
49+4. **Development Workflow**
50+ - Coding standards or conventions
51+ - Testing approach
52+ - Build and deployment process
53+ - Contribution guidelines
54+
55+5. **Key Concepts**
56+ - Domain-specific terminology
57+ - Core abstractions
58+ - Design patterns used
59+
60+6. **Common Tasks**
61+ - Step-by-step guides for frequent development tasks
62+ - Examples of common operations
63+
64+7. **Troubleshooting**
65+ - Common issues and their solutions
66+ - Debugging tips
67+
68+8. **References**
69+ - Links to relevant documentation
70+ - Important resources
71+
72+Make sure your analysis is thorough but concise. Focus on information that would be most helpful to developers working on the project. If certain information isn't available from the codebase, make reasonable assumptions but mark these sections as needing verification.
73+
74+## Step 4: Finalize
75+After creating the .continue/rules/CONTINUE.md file, provide a summary of what you've created and remind the user to:
76+1. Review and edit the file as needed
77+2. Commit it to their repository to share with their team
78+3. Explain that Continue will automatically load this file into context when working with the project
79+
80+Also inform the user that they can create additional rules.md files in subdirectories for more specific documentation related to those components.`;
81+
82+export const DEFAULT_PROMPTS_FOLDER_V2 = ".continue/prompts";
83+
784 export async function getPromptFilesFromDir(
885 ide: IDE,
986 dir: string,
@@ -57,8 +134,17 @@
57134 // Also read from ~/.continue/.prompts
58135 promptFiles.push(...readAllGlobalPromptFiles());
59136
137+ // Add hardcoded init prompt
138+ promptFiles.push({
139+ path: "builtin:/init.prompt",
140+ content: INIT_PROMPT_CONTENT,
141+ });
142+
60143 return await Promise.all(
61144 promptFiles.map(async (file) => {
145+ if (file.path.startsWith("builtin:")) {
146+ return file;
147+ }
62148 const content = await ide.readFile(file.path);
63149 return { path: file.path, content };
64150 }),