Communitygithub.com

主協議生成器

從一個模板和一份 JSON 規範生成交易對手主協議的審閱草稿,包含按角色選擇的條款和僅限於已簽署協議的附表 A 工作流程。

主協議生成器 是什麼?

本技能提供一個自動化工具,用於從單一 Markdown 模板和每個交易對手的 JSON 規範生成主協議(如 NDA、主服務協議)的草稿。它透過佔位符替換、角色選擇條款(買方、供應商、相互)和嚴格的驗證,確保文件的可重複性與可比較性。此技能支援 Markdown 和 DOCX 輸出(需 Pandoc),並強制在文件頭部標示「DRAFT」以免誤用。其核心功能包括安全的文件名驗證、健全的 Schedule A 表格生成,以及用於在簽署後新增條目的「Schedule A 附錄工作流程」,該流程要求依據已執行協議的實際授權進行操作。本工具專為法律與商業運營團隊設計,旨在加速合約流程,同時將法律審查與批准工作流分離。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

主協議生成器 是做什麼的?

一個主模板、每個交易對手一份小型規範、一個草稿建構步驟。 生成器始終將輸出標示為 DRAFT,包括從已完成模板產生的文件。成功的轉換僅證明文件生成,不代表法律完整性、簽約授權或已準備好發送或簽署。已執行的協議可能允許透過書面通知添加指定機會;在使用 Schedule A 工作流程前,必須先建立該授權。

何時使用

  • 您向許多交易對手發布一份框架協議(NDA、轉介或採購費用、非規避、主服務協議),條款相同,僅少數交易對手特定欄位不同。
  • 隨著時間推移新增交易,且每次重新起草成為瓶頸。
  • 文件必須可從追蹤的來源重現、可比較且無手動編輯。
  • 簽名欄位由自動化放置且需要穩定的頁面佈局。

運作方式

模板

一個帶有 {{PLACEHOLDER}} 欄位的單一 Markdown 模板。每個交易對手特定的值都是一個佔位符;其他所有內容均為固定文字。範例骨架位於 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 或使用 [] 表示「簽署時無條目」佔位符。提供的 schedule 必須是六個儲存格陣列的密集陣列,順序為:編號、日期、受保護的交易對手或批次、角色、條款、費用。每個儲存格必須是有效的 Unicode 字串或有限數字;允許為空字串以表示有意留空。Null、布林值、物件、巢狀儲存格陣列、缺少儲存格和非有限數字將在寫入任何文件或 pandoc 活動之前,以行/儲存格索引被拒絕。未配對的 UTF-16 代理對也會在 UTF-8 輸出期間被拒絕,而非替換;有效的補充字元(如表情符號)仍受支援。

儲存格為純文字,而非 Markdown 或 HTML。建構器會對語法字元進行編碼,以使字面管線符、反斜線、反引號和標記保留在其原始欄位中。每個 CRLF、裸 CR 或 LF 都會變成空格;換行前後的文字會保留。其他空白字元和字面標點符號會在渲染後的儲存格中保留。來源規範不會被修改。一個普通有效的 schedule 會保留其六欄;格式錯誤的輸入絕不會被靜默替換為空的 schedule。

角色表格

spec.role 選取三個字串:長期安排條款、費用部分標題和費用條款開場白。

角色誰付費條款形式
buyer交易對手支付與被介紹方的交易費用交易對手以非獨家基礎任命我們來尋找和介紹
supplier交易對手支付與被介紹方的交易費用;當我們以本人身份購買時,我們按 schedule 條款簽約交易對手向我們以及我們介紹的買家提供產能
mutual關閉交易的一方(由對方介紹)支付費用任一方均可介紹;關閉交易方支付

未知角色將在建構時被拒絕。

建構

僅使用經運營者審查的模板和規範。Schedule 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/

腳本會填入佔位符、渲染 schedule 表格,並寫入 out/<file> MASTER.md,其中包含強制性的 DRAFT 通知。預設情況下(或使用 --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 轉換也不授權上傳、發送或簽署。請參閱電子簽名欄位放置審批工作流程。

兩個輸出目標必須是已解析輸出目錄的直接子項。任一目標處的現有符號連結(包括失效連結)會在寫入任一文件之前被拒絕,即使 DOCX 轉換已禁用。普通的常規檔案可以重建。使用您控制的輸出目錄;這些檢查不提供針對並發惡意檔案系統變更的隔離性。返回的文件路徑是絕對路徑。

簽名頁面幾何

模板以 OpenXML 分頁符號結束內文,以便簽名區塊在相容的 DOCX 渲染器中請求新頁面:

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

簽名頁面結構(我方區塊,接著交易對手區塊,每個區塊包含 By、Name、Title、Email、Date)是一致的,但分頁可能因文字、字型、渲染器或格式而改變。在放置欄位之前,請檢查實際審閱後的文件及其頁面幾何;請參閱電子簽名欄位放置技能。

Schedule A 附錄工作流程

使用已執行協議的實際授權和通知要求:

  1. 在內部談判/批准頻道中審閱機會經濟性和談判策略。在發送合約內容之前獲得承諾批准。共用交易對手頻道不是內部頻道。
  2. 確認提議的條目、角色、條款、費用和生效日期在協議明示的 Schedule A 通知授權範圍內。對長期條款的變更或超出該授權的變更,需要適用的修訂程序;通知不能自行創設例外。
  3. 為已執行協議授權的接收者和通知頻道起草一份經批准的、針對特定交易對手的日期通知。包含有用的商業內容:受保護的交易對手或批次、授權角色、商業條款和適用費用。排除內部利潤率、談判策略、其他方的經濟利益、系統追蹤、原始錯誤和內部歸檔通知。
  4. 在發送前,將準確的通知提交運營者批准;請參閱運營者批准循環。在缺乏批准或參與授權時,保持交易對手頻道靜默。批准不同於授權發送者實際送達通知的證據。
  5. 根據已執行協議的實際要求,記錄授權送達證據、生效日期和任何異議。範例期限並非預設值。保持已執行文件不變;更新追蹤的 schedule 記錄,並重建一份草稿整合檢視供內部審閱,其中引用已執行版本和經批准的通知。此重建不會取代簽署的協議或證明法律效力。

範例

通知文字

僅供說明性草稿使用:僅在已執行協議授權且運營者批准此特定接收者通知時,才能使用這些條款和日期。

Schedule A notice, 2026-09-02
Agreement: Master Agreement dated 2026-08-14 between Us and Acme
Entry 2: Lot B, 8 nodes, region EU-West
Role: introducer
Terms: 6 month term, start no later than 2026-10-01
Fee: standard
This entry takes effect today unless you object within ten business days
with dated written evidence of a prior relationship with the counterparty.

將條目加入規範

"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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

相關技能