Dunning ladder

Decide the next accounts-receivable reminder step within a capped cadence and emit a gated reminder proposal.

Overview

Plan the next reminder in an accounts-receivable dunning cadence without sending the reminder directly.

This skill reads an overdue invoice state and a cadence policy. It chooses the next allowed reminder step when the account is still within the cap, or escalates when the cap has been reached. The reminder is only a gated proposed effect for the send-as catalog skill.

SKILL.md

Dunning Ladder

Plan the next reminder in an accounts-receivable dunning cadence without sending the reminder directly.

This skill reads an overdue invoice state and a cadence policy. It chooses the next allowed reminder step when the account is still within the cap, or escalates when the cap has been reached. The reminder is only a gated proposed effect for the send-as catalog skill.

What this skill does

  • Confirms the invoice is actually overdue from the supplied status and aging.
  • Reads the policy cap and reminder steps supplied by the operator.
  • Chooses the next reminder step without exceeding the cap.
  • Emits a reminder_proposal with a channel and content digest for send-as.
  • Escalates to the configured lane once the cadence cap is reached.

When to use this skill

  • An AR operator needs a bounded next action for an overdue invoice.
  • A workflow needs to propose a reminder while keeping sending behind a separate approval gate.
  • A customer has already received some reminders and the workflow must avoid unbounded follow-up.

When not to use this skill

  • To send the reminder itself.
  • To dun an invoice that is paid, void, disputed, or not yet overdue.
  • To invent cadence rules that are absent from cadence_policy.
  • To exceed the reminder cap because a balance remains unpaid.

Procedure

  1. Validate invoice_status, aging_days, and cadence_policy.
  2. Refuse if invoice_status.status is not overdue or aging_days is less than one.
  3. Count prior reminders from invoice_status.reminders_sent.
  4. If prior reminders are greater than or equal to cadence_policy.cap, set decision.action to escalate, emit no reminder proposal, and route to cadence_policy.escalation_lane.
  5. Otherwise choose the next step whose step is one greater than the number of reminders already sent.
  6. Refuse or escalate if the next step is missing or the invoice is too young for that step's min_aging_days.
  7. Emit reminder_proposal as a gated proposed effect performed by send-as.

Edge cases and stop conditions

  • Paid, void, disputed, or pending invoices return refused with no reminder content.
  • Missing or empty cadence steps return refused; do not invent steps.
  • A missing next step escalates to the configured lane because the policy is incomplete.
  • A too-young invoice for the next step returns refused and preserves the cap state for audit.
  • At or above the cap, emit no reminder content and route to escalation.
  • Any request to send, retry, or bypass approval remains a gated proposal only.

Output schema

yaml
decision:
  status: proposed | escalated | refused
  step: number | null
  action: propose_reminder | escalate | refuse
  reasons: [string]
reminder_proposal:
  effect: send-as
  gated: true
  channel: string | null
  content_digest: string | null
  recipient_ref: string | null
  invoice_ref: string | null
  amount_due: number | null
  currency: string | null
escalation:
  required: boolean
  lane: string | null
  reason: string | null
  cap: number
  reminders_sent: number

Worked example

Input:

yaml
invoice_status:
  invoice_id: inv-2026-0601
  status: overdue
  amount_due: 1840
  currency: USD
  customer_ref: acct-acme-legal
  reminders_sent: 1
aging_days: 22
cadence_policy:
  cap: 3
  escalation_lane: ar-manager
  steps:
    - step: 1
      min_aging_days: 7
      channel: email
      content_digest: first-notice-template
    - step: 2
      min_aging_days: 14
      channel: email
      content_digest: second-notice-template

Output:

yaml
decision:
  status: proposed
  step: 2
  action: propose_reminder
reminder_proposal:
  effect: send-as
  gated: true
  channel: email
  content_digest: second-notice-template
escalation:
  required: false

Inputs

  • invoice_status: JSON object with invoice_id, status, optional amount_due, optional currency, customer_ref, and reminders_sent.
  • aging_days: number of days past due.
  • cadence_policy: JSON object with cap, escalation_lane, and ordered steps.

Each cadence step should include:

yaml
step: 2
min_aging_days: 14
channel: email
content_digest: second-notice-template

Output

Return JSON containing:

  • decision: whether the skill proposed a reminder, escalated, or refused.
  • reminder_proposal: a gated send-as proposal when the next step is allowed.
  • escalation: cap state, lane, and reason when escalation is required.

Safety rules

  • Never send a reminder directly.
  • Never exceed cadence_policy.cap.
  • Never dun a record that is not overdue per the inputs.
  • Keep the proposal gated behind send-as.
  • Escalate rather than proposing another reminder at the cap.
  • Do not include raw payment account numbers or secrets in the proposal.

Local verification

Run:

sh
node test.mjs

The test covers a within-cap reminder proposal, a cap-reached escalation, and a not-overdue refusal.

Published execution profile

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

Runners
  • decide
  • stop
Profile digestsha256:addcba0bddb5d6216433ae2ac45ccb0c2dbb9a642902a6e5254c08869ad2c1de
skill: dunning-ladder
version: 0.1.1
catalog:
  kind: skill
  audience: operator
  visibility: public
  role: context
  category: payments
runners:
  decide:
    default: true
    inputs:
      invoice_status:
        type: json
        required: true
        description: Overdue invoice state, reminder history, amount, and recipient reference.
      aging_days:
        type: number
        required: true
        description: Number of days past due.
      cadence_policy:
        type: json
        required: true
        description: Reminder steps, cap, and escalation lane.
    steps:
      - id: decide
        tool:
          command: node
          args:
            - run.mjs
        inputs:
          invoice_status: $input.invoice_status
          aging_days: $input.aging_days
          cadence_policy: $input.cadence_policy
        artifacts:
          wrap_as: dunning_ladder_packet
  stop:
    inputs:
      reason:
        type: string
        required: false
        description: Harness-only stop path proving the package records stop/error outcomes.
    steps:
      - id: stop
        tool:
          command: /bin/false
        inputs:
          reason: $input.reason
        outputs:
          decision:
            required: false
harness:
  cases:
    - name: within-cap-reminder
      runner: decide
      inputs:
        invoice_status:
          invoice_id: inv-2026-0601
          status: overdue
          amount_due: 1840
          currency: USD
          customer_ref: acct-acme-legal
          reminders_sent: 1
          last_reminder_at: 2026-06-18
        aging_days: 22
        cadence_policy:
          cap: 3
          escalation_lane: ar-manager
          steps:
            - step: 1
              min_aging_days: 7
              channel: email
              tone: friendly
              content_digest: first-notice-template
            - step: 2
              min_aging_days: 14
              channel: email
              tone: firm
              content_digest: second-notice-template
            - step: 3
              min_aging_days: 21
              channel: email
              tone: final
              content_digest: final-notice-template
      expect:
        status: sealed
        receipt:
          schema: runx.receipt.v1
      operator_journeys:
        - mode: standalone
          confusors:
            - settle-invoice
            - send-as
          request: Decide the next dunning step for this overdue account.
          expected_outcome: Return the next ladder step and a gated message proposal, sending nothing.
        - mode: composed
          request: Continue this dunning-ladder work from evidence already gathered upstream.
          expected_outcome: Return the next ladder step and a gated message proposal, sending nothing.
          prior_evidence:
            - The account balance and dunning history already supplied.
          must_not_repeat:
            - Do not send reminders or charge the account.
    - name: missing-policy-fails
      runner: stop
      inputs:
        reason: cadence_policy missing
      expect:
        status: failure

Published package and test evidence.

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

Test result

Harness resultPassed
Tested versionsha-7abbdbea3f20
Recorded result2 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases2
Test recordOpen the recorded run
Inspect receipt referencessha256:2c976da66b03e0246e964eadf3a84fbd71387eda8584d59b7d24225ce3a80c0asha256:574a4f9e2ec5645826eb435b2e1b803e71154b1c7829dabc576a4fcdd113aedb

Package identity

Published revisionsha-7abbdbea3f20
Content digestsha256:7abbdbea3f20fffc5b16aa41acd7f70b9053c2bcbb3bb972a1deaddbbce0990f
SKILL.md digestsha256:e2a496b71183823185881262c41bb6fbf115b7c5945e4712058ed12c27e284e4
Execution profile digestsha256:addcba0bddb5d6216433ae2ac45ccb0c2dbb9a642902a6e5254c08869ad2c1de
Publisher identityUnverified publisher · Kid
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · DeclaredKid · 17 Oct 2026
Source provenanceNot published with this version

Version history

  1. sha-7abbdbea3f20ViewingContent digest sha256:7abbdbea3f20fffc5b16aa41acd7f70b9053c2bcbb3bb972a1deaddbbce0990f
  2. sha-b668595d90c7Content digest sha256:b668595d90c74968cf9b0ecbea6b70955b1ba89143e8136ba11d2e971eedf19d
  3. sha-b49ab64cb83dContent digest sha256:b49ab64cb83d92ec60c74c62780c7a1b6d72b16ee95d1b9a9844f53cead07843
  4. sha-6a4a17a73b23Content digest sha256:6a4a17a73b23f39819c84e929a2573c60e8927fc70db8c2fdc3bc54200a8d390