Skip to content
Back to skills

Mr Metadata Repair

ASecurity

Repairs a merge request's metadata, such as a missing or wrong label or a missing description section, so its checks can pass. Kraft runs it as the on_failure repair of the merge request's CI wait, on every failure; it acts only when the failed job's trace names a label or a description section.

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 21, 2026
ai-agentsshelltestinggit

Works with

  • mcp

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add itsOmidKarami/kraft --skill mr-metadata-repair --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mr Metadata Repair?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mr Metadata Repair
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/itsomidkarami-mr-metadata-repair/badge)](https://www.skillsdirectory.com/skills/itsomidkarami-mr-metadata-repair)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mr-metadata-repair
description: "Repairs a merge request's metadata, such as a missing or wrong label or a missing description section, so its checks can pass. Kraft runs it as the on_failure repair of the merge request's CI wait, on every failure; it acts only when the failed job's trace names a label or a description section."
---

# Repairing a merge request's metadata

The merge request's checks just failed. Its diagnosis — the failed job's name
and the tail of its trace — is in the prompt above, unless no job failed and the
branch no longer merges (see the last section).

**Whether another pass follows is the chain's decision, not this skill's.** Fix
what you can see and exit; the CI wait runs again after you and decides whether
it worked. Do not apply a second guess in the same pass to hedge the first,
and never push a commit or touch CI config to force a run.

Act only when the trace names a label or a description section. When you leave
anything unfixed, whatever the reason, finish `done_with_concerns`, not `failed`,
and say why in `concerns`: a fix loop, if the chain has one, reads your `concerns`
as its diagnosis, and `failed` loses it.

## When the trace names a missing or wrong label

A job that refuses to run without a label of a given kind usually names the
kind and the choices in its own message (for example: `no type label;
expected one of feature, fix, docs`). If it does not, the project's
CONTRIBUTING or the job's own definition in its CI config says what they
are. Pick the label from the diff this item made, not from habit — a wrong
label mislabels what ships (a release label picks the version), which is
worse than stopping to ask. If the diff does not make the choice obvious,
leave it: "I could not tell which of these labels this change takes" in
`concerns` is correct output; a guess is not.

Apply your choice with the `set_mr_labels` tool of the `kraft` MCP server
(`kraft item mr-label <label>...` from the shell works the same way) — not
`glab`/`gh` directly. It adds labels, and removes only those sharing a scope
prefix with one it sets (`kind::a` gives way to `kind::b`); it can't remove an
unscoped label, so if a stray one fails the check, say so. On GitLab it also
starts a new pipeline, because `CI_MERGE_REQUEST_LABELS` is fixed when a
pipeline starts; on GitHub the label edit re-runs workflows that trigger on
`labeled`. If the tool refuses (on GitHub the label must already exist), finish
`done_with_concerns` and name the label.

## When the trace names a missing or wrong description section

A job that reads the merge request's description (for example `missing
section: ## Testing`) is fixed in the item's `mr_meta` document, whose
path is in the documents list above. Edit that file, not the live description:
Kraft rebuilds the description from it on every sync. The exception is a
description a person edited, which Kraft leaves alone. In `kraft view events
--json`, if `mr_description_kept` is newer than the last `mr_description_written`,
your edit won't reach the forge: change nothing, finish `done_with_concerns` and
name the section they need to add. Keep its front matter, change only the body, and take the
section's format from CONTRIBUTING, the PR template or the job's own checker
(run it on the new body if the repo ships one). Fill it from the diff, never
from guesswork; if you cannot tell what it should say, leave it. The `sync`
step after you writes the description to the forge and starts the failed
checks again (on GitLab as a new pipeline). A check that reads the description
when it runs sees the fix; one that reads it from its triggering event does
only if it re-runs on edits.

## When the trace names something else

This task exists for MR-metadata problems, not code problems — a missing
label, not a failing test. If no label or section would fix it, change nothing,
end `done_with_concerns` and name the failed job and the cause in `concerns`. A
chain with a fix loop takes it from there.

## When no failed job is named

Suspect a conflict with the base: the CI wait asks the forge whether this branch
can merge and logs the answer (`merge request is not mergeable: conflict`, or
similar). Don't check out another branch or run `git merge` to look: this worktree
is the item's own, and a merge left mid-conflict when your pass ends strands the
next task. If you need to read, use a command that changes nothing (`git
merge-tree`, `git log`, `git diff origin/<base>...HEAD`). Nothing here can resolve a real
conflict; say so in `concerns` and stop, the same as any other non-label failure.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.