/vibedrift:vibedrift-drift-checkfrom VibeDrift
Checks proposed code against a repo's own conventions and existing functions before writing, preventing drift and duplication. Works standalone or with the VibeDrift MCP server.
Ships in VibeDrift. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Keep new code coherent with the codebase it is joining. Before a function is written or finalized, check it against the repo's own conventions and its existing functions, so the new code matches the first time instead of being flagged in a later review.
This is the same engine as the VibeDrift MCP server, reached through a small command so it works even when no MCP server is connected.
intent — the team's declared rules (CLAUDE.md / AGENTS.md / .cursorrules).dominant --dimension <name> — the repo's majority pattern for a dimension
(async, imports, exports, naming, error_handling, data_access,
logging, auth).find-similar — if the repo already has one
that does the same thing, extend or reuse it instead of writing a duplicate.validate-change — does it
introduce drift (wrong async style, wrong data-access pattern, ...) or duplicate
an existing function? If ok is false, fix it now.check-file — see where that file already
deviates so you do not copy a non-dominant pattern.Prefer the VibeDrift MCP tools if they are connected (get_intent_hints,
get_dominant_pattern, find_similar_function, validate_change,
check_file_drift). Otherwise run the bundled command. The function body is read
from stdin, so multi-line source pipes in cleanly:
# Before writing a new function — is there already one like it?
printf '%s' "$PROPOSED_BODY" | node scripts/vibedrift-tools.mjs find-similar --root .
# After writing it — would it drift or duplicate?
printf '%s' "$PROPOSED_BODY" | node scripts/vibedrift-tools.mjs validate-change --root . --file src/handlers/order.ts
# Learn the repo's convention for a dimension before you start
node scripts/vibedrift-tools.mjs dominant --root . --dimension async
(If @vibedrift/cli is installed globally you can also run the same checks with
npx @vibedrift/cli over MCP; the command above uses the local runner so the
skill is self-contained.)
The command prints JSON.
validate-change: act when ok is false. conflicts[] lists each dimension
where the change deviates, with dominantPattern (what the repo does),
yourPattern (what the change does), and a fixHint. duplicateOf[] lists
existing functions the change would clone — reuse one instead.find-similar: act when found is true; matches[] are the existing
functions, with file, name, line, and similarity.check-file: act when fits is false; deviations[] shows where the file
departs from the repo's dominant pattern.status: "no_baseline" means the repo has not been indexed yet. Run vibedrift
once in the repo (one-time, then cached), or just call again — the first call
builds the baseline automatically.If the result includes a nudge, relay its message to the user as a simple
yes/no offer (it is an occasional suggestion to run a deeper AI scan; never block
on it).
--deep flag on find-similar / validate-change adds an AI pass and
requires vibedrift login; it degrades gracefully when offline.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vibedrift/vibedrift --plugin vibedrift2 skills in this plugin
Other plugins' skills for the same job