@craftsamo/agent-github 0.0.0-stage → 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.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "craftsamo",
3
+ "interface": {
4
+ "displayName": "craftsamo"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "agent-github",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Developer Tools"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "agent-github",
3
+ "version": "0.2.0",
4
+ "description": "GitHub tools for coding agents: issues, project boards, pull requests, repositories, releases and Actions.",
5
+ "author": {
6
+ "name": "craftsamo",
7
+ "url": "https://github.com/craftsamo"
8
+ },
9
+ "homepage": "https://github.com/craftsamo/agent-github#readme",
10
+ "repository": "https://github.com/craftsamo/agent-github",
11
+ "license": "MIT"
12
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "craftsamo",
4
+ "description": "Plugins by craftsamo.",
5
+ "owner": {
6
+ "name": "craftsamo",
7
+ "url": "https://github.com/craftsamo"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "agent-github",
12
+ "source": "./",
13
+ "description": "GitHub tools for coding agents: issues, project boards, pull requests, repositories, releases and Actions.",
14
+ "category": "development"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "agent-github",
3
+ "version": "0.2.0",
4
+ "description": "GitHub tools for coding agents: issues, project boards, pull requests, repositories, releases and Actions.",
5
+ "author": {
6
+ "name": "craftsamo",
7
+ "url": "https://github.com/craftsamo"
8
+ },
9
+ "homepage": "https://github.com/craftsamo/agent-github#readme",
10
+ "repository": "https://github.com/craftsamo/agent-github",
11
+ "license": "MIT",
12
+ "mcpServers": {
13
+ "agent-github": {
14
+ "command": "node",
15
+ "args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp.js"]
16
+ }
17
+ }
18
+ }
package/.mcp.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "agent-github": {
4
+ "command": "node",
5
+ "args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp.js"]
6
+ }
7
+ }
8
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CraftSamo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,238 @@
1
- # Temporary Holding Version
1
+ # agent-github
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ GitHub tools for coding agents: issues, project boards, pull requests,
4
+ repositories, releases and Actions. One implementation, delivered to each
5
+ agent harness in the form that suits it best.
6
+
7
+ | Harness | Delivery | Pinned by |
8
+ | -------------- | ------------------------------------------------ | --------------------------------------------- |
9
+ | OpenCode V2 | native plugin (npm package, with skills) | the version in the package |
10
+ | OpenCode V1 | native plugin (npm package, no skills) | the version in the package |
11
+ | Claude Code | plugin: MCP server and skills | the release tag, as the ref |
12
+ | Codex | plugin: MCP server and skills | the release tag, as the ref |
13
+ | Grok Build | plugin: MCP server and skills | the release tag, as `@ref` |
14
+ | Antigravity | plugin: MCP server and skills (not yet verified) | the release tag's tree URL (not yet verified) |
15
+ | Hermes Agent | native plugin (Python, calls the command line) | the release commit, as the SHA |
16
+ | other MCP host | MCP server from npm | the version in the package |
17
+
18
+ 0.2.0 renamed the MCP server from `github` to `agent-github`, so allow rules
19
+ and MCP configurations written for 0.1.0 change.
20
+
21
+ The tools need [Node.js](https://nodejs.org/) 24 or later and the
22
+ [GitHub CLI](https://cli.github.com/), authenticated as you.
23
+ [`docs/conventions.md`](docs/conventions.md) describes how the tools are named
24
+ and how they behave.
25
+
26
+ ## Install
27
+
28
+ Install from a release, never from the default branch: a release is a tag whose
29
+ commit carries the built `dist/`, and the default branch does not. In the
30
+ commands below, `<version>` is a release's version (`1.2.3`) and `<sha>` is the
31
+ commit its tag names:
32
+
33
+ ```sh
34
+ gh api repos/craftsamo/agent-github/commits/v<version> --jq .sha
35
+ ```
36
+
37
+ ### OpenCode
38
+
39
+ OpenCode V2 takes the package and its options in `opencode.json`:
40
+
41
+ ```json
42
+ {
43
+ "plugins": [
44
+ {
45
+ "package": "@craftsamo/agent-github@<version>",
46
+ "options": { "toolsets": ["issues", "pull_requests", "projects"] }
47
+ }
48
+ ],
49
+ "permissions": [{ "action": "github_*", "resource": "*", "effect": "ask" }]
50
+ }
51
+ ```
52
+
53
+ OpenCode V1 takes the package as a string, or as a pair with its options:
54
+
55
+ ```json
56
+ {
57
+ "plugin": [["@craftsamo/agent-github@<version>", { "toolsets": ["issues", "pull_requests", "projects"] }]],
58
+ "permission": { "github_*": "ask" }
59
+ }
60
+ ```
61
+
62
+ OpenCode allows any action no rule names, so the plugin's request is granted
63
+ silently unless a rule says `ask`. Read tools never ask, so the `github_*` glob
64
+ is safe.
65
+
66
+ V1 registers no skills. Unpack the package and copy its `skills/*` folders into
67
+ `~/.config/opencode/skills/`:
68
+
69
+ ```sh
70
+ npm pack @craftsamo/agent-github@<version>
71
+ tar -xzf craftsamo-agent-github-<version>.tgz
72
+ mkdir -p ~/.config/opencode/skills
73
+ cp -r package/skills/* ~/.config/opencode/skills/
74
+ rm -rf package craftsamo-agent-github-<version>.tgz
75
+ ```
76
+
77
+ ### Claude Code
78
+
79
+ ```sh
80
+ claude plugin marketplace add craftsamo/agent-github#v<version>
81
+ claude plugin install agent-github@craftsamo
82
+ ```
83
+
84
+ ### Codex
85
+
86
+ ```sh
87
+ codex plugin marketplace add craftsamo/agent-github --ref v<version>
88
+ codex plugin add agent-github@craftsamo
89
+ ```
90
+
91
+ Codex starts the MCP server in the plugin's install directory, so name issues
92
+ as `owner/repo#N` or pass `repo` (a bare number fails there with a message saying
93
+ so).
94
+
95
+ ### Grok Build
96
+
97
+ ```sh
98
+ grok plugin install craftsamo/agent-github@v<version> --trust
99
+ ```
100
+
101
+ ### Antigravity
102
+
103
+ Install from the tree of the release tag, never from the default branch, which
104
+ has no built `dist/`. The pinning and the install command are not yet verified
105
+ on a real install.
106
+
107
+ ```sh
108
+ agy plugin install https://github.com/craftsamo/agent-github/tree/v<version>
109
+ ```
110
+
111
+ ### Hermes Agent
112
+
113
+ Hermes installs a commit, not a tag, and the plugin installs disabled:
114
+
115
+ ```sh
116
+ hermes plugins install craftsamo/agent-github --ref <sha>
117
+ hermes plugins enable agent-github
118
+ ```
119
+
120
+ ### Any other MCP host
121
+
122
+ Add the server to the host's MCP configuration. Flags go in `args`:
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "agent-github": {
128
+ "command": "npx",
129
+ "args": ["-y", "@craftsamo/agent-github@<version>", "--toolsets", "issues,pull_requests,projects"]
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ## Tools and skills
136
+
137
+ Each toolset comes with a skill that tells an agent how to use its tools. A
138
+ toolset with no tools yet registers none (0.2.0 ships the `issues` tools).
139
+
140
+ ### Issues (`issues`)
141
+
142
+ | Tool | What it does | Class |
143
+ | ---------------------- | ----------------------------------------------------------------------------------------- | ---------- |
144
+ | `github_issue_read` | `view` one issue in full, or `list` a repository's issues or a parent's sub-issues | read |
145
+ | `github_issue_create` | create an issue with its kind, labels, assignees, milestone, parent and blocked-by issues | add |
146
+ | `github_issue_edit` | change the title, body (or append to it), kind, labels, assignees or milestone | overwrite |
147
+ | `github_issue_comment` | comment on an issue | add |
148
+ | `github_issue_close` | close with a reason (`completed`, `not_planned`, `duplicate`) | overwrite |
149
+ | `github_issue_reopen` | reopen a closed issue | overwrite |
150
+ | `github_issue_relate` | set the parent, sub-issues, blocked-by and blocking issues, sending only what differs | idempotent |
151
+ | `github_issue_develop` | create a branch on GitHub linked to the issue, or return the one already linked | idempotent |
152
+
153
+ The skill is [`github-issues`](skills/github-issues/SKILL.md). An issue's kind
154
+ is the organization's Issue Type of that name when it defines one, otherwise a
155
+ `type:<kind>` label.
156
+
157
+ ## Reads and writes
158
+
159
+ Every read tool is named `github_<domain>_read`. Reads can run unasked; writes
160
+ are confirmed by the harness.
161
+
162
+ | Harness | Reads without asking |
163
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
164
+ | OpenCode | always; the plugin asks only before a write |
165
+ | Claude Code | the rule `mcp__plugin_agent-github_agent-github__*_read` in `permissions.allow` of `~/.claude/settings.json` or a project |
166
+ | Codex | always; Codex runs tools that declare `readOnlyHint` unasked, as the read tools do |
167
+ | Grok Build | `grok --allow 'MCPTool(agent-github__*_read)'` |
168
+ | Antigravity | an Allow rule `mcp(agent-github/<tool>)` for each read tool; not yet verified |
169
+ | Hermes | always; the plugin asks only before a write |
170
+
171
+ Where a write is asked about, and where it is not:
172
+
173
+ - **OpenCode** grants any action no rule names, so a write runs unasked unless
174
+ a rule asks for it: add the `github_*` rule shown under [OpenCode](#opencode).
175
+ - **Codex** under `codex exec`, and **Grok Build** under `grok -p`, refuse a
176
+ write they cannot ask about, unless it is allowed beforehand.
177
+ - **Hermes** `hermes chat -q` refuses a write it cannot ask about; `hermes -z`
178
+ and `--yolo` skip approval, so writes then run unasked.
179
+
180
+ ## Settings
181
+
182
+ Every entry point takes the same settings. A flag wins over its environment
183
+ variable, and an option or setting wins over the variable too.
184
+
185
+ | Setting | Flag | Variable | Meaning |
186
+ | --------------- | ----------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |
187
+ | `toolsets` | `--toolsets` | `AGENT_GITHUB_TOOLSETS` | `issues`, `pull_requests`, `projects`, `repos`, `releases`, `actions` or `all`; default `issues` and `pull_requests` |
188
+ | `read_only` | `--read-only` | `AGENT_GITHUB_READ_ONLY` | registers no tool that writes; wins over every other setting |
189
+ | `tools` | `--tools` | `AGENT_GITHUB_TOOLS` | single tools to add by ID, whatever their toolset |
190
+ | `exclude_tools` | `--exclude-tools` | `AGENT_GITHUB_EXCLUDE_TOOLS` | single tools to remove by ID; wins over `tools` and `toolsets` |
191
+ | `confirm` | `--confirm` | `AGENT_GITHUB_CONFIRM` | MCP server only: `harness` (default) or `elicitation`, as `docs/conventions.md` describes |
192
+
193
+ Lists are comma-separated in a flag or a variable. Where each harness reads them:
194
+
195
+ - **OpenCode** takes the plugin `options` shown above, with lists as arrays and
196
+ `read_only` as a boolean.
197
+ - **Hermes** takes `plugins.entries.agent-github.settings` in `config.yaml`:
198
+
199
+ ```yaml
200
+ plugins:
201
+ entries:
202
+ agent-github:
203
+ settings:
204
+ toolsets: [issues, pull_requests, projects]
205
+ read_only: false
206
+ exclude_tools: [github_pr_merge]
207
+ ```
208
+
209
+ - **Claude Code and Antigravity** start the plugin's server without flags; Claude
210
+ Code passes the client's environment, so set the variables in the environment
211
+ the harness runs in.
212
+ - **Codex and Grok Build** pass no environment to a plugin's MCP server, so the
213
+ `AGENT_GITHUB_*` variables have no effect there. To change settings in Codex,
214
+ add the server under `[mcp_servers]` in Codex's config with flags in `args` (as
215
+ in [Any other MCP host](#any-other-mcp-host)) instead of using the plugin.
216
+
217
+ ## Layout
218
+
219
+ - `src/core/` — the tools, free of any harness.
220
+ - `src/mcp/` — the MCP server, built to `dist/mcp.js` and run by `agent-github`.
221
+ - `src/opencode/` — the OpenCode plugin, built to `dist/opencode.js`.
222
+ - `src/cli/` — the command line the Hermes plugin calls, built to `dist/cli.js`
223
+ and run by `agent-github-cli`.
224
+ - `src/hermes/`, `plugin.yaml` and `__init__.py` — the Hermes plugin.
225
+ - `skills/` — one skill per toolset, `skills/<name>/SKILL.md`, which every
226
+ harness that takes skills loads from the package or plugin root.
227
+ - `plugin.json`, `mcp.json`, `.mcp.json`, `.claude-plugin/`, `.agents/plugins/`,
228
+ `.antigravity-plugin/` and `mcp_config.json` — the plugin manifests of the
229
+ other harnesses. The root `.mcp.json` is the configuration Grok Build reads
230
+ (with `${CLAUDE_PLUGIN_ROOT}`, the variable both Grok Build and Claude Code
231
+ expand); when working on this repository in Claude Code, decline the project
232
+ MCP server it offers from that file.
233
+
234
+ How a release is made is in [`RELEASING.md`](RELEASING.md).
235
+
236
+ ## License
237
+
238
+ [MIT](LICENSE)
package/__init__.py ADDED
@@ -0,0 +1,36 @@
1
+ """Loads the plugin package from ``src/hermes/agent_github_hermes`` for Hermes, which imports this file.
2
+
3
+ The package is loaded as ``<this module's name>._impl``, so Hermes, which evicts
4
+ everything under a plugin's module name when it reloads it or loads it for another
5
+ profile, evicts the package too, and each install path gets a package of its own.
6
+ """
7
+
8
+ import importlib.util
9
+ import sys
10
+ from pathlib import Path
11
+
12
+ _NAME = f"{__name__}._impl"
13
+ _PACKAGE_DIR = Path(__file__).resolve().parent / "src" / "hermes" / "agent_github_hermes"
14
+
15
+
16
+ def _evict() -> None:
17
+ """Drop the package and its submodules from ``sys.modules``."""
18
+ for name in list(sys.modules):
19
+ if name == _NAME or name.startswith(f"{_NAME}."):
20
+ sys.modules.pop(name, None)
21
+
22
+
23
+ _spec = importlib.util.spec_from_file_location(
24
+ _NAME, _PACKAGE_DIR / "__init__.py", submodule_search_locations=[str(_PACKAGE_DIR)]
25
+ )
26
+ _module = importlib.util.module_from_spec(_spec)
27
+ _evict()
28
+ sys.modules[_NAME] = _module
29
+ try:
30
+ _spec.loader.exec_module(_module)
31
+ except BaseException:
32
+ _evict()
33
+ raise
34
+
35
+ register = _module.register
36
+ __all__ = ["register"]