| name | setup-template-store |
| description | First-run setup for license-populator. Choose where the user's license template store lives, scaffold its directory, and write the pointer into the plugin config. Use when the user says "set up license templates", "configure license-populator", or invokes any other skill in this plugin without an existing config. |
Setup Template Store
Configure where the user keeps their license templates. Templates are user-owned content — never store them inside the plugin install path. Default to a folder under $CLAUDE_USER_DATA, but offer to point at a user-chosen path (e.g. a dotfiles or notes repo).
Resolver
The plugin config lives at:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/license-populator/config.json
Template store default path:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/license-populator/templates/
Steps
- Resolve the config path above. If
config.json already exists and contains a valid template_store_path, report it and exit unless the user explicitly asks to reconfigure.
- Ask the user: "Where would you like to keep your license templates? (Press enter for the default plugin data path, or provide an absolute path — e.g. a folder inside your dotfiles or notes repo.)"
- Create the chosen directory if it does not exist.
- Write
config.json:
{
"template_store_path": "<absolute path>",
"created_at": "<ISO 8601 date>"
}
- Seed the store with a
README.md explaining the expected file layout:
- One file per template, e.g.
mit.md, apache-2.0.md, custom-strict-attribution.md.
- Optional frontmatter with
name, summary, permissions, conditions, limitations, placeholders (list of {{tokens}}).
- Body is the license text with
{{year}}, {{copyright_holder}}, etc. tokens for population.
- If the user has no templates yet, offer to seed the store with stock SPDX templates (MIT, Apache-2.0, GPL-3.0, MPL-2.0, BSD-3-Clause, Unlicense, CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0). Fetch from
https://spdx.org/licenses/<id>.json (licenseText field) and convert standard tokens (<year>, <copyright holders>) to {{year}} / {{copyright_holder}}.
- Report the final config path and template store path.
Notes
- Never write user templates under
~/.claude/plugins/.
- Treat
template_store_path as a pointer; the actual files belong to the user.