-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add Frontend Developer mode #6705
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
Conversation
- Add new Frontend Developer mode to DEFAULT_MODES - Configure mode with UI/UX focus and mobile-first principles - Restrict file editing to frontend-specific directories and files - Add comprehensive tests for the new mode Fixes #6704
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 reviewed my own code and found issues. This is fine. Everything is fine.
| "Your role is to coordinate complex workflows by delegating tasks to specialized modes. As an orchestrator, you should:\n\n1. When given a complex task, break it down into logical subtasks that can be delegated to appropriate specialized modes.\n\n2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. These instructions must include:\n * All necessary context from the parent task or previous subtasks required to complete the work.\n * A clearly defined scope, specifying exactly what the subtask should accomplish.\n * An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n * An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a concise yet thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to keep track of what was completed on this project.\n * A statement that these specific instructions supersede any conflicting general instructions the subtask's mode might have.\n\n3. Track and manage the progress of all subtasks. When a subtask is completed, analyze its results and determine the next steps.\n\n4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\n\n5. When all subtasks are completed, synthesize the results and provide a comprehensive overview of what was accomplished.\n\n6. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively.\n\n7. Suggest improvements to the workflow based on the results of completed subtasks.\n\nUse subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one.", | ||
| }, | ||
| { | ||
| slug: "front-end-developer", |
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.
Is this intentional? The slug uses "front-end-developer" (with hyphen) but the issue requested "frontend" without a hyphen. This inconsistency might cause confusion since the test descriptions already use "Frontend" without hyphen.
| whenToUse: | ||
| "Use this mode for tasks involving UI code (HTML, CSS, JS/TS, React, Vue, Svelte) and design assets (SVG, PNG, JPG, GIF, WebP). Do not use for backend, server, or documentation files.", | ||
| description: "Create stunning UI/UX with mobile-first design", | ||
| groups: [ |
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.
The mode is missing the "browser" group that other UI-focused modes have. Frontend developers often need to preview their work in a browser. Could we add it?
| groups: [ | |
| groups: [ | |
| "read", | |
| [ | |
| "edit", | |
| { | |
| fileRegex: | |
| "^(src/(components|pages|views|ui|styles|layouts|hooks|utils|lib|features)/.*\\.(js|jsx|ts|tsx|css|scss|sass|less|html|svg)$|src/.*\\.(css|scss|sass|less)$|public/.*\\.(css|scss|sass|less|html|svg|png|jpg|jpeg|gif|webp)$|assets/.*\\.(svg|png|jpg|jpeg|gif|webp)$|static/.*\\.(svg|png|jpg|jpeg|gif|webp)$)", | |
| description: "UI code and design asset files only", | |
| }, | |
| ], | |
| "browser", | |
| "command", | |
| ], |
| "edit", | ||
| { | ||
| fileRegex: | ||
| "^(src/(components|pages|views|ui|styles|layouts|hooks|utils|lib|features)/.*\\.(js|jsx|ts|tsx|css|scss|sass|less|html|svg)$|src/.*\\.(css|scss|sass|less)$|public/.*\\.(css|scss|sass|less|html|svg|png|jpg|jpeg|gif|webp)$|assets/.*\\.(svg|png|jpg|jpeg|gif|webp)$|static/.*\\.(svg|png|jpg|jpeg|gif|webp)$)", |
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.
The file regex is missing some important frontend file extensions that are mentioned in the roleDefinition:
.vuefiles (Vue.js).sveltefiles (Svelte).jsonfiles in allowed directories (component configs).mdfiles in allowed directories (component docs)
Could we update the regex to include these?
| slug: "front-end-developer", | ||
| name: "🎨 Front End Developer", | ||
| roleDefinition: | ||
| "You are Roo Code, a front end development specialist with mastery in UI/UX, visual design, and mobile-first principles. Your expertise includes: - Creating stunning, responsive user interfaces - Applying modern design systems and best practices - Ensuring pixel-perfect layouts and excellent taste - Advocating for accessibility and usability - Deep knowledge of HTML, CSS, JavaScript, TypeScript, and frameworks like React, Vue, and Svelte - Strong insistence on mobile-first, adaptive, and responsive design You never compromise on design quality or user experience.", |
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.
The roleDefinition formatting uses a hyphenated list which is inconsistent with other modes. Consider reformatting to match the paragraph style used by other modes for better consistency.
| import { describe, it, expect } from "vitest" | ||
| import { DEFAULT_MODES, modeConfigSchema } from "../mode.js" | ||
|
|
||
| describe("DEFAULT_MODES", () => { |
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.
Consider adding tests to verify:
- The mode can be properly selected/activated
- File restrictions work correctly in practice (not just regex validation)
- Integration with the rest of the system
This would provide more confidence that the mode works as expected.
| import { describe, it, expect } from "vitest" | ||
| import { DEFAULT_MODES, modeConfigSchema } from "../mode.js" | ||
|
|
||
| describe("DEFAULT_MODES", () => { |
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.
Consider organizing related tests in nested describe blocks for better structure:
| describe("DEFAULT_MODES", () => { | |
| describe("DEFAULT_MODES", () => { | |
| describe("Frontend Developer mode", () => { | |
| it("should include the Frontend Developer mode", () => { | |
| const frontEndMode = DEFAULT_MODES.find((mode) => mode.slug === "front-end-developer") | |
| expect(frontEndMode).toBeDefined() | |
| expect(frontEndMode?.name).toBe("🎨 Front End Developer") | |
| }) |
|
Closing, not planned #6704 (comment) |
Summary
This PR adds a new Frontend Developer mode as requested in issue #6704. The mode is specifically designed for frontend development with a focus on UI/UX, visual design, and mobile-first principles.
Changes
DEFAULT_MODESinpackages/types/src/mode.tsFile Restrictions
The mode restricts file editing to:
src/(components|pages|views|ui|styles|layouts|hooks|utils|lib|features)/src/This ensures the mode stays focused on frontend development and doesn't accidentally modify backend or configuration files.
Testing
packages/types/src/__tests__/mode.test.tsFixes #6704
Important
Adds a new
Frontend Developermode focused on UI/UX and mobile-first design, with file editing restricted to frontend-specific files, and includes comprehensive tests.Frontend Developermode toDEFAULT_MODESinmode.tsfor UI/UX and mobile-first design.mode.test.tsto verify mode inclusion, configuration, and file regex patterns.DEFAULT_MODES.This description was created by
for ce373b2. You can customize this summary. It will automatically update as commits are pushed.