Skip to content

refactor: expose reusable Skill module - #10397

Closed
lloydrichards wants to merge 2 commits into
Effect-TS:mainfrom
lloydrichards:refactor/public-agent-skill
Closed

lloydrichards wants to merge 2 commits into
Effect-TS:mainfrom
lloydrichards:refactor/public-agent-skill

Conversation

@lloydrichards

@lloydrichards lloydrichards commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature

Description

On the slow march towards building an agentic framework within effect; we have Tools ✅, we have McpClient ✅, next we need Skills. There was already skills added to McpServer as part of the extension, but this is only usable with Mcp, what I want to expose here is just the Skill type so it can be used standalone alongside the LanguageModel to read and load skills through toolcalls.

Creating an immutable local snapshot with instructions and supporting files is simple enough:

const refunds = Skill.make({
  frontmatter: {
    name: "refunds",
    description: "Process customer refunds"
  },
  instructions: "Read references/policy.md before issuing a refund.",
  files: { "references/policy.md": "Refunds over $100 require approval." }
})

This can then be read locally or publish that snapshot through MCP:

const publish = Effect.gen(function*() {
  const skill = yield* refunds
  const policy = yield* Skill.readText(skill, "references/policy.md")

  yield* McpServer.registerSkill(skill, {
    uri: "skill://billing/refunds/SKILL.md"
  })

  return policy
})

Everything is typed so known file keys give direct reads autocomplete and typo checking:

const readPolicy = Effect.gen(function*() {
  const skill = yield* refunds

  // Path suggestions: "SKILL.md" | "references/policy.md"
  yield* Skill.readText(skill, "references/policy.md")
  yield* skill.pipe(Skill.readBytes("references/policy.md"))

  // Compile error: "references/polciy.md" is not a file in this skill.
  // yield* Skill.readText(skill, "references/polciy.md")
  // yield* skill.pipe(Skill.readBytes("references/polciy.md"))
})

Skill.fromFiles also retains known keys. Dynamic bundles accept string paths and keep runtime validation. Skill.manifest uses Effect's Digest service to describe exact file bytes, sizes and MIME types. Existing raw MCP registration remains supported.

This should gives future local agent integrations and skill catalogues a shared value to consume. Manifests can support change detection or approval records. Loaders, execution and approval policies remain application concerns. This PR does not add them, but you can imagine something like:

const skills = AgentSkills.fromMcp(client, {
  allow: ["skill://billing/refunds/SKILL.md"],
});

// const skills = AgentSkills.fromLocal([]);

const billingAgent = Agent.make("billing", {
  input: BillingRequest,
  output: BillingResponse,
  instructions: skills.instructions(
    "Help customers resolve billing problems.",
  ),
  toolkit: Toolkit.merge(billingTools, skills.toolkit),
});

skills.instructions would add the available descriptions and explain how to load them. skills.toolkit would provide the loading and file-reading tools. Its handler Layer would use the scoped McpClient.

Related

@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ecf51ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Nov 5, 2026
@lloydrichards
lloydrichards marked this pull request as ready for review November 5, 2026 08:52
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.41 KB 39.41 KB 0.00 KB (0.00%)
basic.ts 7.23 KB 7.23 KB 0.00 KB (0.00%)
batching.ts 11.08 KB 11.08 KB 0.00 KB (0.00%)
brand.ts 6.87 KB 6.87 KB 0.00 KB (0.00%)
cache.ts 11.54 KB 11.54 KB 0.00 KB (0.00%)
config.ts 22.84 KB 22.84 KB 0.00 KB (0.00%)
differ.ts 22.00 KB 22.00 KB 0.00 KB (0.00%)
http-client.ts 27.09 KB 27.09 KB 0.00 KB (0.00%)
http-router.ts 37.00 KB 37.00 KB 0.00 KB (0.00%)
logger.ts 12.01 KB 12.01 KB 0.00 KB (0.00%)
metric.ts 9.47 KB 9.47 KB 0.00 KB (0.00%)
optic.ts 7.10 KB 7.10 KB 0.00 KB (0.00%)
pubsub.ts 16.02 KB 16.02 KB 0.00 KB (0.00%)
queue.ts 12.89 KB 12.89 KB 0.00 KB (0.00%)
schedule.ts 11.80 KB 11.80 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.14 KB 14.14 KB 0.00 KB (0.00%)
schema-binary.ts 41.99 KB 41.99 KB 0.00 KB (0.00%)
schema-class.ts 21.73 KB 21.73 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 29.60 KB 29.60 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.99 KB 27.99 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.35 KB 15.35 KB 0.00 KB (0.00%)
schema-string.ts 12.34 KB 12.34 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.27 KB 16.27 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.95 KB 38.95 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.15 KB 26.15 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.90 KB 20.90 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.14 KB 21.14 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.17 KB 26.17 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.23 KB 21.23 KB 0.00 KB (0.00%)
schema.ts 20.82 KB 20.82 KB 0.00 KB (0.00%)
stm.ts 14.20 KB 14.20 KB 0.00 KB (0.00%)
stream.ts 10.38 KB 10.38 KB 0.00 KB (0.00%)

@lloydrichards lloydrichards changed the title refactor: expose reusable Skill bundles refactor: expose reusable Skill module Nov 5, 2026
@lloydrichards

Copy link
Copy Markdown
Contributor Author

Without any interaction here, not even from bot, this feel like its just gotten lost. I'm gonna close this and move discussion over to the issue instead. Not worth constantly fixing merge conflicts

This branch is waiting to be deployed

1 waiting deployment
fork — ecf51adf Waiting Nov 5, 2026 by lloydrichards via approval-gate #25230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose a standalone Skill API

1 participant