Skip to main content

Skills (formerly Microagents)

Skills allow you to extend OpenHands prompts with information specific to your project and define how OpenHands should function. See Skills Overview for more information.

Setup Script

You can add a .openhands/setup.sh file, which will run every time OpenHands begins working with your repository. This is an ideal location for installing dependencies, setting environment variables, and performing other setup tasks. For example:

Hooks

You can add a .openhands/hooks.json file to run custom shell scripts at key moments during agent execution — such as blocking dangerous commands, enforcing linting before the agent finishes, or logging tool usage. See the dedicated Hooks page for the full guide.

Repository-Specific Stop Hooks

For repository-specific quality gates, use a Stop hook in .openhands/hooks.json. Stop hooks run when OpenHands tries to finish a task and can block completion until formatting, linting, tests, or other repo-specific checks pass. They work across current agent-server-backed OpenHands flows. For example, create .openhands/hooks/quality_gate.sh:
.openhands/hooks/quality_gate.sh
Then register it in .openhands/hooks.json:
.openhands/hooks.json
If you currently use .openhands/pre-commit.sh, migrate those checks to Stop hooks when you want quality gates to apply to current agent-server-backed OpenHands flows. Move the check commands into a Stop hook script like the one above. See the Hooks guide for complete behavior and JSON response details.