Contract drafting

Draft a contract from a versioned template with explicit parties and terms, reconciling every clause against the rendered baseline deterministically and keeping delivery behind a human gate.

You’re reading version sha-cdec3779dc22. Go to the current version

Overview

Draft a contract without letting the drafting agent silently rewrite the template. The template, parties, and terms are the only evidence; the agent assembles clause text, and deterministic code re-renders every baseline with the supplied values and reconciles the draft against it. A clause may differ from its rendered baseline only through a declared deviation with a reason.

This is not legal advice and does not replace counsel. It is an execution boundary for template fidelity: the receipt proves which template version was drafted, which terms were bound, and which deviations were declared.

In the manual

Runner

  • draft

Declared by its execution profile. Read the profile

SKILL.md

Contract Draft

Draft a contract without letting the drafting agent silently rewrite the template. The template, parties, and terms are the only evidence; the agent assembles clause text, and deterministic code re-renders every baseline with the supplied values and reconciles the draft against it. A clause may differ from its rendered baseline only through a declared deviation with a reason.

This is not legal advice and does not replace counsel. It is an execution boundary for template fidelity: the receipt proves which template version was drafted, which terms were bound, and which deviations were declared.

Procedure

  1. Admission requires a complete template (id, version, title, clauses with baselines), explicit parties, and every required_terms key present in terms. Missing evidence stops before the drafting agent runs.
  2. Native data.digest binds the exact template, parties, and terms.
  3. The drafting agent assembles clause text and declares any deviations.
  4. Deterministic reconciliation re-renders each baseline with the supplied values ({{provider.legal_name}}, {{terms.fee_usd}}, and similar paths). A clause must match its rendered baseline exactly, or carry a declared deviation with a reason. Undeclared deviations, deviations that match the baseline anyway, unknown clause targets, unresolved placeholders, and missing clauses all refuse.
  5. A drafted verdict carries the document and a send proposal gated on a human approver through message-send. delivery_performed is always false.

Output

contract_draft (runx.contract_draft.v1) carries decision, reason, the document or null, confirmed deviations with baseline and text, the gated send_proposal or null, validation, and the three input digests.

Inputs are template, parties, and terms.

Agent task contracts

contract-draft-assemble

Read template, parties, and terms from step inputs. Return draft_doc with title, clauses (each id, heading, text), and deviations as an array of clause_id plus reason entries. Render every placeholder from the supplied values; never invent parties, amounts, or dates. Match each baseline exactly unless a deviation is genuinely needed, and declare every deviation with its reason. Do not add clauses the template does not define and do not produce delivery instructions; delivery belongs to the gated proposal.

Published execution profile

The execution profile published with sha-cdec3779dc22, shown as its exact bytes.

Runner
  • draft
Profile digestsha256:0520f7faa472e527fd51192d78c541275f064f34993dce33045205a7026d1258
skill: contract-draft
version: "0.1.8"

catalog:
  kind: graph
  audience: operator
  visibility: public
  category: content
  role: canonical
  execution: plan
  completion: runtime_receipt
  approval: none

harness:
  files: [fixtures/support/composed.graph]
  cases:
    - name: contract-draft-complete-draft-seals
      operator_journeys:
        - mode: standalone
          confusors: [ghostwrite, message-send]
          request: Draft this services agreement from the approved template with every required term bound.
          expected_outcome: Return a sealed draft where every clause reconciles with the rendered template and delivery stays behind a human gate.
        - mode: composed
          request: Continue from this sealed contract draft into the governed delivery step.
          expected_outcome: Reuse the sealed draft and its send proposal without re-drafting any clause.
          prior_evidence:
            - The template, parties, terms, and sealed draft supplied by the prior step.
          must_not_repeat:
            - Do not re-render or re-negotiate clauses already sealed.
      inputs:
        template:
          id: msa-basic-v1
          version: "1.0"
          title: Services Agreement
          required_terms: [services, fee_usd]
          clauses:
            - id: parties
              heading: Parties
              baseline: "This Services Agreement is between {{provider.legal_name}} and {{customer.legal_name}}."
            - id: fees
              heading: Fees and Payment
              baseline: "Customer will pay USD {{terms.fee_usd}} for {{terms.services}}."
        parties:
          provider: { legal_name: Acme Pty Ltd }
          customer: { legal_name: Globex LLC }
        terms:
          services: monthly platform maintenance
          fee_usd: 4000
      caller:
        answers:
          assemble:
            draft_doc:
              title: Services Agreement
              clauses:
                - id: parties
                  heading: Parties
                  text: This Services Agreement is between Acme Pty Ltd and Globex LLC.
                - id: fees
                  heading: Fees and Payment
                  text: Customer will pay USD 4000 for monthly platform maintenance.
              deviations: []
      expect:
        status: sealed
        steps: [admit, digest-template, digest-parties, digest-terms, assemble, finalize]
        step_outputs:
          finalize:
            subset:
              contract_draft:
                data:
                  schema: runx.contract_draft.v1
                  decision: drafted
                  deviations: []
                  send_proposal:
                    gate: human-approver
                    delivery_skill: message-send
                    sent: false
                  delivery_performed: false
                  validation: { status: pass, findings: [] }
        receipt: { schema: runx.receipt.v1 }

    - name: contract-draft-declared-deviation-seals
      inputs:
        template:
          id: msa-basic-v1
          version: "1.0"
          title: Services Agreement
          required_terms: [fee_usd]
          clauses:
            - id: fees
              heading: Fees and Payment
              baseline: "Customer will pay USD {{terms.fee_usd}} within 30 days after invoice."
        parties:
          customer: { legal_name: Globex LLC }
        terms:
          fee_usd: 4000
      caller:
        answers:
          assemble:
            draft_doc:
              title: Services Agreement
              clauses:
                - id: fees
                  heading: Fees and Payment
                  text: Customer will pay USD 4000 within 45 days after invoice.
              deviations:
                - clause_id: fees
                  reason: Customer requested 45-day payment terms and the operator approved the extension.
      expect:
        status: sealed
        steps: [admit, digest-template, digest-parties, digest-terms, assemble, finalize]
        step_outputs:
          finalize:
            subset:
              contract_draft:
                data:
                  decision: drafted
                  validation: { status: pass, findings: [] }
        receipt: { schema: runx.receipt.v1 }

    - name: contract-draft-undeclared-deviation-refuses
      inputs:
        template:
          id: msa-basic-v1
          version: "1.0"
          title: Services Agreement
          required_terms: [fee_usd]
          clauses:
            - id: fees
              heading: Fees and Payment
              baseline: "Customer will pay USD {{terms.fee_usd}} within 30 days after invoice."
        parties:
          customer: { legal_name: Globex LLC }
        terms:
          fee_usd: 4000
      caller:
        answers:
          assemble:
            draft_doc:
              title: Services Agreement
              clauses:
                - id: fees
                  heading: Fees and Payment
                  text: Customer will pay USD 9000 within 90 days after invoice.
              deviations: []
      expect:
        status: sealed
        steps: [admit, digest-template, digest-parties, digest-terms, assemble, finalize]
        step_outputs:
          finalize:
            subset:
              contract_draft:
                data:
                  decision: refused
                  document: null
                  send_proposal: null
                  validation: { status: fail }
        receipt: { schema: runx.receipt.v1 }

    - name: contract-draft-missing-term-stops
      inputs:
        template:
          id: msa-basic-v1
          version: "1.0"
          title: Services Agreement
          required_terms: [fee_usd, services]
          clauses:
            - id: fees
              heading: Fees and Payment
              baseline: "Customer will pay USD {{terms.fee_usd}} for {{terms.services}}."
        parties:
          customer: { legal_name: Globex LLC }
        terms:
          fee_usd: 4000
      expect:
        status: sealed
        steps: [admit, stop]
        step_outputs:
          stop:
            subset:
              contract_draft:
                data:
                  decision: refused
                  document: null
                  send_proposal: null
                  validation: { status: fail }
        receipt: { schema: runx.receipt.v1 }

runners:
  draft:
    default: true
    inputs:
      template:
        type: object
        required: true
        description: Versioned contract template with stable clause baselines and required term keys.
      parties:
        type: object
        required: true
        description: Explicit party records referenced by template placeholders; no party may be inferred.
      terms:
        type: object
        required: true
        description: Explicit deal terms; every template required term must be supplied.
    examples:
      - template:
          id: msa-basic-v1
          version: "1.0"
          title: Services Agreement
          required_terms: [fee_usd]
          clauses:
            - id: fees
              heading: Fees and Payment
              baseline: "Customer will pay USD {{terms.fee_usd}}."
        parties:
          customer: { legal_name: Globex LLC }
        terms:
          fee_usd: 4000
    result_from: [stop, finalize]
    steps:
      - id: admit
        label: admit only complete template, party, and term evidence
        inputs:
          template: $input.template
          parties: $input.parties
          terms: $input.terms
        tool: { module: contract-draft.mjs, export: admitRequest }
        outputs:
          draft_context: object

      - id: stop
        when:
          value: $steps.admit.draft_context.path
          equals: stop
        inputs:
          draft_context: $steps.admit.draft_context
          template: $input.template
          parties: $input.parties
          terms: $input.terms
        tool: { module: contract-draft.mjs, export: finalizeDraft }
        outputs:
          contract_draft: object
        artifacts:
          named_emits:
            contract_draft: contract_draft

      - id: digest-template
        when:
          value: $steps.admit.draft_context.path
          equals: draft
        tool: data.digest
        inputs:
          value: $input.template

      - id: digest-parties
        when:
          value: $steps.admit.draft_context.path
          equals: draft
        tool: data.digest
        inputs:
          value: $input.parties

      - id: digest-terms
        when:
          value: $steps.admit.draft_context.path
          equals: draft
        tool: data.digest
        inputs:
          value: $input.terms

      - id: assemble
        label: draft clauses from the template under declared-deviation rules
        when:
          value: $steps.admit.draft_context.path
          equals: draft
        agent: { role: reviewer, task: contract-draft-assemble }
        outputs:
          draft_doc: object
        inputs:
          template: $input.template
          parties: $input.parties
          terms: $input.terms
        artifacts:
          named_emits:
            draft_doc: draft_doc

      - id: finalize
        label: reconcile the draft against the rendered template deterministically
        when:
          value: $steps.admit.draft_context.path
          equals: draft
        inputs:
          template: $input.template
          parties: $input.parties
          terms: $input.terms
          draft_context: $steps.admit.draft_context
          draft_doc: $steps.assemble.draft_doc
          template_digest: $steps.digest-template.digest_result.digest
          parties_digest: $steps.digest-parties.digest_result.digest
          terms_digest: $steps.digest-terms.digest_result.digest
        tool: { module: contract-draft.mjs, export: finalizeDraft }
        outputs:
          contract_draft:
            type: object
            schema:
              required: [schema, decision, reason, document, deviations, send_proposal, validation, template_digest, parties_digest, terms_digest, delivery_performed]
              additionalProperties: false
              properties:
                schema: { const: runx.contract_draft.v1 }
                decision: { type: string, enum: [drafted, refused] }
                reason: { type: string, minLength: 1, maxLength: 4000 }
                document:
                  type: [object, "null"]
                  required: [template_id, template_version, title, clauses]
                  additionalProperties: false
                  properties:
                    template_id: { type: string, minLength: 1, maxLength: 500 }
                    template_version: { type: string, minLength: 1, maxLength: 100 }
                    title: { type: string, minLength: 1, maxLength: 500 }
                    clauses:
                      type: array
                      maxItems: 200
                      items:
                        type: object
                        required: [id, heading, text]
                        additionalProperties: false
                        properties:
                          id: { type: string, minLength: 1, maxLength: 200 }
                          heading: { type: string, minLength: 1, maxLength: 500 }
                          text: { type: string, minLength: 1, maxLength: 20000 }
                deviations:
                  type: array
                  maxItems: 200
                  items:
                    type: object
                    required: [clause_id, reason, baseline, text]
                    additionalProperties: false
                    properties:
                      clause_id: { type: string, minLength: 1, maxLength: 200 }
                      reason: { type: string, minLength: 1, maxLength: 2000 }
                      baseline: { type: string, minLength: 1, maxLength: 20000 }
                      text: { type: string, minLength: 1, maxLength: 20000 }
                send_proposal:
                  type: [object, "null"]
                  required: [gate, delivery_skill, sent]
                  additionalProperties: false
                  properties:
                    gate: { const: human-approver }
                    delivery_skill: { const: message-send }
                    sent: { const: false }
                validation:
                  type: object
                  required: [status, findings]
                  additionalProperties: false
                  properties:
                    status: { type: string, enum: [pass, fail] }
                    findings:
                      type: array
                      maxItems: 100
                      items:
                        type: object
                        required: [code, message]
                        additionalProperties: false
                        properties:
                          code: { type: string, minLength: 1, maxLength: 200 }
                          message: { type: string, minLength: 1, maxLength: 2000 }
                template_digest: { type: [string, "null"], pattern: "^sha256:[0-9a-f]{64}$" }
                parties_digest: { type: [string, "null"], pattern: "^sha256:[0-9a-f]{64}$" }
                terms_digest: { type: [string, "null"], pattern: "^sha256:[0-9a-f]{64}$" }
                delivery_performed: { const: false }
        artifacts:
          named_emits:
            contract_draft: contract_draft

Published package and test evidence.

This exact version passed its recorded harness run: 5 checks passed · 0 failed.

Test result

Harness resultPassed
Tested versionsha-cdec3779dc22
Recorded result5 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases4
Test recordOpen the recorded run
Inspect receipt referencessha256:08eb2856dcae054fd08b6d8a9927df3cbbc75fb4ffbdde9541a2059407ee7f3csha256:846ae149e00c8c0375f66a8ca622b97dbdbabca5216b1d01b99df6208c28b564sha256:de0c4256aec92e2d5edb107749a6f11a5687caf80a763f843d7622cc9f067e3asha256:9ccedab03182e90ea87dc070ae13159d71a6429d4ebd60e3a60af570bddde2b4sha256:ba746507bfafe4fb06355481aefc3cc5e0ac2ed2e0742a8cc5353ed3a6ad7e9e

Package identity

Published revisionsha-cdec3779dc22
Content digestsha256:cdec3779dc22c58ef8f66ee8f13084e165582f6e523d3bdea0a09036be83ab0f
SKILL.md digestsha256:66a8c18c5bb83374bb89cf3fe25bc5edc2bb35c419ea16263eea17598a0c55b4
Execution profile digestsha256:0520f7faa472e527fd51192d78c541275f064f34993dce33045205a7026d1258
Publisher identityVerified publisher · runx
Trust tierVerified publisherRunx has verified this publisher. This tier is not a code assessment.
Attestations
  • Publisher · Verifiedrunx · 18 Oct 2026
Source provenanceNot published with this version

Version history

  1. 0.1.9Content digest sha256:820ac2e2ccb971d81e762bb2a729bcc32eb88e5b80215bec77d8da4fdfce1967
  2. sha-cdec3779dc22ViewingContent digest sha256:cdec3779dc22c58ef8f66ee8f13084e165582f6e523d3bdea0a09036be83ab0f