hitl-patterns

Implement CopilotKit HITL patterns with useHumanInTheLoop, ApprovalDialog, and DynamicForm.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/rwxproject/agent-framework --skill hitl-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hitl-patterns
Source: https://github.com/rwxproject/agent-framework/tree/main/.claude/skills/hitl-patterns
Command: npx skills add https://github.com/rwxproject/agent-framework --skill hitl-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Comprehensive HITL patterns for CopilotKit, including reusable React components and hooks to implement approval workflows, user input collection, option selection, and progress confirmation.

Core Features & Use Cases

  • Core hook: useHumanInTheLoop provides a unified pattern to collect human feedback and approvals within LLM-driven workflows.
  • Pattern 1: Approval Workflow - Request user approval before executing sensitive actions using UI dialogs.
  • Pattern 2: User Input Collection - Collect structured information from the user via dynamic forms.
  • Pattern 3: Option Selection - Present multiple options for the user to choose from.
  • Pattern 4: Progress Confirmation - Confirm workflow progress and continuation.
  • Use Case: Integrate HITL patterns into CopilotKit-powered agents to streamline human-in-the-loop interactions.

Quick Start

Integrate useHumanInTheLoop into your React components and trigger on approvals, input collection, and option selections.

Frequently Asked Questions about hitl-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement approval workflows in CopilotKit React applications?

Approval workflows in CopilotKit use the useHumanInTheLoop hook to request user approval before executing sensitive actions. Integrate the hook into your React components, configure the ApprovalDialog component with action details, and handle the approval callback to proceed or cancel the operation.

What is human-in-the-loop and when should I use it in AI-powered apps?

Human-in-the-loop (HITL) pauses automated workflows to collect human feedback, approvals, or input before proceeding. Use it in CopilotKit agents for sensitive decisions, data validation, or option selection where human judgment prevents errors and ensures appropriate oversight.

Can I collect structured user input dynamically within CopilotKit workflows?

Yes. The DynamicForm component collects structured user data with typed fields, built-in validation, and submission callbacks. Pair it with useHumanInTheLoop to integrate form collection into your approval and decision workflows within CopilotKit.

How do I present multiple options for users to choose from in a CopilotKit agent?

Use the useHumanInTheLoop hook with option selection pattern to render choice prompts. Configure the parameters to define available options and handle the user's selection, enabling agents to defer decisions to human users when needed.

Does this HITL pattern library work with existing React and CopilotKit setups?

Yes. The pattern library is designed for React-based CopilotKit integrations with no external dependencies. Import the useHumanInTheLoop hook and pre-built components (ApprovalDialog, DynamicForm) directly into your existing CopilotKit-powered React application.

What validation and error handling does the dynamic form component provide?

The DynamicForm component includes typed field definitions and built-in validation logic. It enforces field constraints, provides validation feedback, and exposes submission callbacks so you can handle validation errors and manage form state within your HITL workflow.