staff-mapping-management
БесплатноБез исполняемых скриптовНе проверенManage staff-institution mapping table for vehicle insurance platform. Use when updating mapping files, resolving name conflicts, converting Excel to JSON, or…
от FDU-INS★ 84 звезды на GitHubОб этом скилле
Staff Mapping Management
Manage business staff-to-institution mapping table, handle conflicts, and track versions.
When to Activate
Use this skill when the user:
- Says "update the mapping table" or "refresh mapping"
- Mentions "staff conflicts", "name conflicts", or "duplicate names"
- Asks "convert mapping Excel to JSON"
- Wants to "check mapping coverage" or "find unmapped staff"
- Needs to "resolve institution assignment conflicts"
Quick Start Workflow
Step 1: Convert Excel → JSON
↓
Step 2: Validate & Detect Conflicts
↓
Step 3: Update System Mapping
↓
Step 4: Verify Coverage
Step 1: Convert Mapping Excel to JSON
1.1 Expected Excel Structure
File: 业务员机构团队对照表YYYYMMDD.xlsx
| Column | Field | Example |
|---|---|---|
| A | 序号 | 1, 2, 3... |
| B | 三级机构 | 达州, 德阳 |
| C | 四级机构 | 达州, 德阳 |
| D | 团队简称 | 达州业务三部 |
| E | 业务员 | 200049147向轩颉 |
1.2 Conversion Script
import pandas as pd
import json
def convert_mapping_excel_to_json(excel_path, json_path):
"""Convert staff mapping Excel → JSON"""
# Load Excel
df = pd.read_excel(excel_path)
# Validate columns
required = ['业务员', '三级机构', '四级机构', '团队简称']
missing = [c for c in required if c not in df.columns]
if missing:
raise ValueError(f"Missing columns: {missing}")
# Build mapping dict
mapping = {}
for _, row in df.iterrows():
staff_key = str(row['业务员'])
mapping[staff_key] = {
'三级机构': str(row['三级机构']),
'四级机构': str(row['四级机构']),
'团队简称': str(row['团队简称']) if pd.notna(row['团队简称']) else None
}
# Save JSON
with open(json_path, 'w', encoding='utf-8') as f:
json.dump(mapping, f, ensure_ascii=False, indent=2)
print(f"✅ Converted {len(mapping)} records")
return mapping
Step 2: Validate & Detect Conflicts
2.1 Conflict Types
| Conflict Type | Description | Example |
|---|---|---|
| Name Conflict | Same name, different institutions | 张三 → 达州 vs 张三 → 德阳 |
| Missing Info | Staff without institution | 李四 → null |
| Duplicate Key | Same staff ID appears twice | 200012345 appears 2x |
2.2 Conflict Detection
def detect_conflicts(mapping):
"""Find name conflicts and data issues"""
import re
# Extract names from "工号+姓名" format
name_to_records = {}
for staff_key, info in mapping.items():
match = re.search(r'[\u4e00-\u9fa5]+', staff_key)
if not match:
continue
name = match.group()
if name not in name_to_records:
name_to_records[name] = []
name_to_records[name].append({
'key': staff_key,
'institution': info['三级机构'],
'team': info['团队简称']
})
# Find conflicts (same name, different institution)
conflicts = []
for name, records in name_to_records.items():
if len(records) > 1:
institutions = set(r['institution'] for r in records)
if len(institutions) > 1:
conflicts.append({
'name': name,
'records': records,
'type': 'name_conflict'
})
return conflicts
2.3 Missing Data Detection
def detect_missing_data(mapping):
"""Find records with missing institution"""
missing = []
for staff_key, info in mapping.items():
if not info.get('三级机构') or info['三级机构'] == 'nan':
missing.append({
'key': staff_key,
'issue': 'missing_institution'
})
return missing
Step 3: Update System Mapping
3.1 Backup Current Version
from datetime import datetime
import shutil
def backup_mapping(current_path):
"""Backup current mapping before update"""
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
backup_path = f'业务员机构团队归属_backup_{timestamp}.json'
shutil.copy(current_path, backup_path)
print(f"✅ Backed up to {backup_path}")
return backup_path
3.2 Apply Update
def update_mapping(new_mapping_path):
"""Update system mapping file"""
# 1. Backup current
current_path = '业务员机构团队归属.json'
backup_mapping(current_path)
# 2. Load new mapping
with open(new_mapping_path, 'r', encoding='utf-8') as f:
new_mapping = json.load(f)
# 3. Validate
conflicts = detect_conflicts(new_mapping)
missing = detect_missing_data(new_mapping)
# 4. Report issues
if conflicts:
print(f"⚠️ Found {len(conflicts)} name conflicts:")
for c in conflicts[:5]:
print(f" - {c['name']}: {len(c['records'])} records")
if missing:
print(f"⚠️ Found {len(missing)} records with missing institution")
# 5. Copy to system location
shutil.copy(new_mapping_path, current_path)
print(f"✅ Updated system mapping: {len(new_mapping)} records")
return {'conflicts': conflic
Установить staff-mapping-management в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditGrepGlobFAQ
Что делает скилл staff-mapping-management?
Manage staff-institution mapping table for vehicle insurance platform. Use when updating mapping files, resolving name conflicts, converting Excel to JSON, or checking mapping coverage. Mentions "update mapping", "staff conflicts", "mapping table", or "institution assignment".
Как установить скилл staff-mapping-management?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл staff-mapping-management запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic