一键导入
plugin-new
Scaffold a new Tyk AI Studio plugin with the plugin-scaffold tool. Use when the user wants to create a new plugin for Studio, Gateway, or as an Agent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new Tyk AI Studio plugin with the plugin-scaffold tool. Use when the user wants to create a new plugin for Studio, Gateway, or as an Agent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Restart a specific component in the development environment. Use when a service needs to be restarted after config changes, code changes, or if it's misbehaving. Components: studio, gateway, frontend, postgres, plugins.
Start, stop, or manage the Docker-based development environment for Tyk AI Studio. Use when the user wants to start the dev environment, stop it, check status, or clean up.
Fetch logs from development environment components for debugging. Use when investigating errors, checking startup status, or debugging issues. Components: studio, gateway, frontend, postgres, plugins, all.
Run unit tests, integration tests, or the full test suite for Tyk AI Studio. Use when the user wants to run tests, check test coverage, or verify code changes.
| name | plugin-new |
| description | Scaffold a new Tyk AI Studio plugin with the plugin-scaffold tool. Use when the user wants to create a new plugin for Studio, Gateway, or as an Agent. |
| argument-hint | <name> <type> [capabilities...] |
| allowed-tools | Bash |
Create a new Tyk AI Studio plugin using the plugin-scaffold tool.
name (required): Plugin name in kebab-case (e.g., my-rate-limiter)
type (required): Plugin type - one of:
studio - AI Studio control plane plugingateway - Microgateway data plane pluginagent - Conversational AI agentdata-collector - Telemetry and analytics plugincapabilities (optional): Comma-separated list of capabilities to include
| Capability | Studio | Gateway | Description |
|---|---|---|---|
pre_auth | ✓ | ✓ | Process requests before authentication |
auth | ✓ | ✓ | Custom authentication handler |
post_auth | ✓ | ✓ | Process requests after authentication (default) |
on_response | ✓ | ✓ | Modify response headers and body |
studio_ui | ✓ | - | Dashboard UI with WebComponents |
object_hooks | ✓ | - | Intercept CRUD operations |
data_collector | ✓ | ✓ | Telemetry collection handlers |
Before scaffolding, review existing implementations for patterns:
| Capability | Example Plugin | Path |
|---|---|---|
auth | custom-auth-ui | examples/plugins/studio/custom-auth-ui/server/main.go |
studio_ui | custom-auth-ui | examples/plugins/studio/custom-auth-ui/server/main.go |
object_hooks | hook-test-plugin | examples/plugins/studio/hook-test-plugin/main.go |
data_collector | file-analytics-collector | examples/plugins/data-collectors/file-analytics-collector/main.go |
post_auth + on_response | llm-rate-limiter-multiphase | examples/plugins/studio/llm-rate-limiter-multiphase/main.go |
First, ensure the scaffolding tool is built:
make tools
Then scaffold the plugin:
make plugin-new NAME=<name> TYPE=<type> [CAPABILITIES=<cap1,cap2>]
| Command | Description |
|---|---|
/plugin-new my-limiter studio | Basic studio plugin with post_auth |
/plugin-new my-cache studio post_auth,on_response,studio_ui | Multi-capability with UI |
/plugin-new my-filter gateway post_auth,on_response | Gateway plugin |
/plugin-new my-assistant agent | Conversational agent |
/plugin-new my-exporter data-collector | Telemetry collector |
# Build the scaffolding tool (run once)
make tools
# Show scaffolding help
make plugin-help
# Scaffold a new plugin
make plugin-new NAME=my-plugin TYPE=studio
make plugin-new NAME=my-plugin TYPE=studio CAPABILITIES=post_auth,on_response,studio_ui
# Build all plugins
make plugins
| Type | Output Directory |
|---|---|
studio | examples/plugins/studio/<name>/ |
gateway | examples/plugins/gateway/<name>/ |
agent | examples/plugins/studio/<name>/server/ |
data-collector | examples/plugins/data-collectors/<name>/ |
Build the plugin:
cd examples/plugins/studio/<name>
go mod tidy
go build -o <name>
Start dev environment with plugin watcher:
make dev-full
Register in Admin UI:
file:///app/examples/plugins/studio/<name>/<name>After scaffolding, verify:
pkg/plugin_sdk/capabilities.goproto/plugin.proto if unsurego build -o <name> in the plugin directorymake plugin-newmake plugin-help for the full scaffolding documentationmy-rate-limiter)cmd/plugin-scaffold/README.md for detailed documentation