$npx -y skills add Tencent/SkillHone --skill forgejoForgejo REST API toolkit — manage issues, pull requests, wikis, and repos on a Forgejo server. Use when the agent needs to file an issue, open / review / merge a PR, read or write a wiki page, or look up repo / branch info. One standalone script per resource type. Reads credentia
| 1 | # Forgejo |
| 2 | |
| 3 | Thin wrapper around the Forgejo REST API. Each resource lives in its own script |
| 4 | so the agent can discover and invoke them individually. SkillHone depends on |
| 5 | this as a VCS backend skill, but it stays independent so another backend such as |
| 6 | GitLab or Gitea can provide the same workflow surface. |
| 7 | |
| 8 | ## Scripts |
| 9 | |
| 10 | | Script | Resource | Representative usage | |
| 11 | |--------|----------|----------------------| |
| 12 | | `scripts/issue.py` | Issues | `python3 scripts/issue.py create --title "Bug"` | |
| 13 | | `scripts/pr.py` | Pull requests | `python3 scripts/pr.py merge 1` | |
| 14 | | `scripts/wiki.py` | Wiki pages | `python3 scripts/wiki.py get --title "Analysis"` | |
| 15 | | `scripts/repo.py` | Repo metadata | `python3 scripts/repo.py branches` | |
| 16 | | `scripts/summary.py` | Aggregate dashboard | `python3 scripts/summary.py` | |
| 17 | |
| 18 | Every script supports `--help`. Run it before guessing flags. |
| 19 | |
| 20 | ## Configuration |
| 21 | |
| 22 | Resolved in this order (first match wins): |
| 23 | |
| 24 | 1. Environment variables: `FORGEJO_URL`, `FORGEJO_TOKEN`, `FORGEJO_OWNER`, `FORGEJO_REPO` |
| 25 | 2. `~/.skillhone/settings.json` + `~/.skillhone/identities.conf` |
| 26 | 3. `_data/forgejo_config.txt` in the current working directory |
| 27 | |
| 28 | If nothing is set, the script exits with a clear message naming the missing variable. |
| 29 | |
| 30 | ## Usage By Resource |
| 31 | |
| 32 | ### Issues |
| 33 | |
| 34 | ```bash |
| 35 | python3 scripts/issue.py list |
| 36 | python3 scripts/issue.py view <N> |
| 37 | python3 scripts/issue.py create --title "Fix: timeout" --body "## Problem\n..." |
| 38 | python3 scripts/issue.py close <N> |
| 39 | python3 scripts/issue.py comment <N> --body "Done" |
| 40 | ``` |
| 41 | |
| 42 | ### Pull Requests |
| 43 | |
| 44 | ```bash |
| 45 | python3 scripts/pr.py list |
| 46 | python3 scripts/pr.py view <M> |
| 47 | python3 scripts/pr.py create --title "Fix timeout" --head fix/timeout --base main --body "Closes #1" |
| 48 | python3 scripts/pr.py review <M> --approve |
| 49 | python3 scripts/pr.py merge <M> --method merge |
| 50 | python3 scripts/pr.py comment <M> --body "LGTM" |
| 51 | ``` |
| 52 | |
| 53 | ### Wiki |
| 54 | |
| 55 | ```bash |
| 56 | python3 scripts/wiki.py list |
| 57 | python3 scripts/wiki.py get --title "Iteration-1-Observation" |
| 58 | python3 scripts/wiki.py create --title "Page" --body "content" |
| 59 | python3 scripts/wiki.py edit --title "Page" --body "updated content" |
| 60 | ``` |
| 61 | |
| 62 | ### Repo Metadata |
| 63 | |
| 64 | ```bash |
| 65 | python3 scripts/repo.py info |
| 66 | python3 scripts/repo.py branches |
| 67 | ``` |
| 68 | |
| 69 | ### Combined Summary |
| 70 | |
| 71 | ```bash |
| 72 | python3 scripts/summary.py |
| 73 | # open issues + open PRs + latest observation wiki page |
| 74 | ``` |
| 75 | |
| 76 | ## Invocation From Other Skills |
| 77 | |
| 78 | Other skills living under `~/.skillhone/skills/` call these scripts via their |
| 79 | absolute path: |
| 80 | |
| 81 | ```bash |
| 82 | python3 ~/.skillhone/skills/forgejo/scripts/issue.py list |
| 83 | ``` |
| 84 | |
| 85 | This keeps the VCS backend replaceable. A GitLab or Gitea skill can expose an |
| 86 | equivalent command surface without changing SkillHone's optimization logic. |
| 87 | |
| 88 | ## Gotchas |
| 89 | |
| 90 | - Tokens with `@` characters break git clone URL injection. Use a token without `@` or URL-encode it. |
| 91 | - `merge --method squash` is not supported by older Forgejo versions. If you hit `Unknown method`, fall back to `merge`. |
| 92 | - Wiki pages are stored as `.md` files in a separate git repo (`<repo>.wiki.git`). `wiki.py` hides that, but if you need custom editing, clone the wiki repo directly. |
| 93 | |
| 94 | ## Hard Rules |
| 95 | |
| 96 | - Never print the Forgejo token to stdout/stderr logs. The scripts already redact; don't paste it into `--body` fields. |
| 97 | - Do not call Forgejo's REST API directly with `curl` or handcrafted HTTP from |
| 98 | SkillHone workflows. Use these backend scripts so credential loading, |
| 99 | redaction, and backend replacement stay centralized. |
| 100 | - Do not `cat` `_data/forgejo_config.txt`, `~/.skillhone/settings.json`, or |
| 101 | `identities.conf` to discover credentials. The scripts resolve credentials |
| 102 | internally. |
| 103 | - Do not push directly to `main` via any of these scripts. PRs only. |
| 104 | - When you get a 401/403, re-check the config resolution order above before changing the script. |