Native step: simplify (bundled skill)
When the bundled simplify skill resolves in this session, Phase 6 step 2 invokes it with each
group's file list as its target, in place of spawning the simplifier agent. This skill keeps the
discovery, filtering, grouping, ordering, verification, and report around it. One mutating pass
runs per group, never both. docs mode keeps the simplifier agent, since simplify has no
factual-staleness pass, and records State: skipped (docs mode). Repo mode never invokes
simplify (context/repo-mode.md gives the reasons). Pointer for how an invoked skill's body stays in context:
Identity check. The name is in the skill listing; the description is advisory. A description
that reads as a different surface is a likely user or project shadow: skip with a warning and
spawn the agent. A name listed with no description is invoked with the warning "identity
confirmed by name alone". Pointer for when the listing drops a description:
Skill descriptions are cut short.
Mutation. Groups the step runs over go one at a time, never in a parallel wave. Before each
invocation, fingerprint the tracked files outside that group; any change there right after it is
mutation detected after a scoped invocation, and the run exits degraded.
Skip report. When the step does not run, the state names why: `did not resolve in this
session`, invocation refused (the reason, never retried), or identity mismatch; those three name the axis
line: settings or environment, plan, platform or provider, host surface; and the enable path,
read live from Bundled skills.
The matching row is in
context/bundled-simplify.md. When simplify runs but
says it ran a weaker procedure, the state is resolved but degraded, and the report relays its disclosure instead of
calling the group fully simplified.
Result block. The Phase 8 report opens with this block, whichever state the step ended in:
Native step: simplify
State: ran | resolved but degraded (<disclosure>) | did not resolve in this session (<axis>) | invocation refused (<reason>) | identity mismatch | skipped (docs mode | unattended) | mutation detected after a scoped invocation
Scope: <file groups the step ran over, or none>
Outside-scope changes: none | <paths>
--unattended: never invoke simplify; the simplifier agent runs every group, and the result
block records State: skipped (unattended) without asking.
Arguments. [time-window|branch|repo] [--unattended] [path...] [in-place[=commit]] [--repo <repo> ...], plus docs and override, which the hint leaves out to stay within its length budget. e.g., /batch-simplify 72h, /batch-simplify branch docs, /batch-simplify repo plugins/foo, /batch-simplify 72h --unattended. Default: 48h
Repository context. Gather first
<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->
Run each command below as its own Bash call, all sent together in one message (worktree isolation).
Keep any bound in the command's own pipe (output limits).
Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).
<!-- END GENERATED: gather-block -->
- Current branch,
git branch --show-current
Variables
HARD path exclusions: ${user_config.hard_exclusions} (unexpanded, empty, or any value outside
enforce and advisory means enforce).
Purpose
Automate running simplification across changed code files, or every code file in the repository, grouped so each pass has tight focus and ecosystem-appropriate context. Replaces the manual process of remembering to run /simplify after each task.
Emit checklist
For any batch run (Phases 1-8), copy templates/checklist.md into your project's working-notes location (or track the phases inline if it has none). Tick each phase as completed. Phase 6.5 SKIPPED when no deferred items surface; Phase 5 task tracking SKIPPED for single-group changes.
Arguments
$ARGUMENTS, optional scope for the file scan: [<scope>] [<path>...] [docs]. The scope picks a universe (three modes below); a path narrows it to a region. They are independent, so any scope takes any path.
Mode 1: Time window (default)
Supported formats: 24h, 48h, 72h, 7d, 2d, 1w. Default: 48h.
Normalize before use: convert to long units before passing the window to git log --since (the option's entry is under Commit Limiting; recheck when that entry documents the short h, d and w forms):
<N>h→<N> hours(e.g.,48h→48 hours)<N>d→<N> days(e.g.,7d→7 days)<N>w→<N> weeks(e.g.,1w→1 weeks)
Mode 2: Branch diff
Trigger: the remaining argument, lowercased and whitespace-normalized, equals one of branch, feature branch, or all commits. Uses git diff --name-only <default-branch>...HEAD (three-dot. Diff from the merge base, so files changed only on the default branch since the branch point are not swept in) to find files this branch changed. Requires being on a non-default branch.
Match the whole argument, never a substring: an argument that merely contains "branch", a path, a filename, a future scope value, is not a branch-mode request, and routing it there silently sweeps the wrong file set.
Detection heuristic (after stripping the docs, override, --unattended, and in-place flags): read the first remaining token as the scope. Matches ^\d+[hdw]$ → time-window mode; equals a branch trigger phrase → branch mode; equals repo → repo mode. Empty argument → default 48h. Every token after the scope is a path.
Decide the scope before testing any token as a path, never after. Stripping paths first lets a repository that happens to contain a directory named repo or branch swallow the scope keyword. /code-tidying:batch-simplify repo would resolve repo as a path, find no scope left, and silently run the 48-hour default narrowed to that directory instead of the whole-repository sweep that was asked for. If the first token is not a scope, the scope defaults to 48h and every token is a path; a token that resolves to nothing is neither a scope nor a path, so it falls through to asking the user rather than guessing. To sweep a directory genuinely named repo, spell it ./repo.
Mode 3: Whole repository
Trigger: the remaining argument, lowercased and whitespace-normalized, equals repo. Sweeps every non-excluded file in the repository rather than a diff, including untracked files that are not ignored, so newly added work is swept too. Explicit entry only: it never auto-escalates from another mode, and it confirms the inventory with the user after Phase 4, once grouping and wave planning have produced the numbers that gate reports, and before any group is dispatched. A trailing path narrows the sweep (see Narrowing to a path) without changing any of the above, the confirmation gate still fires, on the narrowed inventory. Repo-scale machinery, grouping, waves, concurrency, resume, delivery, lives in context/repo-mode.md, loaded only when this mode fires.
Narrowing to a path
Any scope accepts one or more trailing paths: 48h plugins/knowledge, branch src/, repo plugins/code-tidying. Narrowing is orthogonal to scope because the two answer different questions, the scope decides which universe (changed recently, changed on this branch, everything), the path decides which region of it. Binding paths to one mode would assert that only that universe may be narrowed, which nothing supports.
Apply the path as a native pathspec on that mode's own discovery command (-- <path>), never as a filter over the results: the pathspec is what makes the mode's own semantics hold over the narrowed set. That means merge-base for branch and --since for a window.
Resolve each path against the invocation directory, then express it repo-root-relative before handing it to a root-anchored command. Repo mode runs git -C <repo-root>, and -C changes directory before the pathspec is applied: a bare code-tidying typed from inside plugins/ resolves locally but would be read at the root as a top-level code-tidying, sweeping the wrong set or nothing at all while reporting a clean run.
A token counts as a path only if it resolves to an existing file or directory. A token that resolves to nothing is neither a path nor a scope, so it falls through to the ask-the-user rule, which is what keeps a mistyped scope or path an explicit question instead of a silent sweep of nothing.
repo <lane> is deliberately not accepted; use a path. Rationale in context/reference.md "Why narrowing is a path, not a lane".
Over several repositories
With no target form, the sweep covers this checkout, as it always has. A target form (--repo,
--repos-from, --owner, --fleet, --skip, or the same request in words) selects several
repositories, which resolve, count, fan out and merge as