Skip to content

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Jan 3, 2026

Summary

  • Add skill CLI command to generate Claude Code skill files (SKILL.md) from progressive loading TypeScript files
  • Refactor main.rs into modular cli.rs/runner.rs structure for better maintainability
  • Improve mcp-skill README with proper MSRV documentation and GitHub callouts

Changes

New Features

  • mcp-execution-cli skill command with options:
    • --server, -s - Server identifier (required)
    • --servers-dir - Custom servers directory
    • --output, -o - Custom output path
    • --skill-name - Custom skill name
    • --hint - Use case hints (repeatable)
    • --overwrite - Overwrite existing SKILL.md

Security

  • Path traversal detection using Component::ParentDir analysis
  • Symlink escape protection via canonicalize() + starts_with() validation
  • Output path validation for custom paths
  • DoS protection (max 500 files, max 1MB per file)

Code Quality

  • Refactored 500+ line main.rs into focused modules
  • Added comprehensive tests for command parsing and security functions
  • Updated documentation with MCP server recommendation

Test Plan

  • All 611 tests pass
  • Clippy warnings resolved
  • Security review passed
  • Path traversal tests added

Phase 1 of generate-skill CLI command implementation:

- Create mcp-skill crate with skill generation logic
- Move parser, context, template modules from mcp-server
- Add validate_server_id() and extract_skill_metadata() functions
- Apply performance fixes (LazyLock for Handlebars template)
- Apply security fixes (path canonicalization, symlink protection)
- Add DoS protection tests (TooManyFiles, FileTooLarge)
- Reduce code duplication between crates

All 564 tests passing.
Add CLI command to generate Claude Code skill files from progressive
loading TypeScript files. Key features:

- Parse JSDoc metadata (@tool, @server, @category, @Keywords, @description)
- Build skill context with automatic categorization and examples
- Multi-layer security: path traversal, symlink, DoS protection
- Refactor main.rs to modular cli.rs/runner.rs structure

The skill command outputs a structured prompt suitable for LLM-based
SKILL.md generation. For optimal results, MCP server is recommended
as it can leverage LLM summarization for more concise output.
@github-actions github-actions bot added crate: mcp-cli Changes to mcp-cli crate (command-line interface) type: documentation Documentation changes (*.md, docs/, comments) type: dependencies Dependency updates (Cargo.toml, Cargo.lock) build Build configuration changes (build.rs, toolchain) workspace Workspace-wide changes affecting multiple crates breaking change Contains breaking API changes (requires major version bump) release Release preparation (changelog, version bumps) labels Jan 3, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2026

Codecov Report

❌ Patch coverage is 94.81865% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/mcp-skill/src/parser.rs 92.48% 10 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   92.41%   92.80%   +0.38%     
==========================================
  Files          21       22       +1     
  Lines        4749     4779      +30     
==========================================
+ Hits         4389     4435      +46     
+ Misses        360      344      -16     
Flag Coverage Δ
unittests 92.80% <94.81%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/mcp-server/src/service.rs 83.25% <100.00%> (-0.89%) ⬇️
crates/mcp-server/src/types.rs 100.00% <ø> (ø)
crates/mcp-skill/src/context.rs 98.92% <100.00%> (ø)
crates/mcp-skill/src/template.rs 98.18% <100.00%> (ø)
crates/mcp-skill/src/types.rs 100.00% <100.00%> (ø)
crates/mcp-skill/src/parser.rs 97.61% <92.48%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5b21f0...7f61e58. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bug-ops bug-ops merged commit fd49f72 into master Jan 3, 2026
16 checks passed
@bug-ops bug-ops deleted the feature/cli-generate-skill branch January 3, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Contains breaking API changes (requires major version bump) build Build configuration changes (build.rs, toolchain) crate: mcp-cli Changes to mcp-cli crate (command-line interface) release Release preparation (changelog, version bumps) type: dependencies Dependency updates (Cargo.toml, Cargo.lock) type: documentation Documentation changes (*.md, docs/, comments) workspace Workspace-wide changes affecting multiple crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants