Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Aug 25, 2025

Important

Adds a built-in /init slash command for codebase initialization and updates command handling to support built-in commands.

  • Behavior:
    • Adds built-in slash command /init in built-in-commands.ts for initializing codebase analysis.
    • Updates getCommands() and getCommand() in commands.ts to include built-in commands with lowest priority.
    • Built-in commands cannot be edited or deleted in SlashCommandItem.tsx.
  • Tests:
    • Adds tests for built-in commands in built-in-commands.spec.ts.
    • Mocks built-in command functions in frontmatter-commands.spec.ts.
  • UI:
    • Updates SlashCommandsList.tsx to display built-in commands under a new section.
    • Adds localization for built-in commands in multiple chat.json files.
  • Misc:
    • Updates command-integration.spec.ts to recognize built-in as a command source.
    • Adds argumentHint to command properties in webviewMessageHandler.ts.

This description was created by Ellipsis for 75cac18. You can customize this summary. It will automatically update as commits are pushed.

@mrubens mrubens requested review from cte and jr as code owners August 25, 2025 04:49
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 25, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes and have some suggestions for improvement. Overall, this is a clean implementation of built-in commands with good UI handling and comprehensive i18n support.

init: {
name: "init",
description: "Initialize a project with recommended rules and configuration",
content: `Please analyze this codebase and create an AGENTS.md file containing:
Copy link
Contributor

Choose a reason for hiding this comment

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

The content for the init command is quite lengthy (87 lines). Would it make sense to externalize this content to a separate file or break it down into smaller, more focused commands? This would improve maintainability.

/**
* Get all built-in commands as Command objects
*/
export async function getBuiltInCommands(): Promise<Command[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding JSDoc comments to these exported functions to help future developers understand how to add new built-in commands and what each function does.

/**
* Get a specific built-in command by name
*/
export async function getBuiltInCommand(name: string): Promise<Command | undefined> {
Copy link
Contributor

Choose a reason for hiding this comment

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

While the current implementation is simple, consider adding error handling for future built-in commands that might need validation or async operations. Could we make these functions more robust?

const emptyCommand = await getBuiltInCommand("")
expect(emptyCommand).toBeUndefined()
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

The test coverage is good for basic functionality. Consider adding tests for edge cases like:

  • Concurrent access to built-in commands
  • Command name conflicts with user-defined commands
  • Behavior when BUILT_IN_COMMANDS is modified at runtime

<Settings className="w-3 h-3" />
{t("chat:slashCommands.builtInCommands")}
</div>
{builtInCommands.map((command) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice implementation! Consider adding a visual indicator (like a small badge or icon) next to built-in commands to make it clearer that these are system-provided commands, in addition to the Settings icon in the section header.

results.push({
type: ContextMenuOptionType.SectionHeader,
label: "Custom Commands",
label: "Commands",
Copy link
Contributor

Choose a reason for hiding this comment

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

Good change from "Custom Commands" to "Commands" to be more inclusive of built-in commands. This makes the UI more consistent.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 25, 2025
If the update_todo_list tool is available, create a todo list with these focused analysis steps:
1. Quick scan for existing docs
- AI assistant rules (.cursorrules, CLAUDE.md, AGENTS.md, .roorules)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a potential typographical error: the text mentions "AI assistant rules (.cursorrules, CLAUDE.md, AGENTS.md, .roorules)". Should '.roorules' be '.cursor/rules' (or a similar variant) for consistency?

Suggested change
- AI assistant rules (.cursorrules, CLAUDE.md, AGENTS.md, .roorules)
- AI assistant rules (.cursorrules, CLAUDE.md, AGENTS.md, .roo/rules)

Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 25, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Aug 25, 2025
@mrubens mrubens merged commit 2c82f4c into main Aug 25, 2025
13 checks passed
@mrubens mrubens deleted the built_in_commands branch August 25, 2025 20:53
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants