Skip to content

Commit 9c92f7d

Browse files
olaservoclaude
andcommitted
feat(skills): import 25 workflow-oriented skills from github#2374
Imports the workflow-oriented skill catalogue from github#2374 as standalone SKILL.md files served via the existing Registry. Each skill covers a discrete GitHub workflow the model can pull on demand rather than loading all guidance up-front. Imported skills (25): get-context, explore-repo, search-code, trace-history, create-pr, self-review-pr, address-pr-feedback, merge-pr, triage-issues, create-issue, manage-sub-issues, debug-ci, trigger-workflow, security-audit, fix-dependabot, research-vulnerability, manage-project, prepare-release, manage-repo, manage-labels, contribute-oss, browse-discussions, delegate-to-copilot, discover-github, share-snippet. Skipped from github#2374 (2): review-pr and handle-notifications — those names are now used by the renamed-and-deepened skills from the prior commit, so the catalogue ends up with github#2374's names + this fork's deeper content for those two. Each skill is a `skills/<name>/SKILL.md` file embedded via //go:embed, plus a single Registry.Add() call in pkg/github/bundled_skills.go. The `allowed-tools` frontmatter list is included verbatim from github#2374 as advisory metadata (not enforced; not surfaced via resource _meta). Tests: adds Test_BundledSkills_NoDuplicateURIs, Test_BundledSkills_AllFrontmatterValid, and Test_BundledSkills_AllReadable — these scale across the full catalogue and protect against regressions when adding more skills. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f45a34c commit 9c92f7d

28 files changed

Lines changed: 1006 additions & 0 deletions

File tree

pkg/github/bundled_skills.go

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,131 @@ func bundledSkills(_ *inventory.Inventory) *skills.Registry {
2626
Name: "handle-notifications",
2727
Description: "Systematically triage the current user's GitHub notifications inbox — enumerate unread items, prioritize by notification reason (review requests, mentions, assignments, security alerts), act on the high-priority ones, then dismiss the rest. Use when the user asks \"what should I work on?\", \"catch me up on GitHub\", \"triage my inbox\", \"what needs my attention?\", or otherwise wants to clear their notifications backlog.",
2828
Content: skills.HandleNotificationsSKILL,
29+
}).
30+
Add(skills.Bundled{
31+
Name: "get-context",
32+
Description: "Understand the current user, their permissions, and team membership. Use when starting any workflow, checking who you are, what you can access, or looking up team membership.",
33+
Content: skills.GetContextSKILL,
34+
}).
35+
Add(skills.Bundled{
36+
Name: "explore-repo",
37+
Description: "Understand an unfamiliar codebase quickly. Use when exploring a new repo, understanding project structure, finding entry points, or getting oriented in code you haven't seen before.",
38+
Content: skills.ExploreRepoSKILL,
39+
}).
40+
Add(skills.Bundled{
41+
Name: "search-code",
42+
Description: "Find code patterns, symbols, and examples across GitHub. Use when searching for code, finding how something is implemented, locating files, or looking for usage examples across repositories.",
43+
Content: skills.SearchCodeSKILL,
44+
}).
45+
Add(skills.Bundled{
46+
Name: "trace-history",
47+
Description: "Understand why code changed by tracing commits and PRs. Use when investigating git history, finding who changed something, understanding the motivation behind a change, or tracking down when a bug was introduced.",
48+
Content: skills.TraceHistorySKILL,
49+
}).
50+
Add(skills.Bundled{
51+
Name: "create-pr",
52+
Description: "Create a well-structured pull request that reviews smoothly. Use when opening a new PR, pushing changes for review, or submitting code changes to a repository.",
53+
Content: skills.CreatePRSKILL,
54+
}).
55+
Add(skills.Bundled{
56+
Name: "self-review-pr",
57+
Description: "Review your own PR before requesting team review. Use when you want to self-check your PR, verify CI status, polish description, or prepare your changes for review.",
58+
Content: skills.SelfReviewPRSKILL,
59+
}).
60+
Add(skills.Bundled{
61+
Name: "address-pr-feedback",
62+
Description: "Handle review comments on your PR and push fixes. Use when you received PR feedback, need to respond to reviewer comments, resolve threads, or push fixes based on review.",
63+
Content: skills.AddressPRFeedbackSKILL,
64+
}).
65+
Add(skills.Bundled{
66+
Name: "merge-pr",
67+
Description: "Get a PR to merge-ready state and merge it. Use when merging a pull request, checking if a PR is ready to merge, updating a PR branch, or converting a draft PR.",
68+
Content: skills.MergePRSKILL,
69+
}).
70+
Add(skills.Bundled{
71+
Name: "triage-issues",
72+
Description: "Categorize, deduplicate, and prioritize incoming issues. Use when triaging issues, labeling bugs, organizing a backlog, closing duplicates, or processing new issue reports.",
73+
Content: skills.TriageIssuesSKILL,
74+
}).
75+
Add(skills.Bundled{
76+
Name: "create-issue",
77+
Description: "Create well-structured, searchable, actionable issues. Use when filing a bug report, requesting a feature, creating a task, or opening any new GitHub issue.",
78+
Content: skills.CreateIssueSKILL,
79+
}).
80+
Add(skills.Bundled{
81+
Name: "manage-sub-issues",
82+
Description: "Break down large issues into trackable sub-tasks. Use when decomposing epics, creating task breakdowns, organizing work into smaller pieces, or managing parent-child issue relationships.",
83+
Content: skills.ManageSubIssuesSKILL,
84+
}).
85+
Add(skills.Bundled{
86+
Name: "debug-ci",
87+
Description: "Investigate and fix failing GitHub Actions workflows. Use when CI is failing, a workflow run errored, you need to read build logs, or debug why tests aren't passing.",
88+
Content: skills.DebugCISKILL,
89+
}).
90+
Add(skills.Bundled{
91+
Name: "trigger-workflow",
92+
Description: "Run, rerun, or cancel GitHub Actions workflow runs. Use when triggering a deployment, rerunning failed jobs, canceling a stuck workflow, or dispatching a workflow manually.",
93+
Content: skills.TriggerWorkflowSKILL,
94+
}).
95+
Add(skills.Bundled{
96+
Name: "security-audit",
97+
Description: "Systematically review code scanning, secret, and dependency alerts. Use when auditing repo security, checking for vulnerabilities, reviewing CodeQL alerts, or investigating exposed secrets.",
98+
Content: skills.SecurityAuditSKILL,
99+
}).
100+
Add(skills.Bundled{
101+
Name: "fix-dependabot",
102+
Description: "Handle vulnerable dependency alerts and update PRs. Use when fixing Dependabot alerts, updating vulnerable packages, reviewing dependency update PRs, or managing supply chain security.",
103+
Content: skills.FixDependabotSKILL,
104+
}).
105+
Add(skills.Bundled{
106+
Name: "research-vulnerability",
107+
Description: "Query the GitHub Advisory Database for security advisories. Use when researching CVEs, looking up GHSA IDs, checking if a package has known vulnerabilities, or reviewing security advisories for a repo or org.",
108+
Content: skills.ResearchVulnerabilitySKILL,
109+
}).
110+
Add(skills.Bundled{
111+
Name: "manage-project",
112+
Description: "Track and update work items in GitHub Projects (v2). Use when managing a project board, updating issue status fields, adding items to a project, querying project items, or posting project status updates.",
113+
Content: skills.ManageProjectSKILL,
114+
}).
115+
Add(skills.Bundled{
116+
Name: "prepare-release",
117+
Description: "Compile release notes from commits and merged PRs. Use when preparing a release, writing a changelog, summarizing changes since last version, or reviewing what shipped.",
118+
Content: skills.PrepareReleaseSKILL,
119+
}).
120+
Add(skills.Bundled{
121+
Name: "manage-repo",
122+
Description: "Create repos, manage branches, and push file changes. Use when creating a new repository, making a branch, committing files via the API, forking a repo, or managing repository contents.",
123+
Content: skills.ManageRepoSKILL,
124+
}).
125+
Add(skills.Bundled{
126+
Name: "manage-labels",
127+
Description: "Set up and maintain a consistent label scheme. Use when creating labels, organizing a label system, cleaning up labels, or standardizing label naming across a repository.",
128+
Content: skills.ManageLabelsSKILL,
129+
}).
130+
Add(skills.Bundled{
131+
Name: "contribute-oss",
132+
Description: "Fork, branch, and submit PRs to external repositories. Use when contributing to open source, forking a repo to make changes, or submitting a pull request to a project you don't own.",
133+
Content: skills.ContributeOSSSKILL,
134+
}).
135+
Add(skills.Bundled{
136+
Name: "browse-discussions",
137+
Description: "Read and explore GitHub Discussions and categories. Use when browsing discussions, reading community conversations, checking discussion categories, or looking for answers in a project's discussions.",
138+
Content: skills.BrowseDiscussionsSKILL,
139+
}).
140+
Add(skills.Bundled{
141+
Name: "delegate-to-copilot",
142+
Description: "Assign Copilot to issues and request Copilot PR reviews. Use when you want Copilot to work on an issue, get an automated code review, or delegate tasks to GitHub Copilot.",
143+
Content: skills.DelegateToCopilotSKILL,
144+
}).
145+
Add(skills.Bundled{
146+
Name: "discover-github",
147+
Description: "Search for users, organizations, and repositories. Use when finding GitHub users, looking up organizations, discovering repos by topic or language, or managing your starred repositories.",
148+
Content: skills.DiscoverGitHubSKILL,
149+
}).
150+
Add(skills.Bundled{
151+
Name: "share-snippet",
152+
Description: "Create and manage code snippets via GitHub Gists. Use when sharing a code snippet, creating a quick paste, saving notes as a gist, or managing your existing gists.",
153+
Content: skills.ShareSnippetSKILL,
29154
})
30155
}
31156

pkg/github/bundled_skills_test.go

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,85 @@ func Test_DeclareSkillsExtensionIfEnabled(t *testing.T) {
242242
})
243243
}
244244

245+
// Test_BundledSkills_NoDuplicateURIs guards against accidental duplicate
246+
// registrations — two skills with the same name would collide on the same
247+
// skill://github/<name>/SKILL.md URI.
248+
func Test_BundledSkills_NoDuplicateURIs(t *testing.T) {
249+
inv, err := NewInventory(translations.NullTranslationHelper).
250+
WithToolsets([]string{"all"}).
251+
Build()
252+
require.NoError(t, err)
253+
254+
seen := map[string]string{}
255+
for _, b := range bundledSkills(inv).Enabled() {
256+
uri := b.URI()
257+
if prev, dup := seen[uri]; dup {
258+
t.Fatalf("duplicate skill URI %q: previously %q, now %q", uri, prev, b.Name)
259+
}
260+
seen[uri] = b.Name
261+
}
262+
}
263+
264+
// Test_BundledSkills_AllFrontmatterValid verifies that every embedded SKILL.md
265+
// has YAML frontmatter where the `name` field matches the final segment of the
266+
// skill's URI — the SEP's structural requirement that lets hosts resolve
267+
// skill:// URIs back to the declared skill name.
268+
func Test_BundledSkills_AllFrontmatterValid(t *testing.T) {
269+
inv, err := NewInventory(translations.NullTranslationHelper).
270+
WithToolsets([]string{"all"}).
271+
Build()
272+
require.NoError(t, err)
273+
274+
for _, b := range bundledSkills(inv).Enabled() {
275+
t.Run(b.Name, func(t *testing.T) {
276+
require.NotEmpty(t, b.Content, "embedded SKILL.md is empty")
277+
278+
md := strings.ReplaceAll(b.Content, "\r\n", "\n")
279+
require.True(t, strings.HasPrefix(md, "---\n"), "must begin with YAML frontmatter fence")
280+
281+
end := strings.Index(md[4:], "\n---\n")
282+
require.GreaterOrEqual(t, end, 0, "must have closing frontmatter fence")
283+
frontmatter := md[4 : 4+end]
284+
285+
var name string
286+
for _, line := range strings.Split(frontmatter, "\n") {
287+
if strings.HasPrefix(line, "name:") {
288+
name = strings.TrimSpace(strings.TrimPrefix(line, "name:"))
289+
break
290+
}
291+
}
292+
assert.Equal(t, b.Name, name, "frontmatter name must match registered skill name and final URI segment of %s", b.URI())
293+
})
294+
}
295+
}
296+
297+
// Test_BundledSkills_AllReadable verifies that every registered skill resource
298+
// returns its embedded content via resources/read — a round-trip safety net
299+
// against subtle handler mismatches.
300+
func Test_BundledSkills_AllReadable(t *testing.T) {
301+
ctx := context.Background()
302+
inv, err := NewInventory(translations.NullTranslationHelper).
303+
WithToolsets([]string{"all"}).
304+
Build()
305+
require.NoError(t, err)
306+
307+
srv := mcp.NewServer(&mcp.Implementation{Name: "test"}, &mcp.ServerOptions{
308+
Capabilities: &mcp.ServerCapabilities{Resources: &mcp.ResourceCapabilities{}},
309+
})
310+
RegisterBundledSkills(srv, inv)
311+
session := connectClient(t, ctx, srv)
312+
313+
for _, b := range bundledSkills(inv).Enabled() {
314+
t.Run(b.Name, func(t *testing.T) {
315+
res, err := session.ReadResource(ctx, &mcp.ReadResourceParams{URI: b.URI()})
316+
require.NoError(t, err)
317+
require.Len(t, res.Contents, 1)
318+
assert.Equal(t, "text/markdown", res.Contents[0].MIMEType)
319+
assert.Equal(t, b.Content, res.Contents[0].Text)
320+
})
321+
}
322+
}
323+
245324
// listResources enumerates resources/list via an in-memory client session.
246325
func listResources(t *testing.T, ctx context.Context, srv *mcp.Server) []*mcp.Resource {
247326
t.Helper()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: address-pr-feedback
3+
description: Handle review comments on your PR and push fixes. Use when you received PR feedback, need to respond to reviewer comments, resolve threads, or push fixes based on review.
4+
allowed-tools:
5+
- pull_request_read
6+
- add_reply_to_pull_request_comment
7+
- resolve_review_thread
8+
- push_files
9+
- create_or_update_file
10+
- update_pull_request_branch
11+
- request_pull_request_reviewers
12+
---
13+
14+
# Address PR Feedback
15+
16+
You received review feedback. Address it systematically, not piecemeal.
17+
18+
## Available Tools
19+
- `pull_request_read` — read all review comments and threads
20+
- `add_reply_to_pull_request_comment` — respond to reviewer comments
21+
- `resolve_review_thread` — mark threads as resolved
22+
- `push_files` / `create_or_update_file` — push fixes
23+
- `update_pull_request_branch` — rebase/merge with base branch
24+
- `request_pull_request_reviewers` — re-request review after addressing
25+
26+
## Workflow
27+
1. Read ALL comments before responding — comments may be related.
28+
2. Group related feedback and address together in one commit.
29+
3. Reply to each comment explaining what you changed (or why you disagree).
30+
4. Resolve threads only after addressing the concern — not before.
31+
5. Push fixes, then re-request review.
32+
33+
Don't resolve threads without responding. Don't push fixes without explaining them in the thread.

skills/browse-discussions/SKILL.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: browse-discussions
3+
description: Read and explore GitHub Discussions and categories. Use when browsing discussions, reading community conversations, checking discussion categories, or looking for answers in a project's discussions.
4+
allowed-tools:
5+
- list_discussions
6+
- get_discussion
7+
- get_discussion_comments
8+
- list_discussion_categories
9+
---
10+
11+
# Browse Discussions
12+
13+
Read and explore GitHub Discussions.
14+
15+
## Available Tools
16+
- `list_discussions` — list discussions in a repo
17+
- `get_discussion` — get discussion details
18+
- `get_discussion_comments` — read comments and replies
19+
- `list_discussion_categories` — list available categories
20+
21+
Call `list_discussion_categories` first to understand the discussion structure. Filter by category to find relevant conversations.

skills/bundled.go

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,78 @@ var ReviewPRSKILL string
1717

1818
//go:embed handle-notifications/SKILL.md
1919
var HandleNotificationsSKILL string
20+
21+
//go:embed get-context/SKILL.md
22+
var GetContextSKILL string
23+
24+
//go:embed explore-repo/SKILL.md
25+
var ExploreRepoSKILL string
26+
27+
//go:embed search-code/SKILL.md
28+
var SearchCodeSKILL string
29+
30+
//go:embed trace-history/SKILL.md
31+
var TraceHistorySKILL string
32+
33+
//go:embed create-pr/SKILL.md
34+
var CreatePRSKILL string
35+
36+
//go:embed self-review-pr/SKILL.md
37+
var SelfReviewPRSKILL string
38+
39+
//go:embed address-pr-feedback/SKILL.md
40+
var AddressPRFeedbackSKILL string
41+
42+
//go:embed merge-pr/SKILL.md
43+
var MergePRSKILL string
44+
45+
//go:embed triage-issues/SKILL.md
46+
var TriageIssuesSKILL string
47+
48+
//go:embed create-issue/SKILL.md
49+
var CreateIssueSKILL string
50+
51+
//go:embed manage-sub-issues/SKILL.md
52+
var ManageSubIssuesSKILL string
53+
54+
//go:embed debug-ci/SKILL.md
55+
var DebugCISKILL string
56+
57+
//go:embed trigger-workflow/SKILL.md
58+
var TriggerWorkflowSKILL string
59+
60+
//go:embed security-audit/SKILL.md
61+
var SecurityAuditSKILL string
62+
63+
//go:embed fix-dependabot/SKILL.md
64+
var FixDependabotSKILL string
65+
66+
//go:embed research-vulnerability/SKILL.md
67+
var ResearchVulnerabilitySKILL string
68+
69+
//go:embed manage-project/SKILL.md
70+
var ManageProjectSKILL string
71+
72+
//go:embed prepare-release/SKILL.md
73+
var PrepareReleaseSKILL string
74+
75+
//go:embed manage-repo/SKILL.md
76+
var ManageRepoSKILL string
77+
78+
//go:embed manage-labels/SKILL.md
79+
var ManageLabelsSKILL string
80+
81+
//go:embed contribute-oss/SKILL.md
82+
var ContributeOSSSKILL string
83+
84+
//go:embed browse-discussions/SKILL.md
85+
var BrowseDiscussionsSKILL string
86+
87+
//go:embed delegate-to-copilot/SKILL.md
88+
var DelegateToCopilotSKILL string
89+
90+
//go:embed discover-github/SKILL.md
91+
var DiscoverGitHubSKILL string
92+
93+
//go:embed share-snippet/SKILL.md
94+
var ShareSnippetSKILL string

skills/contribute-oss/SKILL.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: contribute-oss
3+
description: Fork, branch, and submit PRs to external repositories. Use when contributing to open source, forking a repo to make changes, or submitting a pull request to a project you don't own.
4+
allowed-tools:
5+
- fork_repository
6+
- create_branch
7+
- push_files
8+
- create_pull_request
9+
- get_file_contents
10+
- search_repositories
11+
- pull_request_read
12+
---
13+
14+
# Contribute to Open Source
15+
16+
Workflow for contributing to repos you don't have write access to.
17+
18+
## Available Tools
19+
- `fork_repository` — fork upstream to your account
20+
- `create_branch` — create feature branch on your fork
21+
- `push_files` — push changes to your fork
22+
- `create_pull_request` — PR from your fork to upstream
23+
- `get_file_contents` — read CONTRIBUTING.md and templates
24+
- `search_repositories` — find the repo
25+
- `pull_request_read` — track your PR status
26+
27+
## Workflow
28+
1. Read CONTRIBUTING.md and CODE_OF_CONDUCT.md first.
29+
2. Fork the repo, create a feature branch (not main).
30+
3. Keep changes small and focused — one concern per PR.
31+
4. Follow the project's existing code style.
32+
5. Create PR with clear description linking related issues.
33+
34+
Look for good-first-issue labels to find starter tasks. Don't submit large PRs without discussing scope first in an issue.

0 commit comments

Comments
 (0)