Retroactively apply configuration and dev dependencies from boneskull-template to an existing project
Applies boneskull-template configuration and dependencies to an existing project with intelligent merging.
/plugin marketplace add boneskull/claude-plugins/plugin install skill-activation@boneskull-pluginstarget-directoryRetroactively apply configuration files and development dependencies from the boneskull-template repository to an existing project, intelligently merging package.json and copying missing configuration files.
Inputs: target-directory (optional) — Target project directory (defaults to current working directory)
Outputs: Summary of changes made
package.json~/.cache/boneskull-templatecd ~/.cache/boneskull-template && git pull origin maingit clone https://github.com/boneskull/boneskull-template.git ~/.cache/boneskull-templateNever copy these from template:
docs/plans/src/test/package-lock.jsonpackage.json)Strategy: Use the merge-package.js script to intelligently merge dependencies
Create backup: cp package.json package.json.backup
Run merge script:
node plugins/tools/scripts/merge-package.js \
<target-directory>/package.json \
~/.cache/boneskull-template/package.json
Install dependencies: Run npm install to install newly added dependencies
Clean up: Delete package.json.backup after successful merge and install
The merge script automatically:
engines, knip, lint-staged, etc.Version comparison logic (handled by merge-package.js):
// Use semver comparison - choose higher version
// Examples:
// "1.2.3" vs "1.2.4" → choose "1.2.4"
// "^1.0.0" vs "^2.0.0" → choose "^2.0.0"
// "~1.2.3" vs "1.2.4" → choose "1.2.4" (prefer exact)
// "latest" vs "1.0.0" → choose "latest"
Strategy: Copy files from template only if they don't exist in target
.github/ directory specially:
.github/ files that don't exist in targetFiles to copy (if missing):
.editorconfig.gitattributes.gitignore (careful - may want to merge).eslintrc.* / eslint.config.js.prettierrc.* / prettier.config.js.prettierignore.commitlintrc.*.markdownlint*.npmrctsconfig.jsoncspell.json.husky/ directory and contents.github/ directory (non-overlapping files only)LICENSE (only if missing)After all changes are complete, inform user they should:
Review changes:
git diff package.json
git status # See new files
Initialize tools if needed:
# If Husky was added:
npm run prepare # or: npx husky install
Review and customize:
Note: Dependencies are automatically installed during step 3 (after merging package.json), so no separate npm install is needed unless the user wants to run it again.
Provide clear summary of actions taken:
✅ Applied boneskull-template to project
Package.json changes:
📦 Added dependencies: prettier, eslint, typescript
📦 Updated dependencies: husky (8.0.0 → 9.0.0), lint-staged (15.0.0 → 16.0.0)
📝 Added scripts: lint, format, test
Configuration files added:
✨ .editorconfig
✨ .prettierrc.json
✨ eslint.config.js
✨ tsconfig.json
✨ .husky/pre-commit
✨ .github/workflows/ci.yml
Files skipped (already exist):
⏭️ .gitignore
⏭️ LICENSE
⏭️ .github/workflows/release.yml
Next steps:
1. Review changes: git diff package.json && git status
2. Initialize Husky: npm run prepare
3. Customize configs as needed
# Apply to current directory
/tools:apply-template
# Apply to specific project
/tools:apply-template ../my-project
# Apply to absolute path
/tools:apply-template /Users/me/projects/my-app
package.json)Git not clean:
No package.json in target:
Network error fetching template:
Version comparison ambiguity:
.gitignore conflicts:
~/.cache/boneskull-templatehttps://github.com/boneskull/boneskull-template.gitplugins/tools/scripts/merge-package.js - handles all package.json merging logic