-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(cli): add custom modes support and refactor implementation #3305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add custom modes support and refactor implementation #3305
Conversation
Adds ability for CLI to load and use custom modes from: - Global: custom_modes.yaml in VS Code global storage - Project: .kilocodemodes in workspace root Changes: - Created customModes loader with platform-aware path resolution - Updated CLI entry point to load and validate custom modes - Extended ExtensionHost to accept and use custom modes - Modified /mode command to display and switch to custom modes - Added customModes to CommandContext for all commands Resolves Kilo-Org#3304 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: df83fc7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Resolved conflicts in: - cli/src/cli.ts: Added both customModes and parallel mode options - cli/src/index.ts: Merged custom modes loading with parallel mode support - cli/src/state/hooks/useCommandContext.ts: Added both customModes and isParallelMode to context Also added changeset for this PR.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Hi @benzntech , Thanks for the PR, looks good. |
catrielmuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @benzntech , Thanks for the PR, looks good.
Please remove the all added ";" at the end of the lines because there are like 250 lines changed that should not.
After that i will test it and it's good to go.
- Add roleDefinition, whenToUse, customInstructions, groups, and iconName properties to ModeConfig - Add organization source type to ModeConfig - Update DEFAULT_MODES with comprehensive mode definitions including: - Detailed role definitions for each mode (architect, code, ask, debug, orchestrator) - Icon names for UI integration - Permission groups for feature access control - Custom instructions for specialized mode behavior - When to use guidance for users This enables richer mode configuration and better user guidance on mode selection.
- Change customModes in ExtensionState from any[] to ModeConfig[] - Change customModesAtom from any[] to ModeConfig[] - Import ModeConfig in extension.ts atoms file This ensures proper type checking throughout the custom modes system.
- Add mode.test.ts with 332 lines of comprehensive test coverage - Test command metadata (name, aliases, description, usage, examples) - Test handler behavior with no arguments (list available modes) - Test handler behavior with valid and invalid mode slugs - Test case-insensitive mode switching - Test source label display (global, project, organization) - Test custom modes integration - Test message structure and timestamps - Coverage includes default modes and custom modes scenarios - Includes tests for error handling and user feedback
| }, | ||
| setCommittingParallelMode: (isCommitting: boolean) => { | ||
| setCommittingParallelMode(isCommitting) | ||
| setCommittingParallelMode(isCommitting); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see a bunch of these, can you maybe clean up the PR so that we can review the actual changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Clean up formatting to match project's no-semicolon style while maintaining the custom modes feature changes.
Merge latest main branch changes while maintaining custom modes feature: - Use ModeConfig from @roo-code/types instead of local definition - Update parseCustomModes to return proper ModeConfig structure - Add customModes to mockContext for tests - Keep all main branch improvements (typed options, selectProvider, etc.)
- Remove unused imports from mode.ts (ArgumentValue, DEFAULT_MODES) - Replace any types with unknown and proper casting in customModes.ts - Rename unused error variables to _error - Add missing properties to mode.test.ts mock context - Treat undefined source as "global" for built-in modes
This PR resolves #3304 by adding support for custom modes and refactoring the implementation based on code review feedback. It also includes fixes for several TypeScript type errors that arose during development.