Merge branch 'next' of https://github.com/eyaltoledano/claude-task-master into joedanz/flexible-brand-rules

# Conflicts:
#	.cursor/rules/dev_workflow.mdc
#	mcp-server/src/tools/index.js
#	scripts/init.js
This commit is contained in:
Joe Danziger
2025-06-15 13:25:59 -04:00
263 changed files with 25128 additions and 21840 deletions

View File

@@ -38,6 +38,7 @@ import {
TASKMASTER_TASKS_DIR,
TASKMASTER_DOCS_DIR,
TASKMASTER_REPORTS_DIR,
TASKMASTER_STATE_FILE,
ENV_EXAMPLE_FILE,
GITIGNORE_FILE
} from '../src/constants/paths.js';
@@ -188,6 +189,33 @@ alias taskmaster='task-master'
}
}
// Function to create initial state.json file for tag management
function createInitialStateFile(targetDir) {
const stateFilePath = path.join(targetDir, TASKMASTER_STATE_FILE);
// Check if state.json already exists
if (fs.existsSync(stateFilePath)) {
log('info', 'State file already exists, preserving current configuration');
return;
}
// Create initial state configuration
const initialState = {
currentTag: 'master',
lastSwitched: new Date().toISOString(),
branchTagMapping: {},
migrationNoticeShown: false
};
try {
fs.writeFileSync(stateFilePath, JSON.stringify(initialState, null, 2));
log('success', `Created initial state file: ${stateFilePath}`);
log('info', 'Default tag set to "master" for task organization');
} catch (error) {
log('error', `Failed to create state file: ${error.message}`);
}
}
// Function to copy a file from the package to the target directory
function copyTemplateFile(templateName, targetPath, replacements = {}) {
// Get the file content from the appropriate source directory
@@ -444,6 +472,9 @@ function createProjectStructure(
ensureDirectoryExists(path.join(targetDir, TASKMASTER_REPORTS_DIR));
ensureDirectoryExists(path.join(targetDir, TASKMASTER_TEMPLATES_DIR));
// Create initial state.json file for tag management
createInitialStateFile(targetDir);
// Copy template files with replacements
const replacements = {
year: new Date().getFullYear()