ase-code-dissect

SkillDev tools

Dissect the current Git change set, treated as an epic, domain-wise and logically into cohesive parts and materialize each part in its own dedicated Git WorkTree. Use when the user calls to "dissect", "split", "break up", or "decompose" a large change set into atomic, separately committable parts.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the ase-code-dissect skill

What this skill tells your AI

The instructions your AI receives, as published by rse/ase in plugin/skills/ase-code-dissect/SKILL.md and read by ahel’s review.

@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md

$ARGUMENTS

@${CLAUDE_SKILL_DIR}/../../meta/ase-common-dissect.md

Procedure

    1. Determine the dissection hint: set , with any leading and trailing whitespace stripped. Additionally, inherit the always existing from the current context, as it names the worktrees and branches of all derived parts.

    2. Determine the repository root by running the corresponding command (taken exactly as given) and capturing its output into :

      git rev-parse --show-toplevel

    3. Determine the diff details and the diff statistics by running the corresponding commands (taken exactly as given) and capturing their full outputs into and :

      git diff --cached --numstat HEAD git diff

      git diff --numstat

    4. git -C "<repo-root/>" -c core.quotepath=off ls-files --others --exclude-standard

      Skip every listed entry below the .ase/ directory -- it carries ASE's own state and the worktrees created by this very skill, and hence is never part of the user's change set.

      Then, for every remaining listed file, capture its creation diff by running the corresponding command (taken exactly as given) and append its output to :

      git -C "<repo-root/>" diff --no-index --binary /dev/null "<file/>"

      This command intentionally exits with a non-zero status, because the two compared paths differ; treat this exit status as success, not as an error. Judge the outcome by the output instead: a run which emits no diff on standard output but an error: or fatal: message (e.g. the entry is a nested Git repository, which git ls-files reports as a directory) is a real failure -- append nothing for that entry and only output the following , then continue with the next file:

    1. Derive the parts of the epic:

      <expand name="dissect-derive" arg1="ase-code-dissect" arg2="" arg3=""

      the individual hunks of the captured , weighted by the line counts of and -- for the folded-in untracked files, which carry no entry -- by their own diff line counts

      Additionally, try to keep all hunks of one file in the same part, and split a file's hunks across parts only when they are genuinely unrelated -- this keeps the per-part patches applicable.

      A single hunk is atomic here, so rule 3's splitting permission does not apply to it: you MUST NOT break a hunk into sub-hunks, because this would require re-computing its @@ header and hence destroy the byte-exactness the per-part depends on.

    2. Report the parts:

    1. Determine the worktree directory of every part by calling the ase_worktree_path(id: "<part-id/>", create: true) tool of the ase MCP server once per of and capturing its output into the of that part.

      You MUST NEVER assemble such a path yourself, as only this tool rejects a path leading through a symbolic link, through a non-directory, or out of the repository -- a path both git worktree add and git worktree remove would otherwise silently follow and thereby write outside the repository.

    2. Determine the existing worktrees and existing branches by running the corresponding commands (taken exactly as given) and capturing their outputs:

      git worktree list --porcelain

      git branch --list

    3. Set to all of for which either the worktree directory or a branch <part-id/> already exists.

    4. Directly after this , and before stopping, give the corrective hint by expanding the following (which, depending on the configured , may expand into nothing and hence emit no output at all):

    5. git worktree remove --force "<part-dir/>"

      git worktree prune

      git branch -D "<part-id/>"

  1. You MUST NEVER mutate the original working copy in this step: do not modify, stage, stash, revert, or commit anything outside of the freshly created worktrees.

    1. Set to the value of the TMPDIR environment variable if it is known in the current session context, and to /tmp otherwise. Do not output anything.

    2. For every part in , in their derived order:

      1. Assemble from the verbatim subset of assigned to this part: keep the complete diff --git file headers and the complete @@ hunk headers of the assigned hunks, and change nothing inside them.

        The captured is byte-exact input and stays byte-exact, too, because git apply rejects even the smallest deviation. You MUST therefore NEVER re-wrap a line, re-indent a line, normalize or strip trailing whitespace, drop the leading context/+/- marker column, re-encode a character, or omit the trailing newline -- and you MUST NEVER re-render any part of the diff as Markdown, so no bullet marker and no inline code span is ever introduced into .

      2. Use the Write tool to write to the patch file <tmp-dir/>/ase-dissect-<part-id/>.patch.

      3. Create the worktree by running the corresponding command (taken exactly as given), which creates the directory and -- named after its last path component -- the branch from HEAD. The .ase directory is usually git-ignored, so the worktree itself never shows up as a change:

        git worktree add "<part-dir/>"

      4. Apply the patch inside the freshly created worktree by running the corresponding command (taken exactly as given):

        git -C "<part-dir/>" apply --whitespace=nowarn "<tmp-dir/>/ase-dissect-<part-id/>.patch"

      5. The existing CHANGELOG.md is changed, never replaced: you MUST use the Read tool to read it and the Edit tool to insert the single new entry in place, and you MUST NEVER use the Write tool on it, as this would drop the entire remaining change history.

      6. Leave the worktree uncommitted: do not run git add and do not run git commit, so the user keeps full control over the final commit of every part.

      7. Only output the following :

    3. Clean up the temporary patch files by running the corresponding command (taken exactly as given) once per of the successfully materialized , and silently ignore the failure of an individual command when the corresponding patch file does not exist:

      rm -f "<tmp-dir/>/ase-dissect-<part-id/>.patch"

      The patch file of a successful part is a pure intermediate: it was already consumed by git apply and its content is fully preserved in the worktree, so it is removed. The patch file of a part whose worktree or patch failed is kept instead, because it is that part's only materialization and would otherwise be lost. Do not output anything.

    1. Finally, give the closing hints by expanding the following (which, depending on the configured , may each expand into nothing and hence emit no output at all):

Signals

GitHub stars
52
Forks
5
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
ase-code-dissect
Source
github.com/rse/ase