Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions core/config/markdown/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ import {
} from "@continuedev/config-yaml";
import { joinPathsToUri } from "../../util/uri";

function createRelativeRuleFilePathParts(ruleName: string): string[] {
const safeRuleName = sanitizeRuleName(ruleName);
return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`];
}

export function createRelativeRuleFilePath(ruleName: string): string {
return createRelativeRuleFilePathParts(ruleName).join("/");
}

/**
* Creates the file path for a rule in the workspace .continue/rules directory
*/
export function createRuleFilePath(
workspaceDir: string,
ruleName: string,
): string {
const safeRuleName = sanitizeRuleName(ruleName);
return joinPathsToUri(
workspaceDir,
".continue",
"rules",
`${safeRuleName}.${RULE_FILE_EXTENSION}`,
...createRelativeRuleFilePathParts(ruleName),
);
}
22 changes: 20 additions & 2 deletions extensions/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { type AssistantConfig } from "@continuedev/sdk";
import { createRelativeRuleFilePath } from "core/config/markdown/utils.js";

import { SlashCommandResult } from "../ui/hooks/useChat.types.js";

function createInitPrompt(): string {
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.
const relativeRuleFilepath = createRelativeRuleFilePath("review");
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.

Create an AGENTS.md file with the following structure:

Expand All @@ -30,7 +32,23 @@ Create an AGENTS.md file with the following structure:
- Development environment setup
- Lint and format commands

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.`;
Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure:

\`\`\`md
---
invokable: true
---

Review this code for potential issues, including:

<insert custom things to look for based on the repository details you find>

Provide specific, actionable feedback for improvements.
\`\`\`

This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claim that /review will be invokable is likely incorrect without setting a name; default name becomes rules/review.md. Clarify instruction or set name in frontmatter.

Prompt for AI agents
Address the following comment on extensions/cli/src/commands/init.ts at line 47:

<comment>Claim that /review will be invokable is likely incorrect without setting a name; default name becomes rules/review.md. Clarify instruction or set name in frontmatter.</comment>

<file context>
@@ -30,7 +30,23 @@ Create an AGENTS.md file with the following structure:
+Provide specific, actionable feedback for improvements.
+\`\`\`
+
+This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository.
+
+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.`;
</file context>
Fix with Cubic


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.`;
}

export async function handleInit(
Expand Down
Loading