Mastermind approval detail

From monoes/monomind · View interactive version

Mastermind approval detail is an AI agent skill from the GitHub repository monoes/monomind. Mastermind approval-detail — inspect and resolve one approval request from an org's agents via `monomind org approvals`, `org approve` and `org deny`.

How to use this skill

Skill file

Mastermind Approval Detail

This skill is invoked directly via /mastermind-approval-detail.


Inputs

The approval queue is .monomind/orgs/<org>/approvals.json, written by the Org Runtime when an

agent asks to use a gated tool (Bash, WebFetch, WebSearch, org_complete). Always read and resolve it

through the CLI: monomind org approve/deny deliver the decision to a running org's daemon (the

waiting agent is notified at once) and fall back to updating the file when the org is not running.


Approval Record

| Field | Meaning |

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

| requestId | Request id (apr-…); may be null on entries recorded before ids existed |

| roleId | Role that asked |

| action | Tool or action requested (e.g. Bash) |

| question | What the agent asked |

| input | Tool input the agent wants to run (may be null) |

| approved | null = pending, true = approved, false = denied |

| ts / resolvedAt | Request / resolution time (epoch ms) |

| resolvedBy | Who resolved it |


Step 0 — Brain Load (standalone only)

If caller is not "command", load brain context following mastermind-protocol/SKILL.md Brain Load Procedure with namespace: ops.


Step 1 — Load Approval

orgFile=".monomind/orgs/${org_name}.json"
[ ! -f "$orgFile" ] && { echo "ERROR: Org '${org_name}' not found."; exit 1; }

all=$(monomind org approvals "$org_name" --all --format json) || { echo "ERROR: Cannot read approvals for org '${org_name}'."; exit 1; }

if [ -n "$approval_id" ]; then
  approvalDef=$(echo "$all" | jq -c --arg id "$approval_id" \
    '[.items[] | select(.requestId != null and (.requestId == $id or (.requestId | startswith($id))))][0] // empty')
  [ -z "$approvalDef" ] && { echo "ERROR: Approval '${approval_id}' not found."; exit 1; }
  approvalId=$(echo "$approvalDef" | jq -r '.requestId')
  roleId=$(echo "$approvalDef" | jq -r '.roleId')
  approvalAction=$(echo "$approvalDef" | jq -r '.action')
fi

Step 2 — Execute Action

list

monomind org approvals "$org_name"

show (default)

echo "APPROVAL — ${approvalId}"
echo "────────────────────────────────────────────────────────"

echo "$approvalDef" | jq -r '
  "  ID:         \(.requestId)",
  "  Role:       \(.roleId)",
  "  Action:     \(.action)",
  "  Status:     \(if .approved == null then "pending" elif .approved then "approved" else "denied" end)",
  "  Question:   \(.question // "-")",
  "  Requested:  \(.ts | tostring)",
  "  Resolved:   \(.resolvedAt // "-" | tostring)  by \(.resolvedBy // "-")"
'

echo ""
echo "INPUT"
echo "────────────────────────────────────────────────────────"
echo "$approvalDef" | jq '.input // {}'

if [ "$(echo "$approvalDef" | jq -r '.approved')" = "null" ]; then
  echo ""
  echo "ACTIONS AVAILABLE"
  echo "  approve: --action approve"
  echo "  deny:    --action deny"
fi

approve

monomind org approve "$org_name" "$roleId" "$approvalAction" --request "$approvalId" ${resolver:+--by "$resolver"}

deny

monomind org deny "$org_name" "$roleId" "$approvalAction" --request "$approvalId" ${resolver:+--by "$resolver"}

Step 3 — Return Output

domain: ops
status: complete
action: <action>
org: <org_name>
approval_id: <approval_id>
approval_status: <status>

Step 4 — Brain Write (standalone only)

If caller is not "command", follow mastermind-protocol/SKILL.md Brain Write Procedure for domain ops.

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.