@schalkneethling/calavera-skill-more-secure-dependabot-config 0.2.0-next.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Schalk Neethling
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://calavera.schalkneethling.com/schemas/calavera-artifact.schema.json",
3
+ "schemaVersion": 1,
4
+ "id": "skill-more-secure-dependabot-config",
5
+ "type": "skill",
6
+ "displayName": "More secure Dependabot config",
7
+ "payload": "payload/more-secure-dependabot-config",
8
+ "compatibility": {
9
+ "calavera": ">=2.2.0 <3"
10
+ }
11
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@schalkneethling/calavera-skill-more-secure-dependabot-config",
3
+ "version": "0.2.0-next.1",
4
+ "description": "More secure Dependabot config artifact for Calavera.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+ssh://git@github.com/schalkneethling/create-project-calavera.git",
9
+ "directory": "packages/artifacts/skill-more-secure-dependabot-config"
10
+ },
11
+ "files": [
12
+ "calavera-artifact.json",
13
+ "payload"
14
+ ],
15
+ "type": "module",
16
+ "exports": {
17
+ ".": "./calavera-artifact.json",
18
+ "./package.json": "./package.json"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "provenance": true
23
+ }
24
+ }
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: dependabot-config
3
+ description: >
4
+ Generate or update Dependabot configuration files for projects. Use this skill
5
+ whenever the user asks to add, create, update, configure, or fix Dependabot for
6
+ a project — including phrases like "set up Dependabot", "add Dependabot config",
7
+ "update my dependabot.yml", "enable Dependabot updates", or "configure automated
8
+ dependency updates". Always apply this skill even if the user only mentions one
9
+ ecosystem (e.g. "add Dependabot for npm") — the canonical config covers all
10
+ required ecosystems.
11
+ ---
12
+
13
+ # Dependabot Configuration Skill
14
+
15
+ Produces the canonical `.github/dependabot.yml` configuration for any project.
16
+ Always emit the complete canonical config, never a partial one, unless the user
17
+ explicitly overrides a specific field after reviewing it.
18
+
19
+ ---
20
+
21
+ ## Canonical Configuration
22
+
23
+ The authoritative configuration to emit is:
24
+
25
+ ```yaml
26
+ version: 2
27
+ updates:
28
+ - package-ecosystem: "npm"
29
+ directory: "/"
30
+ schedule:
31
+ interval: "daily"
32
+ cooldown:
33
+ default-days: 7
34
+ semver-major-days: 7
35
+ semver-minor-days: 3
36
+ semver-patch-days: 2
37
+ include:
38
+ - "*"
39
+
40
+ - package-ecosystem: "github-actions"
41
+ directory: "/"
42
+ schedule:
43
+ interval: "daily"
44
+ cooldown:
45
+ default-days: 7
46
+ include:
47
+ - "*"
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Cooldown Rationale
53
+
54
+ Document this to the user when relevant:
55
+
56
+ | Field | Value | Reasoning |
57
+ | ------------------- | ----- | ------------------------------------------------------ |
58
+ | `default-days` | 7 | Catch-all safety buffer for uncategorised updates |
59
+ | `semver-major-days` | 7 | Breaking changes warrant the longest review window |
60
+ | `semver-minor-days` | 3 | New features; moderate confidence, shorter delay |
61
+ | `semver-patch-days` | 2 | Bug/security fixes; high confidence, fast-track |
62
+ | `include: ["*"]` | — | Apply cooldown rules to all packages without exception |
63
+
64
+ ---
65
+
66
+ ## Workflow
67
+
68
+ ### 1. Identify context
69
+
70
+ - Determine whether a `.github/dependabot.yml` already exists in the project.
71
+ - **Exists**: read the file, explain any differences from the canonical config,
72
+ and check whether the file is Calavera-managed or its installed hash matches
73
+ the recorded Calavera state. Only overwrite it with a file tool when those
74
+ managed-file safety conditions are satisfied. If the file is unmanaged or
75
+ has local edits, report the differences and do not force a write.
76
+ - **Does not exist**: create `.github/dependabot.yml` with the canonical config
77
+ using a file tool.
78
+
79
+ ### 2. Check for non-npm ecosystems
80
+
81
+ If the project uses additional package ecosystems (e.g. `pip`, `cargo`, `bundler`,
82
+ `docker`, `composer`), add an additional `updates` block per ecosystem using the
83
+ same schedule. Keep `npm` and `github-actions` blocks unchanged. Apply
84
+ semver-specific cooldown fields only to semver-capable ecosystems; omit those
85
+ cooldown fields for ecosystems such as `docker` and `composer`. Use the
86
+ references file for additional ecosystem identifiers if needed.
87
+
88
+ ### 3. Handle directory variations
89
+
90
+ If the user's project has packages in subdirectories (e.g. a monorepo), ask which
91
+ directories need coverage and emit one block per directory per ecosystem, keeping
92
+ all other fields from the canonical config intact.
93
+
94
+ ### 4. Write the file
95
+
96
+ Write the config directly to `.github/dependabot.yml` in the project root using a
97
+ file tool — do not present it as a fenced code block for the user to copy manually.
98
+ Ensure the `.github/` directory exists before writing.
99
+
100
+ After writing, confirm the file path to the user and follow with a concise
101
+ explanation of what was configured and why — particularly the cooldown strategy —
102
+ without repeating every field verbatim.
103
+
104
+ ---
105
+
106
+ ## Constraints
107
+
108
+ - **Never omit the `cooldown` block** from any ecosystem entry.
109
+ - **`semver-*` cooldown fields are only valid for package managers that use semver** (e.g. `npm`, `pip`, `cargo`). Do not include `semver-major-days`, `semver-minor-days`, or `semver-patch-days` for `github-actions` or any other non-semver ecosystem — Dependabot will reject the config.
110
+ - **Never change the canonical values** unless the user explicitly requests it and
111
+ provides a reason (e.g. a monorepo with a stricter release cadence).
112
+ - **Always include `github-actions`** as an ecosystem, even if the user only asked
113
+ about npm or another runtime ecosystem.
114
+ - **YAML formatting**: two-space indentation, string values quoted, list items with
115
+ `-` prefix. Validate indentation before emitting — malformed YAML is a silent
116
+ failure in Dependabot.
117
+
118
+ ---
119
+
120
+ ## Reference
121
+
122
+ See `references/ecosystem.md` for the full list of Dependabot-supported
123
+ `package-ecosystem` identifiers and their directory conventions.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Secure Dependabot Config"
3
+ short_description: "Create a safer Dependabot update configuration."
4
+ default_prompt: "Use $dependabot-config to improve this Dependabot configuration."
@@ -0,0 +1,52 @@
1
+ # Dependabot Package Ecosystem Identifiers
2
+
3
+ Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4
+
5
+ | Identifier | Ecosystem | Manifest file(s) |
6
+ | ---------------- | -------------------------- | ------------------------------------ |
7
+ | `npm` | npm / Yarn / pnpm | `package.json` |
8
+ | `pip` | pip / Poetry / pip-compile | `requirements.txt`, `pyproject.toml` |
9
+ | `cargo` | Rust / Cargo | `Cargo.toml` |
10
+ | `bundler` | Ruby / Bundler | `Gemfile` |
11
+ | `composer` | PHP / Composer | `composer.json` |
12
+ | `docker` | Docker | `Dockerfile` |
13
+ | `gradle` | Java / Gradle | `build.gradle`, `build.gradle.kts` |
14
+ | `maven` | Java / Maven | `pom.xml` |
15
+ | `gomod` | Go modules | `go.mod` |
16
+ | `nuget` | .NET / NuGet | `*.csproj`, `packages.config` |
17
+ | `github-actions` | GitHub Actions workflows | `.github/workflows/*.yml` |
18
+ | `terraform` | Terraform | `*.tf` |
19
+ | `elm` | Elm | `elm.json` |
20
+ | `pub` | Dart / Flutter | `pubspec.yaml` |
21
+ | `swift` | Swift Package Manager | `Package.swift` |
22
+ | `bazel` | Bazel | `MODULE.bazel`, `WORKSPACE` |
23
+ | `bun` | Bun | `bun.lock` |
24
+ | `conda` | Conda | `environment.yml` |
25
+ | `deno` | Deno | `deno.json`, `deno.lock` |
26
+ | `devcontainers` | Dev containers | `.devcontainer.json` |
27
+ | `docker-compose` | Docker Compose | `compose.yml`, `docker-compose.yml` |
28
+ | `dotnet-sdk` | .NET SDK | `global.json` |
29
+ | `gitsubmodule` | Git submodules | `.gitmodules` |
30
+ | `helm` | Helm | `Chart.yaml` |
31
+ | `julia` | Julia | `Project.toml` |
32
+ | `mix` | Elixir / Hex | `mix.exs` |
33
+ | `nix` | Nix flakes | `flake.nix` |
34
+ | `opentofu` | OpenTofu | `*.tofu`, `.terraform.lock.hcl` |
35
+ | `pre-commit` | pre-commit | `.pre-commit-config.yaml` |
36
+ | `rust-toolchain` | Rust toolchain | `rust-toolchain.toml` |
37
+ | `sbt` | Scala / sbt | `build.sbt` |
38
+ | `uv` | uv | `pyproject.toml`, `uv.lock` |
39
+ | `vcpkg` | vcpkg | `vcpkg.json` |
40
+
41
+ ## Directory conventions
42
+
43
+ - Single-package project: `directory: "/"`
44
+ - Monorepo with packages in subdirectories: one block per directory, e.g.
45
+ `directory: "/packages/ui"`, `directory: "/packages/api"`
46
+ - Use `directories` for multiple locations; it supports `*` and recursive `**/*` glob patterns.
47
+ - Docker images referenced in a subdirectory: `directory: "/docker"`
48
+
49
+ ## Notes
50
+
51
+ - `github-actions` must use `directory: "/"`; Dependabot then scans `.github/workflows/` and root `action.yml`/`action.yaml` files.
52
+ - Multiple ecosystems in the same directory each require their own `updates` block.