Skip to content

Skill publisher#49

Merged
noctarius merged 12 commits into
mainfrom
skill-publisher
Apr 24, 2026
Merged

Skill publisher#49
noctarius merged 12 commits into
mainfrom
skill-publisher

Conversation

@noctarius
Copy link
Copy Markdown
Collaborator

No description provided.

noctarius and others added 3 commits April 24, 2026 16:21
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>
@noctarius noctarius self-assigned this Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 14:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_publish with scope auth + skills:write permission 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-lint version 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.

Comment thread internal/api/mcp/skill_publish.go Outdated
Comment thread internal/api/mcp/skill_publish.go
Comment thread internal/api/mcp/skill_publish.go
Comment thread internal/api/mcp/skill_publish.go Outdated
Comment thread internal/api/mcp/handlers_unit_test.go Outdated
noctarius and others added 4 commits April 24, 2026 17:06
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread internal/skills/store.go
Comment thread internal/skills/store.go Outdated
Comment thread internal/api/mcp/skill_publish.go Outdated
Comment thread internal/api/mcp/skill_publish.go Outdated
Comment thread internal/api/mcp/skill_publish.go Outdated
noctarius and others added 5 commits April 24, 2026 17:24
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>
@noctarius noctarius merged commit efb0e26 into main Apr 24, 2026
15 checks passed
@noctarius noctarius deleted the skill-publisher branch April 24, 2026 15:51
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