Skip to content

Commit c7f63f8

Browse files
vnzclaude
andauthored
refactor(dependabot): restructure skill to recommended subdirectory format v1.3.0 (#10)
* refactor(dependabot): restructure skill to recommended subdirectory format v1.3.0 Migrate from legacy flat structure to modern subdirectory structure: - skills/dependabot.md → skills/dependabot/SKILL.md - Extract ecosystem tables to references/ecosystems.md This enables progressive disclosure - Claude loads SKILL.md first, then fetches reference files only when needed, reducing token usage. Structure now follows official Claude Code plugin best practices. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add dependabot to README and document skill structure in CLAUDE.md - Add dependabot plugin to Available Plugins table - Add install command example - Document recommended skill subdirectory structure in CLAUDE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(dependabot): remove redundant CLI behavior explanations Consolidate repeated explanations: - CLI outputs JSON / doesn't modify files (was in 3 places, now 1) - --local flag purpose (was in 2 places, now 1) Keep detailed explanation in Section 4, remove duplicates elsewhere. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(dependabot): consolidate remaining redundancies - Simplify Section 5: merge update detection into compact flow - Remove duplicate ecosystem.md reference (keep one in Section 2) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(dependabot): apply optional improvements from skill review - Add trigger phrases: "upgrade dependencies", "version updates" - Tighten --local flag explanation (save ~15 words) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cd6e086 commit c7f63f8

6 files changed

Lines changed: 79 additions & 57 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{
3030
"name": "dependabot",
3131
"description": "Check for dependency updates using Dependabot CLI with auto-detection of package managers",
32-
"version": "1.2.0",
32+
"version": "1.3.0",
3333
"source": "./plugins/dependabot",
3434
"category": "development",
3535
"author": {

CLAUDE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ Personal Claude Code plugin marketplace by vnz.
1313
4. Validate: `prek run --all-files`
1414
5. Commit and test: `/plugin install <name>@cc-plugins-vnz`
1515

16+
## Skill Structure (Recommended)
17+
18+
Use the subdirectory format for skills with reference files:
19+
20+
```
21+
skills/
22+
└── <skill-name>/
23+
├── SKILL.md # Main skill (required)
24+
└── references/ # Optional reference data
25+
└── <topic>.md
26+
```
27+
28+
This enables progressive disclosure — Claude loads SKILL.md first, then fetches reference files only when needed.
29+
1630
## Development
1731

1832
```bash

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ Personal Claude Code plugin marketplace by vnz.
2323
|--------|-------------|
2424
| `date-context` | Injects current date/time at session start to fix web search year issues |
2525
| `terraform-ls` | Terraform language server for code intelligence (go-to-definition, hover, diagnostics) |
26+
| `dependabot` | Check for dependency updates using Dependabot CLI with auto-detection of package managers |
2627

2728
## Usage
2829

2930
After adding the marketplace, install any plugin:
3031
```bash
3132
/plugin install date-context@cc-plugins-vnz
3233
/plugin install terraform-ls@cc-plugins-vnz
34+
/plugin install dependabot@cc-plugins-vnz
3335
```
3436

3537
## Development

plugins/dependabot/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dependabot",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Check for dependency updates using Dependabot CLI with auto-detection of package managers",
55
"license": "MIT",
66
"author": {

plugins/dependabot/skills/dependabot.md renamed to plugins/dependabot/skills/dependabot/SKILL.md

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
2-
description: This skill should be used when the user asks to "check dependencies", "find outdated packages", "scan for updates", "use dependabot", "run dependabot", "check for security updates", "what needs updating", or requests dependency scanning for specific ecosystems like npm, terraform, or github-actions. Supports scanning all ecosystems or specific ones with "use dependabot for <ecosystem>".
2+
name: dependabot
3+
description: This skill should be used when the user asks to "check dependencies", "find outdated packages", "scan for updates", "use dependabot", "run dependabot", "check for security updates", "upgrade dependencies", "version updates", "what needs updating", or requests dependency scanning for specific ecosystems like npm, terraform, or github-actions. Supports scanning all ecosystems or specific ones with "use dependabot for <ecosystem>".
34
---
45

56
# Dependabot Update Skill
67

78
Scan for dependency updates using the official Dependabot CLI and optionally create PRs for found updates.
89

10+
**Reference files:**
11+
- `references/ecosystems.md` - Complete list of supported ecosystems with aliases and detection methods
12+
913
## 1. Prerequisites Check
1014

1115
Before running, verify the required tools are installed:
@@ -36,48 +40,11 @@ Analyze the user's trigger phrase:
3640
- **"use dependabot for npm"** → Scan only `npm_and_yarn` ecosystem
3741
- **"use dependabot for github-actions"** or **"use dependabot for actions"** → Scan only `github_actions` ecosystem
3842

39-
Map common aliases to Dependabot CLI ecosystem values:
40-
| User Says | CLI Ecosystem |
41-
|-----------|---------------|
42-
| npm, yarn, pnpm | `npm_and_yarn` |
43-
| github-actions, actions, workflows | `github_actions` |
44-
| terraform, tf | `terraform` |
45-
| go, golang | `go_modules` |
46-
| python, pip, pipenv | `pip` |
47-
| ruby, bundler, gems | `bundler` |
48-
| rust, cargo | `cargo` |
49-
| docker | `docker` |
50-
| maven, java | `maven` |
51-
| gradle | `gradle` |
52-
| composer, php | `composer` |
53-
| nuget, dotnet, csharp | `nuget` |
54-
| helm | `helm` |
55-
| dart, flutter, pub | `pub` |
56-
| swift | `swift` |
57-
| elixir, hex | `hex` |
43+
See `references/ecosystems.md` for the complete alias mapping and detection methods.
5844

5945
## 3. Ecosystem Auto-Detection
6046

61-
If scanning all ecosystems, detect which are present using file existence checks:
62-
63-
| Ecosystem | CLI Value | Detection Method |
64-
|-----------|-----------|------------------|
65-
| GitHub Actions | `github_actions` | Glob: `.github/workflows/*.yml` or `.github/workflows/*.yaml` |
66-
| Terraform | `terraform` | Glob: `*.tf` or `**/*.tf` (check root and subdirs) |
67-
| npm/yarn/pnpm | `npm_and_yarn` | File exists: `package.json` |
68-
| Go | `go_modules` | File exists: `go.mod` |
69-
| Python (pip) | `pip` | File exists: `requirements.txt`, `pyproject.toml`, `Pipfile`, or `setup.py` |
70-
| Ruby | `bundler` | File exists: `Gemfile` |
71-
| Rust | `cargo` | File exists: `Cargo.toml` |
72-
| Docker | `docker` | Glob: `Dockerfile` or `*.dockerfile` or `docker-compose.yml` |
73-
| Maven | `maven` | File exists: `pom.xml` |
74-
| Gradle | `gradle` | File exists: `build.gradle` or `build.gradle.kts` |
75-
| Composer | `composer` | File exists: `composer.json` |
76-
| NuGet | `nuget` | Glob: `*.csproj` or `packages.config` or `*.fsproj` |
77-
| Helm | `helm` | File exists: `Chart.yaml` |
78-
| Pub (Dart) | `pub` | File exists: `pubspec.yaml` |
79-
| Swift | `swift` | File exists: `Package.swift` |
80-
| Hex (Elixir) | `hex` | File exists: `mix.exs` |
47+
If scanning all ecosystems, detect which are present using file existence checks.
8148

8249
Report detected ecosystems to the user before proceeding:
8350
> "Detected ecosystems: npm_and_yarn, github_actions, terraform"
@@ -102,32 +69,28 @@ Where `<ecosystem>` is the CLI ecosystem value (e.g., `npm_and_yarn`, `terraform
10269
**Understanding the output:**
10370
- The CLI outputs **JSON lines** (one JSON object per line), NOT human-readable tables
10471
- The CLI **never modifies files directly** - it only outputs data describing what would change
105-
- The `--local .` flag means "use local filesystem as source" — this prevents the CLI from cloning from GitHub and instead uses your working directory (it's NOT a "dry-run" flag)
72+
- The `--local .` flag uses your working directory instead of cloning from GitHub (NOT a "dry-run" flag)
10673
- Output can be very large (40KB+) - it may be truncated
10774
- **Important:** Use `2>&1` to capture both stdout and stderr, as the CLI mixes log messages (stderr) with JSON output (stdout)
10875

10976
## 5. Parse Results from JSON Output
11077

111-
The CLI outputs multiple JSON objects. Look for `create_pull_request` events to find updates:
78+
Filter the output for `create_pull_request` events — these contain the updates:
11279

11380
```bash
114-
# Filter for PR creation events (these contain the updates)
11581
<output> | grep '"type":"create_pull_request"'
11682
```
11783

84+
-**Updates found:** `create_pull_request` events in output
85+
-**No updates:** Only `mark_as_processed` events (grep returns nothing)
86+
11887
Each `create_pull_request` event contains:
11988
- `dependencies[].name` - Package name
12089
- `dependencies[].previous-version` - Current version
12190
- `dependencies[].version` - Available version
12291
- `pr-title` - Suggested PR title
12392
- `updated-dependency-files[]` - The actual file changes to apply
12493

125-
**Determining if updates exist:**
126-
-**Updates found:** One or more `create_pull_request` events in the output
127-
-**No updates:** Only `mark_as_processed` events appear (no `create_pull_request`)
128-
129-
This is the definitive way to check — if you grep for `create_pull_request` and get no results, that ecosystem is up-to-date.
130-
13194
## 6. Present Results
13295

13396
Summarize findings in a clear format:
@@ -179,8 +142,6 @@ Based on user's choice:
179142
```
180143

181144
2. **Apply changes manually:**
182-
The CLI doesn't modify files - you must apply the changes yourself.
183-
184145
From the `create_pull_request` JSON events, extract the `updated-dependency-files` array.
185146
Each entry contains:
186147
- `name` - The file path (e.g., `.github/workflows/ci.yml`)
@@ -223,9 +184,5 @@ Based on user's choice:
223184
## Important Notes
224185

225186
- Always use `gh auth token` for authentication - never ask for tokens directly
226-
- The CLI **outputs JSON describing changes** - it never modifies files directly
227-
- The `--local .` flag means "use local directory as repo source" (avoids cloning from GitHub)
228-
- Without `--local`, the CLI clones from GitHub but still doesn't modify your local files
229187
- Some ecosystems may require additional configuration (e.g., private registries)
230188
- If dependabot fails for an ecosystem, report the error and continue with others
231-
- JSON output can be 40KB+ - grep for `create_pull_request` to find relevant data
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Supported Ecosystems Reference
2+
3+
This file contains the complete mapping of user aliases to Dependabot CLI ecosystem values, and the detection methods for auto-discovery.
4+
5+
## Ecosystem Alias Mapping
6+
7+
Map common user phrases to Dependabot CLI ecosystem values:
8+
9+
| User Says | CLI Ecosystem |
10+
|-----------|---------------|
11+
| npm, yarn, pnpm | `npm_and_yarn` |
12+
| github-actions, actions, workflows | `github_actions` |
13+
| terraform, tf | `terraform` |
14+
| go, golang | `go_modules` |
15+
| python, pip, pipenv | `pip` |
16+
| ruby, bundler, gems | `bundler` |
17+
| rust, cargo | `cargo` |
18+
| docker | `docker` |
19+
| maven, java | `maven` |
20+
| gradle | `gradle` |
21+
| composer, php | `composer` |
22+
| nuget, dotnet, csharp | `nuget` |
23+
| helm | `helm` |
24+
| dart, flutter, pub | `pub` |
25+
| swift | `swift` |
26+
| elixir, hex | `hex` |
27+
28+
## Ecosystem Auto-Detection
29+
30+
Detect which ecosystems are present using file existence checks:
31+
32+
| Ecosystem | CLI Value | Detection Method |
33+
|-----------|-----------|------------------|
34+
| GitHub Actions | `github_actions` | Glob: `.github/workflows/*.yml` or `.github/workflows/*.yaml` |
35+
| Terraform | `terraform` | Glob: `*.tf` or `**/*.tf` (check root and subdirs) |
36+
| npm/yarn/pnpm | `npm_and_yarn` | File exists: `package.json` |
37+
| Go | `go_modules` | File exists: `go.mod` |
38+
| Python (pip) | `pip` | File exists: `requirements.txt`, `pyproject.toml`, `Pipfile`, or `setup.py` |
39+
| Ruby | `bundler` | File exists: `Gemfile` |
40+
| Rust | `cargo` | File exists: `Cargo.toml` |
41+
| Docker | `docker` | Glob: `Dockerfile` or `*.dockerfile` or `docker-compose.yml` |
42+
| Maven | `maven` | File exists: `pom.xml` |
43+
| Gradle | `gradle` | File exists: `build.gradle` or `build.gradle.kts` |
44+
| Composer | `composer` | File exists: `composer.json` |
45+
| NuGet | `nuget` | Glob: `*.csproj` or `packages.config` or `*.fsproj` |
46+
| Helm | `helm` | File exists: `Chart.yaml` |
47+
| Pub (Dart) | `pub` | File exists: `pubspec.yaml` |
48+
| Swift | `swift` | File exists: `Package.swift` |
49+
| Hex (Elixir) | `hex` | File exists: `mix.exs` |

0 commit comments

Comments
 (0)