Remove placeholder template files from installer
Workshop feedback: 00-*.md files were confusing and ignored by users. Changes: - Remove createFolderGuides() and createProjectInfoFile() methods - Folders still created but empty (only .gitkeep) - Agents will create files dynamically during workflows - Cleaner, less confusing user experience
This commit is contained in:
parent
5bdb03572b
commit
ef3d523875
|
|
@ -264,104 +264,8 @@ class Installer {
|
|||
const progressPath = path.join(docsPath, '_progress');
|
||||
await fs.ensureDir(progressPath);
|
||||
await fs.ensureDir(path.join(progressPath, 'agent-dialogs'));
|
||||
|
||||
// Create 00 guide files in each folder (if they don't exist)
|
||||
await this.createFolderGuides(docsPath, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create 00 guide files in each folder from templates
|
||||
*/
|
||||
async createFolderGuides(docsPath, config) {
|
||||
const templateDir = path.join(this.srcDir, 'workflows', '0-project-setup', 'templates', 'folder-guides');
|
||||
|
||||
// Mapping: template filename → destination folder & filename
|
||||
const guides = [
|
||||
{ template: '00-product-brief.template.md', folder: 'A-Product-Brief', filename: '00-product-brief.md' },
|
||||
{ template: '00-trigger-map.template.md', folder: 'B-Trigger-Map', filename: '00-trigger-map.md' },
|
||||
{ template: '00-ux-scenarios.template.md', folder: 'C-UX-Scenarios', filename: '00-ux-scenarios.md' },
|
||||
{ template: '00-design-system.template.md', folder: 'E-Design-System', filename: '00-design-system.md' },
|
||||
];
|
||||
|
||||
// Common placeholder replacements
|
||||
const replacements = {
|
||||
'{{project_name}}': config.project_name || 'Untitled Project',
|
||||
'{{date}}': new Date().toISOString().split('T')[0],
|
||||
'{{starting_point}}': config.starting_point || 'brief',
|
||||
'{{user_name}}': config.user_name || 'Designer',
|
||||
'{{communication_language}}': 'en',
|
||||
'{{document_output_language}}': 'en',
|
||||
'{{output_folder}}': config.root_folder || 'design-process',
|
||||
'{{wds_folder}}': config.wdsFolder || '_wds',
|
||||
};
|
||||
|
||||
// Create each folder guide
|
||||
for (const guide of guides) {
|
||||
const templatePath = path.join(templateDir, guide.template);
|
||||
const destPath = path.join(docsPath, guide.folder, guide.filename);
|
||||
|
||||
// Skip if file exists (never overwrite) or template doesn't exist
|
||||
if (await fs.pathExists(destPath)) continue;
|
||||
if (!(await fs.pathExists(templatePath))) continue;
|
||||
|
||||
// Read template
|
||||
let content = await fs.readFile(templatePath, 'utf8');
|
||||
|
||||
// Replace all placeholders
|
||||
for (const [placeholder, value] of Object.entries(replacements)) {
|
||||
content = content.split(placeholder).join(value);
|
||||
}
|
||||
|
||||
// Write file
|
||||
await fs.writeFile(destPath, content, 'utf8');
|
||||
}
|
||||
|
||||
// Also create 00-project-info.md in A-Product-Brief (project settings home)
|
||||
await this.createProjectInfoFile(docsPath, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create 00-project-info.md in A-Product-Brief from template
|
||||
*/
|
||||
async createProjectInfoFile(docsPath, config) {
|
||||
const productBriefPath = path.join(docsPath, 'A-Product-Brief');
|
||||
const projectInfoPath = path.join(productBriefPath, '00-project-info.md');
|
||||
|
||||
// Only create if it doesn't exist (never overwrite)
|
||||
if (await fs.pathExists(projectInfoPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const templatePath = path.join(this.srcDir, 'workflows', '1-project-brief', 'templates', '00-project-info.template.md');
|
||||
|
||||
// Check if template exists
|
||||
if (!(await fs.pathExists(templatePath))) {
|
||||
// Skip if template not found (backward compatibility)
|
||||
return;
|
||||
}
|
||||
|
||||
// Read template
|
||||
let template = await fs.readFile(templatePath, 'utf8');
|
||||
|
||||
// Replace placeholders
|
||||
const replacements = {
|
||||
'{{project_name}}': config.project_name || 'Untitled Project',
|
||||
'{{date}}': new Date().toISOString().split('T')[0],
|
||||
'{{starting_point}}': config.starting_point || 'brief',
|
||||
'{{user_name}}': config.user_name || 'Designer',
|
||||
'{{communication_language}}': 'en',
|
||||
'{{document_output_language}}': 'en',
|
||||
'{{output_folder}}': config.root_folder || 'design-process',
|
||||
'{{wds_folder}}': config.wdsFolder || '_wds',
|
||||
};
|
||||
|
||||
for (const [placeholder, value] of Object.entries(replacements)) {
|
||||
template = template.split(placeholder).join(value);
|
||||
}
|
||||
|
||||
// Write the file
|
||||
await fs.writeFile(projectInfoPath, template, 'utf8');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { Installer };
|
||||
|
|
|
|||
Loading…
Reference in New Issue