← Back to Skills Marketplace
rayleethu

Cosmetics Advisor: Pengleni

by RayLee · GitHub ↗ · v0.0.3 · MIT-0
cross-platform ⚠ suspicious
77
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cosmetics-advisor-pengleni
Description
Use when users need Pengleni beauty assistant capabilities via SMS login/session APIs, including AI virtual try-on, makeup analysis, style transfer, product...
README (SKILL.md)

SKILL: Pengleni Login Session HTML Bridge

0. Quick Checklist For Agent

在真正发请求前,先逐项确认:

  1. CLAWHUB_SKILL_TOKEN 已配置。
  2. 用户已提供合法手机号。
  3. 如果要发消息,已拿到 user_idsession_id
  4. 默认设置 stream=true
  5. 用户输入包含 HTML 时,先做安全过滤。

1. Skill Purpose

当用户需要调用 Pengleni 美妆智能体能力时使用本 Skill:通过手机号验证码完成登录建会话,并基于 HTML 消息承载能力完成 AI 试妆、妆容分析、妆容迁移、商品推荐与美妆知识问答。

适用意图关键词:

  • 验证码登录
  • 创建会话
  • HTML 消息问答
  • 多轮会话延续
  • AI 试妆
  • 妆容分析
  • 妆容迁移
  • 商品推荐
  • 美妆知识问答

2. Runtime Config

Agent 在调用前必须确认以下环境变量:

SITE_BASE_URL=https://www.zhibianai.com
API_BASE_URL=https://www.zhibianai.com/api/v1/clawhub
CLAWHUB_SKILL_TOKEN=your_service_token

默认请求头:

Authorization: Bearer ${CLAWHUB_SKILL_TOKEN}
Content-Type: application/json

3. Python 文件说明

3.1 send_code_client.py

  • 作用:发送短信验证码,请求站点级验证码接口。
  • 关键函数:send_code(phone)
  • 输入:phone(11 位手机号)。
  • 输出:接口返回的 JSON 字典;失败时由 error 字段表达。
  • 典型调用命令示例:
python send_code_client.py --phone 13800138000
python send_code_client.py --env .env --phone 13800138000

3.2 login_client.py

  • 作用:使用手机号 + 验证码登录并创建/复用会话。
  • 关键函数:login(phone, verify_code, session_id="")
  • 输入:phoneverify_code、可选 session_id
  • 输出:登录响应 JSON;成功时包含 user_idsession_id,并落盘到 .session.json
  • 典型调用命令示例:
python login_client.py --phone 13800138000 --verify-code 123456
python login_client.py --env .env --phone 13800138000 --verify-code 123456 --session-id sess_old_xxx
python login_client.py --phone 13800138000 --verify-code 123456 --session-file .session.json

3.3 chat_client.py

  • 作用:向会话发送消息并支持多轮交互。
  • 关键函数:send_message(...)run_multi_turn(...)
  • 输入:user_idsession_id、文本内容(内部转为 html_payload)。
  • 输出:消息接口响应 JSON;优先展示 answer_text
  • 典型调用命令示例:
python chat_client.py --text "你好,帮我推荐一个通勤淡妆"
python chat_client.py --multi-turn
python chat_client.py --stream --trace-id debug-trace-001 --text "帮我优化底妆步骤"
python chat_client.py --user-id user_xxx --session-id sess_xxx --text "继续上次话题"

3.4 client_common.py

  • 作用:封装环境变量加载、HTTP POST、会话文件读写、错误判断等通用能力。
  • 关键函数:load_env_filerequire_envpost_jsonload_sessionsave_session
  • 输入:.env 路径、请求 URL/载荷、会话文件路径等。
  • 输出:标准化 JSON 字典与本地会话文件内容。
  • 典型调用命令示例:
# client_common.py 主要作为工具模块被其他脚本导入,不直接单独运行。
python send_code_client.py --phone 13800138000
python login_client.py --phone 13800138000 --verify-code 123456
python chat_client.py --multi-turn

4. Agent Execution Flow

按以下顺序执行,除非用户明确要求跳过某一步:

  1. 调用验证码接口发送验证码。
  2. 收集用户验证码后调用登录接口。
  3. 从登录响应读取 user_idsession_id
  4. 调用消息接口发送 html_payload
  5. 优先返回 answer_text,若用户需要富文本则返回 answer_html

5. Agent Behavior Rules

  • 如果用户未提供 session_id,允许服务端创建。
  • 如果登录后返回新 session_id,后续请求必须使用新值。
  • 默认流式:Agent 默认 stream=true
  • 发生 401 时,优先提示重新登录,不要盲目重试消息接口。
  • 发生 429504 时,最多重试 2 次,退避 500ms。

6. Security Constraints

  • 输入 HTML 需要白名单策略。
  • 禁止 scriptstyleiframeobjectembedforminput 标签。
  • 应校验 user_idsession_id 的绑定关系。

7. Minimal Error Handling Template

当接口失败时,Agent 返回格式建议:

调用阶段: \x3Csend_code|login|message>
HTTP状态: \x3Cstatus_code>
错误原因: \x3Cmapped_reason>
建议动作: \x3Cretry|relogin|check_input>
Usage Guidance
This skill's code does what its description says (send SMS code, log in with phone+code, and post HTML messages to an external API), but the registry metadata omitted the required environment variables (API_BASE_URL, SITE_BASE_URL, CLAWHUB_SKILL_TOKEN). Before installing, verify the external domain (https://www.zhibianai.com) and the skill author: do you trust that service to receive phone numbers and session tokens? Treat the CLAWHUB_SKILL_TOKEN as sensitive — it will be sent as a Bearer token to the API. Also note the skill will read a local .env (which may contain other secrets) and write .session.json locally. If you need higher assurance, ask the publisher for source/origin/homepage or require the skill to declare required env vars and a verified homepage before use.
Capability Analysis
Type: OpenClaw Skill Name: cosmetics-advisor-pengleni Version: 0.0.3 The skill bundle is a legitimate integration for the Pengleni beauty assistant service (zhibianai.com). It implements a standard SMS-based authentication flow and message exchange using Python's built-in libraries (urllib, json). The code includes proper HTML escaping in chat_client.py and follows the stated purpose of providing AI beauty advice without any evidence of data exfiltration, malicious execution, or obfuscation.
Capability Assessment
Purpose & Capability
The scripts implement SMS code sending, phone+code login, session persistence, and HTML-based chat — all consistent with a Pengleni-style beauty assistant. However, the registry metadata declares no required environment variables or credentials while the SKILL.md and code require SITE_BASE_URL, API_BASE_URL, and CLAWHUB_SKILL_TOKEN. That omission is an inconsistency the user should notice.
Instruction Scope
SKILL.md and the Python code stay within their stated scope: send SMS, perform login, create/use sessions, convert text to escaped HTML, and post to the configured service endpoints. They read/write a local .env and .session.json and do not attempt to access unrelated system paths or other credentials in the codebase.
Install Mechanism
There is no install spec and no network download/install step in the manifest. The skill is instruction-heavy with local Python scripts — low install risk. Running the scripts will execute network calls to external service endpoints (expected for this skill).
Credentials
Although the registry lists no required env vars, both SKILL.md and all client code call require_env('API_BASE_URL') and require_env('CLAWHUB_SKILL_TOKEN') and also expect SITE_BASE_URL for the SMS endpoint. The code will also load a local .env file (if present) and write .session.json. Asking for a bearer token and base URLs is reasonable for this integration, but the registry's omission and the presence of an unknown external domain are red flags.
Persistence & Privilege
The skill does persist session info to .session.json and may read .env; this is expected for a session-based client. It does not request always:true, does not modify other skills, nor claim elevated system privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cosmetics-advisor-pengleni
  3. After installation, invoke the skill by name or use /cosmetics-advisor-pengleni
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.0.3
- Added detailed agent checklist and runtime environment requirements. - Documented Python client scripts for SMS login, session management, and HTML chat, with typical usage and function descriptions. - Outlined full agent workflow from SMS verification to beauty assistant Q&A, including error handling and security constraints. - Introduced HTML white-listing rules and session binding checks for secure message handling. - Provided standardized error message format for improved robustness and clarity.
Metadata
Slug cosmetics-advisor-pengleni
Version 0.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Cosmetics Advisor: Pengleni?

Use when users need Pengleni beauty assistant capabilities via SMS login/session APIs, including AI virtual try-on, makeup analysis, style transfer, product... It is an AI Agent Skill for Claude Code / OpenClaw, with 77 downloads so far.

How do I install Cosmetics Advisor: Pengleni?

Run "/install cosmetics-advisor-pengleni" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Cosmetics Advisor: Pengleni free?

Yes, Cosmetics Advisor: Pengleni is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Cosmetics Advisor: Pengleni support?

Cosmetics Advisor: Pengleni is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Cosmetics Advisor: Pengleni?

It is built and maintained by RayLee (@rayleethu); the current version is v0.0.3.

💬 Comments