You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
move remote-skill discovery prompt ownership into OpenWork Server
expose the authenticated member's authorized skill catalog from Den as MCP resources at skill://index.json and skill://<name>/SKILL.md
have OpenWork Server fetch, validate, cache, bound, and render the catalog into an Agent Skills-compatible <available_skills> discovery block
keep the OpenCode plugin as a narrow engine adapter that only injects the server-produced instruction
keep full skill bodies out of the system prompt; agents retrieve a selected body through the existing openwork-cloud_execute_capability / skill:<id> contract
preserve the /mcp/agent surface at exactly two model-facing tools
Architecture
Den authorization + skill storage
-> authenticated MCP skill resources
OpenWork Server
-> normalized remote-skill catalog
-> bounded discovery system instruction
Engine adapter (OpenCode plugin today)
-> injects the OpenWork-owned instruction
Agent
-> retrieves the selected SKILL.md with execute_capability
This keeps product behavior in OpenWork Server and confines engine-specific code to the adapter. A replacement engine can consume the same server endpoint without depending on OpenCode's treatment of MCP initialization instructions.
Agent Skills and skill://index.json
This PR builds on two stable foundations:
Agent Skills defines the SKILL.md format and progressive-disclosure lifecycle: expose name and description for discovery, then load the full SKILL.md only after the agent selects a relevant skill.
MCP Resources provide the authenticated remote transport and resources/read operation.
skill://index.json is an experimental Skills-over-MCP discovery convention layered on those foundations. It is being explored by the MCP Skills Over MCP Working Group, whose repository explicitly says that the work is exploratory and is not yet an official MCP specification or recommendation. This PR therefore treats the URI and discovery document as a versioned interoperability layer, not as a finalized universal standard.
MCP initialize
-> resources/read("skill://index.json")
-> disclose only name + description to the model
-> model selects a matching skill
-> load the selected SKILL.md on demand
Each normalized SKILL.md is available as an MCP resource for compatible clients. OpenWork also includes the capability field as an extension to the discovery entry. Generic consumers can ignore that unknown field and use the url resource; OpenWork agents use it with the existing openwork-cloud_execute_capability transport. That preserves tenant-aware authorization, errors, policy enforcement, and the existing two-tool model-facing surface.
The <available_skills> XML is the server-rendered model disclosure format, not part of the MCP wire contract. Agent Skills guidance permits XML, JSON, or another structured catalog representation; the important invariant is progressive disclosure rather than one mandatory prompt syntax.
pnpm --dir ee/apps/den-api exec bun test test/mcp-agent-timeouts.test.ts — 13 passed, 0 failed
pnpm --filter openwork-server build — passed
pnpm --dir ee/apps/den-api build — passed
GitHub Actions: OpenWork tests on Linux and macOS, Den API/web/inference builds, Helm validation, and i18n audit all passed
rebased onto current upstream/dev (6bee537e7)
Focused tests cover authenticated MCP initialization and resources/read, index validation, prompt escaping and bounds, capability retrieval guidance, engine-adapter injection, unchanged initialize instructions, and the two-tool annotations/contracts.
Security and compatibility
Den remains authoritative for organization, membership, sharing, and skill-hub access
resources are registered only after the existing MCP authentication and active-membership checks
metadata is schema-validated, normalized, escaped, and bounded before entering system context
the prompt explicitly treats remote skill bodies as untrusted content subordinate to system and user instructions
full skill bodies and credentials do not enter the discovery prompt
malformed, unavailable, or unsupported catalogs fail closed to no injected skill catalog
the server cache is scoped by workspace and a hash of the complete runtime MCP config, so token/config rotation invalidates it
if the experimental remote-discovery convention changes, Den's resource adapter can evolve without changing OpenWork's normalized server catalog or agent-facing capability contract
Remaining gaps
no live production OAuth provider was used
no desktop UI evidence was produced because this has no UI surface
the three Vercel fork statuses require Different AI team authorization and are not code failures
Agreed — I reworked this so OpenWork Server owns the remote-skill catalog and system-prompt behavior. Den now only exposes the authorized catalog as authenticated MCP resources, and the OpenCode plugin is a narrow adapter that injects the server-rendered instruction. The branch is rebased and the PR description includes the updated architecture and validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skill://index.jsonandskill://<name>/SKILL.md<available_skills>discovery blockopenwork-cloud_execute_capability/skill:<id>contract/mcp/agentsurface at exactly two model-facing toolsArchitecture
This keeps product behavior in OpenWork Server and confines engine-specific code to the adapter. A replacement engine can consume the same server endpoint without depending on OpenCode's treatment of MCP initialization instructions.
Agent Skills and
skill://index.jsonThis PR builds on two stable foundations:
SKILL.mdformat and progressive-disclosure lifecycle: exposenameanddescriptionfor discovery, then load the fullSKILL.mdonly after the agent selects a relevant skill.resources/readoperation.skill://index.jsonis an experimental Skills-over-MCP discovery convention layered on those foundations. It is being explored by the MCP Skills Over MCP Working Group, whose repository explicitly says that the work is exploratory and is not yet an official MCP specification or recommendation. This PR therefore treats the URI and discovery document as a versioned interoperability layer, not as a finalized universal standard.Den publishes an authenticated index shaped like:
{ "$schema": "https://schemas.agentskills.io/discovery/0.2.0/schema.json", "skills": [ { "name": "customer-briefing", "type": "skill-md", "description": "Prepare a customer briefing before meetings.", "url": "skill://customer-briefing/SKILL.md", "capability": "skill:skill_01..." } ] }The intended exchange is:
Each normalized
SKILL.mdis available as an MCP resource for compatible clients. OpenWork also includes thecapabilityfield as an extension to the discovery entry. Generic consumers can ignore that unknown field and use theurlresource; OpenWork agents use it with the existingopenwork-cloud_execute_capabilitytransport. That preserves tenant-aware authorization, errors, policy enforcement, and the existing two-tool model-facing surface.The
<available_skills>XML is the server-rendered model disclosure format, not part of the MCP wire contract. Agent Skills guidance permits XML, JSON, or another structured catalog representation; the important invariant is progressive disclosure rather than one mandatory prompt syntax.Validation
pnpm --filter openwork-server typecheck— passedpnpm --dir ee/apps/den-api exec tsc -p tsconfig.json --noEmit— passedpnpm --filter openwork-server test -- src/connect-skill-catalog.test.ts src/opencode-plugins/openwork-extensions-preview.test.ts— 11 passed, 0 failedpnpm --dir ee/apps/den-api exec bun test test/mcp-agent-timeouts.test.ts— 13 passed, 0 failedpnpm --filter openwork-server build— passedpnpm --dir ee/apps/den-api build— passedupstream/dev(6bee537e7)Focused tests cover authenticated MCP initialization and
resources/read, index validation, prompt escaping and bounds, capability retrieval guidance, engine-adapter injection, unchanged initialize instructions, and the two-tool annotations/contracts.Security and compatibility
Remaining gaps