Skip to content
Agentmart
Submit a tool

scope-guard

Monitors implementation scope and prevents drift beyond the plan.

Skill by xoai

IndexedMIT★ 30
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/xoai-scope-guard

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Monitors implementation scope and prevents drift beyond the plan. Detects unrequested refactors, gold-plating, and "while I'm here" additions. Use when implementing tasks from a plan, writing code for a feature, or when the agent starts modifying files not listed in the current task.

Use cases: writing, productivity, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/scope-guard

What's inside

Skill name
scope-guard
Description
Monitors implementation scope and prevents drift beyond the plan. Detects unrequested refactors, gold-plating, and "while I'm here" additions. Use when implementing tasks from a plan, writing code for a feature, or when the agent starts modifying files not listed in the current task.
License
MIT
Instructions
97 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

<!-- sage-metadata
cost-tier: haiku
activation: mandatory
tags: [discipline, scope, focus, yagni]
inputs: [spec, plan, implementation]
outputs: [scope-assessment]
-->

# Scope Guard

Do what was planned. Nothing more.

**Core Principle:** Every line of code that wasn't in the plan is a line of code
that wasn't reviewed, wasn't tested against the spec, and wasn't approved by the
human. "While I'm here" is how technical debt and bugs are born.

## The mechanical floor (opt-in)

This skill is the judgment layer. The MECHANICAL layer under it is the scope
gate: at plan approval, `python3 sage/runtime/tools/manifest.py scope derive
<manifest>` turns the plan's per-task `Files:`/`Output:` lines into a machine
`scope:` block, and — with `scope_gate: standard+` in `.sage/config.yaml` —
the `sage-scope-gate.sh` hook blocks any Edit/Write outside it. Two legal
exits from a block, both recorded: `manifest.py scope add-collateral <path>
--task TN --reason "…"`, or amend the plan and `scope derive --refresh`.
Scope changes go through the artifact, never silently through the diff.
Both knobs are OFF by default, and the 2026-08-02 campaign says leave
them there: bare and gated both held scope 3/3 at two model tiers, so the
gate prevented nothing (it is harmless and fast — arm it if you want the
floor, but do not claim it catches drift). This skill's judgment layer is
what carries scope discipline; see develop/evals/SCOPE-GUARD-CAMPAIGN.md.

## When to Use

Active throughout implementation. Scope guard is a background discipline, not
a discrete step. Apply these rules continuously while working.

## Rules — What's In Scope

In scope (MAY do without asking):
- Everything explicitly listed in the current task
- Infrastructure directly required by the task (imports, types, config)
- Tests for the functionality being implemented
- Constitution-mandated requirements (security, error handling) even if not in task

## Rules — What's Out of Scope

MUST NOT do these without explicit human approval:
- **"While I'm here" refactors:** "This function is messy, let me clean it up" — NO.
  If it's not in the task, don't touch it. File a note for future work.
- **Unrequested features:** "This would be better with caching" — NO.
  If caching isn't in the spec, don't add it. YAGNI.
- **Premature optimization:** "This could be faster with..." — NO.
  Make it work first. Optimize only when evidence shows it's needed.
- **Style fixes in unchanged files:** Don't reformat code you didn't write
  and aren't changing. It pollutes the diff and hides the real changes.
- **Dependency upgrades:** Unless the task specifically requires it.
- **Documentation for unrelated features:** Stay focused.

SHOULD NOT do unless the constitution requires it:
- **Additional error handling** beyond what the spec requests. If the
  constitution mandates error boundaries or input validation, it's in scope.
  Otherwise, note it for future work.

## Self-Check

Before committing any change, ask:

1. "Is this in my current task?" — If no, don't commit it.
2. "Was this in the plan?" — If no, don't commit it.
3. "Did the human ask for this?" — If no, don't commit it.
4. "Is this required by the constitution?" — If yes, it's in scope even if not in the task.

If the answer to all four is "no," you're scope creeping. Revert the change.
If you believe the change is truly important, note it in `.sage/decisions.md`
under a "Future Work" section and move on.

## When Scope SHOULD Expand

Sometimes you discover mid-implementation that the plan is incomplete. This is
legitimate — but the response is NOT to silently expand scope:

1. STOP implementation
2. Describe what you discovered: "Task 3 requires X, which isn't in the plan"
3. Ask the human: "Should I add this to the plan, or work around it?"
4. If they approve, update the plan FIRST, then implement
5. If they say "not now," note it as future work and proceed without it

## Failure Modes

- **Agent wants to "clean up" existing code:** Redirect. "I noticed [X] could be
  improved. I've noted it in decisions.md for future work. Continuing with current task."
- **Dependency requires additional work:** Legitimate. Flag it, ask human, update plan if approved.
- **Constitution requires something not in plan:** Legitimate. Constitution overrides
  the plan. Implement the constitution requirement and note why.

From xoai/sage, MIT.

More from xoai/sage

Signals

Stars
30
Forks
7
Open issues
0
Last commit (this folder)
Aug 2, 2026 (2 months ago)
Last release
Sep 28, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from xoai

Cite this page

scope-guard skill. Agent Mart. https://agentmart.dev/skills/xoai-scope-guard (last updated 2026-10-24)