Changesets · Branches · Tags · Compare
| Changeset | d2a0e1bb558b6d9a01b5e6ad4f388ba8a10037d255e426138b88260f36eb450d |
|---|---|
| Author | Nate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-09-25 11:39 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-25 11:39 -07:00 |
| Parents | d3cfa8dd8581 |
2 files changed
modified core/config/markdown/utils.ts +10 −4
| @@ -4,6 +4,15 @@ | ||
| 4 | 4 | } from "@continuedev/config-yaml"; |
| 5 | 5 | import { joinPathsToUri } from "../../util/uri"; |
| 6 | 6 | |
| 7 | +function createRelativeRuleFilePathParts(ruleName: string): string[] { | |
| 8 | + const safeRuleName = sanitizeRuleName(ruleName); | |
| 9 | + return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`]; | |
| 10 | +} | |
| 11 | + | |
| 12 | +export function createRelativeRuleFilePath(ruleName: string): string { | |
| 13 | + return createRelativeRuleFilePathParts(ruleName).join("/"); | |
| 14 | +} | |
| 15 | + | |
| 7 | 16 | /** |
| 8 | 17 | * Creates the file path for a rule in the workspace .continue/rules directory |
| 9 | 18 | */ |
| @@ -11,11 +20,8 @@ | ||
| 11 | 20 | workspaceDir: string, |
| 12 | 21 | ruleName: string, |
| 13 | 22 | ): string { |
| 14 | - const safeRuleName = sanitizeRuleName(ruleName); | |
| 15 | 23 | return joinPathsToUri( |
| 16 | 24 | workspaceDir, |
| 17 | - ".continue", | |
| 18 | - "rules", | |
| 19 | - `${safeRuleName}.${RULE_FILE_EXTENSION}`, | |
| 25 | + ...createRelativeRuleFilePathParts(ruleName), | |
| 20 | 26 | ); |
| 21 | 27 | } |
modified extensions/cli/src/commands/init.ts +20 −2
| @@ -1,9 +1,11 @@ | ||
| 1 | 1 | import { type AssistantConfig } from "@continuedev/sdk"; |
| 2 | +import { createRelativeRuleFilePath } from "core/config/markdown/utils.js"; | |
| 2 | 3 | |
| 3 | 4 | import { SlashCommandResult } from "../ui/hooks/useChat.types.js"; |
| 4 | 5 | |
| 5 | 6 | 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 | + const relativeRuleFilepath = createRelativeRuleFilePath("review"); | |
| 8 | + return `Please analyze this repository and create a comprehensive AGENTS.md file, along with a custom slash command. 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 | 9 | |
| 8 | 10 | Create an AGENTS.md file with the following structure: |
| 9 | 11 | |
| @@ -30,7 +32,23 @@ | ||
| 30 | 32 | - Development environment setup |
| 31 | 33 | - Lint and format commands |
| 32 | 34 | |
| 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.`; | |
| 35 | +Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure: | |
| 36 | + | |
| 37 | +\`\`\`md | |
| 38 | +--- | |
| 39 | +invokable: true | |
| 40 | +--- | |
| 41 | + | |
| 42 | +Review this code for potential issues, including: | |
| 43 | + | |
| 44 | +<insert custom things to look for based on the repository details you find> | |
| 45 | + | |
| 46 | +Provide specific, actionable feedback for improvements. | |
| 47 | +\`\`\` | |
| 48 | + | |
| 49 | +This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository. | |
| 50 | + | |
| 51 | +Please create both the AGENTS.md file and the .continue/rules/review.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 files concise but informational.`; | |
| 34 | 52 | } |
| 35 | 53 | |
| 36 | 54 | export async function handleInit( |