@openhands/extensions 0.30.0 → 0.32.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.
Files changed (47) hide show
  1. package/.agents/skills/custom-codereview-guide.md +3 -4
  2. package/.claude-plugin/marketplace.json +14 -0
  3. package/.codex-plugin/marketplace.json +14 -0
  4. package/.github/workflows/pr-artifacts.yml +4 -83
  5. package/.github/workflows/tests.yml +13 -0
  6. package/.plugin/marketplace.json +14 -0
  7. package/.release-please-manifest.json +1 -1
  8. package/AGENTS.md +4 -3
  9. package/README.md +3 -2
  10. package/automations/README.md +9 -2
  11. package/automations/bundle-index.js +1 -1
  12. package/automations/catalog/github-pr-reviewer/manifest.json +2 -2
  13. package/automations/catalog/incident-retrospective-drafter/manifest.json +4 -0
  14. package/automations/catalog/jira-issue-to-bitbucket-pr/manifest.json +3 -0
  15. package/automations/catalog/jira-issue-to-gitlab-mr/manifest.json +3 -0
  16. package/automations/catalog/jira-issue-to-pr/manifest.json +3 -0
  17. package/automations/catalog/linear-issue-to-bitbucket-pr/manifest.json +4 -0
  18. package/automations/catalog/linear-issue-to-github-pr/manifest.json +4 -0
  19. package/automations/catalog/linear-issue-to-gitlab-mr/manifest.json +4 -0
  20. package/automations/catalog/linear-triage-assistant/manifest.json +4 -0
  21. package/automations/catalog/research-brief-writer/manifest.json +3 -0
  22. package/automations/catalog/slack-channel-monitor/manifest.json +3 -0
  23. package/automations/catalog/slack-standup-digest/manifest.json +3 -0
  24. package/automations/catalog.schema.json +18 -1
  25. package/automations/index.d.ts +8 -0
  26. package/marketplaces/openhands-extensions.json +14 -0
  27. package/package.json +1 -1
  28. package/pyproject.toml +1 -1
  29. package/python/openhands_extensions/_version.py +1 -1
  30. package/skills/bitbucket-data-center/SKILL.md +26 -9
  31. package/skills/github-pr-reviewer/README.md +6 -0
  32. package/skills/github-pr-reviewer/SKILL.md +7 -0
  33. package/skills/github-stale-ci-pr-closer/scripts/worker.py +8 -2
  34. package/skills/index.js +15 -4
  35. package/skills/slack-channel-monitor/README.md +6 -2
  36. package/skills/slack-channel-monitor/SKILL.md +29 -17
  37. package/skills/slack-channel-monitor/references/windows.md +6 -2
  38. package/skills/slack-channel-monitor/scripts/main.py +156 -11
  39. package/skills/software-factory/.claude-plugin/plugin.json +19 -0
  40. package/skills/software-factory/.codex-plugin/plugin.json +19 -0
  41. package/skills/software-factory/.plugin/plugin.json +19 -0
  42. package/skills/software-factory/README.md +64 -0
  43. package/skills/software-factory/SKILL.md +229 -0
  44. package/skills/software-factory/commands/software-factory.md +8 -0
  45. package/skills/software-factory/scripts/factory.py +630 -0
  46. package/tests/test_github_stale_ci_pr_closer.py +52 -1
  47. package/tests/test_software_factory_script.py +231 -0
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: software-factory
3
+ description: >
4
+ Set up an OpenHands "software factory" on GitHub fast: ask only for the
5
+ repositories and where tickets live (GitHub issues, Jira or Linear), create a working issue-to-PR and PR-review pipeline from the
6
+ automation catalog with defaults, show what runs, then let the user stop or
7
+ extend it one step at a time (tune settings, triage, auto-merge, stale-CI and
8
+ QA add-ons).
9
+ triggers:
10
+ - /software-factory
11
+ - software factory
12
+ ---
13
+
14
+ # Software Factory
15
+
16
+ Build a GitHub software factory from unmodified automation catalog bundles
17
+ (`automations/catalog/<id>/manifest.json`); a Jira or Linear station is created
18
+ by its own skill. This skill adds no automation logic.
19
+
20
+ Two phases: **Phase 1** gets a working factory after one question. **Phase 2**
21
+ extends it in short rounds, only as far as the user wants. After Phase 1 and
22
+ after every round, the **Checkpoint** shows what exists and lets the user stop.
23
+
24
+ Code lives on GitHub. Tickets can come from GitHub issues (default), Jira or
25
+ Linear: only the issue to PR station changes (see "Ticket source"). GitLab and
26
+ Bitbucket code hosts are not part of this flow.
27
+
28
+ ## Stations
29
+
30
+ | Station | Catalog id | Phase | Needs agent profile |
31
+ |---|---|---|---|
32
+ | Issue to PR | `github-issue-to-pr`, or the Jira or Linear station | 1 | yes (GitHub issues only) |
33
+ | PR reviewer | `github-pr-reviewer` | 1 | yes |
34
+ | AGENTS.md maintainer | `github-agents-md-maintainer` | 1 | no |
35
+ | Issue triage | `github-issue-triage`, or `linear-triage-assistant` | add-on | yes (GitHub issues only) |
36
+ | Auto-merge watchdog | `github-delivery-watchdog` | add-on | no |
37
+ | Stale-CI PR closer | `github-stale-ci-pr-closer` | add-on | no |
38
+ | QA changes | `qa-changes` | add-on | no |
39
+
40
+ ## Helper script
41
+
42
+ `scripts/factory.py` in this skill's directory does every catalog and API step
43
+ and prints one JSON document; it exits non-zero with `{"error": ...}` on
44
+ failure. Its usage is below: do not read its source, and do not load the
45
+ `openhands-automation` skill for Phase 1.
46
+
47
+ Set `OPENHANDS_HOST` to the **Ingress** URL in `<RUNTIME_SERVICES>` on a local
48
+ Agent Canvas (it serves both `/api/automation` and `/api`; the automation
49
+ backend URL does not), or to `<HOST>` on OpenHands Cloud. Run every command as:
50
+
51
+ ```bash
52
+ GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" \
53
+ OPENHANDS_AUTOMATION_API_KEY="$OPENHANDS_AUTOMATION_API_KEY" \
54
+ OPENHANDS_API_KEY="$OPENHANDS_API_KEY" \
55
+ python3 <this skill's directory>/scripts/factory.py <command> ...
56
+ ```
57
+
58
+ `$F` below stands for that whole line. Keep the secret names in it: the agent
59
+ server passes a saved secret into a command only when the command names it.
60
+ The script reads the token and never prints it.
61
+
62
+ | Command | Does |
63
+ |---|---|
64
+ | `$F preflight --repos a/b,c/d` | Which stations this deployment supports, the agent profile, the GitHub login, push access per repository. |
65
+ | `$F create --repos a/b --ids ID,ID [--set FIELD=VALUE] [--set ID.FIELD=VALUE]` | Fills each station's form (answers, then derived values, then manifest defaults), uploads the bundle and creates it disabled. `FIELD=VALUE` applies to every listed station with that field. Stations that already exist are reported under `existing`, not recreated. |
66
+ | `$F tune --repos a/b --ids ID,ID [--set FIELD=VALUE] [--set ID.FIELD=VALUE]` | Applies new settings to an existing station by updating it in place. Use this to change a value that is fixed at creation. |
67
+ | `$F verify ID... [--no-wait ID...]` | Dispatches once, enables the ones whose run `COMPLETED` and disables the rest, reporting their `error_detail`. `--no-wait` enables without waiting. |
68
+ | `$F status ID...` | The latest run of each. |
69
+ | `$F prs --repos a/b [--branch-prefix P]` | Open pull requests whose branch starts with `P` (default `openhands/agents-md`, the AGENTS.md maintainer's). |
70
+ | `$F reset-token` | Deletes the saved `GITHUB_PERSONAL_ACCESS_TOKEN` (local Agent Canvas), so `request_secret` opens its form again. |
71
+
72
+ `create` and `verify` return each automation's `url`, its page in Agent Canvas.
73
+ Trust the script's output: do not open pages in the browser to check them, and
74
+ do not use the task tracker for this flow.
75
+
76
+ Add `--profile NAME` to `preflight` or `create` to use a profile other than the
77
+ active one.
78
+
79
+ ## Rules
80
+
81
+ - **Supported stations**: create only those `preflight` reports `ok`; say why
82
+ the others are skipped.
83
+ - **Derived values** (the script fills them; never ask): every
84
+ `githubTokenSecret` is `GITHUB_PERSONAL_ACCESS_TOKEN`. The watchdog's
85
+ `branchPrefix` must equal issue to PR's: when it was changed, pass
86
+ `--set github-delivery-watchdog.branchPrefix=<same value>`.
87
+ - **Agent profile**: if `preflight` reports a profile error, skip the stations
88
+ that need one and point the user to the station's catalog card in Agent
89
+ Canvas (Automations), which has a profile picker.
90
+ - **Token**: never ask for its value in chat, echo it, or put it in a tool
91
+ argument or file.
92
+ - **Failures**: if `create` fails, its output lists the stations it already
93
+ created; report them with the error and ask whether to retry or delete them
94
+ (`DELETE ${OPENHANDS_HOST}/api/automation/v1/{id}`).
95
+ - **Existing stations**: a station `create` reports under `existing` was already
96
+ set up by an earlier run and was left unchanged. Say so rather than presenting
97
+ it as new, and change it with `$F tune` if the user wants different settings.
98
+
99
+ ## Phase 1 - Working factory
100
+
101
+ 1. Ask, in one message: "Which GitHub repositories (`owner/repo`)? Where do
102
+ tickets live: GitHub issues (default), Jira or Linear?" Say that everything
103
+ else uses defaults that can be changed afterwards. If the answer names only
104
+ repositories, use GitHub issues; do not ask again.
105
+ 2. Run `$F preflight --repos <repos>`. Drop repositories without `push`, and
106
+ say which.
107
+ 3. If `github_login` is null, act on `token_error`:
108
+ - `not_set`, and the `request_secret` tool is available: call it once with
109
+ `name: "GITHUB_PERSONAL_ACCESS_TOKEN"` and a `reason` asking for Contents,
110
+ Issues, Pull requests and Workflows read and write (classic PAT: `repo`,
111
+ `workflow`). End your turn, wait for the `[secret-request]` message,
112
+ then rerun `preflight`.
113
+ - `rejected`: GitHub refuses the saved token (invalid or expired), and
114
+ `request_secret` cannot replace it: it answers `saved` at once for a name
115
+ that exists. Say so in one sentence and ask "Shall I remove it and open
116
+ the form for a new one?" On yes, run `$F reset-token`, then handle it as
117
+ `not_set`. If `reset-token` fails, tell the user to replace it in
118
+ Settings -> Secrets and say when done.
119
+ - `not_set` without the tool: tell the user to add it in Settings ->
120
+ Secrets and stop.
121
+ 4. `$F create --repos <repos> --ids github-pr-reviewer,github-agents-md-maintainer`,
122
+ adding `github-issue-to-pr` for GitHub issues. For Jira or Linear, also set
123
+ up the issue to PR station as "Ticket source" describes.
124
+ 5. `$F verify <reviewer id> [<issue to PR id>] --no-wait <maintainer id>`. The
125
+ maintainer's run opens one `AGENTS.md` pull request per repository.
126
+ 6. Go to the Checkpoint.
127
+
128
+ ## Checkpoint
129
+
130
+ Write one short message, in this order:
131
+
132
+ 1. One plain sentence on what runs and how to use it: "Your factory is running
133
+ on `<repos>`. Add the `<trigger label>` label to a ticket to get a draft pull
134
+ request; the reviewer reviews it and you merge it." (On Jira, add that the
135
+ ticket body must name the `owner/repo`.)
136
+ 2. The `AGENTS.md` pull requests from `$F prs --repos <repos>`, asking the user
137
+ to merge them: they give the build agent the repository's build, test and
138
+ lint commands. One opened before this setup started (`created_at`) is
139
+ "still open from an earlier run", not new; the maintainer works once a week
140
+ per repository. If there are none yet, say they are on their way.
141
+ 3. A small table of the automations, each linked to its `url`:
142
+
143
+ | Automation | Schedule | Status |
144
+ |---|---|---|
145
+ | [Issue to PR](<url>) | every 15 minutes | on |
146
+
147
+ Status is `on`, or `off` with the reason in a few words. No automation ids.
148
+ 4. The settings in effect, as a short list (the Tune table's current values).
149
+ Mention that the reviewer also reviews any open, non-draft, green pull
150
+ request with no review yet (at most 2 new per scan).
151
+ 5. End with only a list of possible next steps, one line each, and nothing
152
+ after it. Mark the first one not done yet as recommended:
153
+ - **Try it**: I open a small test issue with the `<trigger label>` label in
154
+ `<repo>`, only if you say so, and report the pull request.
155
+ - **Tune**: change a setting from the list above.
156
+ - **Add a station**: triage, auto-merge watchdog, stale-CI closer (QA only
157
+ if `preflight` reports it `ok`).
158
+ - **Stop here**: the factory keeps running as it is.
159
+
160
+ ## Phase 2 - Extend, one round at a time
161
+
162
+ Do only what the user picked. Ask only the questions for it, in one message,
163
+ each with its current value. Apply, then return to the Checkpoint.
164
+
165
+ ### Tune
166
+
167
+ | Setting | Default | `--set` |
168
+ |---|---|---|
169
+ | Issue trigger label (GitHub issues) | `openhands` | `github-issue-to-pr.triggerLabel` |
170
+ | Draft or ready pull requests | `draft` | `pullRequestMode` (issue to PR, AGENTS.md maintainer) |
171
+ | Branch prefix (GitHub issues) | `openhands/issue` | `github-issue-to-pr.branchPrefix` (and the watchdog's, if present) |
172
+ | Which pull requests get reviewed | label `openhands-review`, reviewer `all-hands-bot` | `github-pr-reviewer.triggerLabel`, `triggerReviewer` |
173
+ | Review tone: concise, thorough, friendly | `concise` | `reviewTone` |
174
+ | Human reviewers requested after agent approval (two or more logins) | none | `maintainers` |
175
+ | Schedules and timezone | issue to PR `*/15 * * * *`, reviewer `*/5 * * * *`, AGENTS.md maintainer `0 9 * * 1`, add-ons per manifest; `UTC` | `ID.schedule`, `timezone` |
176
+ | Agent profile | active profile | `--profile NAME` |
177
+
178
+ Apply:
179
+
180
+ - Schedule or timezone only:
181
+ `PATCH ${OPENHANDS_HOST}/api/automation/v1/{id}` with `{"trigger": {...}}`.
182
+ - Jira or Linear station settings: change them as its skill describes.
183
+ - Anything else is fixed at creation: `$F tune --repos <repos> --ids <id>` with
184
+ the new `--set` values (repeat every earlier non-default value), then
185
+ `$F verify <id>`. `tune` updates the station in place, so there is no
186
+ replacement to delete and no template-id collision.
187
+
188
+ ### Add a station
189
+
190
+ Ask only the question below, then `$F create` it and `$F verify` it.
191
+
192
+ - **Auto-merge watchdog** (`github-delivery-watchdog`, GitHub issues only,
193
+ since it merges only branches with the issue to PR prefix): confirm the user
194
+ wants the agent to merge pull requests itself once review, tests and CI are
195
+ green.
196
+ - **Stale-CI closer** (`github-stale-ci-pr-closer`): confirm it may warn on,
197
+ then close, pull requests whose CI keeps failing.
198
+ - **Triage** (`github-issue-triage`): nothing. For Linear, follow the
199
+ `linear-triage` skill instead; for Jira there is none.
200
+ - **QA changes**: which base branch (default `main`). Offer QA only if
201
+ `preflight` reports it `ok` and the `openhands-automation` webhook
202
+ reachability check passes. It has no bundle, so the script cannot create it:
203
+ create it as the `openhands-automation` skill describes for an
204
+ event-triggered prompt preset, with its manifest `prompt` and `filter`, one
205
+ per repository (it takes a single `repository`). It runs only on pull request
206
+ events, so leave it enabled and skip `verify`.
207
+
208
+ ## Ticket source
209
+
210
+ - **GitHub issues**: `github-issue-to-pr`, created with the others in Phase 1.
211
+ - **Jira**: follow the `jira-issue-to-pr` skill with `git_provider` `github`
212
+ and its defaults (label `create-pr`, `*/5 * * * *`). Ask only what it cannot
213
+ look up (the Jira site if several, or the API-token details when Atlassian
214
+ Rovo is not connected). Tell the user each ticket body must name its
215
+ `owner/repo`.
216
+ - **Linear**: follow the `ticket-to-code-change` skill with GitHub as the
217
+ provider. Ask its questions in one message, proposing the repositories above
218
+ and `*/15 * * * *` as defaults.
219
+
220
+ Once its skill has created the station, run `$F verify <id>` on it.
221
+
222
+ ## Troubleshooting
223
+
224
+ | Symptom | Cause and fix |
225
+ |---|---|
226
+ | Create returns 422 | A value does not match the manifest `setup` block; fix the field at the path the error names. |
227
+ | Issue to PR fails at push | The token lacks Contents or Workflows write, or does not cover that repository. |
228
+ | Reviewer never reviews | The pull request has neither the trigger label nor a request for the trigger reviewer, and is not green. |
229
+ | Watchdog never merges | Its branch prefix differs from issue to PR's, or the pull request lacks an independent approval or green CI. |
@@ -0,0 +1,8 @@
1
+ ---
2
+ # auto-generated by sync_extensions.py
3
+ description: Set up an OpenHands "software factory" on GitHub fast: ask only for the repositories and where tickets live (GitHub issues, Jira or Linear), create a working issue-to-PR and PR-review pipeline from the automation catalog with defaults, show what runs, then let the user stop or extend it one step at a time (tune settings, triage, auto-merge, stale-CI and QA add-ons).
4
+ ---
5
+
6
+ Read and follow the complete instructions in the SKILL.md file located in this skill's directory.
7
+
8
+ $ARGUMENTS