1
---
2
name: sponsor-finder
3
description: Find which of a GitHub repository's dependencies are sponsorable via GitHub Sponsors. Uses deps.dev API for dependency resolution across npm, PyPI, Cargo, Go, RubyGems, Maven, and NuGet. Checks npm funding metadata, FUNDING.yml files, and web search. Verifies every link. Shows direct and transitive dependencies with OSSF Scorecard health data. Invoke with /sponsor followed by a GitHub owner/repo (e.g. "/sponsor expressjs/express").
4
---
5
6
# Sponsor Finder
7
8
Discover opportunities to support the open source maintainers behind your project's dependencies. Accepts a GitHub `owner/repo` (e.g. `/sponsor expressjs/express`), uses the deps.dev API for dependency resolution and project health data, and produces a friendly sponsorship report covering both direct and transitive dependencies.
9
10
## Your Workflow
11
12
When the user types `/sponsor {owner/repo}` or provides a repository in `owner/repo` format:
13
14
1. **Parse the input** — Extract `owner` and `repo`.
15
2. **Detect the ecosystem** — Fetch manifest to determine package name + version.
16
3. **Get full dependency tree** — deps.dev `GetDependencies` (one call).
17
4. **Resolve repos** — deps.dev `GetVersion` for each dep → `relatedProjects` gives GitHub repo.
18
5. **Get project health** — deps.dev `GetProject` for unique repos → OSSF Scorecard.
19
6. **Find funding links** — npm `funding` field, FUNDING.yml, web search fallback.
20
7. **Verify every link** — fetch each URL to confirm it's live.
21
8. **Group and report** — by funding destination, sorted by impact.
22
23
---
24
25
## Step 1: Detect Ecosystem and Package
26
27
Use `get_file_contents` to fetch the manifest from the target repo. Determine the ecosystem and extract the package name + latest version:
28
29
| File | Ecosystem | Package name from | Version from |
30
|------|-----------|-------------------|--------------|
31
| `package.json` | NPM | `name` field | `version` field |
32
| `requirements.txt` | PYPI | list of package names | use latest (omit version in deps.dev call) |
33
| `pyproject.toml` | PYPI | `[project.dependencies]` | use latest |
34
| `Cargo.toml` | CARGO | `[package] name` | `[package] version` |
35
| `go.mod` | GO | `module` path | extract from go.mod |
36
| `Gemfile` | RUBYGEMS | gem names | use latest |
37
| `pom.xml` | MAVEN | `groupId:artifactId` | `version` |
38
39
---
40
41
## Step 2: Get Full Dependency Tree (deps.dev)
42
43
**This is the key step.** Use `web_fetch` to call the deps.dev API:
44
45
```
46
https://api.deps.dev/v3/systems/{ECOSYSTEM}/packages/{PACKAGE}/versions/{VERSION}:dependencies
47
```
48
49
For example:
50
```
51
https://api.deps.dev/v3/systems/npm/packages/express/versions/5.2.1:dependencies
52
```
53
54
This returns a `nodes` array where each node has:
55
- `versionKey.name` — package name
56
- `versionKey.version` — resolved version
57
- `relation` — `"SELF"`, `"DIRECT"`, or `"INDIRECT"`
58
59
**This single call gives you the entire dependency tree** — both direct and transitive — with exact resolved versions. No need to parse lockfiles.
60
61
### URL encoding
62
Package names containing special characters must be percent-encoded:
63
- `@colors/colors` → `%40colors%2Fcolors`
64
- Encode `@` as `%40`, `/` as `%2F`
65
66
### For repos without a single root package
67
If the repo doesn't publish a package (e.g., it's an app not a library), fall back to reading `package.json` dependencies directly and calling deps.dev `GetVersion` for each.
68
69
---
70
71
## Step 3: Resolve Each Dependency to a GitHub Repo (deps.dev)
72
73
For each dependency from the tree, call deps.dev `GetVersion`:
74
75
```
76
https://api.deps.dev/v3/systems/{ECOSYSTEM}/packages/{NAME}/versions/{VERSION}
77
```
78
79
From the response, extract:
80
- **`relatedProjects`** → look for `relationType: "SOURCE_REPO"` → `projectKey.id` gives `github.com/{owner}/{repo}`
81
- **`links`** → look for `label: "SOURCE_REPO"` → `url` field
82
83
This works across **all ecosystems** — npm, PyPI, Cargo, Go, RubyGems, Maven, NuGet — with the same field structure.
84
85
### Efficiency rules
86
- Process in batches of **10 at a time**.
87
- Deduplicate — multiple packages may map to the same repo.
88
- Skip deps where no GitHub project is found (count as "unresolvable").
89
90
---
91
92
## Step 4: Get Project Health Data (deps.dev)
93
94
For each unique GitHub repo, call deps.dev `GetProject`:
95
96
```
97
https://api.deps.dev/v3/projects/github.com%2F{owner}%2F{repo}
98
```
99
100
From the response, extract:
101
- **`scorecard.checks`** → find the `"Maintained"` check → `score` (0–10)
102
- **`starsCount`** — popularity indicator
103
- **`license`** — project license
104
- **`openIssuesCount`** — activity indicator
105
106
Use the Maintained score to label project health:
107
- Score 7–10 → ⭐ Actively maintained
108
- Score 4–6 → ⚠️ Partially maintained
109
- Score 0–3 → 💤 Possibly unmaintained
110
111
### Efficiency rules
112
- Only fetch for **unique repos** (not per-package).
113
- Process in batches of **10 at a time**.
114
- This step is optional — skip if rate-limited and note in output.
115
116
---
117
118
## Step 5: Find Funding Links
119
120
For each unique GitHub repo, check for funding information using three sources in order:
121
122
### 5a: npm `funding` field (npm ecosystem only)
123
Use `web_fetch` on `https://registry.npmjs.org/{package-name}/latest` and check for a `funding` field:
124
- **String:** `"https://github.com/sponsors/sindresorhus"` → use as URL
125
- **Object:** `{"type": "opencollective", "url": "https://opencollective.com/express"}` → use `url`
126
- **Array:** collect all URLs
127
128
### 5b: `.github/FUNDING.yml` (repo-level, then org-level fallback)
129
130
**Step 5b-i — Per-repo check:**
131
Use `get_file_contents` to fetch `{owner}/{repo}` path `.github/FUNDING.yml`.
132
133
**Step 5b-ii — Org/user-level fallback:**
134
If 5b-i returned 404 (no FUNDING.yml in the repo itself), check the owner's default community health repo:
135
Use `get_file_contents` to fetch `{owner}/.github` path `FUNDING.yml`.
136
137
GitHub supports a [default community health files](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file) convention: a `.github` repository at the user/org level provides defaults for all repos that lack their own. For example, `isaacs/.github/FUNDING.yml` applies to all `isaacs/*` repos.
138
139
Only look up each unique `{owner}/.github` repo **once** — reuse the result for all repos under that owner. Process in batches of **10 owners at a time**.
140
141
Parse the YAML (same for both 5b-i and 5b-ii):
142
- `github: [username]` → `https://github.com/sponsors/{username}`
143
- `open_collective: slug` → `https://opencollective.com/{slug}`
144
- `ko_fi: username` → `https://ko-fi.com/{username}`
145
- `patreon: username` → `https://patreon.com/{username}`
146
- `tidelift: platform/package` → `https://tidelift.com/subscription/pkg/{platform-package}`
147
- `custom: [urls]` → use as-is
148
149
### 5c: Web search fallback
150
For the **top 10 unfunded dependencies** (by number of transitive dependents), use `web_search`:
151
```
152
"{package name}" github sponsors OR open collective OR funding
153
```
154
Skip packages known to be corporate-maintained (React/Meta, TypeScript/Microsoft, @types/DefinitelyTyped).
155
156
### Efficiency rules
157
- **Check 5a and 5b for all deps.** Only use 5c for top unfunded ones.
158
- Skip npm registry calls for non-npm ecosystems.
159
- Deduplicate repos — check each repo only once.
160
- **One `{owner}/.github` check per unique owner** — reuse the result for all their repos.
161
- Process org-level lookups in batches of **10 owners at a time**.
162
163
---
164
165
## Step 6: Verify Every Link (CRITICAL)
166
167
**Before including ANY funding link, verify it exists.**
168
169
Use `web_fetch` on each funding URL:
170
- **Valid page** → ✅ Include
171
- **404 / "not found" / "not enrolled"** → ❌ Exclude
172
- **Redirect to valid page** → ✅ Include final URL
173
174
Verify in batches of **5 at a time**. Never present unverified links.
175
176
---
177
178
## Step 7: Output the Report
179
180
### Output discipline
181
182
**Minimize intermediate output during data gathering.** Do NOT announce each batch ("Batch 3 of 7…", "Now checking funding…"). Instead:
183
- Show **one brief status line** when starting each major phase (e.g., "Resolving 67 dependencies…", "Checking funding links…")
184
- **Collect ALL data before producing the report.** Never drip-feed partial tables.
185
- Output the final report as a **single cohesive block** at the end.
186
187
### Report template
188
189
```
190
## 💜 Sponsor Finder Report
191
192
**Repository:** {owner}/{repo} · {ecosystem} · {package}@{version}
193
**Scanned:** {date} · {total} deps ({direct} direct + {transitive} transitive)
194
195
---
196
197
### 🎯 Ways to Give Back
198
199
Sponsoring just {N} people/orgs supports {sponsorable} of your {total} dependencies — a great way to invest in the open source your project depends on.
200
201
1. **💜 @{user}** — {N} direct + {M} transitive deps · ⭐ Maintained
202
{dep1}, {dep2}, {dep3}, ...
203
https://github.com/sponsors/{user}
204
205
2. **🟠 Open Collective: {name}** — {N} direct + {M} transitive deps · ⭐ Maintained
206
{dep1}, {dep2}, {dep3}, ...
207
https://opencollective.com/{name}
208
209
3. **💜 @{user2}** — {N} direct dep · 💤 Low activity
210
{dep1}
211
https://github.com/sponsors/{user2}
212
213
---
214
215
### 📊 Coverage
216
217
- **{sponsorable}/{total}** dependencies have funding options ({percentage}%)
218
- **{destinations}** unique funding destinations
219
- **{unfunded_direct}** direct deps don't have funding set up yet ({top_names}, ...)
220
- All links verified ✅
221
```
222
223
### Report format rules
224
225
- **Lead with "🎯 Ways to Give Back"** — this is the primary output. Numbered list, sorted by total deps covered (descending).
226
- **Bare URLs on their own line** — not wrapped in markdown link syntax. This ensures they're clickable in any terminal emulator.
227
- **Inline dep names** — list the covered dependency names in a comma-separated line under each sponsor, so the user sees exactly what they're funding.
228
- **Health indicator inline** — show ⭐/⚠️/💤 next to each destination, not in a separate table column.
229
- **One "📊 Coverage" section** — compact stats. No separate "Verified Funding Links" table, no "No Funding Found" table.
230
- **Unfunded deps as a brief note** — just the count + top names. Frame as "don't have funding set up yet" rather than highlighting a gap. Never shame projects for not having funding — many maintainers prefer other forms of contribution.
231
- 💜 GitHub Sponsors, 🟠 Open Collective, ☕ Ko-fi, 🔗 Other
232
- Prioritize GitHub Sponsors links when multiple funding sources exist for the same maintainer.
233
234
---
235
236
## Error Handling
237
238
- If deps.dev returns 404 for the package → fall back to reading the manifest directly and resolving via registry APIs.
239
- If deps.dev is rate-limited → note partial results, continue with what was fetched.
240
- If `get_file_contents` returns 404 for the repo → inform user repo may not exist or is private.
241
- If link verification fails → exclude the link silently.
242
- Always produce a report even if partial — never fail silently.
243
244
---
245
246
## Critical Rules
247
248
1. **NEVER present unverified links.** Fetch every URL before showing it. 5 verified links > 20 guessed links.
249
2. **NEVER guess from training knowledge.** Always check — funding pages change over time.
250
3. **Always be encouraging, never shaming.** Frame results positively — celebrate what IS funded, and treat unfunded deps as an opportunity, not a failing. Not every project needs or wants financial sponsorship.
251
4. **Lead with action.** The "🎯 Ways to Give Back" section is the primary output — bare clickable URLs, grouped by destination.
252
5. **Use deps.dev as primary resolver.** Fall back to registry APIs only if deps.dev is unavailable.
253
6. **Always use GitHub MCP tools** (`get_file_contents`), `web_fetch`, and `web_search` — never clone or shell out.
254
7. **Be efficient.** Batch API calls, deduplicate repos, check each owner's `.github` repo only once.
255
8. **Focus on GitHub Sponsors.** Most actionable platform — show others but prioritize GitHub.
256
9. **Deduplicate by maintainer.** Group to show real impact of sponsoring one person.
257
10. **Show the actionable minimum.** Tell users the fewest sponsorships to support the most deps.
258
11. **Minimize intermediate output.** Don't announce each batch. Collect all data, then output one cohesive report.
259