/coding-productivity:setupfrom coding-productivity
Guides users through configuring coding-productivity by auto-detecting CLI tokens, selecting repositories, and writing the .coding-productivity.env configuration file.
Ships in coding-productivity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ask the user each question below using the platform's blocking question tool (e.g., AskUserQuestion in Claude Code, request_user_input in Codex). If no structured question tool is available, present each question as a numbered list and wait for a reply before proceeding. Never skip or auto-configure.
Read .coding-productivity.env in the current directory. If it exists, display current settings (mask tokens: show only last 4 chars) and ask:
Settings file already exists. What would you like to do?
1. Reconfigure - Run setup again from scratch
2. Modify a section - Change repos, storage, scoring, etc.
3. View current - Show the file contents, then stop
4. Cancel - Keep current settings
If "View current": read and display the file (mask tokens), then stop. If "Cancel": stop. If "Modify a section": jump to Re-run Flow below.
Auto-detect existing CLI authentication by running this via Bash:
gh auth token 2>/dev/null && echo "PLATFORM=github" || glab config get token 2>/dev/null && echo "PLATFORM=gitlab" || echo "NONE"
If a token is detected, ask:
Found existing CLI authentication ({platform}). How would you like to proceed?
1. Use detected token (Recommended) - No manual setup needed
2. Use a different platform or token - I'll provide one manually
If option 1: store the token and detected platform. Skip to Step 3.
If no token detected, or user chose option 2, ask:
Which Git platform do you use?
1. GitHub
2. GitLab
If GitLab, also ask for GitLab URL (for self-hosted instances).
Then ask the user to paste their API token. Validate it by running via Bash:
curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer TOKEN" https://api.github.com/user/repos?per_page=1curl -s -o /dev/null -w "%{http_code}" -H "PRIVATE-TOKEN: TOKEN" GITLAB_URL/api/v4/projects?membership=true&per_page=1A 200 means valid. On failure, explain:
repo scope. Create at: https://github.com/settings/tokensread_api scope.Retry until validation succeeds.
Fetch the full list of accessible repositories using the validated token:
curl -s -H "Authorization: Bearer TOKEN" "https://api.github.com/user/repos?per_page=100&type=all" — extract full_namecurl -s -H "PRIVATE-TOKEN: TOKEN" "GITLAB_URL/api/v4/projects?membership=true&per_page=100" — extract path_with_namespacePaginate if needed (follow Link headers).
Present as a multi-select:
Which repositories should be tracked? (comma-separated numbers, or "all")
0. Select all
1. org/repo-one
2. org/repo-two
...
Ask three quick questions:
a. Storage:
Storage backend?
1. DuckDB (Recommended) - Local file, zero cloud setup
2. BigQuery - Requires GCP project and service account
If BigQuery: ask for GCP Project ID, Dataset name, path to service account JSON.
b. Anonymization:
Anonymize developer identities?
1. Yes (Recommended) - Emails are hashed, real names stored separately
2. No - Emails stored as-is
If Yes: generate a key via Bash: python3 -c "import secrets; print(secrets.token_hex(32))"
c. AI Scoring:
Enable AI commit scoring? (uses Anthropic API, costs ~$0.001/commit)
1. No (default) - Raw metrics only
2. Yes - Score each commit's intellectual value with Claude Haiku
If Yes: ask for Anthropic API key, validate with curl. Then ask for the scoring model:
Which model should score commits?
1. claude-haiku-5-5 (Recommended) - Default. Low cost, medium effort
2. Another model ID - I'll provide one
Explain in one line: the scoring model is a measuring instrument. It is fixed in the config, never auto-selected, and changing it later means rescoring everything (/coding-productivity:calibrate, then /coding-productivity:rebase).
Write SCORING_EFFORT=medium and SCORING_MAX_TOKENS=16000 unless the user asks for other values (effort: low, medium, high, xhigh or max; ignored by claude-haiku-4* models, which take neither adaptive thinking nor effort).
Write .coding-productivity.env using the Write tool:
# coding-productivity configuration
# Created by /coding-productivity:setup
# NEVER commit this file to version control.
PLATFORM={platform}
GITHUB_TOKEN={github_token}
GITLAB_TOKEN={gitlab_token}
GITLAB_URL={gitlab_url}
GITLAB_CA_BUNDLE=
REPOS={repos_comma_separated}
STORAGE_BACKEND={storage_backend}
STORAGE_MODE=readwrite
DB_PATH=.coding-productivity/data.duckdb
GCP_PROJECT_ID={gcp_project_id}
BQ_DATASET={bq_dataset}
GOOGLE_APPLICATION_CREDENTIALS={google_creds_path}
SCORING_ENABLED={true_or_false}
ANTHROPIC_API_KEY={anthropic_key}
SCORING_MODEL={scoring_model_or_empty}
SCORING_EFFORT=medium
SCORING_MAX_TOKENS=16000
ANONYMIZATION_ENABLED={true_or_false}
PSEUDONYMIZATION_KEY={key_or_empty}
PSEUDONYMIZATION_KEY_FORMAT=text
EXCLUDED_DEVELOPERS=
BOT_OVERRIDES=
IDENTITY_MERGES=
IDENTITY_AUTO_MERGE=true
IDENTITY_NO_MERGE=
DATE_FIELD=committed_date
MIN_ACTIVE_COMMITS=1
Leave keys blank when not applicable. DATE_FIELD is committed_date (the date a commit reached the branch) unless the user wants to reproduce older figures, in which case write authored_date. Then run via Bash:
chmod 600 .coding-productivity.env
Add to .gitignore (create if needed):
.coding-productivity.env
.coding-productivity/
developer_mapping.json
Display summary (mask tokens) and warnings:
Saved to .coding-productivity.env
Platform: {platform}
Token: ****{last4} [validated]
Repositories: {count} selected
Storage: {backend}
Anonymization: {Enabled/Disabled}
AI Scoring: {Enabled/Disabled}
Scoring model: {scoring_model}
If anonymization enabled:
Back up your pseudonymization key. It is stored in
.coding-productivity.env(thePSEUDONYMIZATION_KEYfield). Losing it means existing hashes become permanently unresolvable. Copy this file to a safe location outside this project.
Display the path to the config file as a clickable reference.
Then:
Setup complete. What next?
1. Run /coding-productivity:extract - Start pulling commit data
2. Done for now
When the user chose "Modify a section" in Step 1:
Which section would you like to modify?
1. Platform & Token
2. Repositories
3. Storage Backend
4. Anonymization
5. AI Scoring
6. Done - exit
For each section, re-run the corresponding step from above. Important edge cases:
PSEUDONYMIZATION_KEY_FORMAT: text (default) or hex. Write hex only when the user is loading data hashed by another pipeline with a hex key decoded to bytes; it is locked with the key once data exists.count commits in storage). If commits > 0, display as locked: "Cannot change while data exists. Delete .coding-productivity/data.duckdb and re-extract to change."count commit_scores > 0), do not just rewrite SCORING_MODEL. Warn: "Changing the scoring model changes the score scale. Existing scores stay on the old model, and the plugin refuses to mix models in one series. Run /coding-productivity:calibrate to compare the models, then /coding-productivity:rebase to rescore everything." Only change the value if the user confirms, or if they are correcting it to the model that actually produced the existing scores.SCORING_MODEL: scoring now requires it. Ask which model produced the existing scores (the newest Haiku available when they were scored) and write that, not the newest model.After each modification, save config, show updated summary, and return to section selection.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub facens/coding-productivity --plugin coding-productivity12 skills in this plugin
/analyzecoding-productivity:analyzeRun interactive productivity analysis on extracted data. Use after extraction to view monthly trends, before/after comparisons, per-author metrics, merge velocity, and category breakdowns./calibratecoding-productivity:calibrateCompare a candidate scoring model with the current one before switching. Rescores a deterministic sample of already-scored commits with both, reports ratios and correlations per quarter, and says COMPARABLE or REBASE REQUIRED. Use when a newer Claude model is available or before changing SCORING_MODEL. Writes nothing to the score tables./Other plugins' skills for the same job