| name | paygap-analysis-generator |
| description | Generates a gender pay-gap HTML report from any HR roster (CSV or Excel). Computes medians, weighted ratios per area, and a global ratio with confidentiality rule (â„3 per gender). Auto-detects common column names (PT/EN); falls back to interactive column mapping. Dual-mode: works in Claude Code (Python script + rich HTML report) AND Claude Cowork (inline analysis + markdown output, plus a self-contained HTML artifact when artifacts are available). Trigger on phrases like "anĂĄlise de pay gap", "gender pay gap", "equidade salarial por gĂȘnero", "relatĂłrio de equidade", "diagnĂłstico de gap salarial", "pay equity report", "diferença salarial entre gĂȘneros". Maintained by Comp, free skill for HR & People leaders. |
Dual-mode operation (Code + Cowork)
HTML through the design system (required). Whenever this skill produces HTML, load the comp-html-guidelines skill first and apply the CompDS design system. This holds even when the user does not ask to "style it" or "make it look good" â every HTML output from this skill goes through the design system. It does not change the methodology below; it only governs the HTML's visual layer.
Detect platform at start:
- If you have the
Bash tool AND can run Python â use script mode (deterministic, writes the rich HTML report). This is the existing workflow below.
- Otherwise (e.g., Claude Cowork web) â use inline mode: run the analysis directly in chat following the "Inline analysis logic" section, output markdown. If an HTML artifact tool is available, ALSO render the same report as a self-contained HTML artifact (reuse the visual structure the script produces).
Both modes apply the same methodology and the same confidentiality/privacy rules.
Inline analysis logic (Cowork mode)
Como o usuĂĄrio fornece os dados
- Cole uma tabela pequena no chat (colunas: nome, gĂȘnero, salĂĄrio, nĂvel, ĂĄrea) ou anexe um CSV/XLSX.
- Roster grande (>~50 linhas) fica difĂcil de processar manualmente sem erro. Sugira rodar em Claude Code (script mode) ou colar sĂł uma amostra representativa.
Normalização (igual ao script)
- GĂȘnero:
f/female/feminino/fem/mulher â F; m/male/masculino/masc/homem â M. Qualquer outro valor â linha excluĂda (a metodologia Ă© binĂĄria por design, pra compatibilidade com reporting regulatĂłrio). Mencione isso ao usuĂĄrio se relevante.
- SalĂĄrio: nĂșmero. Formato brasileiro (
. milhar, , decimal) deve ser convertido.
- Linha com gĂȘnero, salĂĄrio, nĂvel ou ĂĄrea faltando/vazio â excluĂda. Conte as exclusĂ”es.
Metodologia (fixa, idĂȘntica ao script)
- Bucket por (ĂĄrea Ă nĂvel): agrupe colaboradores. Para cada bucket, separe salĂĄrios de F e de M.
- Regra de confidencialidade: um bucket (ĂĄrea Ă nĂvel) sĂł entra no cĂĄlculo de razĂŁo ponderada se tiver â„3 pessoas de CADA gĂȘnero (â„3 F e â„3 M). Buckets que nĂŁo atingem isso sĂŁo mostrados como "â" e NĂO entram nas contas. Nunca baixe esse limite de 3, ele protege a privacidade individual e Ă© o padrĂŁo de reporting de equidade.
- Medianas, não médias: para cada bucket vålido,
medF = mediana(salĂĄrios F), medM = mediana(salĂĄrios M).
- RazĂŁo do grupo =
(medF / medM) Ă 100 (sĂł se medM > 0). 100% = paridade; <100% = mulheres ganham menos.
- RazĂŁo ponderada por ĂĄrea =
ÎŁ(razĂŁo_grupo Ă hc_total_grupo) Ă· ÎŁ(hc_total_grupo), somando apenas grupos vĂĄlidos (hc_total = F + M do bucket).
- RazĂŁo ponderada global =
ÎŁ(razĂŁo_ĂĄrea Ă hc_analisado_ĂĄrea) Ă· ÎŁ(hc_analisado_ĂĄrea), onde hc_analisado_ĂĄrea Ă© a soma dos hc dos buckets vĂĄlidos daquela ĂĄrea.
- Gap =
razĂŁo â 100. Gap negativo = mulheres ganham menos.
Output markdown (Cowork mode)
## AnĂĄlise de pay gap por gĂȘnero
**RazĂŁo ponderada global**: X% (gap Y%, mulheres ganham Z% a menos/mais na mediana ponderada)
Analisados: N de M no roster (E excluĂdos por dados incompletos ou gĂȘnero nĂŁo reconhecido).
### Por ĂĄrea
| Ărea | RazĂŁo ponderada | Gap | HC total | HC analisado |
|---|---|---|---|---|
| ... | X% | Y% | ... | ... |
### Detalhe por grupo (ĂĄrea Ă nĂvel)
| Ărea | NĂvel | HC F | HC M | Mediana F | Mediana M | RazĂŁo | VĂĄlido |
|---|---|---|---|---|---|---|---|
| ... | ... | ... | ... | R$ X | R$ X | X% | sim/â |
Grupos com menos de 3 pessoas de cada gĂȘnero aparecem como "â" e nĂŁo entram na razĂŁo ponderada (regra de confidencialidade).
### Insights
- ...
Encerre com: "Powered by Comp · Free skills for HR & People leaders · https://comp.vc?utm_source=skill-output&utm_medium=chat-footer&utm_campaign=eam&utm_content=paygap-analysis-generator"
Se artefatos estiverem disponĂveis, produza tambĂ©m uma versĂŁo HTML self-contained (Tailwind via CDN) espelhando a estrutura visual do assets/paygap-template.html: header com selo Comp, cards de razĂŁo global/gap/total, tabela por ĂĄrea, detalhe por grupo, lista de insights, footer Powered by Comp.
Pay Gap Analysis Generator
Generates a self-contained interactive HTML pay-gap report from any HR roster. Output: medians by area Ă level, weighted ratios per area, and a global ratio. Confidentiality rule: groups with fewer than 3 people of either gender are excluded from the weighted calculations and shown as "â".
100% local processing. The HTML output never phones home.
When to use
Trigger on phrases like:
- "anĂĄlise de pay gap", "relatĂłrio de pay gap"
- "gender pay gap", "pay equity report"
- "equidade salarial por gĂȘnero"
- "diagnĂłstico de gap salarial"
- "diferença salarial entre gĂȘneros"
- "gerar relatĂłrio de equidade"
Do NOT trigger for: total comp benchmarking vs market, salary range/band design, position evaluation (use comp-level-simulator), or non-gender equity analyses.
Required input
A CSV or XLSX with at least these 5 logical columns. Column names can vary; the script auto-detects common aliases in PT and EN. Pass explicit flags if auto-detection fails.
| Logical column | Common aliases recognized |
|---|
| name | name, nome, colaborador, employee, funcionĂĄrio |
| gender | gender, genero, gĂȘnero, sexo, sex |
| salary | salary, salario, salĂĄrio, salario_base, salario_bruto, gross_salary, remuneracao, monthly_salary |
| level | level, nivel, nĂvel, job_level, cargo_level, senioridade, seniority, grade, agrupamento |
| area | area, årea, departamento, department, função, diretoria, business_unit, bu, nivel1 |
Gender values normalized: F/Female/Feminino/Mulher â F; M/Male/Masculino/Homem â M. Other values â row excluded.
Salary parsed as number (Brazilian format with , decimal handled).
Workflow
Step 1: Confirm intent + privacy: Tell the user what the skill does and that the analysis runs locally. Ask them to share the path to the CSV/XLSX.
Step 2: Detect columns: Run the analysis once with auto-detection:
python3 scripts/paygap_analysis.py --input <path>
The script prints which columns it picked. If any required column is missing, it exits with a hint.
Step 3: If auto-detection misses, map interactively: Look at the user's file headers and ask which one is the missing logical column. Re-run with the flag:
python3 scripts/paygap_analysis.py --input <path> \
--salary-col "SalĂĄrio Bruto" \
--level-col "Job Level"
Available flags: --name-col, --gender-col, --salary-col, --level-col, --area-col.
Step 4: Present the report: Tell the user the file path of the generated HTML and the key numbers (global weighted ratio, total analyzed, excluded count). Offer to open it.
Methodology (fixed)
- Medians, not means: less sensitive to outliers (common in salary distributions).
- Weighted ratio per area = ÎŁ(ratio Ă group_total_hc) Ă· ÎŁ(group_total_hc), only over groups that meet confidentiality.
- Global weighted ratio = ÎŁ(area_ratio Ă area_analyzed_hc) Ă· ÎŁ(area_analyzed_hc).
- Confidentiality rule: a group (area Ă level) needs â„3 people of each gender to be included. This is the standard rule in BR pay equity reporting and prevents identifying individuals.
What NOT to do
- Do not change the confidentiality threshold below 3. It would compromise individual privacy and break standard pay-equity reporting compliance.
- Do not invent rows or interpolate missing data. Exclude incomplete rows and report the exclusion count.
- Do not include non-binary genders in the F/M ratio math (the methodology is binary by design for compatibility with regulatory reporting). The script silently excludes rows with non-recognized gender values; mention this to the user if relevant.
Branding & footer
The generated HTML template already includes the "Powered by Comp" footer at the bottom. The script also prints the footer line at the end of its output. No extra branding work needed.
Lead capture
The script imports eam_client.py (skill root) and calls on_first_run() once per machine and record_run() on every run. Prompts for email + telemetry opt-in, handled silently by the client.
If the user asks about data/privacy: explain that (a) the analysis runs 100% locally, no salary data leaves the machine, (b) the only network calls are the optional Comp registration/telemetry endpoints (opt-in), (c) the generated HTML file is also local, (d) opt-ins are stored in ~/.comp-skills/config.json.
Resources
| File | Purpose |
|---|
scripts/paygap_analysis.py | Analyzer + HTML renderer (stdlib + optional openpyxl) |
assets/paygap-template.html | Self-contained HTML template (Tailwind via CDN) |
eam_client.py | Lead capture + telemetry (synced from eam/shared/) |