@asnd/skill-creator 0.1.2 → 0.1.3

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.
Files changed (88) hide show
  1. package/README.md +64 -125
  2. package/dist/cli/dynamic.d.ts +26 -0
  3. package/dist/cli/dynamic.js +136 -0
  4. package/dist/cli/dynamic.js.map +1 -0
  5. package/dist/cli/main.d.ts +2 -4
  6. package/dist/cli/main.js +376 -1530
  7. package/dist/cli/main.js.map +1 -1
  8. package/dist/cli/parse.d.ts +9 -0
  9. package/dist/cli/parse.js +38 -0
  10. package/dist/cli/parse.js.map +1 -0
  11. package/dist/commands/agents.d.ts +96 -0
  12. package/dist/commands/agents.js +116 -0
  13. package/dist/commands/agents.js.map +1 -0
  14. package/dist/commands/install.d.ts +12 -0
  15. package/dist/commands/install.js +229 -0
  16. package/dist/commands/install.js.map +1 -0
  17. package/dist/core/cache.d.ts +3 -0
  18. package/dist/core/cache.js +52 -0
  19. package/dist/core/cache.js.map +1 -0
  20. package/dist/core/coerce.d.ts +8 -0
  21. package/dist/core/coerce.js +128 -0
  22. package/dist/core/coerce.js.map +1 -0
  23. package/dist/core/filter.d.ts +7 -0
  24. package/dist/core/filter.js +16 -0
  25. package/dist/core/filter.js.map +1 -0
  26. package/dist/core/listing.d.ts +11 -0
  27. package/dist/core/listing.js +31 -0
  28. package/dist/core/listing.js.map +1 -0
  29. package/dist/core/names.d.ts +1 -0
  30. package/dist/core/names.js +7 -0
  31. package/dist/core/names.js.map +1 -0
  32. package/dist/core/output.d.ts +12 -0
  33. package/dist/core/output.js +34 -0
  34. package/dist/core/output.js.map +1 -0
  35. package/dist/core/secrets.d.ts +1 -0
  36. package/dist/core/secrets.js +21 -0
  37. package/dist/core/secrets.js.map +1 -0
  38. package/dist/core/types.d.ts +37 -0
  39. package/dist/core/types.js +2 -0
  40. package/dist/core/types.js.map +1 -0
  41. package/dist/core/usage.d.ts +13 -0
  42. package/dist/core/usage.js +33 -0
  43. package/dist/core/usage.js.map +1 -0
  44. package/dist/graphql/execute.d.ts +8 -0
  45. package/dist/graphql/execute.js +133 -0
  46. package/dist/graphql/execute.js.map +1 -0
  47. package/dist/graphql/extract.d.ts +6 -0
  48. package/dist/graphql/extract.js +109 -0
  49. package/dist/graphql/extract.js.map +1 -0
  50. package/dist/graphql/load.d.ts +11 -0
  51. package/dist/graphql/load.js +95 -0
  52. package/dist/graphql/load.js.map +1 -0
  53. package/dist/mcp/extract.d.ts +8 -0
  54. package/dist/mcp/extract.js +40 -0
  55. package/dist/mcp/extract.js.map +1 -0
  56. package/dist/mcp/http.d.ts +8 -0
  57. package/dist/mcp/http.js +80 -0
  58. package/dist/mcp/http.js.map +1 -0
  59. package/dist/mcp/stdio.d.ts +9 -0
  60. package/dist/mcp/stdio.js +67 -0
  61. package/dist/mcp/stdio.js.map +1 -0
  62. package/dist/openapi/execute.d.ts +12 -0
  63. package/dist/openapi/execute.js +44 -0
  64. package/dist/openapi/execute.js.map +1 -0
  65. package/dist/openapi/extract.d.ts +2 -0
  66. package/dist/openapi/extract.js +123 -0
  67. package/dist/openapi/extract.js.map +1 -0
  68. package/dist/openapi/load.d.ts +11 -0
  69. package/dist/openapi/load.js +52 -0
  70. package/dist/openapi/load.js.map +1 -0
  71. package/dist/openapi/params.d.ts +12 -0
  72. package/dist/openapi/params.js +47 -0
  73. package/dist/openapi/params.js.map +1 -0
  74. package/dist/openapi/refs.d.ts +1 -0
  75. package/dist/openapi/refs.js +8 -0
  76. package/dist/openapi/refs.js.map +1 -0
  77. package/dist/skills/agents.d.ts +77 -0
  78. package/dist/skills/agents.js +85 -0
  79. package/dist/skills/agents.js.map +1 -0
  80. package/dist/skills/generate.d.ts +1 -0
  81. package/dist/skills/generate.js +494 -0
  82. package/dist/skills/generate.js.map +1 -0
  83. package/package.json +7 -10
  84. package/prompts/skill-creator.md +169 -0
  85. package/dist/cli/package-SLCRJ4QY.js +0 -89
  86. package/dist/cli/package-SLCRJ4QY.js.map +0 -1
  87. package/prompts/generate-skill.md +0 -22
  88. package/skills/skill-creator/SKILL.md +0 -260
@@ -0,0 +1,169 @@
1
+ ---
2
+ description: Generate an API/tool skill and wrapper CLI
3
+ argument-hint: '<source flags or URL> [--name skill-name] [--agent agent] [--scope project|global]'
4
+ ---
5
+
6
+ # Task: create a reusable agent command surface
7
+
8
+ Invocation arguments from the user/host:
9
+
10
+ ```txt
11
+ $ARGUMENTS
12
+ ```
13
+
14
+ Generate and install a complete Agent Skill plus thin wrapper CLI scripts from an MCP server, OpenAPI spec, GraphQL endpoint/schema, or similar API/tool source. This command is for creating reusable agent infrastructure, not for one-off API calls.
15
+
16
+ If the arguments block is empty or still a literal placeholder, infer the source from the surrounding user message. If the source, target agent, or install scope is still missing, ask only the minimum blocking questions.
17
+
18
+ ## Research-backed command principles
19
+
20
+ Follow these principles when creating the generated skill and its scripts:
21
+
22
+ - Write instructions for the future agent, not prose about what the command would do.
23
+ - Keep command/prompt descriptions short, verb-led, and specific.
24
+ - Make the CLI inspectable: it must support discovery/help such as `--list`, `--search`, and `<command> --help`.
25
+ - Make output small by default: document `--head`, `--limit`, `--fields`, `--pretty`, `jq`, and file export patterns when useful.
26
+ - Preserve approval boundaries: identify write/delete/mutation commands and do not test destructive operations without explicit safe test data.
27
+ - Avoid raw secrets. Use environment variables or files, e.g. `--auth-header 'Authorization:env:API_TOKEN'`.
28
+ - Test the installed wrapper from the generated skill directory, exactly as a future agent will run it.
29
+
30
+ ## Decide the target
31
+
32
+ 1. Determine the target agent and install scope.
33
+ - Agents commonly supported by `npx @asnd/skill-creator generate`: `pi`, `universal`, `codex`, `claude-code`, `cursor`, `opencode`, `gemini-cli`, `amp`, `github-copilot`, `goose`, `cline`, `windsurf`.
34
+ - Scope is `project` or `global`.
35
+ 2. Choose a spec-compliant skill name: lowercase kebab-case, 1-64 chars, letters/numbers/hyphens only, no leading/trailing hyphen, no consecutive hyphens.
36
+ 3. Choose a script name, usually the same as the skill name.
37
+
38
+ ## Prefer the built-in generator
39
+
40
+ Use `npx @asnd/skill-creator` for generator commands so the package does not need to be installed globally.
41
+
42
+ ### OpenAPI
43
+
44
+ ```bash
45
+ npx @asnd/skill-creator generate \
46
+ --template openapi \
47
+ --name <skill-name> \
48
+ --spec <openapi-url-or-file> \
49
+ --agent <agent> \
50
+ --scope project|global
51
+ ```
52
+
53
+ ### GraphQL
54
+
55
+ ```bash
56
+ npx @asnd/skill-creator generate \
57
+ --template graphql \
58
+ --name <skill-name> \
59
+ --graphql <graphql-endpoint-url> \
60
+ --graphql-schema <schema-url-or-file> \
61
+ --agent <agent> \
62
+ --scope project|global
63
+ ```
64
+
65
+ If no schema is provided and introspection may fail, ask whether to introspect live or where to get SDL/introspection JSON.
66
+
67
+ ### MCP HTTP/SSE
68
+
69
+ ```bash
70
+ npx @asnd/skill-creator generate \
71
+ --template mcp-http \
72
+ --name <skill-name> \
73
+ --mcp <mcp-url> \
74
+ --agent <agent> \
75
+ --scope project|global
76
+ ```
77
+
78
+ ### MCP stdio
79
+
80
+ ```bash
81
+ npx @asnd/skill-creator generate \
82
+ --template mcp-stdio \
83
+ --name <skill-name> \
84
+ --mcp-stdio '<server-command>' \
85
+ --agent <agent> \
86
+ --scope project|global
87
+ ```
88
+
89
+ Useful optional flags:
90
+
91
+ ```bash
92
+ --script <script-name>
93
+ --auth-header 'Header:env:ENV_NAME'
94
+ --base-url <url>
95
+ --description '<trigger-oriented generated skill description>'
96
+ --force
97
+ --no-test
98
+ ```
99
+
100
+ ## Refine the generated skill
101
+
102
+ After generation, inspect `SKILL.md` and rewrite it if needed so future agents know when and how to use the wrapper.
103
+
104
+ The generated skill should contain:
105
+
106
+ - Trigger-oriented frontmatter `description` that names the service and when to use it.
107
+ - Setup/auth environment variables; never raw secret values.
108
+ - Usage commands:
109
+ - `./scripts/<script-name> --list`
110
+ - `./scripts/<script-name> --search '<topic>'`
111
+ - `./scripts/<script-name> <command> --help`
112
+ - `./scripts/<script-name> --pretty <command> <flags>`
113
+ - Small-output guidance: limits, field selection, paging, raw/binary output, and `jq` examples when responses are nested.
114
+ - Safety notes for write/delete/mutation operations.
115
+ - References to bundled specs/schemas/docs instead of copied full help output.
116
+
117
+ Expected generated layout:
118
+
119
+ ```txt
120
+ <skill-name>/
121
+ ├── SKILL.md
122
+ ├── scripts/
123
+ │ └── <script-name>
124
+ ├── references/
125
+ │ ├── openapi-spec-MM-DD-YYYY.json|yaml # OpenAPI when available
126
+ │ └── graphql-schema-MM-DD-YYYY.graphql|json # GraphQL when available
127
+ └── assets/ # optional static resources
128
+ ```
129
+
130
+ MCP skills usually do not need a source artifact in `references/`; add concise notes only when they help future agents.
131
+
132
+ ## Smoke test
133
+
134
+ From the generated skill directory, run discovery/help first:
135
+
136
+ ```bash
137
+ ./scripts/<script-name> --list
138
+ ./scripts/<script-name> --search '<topic>'
139
+ ./scripts/<script-name> <command> --help
140
+ ```
141
+
142
+ Then run at most one safe read-only command with bounded output, for example:
143
+
144
+ ```bash
145
+ ./scripts/<script-name> --pretty --head 3 <safe-read-command> <flags>
146
+ ```
147
+
148
+ If auth, billing, network, or destructive side effects block testing, do not fake success. Record exactly what was skipped and why.
149
+
150
+ ## Manual path for unsupported sources
151
+
152
+ If `npx @asnd/skill-creator generate` does not support the source:
153
+
154
+ 1. Create the selected agent/scope skill directory manually.
155
+ 2. Add executable scripts in `scripts/` that hide setup/source details and expose a simple, inspectable CLI.
156
+ 3. Add stable specs, schemas, docs excerpts, examples, or notes under `references/`.
157
+ 4. Write `SKILL.md` using the requirements above.
158
+ 5. `chmod +x scripts/<script-name>` and smoke-test from the skill directory.
159
+
160
+ ## Final response
161
+
162
+ Report:
163
+
164
+ - Installed skill path and target agent/scope.
165
+ - Files created or changed.
166
+ - Wrapper commands future agents should use.
167
+ - Required environment variables or auth setup.
168
+ - Commands tested and results.
169
+ - Anything intentionally not tested.
@@ -1,89 +0,0 @@
1
- // package.json
2
- var package_default = {
3
- name: "@asnd/skill-creator",
4
- version: "0.1.2",
5
- description: "Turn any MCP server, OpenAPI spec, or GraphQL endpoint into a CLI at runtime.",
6
- keywords: [
7
- "graphql",
8
- "mcp",
9
- "openapi",
10
- "pi-package",
11
- "skills"
12
- ],
13
- homepage: "https://github.com/sandiiarov/skill-creator#readme",
14
- bugs: {
15
- url: "https://github.com/sandiiarov/skill-creator/issues"
16
- },
17
- license: "MIT",
18
- repository: {
19
- type: "git",
20
- url: "git+https://github.com/sandiiarov/skill-creator.git"
21
- },
22
- bin: {
23
- "skill-creator": "dist/cli/main.js"
24
- },
25
- files: [
26
- "dist",
27
- "skills",
28
- "prompts",
29
- "LICENSE",
30
- "README.md"
31
- ],
32
- type: "module",
33
- scripts: {
34
- build: "tsup",
35
- dev: "tsx src/cli/main.ts",
36
- fmt: "oxfmt",
37
- "fmt:check": "oxfmt --check",
38
- lint: "oxlint",
39
- "lint:fix": "oxlint --fix",
40
- test: "vitest run",
41
- "test:watch": "vitest",
42
- typecheck: "tsc --noEmit"
43
- },
44
- dependencies: {
45
- "@apidevtools/json-schema-ref-parser": "^14.2.1",
46
- "@graphql-tools/graphql-file-loader": "^8.1.14",
47
- "@graphql-tools/json-file-loader": "^8.0.28",
48
- "@graphql-tools/load": "^8.1.10",
49
- "@graphql-tools/url-loader": "^9.1.2",
50
- "@modelcontextprotocol/sdk": "^1.23.0",
51
- ajv: "^8.20.0",
52
- "ajv-formats": "^3.0.1",
53
- cacache: "^21.0.0",
54
- graphql: "^16.14.0",
55
- "graphql-request": "^7.4.0",
56
- ky: "^2.0.2",
57
- minimatch: "^10.1.1",
58
- "string-argv": "^0.3.2",
59
- yaml: "^2.8.1",
60
- zod: "^4.1.13"
61
- },
62
- devDependencies: {
63
- "@types/cacache": "^20.0.1",
64
- "@types/node": "^24.10.1",
65
- execa: "^9.6.0",
66
- oxfmt: "^0.51.0",
67
- oxlint: "^1.66.0",
68
- tsup: "^8.5.1",
69
- tsx: "^4.20.6",
70
- typescript: "^5.9.3",
71
- vitest: "^4.0.14"
72
- },
73
- engines: {
74
- node: ">=20"
75
- },
76
- packageManager: "pnpm@10.1.0",
77
- pi: {
78
- skills: [
79
- "./skills"
80
- ],
81
- prompts: [
82
- "./prompts"
83
- ]
84
- }
85
- };
86
- export {
87
- package_default as default
88
- };
89
- //# sourceMappingURL=package-SLCRJ4QY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../package.json"],"sourcesContent":["{\n \"name\": \"@asnd/skill-creator\",\n \"version\": \"0.1.2\",\n \"description\": \"Turn any MCP server, OpenAPI spec, or GraphQL endpoint into a CLI at runtime.\",\n \"keywords\": [\n \"graphql\",\n \"mcp\",\n \"openapi\",\n \"pi-package\",\n \"skills\"\n ],\n \"homepage\": \"https://github.com/sandiiarov/skill-creator#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/sandiiarov/skill-creator/issues\"\n },\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/sandiiarov/skill-creator.git\"\n },\n \"bin\": {\n \"skill-creator\": \"dist/cli/main.js\"\n },\n \"files\": [\n \"dist\",\n \"skills\",\n \"prompts\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsx src/cli/main.ts\",\n \"fmt\": \"oxfmt\",\n \"fmt:check\": \"oxfmt --check\",\n \"lint\": \"oxlint\",\n \"lint:fix\": \"oxlint --fix\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@apidevtools/json-schema-ref-parser\": \"^14.2.1\",\n \"@graphql-tools/graphql-file-loader\": \"^8.1.14\",\n \"@graphql-tools/json-file-loader\": \"^8.0.28\",\n \"@graphql-tools/load\": \"^8.1.10\",\n \"@graphql-tools/url-loader\": \"^9.1.2\",\n \"@modelcontextprotocol/sdk\": \"^1.23.0\",\n \"ajv\": \"^8.20.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"cacache\": \"^21.0.0\",\n \"graphql\": \"^16.14.0\",\n \"graphql-request\": \"^7.4.0\",\n \"ky\": \"^2.0.2\",\n \"minimatch\": \"^10.1.1\",\n \"string-argv\": \"^0.3.2\",\n \"yaml\": \"^2.8.1\",\n \"zod\": \"^4.1.13\"\n },\n \"devDependencies\": {\n \"@types/cacache\": \"^20.0.1\",\n \"@types/node\": \"^24.10.1\",\n \"execa\": \"^9.6.0\",\n \"oxfmt\": \"^0.51.0\",\n \"oxlint\": \"^1.66.0\",\n \"tsup\": \"^8.5.1\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"vitest\": \"^4.0.14\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"packageManager\": \"pnpm@10.1.0\",\n \"pi\": {\n \"skills\": [\n \"./skills\"\n ],\n \"prompts\": [\n \"./prompts\"\n ]\n }\n}\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,EACX,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,KAAO;AAAA,IACL,iBAAiB;AAAA,EACnB;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,SAAW;AAAA,IACT,OAAS;AAAA,IACT,KAAO;AAAA,IACP,KAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAQ;AAAA,IACR,YAAY;AAAA,IACZ,MAAQ;AAAA,IACR,cAAc;AAAA,IACd,WAAa;AAAA,EACf;AAAA,EACA,cAAgB;AAAA,IACd,uCAAuC;AAAA,IACvC,sCAAsC;AAAA,IACtC,mCAAmC;AAAA,IACnC,uBAAuB;AAAA,IACvB,6BAA6B;AAAA,IAC7B,6BAA6B;AAAA,IAC7B,KAAO;AAAA,IACP,eAAe;AAAA,IACf,SAAW;AAAA,IACX,SAAW;AAAA,IACX,mBAAmB;AAAA,IACnB,IAAM;AAAA,IACN,WAAa;AAAA,IACb,eAAe;AAAA,IACf,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,iBAAmB;AAAA,IACjB,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,OAAS;AAAA,IACT,OAAS;AAAA,IACT,QAAU;AAAA,IACV,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,YAAc;AAAA,IACd,QAAU;AAAA,EACZ;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,gBAAkB;AAAA,EAClB,IAAM;AAAA,IACJ,QAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,SAAW;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,22 +0,0 @@
1
- ---
2
- description: Generate a new Agent/Pi skill from an MCP server, OpenAPI spec, or GraphQL endpoint
3
- argument-hint: '<--mcp URL|--mcp-stdio CMD|--spec URL|FILE|--graphql URL> [skill-name] [destination]'
4
- ---
5
-
6
- Generate a new Agent/Pi skill from this API source:
7
-
8
- ```txt
9
- $ARGUMENTS
10
- ```
11
-
12
- Use this workflow:
13
-
14
- 1. If the source, desired skill name, auth requirements, or destination is unclear, ask only the minimum follow-up questions.
15
- 2. Read and follow the `skill-creator` skill instructions. If the skill is not already loaded, load `/skill:skill-creator` or read the local `skills/skill-creator/SKILL.md` when present.
16
- 3. Use `skill-creator` to discover commands with `--list` or `--search`, inspect important commands with `<command> --help`, and test representative read-only calls first.
17
- 4. Create a focused `SKILL.md` for the target API.
18
- - Default destination: `.pi/skills/<kebab-case-skill-name>/SKILL.md`.
19
- - Use a user-provided destination if one is included in the arguments.
20
- 5. Include only tested workflows, practical examples, auth/secret handling, pagination/field-selection notes, and important gotchas.
21
- 6. Do not duplicate the entire CLI help output. Do not execute write/delete/destructive API operations unless the user explicitly requested them.
22
- 7. Validate the generated skill structure and frontmatter before finishing.
@@ -1,260 +0,0 @@
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.