Command Palette

Search for a command to run...

Назад к скиллам
скилл № 33277

prevent-doc-drift

Per-PR documentation-drift prevention. When a PR adds new code subsystems, scripts, skills, docs, plugin routes, feature flags, or changes architecture…

БесплатноБез исполняемых скриптов
grafanaот grafana★ 24 звезды на GitHub

Установить prevent-doc-drift в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Prevent doc drift

A per-PR doc-quality skill. It compares the PR diff against agent guidance files and updates them in the same PR so future agents are never working from a stale map.

This skill is paired with .cursor/skills/maintain-docs/:

  • prevent-doc-drift (this skill) — runs on every PR; catches drift at the moment it's introduced.
  • maintain-docs — runs periodically across the whole repo; catches drift that this skill missed.

Together they form a two-tier defence: the per-PR skill is the primary line, the periodic skill is the safety net.

Hard constraints

These constraints are absolute and override any other instructions:

  1. Only modify documentation files. Allowed: AGENTS.md, CLAUDE.md, README.md at repo root; any *.md or *.mdc under .cursor/rules/, .cursor/skills/, .claude/skills/, or docs/developer/. Forbidden: any source file (.ts, .tsx, .js, .jsx, .go, .json, .css, .html), config files, lockfiles, and any file under docs/design/ (design docs are author-curated by humans via the design-review skill).
  2. Operate on the PR diff only. Do not audit files outside the diff. If you find drift in a file the PR did not touch, add it to docs/_maintenance-backlog.md for maintain-docs to handle — do not silently fix it here.
  3. Never fabricate. Only document features, subsystems, services, scripts, and relationships that the diff actually adds. If you cannot confirm something exists from the diff plus a focused code read, omit it.
  4. Before staging anything, verify the constraint. Run git diff --name-only after edits and confirm every changed path is in the allowed list above. Abort if any disallowed file appears.
  5. One commit max. All doc updates land as a single follow-up commit on the same PR branch (or, if invoked from /review, as a recommended diff block in the review output — see "Operating modes" below).
  6. Do not amend the PR's existing commits. Create a new commit.
  7. Respect the always-on budget. AGENTS.md loads into every agent and is capped by src/validation/always-on-context-budget.test.ts. Add at most one line there per change, and only for a rule nearly every task needs. Put detail in the enforcing test's failure message, a skill, or docs/developer/CONTEXT_INDEX.md.

Operating modes

The skill has two modes:

  • Apply mode (default when invoked directly): the working tree is the PR branch. Apply edits, stage, commit with a clear message, push.
  • Review mode (invoked from /review): emit one canonical observation with the proposed patch evidence. Do not modify the working tree. The shared review policy decides its disposition.

Decide which mode applies based on context: if a gh pr command can determine the current branch is a PR branch and the user invoked this skill directly, use apply mode. If the parent is /review, use review mode.

Workflow

Phase 0 — Resolve the diff

  1. Determine the base ref:
    • If on a PR branch: gh pr view --json baseRefName -q .baseRefName
    • Otherwise: git merge-base HEAD main (or whatever the repo's main branch is — check git symbolic-ref refs/remotes/origin/HEAD).
  2. Capture the diff in three forms — you'll use each:
    • git diff --name-status <base>...HEAD (status flags A / M / D / R)
    • git diff --stat <base>...HEAD (line counts)
    • git log <base>..HEAD --oneline (commit subjects)
  3. From package.json, read the current set of npm scripts: jq -r '.scripts | keys[]' package.json (you'll diff this against the table in AGENTS.md).

If the diff is empty or doc-only, exit cleanly with "no source changes — no drift possible."

Phase 1 — Categorize changes

Walk the name-status output and bucket each path into one of these categories. A single file may land in multiple buckets; that's fine.

Bucket Matches (path patterns)
New frontend subsystem New directory at src/<dir>/ (any first commit of a path matching src/<name>/...)
New backend file New file at pkg/**/*.go
New developer doc New file at docs/developer/**/*.md
New design doc New file at docs/design/**/*.md (we index it; we do not edit it)
New rule New file at .cursor/rules/*.mdc or .cursor/rules/*.md
New skill New directory at .cursor/skills/<name>/ (look for new SKILL.md)
**New npm sc
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл prevent-doc-drift?

Per-PR documentation-drift prevention. When a PR adds new code subsystems, scripts, skills, docs, plugin routes, feature flags, or changes architecture relationships, this skill produces the AGENTS.md, CLAUDE.md, and .cursor/rules/ updates needed in the same PR so agent guidance never falls behind the code. Use this on /review or directly before merge.

Как установить скилл prevent-doc-drift?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prevent-doc-drift запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить prevent-doc-drift с