validate-and-apply-labels
БесплатноЗапускает вложенные скриптыНе проверенMaps branch types to labels and validates them against built-in defaults or a caller-supplied canonical set, including exactly one changelog-decision label…
от lightspeedwp★ 20 звёзд на GitHubОб этом скилле
validate-and-apply-labels
Validates GitHub labels against the canonical set and maps branch type to labels.
When to use this skill
Before submit-pr, to apply the current branch-type mapping, validate label shape or membership against the available policy, and confirm exactly one changelog-decision label is present.
Input
{
labels: string[], // e.g. ["type:feature", "area:agents"]
branchType: string, // optional: for conditional labels
templateFile: string, // optional: PR template file
config: object, // optional
mockGitHub: object, // optional: for testing
}
Behaviour
- Rejects a bare label without its required family prefix (e.g.
buginstead oftype:bug). - In direct-validation mode, checks labels against the built-in canonical set.
- In branch-mapping mode, uses
config.canonicalLabelswhen supplied; otherwise it accepts built-in labels and well-formed supported-family labels. - Ensures exactly one changelog-decision label is present, never zero or two.
- Does not yet fetch the repository's live label set or apply labels atomically with PR submission; those guarantees are deferred to T021.
Output
Branch-type mapping returns the applied labels and any mapping validation errors:
{
valid: boolean,
appliedLabels: string[],
branchType: string,
templateFile: string,
validationErrors: string[],
warnings: string[],
deduplicatedCount: number,
metadata: {
typeLabels: string[],
contextLabels: string[],
totalLabels: number,
},
}
Invalid branch-type mapping input omits templateFile, deduplication data, and metadata:
{
valid: false,
error: string,
appliedLabels: [],
branchType: unknown,
validationErrors: [],
warnings: [],
}
Direct label validation returns label-specific errors and may identify invalid or conflicting labels:
{
valid: boolean,
appliedLabels: string[],
errors: string[] | undefined,
deduplicatedCount: number,
validationErrors: string[],
warnings: string[],
invalidLabels?: unknown[],
conflicts?: Array<{ family: string, labels: string[] }>,
}
Usage
import { validateAndApplyLabels } from './scripts/validate-and-apply-labels.js';
const result = await validateAndApplyLabels({
labels: ['meta:no-changelog'],
branchType: 'feat',
templateFile: 'pr_feature.md',
});
Установить validate-and-apply-labels в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл validate-and-apply-labels?
Maps branch types to labels and validates them against built-in defaults or a caller-supplied canonical set, including exactly one changelog-decision label. Use before submission to check the currently assembled labels.
Как установить скилл validate-and-apply-labels?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл validate-and-apply-labels запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic