/coding-productivity:developersfrom coding-productivity
Manages developer identity data after extraction: detects bots, merges duplicate identities, and excludes developers from analysis.
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.
This skill provides an interactive workflow for cleaning up developer identity data after extraction. It detects bots, finds duplicate identities, and manages exclusions.
Important: Use AskUserQuestion for every interactive prompt. Never assume answers or skip steps.
The project root is the directory containing .coding-productivity.env. All paths below are relative to this root.
Run via Bash:
python3.14 -c "
import json, sys
from pathlib import Path
from scripts.lib.config import Config
from scripts.lib.storage import Storage
cfg = Config()
st = Storage(cfg)
# Check for data
commit_count = st.count('commits')
if commit_count == 0:
print('ERROR: No commit data found. Run /coding-productivity:extract first.')
sys.exit(1)
anon_enabled = cfg.ANONYMIZATION_ENABLED
mapping_path = Path('.coding-productivity/developer_mapping.json')
# Load reverse mapping if anonymization is enabled
mapping = {}
if anon_enabled:
if mapping_path.is_file():
mapping = json.loads(mapping_path.read_text())
else:
print('WARNING: MAPPING_MISSING')
print(json.dumps({
'anon_enabled': anon_enabled,
'mapping_missing': anon_enabled and not mapping_path.is_file(),
'commit_count': commit_count
}))
"
If the output contains MAPPING_MISSING, warn the user:
The developer mapping file (
.coding-productivity/developer_mapping.json) is missing. Without it, hashed identities cannot be resolved to real names. Would you like to re-extract data to regenerate it?
- Yes, I will run /coding-productivity:extract
- No, continue with hashed identities
If they choose to re-extract, exit the skill and tell them to run /coding-productivity:extract. If they continue, proceed but display hashes instead of names.
If commit_count is 0, tell the user to run /coding-productivity:extract first and exit.
Run via Bash to get unique developer identities with commit counts:
python3.14 -c "
import json
from pathlib import Path
from scripts.lib.config import Config
from scripts.lib.storage import Storage
cfg = Config()
st = Storage(cfg)
rows = st.query('''
SELECT author_email,
author_name,
COUNT(*) as commit_count
FROM commits
GROUP BY author_email, author_name
ORDER BY commit_count DESC
''')
# Load config lists for status
excluded = [e.lower() for e in cfg.EXCLUDED_DEVELOPERS]
bot_overrides = cfg.BOT_OVERRIDES
merges = cfg.IDENTITY_MERGES
# Load mapping for deanonymization
anon = cfg.ANONYMIZATION_ENABLED
mapping = {}
if anon:
mp = Path('.coding-productivity/developer_mapping.json')
if mp.is_file():
mapping = json.loads(mp.read_text())
print(json.dumps({
'developers': rows,
'excluded': excluded,
'bot_overrides': bot_overrides,
'merges': merges,
'mapping': mapping,
'anon_enabled': anon
}))
"
Using the data from Step 2, build a numbered table. For each developer:
author_email and author_name hash in the mapping to get the real name and email. If no mapping entry exists, display the hash as-is.EXCLUDED_DEVELOPERS: status = Excludedbots.BOT_NAMES, bots.BOT_EMAILS, or BOT_OVERRIDES): status = BotActiveDisplay the roster as:
=== Developer Roster (N developers, M total commits) ===
# Name Email(s) Status Commits
1 Jane Smith [email protected], [email protected] Active 482
2 dependabot[bot] [email protected] Bot 201
3 John Doe [email protected] Excluded 156
...
Ask via AskUserQuestion:
What would you like to do?
- Review bots — detect and confirm bot accounts
- Find duplicates — detect and merge duplicate identities
- Exclude developer — remove a developer from analysis
- Include developer — re-include a previously excluded developer
- Import aliases — load an existing alias table (CSV) into the identity merges
- Done — exit developer management
Run bot detection via Bash:
python3.14 -c "
import json
from pathlib import Path
from scripts.lib.config import Config
from scripts.lib.storage import Storage
from scripts.lib.bots import detect_bots, load_overrides
cfg = Config()
st = Storage(cfg)
load_overrides(cfg.BOT_OVERRIDES)
rows = st.query('''
SELECT DISTINCT author_name as name, author_email as email
FROM commits
''')
# Resolve hashes if anonymized
anon = cfg.ANONYMIZATION_ENABLED
mapping = {}
if anon:
mp = Path('.coding-productivity/developer_mapping.json')
if mp.is_file():
mapping = json.loads(mp.read_text())
resolved = []
for r in rows:
info = mapping.get(r['email'], mapping.get(r['name'], {}))
resolved.append({
'name': info.get('name', r['name']),
'email': info.get('email', r['email']),
'hash_name': r['name'],
'hash_email': r['email']
})
rows = resolved
detected = detect_bots(rows)
print(json.dumps(detected))
"
Display the detected bots in a numbered list. For each detected bot, ask the user via AskUserQuestion:
Detected bot: {name} ({email}) Confirm as bot? (y/n/done)
- y — Confirm: add to
BOT_OVERRIDESin config- n — Override: this is a real developer, skip it
- done — Stop reviewing, keep remaining as-is
For each confirmed bot, add the name to BOT_OVERRIDES via Bash:
python3.14 -c "
from scripts.lib.config import Config
cfg = Config()
existing = cfg.BOT_OVERRIDES
existing.append('BOT_NAME_HERE')
cfg.update('BOT_OVERRIDES', ','.join(existing))
print('Added to BOT_OVERRIDES')
"
After review is complete, return to Step 2 to refresh and redisplay the roster, then show the action menu again.
analyze.py already joins identities on its own (IDENTITY_AUTO_MERGE, on by default): two emails used with one author name, or one email used with two names, count as one person in every developer count and table, without touching stored data. This action covers the rest (same email local-part, normalized names) and the permanent, retroactive merge. Tell the user that analyze prints the automatic merges it applied, and that a wrong one is undone by answering "different people" below, which records the pair in IDENTITY_NO_MERGE.
Run duplicate detection via Bash:
python3.14 -c "
import json
from pathlib import Path
from scripts.lib.config import Config
from scripts.lib.storage import Storage
from scripts.lib.dedup import find_duplicates
cfg = Config()
st = Storage(cfg)
rows = st.query('''
SELECT author_name as name,
author_email as email,
COUNT(*) as commit_count
FROM commits
GROUP BY author_name, author_email
''')
# Resolve hashes if anonymized
anon = cfg.ANONYMIZATION_ENABLED
mapping = {}
if anon:
mp = Path('.coding-productivity/developer_mapping.json')
if mp.is_file():
mapping = json.loads(mp.read_text())
resolved = []
for r in rows:
info = mapping.get(r['email'], mapping.get(r['name'], {}))
resolved.append({
'name': info.get('name', r['name']),
'email': info.get('email', r['email']),
'commit_count': r['commit_count'],
'hash_email': r['email']
})
rows = resolved
dupes = find_duplicates(rows)
print(json.dumps([(a, b, reason) for a, b, reason in dupes]))
"
If no duplicates found, inform the user and return to the action menu.
If duplicates are found, display each pair:
Duplicate pair #1 (reason: exact_name_match):
A: Jane Smith <[email protected]> (142 commits)
B: Jane Smith <[email protected]> (38 commits)
For each pair, ask via AskUserQuestion:
Merge these identities?
- Yes, keep A as canonical ({email_a})
- Yes, keep B as canonical ({email_b})
- No, these are different people
- Done reviewing duplicates
For each confirmed merge, run via Bash:
python3.14 -c "
from pathlib import Path
from scripts.lib.config import Config
from scripts.lib.storage import Storage
from scripts.lib.dedup import merge_identities, apply_retroactive_merges
cfg = Config()
st = Storage(cfg)
canonical_email = 'CANONICAL_EMAIL'
alias_emails = ['ALIAS_EMAIL']
merge_identities(canonical_email, alias_emails, cfg)
if cfg.ANONYMIZATION_ENABLED and cfg.PSEUDONYMIZATION_KEY:
key = cfg.PSEUDONYMIZATION_KEY # bytes, decoded per PSEUDONYMIZATION_KEY_FORMAT
mapping_path = Path('.coding-productivity/developer_mapping.json')
affected = apply_retroactive_merges(st, mapping_path, key, {'ALIAS_EMAIL': 'CANONICAL_EMAIL'})
print(f'Retroactive merge applied: {affected} rows updated')
else:
print('Merge registered (no retroactive hash rewrite needed — anonymization disabled)')
"
For each pair the user answers "No, these are different people", append it to IDENTITY_NO_MERGE (comma-separated email1:email2 pairs, real emails, not hashes) so the automatic merge never joins them:
python3.14 -c "
from scripts.lib.config import Config
cfg = Config()
pairs = [f'{a}:{b}' for a, b in cfg.IDENTITY_NO_MERGE]
pair = 'EMAIL_A:EMAIL_B'
if pair not in pairs:
pairs.append(pair)
cfg.update('IDENTITY_NO_MERGE', ','.join(pairs))
print('Recorded: analyze will not join these two emails.')
"
After all pairs are reviewed, return to Step 2 to refresh and redisplay the roster, then show the action menu again.
Display the current roster (Active developers only) as a numbered list. Ask via AskUserQuestion:
Which developer should be excluded from analysis? (enter number)
After selection, add the developer's email to EXCLUDED_DEVELOPERS via Bash:
python3.14 -c "
from scripts.lib.config import Config
cfg = Config()
existing = cfg.EXCLUDED_DEVELOPERS
existing.append('DEVELOPER_EMAIL_HERE')
cfg.update('EXCLUDED_DEVELOPERS', ','.join(existing))
print('Developer excluded')
"
Use the hashed email if anonymization is enabled, or the real email if not.
After the change, return to Step 2 to refresh and redisplay the roster, then show the action menu again.
Run via Bash to get the current excluded list:
python3.14 -c "
import json
from scripts.lib.config import Config
cfg = Config()
print(json.dumps(cfg.EXCLUDED_DEVELOPERS))
"
If the excluded list is empty, inform the user and return to the action menu.
Otherwise, display the excluded developers as a numbered list (resolve hashes to names via the mapping if anonymization is enabled). Ask via AskUserQuestion:
Which developer should be re-included? (enter number)
After selection, remove the email from EXCLUDED_DEVELOPERS via Bash:
python3.14 -c "
from scripts.lib.config import Config
cfg = Config()
excluded = cfg.EXCLUDED_DEVELOPERS
excluded.remove('DEVELOPER_EMAIL_HERE')
cfg.update('EXCLUDED_DEVELOPERS', ','.join(excluded))
print('Developer re-included')
"
After the change, return to Step 2 to refresh and redisplay the roster, then show the action menu again.
For a user who already has a table of aliases (original_email,canonical_email, one pair per row) from an earlier pipeline. Ask for the CSV path, then run a dry run via Bash:
python3.14 scripts/import_aliases.py --config .coding-productivity.env --csv PATH_TO_CSV --dry-run
It reports how many pairs it would add, how many are already in IDENTITY_MERGES or have the same address on both sides (skipped), and which CSV lines it refuses: an empty value, a value containing , or : (they would split IDENTITY_MERGES, a comma-separated list of alias:canonical pairs), or an alias already merged into a different address (the first mapping stays). It prints line numbers, not emails. Show the counts, ask the user to confirm, then run it again without --dry-run. Valid pairs are always written; the exit code is 1 when any pair was refused, so tell the user to fix those rows and run it again (pairs already imported are skipped the second time).
analyze applies IDENTITY_MERGES at analysis time and does not touch stored data. With anonymization on, offer Action 2's retroactive rewrite only if the user wants the stored hashes changed too. Then return to Step 2 and show the menu again.
Display a summary of changes made during this session (how many bots confirmed, identities merged, developers excluded/included). Then exit.
All changes are persisted to .coding-productivity.env via config.update(). The keys modified by this skill are:
BOT_OVERRIDES — comma-separated list of confirmed bot namesIDENTITY_MERGES — comma-separated alias:canonical email pairsIDENTITY_NO_MERGE — comma-separated email1:email2 pairs the automatic merge must never joinIDENTITY_AUTO_MERGE — true (default) or false; set by hand, switches the automatic merge in analyze offEXCLUDED_DEVELOPERS — comma-separated list of excluded developer emailsNo manual file editing is needed. The config.update() method handles atomic writes.
What SKILL.md sets; muted values are Claude Code's defaults
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./connectcoding-productivity:connectConnect to an existing BigQuery dataset for read-only analysis. Use when you have access to a pre-populated dataset and want to explore results without running extraction./dedupecoding-productivity:dedupeDetect duplicate work in the extracted commits (merge commits, squash and promotion commits, cherry-picked copies, moved code) so analysis stops counting it twice. Run after extraction and scoring, and again whenever new commits arrive. Rebuilds the duplicate_commits and file_moved_share tables./extractcoding-productivity:extractExtract commits, diffs, and merge/pull requests from configured GitHub or GitLab repositories. Use after setup to populate the local database, or re-run to fetch new data./rebasecoding-productivity:rebaseRescore ALL commits with the configured SCORING_MODEL into a new versioned scoring series using the Message Batches API, then switch the active series. Use after calibrate says REBASE REQUIRED, or whenever the scoring model or prompt changes. Old tables stay untouched.Other plugins' skills for the same job