Skip to content

ui: use the skills of the machine's folders in a chat, next to MCP skills - #142

Draft
allozaur wants to merge 1 commit into
allozaur/feat/ui-library-skillsfrom
allozaur/feat/ui-local-skills-in-chat
Draft

allozaur wants to merge 1 commit into
allozaur/feat/ui-library-skillsfrom
allozaur/feat/ui-local-skills-in-chat

Conversation

@allozaur

@allozaur allozaur commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Overview

The skills on the machine's folders can be used in a chat the way MCP skills are: /skill lists them next to the MCP servers' ones and attaches the picked one, and the model can list and load either kind, asking the user before a skill is loaded.

Additional information

Stacked on the Library skills PR (#141). It joins that PR's local skills with the chat side of the MCP skills PR (#137).

Choices made here:

  • Where the skill tools live. In the core now, not in the MCP extension: list_skills and load_skill are the app's own browser tools and read every SkillSource. The point grows what a chat needs (isAvailable, attach, permission, load), and MCP's source implements them on top of its skills store. The core still does not import the MCP extension. It is the smaller change of the two: the other option, the MCP extension owning tools that also read the folders, would have tied local skills to MCP being on.
  • load_skill takes a name, and from only when two places have a skill of that name. A name only one place has is loaded whatever from says. In the browser, a 2B model kept passing the skill's name as from and looped; the user still sees where the skill is from in the card before anything loads.
  • Approval of a local skill is bound to the SHA-256 of its SKILL.md: Allow once holds while the page is open, Always allow is kept in localStorage, and a skill whose text changed is asked for again (the card says it changed). Picking a skill in /skill is the user's yes to it, as for MCP skills.
  • With llama-server's tools off, the folder source is not on offer: /skill and the tools offer MCP skills only, and with no MCP server publishing skills /skill is greyed out like /cwd. The listing the model gets no longer says where skills come from in general, only under each place.
  • The tools are listed under Browser Tools in the tool settings, not under an "MCP Skills" group.

Still open: how local skills are found. LocalSkillsService goes through llama-server's file_glob_search and read_file; a /skills endpoint would replace that service only, without touching the chat side. The folders stay ~/.agents/skills, then ~/.claude/skills (LOCAL_SKILL_FOLDERS).

Not in it:

  • A local skill's other files. Only its SKILL.md is loaded, since the approval covers that file alone; a call naming another file fails saying so.
  • Taking back an "Always allow" of a local skill.
  • Uploaded demo video: the script below was recorded locally only.
What changed
  • extensions/points/skills.ts: SkillSource grows originKind, isAvailable, attach, permission and load; SkillEntry grows iconUrl and isUnverified; new SkillPermission.
  • services/skill-tools.service.ts (new): the two tool definitions, the listing under each origin, resolving a call to a skill, the call permission and the run. toolsStore offers the tools as browser tools while a source offers skills, with the call permission on load_skill; the agentic loop runs them.
  • stores/skills.svelte.ts: the local source attaches a skill as a chip holding its text, asks with its SKILL.md digest, and loads only with the text the user allowed. hasAvailableSources gates /skill and the tools.
  • /skill is a built-in command now, right after /prompt, with ChatFormPickerSkills over every source; ChatFormPickerPromptOrigin draws a skill's origin too.
  • ChatMessageActionCardSkillDetail: what the permission card shows of a local skill (its description and path, and whether it changed).
  • LocalSkillsService.format and skillDigest: the text the model gets under a line naming the folder, and the digest an approval is bound to.
  • MCP extension: skills/source.ts implements the new methods with mcpStore.skills; skills/tools.ts, its /skill command and ComposerMcpSkills are gone.
  • README: how a chat uses skills.
Testing

In ui/apps/chat:

  • npm run check and npm run lint clean.
  • 1,199 unit tests pass. New or rewritten: the skill tools over fake sources (listing under each origin, unverifiable skills left out, a source off or failing, resolving by name and from, the approval through AgenticGates with each answer kept by the source, a call that names no skill, the tools on and off in toolsStore), the local source in a chat (asks, allow for now and for good, a changed skill asked again, SKILL.md only, attach and a failed attach) and the MCP source's new methods. PR 137's mcp-skill-tools test is replaced by skill-tools.
  • All 80 client test files (428 tests) in eight batches of ten, and the permission card's stories, with a new state for a folder skill.
  • In the browser, against a llama-server with tools on (LFM3-Omni-2B, --agent -c 100000) and the Hugging Face MCP server: /skill listed the 19 skills of ~/.agents/skills and then the server's; a picked local skill went with the message (4,901 prompt tokens); the model loaded a local skill after "Always allow this skill" in the card and quoted it, and loaded hf-mem from Hugging Face after "Allow once". Against a llama-server without tools, /skill was greyed out.
  • The demo script below recorded end to end against the same server.

Not run: the E2E suite, a production build.

Demo script

Needs a tools model on llama-server (any, at -c 100000) 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 publishes 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.',
		'---',
		'',
		'# 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();
	});

	const input = page.getByRole('textbox').first();
	const picker = page.locator('[data-slot="popover-content"]');
	const stop = page.getByRole('button', { name: 'Stop generation' });

	// /skill: the machine's skills first, then the MCP server's, each with where it comes from
	await demo.type(input, '/skill');
	await demo.press('Enter');
	await expect(picker.getByText('review-change')).toBeVisible();
	await expect(picker.getByText('hf-mem', { exact: true })).toBeVisible({ timeout: 30000 });
	await demo.caption('/skill lists the skills of your folders next to the MCP servers’ ones');
	await demo.click(picker.getByText('review-change'));
	await expect(page.getByText('Skill: review-change')).toBeVisible();
	await demo.caption('Picked: it goes with the message, under the folder it comes from');

	await demo.type(input, 'Which rule of this skill comes first? One sentence.');
	await demo.press('Enter');
	await expect(stop).toHaveCount(0, { timeout: 60000 });
	await demo.pause(1500);

	// the model lists and loads a skill itself, and the permission card asks for that skill
	const newChat = page.getByRole('button', { name: 'New chat' }).filter({ visible: true });

	if ((await newChat.count()) === 0) {
		await demo.click(page.getByRole('button', { name: 'Expand navigation' }).first());
	}

	await demo.click(newChat.first());
	await demo.type(
		page.getByRole('textbox').first(),
		'Load the release-notes skill with load_skill, then list its steps.'
	);
	await demo.press('Enter');

	const skillCard = page.getByText('the skill release-notes');
	const allowOnce = page.getByRole('button', { exact: true, name: 'Allow once' });

	// a model that lists the skills first is asked for list_skills, as for any tool
	await expect(allowOnce.first()).toBeVisible({ timeout: 60000 });

	if (!(await skillCard.isVisible())) {
		await demo.click(allowOnce.first());
		await expect(skillCard).toBeVisible({ timeout: 60000 });
	}

	await demo.caption('Loading a skill asks for that skill, in the card every tool call uses');
	await demo.pause(1200);
	await demo.click(allowOnce.first());
	await expect(stop).toHaveCount(0, { timeout: 60000 });
	await demo.pause(2000);
});

Requirements

@allozaur
allozaur added this pull request to stack #138 November 26, 2026 16:16
@github-actions github-actions Bot added documentation Improvements or additions to documentation devops server server/ui labels Nov 26, 2026
@allozaur
allozaur force-pushed the allozaur/feat/ui-local-skills-in-chat branch from 9a246a1 to bb8592f Compare November 26, 2026 16:22
@allozaur
allozaur force-pushed the allozaur/feat/ui-local-skills-in-chat branch 2 times, most recently from b1a164a to a831668 Compare November 27, 2026 08:51
@allozaur
allozaur force-pushed the allozaur/feat/ui-local-skills-in-chat branch from a831668 to 2ab4cca Compare November 27, 2026 09:04
/skill lists the skills of ~/.agents/skills and ~/.claude/skills next to
the ones MCP servers publish, each under where it comes from, and the
model lists and loads both through list_skills and load_skill. A load
asks for the skill in the tool permission card, bound to its content.

The tools move from the MCP extension to the core: they read every
SkillSource, which grows isAvailable, attach, permission and load. The
local source keeps approvals by the SHA-256 of SKILL.md; the MCP source
keeps PR 137's digest-set approvals. With llama-server's file tools off,
only MCP skills are on offer.

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-local-skills-in-chat branch from 2ab4cca to ce1cb87 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

devops documentation Improvements or additions to documentation server/ui server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant