Skip to content

🗂️ feat: Add Deployment Skill Directory#13523

Merged
danny-avila merged 4 commits into
devfrom
danny-avila/deployment-skills-directory
Jun 5, 2026
Merged

🗂️ feat: Add Deployment Skill Directory#13523
danny-avila merged 4 commits into
devfrom
danny-avila/deployment-skills-directory

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

I added read-only deployment skills loaded from a shared filesystem directory so a deployment can ship common skills to every skill-enabled user without persisting those skills in MongoDB.

  • Added a deployment skill registry that resolves DEPLOYMENT_SKILLS_DIR, defaults to project-root ./skill, validates SKILL.md and bundled file paths at startup, and serves stable in-memory skill/file records.
  • Wrapped skill method access so agents, skill runtime handlers, REST skill reads, always-apply resolution, and skill-state pruning see deployment skills alongside DB-backed skills while DB writes stay scoped to persisted skills.
  • Added read-only access handling for deployment skills and storage strategy routing for deployment skill file downloads.
  • Included deployment skills in Docker and Compose deployments through /app/skill, with .env.example documentation and a starter skill/README.md.
  • Added focused tests for directory resolution, startup validation, file loading, wrapper behavior, and deployment skill activation defaults.

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

  • Ran NODE_PATH=/Users/danny/Projects/LibreChat/node_modules:/Users/danny/Projects/LibreChat/packages/data-schemas/node_modules /Users/danny/Projects/LibreChat/node_modules/.bin/jest src/skills/__tests__/deployment.test.ts src/agents/__tests__/skills.test.ts --runInBand --coverage=false from packages/api.
  • Ran npm run build:data-provider.
  • Ran npm run build:data-schemas.
  • Ran npm run build:api; the build completed and still reports existing package-wide TypeScript warnings outside this change.

Test Configuration:

  • Node.js v24.16.0
  • Local verification used the main checkout dependency install through temporary ignored node_modules symlinks in this worktree.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copilot AI review requested due to automatic review settings June 5, 2026 02:17

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces “deployment skills”: read-only skills loaded at server startup from a shared filesystem directory (configurable via DEPLOYMENT_SKILLS_DIR) so deployments can ship common skills to all skill-enabled users without persisting them in MongoDB.

Changes:

  • Added an in-memory deployment skill registry that loads/validates SKILL.md + bundled files at startup and exposes stable skill/file records.
  • Integrated deployment skills across agent skill resolution, REST skill reads, download streaming, and skill-state pruning while keeping writes scoped to DB-backed skills.
  • Updated Docker/Compose + .env.example docs and added targeted unit tests.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
skill/README.md Documents the deployment skills directory layout and behavior.
packages/data-schemas/src/methods/index.ts Re-exports skill validation/helpers used by deployment skill loading.
packages/data-schemas/src/index.ts Surfaces the new method exports from the package entrypoint.
packages/data-provider/src/types/skills.ts Extends SkillSource to include deployment and updates related docs.
packages/api/src/skills/index.ts Exposes the new deployment skills module via package exports.
packages/api/src/skills/import.ts Exports guessMimeType() for reuse by deployment skill file loading.
packages/api/src/skills/deployment.ts Implements deployment skill directory resolution, loading, registry, and DB-method wrappers.
packages/api/src/skills/tests/deployment.test.ts Adds tests for directory resolution, validation, loading, and wrapper behavior.
packages/api/src/agents/skills.ts Defaults deployment skills to active unless explicitly overridden off.
packages/api/src/agents/initialize.ts Extends DB method interfaces to thread deployment?: boolean through agent init.
packages/api/src/agents/handlers.ts Extends tool execute options typing to include deployment?: boolean.
packages/api/src/agents/tests/skills.test.ts Adds coverage for deployment-skill activation + manual/always-apply behavior.
Dockerfile.multi Copies skill/ into the multi-stage image build output.
Dockerfile Creates /app/skill directory for runtime mounting/use.
docker-compose.yml Mounts host ./skill into container /app/skill.
deploy-compose.yml Mounts host ./skill into container /app/skill in deploy compose.
api/server/services/Endpoints/agents/skillDeps.js Wraps skill DB methods/strategy funcs to include deployment skills + download streaming.
api/server/services/Endpoints/agents/initialize.js Ensures skill listing/lookup and accessible skill IDs include deployment skills.
api/server/routes/skills.js Routes skill reads through wrapped methods and includes deployment IDs in access checks.
api/server/middleware/accessResources/canAccessSkillResource.js Grants VIEW access to deployment skills and blocks non-VIEW as read-only.
api/server/index.js Initializes deployment skills during server startup.
api/server/controllers/SkillStatesController.js Prevents pruning deployment skill states and includes deployment IDs in accessible set.
api/server/controllers/agents/responses.js Includes deployment skills in runtime skill resolution for responses route.
api/server/controllers/agents/openai.js Includes deployment skills in runtime skill resolution for OpenAI agent route.
.env.example Documents DEPLOYMENT_SKILLS_DIR configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api/src/skills/deployment.ts Outdated
Comment on lines +255 to +259
if (matchesLookupPreference(skill, options)) {
return skill;
}
return skill;
}
Comment thread packages/api/src/skills/deployment.ts Outdated
Comment on lines +458 to +462
const dbLookup = base.getSkillByName
? base.getSkillByName(name, stripDeploymentIds(accessibleIds), options)
: Promise.resolve(null);
const [dbSkill] = await Promise.all([dbLookup]);
const deployment = registry.getByName(name, accessibleIds, options);

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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.

Reviewed commit: 11b8b03720

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/api/src/skills/deployment.ts Outdated
Comment on lines +887 to +893
function toSkillFileRow(file: DeploymentSkillFile): SkillFileRow {
return {
relativePath: file.relativePath,
filename: file.filename,
filepath: file.filepath,
source: file.source,
mimeType: file.mimeType,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include required metadata in deployment file rows

When listing files for a deployment skill, listSkillFiles returns these stripped-down rows and listFilesHandler immediately serializes each one with serializeSkillFile, which calls file._id.toString(), file.skillId.toString(), file.author.toString(), and reads file_id/category/timestamps. For any deployment skill with files, GET /api/skills/:id/files therefore throws and returns 500 instead of showing the bundled files; return the full DeploymentSkillFile metadata (or add a deployment-specific serializer) before exposing these rows.

Useful? React with 👍 / 👎.

@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13523 index is now live on the MCP server.
Deploy run

@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13523 index is now live on the MCP server.
Deploy run

@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13523 index is now live on the MCP server.
Deploy run

@danny-avila danny-avila marked this pull request as ready for review June 5, 2026 03:02
@danny-avila danny-avila changed the base branch from main to dev June 5, 2026 03:02
@danny-avila danny-avila merged commit 2c8d54e into dev Jun 5, 2026
19 checks passed
@danny-avila danny-avila deleted the danny-avila/deployment-skills-directory branch June 5, 2026 14:24
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jun 18, 2026
* feat: Add deployment skill directory

* chore: Address deployment skill review feedback

* fix: Include deployment skill file metadata

* test: Add deployment skills e2e smoke test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants