Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
#5146: project skills are always on, no switch
milind-sonice9c944647f4
diff --git a/docs/custom-mcp-servers.md b/docs/custom-mcp-servers.mdindex 5917c393a2..1678997532 100644--- a/docs/custom-mcp-servers.md+++ b/docs/custom-mcp-servers.md@@ -433,16 +433,14 @@ the original.A project can ship skills for any AI agent in `agents/skills`, `.agents/skills`or `.claude/skills`. When a bot works in such a folder (or one below it, up tothe git root; outside a repository, only the working folder itself counts), its-**Skills** page lists them under **In this project**, with the switch **Use the-project's skills**. Off, OpenMausBot puts none of them in a prompt, since they-are the checkout's own instructions. On, it trusts every project folder every-bot works in, now and later; in `config.json` it is-`"features": { "projectSkills": true }`. The switch doesn't govern what an-engine loads by itself: Claude Code loads `.claude/skills` and Codex loads-`.agents/skills` either way, and those show as the engine's own skills, each-with the bot's own switch. Once on, a bot's prompt lists each project skill with-its SKILL.md path and `/name` runs it, except one marked `user-invocable: false`,-which only the model uses. The bot's own, library and brought-in skills keep+**Skills** page lists them under **In this project**, and the bot uses them by+itself, the way Claude Code loads `.claude/skills`. There is no switch. Claude+Code loads `.claude/skills` and Codex loads `.agents/skills` themselves, and+those show as the engine's own skills, each with the bot's own switch. A bot's+prompt lists each project skill with its SKILL.md path and `/name` runs it,+except one marked `user-invocable: false`, which only the model uses. A+SKILL.md must be a plain file of a skill's size, and a skill folder linked to a+place outside the project is skipped. The bot's own, library and brought-in skills keeptheir names, an engine without file tools gets none, and they never travel in abot or team package.diff --git a/server/config.ts b/server/config.tsindex 0240b13935..5de75a84d7 100644--- a/server/config.ts+++ b/server/config.ts@@ -230,7 +230,6 @@ const featureConfigSchema = z.object({sharedComputers: z.boolean().optional(),claudeUserMcp: z.boolean().optional(), // Claude bots also load this machine's Claude Code MCP servers. Off unless true: tools cost tokens.claudeUserSkills: z.boolean().optional(), // Claude bots also load the skills in ~/.claude/skills, in place. Off unless true.- projectSkills: z.boolean().optional(), // Bots also use the skills their project ships (agents/, .agents/, .claude/skills). Off unless true: a checkout's own instructions./** LLM-generated titles for new threads. Off unless true. */llmThreadTitles: z.boolean().optional(),/** A new bot's setup card offers answers its engine writes for it, when there is something to go on. On unless false. */@@ -484,7 +483,7 @@ export interface AppConfig extends HelperConfig {context?: { rebuildBytes?: number; compactAt?: number; autoCompact?: boolean; roomCompactAt?: number; roomSessions?: boolean; replayToolHistory?: boolean };memory?: { captureQuietMs?: number; tidyHour?: number };localVm?: { mode?: "shared" | "per-bot" | "pool"; maxInstances?: number; idleTimeoutMinutes?: number; preserveInstalledApps?: boolean; memoryGb?: number; cpus?: number };- features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; projectSkills?: boolean; llmThreadTitles?: boolean; smartSetupChoices?: boolean; autoRecall?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; parallelRoomJobs?: boolean; acpPlanLines?: boolean; agentsToolBridge?: boolean; savedSteps?: boolean; usbPhoneTakeover?: boolean; cloudComputerAutoReplace?: boolean };+ features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; llmThreadTitles?: boolean; smartSetupChoices?: boolean; autoRecall?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; parallelRoomJobs?: boolean; acpPlanLines?: boolean; agentsToolBridge?: boolean; savedSteps?: boolean; usbPhoneTakeover?: boolean; cloudComputerAutoReplace?: boolean };onboarding?: { completedAt?: string; version?: number; reelSeen?: boolean; hintsSeen?: string[]; firstTurnAt?: string };browserProfiles?: BrowserProfile[];browserEngine?: BrowserEngineConfig;diff --git a/server/host/skills-library.ts b/server/host/skills-library.tsindex 09cbe47c15..4cff5672bd 100644--- a/server/host/skills-library.ts+++ b/server/host/skills-library.ts@@ -29,7 +29,7 @@ import {} from "../skill-share.ts";import { enabledSkillFiles, listSkills, readSkillFile, resolveBotSkills, skillsSystemPrompt, type SkillListing } from "../skills.ts";import type { BotRecord, Message, Store } from "../store.ts";-import { claudeUserSkillsEnabled, projectSkillsEnabled } from "../turn-settings.ts";+import { claudeUserSkillsEnabled } from "../turn-settings.ts";import { typedWords } from "../typed-sends.ts";import { supportsWorkspaceFiles, TASK_WORKSPACES_DIR } from "../workspace.ts";@@ -98,7 +98,7 @@ export function createSkillsLibraryHost(deps: SkillsLibraryHostDeps) {const project = projectFor(bot, threadId).filter((skill) => !names.has(skill.name));return [...listed, ...natives.map((skill) => nativeSkillListing(skill, isNativeSkillEnabled(bot.id, skill.name))),- ...project.map((skill) => projectSkillListing(skill, projectSkillsEnabled(cfg))),+ ...project.map(projectSkillListing),];};const readBotSkillFile = (bot: BotRecord, name: string): string | null => {@@ -177,10 +177,9 @@ export function createSkillsLibraryHost(deps: SkillsLibraryHostDeps) {const folder = cwd === undefined ? threadFolder(bot, threadId) : cwd;return folder ? projectSkills(engine, { cwd: folder, dataDir: DATA_DIR }) : [];};- /** The project's skills a turn's prompt and `/` menu use: none until the owner turns them on, and none of a name the- * bot already has or its engine loads by itself. */+ /** The project's skills a turn's prompt and `/` menu use, found by themselves as Claude Code finds `.claude/skills`: none+ * of a name the bot already has or its engine loads by itself. */const projectInUse = (bot: BotRecord, threadId: string, cwd: string | null | undefined, instance: TurnInstance | undefined, assigned: readonly string[] | undefined): NativeSkill[] => {- if (!projectSkillsEnabled(cfg)) return [];const folder = cwd === undefined ? threadFolder(bot, threadId) : cwd;const names = new Set([...resolveBotSkills(bot.id, assigned).map((skill) => skill.name), ...Object.keys(readImportedSkills()),diff --git a/server/index.test.ts b/server/index.test.tsindex d3cf1f5e46..47bef2248a 100644--- a/server/index.test.ts+++ b/server/index.test.ts@@ -9881,7 +9881,7 @@ describe("harness HTTP API", () => {it("keeps skill authoring on by default and persists an explicit opt-out", async () => {const before = await api("GET", "/api/config");expect(before.status).toBe(200);- expect(before.body.features).toEqual({ browser: false, skillAuthoring: true, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: false, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, projectSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });+ expect(before.body.features).toEqual({ browser: false, skillAuthoring: true, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: false, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });const untouched = JSON.parse(readFileSync(join(home, ".openmausbot", "config.json"), "utf8"));expect(untouched.features?.skillAuthoring).toBeUndefined();expect(untouched.features?.skillReview).toBeUndefined();@@ -9891,7 +9891,7 @@ describe("harness HTTP API", () => {features: { skillAuthoring: false },});expect(saved.status).toBe(200);- expect(saved.body.features).toEqual({ browser: false, skillAuthoring: false, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: false, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, projectSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });+ expect(saved.body.features).toEqual({ browser: false, skillAuthoring: false, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: false, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });const disk = JSON.parse(readFileSync(join(home, ".openmausbot", "config.json"), "utf8"));// Earlier browser coverage may have persisted its own toggle: opting out must preserve sibling settings.@@ -9899,7 +9899,7 @@ describe("harness HTTP API", () => {const tools = await api("PATCH", "/api/config", { features: { showToolCalls: true } });expect(tools.status).toBe(200);- expect(tools.body.features).toEqual({ browser: false, skillAuthoring: false, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: true, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, projectSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });+ expect(tools.body.features).toEqual({ browser: false, skillAuthoring: false, skillReview: false, skillReviewSteps: 10, skillsLibrary: false, shareLearnedSkills: "off", showToolCalls: true, sharedComputers: false, claudeUserMcp: false, claudeUserSkills: false, autoRecall: true, roomMemoryCapture: false, parallelRoomJobs: false, llmThreadTitles: true, savedSteps: true, savedStepsHere: process.platform === "darwin", usbPhoneTakeover: false });const bot = (await api("POST", "/api/bots", {})).body.bot;try {diff --git a/server/index.ts b/server/index.tsindex 3c931af234..852b077bd7 100644--- a/server/index.ts+++ b/server/index.ts@@ -432,7 +432,7 @@ import { CLOUD_COMPUTER_DID_NOT_START, CLOUD_COMPUTER_START_BUDGET_MS, CLOUD_COMimport { LocalVmLease, LocalVmLeasePool } from "./local-vm-lease.ts";import { LocalVmSeatPool, type LocalVmSeatHolder } from "./local-vm-seat-pool.ts";import { createLoopGuard, loopGuardSettings } from "./host/loop-guard.ts"; import { createPersonFirst } from "./host/person-first.ts"; import { createRunOwners, runActorOf } from "./host/run-owner.ts";-import { claudeUserSkillsEnabled, projectSkillsEnabled, settingsTurnFields } from "./turn-settings.ts";+import { claudeUserSkillsEnabled, settingsTurnFields } from "./turn-settings.ts";import { addHeldSecretScrubber, redactSecretsInText, scrubHeldSecrets } from "./redact.ts";import * as vps from "./vps-computer.ts";import { vpsConfigForBot, vpsSshAliasForBot } from "./vps-hosts.ts";@@ -11782,7 +11782,7 @@ function configStatus() {browser: builtInBrowserEnabled(cfg),sharedComputers: sharedComputersEnabled(cfg),claudeUserMcp: claudeUserMcpEnabled(cfg),- claudeUserSkills: claudeUserSkillsEnabled(cfg), projectSkills: projectSkillsEnabled(cfg),+ claudeUserSkills: claudeUserSkillsEnabled(cfg),autoRecall: autoRecallEnabled(cfg),roomMemoryCapture: roomMemoryCaptureEnabled(cfg),parallelRoomJobs: parallelRoomJobsEnabled(cfg),diff --git a/server/native-skills.test.ts b/server/native-skills.test.tsindex 8dc5ef1f6f..c83881c1af 100644--- a/server/native-skills.test.ts+++ b/server/native-skills.test.ts@@ -195,7 +195,6 @@ describe("switching a native skill off for one bot", () => {describe("skills a project ships for any agent", () => {const repo = join(PROJECTS, "repo");- const trusted = { features: { projectSkills: true } } as AppConfig;function plantRepo() {mkdirSync(join(repo, ".git"), { recursive: true });mkdirSync(join(repo, "app"), { recursive: true });@@ -208,16 +207,12 @@ describe("skills a project ships for any agent", () => {};}- it("show on the bot's Skills page, off until the owner trusts project skills, and never reach a turn until then", () => {+ it("show on the bot's Skills page and reach a turn by themselves, with no switch", () => {const paths = plantRepo();- const off = hostFor("geminiAgent", { cwd: join(repo, "app") });- expect(listed(off.host.listBotSkills(off.bot))).toEqual(["agents-skill:project", "dot-agents-skill:project", "claude-skill:project"]);- expect(off.host.listBotSkills(off.bot).every((skill) => !skill.enabled && !skill.editable)).toBe(true);- expect(off.host.readBotSkillFile(off.bot, "claude-skill")).toBe(skillMd("claude-skill"));- expect(off.host.skillsIndex(off.bot, "main")).toBe("");- expect(off.host.expandSkillCommand(off.bot, "main", "/claude-skill go", undefined, [], true)).toBe("/claude-skill go");-- const on = hostFor("geminiAgent", { cwd: join(repo, "app"), cfg: trusted });+ const on = hostFor("geminiAgent", { cwd: join(repo, "app") });+ expect(listed(on.host.listBotSkills(on.bot))).toEqual(["agents-skill:project", "dot-agents-skill:project", "claude-skill:project"]);+ expect(on.host.listBotSkills(on.bot).every((skill) => skill.enabled && !skill.editable)).toBe(true);+ expect(on.host.readBotSkillFile(on.bot, "claude-skill")).toBe(skillMd("claude-skill"));const index = on.host.skillsIndex(on.bot, "main");expect(index).toContain("Skills in this project:");expect(index).toContain(`- agents-skill: Works with agents-skill. Read ${JSON.stringify(paths.nearer)}.`);@@ -225,7 +220,6 @@ describe("skills a project ships for any agent", () => {expect(index).toContain(JSON.stringify(paths.dotAgents));expect(index).toContain(JSON.stringify(paths.claude));expect(index).not.toContain("above-the-repo");- expect(on.host.listBotSkills(on.bot).every((skill) => skill.enabled)).toBe(true);expect(on.host.expandSkillCommand(on.bot, "main", "/claude-skill go", undefined, [], true)).toContain(`Read ${JSON.stringify(paths.claude)}`);});@@ -233,14 +227,14 @@ describe("skills a project ships for any agent", () => {const loose = join(PROJECTS, "loose", "app");plant(join(PROJECTS, "loose", "agents", "skills"), "above");const here = plant(join(loose, ".agents", "skills"), "here");- const { host, bot } = hostFor("geminiAgent", { cwd: loose, cfg: trusted });+ const { host, bot } = hostFor("geminiAgent", { cwd: loose });expect(listed(host.listBotSkills(bot))).toEqual(["here:project"]);expect(host.skillsIndex(bot, "main")).toContain(JSON.stringify(here));});it("follow the folder a turn really works in", () => {const paths = plantRepo();- const { host, bot } = hostFor("geminiAgent", { cfg: trusted });+ const { host, bot } = hostFor("geminiAgent");expect(host.skillsIndex(bot, "main")).toBe("");expect(host.skillsIndex(bot, "main", undefined, repo)).toContain(JSON.stringify(paths.agents));expect(host.skillsIndex(bot, "main", undefined, null)).toBe("");@@ -248,7 +242,7 @@ describe("skills a project ships for any agent", () => {it("never run from the bot's folder for a resumed thread that will stay where its session is", () => {plantRepo();- const { host, bot } = hostFor("geminiAgent", { cwd: repo, cfg: trusted, resumed: true });+ const { host, bot } = hostFor("geminiAgent", { cwd: repo, resumed: true });expect(listed(host.listBotSkills(bot, "pinned"))).toEqual([]);expect(host.expandSkillCommand(bot, "pinned", "/claude-skill go", undefined, [], true)).toBe("/claude-skill go");expect(host.expandSkillCommand(bot, "main", "/claude-skill go", undefined, [], true)).toContain("claude-skill");@@ -256,7 +250,7 @@ describe("skills a project ships for any agent", () => {it("leave .agents/skills to Codex, which loads it by itself", () => {const paths = plantRepo();- const { host, bot } = hostFor("codex", { cwd: join(repo, "app"), cfg: trusted });+ const { host, bot } = hostFor("codex", { cwd: join(repo, "app") });expect(listed(host.listBotSkills(bot))).toEqual(["agents-skill:native", "dot-agents-skill:native", "claude-skill:project"]);const index = host.skillsIndex(bot, "main");expect(index).toContain(JSON.stringify(paths.claude));@@ -269,7 +263,7 @@ describe("skills a project ships for any agent", () => {const folder = join(repo, "agents", "skills", "background");mkdirSync(folder, { recursive: true });writeFileSync(join(folder, "SKILL.md"), "---\ndescription: House style.\nuser-invocable: false\n---\n\nUse it.\n");- const { host, bot } = hostFor("geminiAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("geminiAgent", { cwd: repo });expect(host.skillsIndex(bot, "main")).toContain("- background: House style.");expect(host.expandSkillCommand(bot, "main", "/background go", undefined, [], true)).toBe("/background go");});@@ -282,16 +276,28 @@ describe("skills a project ships for any agent", () => {const linkedRepo = join(PROJECTS, "linked");symlinkSync(join(DATA_DIR, "workspaces"), linkedRepo, "dir");plant(join(DATA_DIR, "workspaces", ".agents", "skills"), "inside");- const { host, bot } = hostFor("geminiAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("geminiAgent", { cwd: repo });expect(listed(host.listBotSkills(bot))).toEqual([]);expect(host.skillsIndex(bot, "main", undefined, linkedRepo)).toBe("");rmSync(join(DATA_DIR, "app-skills"), { recursive: true, force: true });rmSync(join(DATA_DIR, "workspaces", ".agents"), { recursive: true, force: true });});+ it.skipIf(process.platform === "win32")("never come through a link that leaves the project", () => {+ mkdirSync(join(repo, ".git"), { recursive: true });+ plant(join(PROJECTS, "elsewhere"), "outside");+ mkdirSync(join(repo, "agents", "skills"), { recursive: true });+ symlinkSync(join(PROJECTS, "elsewhere", "outside"), join(repo, "agents", "skills", "outside"), "dir");+ mkdirSync(join(repo, "shared", "inside"), { recursive: true });+ writeFileSync(join(repo, "shared", "inside", "SKILL.md"), skillMd("inside"));+ symlinkSync(join(repo, "shared", "inside"), join(repo, "agents", "skills", "inside"), "dir");+ const { host, bot } = hostFor("geminiAgent", { cwd: repo });+ expect(listed(host.listBotSkills(bot))).toEqual(["inside:project"]);+ });+it("leave .claude/skills to Claude Code, which loads it by itself", () => {const paths = plantRepo();- const { host, bot } = hostFor("claudeAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("claudeAgent", { cwd: repo });expect(listed(host.listBotSkills(bot))).toEqual(["claude-skill:native", "dot-agents-skill:project", "agents-skill:project"]);const index = host.skillsIndex(bot, "main");expect(index).toContain(JSON.stringify(paths.agents));@@ -300,7 +306,7 @@ describe("skills a project ships for any agent", () => {it("never run in a conversation that keeps a private folder", () => {plantRepo();- const { host, bot } = hostFor("geminiAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("geminiAgent", { cwd: repo });expect(host.expandSkillCommand(bot, "guest", "/claude-skill go", undefined, [], true, true)).toBe("/claude-skill go");expect(host.expandSkillCommand(bot, "guest", "/claude-skill go", undefined, [], true)).toContain("claude-skill");});@@ -311,14 +317,14 @@ describe("skills a project ships for any agent", () => {const roomSkill = plant(join(room, "agents", "skills"), "shared-name");mkdirSync(join(repo, ".git"), { recursive: true });plant(join(repo, ".claude", "skills"), "shared-name");- const { host, bot } = hostFor("claudeAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("claudeAgent", { cwd: repo });expect(host.skillsIndex(bot, "main", undefined, room)).toContain(JSON.stringify(roomSkill));expect(host.skillsIndex(bot, "main", undefined, repo)).not.toContain("shared-name");});it("yield a name to the bot's own skill, even one switched off", () => {plantRepo();- const { host, bot } = hostFor("geminiAgent", { cwd: repo, cfg: trusted });+ const { host, bot } = hostFor("geminiAgent", { cwd: repo });installSkill(bot.id, "local", [{ path: "SKILL.md", content: skillMd("agents-skill") }]);expect(listed(host.listBotSkills(bot))).toEqual(["agents-skill:own", "dot-agents-skill:project", "claude-skill:project"]);expect(host.skillsIndex(bot, "main")).not.toContain("- agents-skill:");@@ -327,15 +333,15 @@ describe("skills a project ships for any agent", () => {it("never come from the app's own folders, nor reach an engine that cannot read files, nor a package", () => {plant(join(TASK_WORKSPACES_DIR, ".agents", "skills"), "app-link");- const task = hostFor("geminiAgent", { cfg: trusted });+ const task = hostFor("geminiAgent");expect(listed(task.host.listBotSkills(task.bot))).toEqual([]);expect(task.host.skillsIndex(task.bot, "main", undefined, join(DATA_DIR, "workspaces", task.bot.id))).toBe("");plantRepo();- const api = hostFor("openai-compat", { cwd: repo, cfg: trusted });+ const api = hostFor("openai-compat", { cwd: repo });expect(listed(api.host.listBotSkills(api.bot))).toEqual([]);- const exported = hostFor("geminiAgent", { cwd: repo, cfg: trusted });+ const exported = hostFor("geminiAgent", { cwd: repo });const team = skillExport(exported.host).collectTeamSkills([exported.bot], "all");expect(team.ok && [...team.skillsByBot.values()].flat()).toEqual([]);expect(skillExport(exported.host).checkedExportSkillNames(["agents-skill"], [exported.bot])).toMatchObject({ ok: false });diff --git a/server/native-skills.ts b/server/native-skills.tsindex d34fc43bdc..6b1daa3c55 100644--- a/server/native-skills.ts+++ b/server/native-skills.ts@@ -54,7 +54,9 @@ function readNativeSkill(root: string, name: string, modelOnly = false): NativeS}/** Each skill in `roots`, the first of a name winning. */-function skillsIn(roots: readonly string[], options: { modelOnly?: boolean; outside?: string } = {}, seen = new Set<string>()): NativeSkill[] {+/** `outside`: no skill whose folder, links followed, is in there. `within`: only skills whose folder, links followed, is in+ * there. */+function skillsIn(roots: readonly string[], options: { modelOnly?: boolean; outside?: string; within?: string } = {}, seen = new Set<string>()): NativeSkill[] {return roots.flatMap((root) => {let names: string[];try {@@ -64,7 +66,9 @@ function skillsIn(roots: readonly string[], options: { modelOnly?: boolean; outs}return names.flatMap((name) => {if (seen.has(name)) return [];- if (options.outside && isInside(resolveThroughLinks(join(root, name)), options.outside)) return [];+ const real = options.outside || options.within ? resolveThroughLinks(join(root, name)) : "";+ if (options.outside && isInside(real, options.outside)) return [];+ if (options.within && !isInside(real, options.within)) return [];const skill = readNativeSkill(root, name, options.modelOnly);if (!skill) return [];seen.add(name);@@ -93,14 +97,17 @@ const PROJECT_SKILL_DIRS = [".agents/skills", "agents/skills", ".claude/skills"]/** The skills a project ships for any agent, in the folders the engine does not load by itself, from `cwd` up to the* nearest git root, or in `cwd` alone outside a repository, so a folder above the project never counts as part of it;* the nearer folder wins a name. None from inside `dataDir`, links followed: those folders are the app's own, and hold- * links to the bot's own skills. */+ * links to the bot's own skills. None through a link that leaves the project either. */export function projectSkills(engine: SkillTurnEngine, options: { cwd: string; dataDir: string; home?: string }): NativeSkill[] {const dataDir = resolveThroughLinks(options.dataDir);if (isInside(resolveThroughLinks(options.cwd), dataDir)) return [];const dirs = PROJECT_SKILL_DIRS.filter((dir) => dir !== ENGINE_PROJECT_DIRS[engine.driverKind]);const levels = projectLevels(options.cwd, options.home ?? homedir());const inRepo = levels.some((level) => entryExistsWithoutFollowing(join(level, ".git")));- return skillsIn((inRepo ? levels : levels.slice(0, 1)).flatMap((level) => dirs.map((dir) => join(level, dir))), { modelOnly: true, outside: dataDir });+ const used = inRepo ? levels : levels.slice(0, 1);+ const top = used.at(-1);+ if (!top) return [];+ return skillsIn(used.flatMap((level) => dirs.map((dir) => join(level, dir))), { modelOnly: true, outside: dataDir, within: resolveThroughLinks(top) });}/** After the skills from this computer, in a turn's skills index. */@@ -132,9 +139,9 @@ export function nativeSkillListing(skill: NativeSkill, enabled = true): SkillLis};}-/** Shown with the bot's skills whether or not they are on, so the owner sees what a project would bring. */-export function projectSkillListing(skill: NativeSkill, enabled: boolean): SkillListing & { origin: "project" } {- return { ...nativeSkillListing(skill, enabled), origin: "project" };+/** Shown with the bot's skills; always on while the bot works in that project, and changed only there. */+export function projectSkillListing(skill: NativeSkill): SkillListing & { origin: "project" } {+ return { ...nativeSkillListing(skill), origin: "project" };}export function readNativeSkillFile(skill: NativeSkill): string | null {diff --git a/server/turn-settings.ts b/server/turn-settings.tsindex 6dc851278a..bbc59cc36f 100644--- a/server/turn-settings.ts+++ b/server/turn-settings.ts@@ -8,10 +8,6 @@ export function claudeUserSkillsEnabled(cfg: AppConfig): boolean {return cfg.features?.claudeUserSkills === true;}-export function projectSkillsEnabled(cfg: AppConfig): boolean {- return cfg.features?.projectSkills === true;-}-/** A folder whose `.claude/skills` links to the person's own `~/.claude/skills`, for Claude Code's `--add-dir`: each skill* loads as it is on disk, scripts and references included, and edits arrive live. Null when there is nothing to link. */export function claudeUserSkillsDir(dataDir: string, home = homedir()): string | null {diff --git a/src/components/bot-panel/pages.tsx b/src/components/bot-panel/pages.tsxindex 800422627f..1f460a8646 100644--- a/src/components/bot-panel/pages.tsx+++ b/src/components/bot-panel/pages.tsx@@ -5,7 +5,7 @@ import { FileText, FolderOpen, Maximize2, Minimize2, Plus, Server } from "lucideimport { appSwitchPatch } from "@/lib/bot-app-access";import { cn } from "@/lib/cn";import { useModalDialog } from "@/hooks/use-modal-dialog";-import { projectSkillsEnabled, skillsLibraryEnabled } from "@/lib/feature-flags";+import { skillsLibraryEnabled } from "@/lib/feature-flags";import { t } from "@/lib/i18n";import { mcpServersForBot, mcpServersOfBot, mcpSwitch, useMcpServers } from "@/lib/mcp-servers";import { deleteMemoryDoc, MEMORY_INDEX, saveMemoryDoc, type MemoryDoc } from "@/lib/memory";@@ -14,7 +14,7 @@ import type { Routine } from "@/lib/routines";import type { SkillImportSummary } from "../../../shared/skill-import";import { shortPath } from "@/lib/short-path";import { skillImportLines } from "@/lib/skill-import";-import { api as appApi, useStore, type Bot, type ConfigStatus } from "@/state/store";+import { useStore, type Bot } from "@/state/store";import { useDesktopCapabilities } from "../DesktopCapabilities";import { connectAppFromBot } from "../AppGrantPrompt";import { ServiceIcon } from "../ServiceIcon";@@ -417,26 +417,9 @@ export function SkillsPage({ bot }: PageContext) {const [importing, setImporting] = useState(false);const [imported, setImported] = useState<string[]>([]);const libraryOn = skillsLibraryEnabled(state.config);- const projectOn = projectSkillsEnabled(state.config);- const [savingProject, setSavingProject] = useState(false);const own = skills.skills.filter((skill) => skill.origin !== "project");const project = skills.skills.filter((skill) => skill.origin === "project");- const toggleProjectSkills = async () => {- if (savingProject) return;- setSavingProject(true);- skills.setError("");- try {- const config = await appApi<ConfigStatus>("/api/config", { method: "PATCH", body: JSON.stringify({ features: { projectSkills: !projectOn } }) });- dispatch({ type: "configStatus", config });- await skills.refresh();- } catch (cause) {- skills.setError(errorText(cause, t("botPanel.skills.projectFailed")));- } finally {- setSavingProject(false);- }- };-const remove = async (skill: ManagedSkill) => {if (skills.working) return;if (!window.confirm(t(skill.origin === "library" ? "skills.unassignConfirm" : "botPanel.skills.removeConfirm", { name: skill.name }))) return;@@ -500,17 +483,8 @@ export function SkillsPage({ bot }: PageContext) {))}{skills.error && !skills.reviewing && <NoteRow tone="warn">{skills.error}</NoteRow>}</Card>- {(project.length > 0 || projectOn) && (+ {project.length > 0 && (<Card label={t("botPanel.skills.project")} anchor="project-skills">- <SwitchRow- data-panel-row="project-skills"- title={t("botPanel.skills.projectUse")}- hint={t("botPanel.skills.projectHint")}- color={bot.color}- checked={projectOn}- disabled={savingProject}- onChange={() => void toggleProjectSkills()}- />{project.map((skill) => (<ItemRow key={skill.name} data-panel-row={`project-skill:${skill.name}`} title={skill.name} hint={skill.description || skill.source} />))}diff --git a/src/components/bot-settings/SkillsSection.tsx b/src/components/bot-settings/SkillsSection.tsxindex cbd75f27a3..b53a106f6e 100644--- a/src/components/bot-settings/SkillsSection.tsx+++ b/src/components/bot-settings/SkillsSection.tsx@@ -493,7 +493,7 @@ export function SkillsSection({ bot }: { bot: Bot }) {</span>)}<div className="mt-0.5 line-clamp-2 text-[12px] text-ink-secondary">{skill.description}</div>- <div className="mt-0.5 text-[11px] text-ink-secondary">{t(skill.origin === "project" && !skill.enabled ? "skills.projectOff" : skill.enabled && skill.listed === false ? "skills.foundWhenNeeded" : "skills.usedWhenRelevant")}</div>+ <div className="mt-0.5 text-[11px] text-ink-secondary">{t(skill.enabled && skill.listed === false ? "skills.foundWhenNeeded" : "skills.usedWhenRelevant")}</div></button>{skill.origin !== "project" && (<Switchdiff --git a/src/lib/feature-flags.ts b/src/lib/feature-flags.tsindex d2cc3cf86f..1dc1ee5302 100644--- a/src/lib/feature-flags.ts+++ b/src/lib/feature-flags.ts@@ -1,7 +1,7 @@import { t } from "./i18n";export interface FeatureFlagConfig {- features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; projectSkills?: boolean; llmThreadTitles?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean };+ features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; llmThreadTitles?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean };browserEngine?: { kind: "engine" | "unavailable"; reason?: string; installable?: boolean; installing?: boolean; installError?: string };}@@ -72,10 +72,6 @@ export function claudeUserSkillsEnabled(config: FeatureFlagConfig | null | undefreturn config?.features?.claudeUserSkills === true;}-export function projectSkillsEnabled(config: FeatureFlagConfig | null | undefined): boolean {- return config?.features?.projectSkills === true;-}-export function llmThreadTitlesEnabled(config: FeatureFlagConfig | null | undefined): boolean {return config?.features?.llmThreadTitles === true;}diff --git a/src/locales/en.json b/src/locales/en.jsonindex 312de7cee2..ab5dc9acdc 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -4530,9 +4530,6 @@"botPanel.skills.importPlaceholder": "Paste a skill link or owner/repo","botPanel.skills.browse": "Browse skills","botPanel.skills.project": "In this project",- "botPanel.skills.projectUse": "Use the project's skills",- "botPanel.skills.projectHint": "Skills a project folder ships for AI agents: its own instructions. On, every bot uses the skills of every project folder it works in, now and later. Claude bots load .claude/skills and Codex bots load .agents/skills by themselves either way.",- "botPanel.skills.projectFailed": "Couldn't change project skills. Try again.","botPanel.folder.private": "Private","botPanel.folder.intro": "Where {name} keeps and edits files.","botPanel.folder.own": "Its own private folder",@@ -6207,8 +6204,7 @@"skills.origin.native": "AI","skills.origin.nativeHint": "The bot's AI loads this from the folder under Source. Turn it off here for this bot only; the files stay where they are.","skills.origin.project": "project",- "skills.origin.projectHint": "Shipped in the project folder under Source. The bot uses it while project skills are on. Edit or remove it there.",- "skills.projectOff": "Off: project skills are off for every bot.",+ "skills.origin.projectHint": "Shipped in the project folder under Source. The bot uses it while it works there. Edit or remove it there.","skills.write.title": "Write a command","skills.write.hint": "Give the bot a short command for something you ask often. Type /name in a chat to run it. Anything after the name fills in {input}.","skills.write.name": "Command name",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 13a55d986b..48ebcd2b35 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -5883,8 +5883,7 @@"skills.origin.native": "IA","skills.origin.nativeHint": "A IA do bot carrega esta habilidade da pasta indicada em Origem. Desative aqui apenas para este bot; os arquivos ficam onde estão.","skills.origin.project": "projeto",- "skills.origin.projectHint": "Vem na pasta do projeto indicada em Origem. O bot a usa enquanto as habilidades de projeto estiverem ativadas. Edite ou remova a habilidade lá.",- "skills.projectOff": "Desativada: as habilidades de projeto estão desativadas para todos os bots.",+ "skills.origin.projectHint": "Vem na pasta do projeto indicada em Origem. O bot a usa enquanto trabalha nela. Edite ou remova a habilidade lá.","skills.write.title": "Escrever um comando","skills.write.hint": "Dê ao bot um comando curto para algo que você pede com frequência. Digite /nome em uma conversa para executá-lo. O que vier depois do nome preenche {input}.","skills.write.name": "Nome do comando",@@ -7941,9 +7940,6 @@"botPanel.skills.importPlaceholder": "Cole o link de uma habilidade ou owner/repo","botPanel.skills.browse": "Explorar habilidades","botPanel.skills.project": "Neste projeto",- "botPanel.skills.projectUse": "Usar as habilidades do projeto",- "botPanel.skills.projectHint": "Habilidades que uma pasta de projeto traz para agentes de IA: são instruções do próprio projeto. Ativada, esta opção faz todo bot usar as habilidades de toda pasta de projeto em que trabalha, agora e depois. Bots do Claude carregam .claude/skills e bots do Codex carregam .agents/skills por conta própria de qualquer forma.",- "botPanel.skills.projectFailed": "Não foi possível alterar as habilidades do projeto. Tente novamente.","botPanel.folder.private": "Privada","botPanel.folder.intro": "Onde {name} guarda e edita arquivos.","botPanel.folder.own": "Uma pasta privada só dele",diff --git a/src/state/config-status.ts b/src/state/config-status.tsindex e11ec801a2..2d1d02f6f0 100644--- a/src/state/config-status.ts+++ b/src/state/config-status.ts@@ -147,7 +147,7 @@ export interface ConfigStatus {/** What a paired phone calls this computer; "" uses the default. */computerName?: string;/** Opt-in flags. Absent means off. */- features?: { skillAuthoring: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; projectSkills?: boolean; llmThreadTitles?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean };+ features?: { skillAuthoring: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; llmThreadTitles?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean };/** First-run progress: whether the welcome tour was finished and which* one-time hints were dismissed. Server-owned so it follows the workspace. */onboarding?: OnboardingStatus;