Skip to content

An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.

fix: Clean up remaining automatic task file generation calls (#1025)

Joe Danziger8781794c56d4
diff --git a/.changeset/happy-sites-stay.md b/.changeset/happy-sites-stay.md
new file mode 100644
index 00000000..d77f3350
--- /dev/null
+++ b/.changeset/happy-sites-stay.md
@@ -0,0 +1,5 @@
+---
+"task-master-ai": patch
+---
+
+Clean up remaining automatic task file generation calls
diff --git a/.cursor/rules/commands.mdc b/.cursor/rules/commands.mdc
index 027e8793..3714905f 100644
--- a/.cursor/rules/commands.mdc
+++ b/.cursor/rules/commands.mdc
@@ -523,7 +523,7 @@ For AI-powered commands that benefit from project context, follow the research c
.option('--details <details>', 'Implementation details for the new subtask, optional')
.option('--dependencies <ids>', 'Comma-separated list of subtask IDs this subtask depends on')
.option('--status <status>', 'Initial status for the subtask', 'pending')
- .option('--skip-generate', 'Skip regenerating task files')
+ .option('--generate', 'Regenerate task files after adding subtask')
.action(async (options) => {
// Validate required parameters
if (!options.parent) {
@@ -545,7 +545,7 @@ For AI-powered commands that benefit from project context, follow the research c
.option('-f, --file <path>', 'Path to the tasks file', 'tasks/tasks.json')
.option('-i, --id <id>', 'ID of the subtask to remove in format parentId.subtaskId, required')
.option('-c, --convert', 'Convert the subtask to a standalone task instead of deleting')
- .option('--skip-generate', 'Skip regenerating task files')
+ .option('--generate', 'Regenerate task files after removing subtask')
.action(async (options) => {
// Implementation with detailed error handling
})
@@ -633,11 +633,11 @@ function showAddSubtaskHelp() {
' --dependencies <ids> Comma-separated list of dependency IDs\n' +
' -s, --status <status> Status for the new subtask (default: "pending")\n' +
' -f, --file <file> Path to the tasks file (default: "tasks/tasks.json")\n' +
- ' --skip-generate Skip regenerating task files\n\n' +
+ ' --generate Regenerate task files after adding subtask\n\n' +
chalk.cyan('Examples:') + '\n' +
' task-master add-subtask --parent=\'5\' --task-id=\'8\'\n' +
' task-master add-subtask -p \'5\' -t \'Implement login UI\' -d \'Create the login form\'\n' +
- ' task-master add-subtask -p \'5\' -t \'Handle API Errors\' --details $\'Handle 401 Unauthorized.\nHandle 500 Server Error.\'',
+ ' task-master add-subtask -p \'5\' -t \'Handle API Errors\' --details "Handle 401 Unauthorized.\\nHandle 500 Server Error." --generate',
{ padding: 1, borderColor: 'blue', borderStyle: 'round' }
));
}
@@ -652,7 +652,7 @@ function showRemoveSubtaskHelp() {
' -i, --id <id> Subtask ID(s) to remove in format "parentId.subtaskId" (can be comma-separated, required)\n' +
' -c, --convert Convert the subtask to a standalone task instead of deleting it\n' +
' -f, --file <file> Path to the tasks file (default: "tasks/tasks.json")\n' +
- ' --skip-generate Skip regenerating task files\n\n' +
+ ' --generate Regenerate task files after removing subtask\n\n' +
chalk.cyan('Examples:') + '\n' +
' task-master remove-subtask --id=\'5.2\'\n' +
' task-master remove-subtask --id=\'5.2,6.3,7.1\'\n' +
diff --git a/.cursor/rules/taskmaster.mdc b/.cursor/rules/taskmaster.mdc
index 3fc236f3..847bd209 100644
--- a/.cursor/rules/taskmaster.mdc
+++ b/.cursor/rules/taskmaster.mdc
@@ -158,7 +158,7 @@ This document provides a detailed reference for interacting with Taskmaster, cov
* `details`: `Provide implementation notes or details for the new subtask.` (CLI: `--details <text>`)
* `dependencies`: `Specify IDs of other tasks or subtasks, e.g., '15' or '16.1', that must be done before this new subtask.` (CLI: `--dependencies <ids>`)
* `status`: `Set the initial status for the new subtask. Default is 'pending'.` (CLI: `-s, --status <status>`)
- * `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after adding the subtask.` (CLI: `--skip-generate`)
+ * `generate`: `Enable Taskmaster to regenerate markdown task files after adding the subtask.` (CLI: `--generate`)
* `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
* **Usage:** Break down tasks manually or reorganize existing tasks.
@@ -286,7 +286,7 @@ This document provides a detailed reference for interacting with Taskmaster, cov
* **Key Parameters/Options:**
* `id`: `Required. The ID(s) of the Taskmaster subtask(s) to remove, e.g., '15.2' or '16.1,16.3'.` (CLI: `-i, --id <id>`)
* `convert`: `If used, Taskmaster will turn the subtask into a regular top-level task instead of deleting it.` (CLI: `-c, --convert`)
- * `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after removing the subtask.` (CLI: `--skip-generate`)
+ * `generate`: `Enable Taskmaster to regenerate markdown task files after removing the subtask.` (CLI: `--generate`)
* `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
* **Usage:** Delete unnecessary subtasks or promote a subtask to a top-level task.
diff --git a/assets/rules/taskmaster.mdc b/assets/rules/taskmaster.mdc
index 892d7274..c106ebf9 100644
--- a/assets/rules/taskmaster.mdc
+++ b/assets/rules/taskmaster.mdc
@@ -157,7 +157,7 @@ This document provides a detailed reference for interacting with Taskmaster, cov
* `details`: `Provide implementation notes or details for the new subtask.` (CLI: `--details <text>`)
* `dependencies`: `Specify IDs of other tasks or subtasks, e.g., '15' or '16.1', that must be done before this new subtask.` (CLI: `--dependencies <ids>`)
* `status`: `Set the initial status for the new subtask. Default is 'pending'.` (CLI: `-s, --status <status>`)
- * `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after adding the subtask.` (CLI: `--skip-generate`)
+ * `generate`: `Enable Taskmaster to regenerate markdown task files after adding the subtask.` (CLI: `--generate`)
* `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
* **Usage:** Break down tasks manually or reorganize existing tasks.
@@ -285,7 +285,7 @@ This document provides a detailed reference for interacting with Taskmaster, cov
* **Key Parameters/Options:**
* `id`: `Required. The ID(s) of the Taskmaster subtask(s) to remove, e.g., '15.2' or '16.1,16.3'.` (CLI: `-i, --id <id>`)
* `convert`: `If used, Taskmaster will turn the subtask into a regular top-level task instead of deleting it.` (CLI: `-c, --convert`)
- * `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after removing the subtask.` (CLI: `--skip-generate`)
+ * `generate`: `Enable Taskmaster to regenerate markdown task files after removing the subtask.` (CLI: `--generate`)
* `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
* **Usage:** Delete unnecessary subtasks or promote a subtask to a top-level task.
diff --git a/scripts/modules/commands.js b/scripts/modules/commands.js
index f2b9441f..5a2d9023 100644
--- a/scripts/modules/commands.js
+++ b/scripts/modules/commands.js
@@ -2655,7 +2655,7 @@ ${result.result}
'Comma-separated list of dependency IDs for the new subtask'
)
.option('-s, --status <status>', 'Status for the new subtask', 'pending')
- .option('--skip-generate', 'Skip regenerating task files')
+ .option('--generate', 'Regenerate task files after adding subtask')
.option('--tag <tag>', 'Specify tag context for task operations')
.action(async (options) => {
// Initialize TaskMaster
@@ -2666,7 +2666,7 @@ ${result.result}
const parentId = options.parent;
const existingTaskId = options.taskId;
- const generateFiles = !options.skipGenerate;
+ const generateFiles = options.generate || false;
// Resolve tag using standard pattern
const tag = taskMaster.getCurrentTag();
@@ -2816,7 +2816,7 @@ ${result.result}
function showAddSubtaskHelp() {
console.log(
boxen(
- `${chalk.white.bold('Add Subtask Command Help')}\n\n${chalk.cyan('Usage:')}\n task-master add-subtask --parent=<id> [options]\n\n${chalk.cyan('Options:')}\n -p, --parent <id> Parent task ID (required)\n -i, --task-id <id> Existing task ID to convert to subtask\n -t, --title <title> Title for the new subtask\n -d, --description <text> Description for the new subtask\n --details <text> Implementation details for the new subtask\n --dependencies <ids> Comma-separated list of dependency IDs\n -s, --status <status> Status for the new subtask (default: "pending")\n -f, --file <file> Path to the tasks file (default: "${TASKMASTER_TASKS_FILE}")\n --skip-generate Skip regenerating task files\n\n${chalk.cyan('Examples:')}\n task-master add-subtask --parent=5 --task-id=8\n task-master add-subtask -p 5 -t "Implement login UI" -d "Create the login form"`,
+ `${chalk.white.bold('Add Subtask Command Help')}\n\n${chalk.cyan('Usage:')}\n task-master add-subtask --parent=<id> [options]\n\n${chalk.cyan('Options:')}\n -p, --parent <id> Parent task ID (required)\n -i, --task-id <id> Existing task ID to convert to subtask\n -t, --title <title> Title for the new subtask\n -d, --description <text> Description for the new subtask\n --details <text> Implementation details for the new subtask\n --dependencies <ids> Comma-separated list of dependency IDs\n -s, --status <status> Status for the new subtask (default: "pending")\n -f, --file <file> Path to the tasks file (default: "${TASKMASTER_TASKS_FILE}")\n --generate Regenerate task files after adding subtask\n\n${chalk.cyan('Examples:')}\n task-master add-subtask --parent=5 --task-id=8\n task-master add-subtask -p 5 -t "Implement login UI" -d "Create the login form" --generate`,
{ padding: 1, borderColor: 'blue', borderStyle: 'round' }
)
);
@@ -2839,7 +2839,7 @@ ${result.result}
'-c, --convert',
'Convert the subtask to a standalone task instead of deleting it'
)
- .option('--skip-generate', 'Skip regenerating task files')
+ .option('--generate', 'Regenerate task files after removing subtask')
.option('--tag <tag>', 'Specify tag context for task operations')
.action(async (options) => {
// Initialize TaskMaster
@@ -2850,7 +2850,7 @@ ${result.result}
const subtaskIds = options.id;
const convertToTask = options.convert || false;
- const generateFiles = !options.skipGenerate;
+ const generateFiles = options.generate || false;
const tag = taskMaster.getCurrentTag();
if (!subtaskIds) {
diff --git a/scripts/modules/task-manager/add-subtask.js b/scripts/modules/task-manager/add-subtask.js
index be12c853..ad03084c 100644
--- a/scripts/modules/task-manager/add-subtask.js
+++ b/scripts/modules/task-manager/add-subtask.js
@@ -21,7 +21,7 @@ async function addSubtask(
parentId,
existingTaskId = null,
newSubtaskData = null,
- generateFiles = true,
+ generateFiles = false,
context = {}
) {
const { projectRoot, tag } = context;
diff --git a/scripts/modules/task-manager/remove-subtask.js b/scripts/modules/task-manager/remove-subtask.js
index 7a9639af..5f096c05 100644
--- a/scripts/modules/task-manager/remove-subtask.js
+++ b/scripts/modules/task-manager/remove-subtask.js
@@ -17,7 +17,7 @@ async function removeSubtask(
tasksPath,
subtaskId,
convertToTask = false,
- generateFiles = true,
+ generateFiles = false,
context = {}
) {
const { projectRoot, tag } = context;
@@ -111,7 +111,7 @@ async function removeSubtask(
// Generate task files if requested
if (generateFiles) {
log('info', 'Regenerating task files...');
- // await generateTaskFiles(tasksPath, path.dirname(tasksPath), context);
+ await generateTaskFiles(tasksPath, path.dirname(tasksPath), context);
}
return convertedTask;
diff --git a/scripts/modules/task-manager/remove-task.js b/scripts/modules/task-manager/remove-task.js
index ecce2d64..e44f6f0a 100644
--- a/scripts/modules/task-manager/remove-task.js
+++ b/scripts/modules/task-manager/remove-task.js
@@ -192,18 +192,18 @@ async function removeTask(tasksPath, taskIds, context = {}) {
}
// Generate updated task files ONCE, with context
- try {
- await generateTaskFiles(tasksPath, path.dirname(tasksPath), {
- projectRoot,
- tag
- });
- results.messages.push('Task files regenerated successfully.');
- } catch (genError) {
- const genErrMsg = `Failed to regenerate task files: ${genError.message}`;
- results.errors.push(genErrMsg);
- results.success = false;
- log('warn', genErrMsg);
- }
+ // try {
+ // await generateTaskFiles(tasksPath, path.dirname(tasksPath), {
+ // projectRoot,
+ // tag
+ // });
+ // results.messages.push('Task files regenerated successfully.');
+ // } catch (genError) {
+ // const genErrMsg = `Failed to regenerate task files: ${genError.message}`;
+ // results.errors.push(genErrMsg);
+ // results.success = false;
+ // log('warn', genErrMsg);
+ // }
} else if (results.errors.length === 0) {
results.messages.push('No tasks found matching the provided IDs.');
}