Your clean-template scripts now include an optional step to remove themselves for a completely fresh start!
Added to both:
scripts/clean-template-dashboard.jsscripts/clean-template-blank.js
What it does:
- Deletes all cleaning script files
- Removes the
scripts/directory - Updates
package.jsonto remove clean commands - Leaves everything else intact
After template cleaning completes, users see:
❓ One more thing...
Remove cleaning scripts for a completely fresh start? (yes/no):
- Type
yes: Scripts removed, completely fresh project - Type
no: Scripts kept, can clean again later
Created/Updated:
- ✅
docs/remove-scripts-feature.md- Complete feature guide - ✅
docs/clean-template-modes.md- Updated with new prompts - ✅
README.md- Added bonus feature mention - ✅
REMOVE-SCRIPTS-SUMMARY.md- This file
$ npm run clean-template:dashboard
🎨 DASHBOARD MODE: Keeps full layout structure
Perfect for building dashboard-style applications.
This action cannot be undone.
Create dashboard template? (yes/no): yes
[... template cleanup happens ...]
✅ Dashboard template ready!
❓ One more thing...
Remove cleaning scripts for a completely fresh start? (yes/no): yes
🧹 Removing cleaning scripts for fresh start...
✓ Deleted: scripts/clean-template.js
✓ Deleted: scripts/clean-template-dashboard.js
✓ Deleted: scripts/clean-template-blank.js
✓ Deleted: scripts/README.md
✓ Deleted: scripts/ directory
📝 Updating package.json...
✓ Removed clean-template scripts from package.json
✨ Cleaning scripts removed! You have a completely fresh start.When user chooses yes:
scripts/
├── clean-template.js ❌
├── clean-template-dashboard.js ❌
├── clean-template-blank.js ❌
└── README.md ❌
{
"scripts": {
"clean-template": "...", // ❌ REMOVED
"clean-template:dashboard": "...", // ❌ REMOVED
"clean-template:blank": "..." // ❌ REMOVED
}
}✅ Application code
✅ Configuration files
✅ Documentation (docs/, README)
✅ TailwindCSS & DaisyUI
✅ .cursorrules
✅ All other npm scripts
-
Completely Fresh Start
- No template artifacts
- Production-ready codebase
- Simpler project structure
-
Cleaner Codebase
- No unused scripts
- Fewer files to maintain
- Smaller repository
-
User Choice
- Optional (not forced)
- Can keep scripts if needed
- Explicit confirmation required
-
Professional Projects
- Remove all "template" remnants
- Project truly feels like yours
- No cleanup needed
Choose YES (remove scripts) when:
- Building a production application
- Don't need to clean again
- Want a completely fresh start
- Prefer minimal project structure
Choose NO (keep scripts) when:
- Still learning/exploring
- Might want to try other modes
- Using as a template for others
- Want to reference the scripts
function removeCleaningScripts() {
const rootDir = path.join(__dirname, "..");
const scriptsDir = path.join(__dirname);
// 1. Delete script files
const scriptsToDelete = ["clean-template.js", "clean-template-dashboard.js", "clean-template-blank.js", "README.md"];
scriptsToDelete.forEach((file) => {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
}
});
// 2. Remove empty directory
fs.rmdirSync(scriptsDir);
// 3. Update package.json
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath));
delete packageJson.scripts["clean-template"];
delete packageJson.scripts["clean-template:dashboard"];
delete packageJson.scripts["clean-template:blank"];
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
}Both scripts now:
- Run template cleanup
- Close first readline interface
- Create new readline interface
- Ask about script removal
- Execute removal if confirmed
- Close second readline interface
docs/remove-scripts-feature.md(400+ lines)- Complete feature documentation
- How it works
- What gets removed
- FAQ section
- Examples and best practices
-
docs/clean-template-modes.md- Added script removal prompts
- Updated both mode sections
-
README.md- Added bonus feature mention
- Noted optional script removal
-
scripts/clean-template-dashboard.js- Added
removeCleaningScripts()function - Added secondary prompt
- Added
-
scripts/clean-template-blank.js- Added
removeCleaningScripts()function - Added secondary prompt
- Added
- ✅ Requires explicit confirmation
- ✅ Only runs after successful cleanup
- ✅ Shows what's being deleted
- ✅ Doesn't affect application code
- ✅ Updates package.json safely
- ✅ Clear prompts
- ✅ Color-coded output
- ✅ Optional (not required)
- ✅ Can decline and keep scripts
- ✅ Confirmation messages
- ✅ Works with both modes
- ✅ User choice preserved
- ✅ Can be declined
- ✅ Scripts available in git history
Test scenarios:
- Dashboard mode + remove scripts
- Dashboard mode + keep scripts
- Blank mode + remove scripts
- Blank mode + keep scripts
- Verify package.json updated correctly
- Verify scripts folder deleted
- Verify application still works
- Verify git history preserved
Two-step cleaning process:
- Clean template (Dashboard or Blank mode)
- Optionally remove cleaning scripts
Maximum flexibility:
- Complete fresh start option
- Can keep scripts if needed
- Professional production setup
- or Learning-friendly setup
- 2 scripts updated (dashboard + blank)
- 1 new function added to each
- 3 docs created/updated
- 1 README section added
- 100% optional feature
- 0 breaking changes
Your users can now:
# Run either mode
npm run clean-template:dashboard
# After cleanup, they see:
❓ One more thing...
Remove cleaning scripts for a completely fresh start? (yes/no):
# Type 'yes' for complete fresh start
# Type 'no' to keep the scriptsPerfect for both learning and production!
Created: October 17, 2025
Status: ✅ Complete and Ready
Breaking Changes: None
User Impact: Positive (more options!)
See full documentation: docs/remove-scripts-feature.md