@asnd/skill-creator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +1619 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/package-4Q4VX3O2.js +90 -0
- package/dist/cli/package-4Q4VX3O2.js.map +1 -0
- package/package.json +84 -0
- package/prompts/generate-skill.md +22 -0
- package/skills/skill-creator/SKILL.md +260 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-creator
|
|
3
|
+
description: Turn MCP servers, OpenAPI specs, and GraphQL endpoints into runtime CLIs. Use when a user wants to discover available tools/endpoints, list commands, inspect command parameters, call MCP/OpenAPI/GraphQL operations, test an API from the shell, or create a skill/workflow around an API without writing generated client code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# skill-creator
|
|
7
|
+
|
|
8
|
+
Use `skill-creator` to turn an MCP server, OpenAPI spec, or GraphQL endpoint into a CLI at runtime. Commands and flags are discovered dynamically from the source.
|
|
9
|
+
|
|
10
|
+
This TypeScript port currently supports:
|
|
11
|
+
|
|
12
|
+
- OpenAPI specs from local files or remote URLs
|
|
13
|
+
- MCP over stdio
|
|
14
|
+
- MCP over Streamable HTTP with SSE fallback
|
|
15
|
+
- GraphQL introspection, provided SDL schemas, and introspection JSON schemas
|
|
16
|
+
- filtering, caching, auth headers, output formatting, and GraphQL stdin variables
|
|
17
|
+
|
|
18
|
+
## Core workflow
|
|
19
|
+
|
|
20
|
+
1. Connect to exactly one source.
|
|
21
|
+
2. Discover available commands with `--list` or `--search`.
|
|
22
|
+
3. Inspect a command with `<command> --help`.
|
|
23
|
+
4. Execute the command with flags. Put global options before the subcommand and command-specific options after it.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# OpenAPI
|
|
27
|
+
skill-creator --spec ./openapi.json --list
|
|
28
|
+
skill-creator --spec ./openapi.json --pretty get-pet --id 1
|
|
29
|
+
|
|
30
|
+
# MCP over HTTP: auto tries Streamable HTTP then SSE
|
|
31
|
+
skill-creator --mcp https://mcp.example.com/mcp --list
|
|
32
|
+
skill-creator --mcp https://mcp.example.com/mcp search --query "test"
|
|
33
|
+
|
|
34
|
+
# MCP over stdio
|
|
35
|
+
skill-creator --mcp-stdio "node server.js" --list
|
|
36
|
+
skill-creator --mcp-stdio "node server.js" echo --message "hello"
|
|
37
|
+
|
|
38
|
+
# GraphQL
|
|
39
|
+
skill-creator --graphql https://api.example.com/graphql --list
|
|
40
|
+
skill-creator --graphql https://api.example.com/graphql users --limit 10
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## CLI reference
|
|
44
|
+
|
|
45
|
+
```txt
|
|
46
|
+
skill-creator [global options] <subcommand> [command options]
|
|
47
|
+
|
|
48
|
+
Source (mutually exclusive, one required):
|
|
49
|
+
--spec URL|FILE OpenAPI spec (JSON or YAML, local or remote)
|
|
50
|
+
--mcp URL MCP server URL (HTTP/SSE)
|
|
51
|
+
--mcp-stdio CMD MCP server command (stdio transport)
|
|
52
|
+
--graphql URL GraphQL endpoint URL
|
|
53
|
+
|
|
54
|
+
Options:
|
|
55
|
+
--auth-header K:V HTTP header; values support env:NAME and file:/path
|
|
56
|
+
--transport TYPE MCP HTTP transport: auto|streamable|sse (default: auto)
|
|
57
|
+
--base-url URL Override OpenAPI base URL
|
|
58
|
+
--graphql-schema SRC GraphQL SDL or introspection JSON schema FILE|URL
|
|
59
|
+
--cache-key KEY Custom cache key
|
|
60
|
+
--cache-ttl SECONDS Cache TTL (default: 3600)
|
|
61
|
+
--refresh Bypass cache
|
|
62
|
+
--list List available commands
|
|
63
|
+
--search PATTERN Search by command name or description
|
|
64
|
+
--include GLOBS Include command globs, comma-separated
|
|
65
|
+
--exclude GLOBS Exclude command globs, comma-separated
|
|
66
|
+
--methods METHODS OpenAPI method filter, e.g. GET,POST
|
|
67
|
+
--fields FIELDS GraphQL selection override, e.g. "id name email"
|
|
68
|
+
--selection-depth N GraphQL default selection depth (default: 2)
|
|
69
|
+
--stdin Read GraphQL variables from stdin JSON
|
|
70
|
+
--pretty Pretty-print JSON
|
|
71
|
+
--raw Print raw response body
|
|
72
|
+
--head N Limit array output to first N records
|
|
73
|
+
--help, -h Show help
|
|
74
|
+
--version Show version
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
78
|
+
|
|
79
|
+
Prefer `env:` or `file:` secret references. Do not pass raw tokens literally.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
export API_TOKEN="Bearer ..."
|
|
83
|
+
|
|
84
|
+
skill-creator --mcp https://api.example.com/mcp \
|
|
85
|
+
--auth-header Authorization:env:API_TOKEN \
|
|
86
|
+
--list
|
|
87
|
+
|
|
88
|
+
skill-creator --spec https://api.example.com/openapi.json \
|
|
89
|
+
--auth-header x-api-key:file:/run/secrets/api-key \
|
|
90
|
+
list-items
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## MCP patterns
|
|
94
|
+
|
|
95
|
+
### Transport selection
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Default: Streamable HTTP, then SSE fallback
|
|
99
|
+
skill-creator --mcp https://mcp.example.com/mcp --list
|
|
100
|
+
|
|
101
|
+
# Force Streamable HTTP only
|
|
102
|
+
skill-creator --mcp https://mcp.example.com/mcp --transport streamable --list
|
|
103
|
+
|
|
104
|
+
# Force legacy SSE
|
|
105
|
+
skill-creator --mcp https://mcp.example.com/sse --transport sse --list
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### GitHub remote MCP
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
export GITHUB_MCP_PAT="Bearer $(gh auth token)"
|
|
112
|
+
|
|
113
|
+
skill-creator \
|
|
114
|
+
--mcp https://api.githubcopilot.com/mcp/x/repos/readonly \
|
|
115
|
+
--auth-header Authorization:env:GITHUB_MCP_PAT \
|
|
116
|
+
--list
|
|
117
|
+
|
|
118
|
+
skill-creator \
|
|
119
|
+
--mcp https://api.githubcopilot.com/mcp/x/repos/readonly \
|
|
120
|
+
--auth-header Authorization:env:GITHUB_MCP_PAT \
|
|
121
|
+
get-file-contents \
|
|
122
|
+
--owner github \
|
|
123
|
+
--repo github-mcp-server \
|
|
124
|
+
--path README.md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Filesystem MCP over stdio
|
|
128
|
+
|
|
129
|
+
Current npm installs may need `ajv` supplied explicitly:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
skill-creator --mcp-stdio \
|
|
133
|
+
"npx -y -p ajv -p @modelcontextprotocol/server-filesystem mcp-server-filesystem /tmp" \
|
|
134
|
+
--list
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
On macOS, `/tmp` resolves to `/private/tmp`. If the filesystem server rejects `/tmp/foo`, retry with `/private/tmp/foo`.
|
|
138
|
+
|
|
139
|
+
## OpenAPI patterns
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Discover operations
|
|
143
|
+
skill-creator --spec https://petstore3.swagger.io/api/v3/openapi.json --list
|
|
144
|
+
|
|
145
|
+
# Override base URL if the spec lacks usable servers
|
|
146
|
+
skill-creator --spec ./openapi.json --base-url https://api.example.com/v1 --list
|
|
147
|
+
|
|
148
|
+
# Filter to safer read-only operations
|
|
149
|
+
skill-creator --spec ./openapi.json --methods GET --list
|
|
150
|
+
|
|
151
|
+
# Include/exclude by generated command names
|
|
152
|
+
skill-creator --spec ./openapi.json --include 'list-*' --exclude '*internal*' --list
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## GraphQL patterns
|
|
156
|
+
|
|
157
|
+
### Introspected endpoints
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
skill-creator --graphql https://beta.pokeapi.co/graphql/v1beta --list
|
|
161
|
+
|
|
162
|
+
skill-creator --graphql https://beta.pokeapi.co/graphql/v1beta \
|
|
163
|
+
--fields "id name" \
|
|
164
|
+
pokemon-v2-pokemon \
|
|
165
|
+
--limit 3
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Endpoints without introspection
|
|
169
|
+
|
|
170
|
+
If introspection is disabled, provide SDL or introspection JSON with `--graphql-schema`.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
skill-creator --graphql https://api.example.com/graphql \
|
|
174
|
+
--graphql-schema ./schema.graphql \
|
|
175
|
+
--list
|
|
176
|
+
|
|
177
|
+
skill-creator --graphql https://api.example.com/graphql \
|
|
178
|
+
--graphql-schema ./introspection.json \
|
|
179
|
+
users --limit 10
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
If no schema is provided and introspection fails, skill-creator tries a stale cached schema. If none exists, provide `--graphql-schema`.
|
|
183
|
+
|
|
184
|
+
### Variables from stdin
|
|
185
|
+
|
|
186
|
+
Use `--stdin` for GraphQL variables that are easier to pass as JSON.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
echo '{"limit": 3}' | skill-creator \
|
|
190
|
+
--graphql https://beta.pokeapi.co/graphql/v1beta \
|
|
191
|
+
pokemon-v2-pokemon \
|
|
192
|
+
--stdin
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Selection sets
|
|
196
|
+
|
|
197
|
+
Use `--fields` for precise output and to avoid oversized nested responses.
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
skill-creator --graphql https://beta.pokeapi.co/graphql/v1beta \
|
|
201
|
+
--fields "id name height weight" \
|
|
202
|
+
pokemon-v2-pokemon-by-pk \
|
|
203
|
+
--id 25
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
If no `--fields` is supplied, skill-creator builds a default selection set. Use `--selection-depth 1` to keep it shallow.
|
|
207
|
+
|
|
208
|
+
## Caching and refresh
|
|
209
|
+
|
|
210
|
+
Remote OpenAPI specs, MCP HTTP tool lists, and GraphQL schemas are cached under `~/.cache/skill-creator` by default. Override with `SKILL_CREATOR_CACHE_DIR`.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
skill-creator --graphql https://api.example.com/graphql --refresh --list
|
|
214
|
+
skill-creator --mcp https://mcp.example.com/mcp --cache-ttl 86400 --list
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Output handling
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Pretty JSON
|
|
221
|
+
skill-creator --spec ./openapi.json --pretty list-pets
|
|
222
|
+
|
|
223
|
+
# Raw response body
|
|
224
|
+
skill-creator --spec ./openapi.json --raw download-report > report.json
|
|
225
|
+
|
|
226
|
+
# Preview large arrays
|
|
227
|
+
skill-creator --graphql https://api.example.com/graphql --head 5 users
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Creating another skill around an API
|
|
231
|
+
|
|
232
|
+
When asked to create a skill for a specific API, use skill-creator to explore first, then document the practical findings.
|
|
233
|
+
|
|
234
|
+
1. Discover commands:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
skill-creator --mcp https://target.example.com/mcp --list
|
|
238
|
+
skill-creator --spec https://target.example.com/openapi.json --list
|
|
239
|
+
skill-creator --graphql https://target.example.com/graphql --list
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
2. Inspect important commands:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
skill-creator --mcp https://target.example.com/mcp <command> --help
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
3. Test representative read-only calls first. Use `--head`, `--fields`, and `--pretty` to control output size.
|
|
249
|
+
|
|
250
|
+
4. Record gotchas in the generated `SKILL.md`:
|
|
251
|
+
- required auth scopes and safe secret passing
|
|
252
|
+
- pagination defaults and limits
|
|
253
|
+
- date/time formats
|
|
254
|
+
- fields that cause huge responses
|
|
255
|
+
- binary or raw output handling
|
|
256
|
+
- write/delete operations to avoid unless explicitly requested
|
|
257
|
+
|
|
258
|
+
5. Prefer wrapper scripts or documented command templates for repeated connection flags. This TypeScript port does not include bake mode.
|
|
259
|
+
|
|
260
|
+
Do not duplicate the entire `--help` output in generated skills. Focus on tested workflows, surprising defaults, anti-patterns, and examples that are known to work.
|