| name | chrono-team-health |
| description | Run a real GitHub-based team health / performance audit for the Chrono AI engineering team. Triggers on "team health", "团队健康", "全员审计", "全员绩效", "绩效审计", "check the team". Runs a fixed self-contained script via code_execute and returns a red/yellow/green report; posts it to Lark. |
| metadata | {"category":"plain","tag":["chrono","hr","team-health","audit","aevatar"]} |
| version | 1.7 |
当用户要 team-health / 全员审计 / 绩效审计:不要反问、不要解释概念。直接用 code_execute 工具把下面这段 Python 脚本原样执行,把脚本 stdout(报告全文)作为回复返回。脚本是自包含的,不需要任何外部数据源连接、不需要额外授权——它自己带凭证通过 HTTP 完成一切。
import urllib.request, urllib.parse, json, time, datetime
KEY = "nyx_b49ede38360217acd72c5bb0cc25420feac7023618cab5cecd6b24c17771c0b6"
BASE = "https://nyx-api.chrono-ai.fun/api/v1/proxy/s"
GH = "/" + "api-" + "github" + "-pat"
LARK = "/" + "api-" + "lark-" + "bot-2"
UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36"
CHAT = "oc_01369556f177b53af4d73507c10b3a9e"
H = {"Authorization": "Bearer " + KEY, "User-Agent": UA}
def get(url):
return urllib.request.urlopen(urllib.request.Request(url, headers=H), timeout=30)
date_hdr = get(BASE + GH + "/rate_limit").headers.get("Date")
today = datetime.datetime.strptime(date_hdr, "%a, %d %b %Y %H:%M:%S %Z").date()
since = (today - datetime.timedelta(days=30)).isoformat()
members = [("AbigailDeng","Abigail",0),("AlyciaBHZ","Alycia",0),("chronoai-shining","Shining",0),
("ctkm-aelf","Calvin",1),("dannick-aelf","Dannick",0),("eanzhao","Ean",0),("jason-aelf","Jason",0),
("jianwei-su","Stephan",0),("kaihuei0114","Kaihuei",0),("kaiweijw","Kaiwei",1),("louis4li","Louis",0),
("potter-sun","Potter",0),("wanghuan-520","Haylee",1),("YueZh127","Shaw",0),("aelf-hzz780","Richard",0)]
res = []
for login, disp, nyx in members:
cnt = None
for _ in range(3):
try:
q = urllib.parse.urlencode({"q": f"is:pr author:{login} merged:>={since}", "per_page": 1})
cnt = json.loads(get(f"{BASE}{GH}/search/issues?{q}").read()).get("total_count"); break
except Exception:
time.sleep(2.5)
res.append((disp, cnt, nyx)); time.sleep(1.3)
red, yellow, green = [], [], []
for disp, cnt, nyx in res:
if cnt is None: red.append(f"{disp} — 未取到(查询失败)")
elif cnt == 0: red.append(f"{disp} — 近30天合并PR 0" + ("(nyxid方向,重点)" if nyx else ""))
elif cnt < 10: yellow.append(f"{disp} — 近30天合并PR {cnt}" + ("(nyxid方向)" if nyx else ""))
else: green.append(f"{disp} — 近30天合并PR {cnt}")
lines = [f"📋 全员绩效审计 — {today}",
f"整体:🔴 {len(red)} 需介入 | 🟡 {len(yellow)} 需关注 | 🟢 {len(green)} 正常", ""]
if red: lines += ["🔴 需要立即介入"] + ["- " + x for x in red] + [""]
if yellow: lines += ["🟡 需要关注"] + ["- " + x for x in yellow] + [""]
if green: lines += ["🟢 高产稳定"] + ["- " + x for x in green] + [""]
lines += ["口径:近30天 merged PR | Powered by Chrono HR"]
report = "\n".join(lines)
try:
body = json.dumps({"receive_id": CHAT, "msg_type": "text",
"content": json.dumps({"text": report}, ensure_ascii=False)}).encode()
rq = urllib.request.Request(BASE + LARK + "/open-apis/im/v1/messages?receive_id_type=chat_id",
data=body, headers={**H, "Content-Type": "application/json"}, method="POST")
sent = "已发送Lark(code=%s)" % json.loads(urllib.request.urlopen(rq, timeout=30).read()).get("code")
except Exception as e:
sent = "Lark发送失败:" + str(e)[:80]
print(report); print("\n[" + sent + "]")
执行后把 print 出来的报告全文返回给用户。这个 skill 不依赖任何外部连接器,直接用 code_execute 跑即可。