default to all rules

This commit is contained in:
Joe Danziger
2025-05-23 15:37:11 -04:00
parent ead4aa4a2d
commit 499aa2b203
4 changed files with 19 additions and 37 deletions

View File

@@ -213,8 +213,8 @@ task-master init
task-master init --rules cursor,windsurf
```
- The `--rules` flag allows you to specify one or more rule sets (e.g., `cursor`, `roo`, `windsurf`) to apply during initialization.
- If omitted, the default is `cursor`.
- The `--rules` flag allows you to specify one or more rule sets (e.g., `cursor`, `roo`, `windsurf`, `cline`) to apply during initialization.
- If omitted, all available rule sets are installed by default (cursor, windsurf, roo, cline).
- You can use multiple comma-separated rules in a single command.
**Example:**

View File

@@ -5,6 +5,7 @@ import {
// isSilentMode // Not used directly here
} from '../../../../scripts/modules/utils.js';
import os from 'os'; // Import os module for home directory check
import { BRAND_NAMES } from '../../../../src/utils/rule-transformer.js';
/**
* Direct function wrapper for initializing a project.
@@ -74,8 +75,8 @@ export async function initializeProjectDirect(args, log, context = {}) {
options.rules = args.rules;
log.info(`Including rules: ${args.rules.join(', ')}`);
} else {
options.rules = ['cursor'];
log.info(`No rules specified, defaulting to: cursor`);
options.rules = BRAND_NAMES;
log.info(`No rules specified, defaulting to: ${BRAND_NAMES.join(', ')}`);
}
log.info(`Initializing project with options: ${JSON.stringify(options)}`);

View File

@@ -320,7 +320,7 @@ async function initializeProject(options = {}) {
let selectedBrandRules =
options.rules && Array.isArray(options.rules) && options.rules.length > 0
? options.rules
: ['cursor'];
: BRAND_NAMES; // Default to all rules
// if (!isSilentMode()) {
// console.log('Skip prompts determined:', skipPrompts);
@@ -418,31 +418,6 @@ async function initializeProject(options = {}) {
// Create structure using only necessary values
createProjectStructure(addAliasesPrompted, dryRun, selectedBrandRules);
// If in MCP mode, call MCP server for rules (without 'yes' param)
if (options.mcpMode && options.mcpServer) {
const mcpArgs = {
action: 'add',
rules: selectedBrandRules,
projectRoot: targetDir
};
try {
const mcpResult = await options.mcpServer.call('rules', mcpArgs);
if (mcpResult && mcpResult.success) {
log(
'success',
`Brand rules added via MCP: ${selectedBrandRules.join(', ')}`
);
} else {
log(
'error',
`MCP rules add failed: ${mcpResult?.error?.message || 'Unknown error'}`
);
}
} catch (err) {
log('error', `MCP server error: ${err.message}`);
}
}
for (const rule of selectedBrandRules) {
const profile = BRAND_PROFILES[rule];
if (profile) {
@@ -479,7 +454,7 @@ function promptQuestion(rl, question) {
function createProjectStructure(
addAliases,
dryRun,
selectedBrandRules = ['cursor']
selectedBrandRules = BRAND_NAMES // Default to all rules
) {
const targetDir = process.cwd();
log('info', `Initializing project in ${targetDir}`);

View File

@@ -2123,17 +2123,23 @@ function registerCommands(programInstance) {
.option('--dry-run', 'Show what would be done without making changes')
.option('--aliases', 'Add shell aliases (tm, taskmaster)')
.action(async (cmdOptions) => {
// Parse rules: accept space or comma separated, default to ['cursor']
let rules = ['cursor'];
// cmdOptions contains parsed arguments
// Parse rules: accept space or comma separated, default to all available rules
let selectedBrands = BRAND_NAMES;
if (cmdOptions.rules && Array.isArray(cmdOptions.rules)) {
rules = cmdOptions.rules
const userSpecifiedBrands = cmdOptions.rules
.flatMap((r) => r.split(','))
.map((r) => r.trim())
.filter(Boolean);
if (rules.length === 0) rules = ['cursor'];
// Only override defaults if user specified valid rules
if (userSpecifiedBrands.length > 0) {
selectedBrands = userSpecifiedBrands;
}
// cmdOptions contains parsed arguments
cmdOptions.rules = rules;
}
cmdOptions.rules = selectedBrands;
try {
console.log('DEBUG: Running init command action in commands.js');
console.log(