/ase-code-dissect
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
$ npx -y skills add rse/ase --skill ase-code-dissect --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/ase-code-dissect
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
ase-code-dissect.SKILL.mdname: ase-code-dissect
argument-hint: "[--help|-h] [--max-parts|-m <count>] [--staged|-s] [--dry|-d] [--force|-f] [<dissect-hint>]"
description: >
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.
user-invocable: true
disable-model-invocation: false
effort: xhigh
allowed-tools:
- "Bash(git *)"
- "Bash(rm -f *)"
- "Write"
- "Read"
- "Edit"@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
<purpose name="ase-code-dissect"> Dissect a Change Set </purpose>
<expand name="getopt" arg1="ase-code-dissect" arg2="--max-parts|-m=8 --staged|-s --dry|-d --force|-f"> $ARGUMENTS </expand>
<objective> *Dissect* the current Git change set, treated as an *epic*, domain-wise and logically into *cohesive parts*, and materialize every part in its own dedicated *Git WorkTree*, so each part can be reviewed and committed *atomically* and *independently*. </objective>
@${CLAUDE_SKILL_DIR}/../../meta/ase-common-dissect.md
Procedure ---------
<flow>
1. <step id="STEP 1: Determine Change Set and Hint">
1. Determine the *dissection hint*: set <dissect-hint><getopt-arguments/></dissect-hint>, with any leading and trailing whitespace stripped. Additionally, inherit the always existing <ase-project-id/> from the current context, as it names the worktrees and branches of all derived parts.
<if condition="<dissect-hint/> is not empty"> Only output the following <template/>:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ⇌ hint: **<dissect-hint/>** </template> </if> <else> No dissection hint was given, so the parts are derived from the change set alone. Do not output anything. </else>
2. Determine the *repository root* by running the corresponding command (taken exactly as given) and capturing its output into <repo-root/>:
`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 <diff/> and <stat/>:
<if condition="<getopt-option-staged/> is equal `true`"> `git diff --cached HEAD`
`git diff --cached --numstat HEAD` </if> <else> `git diff`
`git diff --numstat` </else>
4. <if condition="<getopt-option-staged/> is not equal `true`"> Additionally, *fold in the untracked files* -- they are part of the working copy change set, but carry no diff of their own. Determine them *read-only* by running the corresponding command (taken exactly as given):
`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 <diff/>:
`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 <template/>, then continue with the next file:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ⊘ untracked: `<file/>`, ▶ status: **not foldable into the change set** </template> </if> <else> Untracked files are *not* folded in under `--staged`/`-s`, because they are by definition *not* part of the Git index. Do not output anything. </else>
5. <if condition="<diff/> is empty"> Only output the following <template/> and then *STOP* immediately:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ▶ status: **no changes to dissect** </template> </if>
</step>
2. <step id="STEP 2: Dissect Change Set">
1. *Derive the parts* of the epic:
<expand name="dissect-derive" arg1="ase-code-dissect" arg2="<dissect-hint/>" arg3="<ase-project-id/>" > the individual hunks of the captured <diff/>, weighted by the line counts of <stat/> and -- for the folded-in untracked files, which carry no <stat/> entry -- by their own diff line counts </expand>
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 <patch/> depends on.
2. *Report the parts*:
<expand name="dissect-report" arg1="<ase-project-id/>"></expand>
</step>
3. <step id="STEP 3
Read more
name: ase-code-dissect
argument-hint: "[--help|-h] [--max-parts|-m <count>] [--staged|-s] [--dry|-d] [--force|-f] [<dissect-hint>]"
description: >
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.
user-invocable: true
disable-model-invocation: false
effort: xhigh
allowed-tools:
- "Bash(git *)"
- "Bash(rm -f *)"
- "Write"
- "Read"
- "Edit"@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
<purpose name="ase-code-dissect"> Dissect a Change Set </purpose>
<expand name="getopt" arg1="ase-code-dissect" arg2="--max-parts|-m=8 --staged|-s --dry|-d --force|-f"> $ARGUMENTS </expand>
<objective> *Dissect* the current Git change set, treated as an *epic*, domain-wise and logically into *cohesive parts*, and materialize every part in its own dedicated *Git WorkTree*, so each part can be reviewed and committed *atomically* and *independently*. </objective>
@${CLAUDE_SKILL_DIR}/../../meta/ase-common-dissect.md
Procedure ---------
<flow>
1. <step id="STEP 1: Determine Change Set and Hint">
1. Determine the *dissection hint*: set <dissect-hint><getopt-arguments/></dissect-hint>, with any leading and trailing whitespace stripped. Additionally, inherit the always existing <ase-project-id/> from the current context, as it names the worktrees and branches of all derived parts.
<if condition="<dissect-hint/> is not empty"> Only output the following <template/>:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ⇌ hint: **<dissect-hint/>** </template> </if> <else> No dissection hint was given, so the parts are derived from the change set alone. Do not output anything. </else>
2. Determine the *repository root* by running the corresponding command (taken exactly as given) and capturing its output into <repo-root/>:
`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 <diff/> and <stat/>:
<if condition="<getopt-option-staged/> is equal `true`"> `git diff --cached HEAD`
`git diff --cached --numstat HEAD` </if> <else> `git diff`
`git diff --numstat` </else>
4. <if condition="<getopt-option-staged/> is not equal `true`"> Additionally, *fold in the untracked files* -- they are part of the working copy change set, but carry no diff of their own. Determine them *read-only* by running the corresponding command (taken exactly as given):
`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 <diff/>:
`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 <template/>, then continue with the next file:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ⊘ untracked: `<file/>`, ▶ status: **not foldable into the change set** </template> </if> <else> Untracked files are *not* folded in under `--staged`/`-s`, because they are by definition *not* part of the Git index. Do not output anything. </else>
5. <if condition="<diff/> is empty"> Only output the following <template/> and then *STOP* immediately:
<template> ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ▶ status: **no changes to dissect** </template> </if>
</step>
2. <step id="STEP 2: Dissect Change Set">
1. *Derive the parts* of the epic:
<expand name="dissect-derive" arg1="ase-code-dissect" arg2="<dissect-hint/>" arg3="<ase-project-id/>" > the individual hunks of the captured <diff/>, weighted by the line counts of <stat/> and -- for the folded-in untracked files, which carry no <stat/> entry -- by their own diff line counts </expand>
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 <patch/> depends on.
2. *Report the parts*:
<expand name="dissect-report" arg1="<ase-project-id/>"></expand>
</step>
3. <step id="STEP 3
Showing the first part of this file.
Repo: rse/ase
Other skills on ase.
- /hello
Show a nice greeting message with a timestamp. Use this, when the user wants to greet or say hello, optionally to a certain subject <subject> and in a certain language <language>.
Open skill - /ase-arch-analyze
Review software architecture, including package cohesion and inter-package coupling
Open skill - /ase-arch-discover
Discover additional, third-party components (libraries/frameworks) for the technology stack to provide needed functionality.
Open skill - /ase-code-analyze
Analyze the source code for problems in either the logic and semantics and its related control flow, performance and efficiency, or security.
Open skill - /ase-code-craft
Craft Source Code: Use when user wants to "create", "add", or "craft" a new feature from scratch.
Open skill - /ase-code-explain
Explains code with WHAT, WHY, ANALOGY, DIAGRAM, CRUXES, and GOTCHAS. Use when you want to know how code works or when the user asks "how does this work?"
Open skill

