Commit fd49f72
authored
feat(cli): add skill command for SKILL.md generation (#40)
* feat(mcp-skill): extract skill module to new crate
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.
* feat(cli): add skill command for SKILL.md generation
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.
* style: fix formatting
* fix: remove unnecessary raw string hashes (clippy)
* fix: use char instead of string in starts_with (clippy)
* fix: allow cast_possible_truncation in test
* fix: update doc examples to use mcp_skill imports1 parent b5b21f0 commit fd49f72
File tree
23 files changed
+2427
-987
lines changed- crates
- mcp-cli
- src
- commands
- mcp-server
- src
- skill
- tests
- mcp-skill
- src
- templates
23 files changed
+2427
-987
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
163 | 201 | | |
164 | 202 | | |
165 | 203 | | |
| |||
212 | 250 | | |
213 | 251 | | |
214 | 252 | | |
| 253 | + | |
215 | 254 | | |
216 | 255 | | |
217 | 256 | | |
| |||
0 commit comments