-
Notifications
You must be signed in to change notification settings - Fork 32
🤖 feat: add agent skills support #1285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Re: SSH runtime concern — in mux, |
f267f9a to
a455a8e
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Implemented runtime-aware Agent Skills loading so SSH workspaces can discover/read skills via the active runtime (system prompt index + tools). |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Change-Id: Ic6403e04df7db28a075d2b4084fb9f3f330e9425 Signed-off-by: Thomas Kosiewski <[email protected]>
Change-Id: I94e8cfc58b4220045018e6f2d751560ffc4b39b9 Signed-off-by: Thomas Kosiewski <[email protected]>
Change-Id: I78abef7d37ac2e0a06a03dfad8e577a5becf2437 Signed-off-by: Thomas Kosiewski <[email protected]>
Change-Id: Id5fbd1107aa2b323e7ce065f0bf0b780dfc0b19a Signed-off-by: Thomas Kosiewski <[email protected]>
Change-Id: Iaa402bb87f8a76413e38f6e4ab94b1c3b6d3eb11 Signed-off-by: Thomas Kosiewski <[email protected]>
Change-Id: Ie701433b134eac7cdf13730c7467bdcd72c3eb62 Signed-off-by: Thomas Kosiewski <[email protected]>
6dbf87c to
062213a
Compare
Adds v1 Agent Skills support:
Includes Zod schemas/types, defensive parsing (unknown frontmatter keys ignored), and unit tests.
📋 Implementation Plan
🤖 Agent Skills integration plan (Mux)
Goals (v1)
<projectRoot>/.mux/skills/<name>/SKILL.md~/.mux/skills/<name>/SKILL.md<agent-skills>index (name + description + how to load) into the system prompt.agent_skill_read— read + validate a skill’sSKILL.md(frontmatter + body)agent_skill_read_file— read a file within a skill directory (for referenced files)Explicit non-goals (v1)
/skillcommand or other explicit “activate skill” UX.allowed-tools.file_readsandbox.Spec recap (what we must support)
From https://agentskills.io/specification:
SKILL.md.SKILL.mdcontains:name,descriptionlicense,compatibility,metadataallowed-toolsexists in the spec but is ignored by mux (it must not break parsing).Repo integration points (confirmed)
src/node/services/systemMessage.tsviabuildSystemMessage(...).<environment>+ optional<mcp>first.buildMCPContextcall) and before the earlyvariant === "agent"return, so both variants get the skill index.src/common/utils/tools/toolDefinitions.ts(Zod schemas) and registered insrc/common/utils/tools/tools.ts(getToolsForModel).file_readis restricted to workspace CWD (with a plan-file exception), so skills need dedicated tools.Implementation plan (tool-based, recommended) — net +~320–520 LoC (product code)
1) Add shared Agent Skill domain schemas/types (Zod-first)
Create:
src/common/orpc/schemas/agentSkill.tssrc/common/types/agentSkill.tsKey points:
SkillNameSchema:min(1),max(64)^[a-z0-9]+(?:-[a-z0-9]+)*$AgentSkillFrontmatterSchema:{ name, description, license?, compatibility?, metadata? }.strict().allowed-tools(and other unknown keys) are tolerated and ignored.AgentSkillDescriptorSchema(system prompt index):{ name, description, scope: "project" | "global" }AgentSkillPackageSchema(tool output):{ scope, directoryName, frontmatter, body }refine(directoryName === frontmatter.name)Draft schema sketch (no allowed-tools, tolerant parsing)
2) Parse
SKILL.mdsafelyAdd a pure helper (easy to unit test), e.g.:
src/node/services/agentSkills/parseSkillMarkdown.tsBehavior:
MAX_FILE_SIZEfromsrc/node/services/tools/fileCommon.ts(1MB).---\n...\n---\n.yamlis the simplest fit).{ frontmatter, body }.3) Runtime-aware discovery service
Add:
src/node/services/agentSkills/agentSkillsService.tsResponsibilities:
Roots (in this order for precedence):
${projectPath}/.mux/skills~/.mux/skillsNotes:
~/.mux(no-devsuffix), mirroring the plan storage behavior.Runtime(local/worktree/ssh).Directory listing (since
Runtimehas noreaddir):runtime.stat(root)to check existence.await runtime.resolvePath(root)before invoking shell commands (bash won’t expand~inside quotes).execBuffered(runtime, ...)fromsrc/node/utils/runtime/helpers.tsto runls -1and parse stdout.SkillNameSchema.safeParse(so parsinglsoutput is safe).Defensive behavior:
Optional cache:
{ projectPath, runtimeType }.stat.modifiedTime(or disable cache if too complex initially).4) System prompt injection (
<agent-skills>)In
buildSystemMessage(src/node/services/systemMessage.ts):Rules:
5) Add tool definitions + wiring
In
src/common/utils/tools/toolDefinitions.ts:agent_skill_read+agent_skill_read_fileschemas.file_read).In
src/common/utils/tools/tools.ts:getToolsForModel.6) Implement tool handlers
Add:
src/node/services/tools/agent_skill_read.tssrc/node/services/tools/agent_skill_read_file.tsHandler behavior:
agent_skill_read({ name }):{ success: true, skill: AgentSkillPackage }or{ success: false, error }.agent_skill_read_file({ name, filePath, offset?, limit? }):~runtime.normalizePath(filePath, skillDir)and ensure it is withinskillDirfileCommon.validateFileSize+ the same output limits asfile_read.7) Tests (prefer pure unit tests)
parseSkillMarkdown.test.ts:allowed-tools) without failingDiscovery/precedence tests:
ls-based discovery.Alternative (not shipping in v1): relax file_read sandbox
If we ever want “agent reads SKILL.md directly via
file_read”, we’d need to extend the read sandbox to allow~/.mux/skillsand<projectRoot>/.mux/skills.Est. net LoC: +~120–220 (product code)
Tradeoff: expands security surface area and still leaves unclear UX for referenced files.
Validation checklist
<agent-skills>block appears when at least one valid skill exists.{ success:false, error }for missing/invalid skills.agent_skill_read_fileblocks../traversal and cannot read outside the skill directory.Generated with
mux• Model:openai:gpt-5.2• Thinking:xhigh