update "brand rules" to "rules"

This commit is contained in:
Joe Danziger
2025-05-22 14:26:08 -04:00
parent 0c64e9a739
commit c5c46e0cf8
9 changed files with 54 additions and 115 deletions

View File

@@ -2,14 +2,14 @@
'task-master-ai': patch
---
Added flexible brand rules management:
Added flexible rules management:
- New `init` flag: You can now specify which brands to include rules for at project initialization using `--rules <brands>` or `-r <brands>` (e.g., `task-master init -r cursor,roo`). Only the selected brands' rules and configuration are included.
- New commands: `task-master rules add <brands>` and `task-master rules remove <brands>` let you add or remove brand-specific rules and MCP config after initialization, supporting multiple brands at once.
- New command: `task-master rules setup` launches an interactive prompt to select which brand rules to apply to your project. This does **not** re-initialize your project or affect shell aliases; it only manages rules. The list of brands is always up-to-date with available profiles, so you never have to update the CLI when adding a new brand.
- The interactive rules setup flow is also used during `init` if you don't specify brands with `--rules`.
- New `init` flag: You can now specify which rules to include at project initialization using `--rules <rules>` or `-r <rules>` (e.g., `task-master init -r cursor,roo`). Only the selected rules and configuration are included.
- New commands: `task-master rules add <rules>` and `task-master rules remove <rules>` let you add or remove specific rules and MCP config after initialization, supporting multiple rules at once.
- New command: `task-master rules setup` launches an interactive prompt to select which rules to apply to your project. This does **not** re-initialize your project or affect shell aliases; it only manages rules. The list of rules is always up-to-date with available profiles, so you never have to update the CLI when adding a new rule set.
- The interactive rules setup flow is also used during `init` if you don't specify rules with `--rules`.
- Documentation and tests were updated to reflect these changes.
This enables more flexible, brand-specific project setups and makes rules management much easier. You can update or switch brands at any time after initialization using the interactive setup.
This enables more flexible, rule-specific project setups and makes rules management much easier. You can update or switch rules at any time after initialization using the interactive setup.
- Resolves #338

View File

@@ -17,12 +17,12 @@ This document provides a detailed reference for interacting with Taskmaster, cov
### 1. Initialize Project (`init`)
* **Brand Rules Option:**
* `--rules <brands>` or `-r <brands>`: Comma-separated list of brand rule sets to apply at initialization (e.g., `cursor,windsurf,roo`).
* **Rules Option:**
* `--rules <rules>` or `-r <rules>`: Comma-separated list of rule sets to apply at initialization (e.g., `cursor,windsurf,roo`).
* Example: `task-master init --rules cursor,windsurf`
* Example: `task-master init -r roo`
* **What happens:**
* For each brand, creates the appropriate rules directory (e.g., `.roo/rules`) and MCP config (e.g., `.roo/mcp.json`).
* For each, creates the appropriate rules directory (e.g., `.roo/rules`) and MCP config (e.g., `.roo/mcp.json`).
* If not specified, only Cursor rules are initialized by default.
@@ -93,15 +93,15 @@ This document provides a detailed reference for interacting with Taskmaster, cov
---
### Add or Remove Brand Rules After Initialization
### Add or Remove Rules After Initialization
* **CLI Command:**
* `task-master rules add <brands>`: Add one or more brand rule sets to your project (e.g., `task-master rules add windsurf,roo`).
* `task-master rules remove <brands>`: Remove one or more brand rule sets (e.g., `task-master rules remove windsurf`).
* `task-master rules add <rules>`: Add one or more rule sets to your project (e.g., `task-master rules add windsurf,roo`).
* `task-master rules remove <rules>`: Remove one or more rule sets (e.g., `task-master rules remove windsurf`).
* **What happens:**
* Adding rules creates the brand rules directory (e.g., `.roo/rules`) and MCP config.
* Removing rules deletes the brand rules directory and associated MCP config.
* You can use multiple comma-separated brands in a single command.
* Adding rules creates the rules directory (e.g., `.roo/rules`) and MCP config (if appropriate).
* Removing rules deletes the rules directory and associated MCP config.
* You can use multiple comma-separated rules in a single command.
---

View File

@@ -93,14 +93,12 @@ task-master init
# If installed locally
npx task-master init
# Initialize project with specific rules
task-master init --rules cursor,windsurf
```
This will prompt you for project details and set up a new project with the necessary files and structure.
You can also specify brand rules to apply during initialization:
```bash
task-master init --rules cursor,windsurf
```
#### Common Commands
@@ -108,81 +106,22 @@ task-master init --rules cursor,windsurf
# Initialize a new project
task-master init
# Initialize a new project applying specific brand rules
task-master init --rules cursor,windsurf
# Parse a PRD and generate tasks
task-master parse-prd your-prd.txt
# Add, remove, or set up brand rules after initialization
You can add or remove brand rules at any time after project initialization:
```
task-master rules add windsurf,roo
# Adds the specified brand rule sets (e.g., .windsurf/rules, .roo/rules) to your project.
# Also sets up the corresponding MCP configuration in the brand directory.
task-master rules remove windsurf
# Removes the specified brand rule sets and their MCP config from your project.
task-master rules setup
# Launches an interactive prompt to select which brand rules to apply to your project.
# This does NOT re-initialize the project or ask about shell aliases.
# Useful for updating/enforcing rules or switching brands at any time.
# The list of brands is always up-to-date with available profiles.
````
- Adding rules creates the brand rules directory (e.g., `.roo/rules`) and copies/initializes the brand's rules.
- Removing rules deletes the brand rules directory and associated MCP config.
- You can use multiple comma-separated brands in a single command.
- Use the `--force` flag to bypass the confirmation prompt when removing rules (dangerous, irreversible):
```bash
task-master rules remove windsurf --force
````
:warning: **Warning:** The `--force` flag will immediately and permanently delete brand rules and configuration without asking for confirmation.
task-master rules add windsurf,roo
task-master rules remove windsurf --force
# List all tasks
task-master list
# Show the next task to work on
task-master next
# Generate task files
task-master generate
````
### Interactive Rules Setup
You can launch the interactive rules setup at any time with:
```bash
task-master rules setup
# Add rules after initialization
task-master rules add windsurf,roo
```
This command opens a prompt where you can select which brand rules (e.g., Cursor, Roo, Windsurf) you want to apply to your project. The list of brands is always current with the available profiles—no manual updates needed. This does **not** re-initialize your project or ask about shell aliases; it only manages rules.
- Use this command to update, enforce, or switch brand rules interactively after project creation.
- The same interactive prompt is also used during `init` if you don't specify brands with `--rules`.
## Documentation
For more detailed information, check out the documentation in the `docs` directory:

View File

@@ -17,12 +17,12 @@ This document provides a detailed reference for interacting with Taskmaster, cov
### 1. Initialize Project (`init`)
* **Brand Rules Option:**
* `--rules <brands>` or `-r <brands>`: Comma-separated list of brand rule sets to apply at initialization (e.g., `cursor,windsurf,roo`).
* **Rules Option:**
* `--rules <rules>` or `-r <rules>`: Comma-separated list of rule sets to apply at initialization (e.g., `cursor,windsurf,roo`).
* Example: `task-master init --rules cursor,windsurf`
* Example: `task-master init -r roo`
* **What happens:**
* For each brand, creates the appropriate rules directory (e.g., `.roo/rules`) and MCP config (e.g., `.roo/mcp.json`).
* For each, creates the appropriate rules directory (e.g., `.roo/rules`) and MCP config (e.g., `.roo/mcp.json`).
* If not specified, only Cursor rules are initialized by default.
@@ -93,15 +93,15 @@ This document provides a detailed reference for interacting with Taskmaster, cov
---
### Add or Remove Brand Rules After Initialization
### Add or Remove Rules After Initialization
* **CLI Command:**
* `task-master rules add <brands>`: Add one or more brand rule sets to your project (e.g., `task-master rules add windsurf,roo`).
* `task-master rules remove <brands>`: Remove one or more brand rule sets (e.g., `task-master rules remove windsurf`).
* `task-master rules add <rules>`: Add one or more rule sets to your project (e.g., `task-master rules add windsurf,roo`).
* `task-master rules remove <rules>`: Remove one or more rule sets (e.g., `task-master rules remove windsurf`).
* **What happens:**
* Adding rules creates the brand rules directory (e.g., `.roo/rules`) and MCP config.
* Removing rules deletes the brand rules directory and associated MCP config.
* You can use multiple comma-separated brands in a single command.
* Adding rules creates the rules directory (e.g., `.roo/rules`) and MCP config (if appropriate).
* Removing rules deletes the rules directory and associated MCP config.
* You can use multiple comma-separated rules in a single command.
---

View File

@@ -209,13 +209,13 @@ task-master add-task --prompt="Description" --priority=high
# Initialize a new project with Task Master structure
task-master init
# Initialize a new project applying specific brand rules
# Initialize a new project applying specific rules
task-master init --rules cursor,windsurf
```
- The `--rules` flag allows you to specify one or more brand rule sets (e.g., `cursor`, `roo`, `windsurf`) to apply during initialization.
- 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`.
- You can use multiple comma-separated brands in a single command.
- You can use multiple comma-separated rules in a single command.
**Example:**
@@ -223,25 +223,25 @@ task-master init --rules cursor,windsurf
task-master init --rules cursor,roo
```
## Manage Brand Rules
## Manage Rules
```bash
# Add brand rule sets to your project
# Add rule sets to your project
# (e.g., .roo/rules, .windsurf/rules)
task-master rules add <brand1,brand2,...>
task-master rules add <rules1,rules2,...>
# Remove brand rule sets from your project
task-master rules remove <brand1,brand2,...>
# Remove rule sets from your project
task-master rules remove <rules1,rules2,...>
# Launch interactive rules setup to select brands
# Launch interactive rules setup to select rules
# (does not re-initialize project or ask about shell aliases)
task-master rules setup
```
- Adding rules creates the brand rules directory (e.g., `.roo/rules`) and copies/initializes the brand's rules.
- Removing rules deletes the brand rules directory and associated MCP config.
- You can use multiple comma-separated brands in a single command.
- The `setup` action launches an interactive prompt to select which brand rules to apply. The list of brands is always current with the available profiles, and no manual updates are needed. This command does **not** re-initialize your project or affect shell aliases; it only manages rules interactively.
- Adding rules creates the rules directory (e.g., `.roo/rules`) and copies/initializes the rules.
- Removing rules deletes the rules directory and associated MCP config.
- You can use multiple comma-separated rules in a single command.
- The `setup` action launches an interactive prompt to select which rules to apply. The list of rules is always current with the available profiles, and no manual updates are needed. This command does **not** re-initialize your project or affect shell aliases; it only manages rules interactively.
**Examples:**
@@ -259,10 +259,10 @@ You can launch the interactive rules setup at any time with:
task-master rules setup
```
This command opens a prompt where you can select which brand rules (e.g., Cursor, Roo, Windsurf) you want to apply to your project. The list of brands is always current with the available profiles—no manual updates needed. This does **not** re-initialize your project or ask about shell aliases; it only manages rules.
This command opens a prompt where you can select which rules (e.g., Cursor, Roo, Windsurf) you want to apply to your project. The list of rules is always current with the available profiles—no manual updates needed. This does **not** re-initialize your project or ask about shell aliases; it only manages rules.
- Use this command to update, enforce, or switch brand rules interactively after project creation.
- The same interactive prompt is also used during `init` if you don't specify brands with `--rules`.
- Use this command to add rules interactively after project creation.
- The same interactive prompt is also used during `init` if you don't specify rules with `--rules`.
## Configure AI Models

View File

@@ -72,7 +72,7 @@ export async function initializeProjectDirect(args, log, context = {}) {
// Handle rules option just like CLI
if (Array.isArray(args.rules) && args.rules.length > 0) {
options.rules = args.rules;
log.info(`Including brand rules: ${args.rules.join(', ')}`);
log.info(`Including rules: ${args.rules.join(', ')}`);
} else {
options.rules = ['cursor'];
log.info(`No rules specified, defaulting to: cursor`);

View File

@@ -1,6 +1,6 @@
/**
* rules.js
* Direct function implementation for adding or removing brand rules
* Direct function implementation for adding or removing rules
*/
import {
@@ -18,10 +18,10 @@ import path from 'path';
import fs from 'fs';
/**
* Direct function wrapper for adding or removing brand rules.
* Direct function wrapper for adding or removing rules.
* @param {Object} args - Command arguments
* @param {"add"|"remove"} args.action - Action to perform: add or remove rules
* @param {string[]} args.rules - List of brand rules to add or remove
* @param {string[]} args.rules - List of rules to add or remove
* @param {string} args.projectRoot - Absolute path to the project root
* @param {boolean} [args.yes=true] - Run non-interactively
* @param {Object} log - Logger object

View File

@@ -40,7 +40,7 @@ export function registerInitializeProjectTool(server) {
.array(z.string())
.optional()
.describe(
'List of brand rules to include at initialization (e.g., ["cursor", "roo"]). If omitted, defaults to ["cursor"].'
'List of rules to include at initialization (e.g., ["cursor", "roo"]). If omitted, defaults to ["cursor"].'
)
}),
execute: withNormalizedProjectRoot(async (args, context) => {

View File

@@ -1,6 +1,6 @@
/**
* tools/rules.js
* Tool to add or remove brand rules from a project (MCP server)
* Tool to add or remove rules from a project (MCP server)
*/
import { z } from 'zod';
@@ -19,16 +19,16 @@ export function registerRulesTool(server) {
server.addTool({
name: 'rules',
description:
'Add or remove brand rules and MCP config from the project (mirrors CLI rules add/remove).',
'Add or remove rules and MCP config from the project (mirrors CLI rules add/remove).',
parameters: z.object({
action: z
.enum(['add', 'remove'])
.describe('Whether to add or remove brand rules.'),
.describe('Whether to add or remove rules.'),
rules: z
.array(z.string())
.min(1)
.describe(
'List of brand rules to add or remove (e.g., ["roo", "windsurf"]).'
'List of rules to add or remove (e.g., ["roo", "windsurf"]).'
),
projectRoot: z
.string()