approval

Imported skill approval from langchain

16 stars

Best use case

approval is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Imported skill approval from langchain

Teams using approval should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/approval/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/fullstack-web/approval/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/approval/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How approval Compares

Feature / AgentapprovalStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Imported skill approval from langchain

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

"""Approval widget for HITL - using standard Textual patterns."""

from __future__ import annotations

import asyncio
from typing import Any, ClassVar

from textual import events
from textual.app import ComposeResult
from textual.binding import Binding, BindingType
from textual.containers import Container, Vertical, VerticalScroll
from textual.message import Message
from textual.widgets import Static

from deepagents_cli.widgets.tool_renderers import get_renderer


class ApprovalMenu(Container):
    """Approval menu using standard Textual patterns.

    Key design decisions (following mistral-vibe reference):
    - Container base class with compose()
    - BINDINGS for key handling (not on_key)
    - can_focus_children = False to prevent focus theft
    - Simple Static widgets for options
    - Standard message posting
    - Tool-specific widgets via renderer pattern
    """

    can_focus = True
    can_focus_children = False

    # CSS is in app.tcss - no DEFAULT_CSS needed

    BINDINGS: ClassVar[list[BindingType]] = [
        Binding("up", "move_up", "Up", show=False),
        Binding("k", "move_up", "Up", show=False),
        Binding("down", "move_down", "Down", show=False),
        Binding("j", "move_down", "Down", show=False),
        Binding("enter", "select", "Select", show=False),
        Binding("1", "select_approve", "Approve", show=False),
        Binding("y", "select_approve", "Approve", show=False),
        Binding("2", "select_reject", "Reject", show=False),
        Binding("n", "select_reject", "Reject", show=False),
        Binding("3", "select_auto", "Auto-approve", show=False),
        Binding("a", "select_auto", "Auto-approve", show=False),
    ]

    class Decided(Message):
        """Message sent when user makes a decision."""

        def __init__(self, decision: dict[str, str]) -> None:
            super().__init__()
            self.decision = decision

    def __init__(
        self,
        action_request: dict[str, Any],
        assistant_id: str | None = None,
        id: str | None = None,  # noqa: A002
        **kwargs: Any,
    ) -> None:
        super().__init__(id=id or "approval-menu", classes="approval-menu", **kwargs)
        self._action_request = action_request
        self._assistant_id = assistant_id
        self._tool_name = action_request.get("name", "unknown")
        self._tool_args = action_request.get("args", {})
        self._description = action_request.get("description", "")
        self._selected = 0
        self._future: asyncio.Future[dict[str, str]] | None = None
        self._option_widgets: list[Static] = []
        self._tool_info_container: Vertical | None = None

    def set_future(self, future: asyncio.Future[dict[str, str]]) -> None:
        """Set the future to resolve when user decides."""
        self._future = future

    def compose(self) -> ComposeResult:
        """Compose the widget with Static children.

        Layout prioritizes options visibility - they appear at the top so users
        always see them even in small terminals.
        """
        # Title
        yield Static(
            f">>> {self._tool_name} Requires Approval <<<",
            classes="approval-title",
        )

        # Options container FIRST - always visible at top
        with Container(classes="approval-options-container"):
            # Options - create 3 Static widgets
            for i in range(3):
                widget = Static("", classes="approval-option")
                self._option_widgets.append(widget)
                yield widget

        # Help text right after options
        yield Static(
            "↑/↓ navigate • Enter select • y/n/a quick keys",
            classes="approval-help",
        )

        # Separator between options and tool details
        yield Static("─" * 40, classes="approval-separator")

        # Tool info in scrollable container BELOW options
        with VerticalScroll(classes="tool-info-scroll"):
            self._tool_info_container = Vertical(classes="tool-info-container")
            yield self._tool_info_container

    async def on_mount(self) -> None:
        """Focus self on mount and update tool info."""
        await self._update_tool_info()
        self._update_options()
        self.focus()

    async def _update_tool_info(self) -> None:
        """Mount the tool-specific approval widget."""
        if not self._tool_info_container:
            return

        # Get the appropriate renderer for this tool
        renderer = get_renderer(self._tool_name)
        widget_class, data = renderer.get_approval_widget(self._tool_args)

        # Clear existing content and mount new widget
        await self._tool_info_container.remove_children()
        approval_widget = widget_class(data)
        await self._tool_info_container.mount(approval_widget)

    def _update_options(self) -> None:
        """Update option widgets based on selection."""
        options = [
            "1. Approve (y)",
            "2. Reject (n)",
            "3. Auto-approve all this session (a)",
        ]

        for i, (text, widget) in enumerate(zip(options, self._option_widgets, strict=True)):
            cursor = "› " if i == self._selected else "  "
            widget.update(f"{cursor}{text}")

            # Update classes
            widget.remove_class("approval-option-selected")
            if i == self._selected:
                widget.add_class("approval-option-selected")

    def action_move_up(self) -> None:
        """Move selection up."""
        self._selected = (self._selected - 1) % 3
        self._update_options()

    def action_move_down(self) -> None:
        """Move selection down."""
        self._selected = (self._selected + 1) % 3
        self._update_options()

    def action_select(self) -> None:
        """Select current option."""
        self._handle_selection(self._selected)

    def action_select_approve(self) -> None:
        """Select approve option."""
        self._selected = 0
        self._update_options()
        self._handle_selection(0)

    def action_select_reject(self) -> None:
        """Select reject option."""
        self._selected = 1
        self._update_options()
        self._handle_selection(1)

    def action_select_auto(self) -> None:
        """Select auto-approve option."""
        self._selected = 2
        self._update_options()
        self._handle_selection(2)

    def _handle_selection(self, option: int) -> None:
        """Handle the selected option."""
        decision_map = {
            0: "approve",
            1: "reject",
            2: "auto_approve_all",
        }
        decision = {"type": decision_map[option]}

        # Resolve the future
        if self._future and not self._future.done():
            self._future.set_result(decision)

        # Post message
        self.post_message(self.Decided(decision))

    def on_blur(self, event: events.Blur) -> None:
        """Re-focus on blur to keep focus trapped."""
        self.call_after_refresh(self.focus)

Related Skills

u0532-engineering-human-approval-router

16
from diegosouzapw/awesome-omni-skill

Operate the "Engineering Human Approval Router" capability in production for workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

u01789-human-approval-routing-for-remote-team-collaboration

16
from diegosouzapw/awesome-omni-skill

Operate the "Human Approval Routing for remote team collaboration" capability in production for remote team collaboration workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

u01784-human-approval-routing-for-multilingual-translation-services

16
from diegosouzapw/awesome-omni-skill

Operate the "Human Approval Routing for multilingual translation services" capability in production for multilingual translation services workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

u01689-human-approval-routing-for-education-support-services

16
from diegosouzapw/awesome-omni-skill

Operate the "Human Approval Routing for education support services" capability in production for education support services workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

asset-approval

16
from diegosouzapw/awesome-omni-skill

Use to manage co-marketing asset reviews with traceable evidence and SLAs.

approval-workflow

16
from diegosouzapw/awesome-omni-skill

Manages Human-in-the-Loop (HITL) approval workflows for sensitive actions. Use when creating approval requests, processing approved items, or implementing safety controls for autonomous actions.

approval-gate

16
from diegosouzapw/awesome-omni-skill

ワークフローの重要なフェーズ移行前にユーザーの明示的な承認を必要とする承認ゲートの共通フォーマットとパターンを定義

u01688-human-approval-routing-for-education-support-services

16
from diegosouzapw/awesome-omni-skill

Operate the "Human Approval Routing for education support services" capability in production for education support services workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.

architecture-review-and-approval

16
from diegosouzapw/awesome-omni-skill

Run structured architecture reviews with stakeholders and sign-off.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

customer-discovery

16
from diegosouzapw/awesome-omni-skill

Find where potential customers discuss problems online and extract their language patterns. Provides starting points for community research, not exhaustive coverage.

create-prd

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "创建PRD", "写产品需求文档", "生成PRD", "新建PRD", "create PRD", "write product requirements document", or mentions "产品需求文档", "PRD模板". Automatically generates comprehensive Chinese PRD documents following 2026 best practices.