Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/cobol-modernization/skills/build-setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ triggers:
Set up a build environment and create test fixtures for validating COBOL-to-Java migrations.

To install GnuCOBOL, run: `./scripts/install-gnucobol.sh`
On Windows, run that shell script from Git Bash/WSL (`bash scripts/install-gnucobol.sh`) or install GnuCOBOL with a Windows package manager and document the chosen command in `build_notes.md`.

## Phase 1: Build Setup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"
uv run python -m lc_sdk_examples.cobol_modernization --src-path /path/to/cobol/project
```

PowerShell equivalent for the environment setup:

```powershell
$env:LLM_API_KEY = "your-api-key"
$env:LLM_MODEL = "anthropic/claude-3-5-sonnet-20241022"

uv run python -m lc_sdk_examples.cobol_modernization --src-path C:\path\to\cobol\project
```

## Workflow Phases

### Phase 1: Build Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ uv run python -m lc_sdk_examples.migration_scoring \
--rubric-path /path/to/style_rubric.txt
```

PowerShell equivalent for the environment setup:

```powershell
$env:LLM_API_KEY = "your-api-key"
$env:LLM_MODEL = "anthropic/claude-3-5-sonnet-20241022"

uv run python -m lc_sdk_examples.migration_scoring `
--src-path C:\path\to\migration\project `
--rubric-path C:\path\to\style_rubric.txt
```

## Workflow Phases

### Phase 1: Migration Mapping
Expand Down
2 changes: 2 additions & 0 deletions plugins/onboarding/skills/agent-readiness-report/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Or scan all five at once:
for s in scripts/scan_*.sh; do bash "$s" /path/to/repo; echo; done
```

On Windows, run these `.sh` helpers from Git Bash or WSL and pass a path that environment can read. Native PowerShell cannot execute the shell scripts directly.

**Important**: The scripts are helpers, not scorers. They find files and
patterns but do not evaluate quality. Many features require judgment that only
reading the actual files can provide — for example, whether a README includes
Expand Down
7 changes: 7 additions & 0 deletions plugins/openhands/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ This plugin provides a unified entry point and the CLI integration script.
command -v openhands &>/dev/null && echo "CLI available" || echo "CLI not found"
```

PowerShell check:

```powershell
if (Get-Command openhands -ErrorAction SilentlyContinue) { "CLI available" } else { "CLI not found" }
```

2. **If CLI is available**, use it — it manages auth and API keys automatically.
3. **If CLI is not available**, check for an API key:
- Preferred env var: `OPENHANDS_CLOUD_API_KEY`
Expand All @@ -49,6 +55,7 @@ command -v openhands &>/dev/null && echo "CLI available" || echo "CLI not found"
```

The script checks for the CLI, installs it if needed, sends the task, and opens the resulting conversation URL.
On Windows, run this POSIX shell script from Git Bash or WSL (`bash scripts/run.sh "Investigate flaky tests in tests/test_api.py"`) unless a native PowerShell launcher is available.

If the script exits with code `2` (`AUTH_REQUIRED`), ask the user to complete authentication in the browser, then re-run.

Expand Down
9 changes: 9 additions & 0 deletions plugins/release-notes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ curl -o .github/workflows/release-notes.yml \
https://raw.githubusercontent.com/OpenHands/extensions/main/plugins/release-notes/workflows/release-notes.yml
```

PowerShell equivalent:

```powershell
New-Item -ItemType Directory -Force .github\workflows | Out-Null
Invoke-WebRequest `
-Uri https://raw.githubusercontent.com/OpenHands/extensions/main/plugins/release-notes/workflows/release-notes.yml `
-OutFile .github\workflows\release-notes.yml
```

Configure required secrets (see the README for details).

### Manual Invocation
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-skills-catalog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function buildCatalog(skillsDir) {
const skillMd = join(dirPath, "SKILL.md");
if (!existsSync(skillMd)) continue;

const raw = readFileSync(skillMd, "utf-8");
const raw = readFileSync(skillMd, "utf-8").replace(/\r\n?/g, "\n");
const parts = raw.split("---");
if (parts.length < 3) {
console.warn(`Warning: ${skillMd} missing frontmatter sections, skipping`);
Expand Down
2 changes: 2 additions & 0 deletions skills/add-skill/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ python3 scripts/fetch_skill.py "https://github.com/OpenHands/extensions/tree/mai
ls /path/to/workspace/.agents/skills/codereview/SKILL.md
```

On Windows, use `python` if `python3` is not available and verify with PowerShell, for example: `Test-Path C:\path\to\workspace\.agents\skills\codereview\SKILL.md`.

Response: "✅ Added `codereview` to your workspace. The skill is now available."

## Notes
Expand Down
13 changes: 12 additions & 1 deletion skills/azure-devops/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ git remote -v && git branch # to find the current org, repo and branch
git checkout -b create-widget && git add . && git commit -m "Create widget" && git push -u origin create-widget
```

On Windows PowerShell, run those `git` commands as separate commands if `&&` is not supported by the installed shell.

## Azure DevOps API Usage

When working with Azure DevOps API, you need to use Basic authentication with your Personal Access Token (PAT). The username is ignored (empty string), and the password is the PAT.
Expand All @@ -43,8 +45,17 @@ AUTH=$(echo -n ":$AZURE_DEVOPS_TOKEN" | base64)
curl -H "Authorization: Basic $AUTH" -H "Content-Type: application/json" https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1
```

PowerShell equivalent for the PAT header:

```powershell
$auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$env:AZURE_DEVOPS_TOKEN"))
Invoke-RestMethod `
-Headers @{ Authorization = "Basic $auth"; "Content-Type" = "application/json" } `
-Uri "https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1"
```

Common API endpoints:
- List repositories: `https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1`
- Get repository details: `https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}?api-version=7.1`
- List pull requests: `https://dev.azure.com/{organization}/{project}/_apis/git/pullrequests?api-version=7.1`
- Create pull request: `https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?api-version=7.1` (POST)
- Create pull request: `https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?api-version=7.1` (POST)
13 changes: 12 additions & 1 deletion skills/bitbucket/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ ENCODED_PASS=$(python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sy
git remote set-url origin "https://${ENCODED_USER}:${ENCODED_PASS}@bitbucket.org/username/repo.git"
```

PowerShell equivalent for the remote URL encoding:

```powershell
$parts = $env:BITBUCKET_TOKEN -split ":", 2
$encodedUser = [Uri]::EscapeDataString($parts[0])
$encodedPass = [Uri]::EscapeDataString($parts[1])
git remote set-url origin "https://${encodedUser}:${encodedPass}@bitbucket.org/username/repo.git"
```

Atlassian's Bitbucket Cloud docs recommend avoiding long-lived credentials in the remote URL when possible. Their API token examples use either `https://{bitbucket_username}:{api_token}@...` or `https://x-bitbucket-api-token-auth:{api_token}@...`; OpenHands users should only construct those URLs on demand, with proper URL encoding.

Here are some instructions for pushing, but ONLY do this if the user asks you to:
Expand All @@ -42,4 +51,6 @@ Here are some instructions for pushing, but ONLY do this if the user asks you to
```bash
git remote -v && git branch # to find the current org, repo and branch
git checkout -b create-widget && git add . && git commit -m "Create widget" && git push -u origin create-widget
```
```

On Windows PowerShell, run those `git` commands as separate commands if `&&` is not supported by the installed shell.
1 change: 1 addition & 0 deletions skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The prompt includes a **Files Changed** manifest listing every file in the PR, f
3. Only after both checks come up empty should you flag something as missing. Even then, prefer "I could not locate X" over "X is missing" — the file may be in a path you haven't searched.

Before posting an **inline review comment that names a specific line number**, verify the line maps to what you think it does (`sed -n 'X,Yp' <file>` or `view`). Line numbers derived by counting `+`/`-`/context lines from a `@@` hunk header are not reliable; ground them against the file.
On Windows PowerShell, use `Get-Content`, `Select-String`, or `(Get-Content <file>)[($start - 1)..($end - 1)]` for the same file and line checks.

CODE REVIEW SCENARIOS:

Expand Down
4 changes: 3 additions & 1 deletion skills/datadog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ triggers:

# Datadog

Windows PowerShell equivalents for the Datadog `curl`, environment-variable, timestamp, and JSON formatting snippets are in `references/windows.md`.

<IMPORTANT>
Before performing any Datadog operations, first check if the required environment variables are set:

Expand Down Expand Up @@ -92,4 +94,4 @@ curl -s -G "https://api.${DD_SITE}/api/v1/monitor" \
- [APM/Tracing API](https://docs.datadoghq.com/api/latest/tracing/)
- [Monitors API](https://docs.datadoghq.com/api/latest/monitors/)
- [Events API](https://docs.datadoghq.com/api/latest/events/)
- [Dashboards API](https://docs.datadoghq.com/api/latest/dashboards/)
- [Dashboards API](https://docs.datadoghq.com/api/latest/dashboards/)
45 changes: 45 additions & 0 deletions skills/datadog/references/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Windows Notes for Datadog Commands

Use these PowerShell forms when running the Datadog examples natively on Windows.

## Check Required Environment Variables

```powershell
foreach ($name in "DD_API_KEY", "DD_APP_KEY", "DD_SITE") {
if ([Environment]::GetEnvironmentVariable($name)) {
"$name is set"
} else {
"$name is NOT set"
}
}
```

## Run the Curl Examples

In PowerShell, call `curl.exe` so the examples use real curl rather than the `curl` alias. Replace `${DD_SITE}` with `$env:DD_SITE` and `${DD_API_KEY}` / `${DD_APP_KEY}` with `$env:DD_API_KEY` / `$env:DD_APP_KEY`.

```powershell
curl.exe -s -X POST "https://api.$env:DD_SITE/api/v2/logs/events/search" `
-H "DD-API-KEY: $env:DD_API_KEY" `
-H "DD-APPLICATION-KEY: $env:DD_APP_KEY" `
-H "Content-Type: application/json" `
-d '{"filter":{"query":"service:my-service status:error","from":"now-1h","to":"now"},"sort":"-timestamp","page":{"limit":50}}' |
ConvertFrom-Json
```

## Replace Linux Date and Jq

The metrics example uses `date -d` and `jq`. In PowerShell, compute Unix timestamps with .NET and pipe JSON to `ConvertFrom-Json`.

```powershell
$from = [DateTimeOffset]::UtcNow.AddHours(-1).ToUnixTimeSeconds()
$to = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds()

curl.exe -s -G "https://api.$env:DD_SITE/api/v1/query" `
-H "DD-API-KEY: $env:DD_API_KEY" `
-H "DD-APPLICATION-KEY: $env:DD_APP_KEY" `
--data-urlencode "query=avg:system.cpu.user{*}" `
--data-urlencode "from=$from" `
--data-urlencode "to=$to" |
ConvertFrom-Json
```
2 changes: 2 additions & 0 deletions skills/discord/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Use this skill when implementing or automating Discord integrations.

## Quick recipes

The shell snippets below use POSIX-style environment variables and line continuations. On Windows PowerShell, use `curl.exe` for the shown flags and `$env:DISCORD_WEBHOOK_URL` / `$env:DISCORD_BOT_TOKEN` for environment variables, or translate the request to `Invoke-RestMethod`.

### Post a message via an incoming webhook (recommended)

Discord requires at least one of `content`, `embeds`, `components`, `file`, or `poll`.
Expand Down
6 changes: 5 additions & 1 deletion skills/docker/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ sudo dockerd > /tmp/docker.log 2>&1 &
sleep 5
```

On Windows, start Docker Desktop or the Docker service instead of running `sudo dockerd`; then run Docker commands from PowerShell without `sudo`.

## Verifying Docker Installation

To verify Docker is working correctly, run the hello-world container:

```bash
sudo docker run hello-world
```
```

PowerShell equivalent after Docker Desktop is running: `docker run hello-world`.
1 change: 1 addition & 0 deletions skills/github-pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ triggers:
# GitHub PR Review

Post structured code review feedback using the GitHub API with inline comments on specific lines.
Windows PowerShell equivalents for JSON file creation, temp paths, line lookup, and fallback `curl` are in `references/windows.md`.

## Key Rule: One API Call

Expand Down
47 changes: 47 additions & 0 deletions skills/github-pr-review/references/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Windows Notes for GitHub PR Review Commands

Use these PowerShell forms for the JSON-file, line-check, and fallback API snippets.

## Create the Review JSON File

```powershell
$reviewJson = Join-Path $env:TEMP "review.json"
@'
{
"commit_id": "{commit_sha}",
"event": "COMMENT",
"body": "Brief 1-3 sentence summary.",
"comments": []
}
'@ | Set-Content -LiteralPath $reviewJson -Encoding utf8
```

Then pass the file to `gh`:

```powershell
gh api -X POST repos/{owner}/{repo}/pulls/{pr_number}/reviews --input $reviewJson
```

## Verify File Lines

Use `Select-String` for pattern lookup and `Get-Content` for exact ranges.

```powershell
Select-String -Path filename -Pattern "pattern"

$lines = Get-Content -LiteralPath filename
$lines[41] # line 42, because arrays are zero-based
$lines[($start - 1)..($end - 1)]
```

## Fallback Curl

Use `curl.exe` so PowerShell does not resolve `curl` to its alias.

```powershell
curl.exe -X POST `
-H "Authorization: token $env:GITHUB_TOKEN" `
-H "Accept: application/vnd.github+json" `
"https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}/reviews" `
--data-binary "@$reviewJson"
```
1 change: 1 addition & 0 deletions skills/github-pr-reviewer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ triggers:
Create a cron automation that watches a GitHub repository for pull requests
with a review trigger label, starts an OpenHands review conversation once per
label event, and posts the AI review as a GitHub comment.
Windows PowerShell equivalents for the setup, packaging, upload, and API-check shell snippets are in `references/windows.md`.

The automation script is deterministic: PR discovery, label-event tracking,
state persistence, stale-result suppression, and GitHub comment posting are
Expand Down
61 changes: 61 additions & 0 deletions skills/github-pr-reviewer/references/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Windows Notes for GitHub PR Reviewer Setup

Use these PowerShell forms when creating the reviewer automation from Windows.

## Validate the GitHub Token

```powershell
Invoke-RestMethod `
-Uri "https://api.github.com/user" `
-Headers @{ Authorization = "Bearer $env:GITHUB_PERSONAL_ACCESS_TOKEN" }
```

## Build Directory and Syntax Check

```powershell
$buildDir = Join-Path $env:TEMP "pr-reviewer-build"
New-Item -ItemType Directory -Force $buildDir | Out-Null
# write the customised main.py to (Join-Path $buildDir "main.py")

python -m py_compile (Join-Path $buildDir "main.py")
if ($LASTEXITCODE -eq 0) { "Syntax OK" }
```

## Package and Upload

Modern Windows includes `tar.exe`. Use it to create the `.tar.gz` expected by the automation API.

```powershell
$tarball = Join-Path $env:TEMP "pr-reviewer.tar.gz"
tar.exe -czf $tarball -C $buildDir .

$upload = curl.exe -s -X POST `
"$env:OPENHANDS_HOST/api/automation/v1/uploads?name=github-pr-reviewer" `
-H "X-Session-API-Key: $env:OPENHANDS_AUTOMATION_API_KEY" `
-H "Content-Type: application/gzip" `
--data-binary "@$tarball" | ConvertFrom-Json

$tarballPath = $upload.tarball_path
"Uploaded: $tarballPath"
```

## Register the Automation

Use a double-quoted here-string when the body needs PowerShell variable interpolation.

```powershell
$body = @"
{
"name": "GitHub PR Reviewer: {owner}/{repo}",
"trigger": {"type": "cron", "schedule": "{cron_schedule}"},
"tarball_path": "$tarballPath",
"entrypoint": "python3 main.py",
"timeout": 300
}
"@

curl.exe -s -X POST "$env:OPENHANDS_HOST/api/automation/v1" `
-H "X-Session-API-Key: $env:OPENHANDS_AUTOMATION_API_KEY" `
-H "Content-Type: application/json" `
-d $body
```
1 change: 1 addition & 0 deletions skills/github-repo-monitor/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ triggers:

Create a cron automation that polls a single GitHub repository on a
configurable schedule (default: every minute).
Windows PowerShell equivalents for the setup, packaging, upload, and API-check shell snippets are in `references/windows.md`.

When a comment on an issue or PR contains the **trigger phrase**
(default: `@OpenHands`) it:
Expand Down
Loading
Loading