Branchwell

Skillfarm / website · skillfarm.ai / commits / 89e3b038

Remove remaining public MCP pages and references new

written by protomota · 89e3b0386808cd2c72180a107bf17e8f384b21a3 · parent ca527188

5 files changed

src/index.tsx changed

99 import { DAY, HttpError, now } from './lib/util';
1010 import { registerAdmin } from './routes/admin';
1111 import { registerAuth } from './routes/auth';
12- import { registerMcp } from './routes/mcp';
13- import { registerOAuth } from './routes/oauth';
1412 import { registerPages } from './routes/pages';
1513 import { registerSettings } from './routes/settings';
1614 import { registerSkills } from './routes/skills';
⋯
9088 return next();
9189 });
9290
91+ const retired = (c: Ctx) => c.body(null, 410);
92+ app.all('/mcp', retired);
93+ app.all('/mcp/*', retired);
94+ app.all('/oauth/*', retired);
95+ app.all('/.well-known/oauth-authorization-server', retired);
96+ app.all('/.well-known/oauth-protected-resource', retired);
97+ app.all('/.well-known/oauth-protected-resource/*', retired);
98+ app.all('/.well-known/oauth-authorization-server/*', retired);
99+ app.all('/.well-known/openid-configuration', retired);
93100 registerAuth(app);
94- registerOAuth(app);
95- registerMcp(app);
96101 registerPages(app);
97102 registerSkills(app);
98103 registerSettings(app);
⋯
112117 c.env.DB.prepare("SELECT u.handle, s.slug, s.updated_at FROM skills s JOIN users u ON u.id = s.owner_id WHERE s.state = 'live' ORDER BY s.published_at DESC LIMIT 5000").all<{ handle: string; slug: string; updated_at: number }>(),
113118 c.env.DB.prepare("SELECT u.handle FROM users u WHERE u.status = 'active' AND EXISTS (SELECT 1 FROM skills s WHERE s.owner_id = u.id AND s.state = 'live') LIMIT 5000").all<{ handle: string }>(),
114119 ]);
115- const urls = ['/', '/skills', '/prompts', '/growers', '/leaderboard', '/seeds', '/connect', '/help', '/guidelines', '/privacy', '/research', ...PROMPTS.map((p) => `/prompts/${p.slug}`)].map((p) => `<url><loc>${site}${p}</loc></url>`);
120+ const urls = ['/', '/skills', '/prompts', '/growers', '/leaderboard', '/seeds', '/help', '/guidelines', '/privacy', '/research', ...PROMPTS.map((p) => `/prompts/${p.slug}`)].map((p) => `<url><loc>${site}${p}</loc></url>`);
116121 for (const s of skills.results) urls.push(`<url><loc>${site}/skills/${s.handle}/${s.slug}</loc><lastmod>${new Date(s.updated_at * 1000).toISOString().slice(0, 10)}</lastmod></url>`);
117122 for (const g of growers.results) urls.push(`<url><loc>${site}/u/${g.handle}</loc></url>`);
118123 return c.body(`<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.join('\n')}\n</urlset>\n`, 200, {

src/routes/pages.tsx changed

1313 import { getUserByHandle } from '../lib/users';
1414 import { dateLabel, HttpError, plural, safeUrl, timeAgo } from '../lib/util';
1515 import { heroScene, hillEdge, icon, spot, tierArt } from '../views/art';
16- import { AgentBadge, Avatar, Copy, Empty, SendToAgent, SkillCard, TierBadge, TierProgress } from '../views/components';
16+ import { AgentBadge, Avatar, Empty, SendToAgent, SkillCard, TierBadge, TierProgress } from '../views/components';
1717 import { render } from '../views/layout';
1818
1919 type Member = Pick<User, 'id' | 'handle' | 'display_name' | 'avatar_key' | 'avatar_fallback' | 'seeds_total' | 'bio'> & { skills?: number; period_seeds?: number };
⋯
6464 refreshStale(c.env, c.executionCtx, [...fresh, ...trending, ...newest, ...allPicks]);
6565 const hasSkills = newest.length > 0;
6666 // Until growers share skills of their own, Sprout's picks lead the page with a fuller row.
67- const picks = hasSkills ? allPicks.slice(0, 6) : allPicks;
67+ const publicPicks = allPicks.filter(({ title, summary }) => !/\bmcp\b|model context protocol/i.test(title + " " + summary));
68+ const picks = hasSkills ? publicPicks.slice(0, 6) : publicPicks;
6869 const showGrowerRow = hasSkills || !picks.length;
6970 // With only a handful of skills the two rows would repeat each other.
7071 const showNewest = newest.some((n) => !trending.some((t) => t.id === n.id));
⋯
215216 </ol>
216217 </section>
217218
218- <section class="band band-soil">
219- {hillEdge('#3A1F0F')}
220- <div class="wrap mcp-band">
221- <div>
222- <h2 class="section-title">Bring Skillfarm into your agent</h2>
223- <p>Skillfarm runs an MCP server. Any agent can search and read skills with no account. Sign in from your MCP client and it can share skills for you too. Submissions still go through review.</p>
224- <Copy text="https://skillfarm.ai/mcp" label="Copy URL" />
225- <a class="btn btn-sun" href="/connect">Set up MCP</a>
226- </div>
227- {spot('mcp')}
228- </div>
229- </section>
230219
231220 {raw(`<!-- branch-note --><style>.branch-note{box-sizing:border-box;max-width:1180px;margin:48px auto;padding:0 20px;color:inherit;text-align:left}.branch-note .bn-box{border:2px solid currentColor;border-radius:24px;padding:32px 28px;background:color-mix(in srgb,currentColor 6%,transparent)}.branch-note .bn-eye{margin:0 0 6px;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.8}.branch-note h2{margin:0 0 12px;font-size:clamp(26px,3.8vw,40px);line-height:1.12}.branch-note p{margin:0 0 10px;max-width:760px;font-size:18px;line-height:1.55}.branch-note p:last-child{margin-bottom:0}.branch-note .bn-lic{opacity:.8;font-size:16px}</style><section class="branch-note" id="branch" aria-labelledby="branch-h"><div class="bn-box"><p class="bn-eye">Organization model</p><h2 id="branch-h">Start your&nbsp;own</h2><p>Anyone can start their own Skillfarm without asking us, and can give it a different name. Our organization model is open: our designs, research and specs are public domain, free for anyone to use, copy and&nbsp;change.</p><a href="/start" style="display:inline-block;margin-top:14px;padding:12px 24px;border-radius:999px;border:2px solid currentColor;color:inherit;font-weight:700;text-decoration:none">See every step</a></div></section><!-- /branch-note -->`)}
232221 </>,
⋯
281270 ),
282271 );
283272
284- app.get('/connect', (c) => {
285- const site = c.env.SITE_URL;
286- return render(
287- c,
288- { title: 'Connect over MCP', description: 'Skillfarm runs an MCP server. Search and read skills from any agent, and share skills from your own account after you sign in.', active: 'connect' },
289- <div class="wrap section prose-page">
290- <h1>Connect your agent over MCP</h1>
291- <p class="lede">Skillfarm runs a Model Context Protocol server, so your agent can find and read skills without leaving your editor. Signed-in agents can also share skills for you.</p>
292- <div class="grid grid-2 connect-grid">
293- <div class="card pad">
294- <h2>Browse without an account</h2>
295- <p>Read-only. Search, read and download any live skill.</p>
296- <Copy text={`${site}/mcp`} label="Copy URL" />
297- <h3>From a terminal agent</h3>
298- <Copy text={`claude mcp add --transport http skillfarm ${site}/mcp`} />
299- </div>
300- <div class="card pad">
301- <h2>Use your account</h2>
302- <p>Everything above, plus sharing, liking and reviewing as you. Your client opens Skillfarm to sign you in.</p>
303- <Copy text={`${site}/mcp/account`} label="Copy URL" />
304- <h3>From a terminal agent</h3>
305- <Copy text={`claude mcp add --transport http skillfarm-account ${site}/mcp/account`} />
306- </div>
307- </div>
308- <h2>What your agent can do</h2>
309- <table class="table">
310- <thead>
311- <tr><th>Tool</th><th>What it does</th><th>Needs sign-in</th></tr>
312- </thead>
313- <tbody>
314- <tr><td><code>search_skills</code></td><td>Search live skills by words, category, agent, member, maker, repo or licence, including Sprout's picks</td><td>No</td></tr>
315- <tr><td><code>list_categories</code></td><td>The categories and agents, with how many skills each category holds</td><td>No</td></tr>
316- <tr><td><code>get_prompt</code></td><td>The ready-made prompt library: the list, or the full text of one prompt</td><td>No</td></tr>
317- <tr><td><code>get_skill</code></td><td>Read a skill's details and its SKILL.md</td><td>No</td></tr>
318- <tr><td><code>install_skill</code></td><td>The steps to install a skill for your agent. A skill that lives in a public repo installs straight from its public repo</td><td>No</td></tr>
319- <tr><td><code>download_skill</code></td><td>Fetch every file of a skill that Skillfarm holds, exactly as reviewed</td><td>No</td></tr>
320- <tr><td><code>get_profile</code></td><td>Look up a grower and their portfolio</td><td>No</td></tr>
321- <tr><td><code>leaderboard</code></td><td>Top growers, all time or this month</td><td>No</td></tr>
322- <tr><td><code>whoami</code></td><td>Your account, Seeds and tier</td><td>Yes</td></tr>
323- <tr><td><code>my_skills</code></td><td>Your skills and where each one is in review</td><td>Yes</td></tr>
324- <tr><td><code>share_skill</code></td><td>Submit a new skill or a new version for review</td><td>Yes, write</td></tr>
325- <tr><td><code>like_skill</code>, <code>unlike_skill</code></td><td>Like or unlike a skill</td><td>Yes, write</td></tr>
326- <tr><td><code>review_skill</code></td><td>Leave a review</td><td>Yes, write</td></tr>
327- </tbody>
328- </table>
329- <h2>How permissions work</h2>
330- <ul>
331- <li>An agent can only ever act as the account that signed in. There is no way to write as someone else.</li>
332- <li>Access is scoped. <code>skills:read</code> covers your own account details. <code>skills:write</code> covers sharing, liking and reviewing. You choose what to grant on the consent screen.</li>
333- <li>Nothing an agent submits goes public on its own. Every submission is scanned and then approved or denied by a person, the same as on the website.</li>
334- <li>The same limits apply as on the site: weekly share limits by tier, and hourly limits on likes.</li>
335- <li>You can see and revoke every connected app and token in your <a href="/settings#access">settings</a>.</li>
336- </ul>
337- <h2>Tokens for scripts</h2>
338- <p>For CI or a client without OAuth support, create a personal access token in <a href="/settings#access">settings</a> and send it as a bearer token:</p>
339- <Copy text={`Authorization: Bearer sf_pat_…`} />
340- </div>,
341- );
342- });
273+ app.get('/connect', (c) => c.redirect('/skills', 308));
343274
344275 app.get('/help', (c) => {
345276 const site = c.env.SITE_URL;
⋯
416347 <p>To remove one, delete its folder. To update one you installed with <code>npx skills</code>, run <code>npx skills update</code>. If you keep your own skills repo, pull it. Agents pick up changes in a new session.</p>
417348 </details>
418349 <details>
419- <summary>Can my agent search Skillfarm itself?</summary>
420- <p>Yes. <a href="/connect">Connect it over MCP</a> and it can search by words, category, maker or licence, and fetch the install steps for any skill.</p>
421- </details>
422- <details>
423350 <summary>Something is wrong with a skill. Who do I tell?</summary>
424351 <p>Sign in and use Report on the skill's page.</p>
425352 </details>
⋯
487414 <SendToAgent options={sendOptionsFor(prompt.body)} small />
488415 </div>
489416 </article>
490- <p class="fine">Works in every major coding agent. Your agent can also fetch it over <a href="/connect">MCP</a> as <code>{prompt.slug}</code>.</p>
417+ <p class="fine">Works in every major coding agent.</p>
491418 {more.length ? (
492419 <>
493420 <h2>More in {groupName(prompt.group)}</h2>
⋯
579506 <h2>What you add yourself</h2>
580507 <p>Your handle, display name, bio, website, avatar, skills, reviews and likes. Profiles and live skills are public.</p>
581508 <h2>Sessions and tokens</h2>
582- <p>Signing in sets one cookie that holds a random session token. Only a hash of it is stored. The same is true of personal access tokens and MCP tokens. Signing out, or revoking a token in settings, deletes it.</p>
509+ <p>Signing in sets one cookie that holds a random session token. Only a hash of it is stored. The same is true of access tokens. Signing out, or revoking a token in settings, deletes it.</p>
583510 <h2>Installs</h2>
584511 <p>To count an install once per person, Skillfarm stores a salted one-way hash of the installer's IP address and browser string. The IP address itself is not stored.</p>
585512 <h2>Review</h2>

src/routes/settings.tsx changed

148148
149149 <section class="card pad" id="access">
150150 <h2>Connected apps</h2>
151- <p class="muted">MCP clients you signed in to. Revoking one signs it out at once.</p>
151+ <p class="muted">Previously connected apps. Revoking one signs it out at once.</p>
152152 {grants.results.length ? (
153153 <ul class="rows">
154154 {grants.results.map((g) => (
⋯
161161 ))}
162162 </ul>
163163 ) : (
164- <p>No apps connected. See <a href="/connect">how to connect over MCP</a>.</p>
164+ <p>No apps connected.</p>
165165 )}
166166
167167 <h2>Personal access tokens</h2>
168- <p class="muted">For scripts and MCP clients without sign-in support. A token acts as you, within the access you give it.</p>
168+ <p class="muted">For scripts without sign-in support. A token acts as you, within the access you give it.</p>
169169 {tokens.results.length ? (
170170 <ul class="rows">
171171 {tokens.results.map((t) => (

src/views/layout.tsx changed

2424 { href: '/growers', label: 'Growers', key: 'growers' },
2525 { href: '/leaderboard', label: 'Leaderboard', key: 'leaderboard' },
2626 { href: '/seeds', label: 'Seeds', key: 'seeds' },
27- { href: '/connect', label: 'MCP', key: 'connect' },
2827 { href: '/help', label: 'Help', key: 'help' },
2928 ];
3029

test/e2e.mjs changed

11 // End-to-end checks against a local `wrangler dev` (needs DEV_LOGIN=1 in .dev.vars and a migrated local database).
22 // Run: npm run dev then, in another shell: npm test
3- import { createHash, randomBytes } from 'node:crypto';
3+ import { randomBytes } from 'node:crypto';
44 import { createServer } from 'node:http';
55
66 const BASE = process.env.BASE_URL ?? 'http://127.0.0.1:8787';
⋯
145145 return { res, page, steps, id: page.split('/').pop(), html: await (await client.req(page)).text() };
146146 }
147147
148- async function mcp(path, method, params, token, id = 1) {
149- const headers = { 'content-type': 'application/json', accept: 'application/json, text/event-stream' };
150- if (token) headers.authorization = `Bearer ${token}`;
151- const res = await fetch(BASE + path, { method: 'POST', headers, body: JSON.stringify({ jsonrpc: '2.0', id, method, params }) });
152- let body = null;
153- try {
154- body = await res.json();
155- } catch {
156- /* empty */
157- }
158- return { res, body };
159- }
160- const toolData = (r) => r.body?.result?.structuredContent;
161148
162149 async function main() {
163150 const stub = await startStub();
⋯
368355 const dl = await anon.req(`${skillPath}/download`);
369356 check('download works', dl.status === 200 && (await dl.text()).includes('# Changelog writer'));
370357
371- // Tokens and MCP
372- const anonInit = await mcp('/mcp', 'initialize', { protocolVersion: '2025-06-18', capabilities: {}, clientInfo: { name: 'e2e', version: '1' } });
373- check('MCP initialize without sign-in', anonInit.body?.result?.serverInfo?.name === 'skillfarm' && anonInit.body.result.protocolVersion === '2025-06-18');
374- const tools = await mcp('/mcp', 'tools/list', {});
375- check('MCP lists tools', tools.body?.result?.tools?.length >= 10);
376- const search = await mcp('/mcp', 'tools/call', { name: 'search_skills', arguments: { query: run } });
377- check('MCP search finds the approved skill', toolData(search)?.skills?.some((s) => s.skill === `${owner}/${slug}`), JSON.stringify(search.body).slice(0, 200));
378- const got = await mcp('/mcp', 'tools/call', { name: 'get_skill', arguments: { skill: `${owner}/${slug}` } });
379- check('MCP reads a skill', toolData(got)?.skill_md?.includes('# Changelog writer'));
380- const dlm = await mcp('/mcp', 'tools/call', { name: 'download_skill', arguments: { skill: `${owner}/${slug}` } });
381- check('MCP downloads a skill', toolData(dlm)?.files?.[0]?.path === 'SKILL.md');
382- const anonShare = await mcp('/mcp', 'tools/call', { name: 'share_skill', arguments: { skill_md: SKILL_MD } });
383- check('MCP write without sign-in answers 401 with a challenge', anonShare.res.status === 401 && (anonShare.res.headers.get('www-authenticate') ?? '').includes('resource_metadata='));
384- check('MCP /account requires sign-in', (await mcp('/mcp/account', 'tools/list', {})).res.status === 401);
385- check('MCP rejects a made-up token', (await mcp('/mcp', 'tools/list', {}, 'sf_pat_notreal')).res.status === 401);
386- const cookieOnly = await a.req('/mcp', { method: 'POST', json: { jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: 'whoami', arguments: {} } }, origin: 'https://evil.example' });
387- check('MCP ignores the browser session cookie', cookieOnly.status === 401, String(cookieOnly.status));
388- check('MCP GET is not offered', (await fetch(`${BASE}/mcp`, { headers: { accept: 'text/event-stream' } })).status === 405);
389-
390- // Personal access tokens
391- const patRead = (await (await a.req('/settings/tokens', { method: 'POST', form: { name: 'read only', scopes: 'skills:read' } })).text()).match(/sf_pat_[A-Za-z0-9_-]+/)?.[0];
392- check('create a read-only token', !!patRead);
393- const who = await mcp('/mcp/account', 'tools/call', { name: 'whoami', arguments: {} }, patRead);
394- check('token acts as its owner', toolData(who)?.handle === owner, JSON.stringify(who.body).slice(0, 200));
395- const denied = await mcp('/mcp/account', 'tools/call', { name: 'share_skill', arguments: { skill_md: SHADY_MD } }, patRead);
396- check('read-only token cannot write', denied.res.status === 403 && (denied.res.headers.get('www-authenticate') ?? '').includes('insufficient_scope'), String(denied.res.status));
397-
398- // OAuth for MCP clients
399- const meta = await (await fetch(`${BASE}/.well-known/oauth-authorization-server`)).json();
400- check('OAuth metadata', meta.code_challenge_methods_supported?.includes('S256') && !!meta.registration_endpoint);
401- const prm = await (await fetch(`${BASE}/.well-known/oauth-protected-resource/mcp`)).json();
402- check('protected-resource metadata', prm.resource?.endsWith('/mcp') && prm.authorization_servers?.length === 1);
403- const badReg = await fetch(`${BASE}/oauth/register`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ client_name: 'x', redirect_uris: ['http://evil.example/cb'] }) });
404- check('registration refuses non-local http redirects', badReg.status === 400);
405- const badReg2 = await fetch(`${BASE}/oauth/register`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ client_name: 'x', redirect_uris: ['javascript:alert(1)'] }) });
406- check('registration refuses script redirects', badReg2.status === 400);
407- const redirect = 'http://127.0.0.1:53999/callback';
408- const reg = await (await fetch(`${BASE}/oauth/register`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ client_name: 'E2E <b>Client</b>', redirect_uris: [redirect] }) })).json();
409- check('dynamic client registration', !!reg.client_id && !reg.client_secret);
410- const verifier = randomBytes(40).toString('base64url');
411- const challenge = createHash('sha256').update(verifier).digest('base64url');
412- const authz = (extra = {}) => new URLSearchParams({ response_type: 'code', client_id: reg.client_id, redirect_uri: redirect, code_challenge: challenge, code_challenge_method: 'S256', state: 'xyz', scope: 'skills:read skills:write', ...extra });
413- check('authorize sends visitors to sign-in', (await anon.req(`/oauth/authorize?${authz()}`)).headers.get('location')?.startsWith('/signin?next='));
414- check('authorize refuses an unregistered redirect', (await b.req(`/oauth/authorize?${authz({ redirect_uri: 'https://evil.example/cb' })}`)).status === 400);
415- const noPkce = await b.req(`/oauth/authorize?${new URLSearchParams({ response_type: 'code', client_id: reg.client_id, redirect_uri: redirect, state: 'xyz' })}`);
416- check('authorize requires PKCE', noPkce.status === 302 && noPkce.headers.get('location')?.includes('error=invalid_request'));
417- const consent = await b.req(`/oauth/authorize?${authz()}`);
418- const consentHtml = await consent.text();
419- check('consent screen shows the app and escapes its name', consent.status === 200 && consentHtml.includes('E2E bClient/b') && !consentHtml.includes('<b>Client</b>'), consentHtml.match(/<h1>[^<]*/)?.[0]);
420- check('consent page allows the redirect back', !(consent.headers.get('content-security-policy') ?? '').includes('form-action'));
421- const crossConsent = await b.req('/oauth/authorize', { method: 'POST', form: Object.fromEntries([...authz(), ['decision', 'allow']]), origin: 'https://evil.example' });
422- check('another site cannot approve for you', crossConsent.status === 403);
423- const allow = await b.req('/oauth/authorize', { method: 'POST', form: Object.fromEntries([...authz(), ['decision', 'allow']]) });
424- const back = new URL(allow.headers.get('location') ?? 'http://x/');
425- const code = back.searchParams.get('code');
426- check('consent returns a code to the registered address', back.origin + back.pathname === redirect && !!code && back.searchParams.get('state') === 'xyz');
427- const tokenReq = (form) => fetch(`${BASE}/oauth/token`, { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams(form) });
428- const wrong = await tokenReq({ grant_type: 'authorization_code', code, client_id: reg.client_id, redirect_uri: redirect, code_verifier: randomBytes(40).toString('base64url') });
429- check('wrong PKCE verifier is refused', wrong.status === 400);
430- const burned = await tokenReq({ grant_type: 'authorization_code', code, client_id: reg.client_id, redirect_uri: redirect, code_verifier: verifier });
431- check('a code that failed once cannot be reused', burned.status === 400);
432- const allow2 = await b.req('/oauth/authorize', { method: 'POST', form: Object.fromEntries([...authz(), ['decision', 'allow']]) });
433- const code2 = new URL(allow2.headers.get('location')).searchParams.get('code');
434- const tok = await (await tokenReq({ grant_type: 'authorization_code', code: code2, client_id: reg.client_id, redirect_uri: redirect, code_verifier: verifier })).json();
435- check('code exchange returns tokens', tok.access_token?.startsWith('sf_at_') && tok.refresh_token?.startsWith('sf_rt_') && tok.expires_in === 3600, JSON.stringify(tok).slice(0, 120));
436- check('code is single use', (await tokenReq({ grant_type: 'authorization_code', code: code2, client_id: reg.client_id, redirect_uri: redirect, code_verifier: verifier })).status === 400);
437- check('refresh token is not a bearer token', (await mcp('/mcp/account', 'tools/list', {}, tok.refresh_token)).res.status === 401);
438- const who2 = await mcp('/mcp/account', 'tools/call', { name: 'whoami', arguments: {} }, tok.access_token);
439- check('OAuth token acts as the member who approved', toolData(who2)?.handle === fan);
440-
441- // Share through MCP: goes to the queue with the pattern scan attached
442- const mshare = await mcp('/mcp/account', 'tools/call', { name: 'share_skill', arguments: { skill_md: SHADY_MD } }, tok.access_token);
443- check('MCP share lands in review', toolData(mshare)?.status === 'waiting_for_review', JSON.stringify(mshare.body).slice(0, 300));
444- const shadyRef = toolData(mshare)?.skill;
445- check('MCP submission is not public', (await anon.req(`/skills/${shadyRef}`)).status === 404);
446- const search2 = await mcp('/mcp', 'tools/call', { name: 'search_skills', arguments: { query: `Totally Fine Helper ${run}` } });
447- check('MCP submission is not in search', toolData(search2)?.skills?.length === 0);
448- const mineList = await mcp('/mcp/account', 'tools/call', { name: 'my_skills', arguments: {} }, tok.access_token);
449- check('my_skills shows it as pending', toolData(mineList)?.skills?.some((s) => s.skill === shadyRef && s.state === 'pending'));
450- const queue2 = await (await admin.req('/admin')).text();
451- check('queue shows the MCP submission flagged', queue2.includes(`Totally Fine Helper ${run}`) && /scan-high/.test(queue2));
452- let shadyReview = null;
453- for (const p of [...new Set(queue2.match(/\/admin\/review\/[A-Za-z0-9_-]+/g) ?? [])]) {
454- const t = await (await admin.req(p)).text();
455- if (t.includes(`Totally Fine Helper ${run}`)) shadyReview = p;
358+ for (const path of ['/mcp', '/mcp/account', '/oauth/register', '/.well-known/oauth-authorization-server']) {
359+ check('retired programmatic route '+path, (await fetch(BASE+path)).status === 410);
456360 }
457- const deny = await admin.req(`${shadyReview}/decide`, { method: 'POST', form: { decision: 'reject', note: 'Pipes a remote script into a shell and reads SSH keys.' } });
458- check('admin denies', deny.status === 302);
459- check('denied skill stays private', (await anon.req(`/skills/${shadyRef}`)).status === 404);
460- const mineList2 = await mcp('/mcp/account', 'tools/call', { name: 'my_skills', arguments: {} }, tok.access_token);
461- check('member sees the reviewer note', toolData(mineList2)?.skills?.some((s) => s.skill === shadyRef && /SSH keys/.test(s.latest_version?.reviewer_note ?? '')));
462361
463- const mrepo = await mcp('/mcp/account', 'tools/call', { name: 'share_skill', arguments: { github_url: `https://github.com/e2e-org/turned-down-${run}` } }, tok.access_token);
464- check('MCP shares a whole repo', toolData(mrepo)?.skills_found === 2 && toolData(mrepo)?.url?.includes('/share/repo/'), JSON.stringify(mrepo.body).slice(0, 300));
465-
466- const mlike = await mcp('/mcp/account', 'tools/call', { name: 'like_skill', arguments: { skill: `${owner}/${slug}` } }, tok.access_token);
467- check('MCP like', toolData(mlike)?.liked === true);
468-
469- // Refresh rotation and replay detection
470- const ref = await (await tokenReq({ grant_type: 'refresh_token', refresh_token: tok.refresh_token, client_id: reg.client_id })).json();
471- check('refresh returns a new pair', ref.access_token?.startsWith('sf_at_') && ref.refresh_token !== tok.refresh_token);
472- check('old access token stops working after refresh', (await mcp('/mcp/account', 'tools/list', {}, tok.access_token)).res.status === 401);
473- check('new access token works', (await mcp('/mcp/account', 'tools/list', {}, ref.access_token)).res.status === 200);
474- check('replayed refresh token is refused', (await tokenReq({ grant_type: 'refresh_token', refresh_token: tok.refresh_token, client_id: reg.client_id })).status === 400);
475- check('replay revokes the whole connection', (await mcp('/mcp/account', 'tools/list', {}, ref.access_token)).res.status === 401);
476-
477362 // Admin moderation after the fact
478363 const adminSkills = await (await admin.req('/admin?tab=skills')).text();
479364 check('admin skills tab', adminSkills.includes(`Changelog Writer ${run}`));
⋯
517402 check('members can like a pick', likePick.status === 200 && (await likePick.json()).liked === true);
518403 const boards = (await (await anon.req('/leaderboard')).text()) + (await (await anon.req('/leaderboard?period=month')).text()) + (await (await anon.req('/growers')).text());
519404 check('Sprout earns nothing and is on no board', !boards.includes('/u/sprout'));
520- const mpick = await mcp('/mcp', 'tools/call', { name: 'search_skills', arguments: { query: pickTitle, from: 'sprout' } });
521- const mp = toolData(mpick)?.skills?.[0];
522- check('MCP search marks a pick and names its maker', mp?.kind === 'pick' && mp?.maker?.name === 'Example Maker' && mp?.source_url?.includes(`example-org/pick-${run}`) && mp?.by?.agent === true, JSON.stringify(mp ?? mpick.body).slice(0, 200));
523- const mget = toolData(await mcp('/mcp', 'tools/call', { name: 'get_skill', arguments: { skill: `sprout/pick-${run}` } }));
524- check('MCP get_skill returns no hosted text for a pick', mget?.skill_md === null && /hosts no copy/.test(mget?.notice ?? ''));
525- const mdl = toolData(await mcp('/mcp', 'tools/call', { name: 'download_skill', arguments: { skill: `sprout/pick-${run}` } }));
526- check('MCP download points to the maker', mdl?.hosted === false && mdl?.files?.length === 0 && !!mdl?.source_url);
527405 // The maker picks from migration 0004: new categories, and a Codex install line.
528406 const legalHtml = await (await anon.req('/skills?category=legal')).text();
529407 check('the Legal category lists legal picks', legalHtml.includes('Legal skills') && legalHtml.includes('/skills/sprout/commercial-legal'));
530408 const codexPick = await (await anon.req('/skills/sprout/security-best-practices')).text();
531409 check('a desktop agent pick says to type its install line inside that agent', codexPick.includes('Type this inside your desktop agent.') && codexPick.includes('$skill-installer security-best-practices'));
532- const mlegal = toolData(await mcp('/mcp', 'tools/call', { name: 'search_skills', arguments: { category: 'legal', limit: 30 } }));
533- check('MCP search filters by a new category', mlegal?.skills?.length >= 13 && mlegal.skills.every((k) => k.category === 'legal'), JSON.stringify(mlegal?.skills?.[0] ?? {}).slice(0, 200));
534- const mtop = toolData(await mcp('/mcp', 'tools/call', { name: 'search_skills', arguments: { from: 'sprout', sort: 'trending', limit: 12 } }));
535- const topRepos = (mtop?.skills ?? []).map((k) => k.source_url?.split('/').slice(3, 5).join('/'));
536- check('one repo does not fill the first page of picks', new Set(topRepos).size === topRepos.length && topRepos.length === 12, topRepos.join(' '));
537- // Search by maker, repo, licence, member and several words; categories; install steps.
538- const call = async (name, args) => toolData(await mcp('/mcp', 'tools/call', { name, arguments: args }));
539- const byMaker = await call('search_skills', { maker: 'an AI lab', limit: 30 });
540- check('MCP search filters by maker', byMaker?.skills?.length >= 24 && byMaker.skills.every((k) => k.maker?.name === 'an AI lab'), `${byMaker?.skills?.length}`);
541- const byRepo = await call('search_skills', { repo: 'anthropics/claude-for-legal', limit: 30 });
542- check('MCP search filters by repo', byRepo?.skills?.length === 12 && byRepo.skills.every((k) => k.github?.repo === 'anthropics/claude-for-legal'), `${byRepo?.skills?.length}`);
543- const byLicense = await call('search_skills', { license: 'mpl-2.0' });
544- check('MCP search filters by licence', byLicense?.skills?.length === 1 && byLicense.skills[0].skill === 'sprout/hashicorp-agent-skills', JSON.stringify(byLicense?.skills?.map((k) => k.skill)));
545- const byWords = await call('search_skills', { query: 'legal anthropic contracts' });
546- check('MCP search needs every word to match', byWords?.skills?.length >= 1 && byWords.skills.every((k) => k.category === 'legal'), JSON.stringify(byWords?.skills?.map((k) => k.skill)));
547- const byCatWord = await call('search_skills', { query: 'marketing', limit: 30 });
548- check('a category word finds what is filed under it', byCatWord?.skills?.some((k) => k.skill === 'sprout/internal-comms'));
549- check('search by member finds only their skills', (await call('search_skills', { by: 'sprout', limit: 5 }))?.skills?.every((k) => k.by.handle === 'sprout'));
550- check('search by an unknown member finds nothing', (await call('search_skills', { by: 'nobody-here-xyz' }))?.skills?.length === 0);
551- const cats = await call('list_categories', {});
552- check('MCP lists categories with counts', cats?.categories?.length === 14 && cats.categories.find((k) => k.key === 'legal')?.skills >= 13 && cats.agents?.length === 3 && cats.totals?.sprout_picks >= 136, JSON.stringify(cats?.totals));
553- const pickPlan = await call('install_skill', { skill: 'sprout/security-best-practices' });
554- check('install steps for a Codex pick point to the maker', pickPlan?.source === 'maker' && pickPlan.agents?.length === 1 && pickPlan.agents[0].quick === '$skill-installer security-best-practices' && pickPlan.agents[0].quick_where === 'codex', JSON.stringify(pickPlan?.agents?.[0] ?? pickPlan));
555- const ccPlan = await call('install_skill', { skill: 'sprout/word-documents', agent: 'claude-code' });
556- check('a line typed inside Claude Code is offered to Claude Code', ccPlan?.agents?.[0]?.quick_where === 'claude-code' && ccPlan.agents[0].quick.startsWith('/plugin marketplace add anthropics/skills'));
557- const allPlan = await call('install_skill', { skill: 'sprout/gemini-api-dev' });
558- check('a terminal line is offered to every agent the pick supports', allPlan?.agents?.length === 3 && allPlan.agents.every((k) => k.quick_where === 'terminal'));
559- const hostedRef = (await call('search_skills', { from: 'growers', limit: 1 }))?.skills?.[0];
560- const hostedPlan = hostedRef ? await call('install_skill', { skill: hostedRef.skill, agent: 'codex' }) : null;
561- check('install steps for a shared skill give a command and a folder', !!hostedPlan && ['github', 'skillfarm'].includes(hostedPlan.source) && hostedPlan.agents.length >= 1 && hostedPlan.agents.every((k) => k.folder.includes('/skills/') && !!k.reviewed_copy && k.manual.length >= 2), JSON.stringify(hostedPlan ?? {}).slice(0, 300));
562410 const siteSearch = await (await anon.req('/skills?q=legal+contracts')).text();
563411 check('site search matches several words', siteSearch.includes('/skills/sprout/commercial-legal') && !siteSearch.includes('/skills/sprout/word-documents'));
564412 // Send to agent and the Help page.
⋯
567415 check('Help page lists the setup prompts', helpRes.status === 200 && helpHtml.includes('id="own-skills-repo"') && helpHtml.includes('id="review-before-install"') && helpHtml.includes('Keep your own skills repo'));
568416 check('Help prompts carry a Claude Code link and a Codex link', helpHtml.includes('claude-cli://open?q=Set%20up%20one%20skills%20repository') && helpHtml.includes('codex://new?prompt=Set%20up%20one%20skills%20repository'));
569417 check('the header links to Help', (await (await anon.req('/')).text()).includes('href="/help"'));
570- const hostedPage = hostedRef ? await (await anon.req(`/skills/${hostedRef.skill}`)).text() : '';
418+ const hostedPage = await (await anon.req('/skills/'+owner+'/'+slug)).text();
571419 check('a shared skill page offers Send to agent and remembers the agent tab', hostedPage.includes('data-send-go') && hostedPage.includes('claude-cli://open?q=Install%20the%20') && hostedPage.includes('data-agent-tabs'));
572420 const pickSend = await (await anon.req('/skills/sprout/security-best-practices')).text();
573421 check('a Codex pick sends its prompt to Codex only', pickSend.includes('codex://new?prompt=Help%20me%20install') && !pickSend.includes('claude-cli://'));
574- const geminiPlan = await call('install_skill', { skill: 'sprout/gemini-api-dev', agent: 'gemini-cli' });
575- check('Gemini CLI installs into the shared agents folder', geminiPlan?.agents?.[0]?.folder === '~/.agents/skills');
576422 // Converted copies of picks.
577423 const copyPage = await (await anon.req('/skills/sprout/powerpoint-decks')).text();
578424 check('a pick with a converted copy offers the multi-agent version', copyPage.includes('id="multi-agent"') && copyPage.includes('npx skills add https://branchwell.ai/skillfarm/skills.git --skill pptx --full-depth -a codex -g -y') && !copyPage.includes('NOTICE.md') && !copyPage.includes('keeps the credit') && !copyPage.includes('github.com/projectatomai') && copyPage.includes('Install the original'));
579425 check('a pick without a converted copy shows no multi-agent card', !(await (await anon.req('/skills/sprout/security-best-practices')).text()).includes('id="multi-agent"'));
580- const copyPlan = await call('install_skill', { skill: 'sprout/powerpoint-decks' });
581- check('install steps use the maker\'s way for Claude Code and the converted copy elsewhere', copyPlan?.agents?.length === 3 && copyPlan.agents.find((k) => k.agent === 'claude-code')?.quick_where === 'claude-code' && copyPlan.agents.find((k) => k.agent === 'codex')?.copy === true && copyPlan.multi_agent?.agents?.length === 3 && copyPlan.multi_agent.repo === 'skillfarm/skills', JSON.stringify(copyPlan?.agents?.map((k) => [k.agent, k.quick_where, k.copy])));
582- const copyOne = await call('install_skill', { skill: 'sprout/powerpoint-decks', agent: 'gemini-cli' });
583- check('asking for one agent narrows the converted copy too', copyOne?.agents?.length === 1 && copyOne.multi_agent?.agents?.length === 1 && copyOne.agents[0].quick.endsWith('-a gemini-cli -g -y'));
584- const copySearch = await call('search_skills', { query: 'powerpoint', agent: 'codex' });
585- check('a converted pick is found under Codex and names its copy', copySearch?.skills?.some((k) => k.skill === 'sprout/powerpoint-decks' && k.multi_agent_version === 'https://branchwell.ai/skillfarm/skills/tree/main/converted/pptx'), JSON.stringify(copySearch?.skills?.map((k) => k.skill)));
586426 // The prompt library.
587427 const promptsRes = await anon.req('/prompts');
588428 const promptsHtml = await promptsRes.text();
⋯
595435 check('the header links to Prompts', (await (await anon.req('/')).text()).includes('href="/prompts"'));
596436 const sitemap = await (await anon.req('/sitemap.xml')).text();
597437 check('the sitemap lists Help, Prompts and each prompt', sitemap.includes('/help</loc>') && sitemap.includes('/prompts</loc>') && sitemap.includes('/prompts/own-skills-repo</loc>'));
598- const mcpPrompts = (await mcp('/mcp', 'prompts/list', {})).body?.result?.prompts;
599- check('MCP lists the prompts', mcpPrompts?.length === new Set(promptSlugs).size && mcpPrompts.some((k) => k.name === 'own-skills-repo' && k.description), `${mcpPrompts?.length}`);
600- const mcpPrompt = (await mcp('/mcp', 'prompts/get', { name: 'own-skills-repo' })).body?.result;
601- check('MCP returns one prompt as a user message', mcpPrompt?.messages?.[0]?.role === 'user' && mcpPrompt.messages[0].content?.text?.startsWith('Set up one skills repository'));
602- check('MCP refuses an unknown prompt', (await mcp('/mcp', 'prompts/get', { name: 'nope' })).body?.error?.code === -32602);
603- const promptList = await call('get_prompt', {});
604- check('get_prompt lists the library in groups', promptList?.prompts?.length === mcpPrompts?.length && promptList.groups?.length === 4 && promptList.prompts.every((k) => k.url.includes('/prompts/')));
605- const promptGroup = await call('get_prompt', { group: 'build' });
606- check('get_prompt narrows to a group', promptGroup?.prompts?.length >= 3 && promptGroup.prompts.every((k) => k.group === 'build'));
607- const promptOne = await call('get_prompt', { prompt: 'fix-a-bug' });
608- check('get_prompt returns the full text of one prompt', promptOne?.prompt === 'fix-a-bug' && typeof promptOne.text === 'string' && promptOne.text.length > 200);
609438 const editPick = await admin.req('/admin/picks', { method: 'POST', form: { ...pickForm, id: pickId, summary: 'An edited summary for the made-up skill.' } });
610439 check('admin edits a pick', editPick.status === 302 && (await (await anon.req(pickPath)).text()).includes('An edited summary'));
611440 const rmPick = await admin.req(`/admin/skills/${pickId}/remove`, { method: 'POST' });

Browse files at this commit