Communitygithub.com

主协议生成器

从一个模板加一份JSON规范生成对手方主协议的审阅草稿,支持按角色选择条款,并提供仅限于已签署协议的附录A工作流。

主协议生成器 是什么?

主协议生成器是一个面向法律和商业文档自动化的AI agent技能,特别适用于框架协议(如保密协议、转介费协议、主服务协议等)的批量生成。它采用单一Markdown模板配合每对手方一个JSON规范文件的方式,通过构建脚本填充占位符、渲染角色特定条款和附录A表格,最终输出带有强制“草稿”标记的Markdown和/或DOCX文件。该技能支持买家、供应商、互惠三种角色,各自对应不同的费用和条款结构;附录A工作流则基于已签署协议的授权来添加新的交易机会。设计强调可复现性、可审查性和来源控制——所有文档由版本化模板和规范生成,避免手工编辑,并拒绝不安全的文件名和无效的日程数据。输出始终标记为草稿,不构成法律完备性、签约授权或发送/签署的许可;签名页几何结构和签署字段放置需配合专门的esign-field-placement技能。支持平台包括Claude Code、Cursor、Codex等可执行node.js脚本的AI agent环境。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/master-agreement-generator

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

主协议生成器 是做什么的?

一个主模板、每个对手方一份小规范、一次构建步骤。 生成器始终将输出标记为草稿,包括从已完成模板生成的文档。成功的转换证明的是文档生成能力,而非法律完备性、签约授权或发送/签署的许可。已签署的协议可能允许通过通知添加指定机会;在使用附录A工作流之前,必须确定该授权已确立。

何时使用

  • 您向众多对手方发布框架协议(保密协议、转介或采购费、非规避、主服务协议),条款相同,仅少数对手方特定字段不同。
  • 交易随时间增加,为每笔交易重新起草成为瓶颈。
  • 文档必须可从受追踪的源代码复现、可差异对比,且无手工编辑。
  • 签名字段由自动化放置,需要稳定的页面布局。

工作原理

模板

单个Markdown模板,包含{{PLACEHOLDER}}字段。每个对手方特定的值是一个占位符;其他所有内容均为固定文本。示例骨架位于references/master-template.example.md。将其中的通用句子替换为您法务批准的条款。

参考脚本填充的占位符:

占位符来源
{{DATE}}spec.date,默认今天
{{CP_SHORT}}spec.short
{{CP_LEGAL}}、{{CP_JURIS}}、{{CP_ADDR}}规范字段,若对手方在签署时填写则为空行
{{ROLE_CLAUSE}}、{{FEE_TITLE}}、{{FEE_CLAUSE}}由spec.role从角色表中选择
{{SCHEDULE_ROWS}}spec.schedule,或一个“签署时无条目”行
{{SUPPLEMENT_CLAUSE}}spec.supplement,带尾部分隔符或空值渲染
{{CP_SIGBLOCK}}、{{CP_SIGNER}}、{{CP_TITLE}}、{{CP_EMAIL}}签名块字段,未知时为空白

规范

每个对手方一个JSON文件:

{
  "file": "AcmeSupplier",
  "short": "Acme",
  "role": "supplier",
  "legal": "Acme Compute Ltd",
  "juris": "England and Wales company",
  "addr": "1 Example Street, London",
  "signer": "A. Person",
  "title": "Director",
  "email": "[email protected]",
  "schedule": [["1", "2026-09-01", "Lot A (16 nodes)", "introducer", "12 months", "standard"]],
  "supplement": "the Data Processing Addendum dated 2026-09-01"
}

仅file、short和role是草稿必需的。缺失的签名字段渲染为空行供审查和完成。参见references/spec.example.json。

file必须是一个非空的便携式文件名,例如AcmeSupplier或Acme Supplier,不包含目录组件。构建器拒绝任何路径分隔符、驱动器/UNC语法、控制字符、Windows保留标点或设备名称,以及尾部点或空格。无效名称在不进行清理或重命名的情况下被拒绝,在创建输出或调用pandoc之前。

省略schedule或使用[]表示“签署时无条目”占位符。提供的日程必须是一个由六元素数组组成的紧凑数组,顺序为:编号、日期、受保护的对手方或批次、角色、条款、费用。每个单元格必须是一个有效的Unicode字符串或有限数字;允许空字符串表示有意空白。空值、布尔值、对象、嵌套单元格数组、缺失单元格和非有限数字在写入任何构件或pandoc活动之前会连同行/单元格索引一起被拒绝。未配对的UTF-16代理项也会被拒绝,而不是在UTF-8输出期间替换;有效的补充字符(如emoji)仍然受支持。

单元格是纯文本,而非Markdown或HTML。构建器对语法字符进行编码,使得字面意义的管道符、反斜杠、反引号和标记保留在其原始字段中。每个CRLF、单独的CR或LF变为一个空格;换行符周围的文本得以保留。其他空格和字面标点符号在渲染的单元格中保持不变。源规范不被修改。一个普通有效的日程保留其六列;格式错误的输入永远不会被静默替换为空日程。

角色表

spec.role选择三个字符串:常设安排条款、费用章节标题和费用条款开场白。

角色谁付款条款形式
买家对手方就与被介绍方的交易付款对手方以非排他性基础委托我们寻找和介绍
供应商对手方就与被介绍方的交易付款;当我们作为主体采购时,按日程条款签约对手方向我们及我们介绍的买家提供容量
互惠谁与对方的介绍成交谁付款任何一方均可介绍;成交方付款

未知角色在构建时被拒绝。

构建

仅使用经操作人员审阅的模板和规范。附录A之外的普通模板替换支持标记,而不是针对不受信任文档的消毒器。Pandoc可以读取引用的本地或远程资源;此生成器不沙箱转换器的文件系统或网络访问。请审阅这些引用并在您自己适当受限的环境中运行转换。聚焦测试使用合成转换器,不认证真实的DOCX布局或隔离。

node skills/master-agreement-generator/scripts/build-agreement.js \
  skills/master-agreement-generator/references/master-template.example.md \
  specs/AcmeSupplier.json \
  out/

该脚本填充占位符、渲染日程表,并写入out/<file> MASTER.md,附带强制的草稿通知。默认情况下(或使用--require-docx),它需要已安装的pandoc来生成非空的常规.docx构件。pandoc缺失、转换失败或输出缺失/为空返回退出码1。每次pandoc探测或转换限定十秒。未知、重复或冲突的标志返回退出码2。

显式使用--markdown-only进行仅Markdown的成功草稿。此模式从不探测或调用pandoc,从库返回docxSkipped: true,并且不为电子签名工作流提供DOCX。库调用者必须传递{ markdownOnly: true };单独传递{ pandoc: false }现在会使DOCX要求失败。结果始终报告documentStatus: 'draft'。在重新构建其Markdown时,现有生成的DOCX会被移除,失败的转换不会留下部分DOCX,因此较早的构件不能冒充为当前输出。将两个生成的文件排除在版本控制之外;模板和规范是源代码。

没有执行副本模式。示例故意包含未解决的括号起草指令;填充{{PLACEHOLDER}}标记并不完成那些法律条款。在准备执行文件之前,请单独审阅已完成的条款、当事方详情、授权签署人、商业条款和确切的文档版本。将草稿和经审阅的执行副本作为不同的记录保存。即使是成功的DOCX转换也不授权上传、发送或签名。请参阅esign-field-placement审批工作流。

两个输出目标必须是已解析输出目录的直接子项。任一目标处的现有符号链接(包括悬空链接)在写入任一构件之前被拒绝,即使DOCX转换被禁用。普通常规文件可以重新构建。使用您控制的输出目录;这些检查不提供针对并发恶意文件系统更改的隔离。返回的构件路径是绝对路径。

签名页几何结构

模板在正文末尾添加一个OpenXML分页符,以便签名块在兼容的DOCX渲染器中请求新页面:

```{=openxml}
<w:p><w:r><w:br w:type="page"/></w:r></w:p>
```

签名页结构(我们的块,然后是对手方块,每个都包含By、Name、Title、Email、Date)是一致的,但分页可能因文本、字体、渲染器或格式而改变。在放置字段之前检查实际审阅的文档及其页面几何结构;请参阅esign-field-placement技能。

附录A追加工作流

使用已签署协议的实际授权和通知要求:

  1. 在内部协商/审批渠道中审阅机会经济性和谈判策略。在发送合同内容之前获得承诺批准。共享的对手方渠道不是内部渠道。
  2. 确认提议的条目、角色、条款、费用和生效日期在协议明确的附录A通知授权范围内。对常设条款的更改,或超出该授权的变更,需要适用的修订程序;通知不能自行创建例外。
  3. 为已签署协议授权的收件人和通知渠道起草一份经批准、针对对手方的日期通知。包含有用的业务内容:受保护的对手方或批次、授权角色、商业条款和适用费用。排除内部利润、谈判策略、其他当事方的经济性、系统追踪、原始错误和内部归档通知。
  4. 在发送之前,将确切的通知归档以供操作人员审批;请参阅operator-approval-loop。在缺少审批或参与授权时,在对手方渠道中保持沉默。审批与授权发送者实际送达通知的证据是分开的。
  5. 根据已签署协议的实际要求记录授权的送达证据、生效日期和任何异议。示例期限并非默认值。保持已签署文件不可变;更新受追踪的日程记录,并重新构建一份草稿汇总视图供内部审阅,附带对已签署版本和已批准通知的引用。此重新构建不替换已签署协议或证明法律效力。

示例

通知文本

仅为说明性草稿:仅在已签署协议授权且操作人员批准该确切收件人通知时使用这些术语和日期。

附表A通知,2026-09-02
协议:我们与Acme之间于2026-08-14签署的主协议
条目2:批次B,8节点,区域EU-West
角色:介绍人
条款:6个月期限,不晚于2026-10-01开始
费用:标准
本条目自今日起生效,除非您在十个工作日内提出反对,并提供与对手方存在先前关系的日期书面证据。

将条目添加到规范中

"schedule": [
  ["1", "2026-08-20", "Lot A (16 nodes)", "introducer", "12 months", "standard"],
  ["2", "2026-09-02", "Lot B (8 nodes, EU-West)", "introducer", "6 months", "standard"]
]

重新构建,差异对比草稿Markdown,并将汇总草稿附加到内部记录中,连同未更改的已签署文档和通知证据。

对手方在签署时填写自己的详细信息

对于起草,从规范中省略legal、juris、addr、signer、title、email以渲染空行。一个单独审阅的执行工作流必须决定哪些详细信息可以由对手方完成,并验证实际字段;生成器不创建或批准电子签名信封。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能