Blame · Line-by-line history
SKILL.md
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 43095dc | 1 | --- |
| 2 | name: gluecron-pr | |
| 3 | description: Open, list, fetch, comment on, merge, or close pull requests on a Gluecron-hosted repository. Use this skill whenever the user references a Gluecron repo (origin URL contains "gluecron.com" or matches the GLUECRON_HOST env var) and asks to "open a PR", "merge", "review", "comment on PR #N", "list open PRs", or "close PR #N" on a repo that is NOT hosted on GitHub. | |
| 4 | tools: | |
| 5 | - gluecron_create_pr | |
| 6 | - gluecron_get_pr | |
| 7 | - gluecron_list_prs | |
| 8 | - gluecron_comment_pr | |
| 9 | - gluecron_merge_pr | |
| 10 | - gluecron_close_pr | |
| 11 | - Bash | |
| 12 | --- | |
| 13 | ||
| 14 | # Skill: gluecron-pr | |
| 15 | ||
| 16 | You are the Gluecron pull-request lifecycle assistant. Drive the K1 MCP write | |
| 17 | surface (`gluecron_create_pr`, `gluecron_get_pr`, `gluecron_list_prs`, | |
| 18 | `gluecron_comment_pr`, `gluecron_merge_pr`, `gluecron_close_pr`) on a Gluecron- | |
| 19 | hosted repository. | |
| 20 | ||
| 21 | ## When to use this skill | |
| 22 | ||
| 23 | Trigger this skill when ALL of these are true: | |
| 24 | ||
| 25 | 1. The user mentions a pull request action (open, create, merge, close, | |
| 26 | review, comment on, list). | |
| 27 | 2. The active git repository's `remote.origin.url` contains `gluecron.com`, | |
| 28 | matches `$GLUECRON_HOST`, OR the user explicitly mentions Gluecron. | |
| 29 | 3. The repo is NOT on GitHub. If `origin` is `github.com`, defer to the | |
| 30 | built-in GitHub skill or `gh` CLI instead. | |
| 31 | ||
| 32 | If the repo origin is ambiguous, ask the user once and remember the answer | |
| 33 | for the rest of the session. | |
| 34 | ||
| 35 | ## Required setup before the first tool call | |
| 36 | ||
| 37 | Run these shell commands once per session to learn the context: | |
| 38 | ||
| 39 | ```bash | |
| 40 | # 1. Owner/repo from the origin URL | |
| 41 | git config --get remote.origin.url | |
| 42 | # 2. Default branch (fall back to "main" if this fails) | |
| 43 | git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' || echo main | |
| 44 | # 3. Current branch (used as `head_branch` when opening PRs from CWD) | |
| 45 | git rev-parse --abbrev-ref HEAD | |
| 46 | ``` | |
| 47 | ||
| 48 | The origin URL takes one of two shapes: | |
| 49 | ||
| 50 | - `https://<HOST>/<owner>/<repo>.git` | |
| 51 | - `git@<HOST>:<owner>/<repo>.git` | |
| 52 | ||
| 53 | Strip the `.git` suffix. The MCP tools take `owner` and `repo` as separate | |
| 54 | arguments. | |
| 55 | ||
| 56 | ## Required diff inspection before opening a PR | |
| 57 | ||
| 58 | Always read the diff before drafting the title and body so they match what | |
| 59 | is actually being shipped: | |
| 60 | ||
| 61 | ```bash | |
| 62 | git fetch origin <base_branch> | |
| 63 | git diff origin/<base_branch>...HEAD --stat | |
| 64 | git diff origin/<base_branch>...HEAD | |
| 65 | ``` | |
| 66 | ||
| 67 | Draft the title in imperative voice (≤72 chars). Draft the body in this | |
| 68 | shape: | |
| 69 | ||
| 70 | ``` | |
| 71 | ## Summary | |
| 72 | - 1-3 bullet points describing the change | |
| 73 | ||
| 74 | ## Test plan | |
| 75 | - [ ] step 1 | |
| 76 | - [ ] step 2 | |
| 77 | ``` | |
| 78 | ||
| 79 | ## Tool-call recipes | |
| 80 | ||
| 81 | ### "Open a PR from this branch" | |
| 82 | ||
| 83 | 1. Run the three setup shell commands above. | |
| 84 | 2. Run `git diff origin/<base>...HEAD`. | |
| 85 | 3. Call `gluecron_create_pr` with `owner`, `repo`, `title`, `body`, | |
| 86 | `head_branch=<current branch>`, `base_branch=<default branch>`. | |
| 87 | 4. Echo the returned `url` (it is relative — prefix with the Gluecron host). | |
| 88 | ||
| 89 | ### "What's in PR #42?" | |
| 90 | ||
| 91 | 1. Call `gluecron_get_pr` with `{ owner, repo, number: 42 }`. | |
| 92 | 2. If the user wants to see the diff locally, follow up with | |
| 93 | `git fetch origin <headBranch>` then `git diff <baseBranch>...<headBranch>`. | |
| 94 | ||
| 95 | ### "Comment 'looks good, ship it' on PR #42" | |
| 96 | ||
| 97 | 1. Call `gluecron_comment_pr` with `{ owner, repo, number: 42, body: "..." }`. | |
| 98 | ||
| 99 | ### "Merge PR #42" | |
| 100 | ||
| 101 | 1. Call `gluecron_merge_pr` with `{ owner, repo, number: 42 }`. | |
| 102 | 2. If the response is `{ merged: false, reason: ... }`, surface the reason | |
| 103 | verbatim. Common reasons: | |
| 104 | - "This PR is a draft" → suggest the user run "mark ready for review". | |
| 105 | - "AI review: ..." or "GateTest: ..." → propose fixing the underlying | |
| 106 | check, not bypassing it. | |
| 107 | - Branch protection (required reviews, required checks) → list which | |
| 108 | gate is missing. | |
| 109 | ||
| 110 | ### "Close PR #42 without merging" | |
| 111 | ||
| 112 | 1. Call `gluecron_close_pr` with `{ owner, repo, number: 42 }`. | |
| 113 | ||
| 114 | ### "List open PRs on this repo" | |
| 115 | ||
| 116 | 1. Call `gluecron_list_prs` with `{ owner, repo, state: "open" }`. | |
| 117 | 2. Render as a compact table: number, title, head→base, author. | |
| 118 | ||
| 119 | ## Example user prompts | |
| 120 | ||
| 121 | - "Open a PR titled 'Fix off-by-one in pagination' from this branch." | |
| 122 | - "Show me PR 17." | |
| 123 | - "Comment 'thanks, merging now' on PR 17." | |
| 124 | - "Merge 17." | |
| 125 | - "List open PRs on this repo." | |
| 126 | - "Close PR 14, I'm going to start over." | |
| 127 | ||
| 128 | ## Don'ts | |
| 129 | ||
| 130 | - Do NOT skip the diff inspection step before opening a PR — never invent | |
| 131 | a body from the commit message alone. | |
| 132 | - Do NOT call `gluecron_merge_pr` if the user has not explicitly asked to | |
| 133 | merge. "Approve" or "LGTM" means COMMENT, not merge. | |
| 134 | - Do NOT post `gh` CLI commands — that's for GitHub, not Gluecron. | |
| 135 | - If a tool returns `-32601 method_not_found` for the repo, the caller | |
| 136 | lacks read access. Tell the user; do not retry. | |
| 137 | - If a tool returns `-32602 invalid_params` mentioning authentication, the | |
| 138 | MCP server is not authenticated. Tell the user to re-run | |
| 139 | `curl -sSL https://gluecron.com/install | bash`. |