Skill publisher#49
Merged
Merged
Conversation
Add a new MCP tool, skill_publish, so agents can create and publish skills into a scope directly from SKILL.md-style markdown or explicit fields. The handler enforces scope authorization, derives slug/name defaults, parses optional frontmatter, creates the skill, and marks it published so it is immediately discoverable/installable. Also add parser/unit tests, handler validation tests, and scope-auth inventory/integration coverage for the new scope-taking tool. Co-authored-by: Codex <noreply@openai.com>
Extend skill_publish to accept a files array and persist supplementary skill files (scripts/references) through skills.Store.Create. Add validation/parsing for file payloads using existing skill file safety rules and return input errors for malformed file structures. Add unit tests for file payload parsing and an integration test verifying published skills store multiple files successfully. Co-authored-by: Codex <noreply@openai.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an MCP tool to publish skills into the skills registry directly from markdown (optionally with frontmatter) and optional supplementary files, making them immediately discoverable/installable within a scope.
Changes:
- Introduce new MCP tool
skill_publishwith scope auth +skills:writepermission and support for markdown/frontmatter parsing plus file attachments. - Add unit + integration coverage for parsing, authorization, and end-to-end publish-with-files behavior.
- Bump
golangci-lintversion in the Makefile.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/api/mcp/skill_publish.go | New MCP tool implementation, frontmatter parsing, slug derivation, supplementary file parsing/validation, publish status update |
| internal/api/mcp/skill_publish_test.go | Unit tests for frontmatter parsing, slug derivation, and supplementary file parsing |
| internal/api/mcp/server.go | Registers the new skill_publish tool |
| internal/api/mcp/scopeauth_inventory_test.go | Adds skill_publish to scope-taking tool inventory checks |
| internal/api/mcp/scope_authz_integration_test.go | Adds scope authorization integration coverage for skill_publish |
| internal/api/mcp/mcp_integration_test.go | End-to-end integration test for skill_publish with supplementary files |
| internal/api/mcp/handlers_unit_test.go | Adds handler validation tests for missing args / invalid files type (but see review comment) |
| designs/TASKS.md | Documents completion of the MCP skill publishing tool task |
| Makefile | Updates GOLANGCI_LINT_VERSION |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Make default slug derivation from source_name separator-stable across platforms by normalizing backslashes to forward slashes and using the path package for basename/extension extraction. This keeps behavior consistent for client-provided names regardless of server OS. Add regression coverage for both slash styles in skill_publish tests. Co-authored-by: Codex <noreply@openai.com>
Avoid partial publish failures in skill_publish by creating skills directly with published status and published_at, instead of doing Create followed by UpdateSkillStatus in a second DB operation. Extend skills.CreateInput with optional initial status/published_at fields (defaulting to draft for existing callers) and add unit coverage for default and published create paths. Co-authored-by: Codex <noreply@openai.com>
Rename the skill_publish unit test that passed a malformed files value under an unconfigured server and assert the returned error text explicitly reflects the early server-not-configured guard. This aligns test naming with actual behavior and avoids implying files validation was reached. Co-authored-by: Codex <noreply@openai.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Update skills store API documentation to reflect current behavior: Create defaults to draft status but may create published skills when CreateInput.Status and PublishedAt are provided. Adjust comments on CreateInput and Store.Create to make this explicit for callers. Co-authored-by: Codex <noreply@openai.com>
Change skill_publish frontmatter parsing to return an explicit error when agent_types is provided as an inline list but is not valid JSON array syntax, instead of silently ignoring parse failures and falling back to default compatibility. Add regression coverage for invalid inline agent_types parsing and update TASKS.md tracking. Co-authored-by: Codex <noreply@openai.com>
Switch skill_publish agent_types array schema declaration to mcpgo.WithStringItems() for consistency with other MCP tools and stricter client schema handling. Update TASKS.md to track the MCP schema consistency adjustment. Co-authored-by: Codex <noreply@openai.com>
Rename the local file path variable in parseSkillPublishFiles from path to relativePath to avoid confusion with the path package, and wrap ValidateSkillFile failures with the item index so multi-file payload errors are easier to diagnose. Add/adjust tests to assert indexed error context and update TASKS.md. Co-authored-by: Codex <noreply@openai.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.