From cloverleaf
Human gate action on an RFC (rfc_strategy_gate) or Plan (task_batch_gate) in status gate-pending. Usage — /cloverleaf-gate <item-id> <approve|reject|revise> [reason]. `revise` is valid only at rfc_strategy_gate (RFC only).
How this skill is triggered — by the user, by Claude, or both
Slash command
/cloverleaf:cloverleaf-gateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user has invoked this skill with `<item-id> <action> [reason]`.
The user has invoked this skill with <item-id> <action> [reason].
Capture arguments:
$ITEM_ID = first positional arg$ACTION = second positional arg (must be approve, reject, or revise)$REASON = remaining args joined with spaces (optional)If ITEM_ID or ACTION is missing, report usage and stop.
Validate action:
case "$ACTION" in
approve|reject|revise) ;;
*) echo "Invalid action: $ACTION. Use approve, reject, or revise." >&2; exit 1 ;;
esac
Detect work-item type by checking which directory has the JSON file:
if [ -f "<repo_root>/.cloverleaf/rfcs/$ITEM_ID.json" ]; then
TYPE=rfc
GATE=rfc_strategy_gate
elif [ -f "<repo_root>/.cloverleaf/plans/$ITEM_ID.json" ]; then
TYPE=plan
GATE=task_batch_gate
else
echo "No RFC or Plan found with ID $ITEM_ID" >&2
exit 1
fi
Validate that revise is only valid at rfc_strategy_gate (i.e., on RFCs — revise is only exclusive to rfc_strategy_gate):
if [ "$ACTION" = "revise" ] && [ "$TYPE" != "rfc" ]; then
echo "revise is only valid at rfc_strategy_gate (RFCs). Use reject on Plans." >&2
exit 2
fi
Verify the item is in gate-pending status:
STATUS=$(cloverleaf-cli load-$TYPE <repo_root> $ITEM_ID | jq -r .status)
if [ "$STATUS" != "gate-pending" ]; then
echo "$TYPE $ITEM_ID is in status '$STATUS', not gate-pending" >&2
exit 3
fi
Emit the gate-decision event:
if [ -n "$REASON" ]; then
cloverleaf-cli emit-gate-decision <repo_root> $ITEM_ID $GATE $ACTION human --comment="$REASON"
else
cloverleaf-cli emit-gate-decision <repo_root> $ITEM_ID $GATE $ACTION human
fi
Advance the work-item state:
case "$ACTION" in
approve)
cloverleaf-cli advance-$TYPE <repo_root> $ITEM_ID approved human $GATE
;;
reject)
cloverleaf-cli advance-$TYPE <repo_root> $ITEM_ID rejected human $GATE
;;
revise)
# RFC-only — validated in step 4
cloverleaf-cli advance-rfc <repo_root> $ITEM_ID drafting human $GATE
# Persisting the revise reason as a feedback finding is deferred to v0.6.
# For now, the reason is surfaced on stdout so the caller can capture it
# and pass it back via the next /cloverleaf-draft-rfc invocation context.
if [ -n "$REASON" ]; then
echo "revise reason: $REASON"
fi
;;
esac
Commit state files:
git add .cloverleaf/rfcs/ .cloverleaf/plans/ .cloverleaf/events/
git commit -m "cloverleaf: gate $ITEM_ID $ACTION ($GATE)"
Print the new status:
NEW=$(cloverleaf-cli load-$TYPE <repo_root> $ITEM_ID | jq -r .status)
echo "$ITEM_ID: $STATUS → $NEW"
revise (RFC only) returns the RFC to drafting. The orchestrator loops back to /cloverleaf-draft-rfc.reject of an RFC: terminal (enters rejected state; orchestrator halts).reject of a Plan: plan enters rejected state; it can be re-decomposed via a new /cloverleaf-breakdown run (rejected → drafting via agent is a legal transition).[reason] text is persisted in the gate_decision event's comment field. For revise, it's also echoed to stdout so the calling orchestrator can feed it back to the Researcher on re-draft.npx claudepluginhub cloverleaf-org/cloverleaf --plugin cloverleafProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.