What is the OpenCode skill?
The agent-native OpenCode skill is a pre-written instruction file that teaches AI coding assistants (OpenCode, Cursor, Windsurf, etc.) how to use agent-native effectively. It provides:- Core workflow patterns (snapshot → interact → re-snapshot)
- Command reference with examples
- Best practices for reliable automation
- Common patterns for different app types
The skill follows the Agent Skills specification, making it compatible with OpenCode, Cursor, Claude Code, and other tools that support skill files.
Installation
Using npx skills (recommended)
If you have theskills CLI installed:
Manual installation
You can also add the skill manually to your project:- Create a
skills/directory in your project or home directory - Download the skill file from the agent-native repository
- Place it in
skills/agent-native/SKILL.md
For OpenCode
OpenCode automatically discovers skills in:~/.config/opencode/skills/./skills/(project-local)
agent-native skill folder in either location.
For Cursor
Add the skill content to your.cursorrules file:
What the skill provides
The skill teaches the AI agent:1. Core workflow
2. Command patterns
The skill includes all major commands with examples:- Navigation:
open,apps - Inspection:
snapshot,tree,find,inspect - Interaction:
click,fill,type,check,uncheck,select,focus,hover - State reading:
get text,get value,is enabled,is focused - Keyboard:
key,paste - Screenshots:
screenshot - Waiting:
wait
3. Electron app handling
4. Best practices
- Always use
-iwith snapshot for interactive elements only - Re-snapshot after navigation — old refs may not resolve
- Use
--jsonfor structured output when parsing in code - Fall back to keyboard when AX tree is sparse
Usage with OpenCode
Once installed, OpenCode automatically knows how to use agent-native:Usage with Cursor
With the skill in.cursorrules, Cursor will:
- Know to use
agent-nativefor macOS app automation tasks - Follow the snapshot → interact → re-snapshot pattern
- Handle errors and re-snapshot when needed
- Fall back to keyboard shortcuts for Electron apps
Usage with other tools
Any AI coding assistant that supports:- Shell command execution (runs
agent-nativecommands) - Instruction files (reads SKILL.md or similar)
- Multi-step reasoning (breaks tasks into steps)
Skill file structure
The skill file has these sections:Structure
Customizing the skill
You can customize the skill for your specific use cases:Add project-specific patterns
Add app-specific shortcuts
Override default behavior
Viewing the skill source
The complete skill file is available at:agent-native/SKILL.md
View the full skill source on GitHub
Example: Teaching custom workflows
Create a project-specific skill that extends the base agent-native skill:skills/custom-automation/SKILL.md
- Post standup message template:
Screenshot and share
-
Capture Safari window:
-
Paste into Slack:
Next steps
JSON output
Learn about structured output for programmatic use
Best practices
Essential patterns for reliable automation