Skip to content

ui: list the skills at hand in the Library: the machine's folders and MCP servers - #141

Draft
allozaur wants to merge 1 commit into
allozaur/feat/ui-library-attachmentsfrom
allozaur/feat/ui-library-skills
Draft

allozaur wants to merge 1 commit into
allozaur/feat/ui-library-attachmentsfrom
allozaur/feat/ui-library-skills

Conversation

@allozaur

@allozaur allozaur commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Overview

The Library gets a Skills tab: the skills found on the machine and the ones MCP servers publish, one row each with its name, where it comes from and what it is for. A search field filters them, and a row opens the skill's SKILL.md.

Additional information

Stacked on the Library attachments PR (#140). Third of three Library PRs. There is no Discover and no catalog: only what is at hand.

Open, for a decision:

  • How the browser finds them. Built: llama-server's existing file tools (file_glob_search, read_file), so local skills are listed only when llama-server runs with its tools on. The other route is a /skills endpoint in llama-server, which is C++ and would work without the tools.
  • MCP skills in the tab. They are listed next to the local ones, each under its server's name. That was not asked for in so many words.

Choices made here:

  • Folders. ~/.agents/skills, then ~/.claude/skills, on the machine llama-server runs on. A project's own .agents/skills is not listed: the Library has no project or working directory to take it from.
  • When both folders hold a skill of the same name, the first folder's is listed.
  • Only a SKILL.md's name and description are read. A skill that does not name itself is known by its folder.
  • A row opens the SKILL.md rendered as Markdown, without its frontmatter. For an MCP skill that is the verified read the server card's "Read SKILL.md" does: looking at a skill is not loading it for the model.

Not in it:

  • Using a local skill in a chat. /skill, list_skills and load_skill still cover MCP skills only. Making local ones usable the same way needs the approval bound to their content and a tool provider for them: a follow-up.
  • A skill's other files. Only SKILL.md is shown.
  • The demo script below was run locally. No video is uploaded yet.
How it works
  • One kind of item, several sources. A source lists its skills and reads one's SKILL.md. The machine's folders are the app's own source. An extension adds another through a new skillSources extension point, and MCP contributes the skills of its servers that way. The core does not import the MCP extension.
  • Local skills. One file_glob_search per folder finds the SKILL.md files two levels down, then the top 40 lines of each are read for the frontmatter. A folder that is not there has no skills. Nothing is kept: the list is read when the tab shows.
  • MCP skills. The listings mcpStore.skills already keeps, for the servers in use. Showing the tab connects the servers that are on, as the server card does.
  • The tab. Mounted only while it shows. The search looks at names, descriptions and sources.
What changed
  • extensions/points/skills.ts: SkillSource and SkillEntry, and the skillSources point.
  • LocalSkillsService: the skills of a folder and a skill's SKILL.md, through ToolsService.
  • skillsStore: the local source (folders in order, one skill per name, sorted) and sources, with what extensions contribute. canReadLocalSkills says whether llama-server offers the two file tools.
  • utils/skill-manifest.ts: name and description from a frontmatter, plain, quoted or a block, and the instructions without it.
  • LibrarySkills, LibrarySkillRow, DialogSkill, and the third tab of the Library page.
  • MCP extension: skills/source.ts. Its skill icon now comes from the core's SKILL_ICON.
  • README: the new extension point and where local skills come from.
Testing

In ui/apps/chat, on the tip of this branch:

  • npm run check and npm run lint clean.
  • 1,185 unit tests pass, 24 of them new: the frontmatter reader (one line, folded, literal, quoted, nested keys, Windows line ends, no frontmatter), the local skills service over mocked file tools, the skills store (folder order, one skill per name, no file tools, a folder that fails, a skill that was not listed) and the MCP source.
  • Client and Storybook tests pass, the client ones in batches of ten.
  • In the browser, against a llama-server with its tools on: the tab listed the 19 skills of ~/.agents/skills on this machine (the same names in ~/.claude/skills are listed once) and the 25 the Hugging Face MCP server publishes, the search narrowed them, and a local and an MCP skill each opened their SKILL.md. Checked on a phone viewport too.

Not run: the E2E suite, a production build, a llama-server without tools (the empty state for it is covered by the store's test only).

Demo script

Needs no model and no sign-in. The local skills are answered by the script in place of llama-server's file tools, so the video shows the same skills on any machine; the MCP skills are the Hugging Face server's.

// The Hugging Face MCP server lists its skills without a sign-in.
const HUGGING_FACE_SERVER = {
	enabled: true,
	id: 'huggingface',
	name: 'Hugging Face',
	url: 'https://huggingface.co/mcp'
};
// Two skills of ~/.agents/skills, answered here in place of llama-server's file tools, so the
// demo shows the same skills on any machine.
const LOCAL_SKILLS: Record<string, string> = {
	'release-notes': [
		'---',
		'name: release-notes',
		'description: Write release notes from the merged pull requests since the last tag.',
		'---',
		'',
		'# Release notes',
		'',
		'1. List the pull requests merged since the last tag.',
		'2. Group them: features, fixes, the rest.',
		'3. Write one line per pull request, for a reader who uses the app.'
	].join('\n'),
	'review-change': [
		'---',
		'name: review-change',
		'description: >',
		'  Review a change for bugs first, then for style.',
		'  Use when asked to review a diff or a pull request.',
		'---',
		'',
		'# Review a change',
		'',
		'Read the whole diff before commenting. Report bugs with the input that triggers them.'
	].join('\n')
};

test.use({ settings: { enableMcp: true, mcpServers: JSON.stringify([HUGGING_FACE_SERVER]) } });

test('demo', async ({ demo, page }) => {
	await page.route('**/tools', async (route) => {
		const request = route.request();

		if (request.method() !== 'POST') return route.continue();

		const { params, tool } = request.postDataJSON();

		if (tool === 'file_glob_search') {
			return route.fulfill({
				json:
					params.path === '~/.agents/skills'
						? {
								base: '/home/demo/.agents/skills',
								entries: Object.keys(LOCAL_SKILLS).map((name) => ({
									path: `${name}/SKILL.md`,
									type: 'file'
								}))
							}
						: { error: `path does not exist or is not a directory: ${params.path}` }
			});
		}

		if (tool === 'read_file') {
			const name = String(params.path).split('/').at(-2) ?? '';

			return route.fulfill({ json: { plain_text_response: LOCAL_SKILLS[name] ?? '' } });
		}

		return route.continue();
	});

	await demo.click(page.getByRole('button', { name: 'Expand navigation' }).first());
	await demo.click(page.getByRole('button', { name: 'Library' }));
	await demo.click(page.getByRole('tab', { name: 'Skills' }));

	await expect(page.getByText('review-change')).toBeVisible();
	await expect(page.getByText('hf-mem', { exact: true })).toBeVisible({ timeout: 30000 });
	await demo.caption('The skills on this machine and on MCP servers, each with its source');
	await demo.scroll(page.getByText('hf-mem', { exact: true }), 600);
	await demo.pause(1000);

	const search = page.getByPlaceholder('Search skills');

	await demo.type(search, 'review');
	await demo.click(page.getByRole('button', { name: /review-change/ }));
	await expect(page.getByRole('dialog', { name: /review-change/ })).toBeVisible();
	await demo.caption('A row opens the SKILL.md of its skill');
	await demo.press('Escape');

	await search.fill('');
	await demo.type(search, 'hf-mem');
	await demo.click(page.getByRole('button', { name: /hf-mem/ }));
	await expect(page.getByRole('dialog', { name: /hf-mem/ })).toBeVisible();
	await demo.caption('For a skill of an MCP server it is read from that server, verified');
	await demo.pause(1500);
});

Requirements

@allozaur
allozaur added this pull request to stack #138 November 26, 2026 15:27
@allozaur
allozaur force-pushed the allozaur/feat/ui-library-skills branch from 673a257 to 9969f50 Compare November 26, 2026 15:30
@github-actions github-actions Bot added documentation Improvements or additions to documentation server/ui labels Nov 26, 2026
@allozaur
allozaur force-pushed the allozaur/feat/ui-library-skills branch from 9969f50 to 106c643 Compare November 26, 2026 16:12
@allozaur
allozaur force-pushed the allozaur/feat/ui-library-skills branch 2 times, most recently from 0a81678 to 45c6b2f Compare November 26, 2026 20:05
@allozaur
allozaur force-pushed the allozaur/feat/ui-library-skills branch 2 times, most recently from 171c960 to 695c444 Compare November 27, 2026 09:04
… MCP servers

A Skills tab lists the skills found in ~/.agents/skills and ~/.claude/skills on the machine llama-server runs on, read through llama-server's file tools, next to the skills MCP servers publish, which reach it through the new skillSources point. A row opens the skill's SKILL.md.

Assisted-by: Claude (Opus 5.5 Medium)
@allozaur
allozaur removed this pull request from stack #138 November 27, 2026 09:26
@allozaur
allozaur force-pushed the allozaur/feat/ui-library-skills branch from 695c444 to 105d6ee Compare November 27, 2026 09:26
@allozaur
allozaur added this pull request to stack #151 November 27, 2026 09:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant