Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions plugins/github/skills/gh-stack/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ description: |
metadata:
author: github
github-path: skills/gh-stack
github-ref: refs/tags/v0.0.2
github-ref: refs/tags/v0.0.4
github-repo: https://github.com/github/gh-stack
github-tree-sha: f11c787bea0bf060af1d8742464a22cd35aa1630
version: 0.0.2
github-tree-sha: 474deca0369d18493405fde3808db6af9f628cf5
version: 0.0.4
name: gh-stack
---
# gh-stack
Expand Down Expand Up @@ -141,16 +141,18 @@ Small, incidental fixes (e.g., fixing a typo you noticed) can go in the current
|------|---------|
| Create a stack (recommended) | `gh stack init -p feat auth` |
| Create a stack without prefix | `gh stack init auth` |
| Adopt existing branches | `gh stack init --adopt branch-a branch-b` |
| Create a stack of multiple branches | `gh stack init auth api frontend` |
| Adopt existing branches | `gh stack init existing-branch-a existing-branch-b` |
| Set custom trunk | `gh stack init --base develop branch-a` |
| Add a branch to stack (suffix only if prefix set) | `gh stack add api-routes` |
| Add branch + stage all + commit | `gh stack add -Am "message" api-routes` |
| Push branches to remote | `gh stack push` |
| Push to specific remote | `gh stack push --remote origin` |
| Push branches + create PRs | `gh stack submit --auto` |
| Create PRs as drafts | `gh stack submit --auto --draft` |
| Push branches + create draft PRs | `gh stack submit --auto` |
| Create PRs as ready for review | `gh stack submit --auto --open` |
| Sync (fetch, rebase, push) | `gh stack sync` |
| Sync with specific remote | `gh stack sync --remote origin` |
| Sync and prune merged branches | `gh stack sync --prune` |
| Rebase entire stack | `gh stack rebase` |
| Rebase upstack only | `gh stack rebase --upstack` |
| Continue after conflict | `gh stack rebase --continue` |
Expand Down Expand Up @@ -231,8 +233,8 @@ git commit -m "Add frontend dashboard"

# ── Stack complete: feat/auth → feat/api-routes → feat/frontend ──

# 7. Push everything and create draft PRs
gh stack submit --auto --draft
# 7. Push everything and create PRs (drafts by default)
gh stack submit --auto

# 8. Verify the stack
gh stack view --json
Expand Down Expand Up @@ -304,8 +306,13 @@ gh stack push
```bash
# Single command: fetch, rebase, push, sync PR state
gh stack sync

# Sync and automatically clean up local branches for merged PRs
gh stack sync --prune
```

> **Note for agents:** In non-interactive environments, the prune prompt is not shown. Use `--prune` explicitly to delete local branches for merged PRs.

### Squash-merge recovery

When a PR is squash-merged on GitHub, the original branch's commits no longer exist in the trunk history. `gh stack` detects this automatically and uses `git rebase --onto` to correctly replay remaining commits.
Expand Down Expand Up @@ -387,7 +394,7 @@ gh stack unstack
git branch -m old-branch-1 new-branch-1

# 3. Re-create the stack with the new structure
gh stack init --base main --adopt new-branch-1 new-branch-2 new-branch-3
gh stack init --base main new-branch-1 new-branch-2 new-branch-3
```

---
Expand Down Expand Up @@ -417,21 +424,20 @@ gh stack init branch-a branch-b branch-c
# Use a different trunk branch
gh stack init --base develop branch-a branch-b

# Adopt existing branches into a stack
gh stack init --adopt branch-a branch-b branch-c
# Adopt existing branches into a stack (handled automatically if the branches exist)
gh stack init branch-a branch-b branch-c
```

| Flag | Description |
|------|-------------|
| `-b, --base <branch>` | Trunk branch (defaults to the repo's default branch) |
| `-a, --adopt` | Adopt existing branches instead of creating new ones |
| `-p, --prefix <string>` | Branch name prefix. Subsequent `add` calls only need the suffix (e.g., with `-p feat`, `gh stack add auth` creates `feat/auth`) |

**Behavior:**

- Using `-p` is recommended — it simplifies branch naming for subsequent `add` calls
- Creates any branches that don't already exist (branching from the trunk branch)
- In `--adopt` mode: validates all branches exist, rejects if any is already in a stack or has an existing PR
- Existing branches are adopted automatically; missing branches are created from the trunk
- Checks out the last branch in the list
- Enables `git rerere` so conflict resolutions are remembered across rebases. On first run in a repo, this may trigger a confirmation prompt — pre-configure with `git config rerere.enabled true` to avoid it

Expand Down Expand Up @@ -525,14 +531,14 @@ Push all stack branches and create PRs on GitHub. **Always pass `--auto`** — w
# Submit and auto-title new PRs (required for non-interactive use)
gh stack submit --auto

# Submit and create PRs as drafts
gh stack submit --auto --draft
# Submit and create PRs as ready for review (not drafts)
gh stack submit --auto --open
```

| Flag | Description |
|------|-------------|
| `--auto` | Auto-generate PR titles without prompting (**required** for non-interactive use) |
| `--draft` | Create new PRs as drafts |
| `--open` | Mark new and existing PRs as ready for review |
| `--remote <name>` | Remote to push to (use if multiple remotes exist) |

**Behavior:**
Expand Down Expand Up @@ -568,8 +574,8 @@ gh stack link [flags] <branch-or-pr> <branch-or-pr> [...]
# Link branches into a stack (pushes, creates PRs, creates stack)
gh stack link branch-a branch-b branch-c

# Use a different base branch and create PRs as drafts
gh stack link --base develop --draft branch-a branch-b branch-c
# Use a different base branch and mark PRs as ready for review
gh stack link --base develop --open branch-a branch-b branch-c

# Link existing PRs by number
gh stack link 10 20 30
Expand All @@ -581,7 +587,7 @@ gh stack link 42 43 feature-auth feature-ui
| Flag | Description |
|------|---------|
| `--base <branch>` | Base branch for the bottom of the stack (default: `main`) |
| `--draft` | Create new PRs as drafts |
| `--open` | Mark new and existing PRs as ready for review |
| `--remote <name>` | Remote to push to (use if multiple remotes exist) |

**Behavior:**
Expand Down Expand Up @@ -615,6 +621,7 @@ gh stack sync [flags]
| Flag | Description |
|------|-------------|
| `--remote <name>` | Remote to fetch from and push to (use if multiple remotes exist) |
| `--prune` | Delete local branches for merged PRs |

**What it does (in order):**

Expand All @@ -623,6 +630,7 @@ gh stack sync [flags]
3. **Cascade rebase** all stack branches onto their updated parents (only if trunk moved). Handles merged PRs automatically. If a conflict is detected, **all branches are restored** to their pre-rebase state and the command exits with code 3 — see [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) for the resolution workflow
4. **Push** all active branches atomically
5. **Sync PR state** from GitHub and report the status of each PR
6. **Prune** — in interactive terminals, prompts to delete local branches for merged PRs. Use `--prune` to skip the prompt. In non-interactive environments, pruning only happens when `--prune` is passed explicitly

**Output (stderr):**

Expand All @@ -632,6 +640,7 @@ gh stack sync [flags]
- `✓ Pushed N branches`
- `✓ PR #N (<branch>) — Open` per branch
- `Merged: #N, #M` for merged branches
- `✓ Pruned <branch> (merged)` per pruned branch (when pruning)
- `✓ Stack synced`

---
Expand Down Expand Up @@ -788,30 +797,25 @@ When a branch name is provided, the command resolves it against locally tracked

Tear down a stack so you can restructure it — remove a branch, reorder branches, rename branches, or make other large changes. After unstacking, use `gh stack init` to re-create the stack with the desired structure.

You must have a branch from the stack checked out locally. The command targets the active stack — the one that contains the currently checked out branch.

```
gh stack unstack [flags] [branch]
gh stack unstack [flags]
```

```bash
# Tear down the stack (locally and on GitHub), then rebuild
gh stack unstack
gh stack init --base main --adopt branch-2 branch-1 branch-3 # reordered
gh stack init --base main branch-2 branch-1 branch-3 # reordered

# Only remove local tracking (keep the stack on GitHub)
gh stack unstack --local

# Specify a branch to identify which stack to tear down
gh stack unstack feature-auth
```

| Flag | Description |
|------|-------------|
| `--local` | Only delete the stack locally (keep it on GitHub) |

| Argument | Description |
|----------|-------------|
| `[branch]` | A branch in the stack (defaults to the current branch) |

---

## Output conventions
Expand Down
2 changes: 1 addition & 1 deletion plugins/github/skills/github-issues/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
github-path: skills/github-issues
github-ref: refs/heads/main
github-repo: https://github.com/github/awesome-copilot
github-tree-sha: 44219c182a1435252a1751313b99fb0a79882bb5
github-tree-sha: 95fb5bd16c2cecb7c14c58d7e902a91daae2ec5e
name: github-issues
---
# GitHub Issues
Expand Down
116 changes: 77 additions & 39 deletions plugins/github/skills/github-issues/references/issue-fields.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,83 @@
# Issue Fields (GraphQL, Private Preview)

> **Private preview:** Issue fields are currently in private preview. Request access at https://github.com/orgs/community/discussions/175366
# Issue Fields

Issue fields are custom metadata (dates, text, numbers, single-select) defined at the organization level and set per-issue. They are separate from labels, milestones, and assignees. Common examples: Start Date, Target Date, Priority, Impact, Effort.

**Important:** All issue field queries and mutations require the `GraphQL-Features: issue_fields` HTTP header. Without it, the fields are not visible in the schema.

**Prefer issue fields over project fields.** When you need to set metadata like dates, priority, or status on an issue, use issue fields (which live on the issue itself) rather than project fields (which live on a project item). Issue fields travel with the issue across projects and views, while project fields are scoped to a single project. Only use project fields when issue fields are not available or when the field is project-specific (e.g., sprint iterations).

## Discovering available fields
## REST API (recommended)

The REST API is the simplest way to discover fields and set values.

### Discovering available fields

```bash
gh api orgs/{org}/issue-fields --jq '.[] | {id, name, options: [.options[]? | {id, name}]}'
```

### Reading field values on an issue

```bash
gh api repos/{owner}/{repo}/issues/{number}/issue-field-values
```

### Setting field values

```bash
gh api repos/{owner}/{repo}/issues/{number}/issue-field-values \
-X POST \
--input - <<'EOF'
{"issue_field_values": [{"field_id": 1, "value": "P1"}]}
EOF
```

**Important:** The payload must be a JSON object with an `issue_field_values` array. Each entry has:
- `field_id` (integer): the field's numeric ID from the org fields list
- `value` (string): the **option name** for single-select fields (e.g., `"P1"`, `"High"`), or the literal value for text/number/date fields

Common mistakes to avoid:
- Passing the option ID instead of the option name as `value` (the API expects the display name)
- Sending `field_id` and `value` as top-level keys without wrapping in `issue_field_values` array
- Using `-f` flags instead of `--input` with JSON body

Fields are defined at the org level. List them before trying to set values:
### Example: Set priority to P1

```bash
# 1. Find the Priority field ID and option names
gh api orgs/{org}/issue-fields --jq '.[] | select(.name == "Priority")'

# 2. Set it (use the option NAME, not ID)
gh api repos/{owner}/{repo}/issues/{number}/issue-field-values \
-X POST \
--input - <<'EOF'
{"issue_field_values": [{"field_id": 1, "value": "P1"}]}
EOF
```

### Example: Set multiple fields at once

```bash
gh api repos/{owner}/{repo}/issues/{number}/issue-field-values \
-X POST \
--input - <<'EOF'
{"issue_field_values": [
{"field_id": 1, "value": "P1"},
{"field_id": 5, "value": "2026-06-01"},
{"field_id": 7, "value": "High"}
]}
EOF
```

### Workflow for setting fields (REST)

1. **Discover fields** - `gh api orgs/{org}/issue-fields` to get field IDs and option names
2. **Set values** - POST to `repos/{owner}/{repo}/issues/{number}/issue-field-values` with JSON body
3. **Batch when possible** - multiple fields can be set in a single request

## GraphQL API (alternative)

The GraphQL API requires the `GraphQL-Features: issue_fields` HTTP header. Without it, the fields are not visible in the schema.

### Discovering available fields (GraphQL)

```graphql
# Header: GraphQL-Features: issue_fields
Expand All @@ -31,9 +98,7 @@ Fields are defined at the org level. List them before trying to set values:

Field types: `IssueFieldDate`, `IssueFieldText`, `IssueFieldNumber`, `IssueFieldSingleSelect`.

For single-select fields, you need the option `id` (not the name) to set values.

## Reading field values on an issue
### Reading field values (GraphQL)

```graphql
# Header: GraphQL-Features: issue_fields
Expand Down Expand Up @@ -67,7 +132,7 @@ For single-select fields, you need the option `id` (not the name) to set values.
}
```

## Setting field values
### Setting field values (GraphQL)

Use `setIssueFieldValue` to set one or more fields at once. You need the issue's node ID and the field IDs from the discovery query above.

Expand Down Expand Up @@ -95,37 +160,10 @@ Each entry in `issueFields` takes a `fieldId` plus exactly one value parameter:
| Date | `dateValue` | ISO 8601 date string, e.g. `"2026-04-15"` |
| Text | `textValue` | String |
| Number | `numberValue` | Float |
| Single select | `singleSelectOptionId` | ID from the field's `options` list |
| Single select | `singleSelectOptionId` | Node ID from the field's `options` list |

To clear a field value, set `delete: true` instead of a value parameter.

## Workflow for setting fields

1. **Discover fields** - query the org's `issueFields` to get field IDs and option IDs
2. **Get the issue node ID** - from `repository.issue.id`
3. **Set values** - call `setIssueFieldValue` with the issue node ID and field entries
4. **Batch when possible** - multiple fields can be set in a single mutation call

## Example: Set dates and priority on an issue

```bash
gh api graphql \
-H "GraphQL-Features: issue_fields" \
-f query='
mutation {
setIssueFieldValue(input: {
issueId: "I_kwDOxxx"
issueFields: [
{ fieldId: "IFD_startDate", dateValue: "2026-04-01" }
{ fieldId: "IFD_targetDate", dateValue: "2026-04-30" }
{ fieldId: "IFSS_priority", singleSelectOptionId: "OPTION_P1" }
]
}) {
issue { id title }
}
}'
```

## Searching by field values

### GraphQL bulk query (recommended)
Expand Down
6 changes: 4 additions & 2 deletions plugins/go/skills/golang-pro/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
author: https://github.com/Jeffallan
domain: language
github-path: skills/golang-pro
github-ref: refs/tags/v0.4.11
github-ref: refs/tags/v0.4.15
github-repo: https://github.com/Jeffallan/claude-skills
github-tree-sha: 21c16cca0eaf425259a5aebc2de99ee64807b500
github-tree-sha: e347d9842958ce46d5f0644ef6009304d648a964
output-format: code
related-skills: devops-engineer, microservices-architect, test-master
role: specialist
Expand Down Expand Up @@ -123,3 +123,5 @@ When implementing Go features, provide:
## Knowledge Reference

Go 1.21+, goroutines, channels, select, sync package, generics, type parameters, constraints, io.Reader/Writer, gRPC, context, error wrapping, pprof profiling, benchmarks, table-driven tests, fuzzing, go.mod, internal packages, functional options

[Documentation](https://jeffallan.github.io/claude-skills/skills/language/golang-pro/)
Loading