skills/openhands-sdk/SKILL.md
Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software. Use when you need to build agents with the SDK, create custom tools, configure LLMs, manage conversations, delegate to sub-agents, or deploy agents locally or remotely.
npx skillsauth add openhands/extensions openhands-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All SDK documentation lives at https://docs.openhands.dev/sdk.
For the full topic index, fetch https://docs.openhands.dev/llms.txt and read the "OpenHands Software Agent SDK" section.
Install: pip install openhands-sdk openhands-tools
import os
from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool
llm = LLM(
model=os.getenv("LLM_MODEL", "gpt-5.5"),
api_key=os.getenv("LLM_API_KEY"),
base_url=os.getenv("LLM_BASE_URL", None),
)
agent = Agent(
llm=llm,
tools=[
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
],
)
cwd = os.getcwd()
conversation = Conversation(agent=agent, workspace=cwd)
conversation.send_message("Write 3 facts about the current project into FACTS.txt.")
conversation.run()
print("All done!")
openhands.sdk)| Class | Purpose |
|---|---|
| Agent | Reasoning-action loop |
| Condenser | Conversation history compression system |
| Conversation | Conversation orchestration system |
| Event | Typed event framework |
| LLM | Provider-agnostic language model interface |
| SecurityAnalyzer | Action security analysis and validation |
| Skill | Reusable prompt system |
| Tool / ToolDefinition | Action-observation tool framework |
| Workspace | Execution environment abstraction |
openhands.sdk.agent, openhands.sdk.conversation, openhands.sdk.event, openhands.sdk.llm, openhands.sdk.security, openhands.sdk.tool, openhands.sdk.utils, openhands.sdk.workspace
Source: examples/
01_standalone_sdk/01_hello_world.py02_custom_tools.py03_activate_skill.py04_confirmation_mode_example.py05_use_llm_registry.py06_interactive_terminal_w_reasoning.py07_mcp_integration.py08_mcp_with_oauth.py09_pause_example.py10_persistence.py11_async.py12_custom_secrets.py13_get_llm_metrics.py14_context_condenser.py15_browser_use.py16_llm_security_analyzer.py17_image_input.py18_send_message_while_processing.py19_llm_routing.py20_stuck_detector.py21_generate_extraneous_conversation_costs.py22_anthropic_thinking.py23_responses_reasoning.py24_planning_agent_workflow.py25_agent_delegation.py26_custom_visualizer.py27_observability_laminar.py28_ask_agent_example.py29_llm_streaming.py30_tom_agent.py31_iterative_refinement.py32_configurable_security_policy.py33_hooks34_critic_example.py35_subscription_login.py36_event_json_to_openai_messages.py37_llm_profile_store38_browser_session_recording.py39_llm_fallback.py40_acp_agent_example.py41_task_tool_set.py42_file_based_subagents.py44_model_switching_in_convo.py45_parallel_tool_execution.py46_agent_settings.py47_defense_in_depth_security.py48_conversation_fork.py49_switch_llm_tool.py50_async_cancellation.py51_agent_hooks52_dynamic_workflow.py53_client_defined_tools.py54_goal_completion_loop.py02_remote_agent_server/01_convo_with_local_agent_server.py02_convo_with_docker_sandboxed_server.py03_browser_use_with_docker_sandboxed_server.py04_convo_with_api_sandboxed_server.py05_vscode_with_docker_sandboxed_server.py06_custom_tool07_convo_with_cloud_workspace.py08_convo_with_apptainer_sandboxed_server.py09_acp_agent_with_remote_runtime.py10_cloud_workspace_share_credentials.py11_conversation_fork.py12_settings_and_secrets_api.py13_workspace_get_llm.py14_client_defined_tools.py15_openai_compatible_gateway.py16_deferred_init.pyhook_scriptsscripts03_github_workflows/01_basic_action02_pr_review03_todo_management04_datadog_debugging05_posthog_debugging04_llm_specific_tools/01_gpt5_apply_patch_preset.py02_gemini_file_tools.py05_skills_and_plugins/01_loading_agentskills02_loading_plugins03_managing_installed_skills04_mixed_marketplace_skillstools
Iterate on a GitHub pull request — drive it through CI, code review, and QA until it is merge-ready. Poll verification layers with `gh` CLI, diagnose and fix CI failures, address review feedback, retry flaky checks, push fixes, and repeat. The agent is the orchestration loop.
development
Guides technical explanations toward flowing, direct, conversational prose. This skill should be used for engineering chat, design discussion, architecture analysis, code-review explanations, and technical recommendations that should be concise without becoming fragmented or vague.
tools
This skill should be used when the user asks to "set up a Jira automation to create pull requests", "poll Jira for create-pr issues", "automatically create GitHub PRs from Jira tickets", "deploy a Jira issue-to-PR automation", "create a Jira to GitHub PR workflow", or mentions automating GitHub PR creation from a Jira label. Deploys a cron-based OpenHands automation that watches a Jira Cloud project for issues labeled with a configurable label (default: "create-pr") and spawns an agent conversation to create a GitHub pull request for each new issue found. The target GitHub repository is read from the body of the Jira ticket - no repo parameter is required at deploy time.
tools
This skill should be used when the user asks to "create an automation", "schedule a task", "set up a cron job", "webhook integration", "event-triggered automation", or mentions automations, scheduled tasks, cron scheduling, or webhook events in OpenHands Cloud.