getaero-io/gtm-eng-skills / engineering/warm-intro-scoring
warm-intro-scoring
Verifiedscripts/render.py
View on GitHub"""Render scored-path CSV as a standalone private review artifact (stdlib only)."""
import argparse
import csv
import json
import math
import os
from pathlib import Path
from score import FIELDS
def render(rows):
clean=[]
seen=set()
for row in rows:
if not all(row.get(k) for k in ('campaign_id','owner_id','connector_id','target_id','path_id')):
raise ValueError('Stable path identities required')
if row['path_id'] in seen:
raise ValueError('Duplicate path ID')
seen.add(row['path_id'])
for k in ('total_score','direct_intro_score','work_overlap_score','relationship_score','school_city_community_score','role_industry_score','investor_score'):
if not math.isfinite(float(row[k])) or float(row[k]) < 0:
raise ValueError('Scores must be finite and nonnegative')
clean.append({k:row.get(k,'') for k in FIELDS})
template=(Path(__file__).parent.parent/'assets/review.html').read_text()
# Escape HTML parser delimiters inside JSON, not just JavaScript quotes.
payload=json.dumps(clean,ensure_ascii=True).replace('<','\\u003c').replace('>','\\u003e').replace('&','\\u0026')
return template.replace('__PATH_DATA__',payload)
if __name__=='__main__':
p=argparse.ArgumentParser(description=__doc__);p.add_argument('input',type=Path);p.add_argument('--output',required=True,type=Path)
a=p.parse_args()
with a.input.open(newline='') as f: output=render(list(csv.DictReader(f)))
with os.fdopen(os.open(a.output,os.O_WRONLY|os.O_CREAT|os.O_EXCL,0o600),'w') as f:f.write(output)
print(f'Private local artifact: {a.output.resolve()}')
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |