بنقرة واحدة
create-megalinter-flavor
Create a new MegaLinter flavor image configuration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Create a new MegaLinter flavor image configuration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | create-megalinter-flavor |
| description | Create a new MegaLinter flavor image configuration |
| allowed-tools | ["Read","Write","Bash","AskUserQuestion"] |
| argument-hint | <name> [LINTER1,LINTER2,...] |
You are creating a new MegaLinter flavor image configuration. Follow these steps precisely.
Parse the arguments provided: $ARGUMENTS
ACTION_ACTIONLINT,MARKDOWN_MARKDOWNLINT)The name must:
^[a-z][a-z0-9-]*$ (lowercase, alphanumeric, hyphens, starts with letter)megalinter-<name>/Check for existing directory:
ls -d megalinter-<name>/ 2>/dev/null
If validation fails, inform the user and stop.
Run the extractor to get available linters from MegaLinter:
python megalinter-factory/megalinter_extractor.py 2>&1 | head -100
This extracts linter information directly from MegaLinter's descriptors.
If linters were provided as arguments, validate each one exists in MegaLinter (check extractor output).
Important: Some linters are already included in the ci_light base flavor. The extractor output shows ci_light has N linters - these DON'T need to be in custom_linters. Only add linters that aren't in the base flavor.
Linters already in ci_light (24 total):
NOT in ci_light (must be added as custom_linters):
Built-in linters requiring specific base flavors:
Some linters are built-in (no install needed) but require tools only available in specific base flavors:
| Linter | Required Base Flavor |
|---|---|
| TERRAFORM_TERRAFORM_FMT | terraform |
| CSHARP_DOTNET_FORMAT | dotnet or dotnetweb |
| VBDOTNET_DOTNET_FORMAT | dotnet or dotnetweb |
| SWIFT_SWIFTLINT | swift |
| GO_* linters | go |
| JAVA_* linters | java |
| PYTHON_* linters | python (or ci_light for some) |
| RUST_CLIPPY | rust |
If a user requests these linters with ci_light base, warn them they need to change upstream_image to the appropriate flavor (e.g., oxsecurity/megalinter-terraform).
If NO linters were provided, use AskUserQuestion to help the user select linters interactively. Present linters grouped by category:
The generator will automatically use ci_light as the base flavor (it's the lightest). The user can override this by editing upstream_image after creation.
Create the directory and both required configuration files.
Create megalinter-<name>/flavor.yaml with this simple structure:
# MegaLinter Flavor Factory Configuration
# Source of truth for megalinter-<name> flavor
#
# To regenerate Dockerfile and test.sh:
# python megalinter-factory/generate.py megalinter-<name>/
#
# Linter versions are automatically extracted from MegaLinter at build time.
---
name: <name>
description: "<user-provided or auto-generated description>"
# Upstream MegaLinter base image (Renovate tracks this)
# renovate: datasource=docker depName=oxsecurity/megalinter-ci_light
upstream_image: "oxsecurity/megalinter-ci_light:v9.3.0@sha256:a71e62c83e3b2d52316e7322b9168e1588e9bcf454dbf9b21fc71b0954786e5e"
# Additional linters not in base flavor
# Just list linter keys - versions come from MegaLinter automatically
custom_linters:
- <LINTER_KEY_1>
- <LINTER_KEY_2>
Note: For the upstream_image digest, look it up with:
docker buildx imagetools inspect oxsecurity/megalinter-ci_light:v9.3.0 --format '{{json .Manifest}}' | jq -r '.digest'
Create megalinter-<name>/metadata.yaml for CI versioning:
---
# Custom MegaLinter flavor: <name>
# <description>
#
# Version is managed independently of upstream - update manually for major changes.
# auto_patch: true enables automatic patch version increments on rebuild.
version: "v1.0"
auto_patch: true
Add the new image to .trivy-images.yaml so it gets included in daily vulnerability scanning. Insert megalinter-<name> in alphabetical order within the images list:
images:
# ... existing entries ...
- "megalinter-<name>"
# ... existing entries ...
Run the factory generator to verify the configuration produces valid output:
python megalinter-factory/generate.py megalinter-<name>/
Review the generated Dockerfile and test.sh to verify they look correct. Generated files are gitignored — CI regenerates them at build time.
Inform the user:
megalinter-<name>/flavor.yaml - flavor configurationmegalinter-<name>/metadata.yaml - CI versioning.trivy-images.yaml for daily vulnerability scanningpython megalinter-factory/generate.py megalinter-<name>/| Check | Validation |
|---|---|
| Name format | ^[a-z][a-z0-9-]*$ |
| Name uniqueness | No existing megalinter-<name>/ directory |
| Linter keys | Must exist in MegaLinter descriptors |
For /create-megalinter-flavor test-ci ACTION_ACTIONLINT,MARKDOWN_MARKDOWNLINT:
name: test-ci
description: "Custom MegaLinter for CI testing"
# renovate: datasource=docker depName=oxsecurity/megalinter-ci_light
upstream_image: "oxsecurity/megalinter-ci_light:v9.3.0@sha256:a71e62c83e3b2d52316e7322b9168e1588e9bcf454dbf9b21fc71b0954786e5e"
custom_linters:
- ACTION_ACTIONLINT
- MARKDOWN_MARKDOWNLINT