mj-agent-flow-scope-drift

Detects implementation scope drift by comparing git diffs against linked Plan, SPEC, and Issue scope.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-flow-scope-drift-mj-agentlab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mj-agent-flow-scope-drift
Source: https://github.com/MJ-AgentLab/mj-agent/tree/main/.claude/skills/mj-agent-flow-scope-drift
Command: npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-flow-scope-drift-mj-agentlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? During implementation of mj-agent tasks (HITL Stage 9), code changes often drift beyond the originally agreed Plan, SPEC, or Issue scope. This Skill catches that drift before commit or push by comparing the working tree diff against linked planning artifacts, preventing unreviewed scope expansion. ## Core Features & Use Cases - Per-file scope classification: Maps every changed file against Plan / SPEC / Issue text and labels it in-scope, out-of-scope, or unclassified. - Severity matrix with flavor detection: Classifies drift severity (None to High), with mj-agent-specific A/B/C flavor recognition where B-flavor (in-source canonical SKILL.md or prompt changes) is automatically High and triggers a mandatory HITL pause. - Actionable drift report: Outputs a per-file table, severity rating, and recommendation (continue, amend Plan, split PR, or pause for HITL) without auto-modifying anything. - Use Case: Before pushing a feature branch with 12 changed files, run the drift check to discover that a SKILL.md edit was never in the Plan, then decide whether to amend the Plan or split it into a separate PR. ## Quick Start Ask the agent to run a scope drift check on the current branch before committing, for example by saying "check scope drift against the linked Plan".

Frequently Asked Questions about mj-agent-flow-scope-drift

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my code changes match the original plan scope?▼

Run a scope drift check that captures the git diff against the merge-base and searches the linked Plan, SPEC, and Issue text for each changed file. Files with no match are flagged as unclassified drift candidates with a severity rating and recommended action.

What is scope drift in a HITL development workflow?▼

Scope drift is when implementation changes expand beyond the agreed Plan, SPEC, or Issue scope during coding. In the mj-agent 17-stage HITL process, Stage 9 detects this drift before commit so humans can decide whether to amend the plan, split the PR, or continue.

Why use git merge-base instead of develop..HEAD for diffs?▼

Using merge-base avoids false diffs caused by the develop branch advancing after your feature branch was created. The command git diff $(git merge-base develop HEAD)..HEAD compares only your actual branch changes.

When should I skip a scope drift check before committing?▼

Skip it for single-file trivial changes like renames, typos, or small docstring edits, or when the user explicitly accepts out-of-scope changes. It is also skippable when no linked Plan or SPEC exists yet, though creating one first is recommended.

Does the scope drift check automatically amend the plan or split PRs?▼

No. It only outputs a drift report with recommendations such as amend Plan, split PR, or pause for HITL review. The user decides and invokes separate skills like mj-agent-doc-author or branch tooling to execute the chosen action.