skills/auth-manager/SKILL.md
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
npx skillsauth add aaaaqwq/agi-super-skills auth-managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
基于 fast-browser-use (fbu),使用
--user-data-dir保存完整 Chrome profile(cookies + localStorage + IndexedDB)。
fbu 二进制在 ~/.cargo/bin/,每次执行前必须设置:
export PATH="$HOME/.cargo/bin:$PATH"
export CHROME_PATH=/usr/bin/google-chrome
export DISPLAY=:1 # 桌面显示,headless false 时必须
定期对 auth-platforms.json 中所有 enabled: true 平台执行 snapshot 检查:
# 必须用 timeout 包裹,防止 Chrome 残留
timeout --kill-after=5 60 fast-browser-use snapshot \
--url "<check_url>" \
--user-data-dir ~/.openclaw/chrome-profiles/<platform> || true
pkill -f "chrome.*--remote-debugging" 2>/dev/null || true
判定逻辑:
logged_in_indicators 关键词 → ✅ activelogin_page_indicators 关键词 → ❌ expireduncertainerrorCloudflare 站点(如 linux.do)headless 模式会被拦截,需加 --headless false:
timeout --kill-after=5 90 fast-browser-use snapshot \
--url "https://linux.do" \
--user-data-dir ~/.openclaw/chrome-profiles/linuxdo \
--headless false || true
pkill -f "chrome.*--remote-debugging" 2>/dev/null || true
结果写入 ~/.openclaw/auth-session-state.json,过期/异常时推送告警。
当用户使用 fbu 授权新平台时,执行以下完整流程:
mkdir -p ~/.openclaw/chrome-profiles/<platform>
fast-browser-use login \
--url "https://platform.com/login" \
--headless false \
--user-data-dir ~/.openclaw/chrome-profiles/<platform> \
--save-session ~/.openclaw/chrome-profiles/<platform>-session.json
关键参数说明:
--headless false— 必须,在桌面打开可视 Chrome 窗口--save-session— 必填参数(fbu login 要求),即使主要靠 user-data-dir 保存状态--user-data-dir— 保存完整 Chrome profile- 浏览器打开后终端显示 "Press Enter after you have logged in..."
- 用户登录完成后,agent 向进程写入换行符(Enter)触发保存
# 使用 process write 向 fbu 进程发送 Enter
process.write(sessionId, "\n")
fast-browser-use snapshot \
--url "<check_url>" \
--user-data-dir ~/.openclaw/chrome-profiles/<platform>
检查 DOM 输出是否包含登录态关键词(用户名、余额、dashboard 等)。
将新平台添加到 auth-platforms.json,包括 check_url、login_url、indicators 等。
写入 auth-session-state.json。
~/.openclaw/chrome-profiles/<platform>/ # fbu Chrome profile(完整状态)
~/.openclaw/auth-platforms.json # 平台配置
~/.openclaw/auth-session-state.json # 检查结果状态
~/.openclaw/auth-platforms.json:
{
"platforms": {
"platform_id": {
"name": "显示名称",
"profile_dir": "~/.openclaw/chrome-profiles/platform_id",
"check_url": "https://example.com/dashboard",
"login_url": "https://example.com/login",
"logged_in_indicators": ["关键词1", "关键词2"],
"login_page_indicators": ["登录", "Sign in"],
"enabled": true,
"credentials": {
"username": "[email protected]",
"password": "xxx"
},
"login_method": "github_oauth"
}
}
}
github_oauth、qrcode、password),帮助 agent 判断是否能自动登录遍历所有 enabled 平台,用 grep 匹配关键词快速判定:
# 批量检查示例(用 grep 匹配关键词)
for platform in polymarket aixn xingjiabiapi github douyin xiaohongshu linuxdo; do
echo "=== $platform ==="
fast-browser-use snapshot \
--url "$(jq -r ".platforms.$platform.check_url" ~/.openclaw/auth-platforms.json)" \
--user-data-dir ~/.openclaw/chrome-profiles/$platform 2>&1 \
| grep -E "关键词" | head -5
done
| 平台 | 登录方式 | Headless | 备注 | |------|----------|----------|------| | Polymarket | 钱包/OAuth | ✅ | 检查"资产组合"关键词 | | AIXN (XAPI) | 账密 | ✅ | 有 credentials,可自动登录 | | 性价比API | GitHub OAuth | ✅ | 需先有 GitHub 登录态 | | GitHub | 账密 | ✅ | 检查 Settings 页面 | | 抖音创作者 | 扫码 | ✅ | 必须用户手动扫码 | | 小红书创作者 | 扫码/短信 | ⚠️ 优先可见桌面浏览器 | 创作者后台常落短信登录;主站二维码可能被风控 | | Linux Do | 账密/OAuth | ❌ 需 headless false | Cloudflare 拦截 headless | | X (Twitter) | 账密 | ✅ | 可能有验证码 |
优先策略不是新起 hidden/CDP 浏览器,而是宿主机可见 Chrome + 既有会话复用。
defaultProfile: "user" + driver: "existing-session" + attachOnly: true不要把 18800 当成默认真相。
18800 只是一个可选 CDP profile(如 openclaw)existing-session 语义,而不是再额外起一个干净浏览器小红书 creator 登录页可能只显示短信登录。
error_code=300012 / IP 风险)推荐 SOP(更新版,二维码优先):
二维码优先规则(硬约束):
300012),再进入降级路径调试判定顺序:
~/.openclaw/auth-session-state.json:
{
"platforms": {
"polymarket": {
"status": "active",
"message": "登录正常 ✅ (发现: 资产组合 $6.02)",
"checkedAt": 1740000000
}
},
"lastCheck": 1740000000
}
status 值: active | expired | uncertain | error
已配置定期自动检查(cron id: 1f2eb5a5-5c2e-4556-b006-e29325f41609),过期则推送告警。
--url、--headless、--user-data-dir、--save-session 四个缺一不可--user-data-dir 会锁定 profile,同一 profile 不能被多个 Chrome 实例同时使用--headless false,但 snapshot 的 --headless 参数需要显式传 falsetesting
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
development
Monitor and report on API provider quotas, balances, and usage. Query official providers (Moonshot, DeepSeek, xAI, Google AI Studio) and relay/proxy providers (Xingjiabiapi, Aixn, WoW) via their billing APIs. Also checks subscription services (Brave Search, OpenRouter). Generates quota reports. Triggers on "查额度", "API余额", "quota check", "billing report", "api balance", "供应商额度", "中转站余额", "费用报告", "check balance", "how much credit".
development
# A股基金监控 Skill A股基金净值监控,支持实时估值和盘后净值,自动判断交易日/节假日。 ## 用法 ### 快速监控(命令行) ```bash # 默认配置,输出到控制台 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh # 推送到群(使用--push参数) bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --push # 监控指定基金 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --codes "000979 002943" ``` ### Agent调用 ``` 执行A股基金监控任务。 1. 读取配置文件: ~/clawd/skills/a-fund-monitor/config.json 2. 获取实时净值数据 3. 非交易日自动切换为简短报告 配置文件格式: { "funds": [ {"code": "000979", "name": "景顺长城沪港深精选股票
development
Use when the user asks to "optimize for AI", "get cited by ChatGPT", "AI optimization", "appear in AI answers", "GEO optimization", "get cited by AI", "show up in ChatGPT answers", "AI does not mention my brand", or "make content AI-quotable". Optimizes content for Generative Engine Optimization (GEO) to increase chances of being cited by AI systems like ChatGPT, Claude, Perplexity, and Google AI Overviews. Makes content AI-friendly while maintaining SEO value. For SEO-focused writing, see seo-content-writer. For entity and brand presence, see entity-optimizer.