diff --git a/mcp-server/src/tools/initialize-project.js b/mcp-server/src/tools/initialize-project.js index 16764b91..1895aeaa 100644 --- a/mcp-server/src/tools/initialize-project.js +++ b/mcp-server/src/tools/initialize-project.js @@ -5,6 +5,7 @@ import { withNormalizedProjectRoot } from './utils.js'; import { initializeProjectDirect } from '../core/task-master-core.js'; +import { BRAND_RULE_OPTIONS } from '../../../src/constants/rules.js'; export function registerInitializeProjectTool(server) { server.addTool({ @@ -37,10 +38,10 @@ export function registerInitializeProjectTool(server) { 'The root directory for the project. ALWAYS SET THIS TO THE PROJECT ROOT DIRECTORY. IF NOT SET, THE TOOL WILL NOT WORK.' ), rules: z - .array(z.string()) + .array(z.enum(BRAND_RULE_OPTIONS)) .optional() .describe( - 'List of rules to include at initialization (e.g., ["cursor", "roo"]). If omitted, defaults to all available brand rules.' + `List of rules to include at initialization. If omitted, defaults to all available brand rules. Available options: ${BRAND_RULE_OPTIONS.join(', ')}` ) }), execute: withNormalizedProjectRoot(async (args, context) => { diff --git a/mcp-server/src/tools/rules.js b/mcp-server/src/tools/rules.js index e45cf2fc..65c5a7fe 100644 --- a/mcp-server/src/tools/rules.js +++ b/mcp-server/src/tools/rules.js @@ -10,6 +10,7 @@ import { withNormalizedProjectRoot } from './utils.js'; import { rulesDirect } from '../core/direct-functions/rules.js'; +import { BRAND_RULE_OPTIONS } from '../../../src/constants/rules.js'; /** * Register the rules tool with the MCP server @@ -25,10 +26,10 @@ export function registerRulesTool(server) { .enum(['add', 'remove']) .describe('Whether to add or remove rules.'), rules: z - .array(z.string()) + .array(z.enum(BRAND_RULE_OPTIONS)) .min(1) .describe( - 'List of rules to add or remove (e.g., ["roo", "windsurf"]).' + `List of rules to add or remove. Available options: ${BRAND_RULE_OPTIONS.join(', ')}` ), projectRoot: z .string() diff --git a/src/constants/rules.js b/src/constants/rules.js new file mode 100644 index 00000000..662d4b02 --- /dev/null +++ b/src/constants/rules.js @@ -0,0 +1,28 @@ +/** + * @typedef {'cursor' | 'roo' | 'windsurf' | 'cline'} BrandRule + */ + +/** + * Available brand rules for project initialization + * @type {BrandRule[]} + * @description Defines possible brand rule sets: + * - cursor: Cursor IDE rules (default) + * - roo: Roo Code IDE rules + * - windsurf: Windsurf IDE rules + * - cline: Cline IDE rules + */ +export const BRAND_RULE_OPTIONS = [ + 'cursor', + 'roo', + 'windsurf', + 'cline' +]; + +/** + * Check if a given brand rule is valid + * @param {string} brandRule - The brand rule to check + * @returns {boolean} True if the brand rule is valid, false otherwise + */ +export function isValidBrandRule(brandRule) { + return BRAND_RULE_OPTIONS.includes(brandRule); +} \ No newline at end of file