Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

creating-a-plugin创建插件

Agent Skill

creating-a-plugin 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

269

周安装

11

GitHub Stars

176

下载量

86
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:creating-a-plugin(创建插件)
来源仓库:https://github.com/ed3dai/ed3d-plugins
仓库路径:skills/creating-a-plugin
安装命令:
npx skills add https://github.com/ed3dai/ed3d-plugins --skill creating-a-plugin
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ed3dai/ed3d-plugins --skill creating-a-plugin

简介

该技能指导如何打包和分发跨项目的可复用组件,包括命令、代理、钩子等。

  • 适用于拥有通用功能模块并希望标准化发布到用户级或项目级插件目录时。
  • 支持开发阶段任意位置安装,最终可部署至 ~/.claude/plugins/ 或 .claude/plugins/。
  • 安装方式:GitHub 仓库,使用 npx 命令添加;注意插件结构与分发规范遵循。
  • creating-a-plugin 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Creating a Plugin

Overview

A Claude Code plugin packages reusable components (commands, agents, skills, hooks, MCP servers) for distribution. Create a plugin when you have components that work across multiple projects.

Don't create a plugin for:

  • Project-specific configurations (use .claude/ in project root)
  • One-off scripts or commands
  • Experimental features still in development

Plugin storage locations:

  • Development: Anywhere during development, installed via file:/// path
  • User-level: ~/.claude/plugins/ (after installation)
  • Project-level: .claude/plugins/ (project-specific installations)

Quick Start Checklist

Minimal viable plugin:

  1. Create directory: my-plugin/
  2. Create .claude-plugin/plugin.json with at minimum: {"name": "my-plugin"}
  3. Add components (commands, agents, skills, hooks, or MCP servers)
  4. Test locally: /plugin install file:///absolute/path/to/my-plugin
  5. Reload: /plugin reload

Directory Structure

my-plugin/
�� .claude-plugin/
   �� plugin.json              # Required: plugin manifest
�� commands/                    # Optional: slash commands
   �� my-command.md
�� agents/                      # Optional: specialized subagents
   �� my-agent.md
�� skills/                      # Optional: reusable techniques
   �� my-skill/
       �� SKILL.md
�� hooks/                       # Optional: event handlers
   �� hooks.json
�� .mcp.json                    # Optional: MCP server configs
�� README.md                    # Recommended: documentation

Critical: The .claude-plugin/ directory with plugin.json inside must exist at plugin root.

Component Reference

ComponentLocationFile FormatWhen to Use
Commandscommands/*.mdMarkdown + YAML frontmatterCustom slash commands for repetitive tasks
Agentsagents/*.mdMarkdown + YAML frontmatterSpecialized subagents for complex workflows
Skillsskills/*/SKILL.mdMarkdown + YAML frontmatterReusable techniques and patterns
Hookshooks/hooks.jsonJSONEvent handlers (format code, validate, etc.)
MCP Servers.mcp.jsonJSONExternal tool integrations

plugin.json Format

Minimal valid manifest:

{
  "name": "my-plugin"
}

Complete annotated manifest:

{
  "name": "my-plugin",                    // Required: kebab-case identifier
  "version": "1.0.0",                     // Recommended: semantic versioning
  "description": "What this plugin does", // Recommended: brief description

  "author": {                             // Optional but recommended
    "name": "Your Name",
    "email": "you@example.com",
    "url": "https://github.com/yourname"
  },

  "homepage": "https://github.com/yourname/my-plugin",
  "repository": "https://github.com/yourname/my-plugin",
  "license": "MIT",
  "keywords": ["productivity", "automation"],

  "commands": [                           // Optional: explicit command paths
    "./commands/cmd1.md",
    "./commands/cmd2.md"
  ],

  "agents": [                             // Optional: explicit agent paths
    "./agents/agent1.md"
  ],

  "hooks": [                              // Optional: inline hooks
    {
      "event": "PostToolUse",
      "matcher": "Edit|Write",
      "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\""
    }
  ],

  "mcpServers": {                         // Optional: inline MCP configs
    "my-server": {
      "command": "${CLAUDE_PLUGIN_ROOT}/servers/my-server",
      "args": ["--port", "8080"],
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

Key points:

  • name is required, everything else is optional
  • Use ${CLAUDE_PLUGIN_ROOT} to reference plugin directory
  • Commands/agents auto-discovered from commands/ and agents/ directories if not listed explicitly
  • Skills auto-discovered from skills/*/SKILL.md pattern

Creating Commands

File location: commands/my-command.md creates /my-command slash command

Nested commands: commands/feature/sub-command.md creates /plugin-name:feature:sub-command

Template:

---
description: Brief description of what this command does
allowed-tools: Read, Grep, Glob, Bash
model: sonnet
argument-hint: "[file-path]"
---

# Command Name

Your command prompt goes here.

You can use:
- $1, $2, etc. for positional arguments
- $ARGUMENTS for all arguments as single string
- @filename to include file contents
- !bash command to execute shell commands

Example implementation instructions...

Frontmatter fields:

  • description - Brief description shown in /help
  • allowed-tools - Comma-separated list: Read, Grep, Glob, Bash, Edit, Write, TodoWrite, Task
  • model - Optional: haiku, sonnet, or opus (defaults to user's setting)
  • argument-hint - Optional: shown in help text
  • disable-model-invocation - Optional: true to prevent auto-run

Complete example (commands/review-pr.md):

---
description: Review pull request for security and best practices
allowed-tools: Read, Grep, Glob, Bash
model: opus
argument-hint: "[pr-number]"
---

# Pull Request Review

Review pull request #$1 for:

1. Security vulnerabilities
2. Performance issues
3. Best practices compliance
4. Error handling

Steps:
1. Use Bash to run: gh pr diff $1
2. Use Read to examine changed files
3. Use Grep to search for common anti-patterns
4. Provide structured feedback with file:line references

Focus on critical issues first.

Creating Agents

File location: agents/code-reviewer.md creates agent named "code-reviewer"

Template:

---
name: agent-name
description: When and why to use this agent (critical for auto-delegation)
tools: Read, Edit, Write, Grep, Glob, Bash
model: opus
---

# Agent Name

Detailed instructions and system prompt for this agent.

## Responsibilities
- Task 1
- Task 2

## Tools Available
- Read: File operations
- Grep: Code search
- Bash: Shell commands

## Workflow
1. Step 1
2. Step 2

Frontmatter fields:

  • name - Required: kebab-case identifier
  • description - Required: Max 1024 chars, used for auto-delegation
  • tools - Comma-separated list of allowed tools
  • model - Optional: haiku, sonnet, or opus

Complete example (agents/security-auditor.md):

---
name: security-auditor
description: Use when reviewing code for security vulnerabilities, analyzing authentication flows, or checking for common security anti-patterns like SQL injection, XSS, or insecure dependencies
tools: Read, Grep, Glob, Bash
model: opus
---

# Security Auditor Agent

You are a security expert specializing in web application security and secure coding practices.

## Your Responsibilities

1. Identify security vulnerabilities (SQL injection, XSS, CSRF, etc.)
2. Review authentication and authorization logic
3. Check for insecure dependencies
4. Verify input validation and sanitization
5. Review cryptographic implementations

## Workflow

1. **Scan for patterns:** Use Grep to find common vulnerability patterns
2. **Read suspicious code:** Use Read to examine flagged files
3. **Check dependencies:** Use Bash to run security audit tools
4. **Report findings:** Provide severity ratings and remediation steps

## Common Vulnerability Patterns

- SQL injection: String concatenation in queries
- XSS: Unescaped user input in templates
- CSRF: Missing CSRF tokens
- Auth bypass: Missing authorization checks
- Hardcoded secrets: API keys, passwords in code

## Reporting Format

For each finding:
- **Severity:** Critical/High/Medium/Low
- **Location:** `file:line`
- **Issue:** What's vulnerable
- **Impact:** What attacker could do
- **Fix:** How to remediate

Creating Skills

REQUIRED SUB-SKILL: Use writing-skills for complete guidance on skill structure, testing, and deployment.

Skills follow a specific structure.

File location: skills/my-skill/SKILL.md

Minimal template:

---
name: my-skill-name
description: Use when [specific triggers] - [what it does]
---

# Skill Name

## Overview
Core principle in 1-2 sentences.

## When to Use
- Symptom 1
- Symptom 2
- When NOT to use

## Quick Reference
[Table or bullets for common operations]

## Implementation
[Code examples, patterns]

## Common Mistakes
[What goes wrong + fixes]

Key principles:

  • name uses only letters, numbers, hyphens (no special chars)
  • description starts with "Use when..." in third person
  • Keep token-efficient (<500 words if frequently loaded)
  • One excellent example beats many mediocre ones
  • Use writing-skills skill for complete guidance

Creating Hooks

File location: hooks/hooks.json or inline in plugin.json

Standalone hooks file:

{
  "hooks": [
    {
      "event": "PreToolUse",
      "matcher": "Bash",
      "command": "echo 'About to run: $CLAUDE_TOOL_NAME'"
    },
    {
      "event": "PostToolUse",
      "matcher": "Edit|Write",
      "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\""
    },
    {
      "event": "SessionStart",
      "matcher": "*",
      "command": "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh"
    }
  ]
}

Hook events:

  • PreToolUse - Before tool execution (can block)
  • PostToolUse - After tool execution
  • UserPromptSubmit - When user submits prompt
  • Stop - When Claude finishes responding
  • SessionStart - Session initialization
  • SessionEnd - Session cleanup
  • Notification - On Claude Code notifications
  • SubagentStop - When subagent completes
  • PreCompact - Before context compaction

Matcher patterns:

  • Specific tool: "Bash"
  • Multiple tools: "Edit|Write"
  • All tools: "*"

Environment variables:

  • $CLAUDE_EVENT_TYPE - Event type
  • $CLAUDE_TOOL_NAME - Tool being used
  • $CLAUDE_TOOL_INPUT - Tool input (JSON)
  • $CLAUDE_FILE_PATHS - Space-separated file paths

Creating MCP Server Configs

File location: .mcp.json at plugin root or inline in plugin.json

Standalone.mcp.json:

{
  "mcpServers": {
    "database-tools": {
      "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
      "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
      "env": {
        "DB_URL": "${DB_URL}",
        "API_KEY": "${API_KEY:-default-key}"
      }
    },
    "web-scraper": {
      "command": "npx",
      "args": ["web-mcp-server", "--port", "3000"]
    }
  }
}

Configuration fields:

  • command - Executable path or command name
  • args - Array of arguments
  • env - Environment variables (supports ${VAR} or ${VAR:-default})

Special variable:

  • ${CLAUDE_PLUGIN_ROOT} - Resolves to plugin root directory

Setting Up Dev Marketplace

For local development, create a marketplace to organize your plugins:

File: dev-marketplace/.claude-plugin/marketplace.json

{
  "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  "name": "my-dev-marketplace",
  "version": "1.0.0",
  "owner": {
    "name": "Your Name",
    "email": "you@example.com"
  },
  "metadata": {
    "description": "Local development marketplace for my plugins",
    "pluginRoot": "./plugins"
  },
  "plugins": [
    {
      "name": "my-plugin-one",
      "version": "1.0.0",
      "description": "What this plugin does",
      "source": "./plugins/my-plugin-one",
      "category": "development",
      "author": {
        "name": "Your Name",
        "email": "you@example.com"
      }
    },
    {
      "name": "my-plugin-two",
      "version": "0.1.0",
      "description": "Experimental plugin",
      "source": "./plugins/my-plugin-two",
      "category": "productivity",
      "strict": false
    }
  ]
}

Directory structure:

dev-marketplace/
�� .claude-plugin/
   �� marketplace.json
�� plugins/
    �� my-plugin-one/
       �� .claude-plugin/
          �� plugin.json
       �� commands/
    �� my-plugin-two/
        �� .claude-plugin/
           �� plugin.json
        �� agents/

Install dev marketplace:

/plugin marketplace add file:///absolute/path/to/dev-marketplace
/plugin browse
/plugin install my-plugin-one@my-dev-marketplace

Plugin entry fields:

  • name - Required: plugin identifier
  • source - Required: relative path or git URL
  • version - Recommended: semantic version
  • description - Recommended: brief description
  • category - Optional: development, productivity, security, etc.
  • author - Optional: author details
  • strict - Optional: default true (requires plugin.json), set false to use marketplace entry as manifest

Source formats:

// Local relative path
"source": "./plugins/my-plugin"

// GitHub repository
"source": {
  "source": "github",
  "repo": "owner/repo"
}

// Git URL
"source": {
  "source": "url",
  "url": "https://gitlab.com/team/plugin.git"
}

Naming Conventions

Use kebab-case everywhere:

  • Plugin names: my-awesome-plugin
  • Command names: review-code
  • Agent names: security-auditor
  • Skill names: test-driven-development

Filename mapping:

  • commands/my-command.md/my-command
  • commands/project/build.md/plugin-name:project:build
  • agents/code-reviewer.md � agent name code-reviewer
  • skills/my-skill/SKILL.md � skill name my-skill

Testing Locally

Development workflow:

  1. Create plugin structure: mkdir -p my-plugin/.claude-plugin echo '{"name":"my-plugin"}' > my-plugin/.claude-plugin/plugin.json
  2. Add components (commands, agents, skills)
  3. Install locally: /plugin install file:///absolute/path/to/my-plugin
  4. Test functionality: /my-command arg1 arg2 # Use Task tool with your agent # Use Skill tool with your skill
  5. Iterate:

- Edit plugin files - Run /plugin reload - Test again

Using dev marketplace:

  1. Create marketplace structure
  2. Add marketplace: /plugin marketplace add file:///absolute/path/to/dev-marketplace
  3. Browse and install: /plugin browse /plugin install my-plugin@my-dev-marketplace

Common Mistakes

IssueSymptomFix
Missing .claude-plugin/Plugin not recognizedCreate .claude-plugin/plugin.json at root
Invalid plugin.jsonParse error on loadValidate JSON syntax, ensure name field exists
Wrong tool nameTool not available in command/agentCheck spelling: Read, Grep, Glob, Bash, Edit, Write
Description too longWarning or truncationKeep under 1024 characters total
Not using third personDescription sounds wrongUse "Use when..." not "I will..."
Absolute paths in plugin.jsonBreaks on other machinesUse relative paths or ${CLAUDE_PLUGIN_ROOT}
Forgetting /plugin reloadChanges not visibleRun /plugin reload after edits
Command not foundSlash command doesn't workCheck filename matches expected command, reload plugin
Agent not auto-delegatedAgent never gets usedImprove description with specific triggers and symptoms

Distribution

For production/team use:

  1. Push plugin to Git repository (GitHub, GitLab, etc.)
  2. Create or update team's marketplace repository
  3. Add plugin entry to marketplace.json
  4. Team members install: /plugin marketplace add user-or-org/marketplace-repo /plugin install plugin-name@marketplace-name

For public distribution:

Refer to official Claude Code documentation for publishing to public marketplaces.

Reference Links

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.01%
按下载量换算30

Claude

30.25%
按下载量换算26

Cursor

21.27%
按下载量换算18

Gemini CLI

9.24%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/ed3dai/ed3d-plugins --skill creating-a-plugin 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills