@openhands/extensions 0.0.1-alpha → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/custom-codereview-guide.md +25 -0
- package/.github/pull_request_template.md +38 -0
- package/.github/release.yml +14 -0
- package/.github/workflows/check-extensions.yml +72 -0
- package/.github/workflows/npm-publish.yml +89 -0
- package/.github/workflows/pr.yml +30 -0
- package/.github/workflows/release.yml +24 -0
- package/.github/workflows/tests.yml +25 -0
- package/.github/workflows/vulnerability-scan.yml +87 -0
- package/.release-please-manifest.json +3 -0
- package/AGENTS.md +132 -0
- package/README.md +10 -0
- package/analysis_results.md +162 -0
- package/marketplaces/large-codebase.json +66 -0
- package/marketplaces/openhands-extensions.json +682 -0
- package/package.json +4 -10
- package/plugins/README.md +30 -0
- package/plugins/city-weather/.plugin/plugin.json +13 -0
- package/plugins/city-weather/README.md +145 -0
- package/plugins/city-weather/commands/now.md +56 -0
- package/plugins/cobol-modernization/.plugin/plugin.json +19 -0
- package/plugins/cobol-modernization/README.md +201 -0
- package/plugins/cobol-modernization/references/troubleshooting.md +18 -0
- package/plugins/cobol-modernization/skills/build-setup/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/build-setup/scripts/install-gnucobol.sh +32 -0
- package/plugins/cobol-modernization/skills/cobol-modernization-overview/SKILL.md +113 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/SKILL.md +62 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/references/cics-transformation-examples.md +45 -0
- package/plugins/cobol-modernization/skills/mainframe-planning/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/to-java-migration/SKILL.md +59 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/cobol-to-java-example.md +58 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/datatype-mappings.md +19 -0
- package/plugins/issue-duplicate-checker/.plugin/plugin.json +13 -0
- package/plugins/issue-duplicate-checker/README.md +51 -0
- package/plugins/issue-duplicate-checker/action.yml +349 -0
- package/plugins/issue-duplicate-checker/scripts/auto_close_duplicate_issues.py +569 -0
- package/plugins/issue-duplicate-checker/scripts/issue_duplicate_check_openhands.py +681 -0
- package/plugins/issue-duplicate-checker/scripts/post_duplicate_notice.js +220 -0
- package/plugins/issue-duplicate-checker/scripts/remove_duplicate_candidate_label.js +27 -0
- package/plugins/magic-test/.plugin/plugin.json +13 -0
- package/plugins/magic-test/skills/magic-word/SKILL.md +33 -0
- package/plugins/migration-scoring/.plugin/plugin.json +19 -0
- package/plugins/migration-scoring/README.md +244 -0
- package/plugins/migration-scoring/skills/migration-mapping/SKILL.md +72 -0
- package/plugins/migration-scoring/skills/migration-report/SKILL.md +118 -0
- package/plugins/migration-scoring/skills/migration-scoring-overview/SKILL.md +126 -0
- package/plugins/migration-scoring/skills/score-quality/SKILL.md +54 -0
- package/plugins/migration-scoring/skills/score-quality/references/scoring-criteria.md +30 -0
- package/plugins/migration-scoring/skills/score-style/SKILL.md +106 -0
- package/plugins/onboarding/.plugin/plugin.json +20 -0
- package/plugins/onboarding/README.md +30 -0
- package/plugins/onboarding/references/criteria.md +144 -0
- package/plugins/onboarding/skills/agent-readiness-report/README.md +23 -0
- package/plugins/onboarding/skills/agent-readiness-report/SKILL.md +122 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_agent_instructions.sh +88 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_build_env.sh +114 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_feedback_loops.sh +133 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_policy.sh +113 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_workflows.sh +127 -0
- package/plugins/onboarding/skills/improve-agent-readiness/README.md +19 -0
- package/plugins/onboarding/skills/improve-agent-readiness/SKILL.md +167 -0
- package/plugins/onboarding/skills/setup-agents-md/README.md +15 -0
- package/plugins/onboarding/skills/setup-agents-md/SKILL.md +150 -0
- package/plugins/onboarding/skills/setup-openhands/README.md +20 -0
- package/plugins/onboarding/skills/setup-openhands/SKILL.md +56 -0
- package/plugins/onboarding/skills/setup-pr-review/README.md +23 -0
- package/plugins/onboarding/skills/setup-pr-review/SKILL.md +72 -0
- package/plugins/openhands/.plugin/plugin.json +13 -0
- package/plugins/openhands/README.md +52 -0
- package/plugins/openhands/SKILL.md +61 -0
- package/plugins/openhands/commands/create.md +55 -0
- package/plugins/openhands/commands/openhands-cloud.md +8 -0
- package/plugins/openhands/scripts/run.sh +69 -0
- package/plugins/pr-review/.plugin/plugin.json +13 -0
- package/plugins/pr-review/README.md +393 -0
- package/plugins/pr-review/action.yml +298 -0
- package/plugins/pr-review/scripts/agent_script.py +1282 -0
- package/plugins/pr-review/scripts/evaluate_review.py +655 -0
- package/plugins/pr-review/scripts/prompt.py +260 -0
- package/plugins/pr-review/workflows/pr-review-by-openhands.yml +51 -0
- package/plugins/pr-review/workflows/pr-review-evaluation.yml +85 -0
- package/plugins/qa-changes/.plugin/plugin.json +11 -0
- package/plugins/qa-changes/README.md +185 -0
- package/plugins/qa-changes/action.yml +181 -0
- package/plugins/qa-changes/scripts/agent_script.py +406 -0
- package/plugins/qa-changes/scripts/evaluate_qa_changes.py +385 -0
- package/plugins/qa-changes/scripts/prompt.py +174 -0
- package/plugins/qa-changes/workflows/qa-changes-by-openhands.yml +50 -0
- package/plugins/qa-changes/workflows/qa-changes-evaluation.yml +85 -0
- package/plugins/release-notes/.plugin/plugin.json +19 -0
- package/plugins/release-notes/README.md +283 -0
- package/plugins/release-notes/SKILL.md +83 -0
- package/plugins/release-notes/action.yml +117 -0
- package/plugins/release-notes/commands/release-notes.md +8 -0
- package/plugins/release-notes/scripts/agent_script.py +292 -0
- package/plugins/release-notes/scripts/generate_release_notes.py +733 -0
- package/plugins/release-notes/scripts/prompt.py +90 -0
- package/plugins/release-notes/scripts/validate_release_notes.py +328 -0
- package/plugins/release-notes/workflows/release-notes.yml +76 -0
- package/plugins/vulnerability-remediation/.plugin/plugin.json +19 -0
- package/plugins/vulnerability-remediation/README.md +217 -0
- package/plugins/vulnerability-remediation/action.yml +187 -0
- package/plugins/vulnerability-remediation/scripts/scan_and_remediate.py +561 -0
- package/plugins/vulnerability-remediation/workflows/vulnerability-scan.yml +87 -0
- package/pyproject.toml +12 -0
- package/release-please-config.json +16 -0
- package/scripts/sync_extensions.py +494 -0
- package/scripts/sync_openhands_sdk_skill.py +264 -0
- package/skills/README.md +159 -0
- package/skills/add-javadoc/.plugin/plugin.json +18 -0
- package/skills/add-javadoc/README.md +40 -0
- package/skills/add-javadoc/SKILL.md +35 -0
- package/skills/add-javadoc/references/example.md +32 -0
- package/skills/add-skill/.plugin/plugin.json +18 -0
- package/skills/add-skill/README.md +67 -0
- package/skills/add-skill/SKILL.md +47 -0
- package/skills/add-skill/scripts/fetch_skill.py +259 -0
- package/skills/agent-creator/.plugin/plugin.json +20 -0
- package/skills/agent-creator/README.md +104 -0
- package/skills/agent-creator/SKILL.md +190 -0
- package/skills/agent-creator/commands/agent-creator.md +8 -0
- package/skills/agent-creator/references/fallback.md +117 -0
- package/skills/agent-memory/.plugin/plugin.json +18 -0
- package/skills/agent-memory/README.md +35 -0
- package/skills/agent-memory/SKILL.md +30 -0
- package/skills/agent-memory/commands/remember.md +8 -0
- package/skills/agent-sdk-builder/.plugin/plugin.json +18 -0
- package/skills/agent-sdk-builder/README.md +40 -0
- package/skills/agent-sdk-builder/SKILL.md +37 -0
- package/skills/agent-sdk-builder/commands/agent-builder.md +8 -0
- package/skills/azure-devops/.plugin/plugin.json +18 -0
- package/skills/azure-devops/README.md +55 -0
- package/skills/azure-devops/SKILL.md +50 -0
- package/skills/bitbucket/.plugin/plugin.json +17 -0
- package/skills/bitbucket/README.md +50 -0
- package/skills/bitbucket/SKILL.md +45 -0
- package/skills/code-review/.plugin/plugin.json +19 -0
- package/skills/code-review/README.md +18 -0
- package/skills/code-review/SKILL.md +208 -0
- package/skills/code-review/commands/codereview-roasted.md +8 -0
- package/skills/code-review/commands/codereview.md +8 -0
- package/skills/code-review/references/risk-evaluation.md +41 -0
- package/skills/code-review/references/supply-chain-security.md +31 -0
- package/skills/code-simplifier/.plugin/plugin.json +21 -0
- package/skills/code-simplifier/README.md +30 -0
- package/skills/code-simplifier/SKILL.md +91 -0
- package/skills/code-simplifier/commands/simplify.md +8 -0
- package/skills/code-simplifier/references/code-quality-review.md +86 -0
- package/skills/code-simplifier/references/code-reuse-review.md +63 -0
- package/skills/code-simplifier/references/efficiency-review.md +81 -0
- package/skills/datadog/.plugin/plugin.json +19 -0
- package/skills/datadog/README.md +100 -0
- package/skills/datadog/SKILL.md +95 -0
- package/skills/deno/.plugin/plugin.json +18 -0
- package/skills/deno/README.md +5 -0
- package/skills/deno/SKILL.md +99 -0
- package/skills/deno/references/README.md +6 -0
- package/skills/discord/.plugin/plugin.json +18 -0
- package/skills/discord/README.md +31 -0
- package/skills/discord/SKILL.md +109 -0
- package/skills/discord/__init__.py +0 -0
- package/skills/discord/references/REFERENCE.md +78 -0
- package/skills/discord/scripts/__init__.py +0 -0
- package/skills/discord/scripts/_http.py +127 -0
- package/skills/discord/scripts/post_webhook.py +106 -0
- package/skills/discord/scripts/send_message.py +102 -0
- package/skills/docker/.plugin/plugin.json +17 -0
- package/skills/docker/README.md +34 -0
- package/skills/docker/SKILL.md +29 -0
- package/skills/evidence-based-citations/.plugin/plugin.json +20 -0
- package/skills/evidence-based-citations/README.md +31 -0
- package/skills/evidence-based-citations/SKILL.md +59 -0
- package/skills/flarglebargle/.plugin/plugin.json +16 -0
- package/skills/flarglebargle/README.md +14 -0
- package/skills/flarglebargle/SKILL.md +9 -0
- package/skills/frontend-design/.plugin/plugin.json +21 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/README.md +42 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/github/.plugin/plugin.json +19 -0
- package/skills/github/README.md +42 -0
- package/skills/github/SKILL.md +106 -0
- package/skills/github-pr-review/.plugin/plugin.json +18 -0
- package/skills/github-pr-review/README.md +145 -0
- package/skills/github-pr-review/SKILL.md +148 -0
- package/skills/github-pr-review/commands/github-pr-review.md +8 -0
- package/skills/github-pr-reviewer/.plugin/plugin.json +20 -0
- package/skills/github-pr-reviewer/README.md +34 -0
- package/skills/github-pr-reviewer/SKILL.md +89 -0
- package/skills/github-pr-reviewer/commands/pr-reviewer:setup.md +8 -0
- package/skills/github-repo-monitor/.plugin/plugin.json +22 -0
- package/skills/github-repo-monitor/README.md +70 -0
- package/skills/github-repo-monitor/SKILL.md +316 -0
- package/skills/github-repo-monitor/commands/github-monitor:poll.md +8 -0
- package/skills/github-repo-monitor/references/github-api.md +241 -0
- package/skills/github-repo-monitor/references/state-schema.md +160 -0
- package/skills/github-repo-monitor/scripts/main.py +915 -0
- package/skills/github-repo-monitor/tests/test_main.py +400 -0
- package/skills/gitlab/.plugin/plugin.json +17 -0
- package/skills/gitlab/README.md +37 -0
- package/skills/gitlab/SKILL.md +32 -0
- package/skills/incident-retrospective/.plugin/plugin.json +21 -0
- package/skills/incident-retrospective/README.md +34 -0
- package/skills/incident-retrospective/SKILL.md +98 -0
- package/skills/incident-retrospective/commands/incident-retro:setup.md +8 -0
- package/skills/iterate/.plugin/plugin.json +13 -0
- package/skills/iterate/README.md +25 -0
- package/skills/iterate/SKILL.md +399 -0
- package/skills/iterate/commands/babysit.md +8 -0
- package/skills/iterate/commands/iterate.md +8 -0
- package/skills/iterate/commands/verify.md +8 -0
- package/skills/iterate/references/heuristics.md +58 -0
- package/skills/iterate/references/verification.md +96 -0
- package/skills/jupyter/.plugin/plugin.json +18 -0
- package/skills/jupyter/README.md +55 -0
- package/skills/jupyter/SKILL.md +50 -0
- package/skills/kubernetes/.plugin/plugin.json +18 -0
- package/skills/kubernetes/README.md +53 -0
- package/skills/kubernetes/SKILL.md +48 -0
- package/skills/learn-from-code-review/.plugin/plugin.json +19 -0
- package/skills/learn-from-code-review/README.md +64 -0
- package/skills/learn-from-code-review/SKILL.md +186 -0
- package/skills/learn-from-code-review/commands/learn-from-reviews.md +8 -0
- package/skills/linear/.plugin/plugin.json +19 -0
- package/skills/linear/README.md +58 -0
- package/skills/linear/SKILL.md +213 -0
- package/skills/linear-triage/.plugin/plugin.json +21 -0
- package/skills/linear-triage/README.md +34 -0
- package/skills/linear-triage/SKILL.md +91 -0
- package/skills/linear-triage/commands/linear-triage:setup.md +8 -0
- package/skills/notion/.plugin/plugin.json +17 -0
- package/skills/notion/README.md +114 -0
- package/skills/notion/SKILL.md +109 -0
- package/skills/npm/.plugin/plugin.json +17 -0
- package/skills/npm/README.md +14 -0
- package/skills/npm/SKILL.md +9 -0
- package/skills/openhands-api/.plugin/plugin.json +22 -0
- package/skills/openhands-api/README.md +48 -0
- package/skills/openhands-api/SKILL.md +399 -0
- package/skills/openhands-api/references/README.md +33 -0
- package/skills/openhands-api/references/TROUBLESHOOTING.md +81 -0
- package/skills/openhands-api/references/example_prompt.md +12 -0
- package/skills/openhands-api/scripts/openhands_api.py +606 -0
- package/skills/openhands-api/scripts/openhands_api.ts +252 -0
- package/skills/openhands-automation/.plugin/plugin.json +19 -0
- package/skills/openhands-automation/README.md +89 -0
- package/skills/openhands-automation/SKILL.md +875 -0
- package/skills/openhands-automation/commands/automation:create.md +8 -0
- package/skills/openhands-automation/references/ab-testing.md +185 -0
- package/skills/openhands-automation/references/custom-automation.md +644 -0
- package/skills/openhands-sdk/.plugin/plugin.json +20 -0
- package/skills/openhands-sdk/README.md +22 -0
- package/skills/openhands-sdk/SKILL.md +229 -0
- package/skills/openhands-sdk/commands/sdk.md +8 -0
- package/skills/pdflatex/.plugin/plugin.json +18 -0
- package/skills/pdflatex/README.md +39 -0
- package/skills/pdflatex/SKILL.md +34 -0
- package/skills/prd/.plugin/plugin.json +19 -0
- package/skills/prd/README.md +28 -0
- package/skills/prd/SKILL.md +237 -0
- package/skills/prd/commands/prd.md +8 -0
- package/skills/qa-changes/README.md +18 -0
- package/skills/qa-changes/SKILL.md +229 -0
- package/skills/qa-changes/commands/qa-changes.md +8 -0
- package/skills/release-notes/README.md +24 -0
- package/skills/release-notes/SKILL.md +19 -0
- package/skills/release-notes/commands/release-notes.md +8 -0
- package/skills/research-brief/.plugin/plugin.json +20 -0
- package/skills/research-brief/README.md +34 -0
- package/skills/research-brief/SKILL.md +99 -0
- package/skills/research-brief/commands/research-brief:setup.md +8 -0
- package/skills/security/.plugin/plugin.json +18 -0
- package/skills/security/README.md +38 -0
- package/skills/security/SKILL.md +33 -0
- package/skills/skill-creator/.plugin/plugin.json +17 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/README.md +182 -0
- package/skills/skill-creator/SKILL.md +545 -0
- package/skills/skill-creator/references/output-patterns.md +82 -0
- package/skills/skill-creator/references/workflows.md +28 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/skills/slack-channel-monitor/.plugin/plugin.json +21 -0
- package/skills/slack-channel-monitor/README.md +91 -0
- package/skills/slack-channel-monitor/SKILL.md +276 -0
- package/skills/slack-channel-monitor/commands/slack-monitor:poll.md +8 -0
- package/skills/slack-channel-monitor/references/slack-api.md +207 -0
- package/skills/slack-channel-monitor/references/state-schema.md +180 -0
- package/skills/slack-channel-monitor/scripts/main.py +962 -0
- package/skills/slack-standup-digest/.plugin/plugin.json +21 -0
- package/skills/slack-standup-digest/README.md +34 -0
- package/skills/slack-standup-digest/SKILL.md +92 -0
- package/skills/slack-standup-digest/commands/standup-digest:setup.md +8 -0
- package/skills/spark-version-upgrade/.plugin/plugin.json +20 -0
- package/skills/spark-version-upgrade/README.md +54 -0
- package/skills/spark-version-upgrade/SKILL.md +233 -0
- package/skills/ssh/.plugin/plugin.json +18 -0
- package/skills/ssh/README.md +140 -0
- package/skills/ssh/SKILL.md +135 -0
- package/skills/swift-linux/.plugin/plugin.json +17 -0
- package/skills/swift-linux/README.md +86 -0
- package/skills/swift-linux/SKILL.md +81 -0
- package/skills/theme-factory/.plugin/plugin.json +19 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/README.md +58 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/uv/.plugin/plugin.json +18 -0
- package/skills/uv/README.md +5 -0
- package/skills/uv/SKILL.md +95 -0
- package/skills/uv/references/README.md +5 -0
- package/skills/vercel/.plugin/plugin.json +18 -0
- package/skills/vercel/README.md +108 -0
- package/skills/vercel/SKILL.md +103 -0
- package/tests/test_add_skill_installs_to_agents_dir.py +42 -0
- package/tests/test_catalogs.py +109 -0
- package/tests/test_code_review_risk_evaluation.py +94 -0
- package/tests/test_issue_duplicate_checker.py +240 -0
- package/tests/test_openhands_api_python.py +152 -0
- package/tests/test_plugin_manifest.py +83 -0
- package/tests/test_pr_review_diff_payload.py +202 -0
- package/tests/test_pr_review_feedback.py +263 -0
- package/tests/test_pr_review_prompt.py +152 -0
- package/tests/test_pr_review_review_context.py +253 -0
- package/tests/test_qa_changes.py +232 -0
- package/tests/test_qa_changes_evaluation.py +259 -0
- package/tests/test_release_notes_generator.py +990 -0
- package/tests/test_sdk_loading.py +150 -0
- package/tests/test_skill_plugin_loading.py +149 -0
- package/tests/test_skills_have_readme.py +66 -0
- package/tests/test_sync_extensions.py +292 -0
- package/tests/test_workflow_sync.py +46 -0
- package/utils/analysis/README.md +7 -0
- package/utils/analysis/laminar_signals/README.md +211 -0
- package/utils/analysis/laminar_signals/analyze.py +780 -0
- package/utils/analysis/laminar_signals/templates/default.j2 +49 -0
- package/utils/analysis/laminar_signals/templates/pr_review.j2 +61 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Auto-generate skills/openhands-sdk/SKILL.md from live data sources.
|
|
3
|
+
|
|
4
|
+
Data sources:
|
|
5
|
+
1. https://docs.openhands.dev/llms.txt - SDK doc index
|
|
6
|
+
2. GitHub API for OpenHands/software-agent-sdk - examples + hello world
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python scripts/sync_openhands_sdk_skill.py # regenerate SKILL.md
|
|
10
|
+
python scripts/sync_openhands_sdk_skill.py --check # CI mode: fail if stale
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import argparse
|
|
16
|
+
import difflib
|
|
17
|
+
import json
|
|
18
|
+
import os
|
|
19
|
+
import re
|
|
20
|
+
import sys
|
|
21
|
+
import textwrap
|
|
22
|
+
import urllib.error
|
|
23
|
+
import urllib.request
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
|
|
26
|
+
SKILL_PATH = Path(__file__).resolve().parent.parent / "skills" / "openhands-sdk" / "SKILL.md"
|
|
27
|
+
LLMS_TXT_URL = "https://docs.openhands.dev/llms.txt"
|
|
28
|
+
GH_API = "https://api.github.com/repos/OpenHands/software-agent-sdk/contents/examples"
|
|
29
|
+
GH_RAW = "https://raw.githubusercontent.com/OpenHands/software-agent-sdk/main"
|
|
30
|
+
GH_BROWSE = "https://github.com/OpenHands/software-agent-sdk/blob/main/examples"
|
|
31
|
+
GH_TREE = "https://github.com/OpenHands/software-agent-sdk/tree/main/examples"
|
|
32
|
+
HELLO_WORLD = f"{GH_RAW}/examples/01_standalone_sdk/01_hello_world.py"
|
|
33
|
+
|
|
34
|
+
FRONTMATTER = """\
|
|
35
|
+
---
|
|
36
|
+
name: openhands-sdk
|
|
37
|
+
description: >-
|
|
38
|
+
Reference skill for the OpenHands Software Agent SDK - the Python framework
|
|
39
|
+
for building AI agents that write software. Use when you need to build agents
|
|
40
|
+
with the SDK, create custom tools, configure LLMs, manage conversations,
|
|
41
|
+
delegate to sub-agents, or deploy agents locally or remotely.
|
|
42
|
+
triggers:
|
|
43
|
+
- openhands-sdk
|
|
44
|
+
- openhands sdk
|
|
45
|
+
- software-agent-sdk
|
|
46
|
+
- agent-sdk
|
|
47
|
+
- /sdk
|
|
48
|
+
---"""
|
|
49
|
+
|
|
50
|
+
# Maps llms.txt arch-page title -> class name shown in the table.
|
|
51
|
+
ARCH_CLASS_MAP = {
|
|
52
|
+
"Agent": "Agent",
|
|
53
|
+
"LLM": "LLM",
|
|
54
|
+
"Conversation": "Conversation",
|
|
55
|
+
"Events": "Event",
|
|
56
|
+
"Skill": "Skill",
|
|
57
|
+
"Condenser": "Condenser",
|
|
58
|
+
"Security": "SecurityAnalyzer",
|
|
59
|
+
"Tool System & MCP": "Tool / ToolDefinition",
|
|
60
|
+
"Workspace": "Workspace",
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_ENTRY_RE = re.compile(r"^- \[(?P<title>[^\]]+)\]\((?P<url>[^)]+)\):\s*(?P<desc>.+)$")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# -- network --
|
|
67
|
+
|
|
68
|
+
def _fetch(url: str, accept: str = "text/plain") -> str:
|
|
69
|
+
headers = {"Accept": accept, "User-Agent": "sync-sdk-skill/1.0"}
|
|
70
|
+
token = os.environ.get("GITHUB_TOKEN")
|
|
71
|
+
if token and "api.github.com" in url:
|
|
72
|
+
headers["Authorization"] = f"token {token}"
|
|
73
|
+
req = urllib.request.Request(url, headers=headers)
|
|
74
|
+
with urllib.request.urlopen(req, timeout=30) as resp:
|
|
75
|
+
return resp.read().decode()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _fetch_json(url: str) -> list | dict:
|
|
79
|
+
return json.loads(_fetch(url, accept="application/vnd.github.v3+json"))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _fetch_or(url: str, fallback, **kw):
|
|
83
|
+
try:
|
|
84
|
+
return _fetch(url, **kw) if "accept" not in kw else _fetch(url, **kw)
|
|
85
|
+
except Exception as e:
|
|
86
|
+
print(f"WARNING: {e} — using fallback", file=sys.stderr)
|
|
87
|
+
return fallback
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# -- llms.txt parsing --
|
|
91
|
+
|
|
92
|
+
def parse_sdk_entries(llms_txt: str) -> list[dict]:
|
|
93
|
+
"""Extract entries from the 'OpenHands Software Agent SDK' section."""
|
|
94
|
+
entries, in_section = [], False
|
|
95
|
+
for line in llms_txt.splitlines():
|
|
96
|
+
stripped = line.strip()
|
|
97
|
+
if stripped == "## OpenHands Software Agent SDK":
|
|
98
|
+
in_section = True
|
|
99
|
+
continue
|
|
100
|
+
if in_section and line.startswith("## "):
|
|
101
|
+
break
|
|
102
|
+
if in_section and (m := _ENTRY_RE.match(stripped)):
|
|
103
|
+
entries.append(m.groupdict())
|
|
104
|
+
return entries
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# -- content builders --
|
|
108
|
+
|
|
109
|
+
def build_classes_table(entries: list[dict]) -> str:
|
|
110
|
+
lines = ["| Class | Purpose |", "|---|---|"]
|
|
111
|
+
for e in entries:
|
|
112
|
+
if "/arch/" not in e["url"]:
|
|
113
|
+
continue
|
|
114
|
+
class_name = ARCH_CLASS_MAP.get(e["title"])
|
|
115
|
+
if not class_name:
|
|
116
|
+
continue
|
|
117
|
+
desc = re.sub(r"^High-level architecture of (the )?", "", e["desc"])
|
|
118
|
+
desc = desc[0].upper() + desc[1:]
|
|
119
|
+
lines.append(f"| [`{class_name}`]({e['url']}) | {desc} |")
|
|
120
|
+
return "\n".join(lines)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def build_api_refs(entries: list[dict]) -> str:
|
|
124
|
+
return ", ".join(
|
|
125
|
+
f"[`{e['title']}`]({e['url']})"
|
|
126
|
+
for e in entries if "/api-reference/" in e["url"]
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def build_guides(entries: list[dict]) -> str:
|
|
131
|
+
return "\n".join(
|
|
132
|
+
f"- [{e['title']}]({e['url']}): {e['desc']}"
|
|
133
|
+
for e in entries
|
|
134
|
+
if "/api-reference/" not in e["url"] and "/arch/" not in e["url"]
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def build_examples(categories: dict[str, list[dict]]) -> str:
|
|
139
|
+
lines = [f"Source: [`examples/`]({GH_TREE})", ""]
|
|
140
|
+
for dir_name, items in categories.items():
|
|
141
|
+
lines.append(f"### [`{dir_name}/`]({GH_TREE}/{dir_name})")
|
|
142
|
+
lines.append("")
|
|
143
|
+
for item in sorted(items, key=lambda x: x["name"]):
|
|
144
|
+
name = item["name"]
|
|
145
|
+
if name.startswith(".") or name == "__pycache__":
|
|
146
|
+
continue
|
|
147
|
+
prefix = GH_TREE if item.get("type") == "dir" else GH_BROWSE
|
|
148
|
+
lines.append(f"- [`{name}`]({prefix}/{dir_name}/{name})")
|
|
149
|
+
lines.append("")
|
|
150
|
+
return "\n".join(lines)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def fetch_examples() -> dict[str, list[dict]]:
|
|
154
|
+
top = _fetch_json(GH_API)
|
|
155
|
+
categories: dict[str, list[dict]] = {}
|
|
156
|
+
for item in sorted(top, key=lambda x: x["name"]):
|
|
157
|
+
if item["type"] != "dir":
|
|
158
|
+
continue
|
|
159
|
+
try:
|
|
160
|
+
categories[item["name"]] = _fetch_json(f"{GH_API}/{item['name']}")
|
|
161
|
+
except Exception as e:
|
|
162
|
+
print(f"WARNING: examples/{item['name']}: {e}", file=sys.stderr)
|
|
163
|
+
return categories
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# -- generate --
|
|
167
|
+
|
|
168
|
+
HELLO_WORLD_FALLBACK = textwrap.dedent("""\
|
|
169
|
+
import os
|
|
170
|
+
from openhands.sdk import LLM, Agent, Conversation, Tool
|
|
171
|
+
from openhands.tools.terminal import TerminalTool
|
|
172
|
+
from openhands.tools.file_editor import FileEditorTool
|
|
173
|
+
|
|
174
|
+
llm = LLM(model="anthropic/claude-sonnet-4-5-20250929", api_key=os.getenv("LLM_API_KEY"))
|
|
175
|
+
agent = Agent(llm=llm, tools=[Tool(name=TerminalTool.name), Tool(name=FileEditorTool.name)])
|
|
176
|
+
conversation = Conversation(agent=agent, workspace=os.getcwd())
|
|
177
|
+
conversation.send_message("Hello!")
|
|
178
|
+
conversation.run()""")
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def generate() -> str:
|
|
182
|
+
print("Fetching llms.txt ...", file=sys.stderr)
|
|
183
|
+
llms_txt = _fetch(LLMS_TXT_URL)
|
|
184
|
+
entries = parse_sdk_entries(llms_txt)
|
|
185
|
+
|
|
186
|
+
print("Fetching examples ...", file=sys.stderr)
|
|
187
|
+
try:
|
|
188
|
+
examples = fetch_examples()
|
|
189
|
+
except Exception:
|
|
190
|
+
examples = {}
|
|
191
|
+
|
|
192
|
+
print("Fetching hello world ...", file=sys.stderr)
|
|
193
|
+
hello = _fetch_or(HELLO_WORLD, HELLO_WORLD_FALLBACK).strip()
|
|
194
|
+
|
|
195
|
+
return f"""{FRONTMATTER}
|
|
196
|
+
|
|
197
|
+
# OpenHands Software Agent SDK
|
|
198
|
+
|
|
199
|
+
All SDK documentation lives at <https://docs.openhands.dev/sdk>.
|
|
200
|
+
|
|
201
|
+
For the full topic index, fetch <https://docs.openhands.dev/llms.txt> and read
|
|
202
|
+
the "OpenHands Software Agent SDK" section.
|
|
203
|
+
|
|
204
|
+
## Quick reference
|
|
205
|
+
|
|
206
|
+
Install: `pip install openhands-sdk openhands-tools`
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
{hello}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Core classes (`openhands.sdk`)
|
|
213
|
+
|
|
214
|
+
{build_classes_table(entries)}
|
|
215
|
+
|
|
216
|
+
## API reference
|
|
217
|
+
|
|
218
|
+
{build_api_refs(entries)}
|
|
219
|
+
|
|
220
|
+
## Guides
|
|
221
|
+
|
|
222
|
+
{build_guides(entries)}
|
|
223
|
+
|
|
224
|
+
## Examples
|
|
225
|
+
|
|
226
|
+
{build_examples(examples)}
|
|
227
|
+
"""
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
# -- main --
|
|
231
|
+
|
|
232
|
+
def main() -> int:
|
|
233
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
234
|
+
parser.add_argument("--check", action="store_true", help="CI mode: fail if stale")
|
|
235
|
+
args = parser.parse_args()
|
|
236
|
+
|
|
237
|
+
generated = generate()
|
|
238
|
+
|
|
239
|
+
if args.check:
|
|
240
|
+
current = SKILL_PATH.read_text() if SKILL_PATH.exists() else ""
|
|
241
|
+
if current == generated:
|
|
242
|
+
print("SDK skill is up to date. ✓", file=sys.stderr)
|
|
243
|
+
return 0
|
|
244
|
+
diff = difflib.unified_diff(
|
|
245
|
+
current.splitlines(keepends=True),
|
|
246
|
+
generated.splitlines(keepends=True),
|
|
247
|
+
fromfile="current SKILL.md",
|
|
248
|
+
tofile="generated SKILL.md",
|
|
249
|
+
)
|
|
250
|
+
sys.stdout.writelines(diff)
|
|
251
|
+
print(
|
|
252
|
+
"\nERROR: SDK skill is out of date. "
|
|
253
|
+
"Run: python scripts/sync_openhands_sdk_skill.py",
|
|
254
|
+
file=sys.stderr,
|
|
255
|
+
)
|
|
256
|
+
return 1
|
|
257
|
+
|
|
258
|
+
SKILL_PATH.write_text(generated)
|
|
259
|
+
print(f"Wrote {SKILL_PATH}", file=sys.stderr)
|
|
260
|
+
return 0
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
if __name__ == "__main__":
|
|
264
|
+
sys.exit(main())
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# OpenHands Skills
|
|
2
|
+
|
|
3
|
+
Skills are specialized prompts that enhance OpenHands with domain-specific knowledge and task-specific workflows. They help developers by providing expert guidance, automating common tasks, and ensuring consistent practices across projects. Each skill is designed to excel in a specific area, from Git operations to code review processes.
|
|
4
|
+
|
|
5
|
+
## Terminology Note
|
|
6
|
+
|
|
7
|
+
**Version 0 (V0)**: The term "skills" continues to be used for V0 conversations. V0 is the current stable version of OpenHands.
|
|
8
|
+
|
|
9
|
+
**Version 1 (V1)**: The term "skills" is used for V1 conversations. V1 UI and app server have not yet been released, but the codebase has been updated to use "skills" terminology in preparation for the V1 release.
|
|
10
|
+
|
|
11
|
+
This directory (`OpenHands/extensions/`) contains shareable skills that will be used in V1 conversations. For V0 conversations, the system continues to use skills from the same underlying files.
|
|
12
|
+
|
|
13
|
+
## Sources of Skills
|
|
14
|
+
|
|
15
|
+
OpenHands loads skills (V1) or skills (V0) from two sources:
|
|
16
|
+
|
|
17
|
+
### 1. Shareable Skills (Public)
|
|
18
|
+
|
|
19
|
+
This directory (`OpenHands/extensions/`) contains shareable skills (V1) or skills (V0) that are:
|
|
20
|
+
|
|
21
|
+
- Available to all OpenHands users
|
|
22
|
+
- Maintained in the OpenHands repository
|
|
23
|
+
- Perfect for reusable knowledge and common workflows
|
|
24
|
+
- Used as "skills" in V1 conversations and "skills" in V0 conversations
|
|
25
|
+
|
|
26
|
+
Directory structure:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
OpenHands/extensions/
|
|
30
|
+
├── # Keyword-triggered expertise
|
|
31
|
+
│ ├── git.md # Git operations
|
|
32
|
+
│ ├── testing.md # Testing practices
|
|
33
|
+
│ └── docker.md # Docker guidelines
|
|
34
|
+
└── # These skills are always loaded
|
|
35
|
+
├── pr_review.md # PR review process
|
|
36
|
+
├── bug_fix.md # Bug fixing workflow
|
|
37
|
+
└── feature.md # Feature implementation
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Repository Instructions (Private)
|
|
41
|
+
|
|
42
|
+
Each repository can have its own instructions. On V1, use `.agents/skills/`. For backward compatibility, `.openhands/skills/` and `.openhands/microagents/` are still supported. These instructions are:
|
|
43
|
+
|
|
44
|
+
- Private to that repository
|
|
45
|
+
- Automatically loaded when working with that repository
|
|
46
|
+
- Perfect for repository-specific guidelines and team practices
|
|
47
|
+
|
|
48
|
+
Example repository structure:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
your-repository/
|
|
52
|
+
├── .agents/
|
|
53
|
+
│ └── skills/ # V1: Preferred location for repository-specific skills
|
|
54
|
+
│ └── repo.md # Repository-specific instructions
|
|
55
|
+
│ └── ... # Private skills that are only available inside this repo
|
|
56
|
+
└── .openhands/ # Legacy locations (still supported)
|
|
57
|
+
├── skills/ # Legacy V1 path
|
|
58
|
+
│ └── repo.md
|
|
59
|
+
└── microagents/ # Legacy V0 path
|
|
60
|
+
└── repo.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Loading Order
|
|
64
|
+
|
|
65
|
+
When OpenHands works with a repository, it:
|
|
66
|
+
|
|
67
|
+
1. Loads repository-specific instructions from `.agents/skills/` (V1) if present
|
|
68
|
+
2. Also checks `.openhands/skills/` and `.openhands/microagents/` for backward compatibility
|
|
69
|
+
3. Loads relevant knowledge agents based on keywords in conversations
|
|
70
|
+
|
|
71
|
+
## Types of Skills
|
|
72
|
+
|
|
73
|
+
Most skills use markdown files with YAML frontmatter. For repository agents (repo.md), the frontmatter is optional - if not provided, the file will be loaded with default settings as a repository agent.
|
|
74
|
+
|
|
75
|
+
### 1. Knowledge Agents
|
|
76
|
+
|
|
77
|
+
Knowledge agents provide specialized expertise that's triggered by keywords in conversations. They help with:
|
|
78
|
+
|
|
79
|
+
- Language best practices
|
|
80
|
+
- Framework guidelines
|
|
81
|
+
- Common patterns
|
|
82
|
+
- Tool usage
|
|
83
|
+
|
|
84
|
+
Key characteristics:
|
|
85
|
+
|
|
86
|
+
- **Trigger-based**: Activated by specific keywords in conversations
|
|
87
|
+
- **Context-aware**: Provide relevant advice based on file types and content
|
|
88
|
+
- **Reusable**: Knowledge can be applied across multiple projects
|
|
89
|
+
- **Versioned**: Support multiple versions of tools/frameworks
|
|
90
|
+
|
|
91
|
+
You can see an example of a knowledge-based agent in [OpenHands's github skill](https://github.com/OpenHands/OpenHands/tree/main/skills/github.md).
|
|
92
|
+
|
|
93
|
+
### 2. Repository Agents
|
|
94
|
+
|
|
95
|
+
Repository agents provide repository-specific knowledge and guidelines. They are:
|
|
96
|
+
|
|
97
|
+
- Loaded from `.openhands/microagents/repo.md` (V0) or `.agents/skills/` directory (V1)
|
|
98
|
+
- Specific to individual repositories
|
|
99
|
+
- Automatically activated for their repository
|
|
100
|
+
- Perfect for team practices and project conventions
|
|
101
|
+
|
|
102
|
+
Key features:
|
|
103
|
+
|
|
104
|
+
- **Project-specific**: Contains guidelines unique to the repository
|
|
105
|
+
- **Team-focused**: Enforces team conventions and practices
|
|
106
|
+
- **Always active**: Automatically loaded for the repository
|
|
107
|
+
- **Locally maintained**: Updated with the project
|
|
108
|
+
|
|
109
|
+
You can see an example of a repo agent in [the agent for the OpenHands repo itself](https://github.com/OpenHands/OpenHands/blob/main/.agents/skills/repo.md).
|
|
110
|
+
|
|
111
|
+
## Contributing
|
|
112
|
+
|
|
113
|
+
### When to Contribute
|
|
114
|
+
|
|
115
|
+
1. **Knowledge Agents** - When you have:
|
|
116
|
+
|
|
117
|
+
- Language/framework best practices
|
|
118
|
+
- Tool usage patterns
|
|
119
|
+
- Common problem solutions
|
|
120
|
+
- General development guidelines
|
|
121
|
+
|
|
122
|
+
2. **Repository Agents** - When you need:
|
|
123
|
+
- Project-specific guidelines
|
|
124
|
+
- Team conventions and practices
|
|
125
|
+
- Custom workflow documentation
|
|
126
|
+
- Repository-specific setup instructions
|
|
127
|
+
|
|
128
|
+
### Best Practices
|
|
129
|
+
|
|
130
|
+
1. **For Knowledge Agents**:
|
|
131
|
+
|
|
132
|
+
- Choose distinctive triggers
|
|
133
|
+
- Focus on one area of expertise
|
|
134
|
+
- Include practical examples
|
|
135
|
+
- Use file patterns when relevant
|
|
136
|
+
- Keep knowledge general and reusable
|
|
137
|
+
|
|
138
|
+
2. **For Repository Agents**:
|
|
139
|
+
- Document clear setup instructions
|
|
140
|
+
- Include repository structure details
|
|
141
|
+
- Specify testing and build procedures
|
|
142
|
+
- List environment requirements
|
|
143
|
+
- Document CI workflows and checks
|
|
144
|
+
- Include information about code quality standards
|
|
145
|
+
- Maintain up-to-date team practices
|
|
146
|
+
- Consider using OpenHands to generate a comprehensive repo.md (see [Creating a Repository Agent](#creating-a-repository-agent))
|
|
147
|
+
- YAML frontmatter is optional - files without frontmatter will be loaded with default settings
|
|
148
|
+
|
|
149
|
+
### Submission Process
|
|
150
|
+
|
|
151
|
+
1. Create your agent file in the appropriate directory:
|
|
152
|
+
- `skills/` for expertise (public, shareable)
|
|
153
|
+
- Note: Repository-specific agents should remain in their respective repositories' `.agents/skills/` (V1) or `.openhands/microagents/` (V0) directory
|
|
154
|
+
2. Test thoroughly
|
|
155
|
+
3. Submit a pull request to OpenHands
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
All skills are subject to the same license as OpenHands. See the root LICENSE file for details.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "add-javadoc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Add comprehensive JavaDoc documentation to Java classes and methods. Use when documenting Java code, adding API documentation, or improving code documentation.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "OpenHands",
|
|
7
|
+
"email": "contact@all-hands.dev"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/OpenHands/extensions",
|
|
10
|
+
"repository": "https://github.com/OpenHands/extensions",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javadoc",
|
|
14
|
+
"java",
|
|
15
|
+
"documentation",
|
|
16
|
+
"api-docs"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# add-javadoc
|
|
2
|
+
|
|
3
|
+
Add comprehensive JavaDoc documentation to Java classes and methods. Use when documenting Java code, adding API documentation, or improving code documentation.
|
|
4
|
+
|
|
5
|
+
## Triggers
|
|
6
|
+
|
|
7
|
+
This skill is activated by the following keywords:
|
|
8
|
+
|
|
9
|
+
- `javadoc`
|
|
10
|
+
- `java documentation`
|
|
11
|
+
- `document java`
|
|
12
|
+
|
|
13
|
+
## Details
|
|
14
|
+
|
|
15
|
+
This skill guides the agent to add standard JavaDoc comments to all public classes and methods in Java source files.
|
|
16
|
+
|
|
17
|
+
### Class-Level Documentation
|
|
18
|
+
|
|
19
|
+
For each public class, the agent will:
|
|
20
|
+
- Add a class-level JavaDoc block describing the purpose and responsibility of the class
|
|
21
|
+
- Include an `@author` tag if appropriate
|
|
22
|
+
|
|
23
|
+
### Method-Level Documentation
|
|
24
|
+
|
|
25
|
+
For each public method, the agent will:
|
|
26
|
+
- Add a method-level JavaDoc block describing what the method does
|
|
27
|
+
- Include `@param` tags for all parameters with clear descriptions
|
|
28
|
+
- Include a `@return` tag describing the return value
|
|
29
|
+
- Include `@throws` tags for any checked exceptions
|
|
30
|
+
|
|
31
|
+
### Style Guidelines
|
|
32
|
+
|
|
33
|
+
- First sentence should be a concise summary
|
|
34
|
+
- Use HTML tags sparingly (prefer plain text)
|
|
35
|
+
- Document preconditions and postconditions when relevant
|
|
36
|
+
- Include code examples with `{@code ...}` for complex methods
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
See [references/example.md](references/example.md) for a before/after example showing undocumented Java code transformed with proper JavaDoc comments.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-javadoc
|
|
3
|
+
description: Add comprehensive JavaDoc documentation to Java classes and methods. Use when documenting Java code, adding API documentation, or improving code documentation.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Java source files
|
|
6
|
+
triggers:
|
|
7
|
+
- javadoc
|
|
8
|
+
- java documentation
|
|
9
|
+
- document java
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Add comprehensive JavaDoc documentation to all public classes and methods.
|
|
13
|
+
|
|
14
|
+
## Class-Level Documentation
|
|
15
|
+
|
|
16
|
+
For each public class:
|
|
17
|
+
- Add class-level JavaDoc describing the purpose and responsibility of the class
|
|
18
|
+
- Include `@author` tag if appropriate
|
|
19
|
+
|
|
20
|
+
## Method-Level Documentation
|
|
21
|
+
|
|
22
|
+
For each public method:
|
|
23
|
+
- Add method-level JavaDoc describing what the method does
|
|
24
|
+
- Include `@param` tags for all parameters with clear descriptions
|
|
25
|
+
- Include `@return` tag describing the return value
|
|
26
|
+
- Include `@throws` tags for any checked exceptions
|
|
27
|
+
|
|
28
|
+
## Style Guidelines
|
|
29
|
+
|
|
30
|
+
- First sentence should be a concise summary
|
|
31
|
+
- Use HTML tags sparingly (prefer plain text)
|
|
32
|
+
- Document preconditions and postconditions when relevant
|
|
33
|
+
- Include code examples with `{@code ...}` for complex methods
|
|
34
|
+
|
|
35
|
+
See [references/example.md](references/example.md) for before/after examples.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# JavaDoc Example
|
|
2
|
+
|
|
3
|
+
## Before
|
|
4
|
+
|
|
5
|
+
```java
|
|
6
|
+
public class UserService {
|
|
7
|
+
public User findById(String id) {
|
|
8
|
+
return repository.find(id);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## After
|
|
14
|
+
|
|
15
|
+
```java
|
|
16
|
+
/**
|
|
17
|
+
* Service for managing user operations.
|
|
18
|
+
*
|
|
19
|
+
* @author Generated by Large Codebase SDK
|
|
20
|
+
*/
|
|
21
|
+
public class UserService {
|
|
22
|
+
/**
|
|
23
|
+
* Finds a user by their unique identifier.
|
|
24
|
+
*
|
|
25
|
+
* @param id The unique identifier of the user
|
|
26
|
+
* @return The User object if found, null otherwise
|
|
27
|
+
*/
|
|
28
|
+
public User findById(String id) {
|
|
29
|
+
return repository.find(id);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "add-skill",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Add (import) an OpenHands skill from a GitHub repository into the current workspace.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "OpenHands",
|
|
7
|
+
"email": "contact@all-hands.dev"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/OpenHands/extensions",
|
|
10
|
+
"repository": "https://github.com/OpenHands/extensions",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"skill",
|
|
14
|
+
"import",
|
|
15
|
+
"github",
|
|
16
|
+
"sparse-checkout"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# add-skill
|
|
2
|
+
|
|
3
|
+
Add (import) an OpenHands skill from a GitHub repository into the current workspace.
|
|
4
|
+
|
|
5
|
+
This skill is useful when a user says things like:
|
|
6
|
+
|
|
7
|
+
- “Add the `codereview` skill from https://github.com/OpenHands/extensions/”
|
|
8
|
+
- “/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview”
|
|
9
|
+
|
|
10
|
+
It fetches only the requested skill directory (via git sparse checkout) and installs it into the workspace so OpenHands can use it.
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
- Parses a GitHub URL (multiple formats supported)
|
|
15
|
+
- Downloads only the requested skill folder (no full repo clone)
|
|
16
|
+
- Validates the downloaded folder contains a `SKILL.md`
|
|
17
|
+
- Installs the skill into:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
<workspace>/.agents/skills/<skill-name>/
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Included files
|
|
24
|
+
|
|
25
|
+
- `SKILL.md` – skill metadata + usage guidance for the agent
|
|
26
|
+
- `scripts/fetch_skill.py` – implementation used to fetch/install a skill
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
From the `add-skill` skill directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 scripts/fetch_skill.py "<github-skill-url>" "<workspace-path>" [--force]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Examples
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Full URL with explicit branch
|
|
40
|
+
python3 scripts/fetch_skill.py \
|
|
41
|
+
"https://github.com/OpenHands/extensions/tree/main/skills/docker" \
|
|
42
|
+
"/workspace"
|
|
43
|
+
|
|
44
|
+
# Shorthand form (defaults to main)
|
|
45
|
+
python3 scripts/fetch_skill.py \
|
|
46
|
+
"OpenHands/extensions/skills/codereview" \
|
|
47
|
+
"/workspace"
|
|
48
|
+
|
|
49
|
+
# Overwrite if the skill already exists
|
|
50
|
+
python3 scripts/fetch_skill.py \
|
|
51
|
+
"OpenHands/extensions/tree/main/skills/codereview" \
|
|
52
|
+
"/workspace" \
|
|
53
|
+
--force
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Supported URL formats
|
|
57
|
+
|
|
58
|
+
- `https://github.com/<owner>/<repo>/tree/<branch>/<path/to/skill>`
|
|
59
|
+
- `https://github.com/<owner>/<repo>/<path/to/skill>` (defaults to `main`)
|
|
60
|
+
- `github.com/<owner>/<repo>/<path/to/skill>`
|
|
61
|
+
- `<owner>/<repo>/<path/to/skill>`
|
|
62
|
+
|
|
63
|
+
## Notes / caveats
|
|
64
|
+
|
|
65
|
+
- If `GITHUB_TOKEN` is set, it will be used for authentication (needed for private repos).
|
|
66
|
+
- If the destination already exists, the script will fail unless `--force` is provided.
|
|
67
|
+
- The script installs under `.agents/skills/`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-skill
|
|
3
|
+
description: Add an external skill from a GitHub repository to the current workspace. Use when users want to import, install, or add a skill from a GitHub URL (e.g., `/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview` or "add the codereview skill from https://github.com/OpenHands/extensions/"). Handles fetching the skill files and placing them in .agents/skills/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Add Skill
|
|
7
|
+
|
|
8
|
+
Import skills from GitHub repositories into the current workspace.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
When a user requests to add a skill from a GitHub URL:
|
|
13
|
+
|
|
14
|
+
1. **Parse the URL** to extract repository owner, name, and skill path
|
|
15
|
+
2. **Fetch the skill** using the bundled script:
|
|
16
|
+
```bash
|
|
17
|
+
python3 <this-skill-path>/scripts/fetch_skill.py "<github-url>" "<workspace-path>"
|
|
18
|
+
```
|
|
19
|
+
3. **Verify** that SKILL.md exists in the destination
|
|
20
|
+
4. **Inform the user** the skill is now available
|
|
21
|
+
|
|
22
|
+
## URL Formats Supported
|
|
23
|
+
|
|
24
|
+
- `https://github.com/owner/repo/tree/main/path/to/skill`
|
|
25
|
+
- `https://github.com/owner/repo/skill-name`
|
|
26
|
+
- `github.com/owner/repo/skill-name`
|
|
27
|
+
- `owner/repo/skill-name` (shorthand)
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
User: `/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Run the fetch script
|
|
35
|
+
python3 scripts/fetch_skill.py "https://github.com/OpenHands/extensions/tree/main/skills/codereview" "/path/to/workspace"
|
|
36
|
+
|
|
37
|
+
# Verify installation
|
|
38
|
+
ls /path/to/workspace/.agents/skills/codereview/SKILL.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Response: "✅ Added `codereview` to your workspace. The skill is now available."
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- Creates `.agents/skills/` directory if it doesn't exist
|
|
46
|
+
- Uses `GITHUB_TOKEN` for authentication (required for private repos)
|
|
47
|
+
- Warns before overwriting existing skills with the same name
|