Plugins

Eleven·2026년 4월 16일

Hello, Claude Code

목록 보기
9/11

요약

Plugin은 지금까지 배운 Commands, Subagents, Skills, Hooks, MCP를 하나의 폴더로 묶어서 팀에 배포하는 패키지다. 개별 설정 파일들을 하나씩 공유하는 대신, /plugin install 이름 한 줄로 전체 워크플로우를 설치할 수 있다.


개념 정리

Plugin이 없을 때 vs 있을 때

Plugin 없음  →  팀원에게 이렇게 안내해야 함:
  "code-reviewer.md는 .claude/agents/에 넣고,
   security-gate.sh는 ~/.claude/hooks/에 넣고,
   settings.json에 이렇게 추가하고,
   GitHub MCP 설정은 이렇게 하고..."

Plugin 있음  →  한 줄로 끝:
  /plugin install pr-review

Plugin 폴더 구조

my-plugin/
├── .claude-plugin/
│   └── plugin.json      ← 플러그인 메타데이터 (이름, 버전, 설명)
├── commands/            ← Slash Commands
│   └── review-pr.md
├── agents/              ← Subagents
│   └── code-reviewer.md
├── skills/              ← Skills
│   └── code-review/
├── hooks/               ← Hooks 설정
│   └── hooks.json
├── .mcp.json            ← MCP 서버 설정
├── settings.json        ← 기본 설정값
└── README.md

각각 흩어져 있던 파일들이 하나의 폴더 안에 모인다.


plugin.json — 플러그인의 신분증

{
  "name": "pr-review",
  "version": "1.0.0",
  "description": "Complete PR review workflow with security, testing, and docs",
  "author": {
    "name": "Anthropic"
  },
  "license": "MIT"
}

설치 흐름

/plugin install pr-review 입력 시 자동으로:

플러그인 매니페스트 다운로드
    ↓
Commands → .claude/commands/ 에 설치
Subagents → .claude/agents/ 에 설치
MCP → settings.json 에 등록
Hooks → settings.json 에 등록
    ↓
전부 즉시 사용 가능 ✅

Plugin 관리 명령어

/plugin install pr-review      # 설치
/plugin list                   # 설치된 플러그인 목록
/plugin remove pr-review       # 제거
/plugin update pr-review       # 업데이트

레포 실습 파일 3개 (07-plugins/)

pr-review/          ← PR 리뷰 전체 워크플로우
devops-automation/  ← 배포 자동화
documentation/      ← 문서 생성 자동화

documentation 플러그인 내부 구조 예시:

documentation/
├── commands/
│   ├── generate-api-docs.md
│   ├── generate-readme.md
│   ├── sync-docs.md
│   └── validate-docs.md
├── agents/
│   ├── api-documenter.md
│   ├── code-commentator.md
│   └── example-generator.md
└── mcp/
    ├── github-docs-config.json
    └── slack-announce-config.json

이 플러그인 하나로 /generate-api-docs, /generate-readme 커맨드가 생기고, api-documenter 에이전트가 설치되고, GitHub + Slack MCP가 연결된다.


직접 만들어서 팀에 배포하는 흐름

# 1. 플러그인 폴더 생성
mkdir my-team-plugin
cd my-team-plugin

# 2. 메타데이터 파일 생성
mkdir .claude-plugin
echo '{"name":"my-team","version":"1.0.0"}' > .claude-plugin/plugin.json

# 3. 기존 파일들 복사해서 넣기
cp ../code-reviewer.md agents/
cp ../security-gate.sh hooks/

# 4. 로컬 테스트 (설치 전 검증)
claude --plugin-dir ./my-team-plugin

# 5. GitHub에 올려서 팀과 공유
git push

지금까지 배운 것들과의 관계

개별 파일                Plugin 내부 위치
─────────────           ──────────────────
Slash Commands    →     commands/ 폴더
Subagents         →     agents/ 폴더
Skills            →     skills/ 폴더
Hooks             →     hooks/hooks.json
MCP               →     .mcp.json
CLAUDE.md         →     (Plugin에 포함 안 됨, 별도 관리)

실제 활용 예시 (/deploy production)

/deploy production 입력 시:
1. Pre-deploy Hook 실행 (환경 검증)
2. deployment-specialist Subagent에 위임
3. Kubernetes MCP로 배포 실행
4. 진행 상황 모니터링
5. Post-deploy Hook 실행 (헬스 체크)
6. 결과 리포트

이 전체 흐름이 devops-automation 플러그인 하나에 담겨 있다.


핵심 요약 (TL;DR)

  • Plugin = Commands + Subagents + Skills + Hooks + MCP를 하나로 묶은 배포 패키지
  • /plugin install 이름 한 줄로 전체 워크플로우 설치
  • plugin.json이 플러그인의 신분증 (이름, 버전, 설명)
  • --plugin-dir 플래그로 로컬 테스트 후 GitHub에 올려서 팀 배포
  • CLAUDE.md는 Plugin에 포함되지 않고 별도로 관리됨

다음에 알아볼 것

  • Module 03: Skills — 자동 감지 기반 재사용 워크플로우
  • Module 08: Checkpoints — 세션 스냅샷과 롤백
  • 실제 팀 플러그인 직접 만들어보기


[Series] Claude Code Fundamentals - Plugins

Summary

A Plugin is a package that bundles Commands, Subagents, Skills, Hooks, and MCP into a single folder for distribution to a team. Instead of sharing individual configuration files one by one, the entire workflow can be installed with a single line: /plugin install name.


Key Concepts

Without Plugin vs With Plugin

Without Plugin  →  Must guide teammates like this:
  "Put code-reviewer.md in .claude/agents/,
   put security-gate.sh in ~/.claude/hooks/,
   add this to settings.json,
   set up GitHub MCP like this..."

With Plugin  →  One line:
  /plugin install pr-review

Plugin Folder Structure

my-plugin/
├── .claude-plugin/
│   └── plugin.json      ← Plugin metadata (name, version, description)
├── commands/            ← Slash Commands
│   └── review-pr.md
├── agents/              ← Subagents
│   └── code-reviewer.md
├── skills/              ← Skills
│   └── code-review/
├── hooks/               ← Hooks configuration
│   └── hooks.json
├── .mcp.json            ← MCP server configuration
├── settings.json        ← Default settings
└── README.md

All previously scattered files are gathered into a single folder.


plugin.json — The Plugin's Identity Card

{
  "name": "pr-review",
  "version": "1.0.0",
  "description": "Complete PR review workflow with security, testing, and docs",
  "author": {
    "name": "Anthropic"
  },
  "license": "MIT"
}

Installation Flow

When /plugin install pr-review is entered:

Download plugin manifest
    ↓
Commands → installed to .claude/commands/
Subagents → installed to .claude/agents/
MCP → registered in settings.json
Hooks → registered in settings.json
    ↓
Everything ready to use immediately ✅

Plugin Management Commands

/plugin install pr-review      # Install
/plugin list                   # List installed plugins
/plugin remove pr-review       # Remove
/plugin update pr-review       # Update

Repo Practice Files (07-plugins/)

pr-review/          ← Complete PR review workflow
devops-automation/  ← Deployment automation
documentation/      ← Documentation generation automation

Example of the documentation plugin's internal structure:

documentation/
├── commands/
│   ├── generate-api-docs.md
│   ├── generate-readme.md
│   ├── sync-docs.md
│   └── validate-docs.md
├── agents/
│   ├── api-documenter.md
│   ├── code-commentator.md
│   └── example-generator.md
└── mcp/
    ├── github-docs-config.json
    └── slack-announce-config.json

This single plugin installs /generate-api-docs and /generate-readme commands, the api-documenter agent, and connects GitHub + Slack MCP — all at once.


Creating and Distributing Your Own Plugin

# 1. Create plugin folder
mkdir my-team-plugin
cd my-team-plugin

# 2. Create metadata file
mkdir .claude-plugin
echo '{"name":"my-team","version":"1.0.0"}' > .claude-plugin/plugin.json

# 3. Copy existing files into the plugin
cp ../code-reviewer.md agents/
cp ../security-gate.sh hooks/

# 4. Local test (validate before publishing)
claude --plugin-dir ./my-team-plugin

# 5. Push to GitHub to share with team
git push

Relationship with Everything Learned So Far

Individual File           Location Inside Plugin
─────────────            ──────────────────────
Slash Commands    →      commands/ folder
Subagents         →      agents/ folder
Skills            →      skills/ folder
Hooks             →      hooks/hooks.json
MCP               →      .mcp.json
CLAUDE.md         →      (Not in Plugin — managed separately)

Real-World Example (/deploy production)

When /deploy production is invoked:
1. Pre-deploy Hook runs (environment validation)
2. Delegates to deployment-specialist Subagent
3. Executes deployment via Kubernetes MCP
4. Monitors progress
5. Post-deploy Hook runs (health checks)
6. Reports status

This entire flow is contained in a single devops-automation plugin.


TL;DR

  • Plugin = Commands + Subagents + Skills + Hooks + MCP bundled into one deployable package
  • /plugin install name installs the entire workflow in one line
  • plugin.json is the plugin's identity card (name, version, description)
  • Use --plugin-dir flag for local testing, then push to GitHub for team distribution
  • CLAUDE.md is not included in Plugins — it is managed separately

0개의 댓글