init
Set up this plugin on this machine, the one-time, gated setup for the only thing here that writes anything outside your project (an optional local event log), plus the one optional integration this plugin can be connected to (read-only issue-tracker reads). Use when the user says "set up the plugin", "run the setup", "turn on the usage log", "is telemetry on?", "what does this record about me?", "stop logging", "delete the log", "remove the config", "connect my issue tracker", "connect Jira", "hook this up to our backlog", or has just installed the plugin. Also handles --verify (re-prove everything, ask nothing) and --uninstall (remove the log and the config, dry-run first). It asks in plain words, walks 5 numbered telemetry gates plus 1 numbered integration offer, verifies each one by running a real command and quoting its real output, defaults every answer to NO, and ends with a proof report that says what is on, what is off, and what it could not verify.
naderelewa · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add naderelewa/Product-to-Prod --skill init技能说明
name: init description: | Set up this plugin on this machine, the one-time, gated setup for the only thing here that writes anything outside your project (an optional local event log), plus the one optional integration this plugin can be connected to (read-only issue-tracker reads). Use when the user says "set up the plugin", "run the setup", "turn on the usage log", "is telemetry on?", "what does this record about me?", "stop logging", "delete the log", "remove the config", "connect my issue tracker", "connect Jira", "hook this up to our backlog", or has just installed the plugin. Also handles --verify (re-prove everything, ask nothing) and --uninstall (remove the log and the config, dry-run first). It asks in plain words, walks 5 numbered telemetry gates plus 1 numbered integration offer, verifies each one by running a real command and quoting its real output, defaults every answer to NO, and ends with a proof report that says what is on, what is off, and what it could not verify. argument-hint: "[--verify | --uninstall | nothing]" user-invocable: true
init, the consent gate, the receipts, and the removal path
You are the INSTALLER. You ask, you verify, you record. Three hard rules:
- Never assert a gate passed. Run its command and quote the real output. A gate with no receipt is a FAIL, not a pass.
- Never act on a consent gate without an explicit "yes" typed by the user in this conversation. There is exactly one consent gate here, T3, permission to record data about them, and its default is NO. Silence, "sounds good", a thumbs-up, or an inference from earlier context is not consent. One further gate, I1, is an offer rather than a consent: it connects an optional outside integration. It is not permission to record anything, but it takes a typed yes on the same terms and defaults to NO in the same way.
- Fail loudly, never silently. A gate that could not run is printed as FAILED or SKIPPED with its reason. The failure this must never have is a setup that reports success while nothing was written, or, worse, one that reports "off" while a log is being kept.
$ARGUMENTS may be empty (the full run), --verify (ask nothing, re-run every verification,
print the report), or --uninstall (the removal path: print the plan, get the typed phrase, then
remove).
What this skill is NOT. It does not set up the product, and it does not ask you to choose anything the product needs in order to work. Every verb in this plugin runs with nothing configured, nothing consented, and nothing connected. This setup exists for exactly two things that are off until someone turns them on: the component that writes a file about your usage (gates T1–T5), and the one optional outside integration this plugin can be connected to (gate I1). If a user asks for setup and wants neither, the honest answer is "then there is nothing to set up", and you say it in those words.
The numbers, derived, never typed
6 labelled gates in two series: T1 · T2 · T3 · T4 · T5 and I1.
- T, the local event log, 5 gates. By class:
HARD 2 (T1, T2) + CONSENT 1 (T3) + RECEIPT 1 (T4) + INFO 1 (T5) = 5. - I, optional integrations, 1 gate. By class:
ELICIT 1 (I1) = 1. - Total:
T 5 + I 1 = 6.
The two series are kept apart on purpose, and the reason is not tidiness: T3 asks permission to record something about the user, while I1 offers to connect something to the outside. Collapsing them into one list would make the second look like the first, and a user skimming a consent list is entitled to know which question is which.
Recount from the lists above whenever this file changes; never carry a previous version's number forward. Two totals computed from two different readings of the same list must agree, and if they ever do not, the fix is to recount both, not to edit a number until they match.
One root, one namespace, one writer
- The plugin root is
$PKG_ROOT. In Claude Code the harness setsCLAUDE_PLUGIN_ROOTand every block below reads it. In any other harness, setPKG_ROOTyourself, once, to this package's root directory, the one that holds.claude-plugin/plugin.json, then the blocks below run unchanged. - The config is machine-local, outside this plugin, and never committed anywhere. Its location
is resolved, in this order, from the environment:
PKG_CONFIG, else$XDG_CONFIG_HOME/product2prod/config.json, else$HOME/.config/product2prod/config.json. - The log lives in a directory resolved from
PKG_DATA_DIR, else$XDG_STATE_HOME/product2prod, else$HOME/.local/state/product2prod, and once consent is given, the directory that was used is recorded in the config, which is what makes it removable by rule later. scripts/telemetry.shis the only writer of the log, the only writer of these config keys, and the only remover of either. You call it; you do not hand-roll arm, an edit, or a JSON write of your own. Two implementations of "remove the log" drift, and the one that drifts is the one that deletes something.
Every block below re-derives $PKG_ROOT on its own first line. Shell state does not survive
between tool calls, so a block that inherited it from an earlier one would run bash /scripts/...
and report a missing writer one line after another block proved it was there.
PKG_ROOT="${CLAUDE_PLUGIN_ROOT:-${PKG_ROOT:-}}"
[ -n "$PKG_ROOT" ] && [ -r "$PKG_ROOT/scripts/telemetry.sh" ] \
&& echo "root: $PKG_ROOT" \
|| { echo "STOP: set PKG_ROOT to this package's root directory, the one holding"; \
echo " .claude-plugin/plugin.json, then re-run."; \
echo " Recovery: a skills-only copy has no such root to point the package root at, so"; \
echo " move to install option 3, which runs from the whole package on disk."; }