moyu

Classify AI code diffs by scope and enforce minimal-change thresholds.

6|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/kmshihab7878/claude-code-setup --skill moyu-kmshihab7878
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moyu
Source: https://github.com/kmshihab7878/claude-code-setup/tree/main/skills/moyu
Command: npx skills add https://github.com/kmshihab7878/claude-code-setup --skill moyu-kmshihab7878

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents AI coding agents from expanding scope, adding unrequested abstractions, or changing files the user did not ask to modify, ensuring small, reviewable diffs and avoiding over-engineering.

Core Features & Use Cases

  • Scope enforcement: Limits edits strictly to user-specified files and lines, asking for confirmation before touching anything else.
  • Minimal-change preference: Prioritizes the simplest viable change (one-line or one-function fixes) and reuses existing code instead of introducing new abstractions or dependencies.
  • Intervention levels: Detects and classifies diffs into L1–L4 severity levels with prescribed actions (self-revert, course correction, scope reset, emergency brake).
  • Use case: A developer asks an AI to fix a single bug; Moyu ensures the agent produces the minimal patch without refactoring unrelated modules, adding libraries, or creating new files.

Quick Start

Ask the AI to fix the specified bug and instruct it to "apply moyu: only change the files and lines I specify; ask before any other edits."

Frequently Asked Questions about moyu

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

FAQPage Schema
How do I stop AI coding agents from making unrequested or over-engineered code changes?

To stop AI coding agents from making unrequested or over-engineered code changes, apply this skill to enforce minimal-change thresholds. It detects scope expansion during automated refactoring workflows, classifies diffs by severity, and prompts for confirmation before modifying unrequested files.

What is diff analysis scope control for AI code review?

Diff analysis scope control for AI code review is a mechanism that classifies code modifications by size and severity. It enforces minimal-change preferences by detecting unrequested abstractions, limiting edits to user-specified files, and prescribing intervention levels like self-revert or scope reset.

How do I enforce minimal changes when an AI agent modifies code during automated refactoring?

To enforce minimal changes when an AI agent modifies code during automated refactoring, instruct the agent to apply scope control rules. This prioritizes the simplest viable patch, reuses existing code, and applies an emergency brake to prevent adding new dependencies or creating unrelated files.

Does this AI agent guardrail work with existing PR and code review workflows?

Yes, this AI agent guardrail works with existing PR and code review workflows by analyzing diffs on the fly. It prevents AI coding agents from expanding scope during automated refactoring, ensuring small, reviewable diffs by asking for confirmation before any non-requested modifications occur.

What are the intervention levels when an AI coding agent expands scope beyond my request?

The intervention levels when an AI coding agent expands scope are classified as L1 through L4 severity. Depending on the diff size and scope expansion, the guardrail prescribes specific actions ranging from course correction and self-revert to a full scope reset or emergency brake.

When should I not use automated scope control for AI code generation?

You should not use automated scope control for AI code generation when your workflow explicitly requires the agent to introduce new abstractions, add dependencies, or refactor unrelated modules. The guardrail is designed to prioritize the simplest viable change and will block large, unrequested modifications.