Approval runtime skill

From infometa/workbuddyskills · View interactive version

Approval runtime skill is an AI agent skill from the GitHub repository infometa/workbuddyskills. Used to query or process existing approval instances and approval tasks. Use when users mention approval to-dos, agree, pass, complete, reject, return, withdraw, cancel, edit approval forms, submit after filling, change handler, add sign-off node, remind, carbon copy, reply, task details, progress,

How to use this skill

Skill file

Approval Flow Runtime

Scope

Only handles existing approval instances, approval tasks, activity feeds, replies, and runtime form data. Do not treat instance detail, task detail, or feed detail as a to-do query. First bind one explicit task, instance, object record, feed, or reply target, then choose the narrowest tool for that target.

Core Rules

Layout Identification Before Editing or Completing

When the user asks to edit, save, agree, pass, or complete an approval task, always identify the layout through approval_runtime_get_task_extra_data with fixed apiName: ApprovalTaskExtraData.

  1. Determine buttonType from the confirmed action in current context.
  2. Reuse a trusted explicit buttonType if one already exists for the same task and action.
  3. Use these fixed mappings when the action is already uniquely identified:
  1. Call approval_runtime_get_task_extra_data with instanceId, taskId, and matching buttonType.
  2. Route only by approvalForm.objectFlowLayoutExists from that result:
  1. Do not use task detail, instance detail, or any other result to replace this layout judgment.

Tool Routing

| User Intent | Tool | Fixed apiName | Role |

| --- | --- | --- | --- |

| View task detail or feed detail | approval_runtime_get_task_detail | ApprovalFeedDetail | Read task, to-do, or workflow instance level detail |

| View instance detail | approval_runtime_instance_detail | ApprovalInstanceDetail | Read full approval instance information |

| Find active instance by business record | approval_runtime_get_approval_in_95f9b6fb59f0 | ApprovalInstanceIdByObject | Resolve the running instance from entityId + objectId |

| View task extra data | approval_runtime_get_task_extra_data | ApprovalTaskExtraData | Read button-scoped extra data, form layout, opinion rules, and task-side runtime data |

| View detail change data | approval_runtime_detail_change | ApprovalInstanceDetailChange | Read instance detail-line change information |

| Query rejectable targets | approval_runtime_get_can_refuse_tasks | ApprovalCanRefuseTasks | Get candidate tasks that the current task can reject to |

| Check whether a task can be retrieved | approval_runtime_retrieve_check | ApprovalTaskRetrieveCheck | Validate retrieve eligibility before retrieve |

| Save flow-layout form only | approval_runtime_edit | ApprovalTaskFormEdit | Save a flow-layout approval form without completing |

| Save default-layout form only | approval_runtime_update_approval_content | ApprovalTaskDefaultFormEdit | Save default-layout form data without completing |

| Complete a flow-layout approval task | approval_runtime_complete | ApprovalTaskComplete | Complete the approval task after flow-layout data is already saved |

| Update and complete a default-layout approval task | approval_runtime_update_and_complete | ApprovalTaskUpdateComplete | Save required data and complete in one call |

| Reject to a previous task | approval_runtime_reject_to_before_task | ApprovalTaskReject | Reject from the current task to a selected previous task |

| Retrieve an approval task | approval_runtime_retrieve | ApprovalTaskRetrieve | Perform retrieve after retrieve-check is satisfied |

| Change regular task handler | approval_runtime_change_task_handler | ApprovalTaskChangeHandler | Replace the current task assignees |

| Change free approval handler | approval_runtime_change_free_app_b3714e5440ed | ApprovalTaskChangeFreeHandler | Adjust the free-approval handler definition on the instance |

| Carbon copy / mark as read | approval_runtime_carbon_copy | ApprovalTaskCarbonCopy | Send carbon-copy style approval-side message data |

| Reply to approval feed/comment | approval_runtime_reply | ApprovalTaskReply | Create a reply or comment with replyMessage |

| Delete approval reply | approval_runtime_delete_reply | ApprovalTaskDeleteReply | Delete a reply by trusted reply context |

Write Execution Rules

Flow-layout save only

Use approval_runtime_edit only when approvalForm.objectFlowLayoutExists == true.

Default-layout save only

Use approval_runtime_update_approval_content only when approvalForm.objectFlowLayoutExists == false.

Flow-layout complete

Use the fixed two-step sequence below only when approvalForm.objectFlowLayoutExists == true.

  1. Save with approval_runtime_edit
  2. Complete with approval_runtime_complete

Requirements:

Default-layout complete

Use approval_runtime_update_and_complete only when approvalForm.objectFlowLayoutExists == false.

Reject

Before approval_runtime_reject_to_before_task, first call approval_runtime_get_can_refuse_tasks.

Retrieve

Before approval_runtime_retrieve, first call approval_runtime_retrieve_check.

Handler change

Reply and carbon copy

Delete reply

Use approval_runtime_delete_reply only with trusted current reply context.

Confirmation Rules For Non-Read Operations

  1. Before every write, show a business-facing preview that states the target approval item, intended action, changed fields or assignee/visibility changes, comment or opinion, and impact.
  2. Do not expose raw tool names, raw payload JSON, apiName, or internal mappings unless the user explicitly asks.
  3. Wait for an explicit affirmative in a later user message before calling the write tool.
  4. Any change to target, action, field values, assignees, reject target, retrieve path, reply scope, or comment invalidates the prior confirmation and requires a new preview.
  5. After confirmation, execute the write once. Do not silently chain another write except the fixed flow-layout "save, then complete" sequence.

Target Contract

Success Rule

Only treat the operation as successful when the tool result clearly reports success. If the result is only a validation response, a partial acceptance, or cannot independently prove the final business state, state that truthfully and stop.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.