Skip to content

Add "Examples" workflow to demonstrate plugin behavior#110

Draft
rbren wants to merge 11 commits intomainfrom
add-python-type-annotations-plugin
Draft

Add "Examples" workflow to demonstrate plugin behavior#110
rbren wants to merge 11 commits intomainfrom
add-python-type-annotations-plugin

Conversation

@rbren
Copy link

@rbren rbren commented Mar 15, 2026

Summary

A simple plugin that instructs the agent to add valid Python type annotations to files or directories.

Features

  • SKILL.md with instructions for adding type annotations (parameters, return types, class attributes, best practices)
  • Example before/after Python files demonstrating the transformation
  • GitHub Action workflow (update-example.yml) to regenerate examples using OpenHands CLI
  • Trajectory output saved from headless runs

Plugin Structure

plugins/python-type-annotations/
├── .claude-plugin/
│   └── plugin.json
├── skills/
│   └── type-annotations/
│       └── SKILL.md
├── examples/
│   └── basic/
│       ├── prompt.md
│       ├── trajectory.json
│       ├── before/
│       │   └── hello.py
│       └── after/
│           └── hello.py
├── workflows/
│   └── update-example.yml
└── README.md

Usage

openhands run \
  --plugin github:OpenHands/extensions/plugins/python-type-annotations \
  --prompt "Add type annotations to all Python files in src/"

Example Transformation

Before:

def greet(name):
    return f"Hello, {name}!"

After:

def greet(name: str) -> str:
    return f"Hello, {name}!"

openhands-agent and others added 9 commits March 15, 2026 22:27
A simple plugin that instructs the agent to add valid Python type
annotations to files or directories.

Features:
- SKILL.md with instructions for adding type annotations
- Example before/after Python files
- GitHub Action workflow to regenerate examples using OpenHands CLI
- Saves trajectory.json output from headless runs

Co-authored-by: openhands <openhands@all-hands.dev>
- Moved update-example.yml to .github/workflows/update-type-annotations-example.yml
- Added workflow_dispatch input to specify branch (defaults to current branch)
- Updated README to reference new workflow location

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
- Use 'openhands --headless --json -f' instead of 'openhands run'
- Copy skills to .agents/skills/ in working directory
- Use LLM_API_KEY env var (not ANTHROPIC_API_KEY directly)
- Clean up .agents directory after run

Co-authored-by: openhands <openhands@all-hands.dev>
- Added --override-with-envs flag to allow headless mode without pre-existing settings
- Made LLM_MODEL and LLM_BASE_URL configurable as workflow inputs
- Changed from ANTHROPIC_API_KEY to LLM_API_KEY secret (standard env var name)
- LLM_BASE_URL is optional and can be set via secret or workflow input

Co-authored-by: openhands <openhands@all-hands.dev>
Instead of capturing noisy JSONL stdout:
- Run headless mode and capture conversation ID from output
- Export trajectory by combining event-*.json files from conversation dir
- Produces clean JSON with conversation_id and events array

Co-authored-by: openhands <openhands@all-hands.dev>
rbren and others added 2 commits March 15, 2026 16:06
@rbren rbren changed the title Add python-type-annotations plugin Add "Examples" workflow to demonstrate plugin behavior Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants