social-sbti
Social-SBTI — Scrapes public posts from Jike / X to generate spoof SBTI personality profile cards. Guided workflow: User trigger → Select platform → Paste URL → Auto health check/credential config/scraping/scoring/rendering → Output card. Trigger scenarios: - User says "run social-sbti" / "start social-sbti" - User says "help me analyze @someone's SBTI" - User says "analyze @someone with social-sbti" - User says "make a social SBTI personality card for XXX"
1How It Works & Mechanism
First locates the skill root directory, after which all commands are executed via the unified bin/sbti entry point.
如果输出为空,告诉用户 skill 安装位置非标准,让他们给你路径,然后手工 `export SBTI_HOME=<路径>`。
Structures SKILL.md into a conversational script spanning Phases 0–8, strictly enforcing sequential execution without skipping steps.
严格按阶段顺序执行,**不要跳步**。
Runs a health check before starting scraping; scraping is prohibited if the check fails.
**不要骗自己**:体检没过就不要进抓取,不然就是浪费时间。
Jike credentials use interactive QR scanning: runs jike-auth in the background and echoes the QR code directly into the chat.
把 stderr 里的 QR 原样贴到对话里让用户用手机 App 扫。
X credentials export auth_token and ct0 from the browser, saving them to ~/.config/sbti/x_cookies.json.
**成功**: cookies 已落到 `~/.config/sbti/x_cookies.json`。回阶段 3 重跑 doctor。
The scraping phase writes posts to sbti-output/<name>_raw.json in the user's project root.
这会把数据写到 `./sbti-output/<name>_raw.json`(用户项目根下)。
The host agent serves as the scoring LLM, scoring each dimension against the rubric's L/M/H anchors.
3. **读 rubric**: `Read` 工具读 `$SBTI_HOME/docs/SCORING_RUBRIC.md`。对照每个维度的 L/M/H 锚点打分。
Scoring carries hard constraints: each dimension must cite at least 1 real post_id, and confidence below 0.4 forces a fallback to M.
- 每维至少引 1 条真实 `post_id`(必须来自 raw.json,不要编)
finalize executes the end-to-end match→HTML→PNG pipeline to complete personality matching and rendering.
1. `match.py` → 匹配 27 人格模板,写回 scores.json 补上 `pattern` + `personality`
Upfront compliance: directly refuses to analyze private individuals during the target confirmation phase, operating only within permitted boundaries.
遇到上述请求时,skill 会**直接拒绝**并说明原因。
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| package | jike-skill[qr](GitHub git URL 安装) |
| package | twikit>=2.0.0 |
| package | playwright>=1.40.0 |
| network | X / Twitter |
| network | esm.sh(产物期卡片保存按钮 CDN) |
4Recommended Governance & Evidence
- 本地凭据 / 浏览器配置: Reads user login cookies/session/keyring: Reads Jike tokens (~/.config/sbti/config.json / jike-tokens.json)
- scripts/: Executes local script or command: bin/sbti (Python CLI shim, forwarded to src/cli.py)
- scripts/ 或 SKILL.md: Declares dynamic installation of external language package dependencies
- 网络端点: Declares external network access: Scrapes Jike posts (web.okjike.com)
- 本地工作目录: File I/O and artifact output: ~/.config/sbti/config.json (chmod 600)
5Second-Pass Verification
- [ok] 流程阶段完整性 — SKILL.md 阶段 0–8 与 README『这个 skill 做什么』流程一致。
- [ok] 依赖来源 — requirements.txt 三个包与 doctor.py 的 pip 安装点一致;jike-skill 走 git URL(PyPI 无此包)。
- [ok] 凭证路径与权限 — README 与 src/config.py 均指向 ~/.config/sbti/,并声明 chmod 600。
- [ok] 抓取端点 — fetch_x.py 用 twikit、twikit_patch 指向 abs.twimg.com;fetch_jike 走即刻端点。
- [ok] 反检测检查 — §3『危險旗標/防護繞過』无命中;twikit_patch 是前端结构适配而非绕过风控。
- [ok] 打分硬约束 — SCORING_RUBRIC 的硬约束与 SKILL.md 阶段 6 一致(证据必填、confidence<0.4 回退 M)。
- [ok] 合规拒绝逻辑 — DISCLAIMER『不允许的用法』与 SKILL.md 阶段 2 的拒绝分支一致。
- [ok] 档位复核 — 读凭据 + 远程包 → orange;无绕过/降级 → 不判红。
6Verdict & Scenarios
4319620f4435f0cc…