Skip to main content

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

If you have the skills CLI installed:
This installs the skill globally so it’s available in all your projects.

Manual installation

You can also add the skill manually to your project:
  1. Create a skills/ directory in your project or home directory
  2. Download the skill file from the agent-native repository
  3. Place it in skills/agent-native/SKILL.md

For OpenCode

OpenCode automatically discovers skills in:
  • ~/.config/opencode/skills/
  • ./skills/ (project-local)
Place the 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 -i with snapshot for interactive elements only
  • Re-snapshot after navigation — old refs may not resolve
  • Use --json for 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:
  1. Know to use agent-native for macOS app automation tasks
  2. Follow the snapshot → interact → re-snapshot pattern
  3. Handle errors and re-snapshot when needed
  4. Fall back to keyboard shortcuts for Electron apps

Usage with other tools

Any AI coding assistant that supports:
  • Shell command execution (runs agent-native commands)
  • Instruction files (reads SKILL.md or similar)
  • Multi-step reasoning (breaks tasks into steps)
can use the agent-native skill effectively.

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
You can also read it locally after installation:

Example: Teaching custom workflows

Create a project-specific skill that extends the base agent-native skill:
skills/custom-automation/SKILL.md
  1. Post standup message template:

Screenshot and share

  1. Capture Safari window:
  2. Paste into Slack:

Next steps

JSON output

Learn about structured output for programmatic use

Best practices

Essential patterns for reliable automation