Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(skillhub): respect native discovery and managed skill ownership
xd-bobo98ec6a8b5be5
diff --git a/apps/desktop/help-knowledge/skills.md b/apps/desktop/help-knowledge/skills.mdindex 579274e9fb..906151f615 100644--- a/apps/desktop/help-knowledge/skills.md+++ b/apps/desktop/help-knowledge/skills.md@@ -24,7 +24,7 @@ Skills are reusable agent capabilities you package as a folder and load into you**Using an installed skill:**-- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command.+- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command. Pi package skills remain usable from `/`, but do not show this local detail shortcut; manage them through their package.- Type `/` in the composer to open the slash-command palette; your installed skills show up there alongside built-in and agent commands. Pick one to run it.@@ -33,7 +33,7 @@ Skills are reusable agent capabilities you package as a folder and load into you- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from Cindy's command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.-- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here.+- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here. Skills provided by Cindy plugins are managed on the owning plugin's page, including when discovered through shared skill links.- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** in the current app run.**Publishing your own skill:**diff --git a/apps/desktop/src/main/bootstrap-electron.ts b/apps/desktop/src/main/bootstrap-electron.tsindex 382681a98b..31b6c0e90e 100644--- a/apps/desktop/src/main/bootstrap-electron.ts+++ b/apps/desktop/src/main/bootstrap-electron.ts@@ -6416,6 +6416,7 @@ const registerIpcHandlers = () => {registerSkillhubIpc({getMaker: getMakerCore,+ getManagedSkillRoots: () => getGhostManager().managedRootDirs(),getAllowedProjectRoots: listAllowedSkillhubProjectRoots,});disposeSkillhubAutoSyncAuthListener = authManager.onAuthStateChange((state) => {diff --git a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.tsindex ff6efbb436..cd4ac0436c 100644--- a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts+++ b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts@@ -144,7 +144,7 @@ export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [id: "skills",title: "Skills (reusable agent capabilities)",summary: "Browse, install, disable, uninstall, publish, and update agent skills; installed skills appear as \"/\" slash commands and are shared across Claude Code and Codex.",- content: "Skills are reusable agent capabilities you package as a folder and load into your sessions. They're managed on the same page as Plugins — **Skills** and **Plugins** are two tabs of one management surface (the Skills tab is the in-app browser for finding, installing, publishing, and updating skills).\n\n**Skills work with both agents:**\n\n- Skills are **engine-shared** — the same installed skill is available to both Claude Code and Codex, so you install it once.\n\n**Where skills live on disk:**\n\n- Global (available to every session): the shared root `~/.agents/skills/<name>/`, which is cross-linked to `~/.claude/skills/` and `~/.codex/skills/` so every engine sees the same skills. On Windows that's under `C:\\Users\\<you>\\`.\n- Project-scoped (only inside one working directory): `<working-dir>/.agents/skills/<name>/` or `<working-dir>/.claude/skills/<name>/`.\n- Each skill is its own folder with a required `SKILL.md` at the root (the prompt / spec the agent reads). Sibling files and subfolders in that folder are also visible to the agent.\n\n**Importing a local skill:**\n\n- On the Skills page, use **Import skill** (top-right) to pick a `.zip` package or a standalone `SKILL.md` file.\n- A zip must contain a `SKILL.md` (at the package root, or inside a single top-level folder). The YAML frontmatter must include non-empty `name` and `description` fields; `name` must match `^[a-z0-9-]{1,200}$`.\n- You then choose where to install: global, a known project, or another directory. Cindy extracts metadata from the file automatically and lists the skill with that name and description.\n- Imported skills can be uninstalled from the detail page, and you can publish them to SkillHub later if you want.\n\n**Using an installed skill:**\n\n- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command.\n\n- Type `/` in the composer to open the slash-command palette; your installed skills show up there alongside built-in and agent commands. Pick one to run it.\n\n**Disabling or uninstalling a local skill (Desktop):**\n\n- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from Cindy's command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.\n- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.\n- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.\n- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here.\n- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** in the current app run.\n\n**Publishing your own skill:**\n\n- Find the publish action on the Skills page and point it at the skill's local folder. It zips the folder and uploads it — reading your directory in place, without copying or moving anything.\n- On first publish, you set the skill's **visibility**: PUBLIC (anyone in the org) or DEPARTMENT_SCOPED (only the departments you choose).\n- The local registry records what you published, so the app knows it's \"yours\" for future updates.\n\n**Updating an already-published skill:**\n\n- On your own skill's detail page you'll see a **发布新版本** (Publish New Version) button.\n- Edit the local folder however you want and publish — the version is **auto-incremented server-side**, you don't pick a number.\n- **Old versions stay live alongside the new one.** Users who already installed an older version keep it until they choose to update.\n- The display name and description are sent on every republish, so editing those metadata fields just means doing a republish.\n\n**Managing an already-published skill:**\n\n- Change who can see or use your skill from the management menu — public, shared with selected teams / departments, or private to you.\n- **Unpublish** makes it private again and returns ownership to your personal scope; it does not remove copies other users already installed.\n- **Authorship is fixed.** Only the original author's account can publish new versions of a given skill (enforced server-side as `NOT_AUTHOR`).\n\n**Browsing and installing others' skills:**\n\n- The marketplace lets you install skills into your global skills directory. You can request a specific version on install; the local registry tracks which version you have.\n\n**Notes:**\n\n- A skill folder without a `SKILL.md` at its root won't be picked up (lowercase `skill.md` is also accepted).\n- Project-scoped skills only show up in sessions whose working directory matches — useful for skills tied to a particular repo's conventions.\n- Editing files inside an installed skill folder takes effect on the next session start; you don't need to reinstall.\n- Uninstalling only removes your local copy. For your own published skills, use unpublish or manage visibility to change market availability.",+ content: "Skills are reusable agent capabilities you package as a folder and load into your sessions. They're managed on the same page as Plugins — **Skills** and **Plugins** are two tabs of one management surface (the Skills tab is the in-app browser for finding, installing, publishing, and updating skills).\n\n**Skills work with both agents:**\n\n- Skills are **engine-shared** — the same installed skill is available to both Claude Code and Codex, so you install it once.\n\n**Where skills live on disk:**\n\n- Global (available to every session): the shared root `~/.agents/skills/<name>/`, which is cross-linked to `~/.claude/skills/` and `~/.codex/skills/` so every engine sees the same skills. On Windows that's under `C:\\Users\\<you>\\`.\n- Project-scoped (only inside one working directory): `<working-dir>/.agents/skills/<name>/` or `<working-dir>/.claude/skills/<name>/`.\n- Each skill is its own folder with a required `SKILL.md` at the root (the prompt / spec the agent reads). Sibling files and subfolders in that folder are also visible to the agent.\n\n**Importing a local skill:**\n\n- On the Skills page, use **Import skill** (top-right) to pick a `.zip` package or a standalone `SKILL.md` file.\n- A zip must contain a `SKILL.md` (at the package root, or inside a single top-level folder). The YAML frontmatter must include non-empty `name` and `description` fields; `name` must match `^[a-z0-9-]{1,200}$`.\n- You then choose where to install: global, a known project, or another directory. Cindy extracts metadata from the file automatically and lists the skill with that name and description.\n- Imported skills can be uninstalled from the detail page, and you can publish them to SkillHub later if you want.\n\n**Using an installed skill:**\n\n- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command. Pi package skills remain usable from `/`, but do not show this local detail shortcut; manage them through their package.\n\n- Type `/` in the composer to open the slash-command palette; your installed skills show up there alongside built-in and agent commands. Pick one to run it.\n\n**Disabling or uninstalling a local skill (Desktop):**\n\n- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from Cindy's command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.\n- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.\n- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.\n- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here. Skills provided by Cindy plugins are managed on the owning plugin's page, including when discovered through shared skill links.\n- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** in the current app run.\n\n**Publishing your own skill:**\n\n- Find the publish action on the Skills page and point it at the skill's local folder. It zips the folder and uploads it — reading your directory in place, without copying or moving anything.\n- On first publish, you set the skill's **visibility**: PUBLIC (anyone in the org) or DEPARTMENT_SCOPED (only the departments you choose).\n- The local registry records what you published, so the app knows it's \"yours\" for future updates.\n\n**Updating an already-published skill:**\n\n- On your own skill's detail page you'll see a **发布新版本** (Publish New Version) button.\n- Edit the local folder however you want and publish — the version is **auto-incremented server-side**, you don't pick a number.\n- **Old versions stay live alongside the new one.** Users who already installed an older version keep it until they choose to update.\n- The display name and description are sent on every republish, so editing those metadata fields just means doing a republish.\n\n**Managing an already-published skill:**\n\n- Change who can see or use your skill from the management menu — public, shared with selected teams / departments, or private to you.\n- **Unpublish** makes it private again and returns ownership to your personal scope; it does not remove copies other users already installed.\n- **Authorship is fixed.** Only the original author's account can publish new versions of a given skill (enforced server-side as `NOT_AUTHOR`).\n\n**Browsing and installing others' skills:**\n\n- The marketplace lets you install skills into your global skills directory. You can request a specific version on install; the local registry tracks which version you have.\n\n**Notes:**\n\n- A skill folder without a `SKILL.md` at its root won't be picked up (lowercase `skill.md` is also accepted).\n- Project-scoped skills only show up in sessions whose working directory matches — useful for skills tied to a particular repo's conventions.\n- Editing files inside an installed skill folder takes effect on the next session start; you don't need to reinstall.\n- Uninstalling only removes your local copy. For your own published skills, use unpublish or manage visibility to change market availability.",},{id: "updates-and-about",diff --git a/apps/desktop/src/main/skillhub/__tests__/localSkillTarget.test.ts b/apps/desktop/src/main/skillhub/__tests__/localSkillTarget.test.tsindex 380d1597a8..7513a140d5 100644--- a/apps/desktop/src/main/skillhub/__tests__/localSkillTarget.test.ts+++ b/apps/desktop/src/main/skillhub/__tests__/localSkillTarget.test.ts@@ -38,6 +38,22 @@ describe('local Skill removal targets', () => {expect(isLocalSkillTargetCurrent(target)).toBe(false);});+ it('excludes plugin snapshots through direct and chained discovery links without blocking external imports', () => {+ const managedRoot = path.join(root, 'ghost-install-state');+ const source = directory('ghost-install-state', 'skill-snapshots', 'plugin', 'revision', 'skill');+ const alias = path.join(root, '.agents', 'skills', 'plugin--skill');+ const fanout = path.join(root, '.claude', 'skills', 'plugin--skill');+ fs.mkdirSync(path.dirname(fanout), { recursive: true });+ fs.symlinkSync(source, alias, process.platform === 'win32' ? 'junction' : 'dir');+ fs.symlinkSync(alias, fanout, process.platform === 'win32' ? 'junction' : 'dir');+ expect(inspectLocalSkillTarget(source, [alias, fanout], [managedRoot])).toBeNull();+ expect(inspectLocalSkillTarget(fanout, [fanout], [managedRoot])).toBeNull();+ const external = directory('external', 'skill-snapshots', 'plugin', 'revision', 'skill');+ const externalAlias = path.join(root, '.agents', 'skills', 'external--skill');+ fs.symlinkSync(external, externalAlias, process.platform === 'win32' ? 'junction' : 'dir');+ expect(inspectLocalSkillTarget(external, [externalAlias], [managedRoot])?.linkOnly).toBe(true);+ });+it('treats a standalone Markdown Skill as one file', () => {const file = path.join(root, '.pi', 'skills', 'standalone.md');fs.mkdirSync(path.dirname(file), { recursive: true });diff --git a/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts b/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.tsindex f54297f92d..e5c6bc8bbc 100644--- a/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts+++ b/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts@@ -70,6 +70,7 @@ const listSkillFolderChildren = vi.fn();const readSkillSiblingFile = vi.fn();const renameLocalSkill = vi.fn();const scanAllSkills = vi.fn();+const getManagedSkillRoots = vi.fn((): string[] => []);const writeSkillFile = vi.fn();const resolveExistingSkillPathForGrant = vi.fn();const isExistingSkillPathGranted = vi.fn();@@ -124,6 +125,7 @@ describe('registerSkillhubIpc usage handlers', () => {beforeEach(async () => {handlers.clear();vi.clearAllMocks();+ getManagedSkillRoots.mockReturnValue([]);getCurrentDataOwnerId.mockReturnValue('local-v1');getCurrentDbClientSnapshot.mockReset();getCurrentDbClientSnapshot.mockReturnValue({@@ -144,6 +146,7 @@ describe('registerSkillhubIpc usage handlers', () => {const { registerSkillhubIpc } = await import('../registerIpc');registerSkillhubIpc({getMaker: () => ({ listAgentSkills }) as never,+ getManagedSkillRoots,getAllowedProjectRoots,marketService: marketService as never,publishService: { publish, cancel } as never,@@ -647,6 +650,28 @@ describe('registerSkillhubIpc usage handlers', () => {expect(setCindySkillEnabled).toHaveBeenCalledTimes(1);});+ it('rejects direct uninstall of a plugin snapshot even when the scanned UI claims it is removable', async () => {+ const stateRoot = fs.mkdtempSync(path.join(fixtureRoot, 'plugin-state-'));+ const source = path.join(stateRoot, 'skill-snapshots', 'plugin', 'revision', 'skill');+ fs.mkdirSync(source, { recursive: true });+ fs.writeFileSync(path.join(source, 'SKILL.md'), 'plugin skill');+ const alias = path.join(fixtureRoot, '.agents', 'skills', 'plugin--skill');+ fs.mkdirSync(path.dirname(alias), { recursive: true });+ fs.symlinkSync(source, alias, process.platform === 'win32' ? 'junction' : 'dir');+ getManagedSkillRoots.mockReturnValue([stateRoot]);+ scanAllSkills.mockResolvedValue({ skills: [{+ kind: 'skill', scope: 'global', name: 'plugin--skill', canUninstall: true,+ absolutePath: source, discoveredPath: alias, discoveryPaths: [alias],+ }], sources: [] });+ const event = { sender: { id: 73, once: vi.fn() } };+ await handlers.get('skillhub:scan')!(event, {});+ await expect(handlers.get('skillhub:uninstall')!(event, { absolutePath: source }))+ .rejects.toThrow('PRECONDITION_FAILED');+ expect(installServiceMocks.uninstall).not.toHaveBeenCalled();+ expect(fs.existsSync(alias)).toBe(true);+ getManagedSkillRoots.mockReturnValue([]);+ });+it('rejects owner changes and replaced sources before mutation', async () => {const { event, absolutePath } = await scanLocalFixture();const uninstall = handlers.get('skillhub:uninstall')!;diff --git a/apps/desktop/src/main/skillhub/__tests__/scanner.test.ts b/apps/desktop/src/main/skillhub/__tests__/scanner.test.tsindex 98d6cb7feb..fc482bf6e1 100644--- a/apps/desktop/src/main/skillhub/__tests__/scanner.test.ts+++ b/apps/desktop/src/main/skillhub/__tests__/scanner.test.ts@@ -80,6 +80,26 @@ function createSymlinkedSkill() {}describe('scanAllSkills', () => {+ it('projects plugin ownership and prevents standalone uninstall for snapshot links', async () => {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'skillhub-plugin-source-'));+ tempRoots.push(root);+ const stateRoot = path.join(root, 'ghost-install-state');+ const source = path.join(stateRoot, 'skill-snapshots', 'plugin', 'revision', 'skill');+ const alias = path.join(root, '.agents', 'skills', 'plugin--skill');+ fs.mkdirSync(source, { recursive: true });+ fs.mkdirSync(path.dirname(alias), { recursive: true });+ fs.writeFileSync(path.join(source, 'SKILL.md'), '---\nname: example\n---\nExample');+ fs.symlinkSync(source, alias, process.platform === 'win32' ? 'junction' : 'dir');+ const maker = { listCustomizations: vi.fn(async () => ({ errors: [], items: [{+ engine: 'pi', kind: 'skill', scope: 'user', name: 'example', absolutePath: alias,+ mdPath: path.join(alias, 'SKILL.md'), files: [],+ }] })) } as unknown as Maker;+ const result = await scanAllSkills({}, maker, [stateRoot]);+ expect(result.skills).toHaveLength(1);+ expect(result.skills[0]).toMatchObject({ managedByPlugin: true, canUninstall: false });+ expect(fs.existsSync(alias)).toBe(true);+ });+it('uses projectRoot as maker workingDirs and maps projectHash back to project skills', async () => {const projectRoot = path.resolve('/repo');const skillDir = path.join(projectRoot, '.claude', 'skills', 'demo');diff --git a/apps/desktop/src/main/skillhub/localSkillTarget.ts b/apps/desktop/src/main/skillhub/localSkillTarget.tsindex 55979f8afe..23eaa16776 100644--- a/apps/desktop/src/main/skillhub/localSkillTarget.ts+++ b/apps/desktop/src/main/skillhub/localSkillTarget.ts@@ -22,10 +22,25 @@ function targetIdentity(operationPath: string): string {return JSON.stringify([source, entry.dev, entry.ino, physical.dev, physical.ino]);}+/** Ownership comes from Host-managed roots, never a link name or a directory-name heuristic. */+export function isPluginManagedSkillPath(source: string, managedRoots: readonly string[]): boolean {+ const canonical = (value: string) => {+ let resolved = path.resolve(value);+ try { resolved = fs.realpathSync.native(resolved); } catch { /* Missing roots have no live targets. */ }+ return process.platform === 'win32' ? resolved.toLowerCase() : resolved;+ };+ const target = canonical(source);+ return managedRoots.some((root) => {+ const relative = path.relative(canonical(root), target);+ return relative === '' || (relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative));+ });+}+/** Only standalone Skill entities may be trashed; never an enclosing package or discovery root. */-export function inspectLocalSkillTarget(source: string, discoveryPaths: readonly string[]): LocalSkillTarget | null {+export function inspectLocalSkillTarget(source: string, discoveryPaths: readonly string[], managedRoots: readonly string[] = []): LocalSkillTarget | null {try {const sourcePath = fs.realpathSync.native(source);+ if (isPluginManagedSkillPath(sourcePath, managedRoots)) return null;const stat = fs.statSync(sourcePath);if (stat.isDirectory()) {if (!['SKILL.md', 'skill.md'].some((name) => fs.statSync(path.join(sourcePath, name), { throwIfNoEntry: false })?.isFile())) return null;diff --git a/apps/desktop/src/main/skillhub/registerIpc.ts b/apps/desktop/src/main/skillhub/registerIpc.tsindex 5cae038315..4719debd93 100644--- a/apps/desktop/src/main/skillhub/registerIpc.ts+++ b/apps/desktop/src/main/skillhub/registerIpc.ts@@ -1,7 +1,7 @@import fs from 'node:fs';import { throwIpcError } from '../utils/ipcValidate';import { setCindySkillEnabled } from './activationPreferences';-import { inspectLocalSkillTarget, isLocalSkillTargetCurrent, type LocalSkillTarget } from './localSkillTarget';+import { inspectLocalSkillTarget, isLocalSkillTargetCurrent, isPluginManagedSkillPath, type LocalSkillTarget } from './localSkillTarget';import { tryAcquireSkillInstallLock } from './installLock';import { randomUUID } from 'node:crypto';import path from 'node:path';@@ -65,6 +65,7 @@ interface ScannedSkillGrant {export interface RegisterSkillhubIpcOptions {getMaker: () => Maker;+ getManagedSkillRoots: () => readonly string[];getAllowedProjectRoots: () => Promise<readonly string[]>;marketService?: SkillhubMarketService;publishService?: SkillPublishService;@@ -205,7 +206,7 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {if (skill.kind !== 'skill') return [];try {return [{ skill, physicalIdentity: physicalIdentity(skill.absolutePath),- target: inspectLocalSkillTarget(skill.absolutePath, skill.discoveryPaths ?? [skill.discoveredPath]) }];+ target: inspectLocalSkillTarget(skill.absolutePath, skill.discoveryPaths ?? [skill.discoveredPath], options.getManagedSkillRoots()) }];} catch { return []; }}));};@@ -368,7 +369,7 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {params?.projects,options.getAllowedProjectRoots,);- const result = await scanAllSkills({ projects }, options.getMaker());+ const result = await scanAllSkills({ projects }, options.getMaker(), options.getManagedSkillRoots());if (scanGenerationBySender.get(event.sender.id) === scanGeneration&& !isAppSessionBoundaryPending()@@ -968,12 +969,13 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {'skillhub:uninstall',async (event, { absolutePath }: { absolutePath: string }) => {const { target } = await requireLocalSkill(event, absolutePath);- if (!target || !isLocalSkillTargetCurrent(target)) {+ if (!target || !isLocalSkillTargetCurrent(target) || isPluginManagedSkillPath(target.sourcePath, options.getManagedSkillRoots())) {throwIpcError('PRECONDITION_FAILED', 'Skill cannot be uninstalled; refresh and retry');}const ownerId = getCurrentDataOwnerId();const result = await installService.uninstall(absolutePath, target,- () => ownerId === getCurrentDataOwnerId() && !isAppSessionBoundaryPending());+ () => ownerId === getCurrentDataOwnerId() && !isAppSessionBoundaryPending()+ && !isPluginManagedSkillPath(target.sourcePath, options.getManagedSkillRoots()));if (!result.success) throwIpcError('INTERNAL', 'Could not move Skill to the trash; retry');await refreshCodexProjectSkillCache(result.projectWorkingDir);broadcastLocalChange();diff --git a/apps/desktop/src/main/skillhub/scanner.ts b/apps/desktop/src/main/skillhub/scanner.tsindex 1070f828d2..fe2c8890e2 100644--- a/apps/desktop/src/main/skillhub/scanner.ts+++ b/apps/desktop/src/main/skillhub/scanner.ts@@ -1,5 +1,5 @@import { isCindySkillEnabled } from './activationPreferences';-import { inspectLocalSkillTarget } from './localSkillTarget';+import { inspectLocalSkillTarget, isPluginManagedSkillPath } from './localSkillTarget';/*** SkillHub Scanner — 商店层 (registry / market) 视图组装。*@@ -43,6 +43,7 @@ export interface Skill {/** Local Cindy override, independent of each engine's native availability. */cindyEnabled?: boolean;canUninstall?: boolean;+ managedByPlugin?: boolean;uninstallLinkOnly?: boolean;/** All lexical discovery aliases; Main owns their validation. */discoveryPaths?: string[];@@ -194,6 +195,7 @@ function filterSkillPackageFileEntries(rootDir: string, entries: SkillFileEntry[export async function scanAllSkills(params: { projects?: ProjectInput[] },maker: Maker,+ managedSkillRoots: readonly string[] = [],): Promise<ScanResult> {const projects = params.projects ?? [];const projectByWorkingDir = new Map<string, ProjectInput>();@@ -334,8 +336,9 @@ export async function scanAllSkills(registryEntry: null, // 下面 join 阶段填...(c.kind === 'skill' ? (() => {const discoveryPaths = all.map((item) => item.absolutePath);- const target = inspectLocalSkillTarget(realPath, discoveryPaths);+ const target = inspectLocalSkillTarget(realPath, discoveryPaths, managedSkillRoots);return { cindyEnabled: isCindySkillEnabled(realPath), discoveryPaths,+ managedByPlugin: isPluginManagedSkillPath(realPath, managedSkillRoots),canUninstall: target !== null, uninstallLinkOnly: target?.linkOnly ?? false };})() : {}),...(project ? { projectRoot: project.projectRoot } : {}),diff --git a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsxindex 35e5cff9c0..b1b2b915cf 100644--- a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx+++ b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx@@ -8953,7 +8953,7 @@ export function ChatInput({onFocusedIndexChange={setSlashFocus}onSelect={(cmd) => insertSlashCommand(cmd)}onOpenSkillDetails={!isRemoteSession && !deviceLinkDeviceId ? (cmd) => {- if (cmd.kind !== 'agent-skill' || cmd.source !== 'skill' || !cmd.path) return;+ if (cmd.kind !== 'agent-skill' || cmd.source !== 'skill' || !cmd.path || cmd.origin === 'package') return;draftSaveSchedulerRef.current?.flush();navigate(buildLocalSkillPathRoute(cmd.path), { state: { resetHistory: true } });} : undefined}diff --git a/apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx b/apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsxindex b73e61b451..8e20b1d383 100644--- a/apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx+++ b/apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx@@ -299,7 +299,7 @@ export function SlashCommandPalette({<div className="flex items-center gap-1 text-14 font-medium text-[var(--cmd-palette-item-text)]"><span className="min-w-0 truncate">{focusedCmd.name}</span>{onOpenSkillDetails && focusedCmd.kind === 'agent-skill'- && focusedCmd.source === 'skill' && focusedCmd.path && (+ && focusedCmd.source === 'skill' && focusedCmd.path && focusedCmd.origin !== 'package' && (<Tip text={t('commandPalette.viewSkillDetails')}><Button variant="secondary"className="w-8 border-transparent bg-transparent p-0 text-[var(--cmd-palette-item-meta)]"diff --git a/apps/desktop/src/renderer/components/new-chat/__tests__/SlashCommandPalette.test.tsx b/apps/desktop/src/renderer/components/new-chat/__tests__/SlashCommandPalette.test.tsxindex c52800be2f..61f1bb409a 100644--- a/apps/desktop/src/renderer/components/new-chat/__tests__/SlashCommandPalette.test.tsx+++ b/apps/desktop/src/renderer/components/new-chat/__tests__/SlashCommandPalette.test.tsx@@ -69,6 +69,17 @@ describe('SlashCommandPalette project Skill rows', () => {expect(screen.queryByRole('button', { name: 'commandPalette.viewSkillDetails' })).toBeNull();});+ it('keeps a package Skill usable without offering an unresolvable local detail page', () => {+ const command: UnifiedCommand = { ...discoveredProjectSkill, path: '/packages/demo/SKILL.md',+ origin: 'package', runtimeStatus: 'approved' };+ const onSelect = vi.fn();+ render(<SlashCommandPalette query="" commands={[command]} focusedIndex={0}+ onFocusedIndexChange={vi.fn()} onSelect={onSelect} onClose={vi.fn()} onOpenSkillDetails={vi.fn()} />);+ expect(screen.queryByRole('button', { name: 'commandPalette.viewSkillDetails' })).toBeNull();+ fireEvent.mouseDown(screen.getByRole('button', { name: 'demo' }));+ expect(onSelect).toHaveBeenCalledWith(command);+ });+it('keeps a discovered Skill disabled and non-actionable', () => {const onSelect = vi.fn();diff --git a/apps/desktop/src/renderer/features/skillhub/components/LocalSkillControls.tsx b/apps/desktop/src/renderer/features/skillhub/components/LocalSkillControls.tsxindex 8657ba0a61..aef198b05d 100644--- a/apps/desktop/src/renderer/features/skillhub/components/LocalSkillControls.tsx+++ b/apps/desktop/src/renderer/features/skillhub/components/LocalSkillControls.tsx@@ -119,7 +119,7 @@ export function LocalSkillControls({ skill, disabled = false, onUninstalled }: {className="gap-2 rounded-lg text-13"><Trash2 size={14} />{t('skillhub.detail.uninstall')}</DropdownMenuItem>- {!skill.canUninstall && <p className="max-w-56 px-2 py-1 text-11 text-[var(--text-secondary)]">{t('skillhub.management.managedElsewhere')}</p>}+ {!skill.canUninstall && <p className="max-w-56 px-2 py-1 text-11 text-[var(--text-secondary)]">{t(skill.managedByPlugin ? 'skillhub.management.managedByPlugin' : 'skillhub.management.managedElsewhere')}</p>}</DropdownMenuContent></DropdownMenu></div>diff --git a/apps/desktop/src/renderer/features/skillhub/components/__tests__/LocalSkillControls.test.tsx b/apps/desktop/src/renderer/features/skillhub/components/__tests__/LocalSkillControls.test.tsxindex 429b049f37..a42928c3ec 100644--- a/apps/desktop/src/renderer/features/skillhub/components/__tests__/LocalSkillControls.test.tsx+++ b/apps/desktop/src/renderer/features/skillhub/components/__tests__/LocalSkillControls.test.tsx@@ -113,4 +113,14 @@ describe('Local Skill management', () => {expect(mocks.uninstall).toHaveBeenCalledOnce();expect(mocks.success).toHaveBeenCalledWith('skillhub.management.cleanupComplete');});++ it('directs plugin-owned Skills to plugin management without allowing uninstall', async () => {+ render(<LocalSkillControls skill={{ ...skill, canUninstall: false, managedByPlugin: true }} />);+ fireEvent.keyDown(screen.getByRole('button', { name: 'skillhub.management.moreLabel' }), { key: 'Enter' });+ const item = await screen.findByRole('menuitem');+ expect(item.getAttribute('aria-disabled')).toBe('true');+ fireEvent.click(item);+ expect(mocks.confirm).not.toHaveBeenCalled();+ expect(screen.getByText('skillhub.management.managedByPlugin')).toBeTruthy();+ });});diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex dcb70dd7b8..cc84dce6ea 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -11239,6 +11239,7 @@"unlinkDescription": "Only the local skill entry will be removed. Original files and edits will be kept.","sharedImpact": "Other Agents sharing this skill will also be affected. Published versions and installations elsewhere are unaffected.","managedElsewhere": "This Skill belongs to another package or shared directory. Remove it at its source.",+ "managedByPlugin": "This skill is provided by a plugin. Manage it on that plugin’s page.","cleanupIncomplete": "The skill was removed, but some local records or links could not be cleaned up.","retryCleanup": "Retry cleanup","cleanupComplete": "Cleanup completed"diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex c9ead36be6..6541c6b8fc 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -11223,6 +11223,7 @@"unlinkDescription": "ローカルのスキル登録のみを削除します。元のファイルと編集内容は保持されます。","sharedImpact": "このスキルを共有する他の Agent にも影響します。公開済みバージョンや別の場所のインストールには影響しません。","managedElsewhere": "このスキルは別のパッケージまたは共有ディレクトリで管理されています。提供元で削除してください",+ "managedByPlugin": "このスキルはプラグインが提供しています。提供元のプラグインページで管理してください。","cleanupIncomplete": "スキルは削除されましたが、一部のローカル記録またはリンクを整理できませんでした。","retryCleanup": "整理を再試行","cleanupComplete": "整理が完了しました"diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 52ffb483c0..92192fcaa8 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -11223,6 +11223,7 @@"unlinkDescription": "로컬 스킬 등록만 제거합니다. 원본 파일과 수정 내용은 유지됩니다.","sharedImpact": "이 스킬을 공유하는 다른 Agent도 영향을 받습니다. 게시된 버전과 다른 위치에 설치된 스킬에는 영향을 주지 않습니다.","managedElsewhere": "이 스킬은 다른 패키지 또는 공유 디렉터리에서 관리됩니다. 원본 위치에서 제거하세요",+ "managedByPlugin": "이 스킬은 플러그인이 제공합니다. 해당 플러그인 페이지에서 관리하세요.","cleanupIncomplete": "스킬은 제거되었지만 일부 로컬 기록이나 링크를 정리하지 못했습니다.","retryCleanup": "정리 다시 시도","cleanupComplete": "정리 완료"diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex a6a161cdd1..bd712e8d46 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -11223,6 +11223,7 @@"unlinkDescription": "仅移除本地技能入口,原文件及修改会保留。","sharedImpact": "共用此技能的其他 Agent 也会受影响。云端发布和其他安装位置不受影响。","managedElsewhere": "此技能由其他包或共享目录管理,需在其来源处移除",+ "managedByPlugin": "此技能由插件提供,请到所属插件页面管理。","cleanupIncomplete": "技能已移除,但部分本地记录或链接未清理完成。","retryCleanup": "重试清理","cleanupComplete": "清理完成"diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex a7c75da91e..17578288f2 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -11223,6 +11223,7 @@"unlinkDescription": "僅移除本機技能入口,原始檔案及修改會保留。","sharedImpact": "共用此技能的其他 Agent 也會受影響。雲端發布和其他安裝位置不受影響。","managedElsewhere": "此技能由其他套件或共用目錄管理,需在其來源處移除",+ "managedByPlugin": "此技能由插件提供,請到所屬插件頁面管理。","cleanupIncomplete": "技能已移除,但部分本機記錄或連結尚未清理完成。","retryCleanup": "重試清理","cleanupComplete": "清理完成"diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.tsindex 5aab64a422..7af77d16b6 100644--- a/apps/desktop/src/renderer/vite-env.d.ts+++ b/apps/desktop/src/renderer/vite-env.d.ts@@ -6643,6 +6643,7 @@ interface SkillhubFileEntry {interface SkillhubSkill {cindyEnabled?: boolean;canUninstall?: boolean;+ managedByPlugin?: boolean;uninstallLinkOnly?: boolean;discoveryPaths?: string[];id: string;diff --git a/packages/maker-core/src/agents/claude-code/customization-scanner.ts b/packages/maker-core/src/agents/claude-code/customization-scanner.tsindex 0ec869dd48..0eba76ecfe 100644--- a/packages/maker-core/src/agents/claude-code/customization-scanner.ts+++ b/packages/maker-core/src/agents/claude-code/customization-scanner.ts@@ -13,6 +13,7 @@* 构建 Claude 特定的目录列表和排序规则。*/+import fs from 'node:fs';import os from 'node:os';import path from 'node:path';@@ -76,3 +77,20 @@ export async function scanClaudeCustomizations(return result;}++/** Native project discovery walks to the nearest Git root (or filesystem root).+ * Keep this runtime view separate from SkillHub's explicitly owned project list.+ * Ancestors precede descendants so same-name winner selection keeps the closest source.+ */+export async function scanClaudeRuntimeSkills(workingDir: string): Promise<ListCustomizationsResult> {+ let current = fs.realpathSync(workingDir);+ const workingDirs: string[] = [];+ while (true) {+ workingDirs.unshift(current);+ if (fs.existsSync(path.join(current, '.git'))) break;+ const parent = path.dirname(current);+ if (parent === current) break;+ current = parent;+ }+ return scanClaudeCustomizations({ workingDirs, kinds: ['skill'] });+}diff --git a/packages/maker-core/src/agents/claude-code/index.ts b/packages/maker-core/src/agents/claude-code/index.tsindex 3f6acbf26c..375a59f895 100644--- a/packages/maker-core/src/agents/claude-code/index.ts+++ b/packages/maker-core/src/agents/claude-code/index.ts@@ -174,7 +174,7 @@ import type {} from '../../types/memory.js';import type { McpProviderContext } from '../../interfaces/mcp-provider.js';import { claudeDisabledSkillOverrides } from '../shared/skill-activation.js';-import { scanClaudeCustomizations } from './customization-scanner.js';+import { scanClaudeCustomizations, scanClaudeRuntimeSkills } from './customization-scanner.js';import {REVIEW_SENSITIVE_CREDENTIAL_GLOB_PATTERNS,isReviewSensitiveCredentialSelector,@@ -2370,9 +2370,7 @@ export class ClaudeCodeAgent extends BaseAgent {const disabledSkillPaths = opts.remoteHostId || opts.botRuntimeProfile || reviewMode? [] : [...(this.deps.getDisabledSkillPaths?.() ?? [])];const disabledSkillOverrides = disabledSkillPaths.length > 0- ? claudeDisabledSkillOverrides((await scanClaudeCustomizations({- workingDirs: [opts.workingDir], kinds: ['skill'],- })).items, disabledSkillPaths)+ ? claudeDisabledSkillOverrides((await scanClaudeRuntimeSkills(opts.workingDir)).items, disabledSkillPaths): {};const buildSettings = (): Settings => {const settings = buildClaudeFlagSettings({diff --git a/packages/maker-core/src/agents/pi/__tests__/pi-skills.test.ts b/packages/maker-core/src/agents/pi/__tests__/pi-skills.test.tsindex f60773d2a4..b43afa3af4 100644--- a/packages/maker-core/src/agents/pi/__tests__/pi-skills.test.ts+++ b/packages/maker-core/src/agents/pi/__tests__/pi-skills.test.ts@@ -100,6 +100,9 @@ describe('PiAgent.listAgentSkills (filesystem discovery, no binary spawn)', () =expect(ordinary.skills).toContainEqual(expect.objectContaining({name: 'managed-sample',runtimeStatus: 'approved',+ origin: 'package',+ enabled: true,+ runtimeCommandName: 'skill:managed-sample',}));expect(resolver).toHaveBeenCalledOnce();});diff --git a/packages/maker-core/src/agents/pi/index.ts b/packages/maker-core/src/agents/pi/index.tsindex 336d56c60c..ebac1a9722 100644--- a/packages/maker-core/src/agents/pi/index.ts+++ b/packages/maker-core/src/agents/pi/index.ts@@ -6911,6 +6911,7 @@ export class PiAgent extends BaseAgent {description: skill.description,source: 'skill' as const,path: skill.path,+ origin: 'package' as const,scope: 'user' as const,enabled: true,runtimeStatus: 'approved' as const,diff --git a/packages/maker-core/src/agents/shared/skill-activation.integration.test.ts b/packages/maker-core/src/agents/shared/skill-activation.integration.test.tsindex 7d272614d7..298e40d660 100644--- a/packages/maker-core/src/agents/shared/skill-activation.integration.test.ts+++ b/packages/maker-core/src/agents/shared/skill-activation.integration.test.ts@@ -4,8 +4,9 @@ import os from 'node:os';import path from 'node:path';import { spawn } from 'node:child_process';import { fileURLToPath } from 'node:url';-import { afterEach, describe, expect, it } from 'vitest';+import { afterEach, describe, expect, it, vi } from 'vitest';import { claudeDisabledSkillOverrides, skillEntryPath } from './skill-activation.js';+import { scanClaudeRuntimeSkills } from '../claude-code/customization-scanner.js';const repo = fileURLToPath(new URL('../../../../..', import.meta.url));const suffix = process.platform === 'win32' ? '.exe' : '';@@ -61,6 +62,49 @@ function safeEnv(home: string): NodeJS.ProcessEnv {}describe('pinned native Skill activation', () => {+ it.skipIf(!fs.existsSync(binary('claude-code')))('disables ancestor Skills using native Git boundaries and nearest-source precedence', async () => {+ const { root, home, cwd: project } = fixture();+ const cwd = path.join(project, 'src');+ fs.mkdirSync(cwd);+ fs.mkdirSync(path.join(project, '.git'));+ const ancestor = path.join(project, '.claude', 'skills', 'ancestor');+ const parentCopy = path.join(project, '.claude', 'skills', 'same');+ const childCopy = path.join(cwd, '.claude', 'skills', 'same');+ const outside = path.join(root, '.claude', 'skills', 'outside');+ writeSkill(ancestor, 'ancestor');+ writeSkill(parentCopy, 'parent-copy');+ writeSkill(childCopy, 'child-copy');+ writeSkill(outside, 'outside');+ const homeSpy = vi.spyOn(os, 'homedir').mockReturnValue(home);+ try {+ const { items } = await scanClaudeRuntimeSkills(cwd);+ expect(items.some((item) => item.name === 'outside')).toBe(false);+ const settings = (disabled: string[]) => claudeDisabledSkillOverrides(items, disabled);+ expect(settings([ancestor, parentCopy, outside])).toEqual({ ancestor: 'off' });+ expect(settings([childCopy])).toEqual({ same: 'off' });+ const commands = async (disabled: string[]) => rpc({ binary: binary('claude-code'), cwd,+ env: { ...safeEnv(home), CLAUDE_CONFIG_DIR: path.join(home, '.claude'),+ ANTHROPIC_API_KEY: 'fixture-only', ANTHROPIC_BASE_URL: 'http://127.0.0.1:9', CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: '1' },+ args: ['-p', '--input-format', 'stream-json', '--output-format', 'stream-json', '--verbose',+ '--settings', JSON.stringify({ apiKeyHelper: '', skillOverrides: settings(disabled) })],+ initial: { type: 'control_request', request_id: 'init', request: { subtype: 'initialize' } },+ onMessage: (data) => data.type === 'control_response' ? data.response.response.commands.map((item: { name: string }) => item.name) : undefined,+ });+ expect(await commands([])).toEqual(expect.arrayContaining(['ancestor', 'child-copy']));+ const disabled = await commands([ancestor, parentCopy]);+ expect(disabled).not.toContain('ancestor');+ expect(disabled).toContain('child-copy');+ expect(disabled).not.toContain('outside');+ expect(await commands([childCopy])).not.toContain('child-copy');+ // Worktree Git markers are files; discovery still stops there.+ fs.rmdirSync(path.join(project, '.git'));+ fs.writeFileSync(path.join(project, '.git'), 'gitdir: /fixture-only');+ expect((await scanClaudeRuntimeSkills(cwd)).items.some((item) => item.name === 'outside')).toBe(false);+ fs.unlinkSync(path.join(project, '.git'));+ expect((await scanClaudeRuntimeSkills(cwd)).items.some((item) => item.name === 'outside')).toBe(true);+ } finally { homeSpy.mockRestore(); }+ });+it.skipIf(!fs.existsSync(binary('claude-code')))('Claude disables by directory identity even when the frontmatter name differs', async () => {const { home, cwd } = fixture();const source = path.join(home, '.claude', 'skills', 'directory-name');diff --git a/packages/maker-core/src/maker.test.ts b/packages/maker-core/src/maker.test.tsindex 2b63efb3d8..bf1d0d73af 100644--- a/packages/maker-core/src/maker.test.ts+++ b/packages/maker-core/src/maker.test.ts@@ -1709,12 +1709,14 @@ describe('Maker Pi runtime skill status', () => {expect.objectContaining({name: 'context-mode-old',path: managedPath,+ origin: 'package',runtimeStatus: 'loaded',runtimeCommandName: 'skill:context-mode-old',}),expect.objectContaining({name: 'unproven-at-launch',runtimeStatus: 'unknown',+ origin: 'package',}),]);expect(active.skills.some((skill) => skill.name === 'installed-after-start')).toBe(false);diff --git a/packages/maker-core/src/maker.ts b/packages/maker-core/src/maker.tsindex 69b9955875..80c0996a1c 100644--- a/packages/maker-core/src/maker.ts+++ b/packages/maker-core/src/maker.ts@@ -236,6 +236,7 @@ async function mergePiRuntimeSkillStatuses(...(skill.description ? { description: skill.description } : {}),source: 'skill' as const,path: skill.sourcePath,+ origin: 'package' as const,scope: 'user' as const,enabled: true,runtimeStatus: skill.runtimeCommandName ? 'loaded' as const : 'unknown' as const,diff --git a/packages/maker-core/src/types/palette.ts b/packages/maker-core/src/types/palette.tsindex d6cf5e4738..7dcea84f9a 100644--- a/packages/maker-core/src/types/palette.ts+++ b/packages/maker-core/src/types/palette.ts@@ -63,6 +63,8 @@ export interface AgentSkillCommand {/** Whether the skill came from a user-global or project-local directory. */source: SlashCommandSource;path?: string;+ /** Package resources need their owning package's management surface. */+ origin?: 'package';scope?: 'global' | 'project' | 'user' | 'repo' | 'system' | 'admin';enabled?: boolean;/** Pi discovery/runtime state; omitted for engines without a runtime truth layer. */