← 返回 Skills 市场
imadentive

fadada-esign

作者 imadentive · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
130
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fadada-esign
功能描述
法大大电子合同与电子签署技能(FASC API 5.0)。一键发送合同给对方签署,支持查询签署状态、下载已签署合同。适用于HR合同、销售合同、协议签署等场景。当用户提到"发合同"、"让对方签合同"、"电子签"、"法大大"、"合同签署"、"查询签署状态"、"下载合同"等场景时触发。
使用说明 (SKILL.md)

法大大电子签 Skill(FASC API 5.0)

基于法大大 FASC API 5.0,提供一键式合同创建、发送、签署全流程解决方案。

✨ 核心特性

  • 一键发送 - 只需一行代码即可完成文件上传、任务创建、获取签署链接
  • 正确签名 - 严格按照官方文档实现 HMAC-SHA256 两步签名算法
  • 智能配置 - 支持环境变量、配置文件、代码传入多种配置方式
  • 命令行工具 - 提供 fadada CLI 工具,无需编写代码即可发送合同
  • 完整功能 - 支持发送、查询、下载全流程

🚀 快速开始

1. 安装

# 安装依赖
pip install requests

2. 配置凭证

方式一:环境变量

export FADADA_APP_ID="your_app_id"
export FADADA_APP_SECRET="your_app_secret"
export FADADA_OPEN_CORP_ID="your_open_corp_id"

方式二:配置文件

# 创建配置文件
mkdir -p ~/.fadada
cat > ~/.fadada/config.json \x3C\x3C EOF
{
  "app_id": "your_app_id",
  "app_secret": "your_app_secret",
  "open_corp_id": "your_open_corp_id"
}
EOF

方式三:代码中直接传入

from fadada_esign import FaDaDaClient, Signer

client = FaDaDaClient(
    app_id="your_app_id",
    app_secret="your_app_secret",
    open_corp_id="your_open_corp_id"
)

3. 发送合同(最简单的方式)

from fadada_esign import FaDaDaClient, Signer

# 创建客户端
client = FaDaDaClient(
    app_id="your_app_id",
    app_secret="your_app_secret",
    open_corp_id="your_open_corp_id"
)

# 一键发送合同
result = client.send_to_single_signer(
    file_path="/path/to/contract.pdf",
    signer_name="张三",
    signer_mobile="13800138000",
    task_subject="劳动合同签署"
)

print(f"签署链接: {result['sign_url']}")

4. 命令行发送

# 发送给单个签署人
fadada send contract.pdf --signer "张三:13800138000"

# 发送给多个签署人
fadada send contract.pdf --signer "张三:13800138000" --signer "李四:13900139000"

# 指定任务主题
fadada send contract.pdf --signer "张三:13800138000" --subject "销售合同"

📖 API 文档

客户端初始化

from fadada_esign import FaDaDaClient

# 正式环境
client = FaDaDaClient(
    app_id="your_app_id",
    app_secret="your_app_secret",
    open_corp_id="your_open_corp_id"
)

# 沙箱环境
client = FaDaDaClient(
    app_id="your_app_id",
    app_secret="your_app_secret",
    open_corp_id="your_open_corp_id",
    sandbox=True
)

一键发送文档

from fadada_esign import FaDaDaClient, Signer

client = FaDaDaClient(...)

# 方式1:发送给单个签署人(最简单)
result = client.send_to_single_signer(
    file_path="/path/to/contract.pdf",
    signer_name="张三",
    signer_mobile="13800138000"
)

# 方式2:发送给多个签署人
signers = [
    Signer(name="张三", mobile="13800138000", actor_id="signer1"),
    Signer(name="李四", mobile="13900139000", actor_id="signer2")
]

result = client.send_document(
    file_path="/path/to/contract.pdf",
    signers=signers,
    task_subject="多方合同"
)

# 返回结果
print(result)
# {
#     "sign_task_id": "1774590564587181726",
#     "sign_url": "https://fdd1.cn/dQFiT0SDcw1",
#     "task_subject": "多方合同",
#     "file_path": "/path/to/contract.pdf",
#     "signers": [...]
# }

分步操作

from fadada_esign import FaDaDaClient, Signer

client = FaDaDaClient(...)

# 1. 上传文件
file_id = client.upload_file("/path/to/contract.pdf")

# 2. 创建签署任务
signer = Signer(name="张三", mobile="13800138000")
sign_task_id = client.create_sign_task(
    task_subject="合同签署",
    file_id=file_id,
    signers=[signer]
)

# 3. 获取签署链接
sign_url = client.get_sign_url(sign_task_id)

查询签署状态

# 查询任务详情
detail = client.query_task_detail(sign_task_id)
print(detail)
# {
#     "signTaskId": "xxx",
#     "signTaskSubject": "合同签署",
#     "signTaskStatus": "sign_progress",
#     "actors": [...]
# }

下载已签署文档

# 获取下载链接
download_url = client.get_download_url(sign_task_id)
print(f"下载链接: {download_url}")

# 或者直接下载
import requests
response = requests.get(download_url)
with open("signed_contract.pdf", "wb") as f:
    f.write(response.content)

🔧 命令行工具

配置管理

# 交互式配置
fadada config setup

# 查看当前配置
fadada config show

发送合同

# 基础用法
fadada send contract.pdf --signer "张三:13800138000"

# 多个签署人
fadada send contract.pdf \
    --signer "张三:13800138000" \
    --signer "李四:13900139000" \
    --subject "合作协议"

# 保存结果到文件
fadada send contract.pdf \
    --signer "张三:13800138000" \
    --output result.json

查询状态

fadada status \x3Ctask_id>

下载合同

fadada download \x3Ctask_id> --output ./signed_contract.pdf

📋 签署任务状态

状态 说明
draft 创建中
submitting 提交中
fill_wait 等待填写
filled 填写完成
sign_progress 签署进行中
finished 已完成
cancelled 已撤销
expired 已过期

📝 签署人配置

from fadada_esign import Signer

# 基础配置
signer = Signer(
    name="张三",
    mobile="13800138000"
)

# 完整配置
signer = Signer(
    name="张三",
    mobile="13800138000",
    actor_id="signer1",
    actor_type="person",  # person 或 corp
    permissions=["sign"],
    notification={
        "sendNotification": True,
        "notifyWay": "mobile",
        "notifyAddress": "13800138000"
    },
    id_number="11010119900101xxxx",  # 可选
    email="[email protected]"  # 可选
)

⚙️ 配置优先级

配置加载优先级(从高到低):

  1. 代码中显式传入的参数
  2. 环境变量(FADADA_APP_ID, FADADA_APP_SECRET, FADADA_OPEN_CORP_ID
  3. 本地配置文件(.fadada.jsonfadada_config.json
  4. 全局配置文件(~/.fadada/config.json

🔐 安全注意事项

  • App Secret 不要硬编码在代码中,建议使用环境变量或配置文件
  • 配置文件权限建议设置为 600(仅所有者可读写)
  • 生产环境建议使用正式环境(sandbox=False)

🐛 错误处理

from fadada_esign import FaDaDaClient, Signer
from fadada_esign.exceptions import FaDaDaError, FaDaDaAuthError, FaDaDaAPIError

client = FaDaDaClient(...)

try:
    result = client.send_to_single_signer(...)
except FaDaDaAuthError as e:
    print(f"认证失败: {e}")
except FaDaDaAPIError as e:
    print(f"API 错误: {e.code} - {e}")
except FaDaDaError as e:
    print(f"操作失败: {e}")

📚 完整示例

#!/usr/bin/env python3
"""
法大大电子签 - 完整示例
"""

from fadada_esign import FaDaDaClient, Signer

def main():
    # 初始化客户端
    client = FaDaDaClient(
        app_id="your_app_id",
        app_secret="your_app_secret",
        open_corp_id="your_open_corp_id",
        sandbox=False  # 生产环境
    )
    
    # 创建签署人
    signers = [
        Signer(name="张三", mobile="13800138000", actor_id="signer1"),
        Signer(name="李四", mobile="13900139000", actor_id="signer2")
    ]
    
    # 发送合同
    result = client.send_document(
        file_path="./劳动合同.pdf",
        signers=signers,
        task_subject="2024年劳动合同"
    )
    
    print("=" * 50)
    print("✅ 合同发送成功!")
    print("=" * 50)
    print(f"任务 ID: {result['sign_task_id']}")
    print(f"签署链接: {result['sign_url']}")
    print()
    
    # 保存任务ID供后续查询
    task_id = result['sign_task_id']
    
    # 稍后查询状态
    # detail = client.query_task_detail(task_id)
    # print(f"当前状态: {detail['signTaskStatus']}")
    
    # 签署完成后下载
    # download_url = client.get_download_url(task_id)
    # print(f"下载链接: {download_url}")

if __name__ == "__main__":
    main()

📄 文件结构

fadada_esign/
├── __init__.py      # 包入口
├── client.py        # 核心客户端
├── signer.py        # 签署人模型
├── config.py        # 配置管理
├── cli.py           # 命令行工具
└── exceptions.py    # 异常类

🔗 相关链接

📄 License

MIT License

安全使用建议
This package mostly looks like an SDK for FaDaDa e-signature, but there are several red flags to check before installing or using it: - Credentials: SKILL.md and examples expect FADADA_APP_ID, FADADA_APP_SECRET, and FADADA_OPEN_CORP_ID. The registry metadata does NOT declare these — assume the code will need them. Only provide these secrets if you trust the code/repo and environment; prefer creating a dedicated FaDaDa app with limited scope. - Endpoints and signature algorithms: the files disagree about API base domains and signing algorithms (MD5 vs SHA256 vs HMAC-SHA256). Confirm with the official FaDaDa documentation which signing algorithm and endpoint to use; otherwise requests may fail or, worse, go to an unexpected server. - Default server_url: some code defaults to 'https://uat-dev.fadada.com/' (a non-standard/test-sounding host). Verify and explicitly set server_url to the official FaDaDa endpoints before uploading any real documents or sending credentials. - Source authenticity: the package metadata and code contain mismatched versions/names (e.g., _skillhub_meta.json version 2.0.0 vs registry version 1.0.0, multiple module names). If you plan to use this SDK, obtain it from the official FaDaDa repository or PyPI entry maintained by FaDaDa rather than an unknown source bundled here. - Local safety checks: inspect the code paths that upload files and where they point. Grep for server_url, upload endpoints, and any hardcoded URLs. Run in an isolated environment (sandbox/container) first and test with non-sensitive sample documents. - Dependencies: setup.py lists only requests, but some modules import pandas at top-level (fadada_client.py) which will fail unless pandas is installed; check requirements before running. - Least privilege: create FaDaDa test credentials for evaluation (not production app_secret), set config file permissions to 600 as recommended, and avoid hardcoding secrets in code. If you cannot verify the source or the endpoints, treat this skill as untrusted and prefer an official SDK or API integration from FaDaDa's official channels.
功能分析
Type: OpenClaw Skill Name: fadada-esign Version: 1.0.0 The bundle provides a comprehensive Python SDK and CLI for the FaDaDa (法大大) e-signature service (FASC API 5.0). The code implements standard API client logic, including HMAC-SHA256 signature generation, file uploads via the requests library, and configuration management using environment variables and local JSON files (e.g., ~/.fadada/config.json). The SKILL.md and README.md files provide clear, functional instructions for an AI agent to manage electronic contracts without any evidence of prompt injection or malicious intent. All network activity is directed to legitimate FaDaDa API endpoints (api.fadada.com), and no suspicious obfuscation or unauthorized data access was detected.
能力评估
Purpose & Capability
The skill claims to be a FaDaDa e-sign SDK (upload/send/query/download contracts) which matches the code and examples. However the registry metadata declares no required environment variables or primary credential while the SKILL.md and code explicitly require app credentials (FADADA_APP_ID, FADADA_APP_SECRET, FADADA_OPEN_CORP_ID) and access to a config file (~/.fadada). This mismatch between declared requirements and what the skill actually expects is concerning and could lead to silent failures or unexpected behavior.
Instruction Scope
SKILL.md instructions stay within the e-signature domain (set credentials, upload file, create tasks, query and download). However there are several inconsistencies inside the documentation/code: SKILL.md mentions HMAC-SHA256 signing, references/api_reference.md shows MD5-based signing in examples, and callback verification examples use SHA256 — these inconsistent signature descriptions across files could cause integration errors. The docs instruct creating config files in ~/.fadada and exporting secrets to env vars (expected), but the package files also import or reference multiple module names (fadada_api vs fadada_esign) and different default server URLs, which widens runtime behavior beyond the single, clear purpose.
Install Mechanism
There is no install spec in the registry (instruction-only), but the bundle includes a full Python SDK and packaging files (setup.py, many modules). This is not inherently malicious, but it's unusual: the package contains code that would be installed/ran by users even though the skill metadata contains no explicit install instructions. Confirm the intended install source (PyPI, GitHub, local) before running code.
Credentials
The skill requires application credentials for FaDaDa (app_id/app_secret/open_corp_id) according to SKILL.md and examples — that's appropriate for an e-sign SDK — but the registry metadata does not declare these required env vars or a primary credential. Also some code defaults to a non-standard server_url ('https://uat-dev.fadada.com/'), rather than clearly using the official domains listed in the API reference. The combination of undeclared required secrets and an unexpected default endpoint is disproportionate and increases risk of accidental credential exposure or misuse.
Persistence & Privilege
The skill does not request always:true and uses the platform defaults (user-invocable, model invocation enabled). It does not request system-level paths or attempt to modify other skills. No persistent privileged injection or global 'always' presence is requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fadada-esign
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fadada-esign 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
fadada-esign 1.0.0 - 初始发布,基于法大大 FASC API 5.0 实现电子合同一键发送、状态查询、下载等完整电子签流程 - 提供 Python SDK 和命令行工具,支持多种配置方式(环境变量、配置文件、代码参数) - 支持单人和多方签署,签署状态实时查询,合同文件安全下载 - 内置错误处理和丰富示例,适用于HR、销售及通用协议签署场景
元数据
Slug fadada-esign
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

fadada-esign 是什么?

法大大电子合同与电子签署技能(FASC API 5.0)。一键发送合同给对方签署,支持查询签署状态、下载已签署合同。适用于HR合同、销售合同、协议签署等场景。当用户提到"发合同"、"让对方签合同"、"电子签"、"法大大"、"合同签署"、"查询签署状态"、"下载合同"等场景时触发。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。

如何安装 fadada-esign?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fadada-esign」即可一键安装,无需额外配置。

fadada-esign 是免费的吗?

是的,fadada-esign 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

fadada-esign 支持哪些平台?

fadada-esign 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 fadada-esign?

由 imadentive(@imadentive)开发并维护,当前版本 v1.0.0。

💬 留言讨论