Skip to content
Development
Skill

/ase-repo-stage

Stage only the part of the current Git working copy changes which belongs to a topic, to the last `CHANGELOG.md` entry, to the last turn, or to the entire session, by picking and, if necessary, splitting hunks, check that the staged state builds on its own, and optionally chain

From plugin
ase
7561 skills11 agents

Claude Code

$ npx -y skills add rse/ase --skill ase-repo-stage --agent claude-code

SKILL.md

ase-repo-stage.SKILL.md
name: ase-repo-stage
argument-hint: "[--help|-h] [--entry|-e] [--turn|-t] [--session|-s] [--merge|-m] [--no-verify|-V] [--worktree|-w] [--changelog|-c] [--commit|-C] [<topic>]"
description: >
    Stage only the part of the current Git working copy changes which
    belongs to a topic, to the last `CHANGELOG.md` entry, to the last
    turn, or to the entire session, by picking and, if necessary,
    splitting hunks, check that the staged state builds on its own,
    and optionally chain into ChangeLog updating and commit message
    crafting. Use when the user calls to "stage" only a part of the
    changes, like "the hunks related to" a topic or "the last turn".
user-invocable: true
disable-model-invocation: false
effort: high
allowed-tools:
    - "Bash(git *)"
    - "Bash(find *)"
    - "Bash(ln -s *)"
    - "Bash(rm -f *)"
    - "Write"
    - "Read"
    - "Skill"

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

<purpose name="ase-repo-stage"> Stage a Part of the Changes </purpose>

<expand name="getopt" arg1="ase-repo-stage" arg2="--entry|-e --turn|-t --session|-s --merge|-m --no-verify|-V --worktree|-w --changelog|-c --commit|-C"> $ARGUMENTS </expand>

<objective> *Stage* only the part of the current Git working copy changes which belongs to a *selection* -- a topic, the last `CHANGELOG.md` entry, the last turn, or the entire session -- by picking and, if necessary, *splitting* hunks, and *check* that the staged state builds on its own. </objective>

Procedure ---------

Throughout the entire skill, you *MUST* *NEVER* modify the *content* of any working copy file yourself: only the Git *index* is changed, the working copy is only *temporarily* stashed and restored by STEP 4, and only the chained `ase-repo-changelog` skill of STEP 5 may edit a file.

Whenever this skill *stops early* after STEP 1.5, first *undo* the intent-to-add marks of all files of <intent-files/> which carry no staged content by running the corresponding command (taken exactly as given) per file: `git reset -q -- "<file/>"`.

<flow>

1. <step id="STEP 1: Determine Selection and Change Set">

1. Set <topic><getopt-arguments/></topic>, with any leading and trailing whitespace stripped. If *more than one* of <getopt-option-entry/>, <getopt-option-turn/>, and <getopt-option-session/> is equal `true`, only output the following <template/> and then immediately *STOP*:

<template> ⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: options `--entry`, `--turn`, and `--session` are mutually exclusive </template>

2. Determine the *selection mode* <mode/>: set it to `entry`, `turn`, or `session` if the corresponding option is equal `true`. Otherwise, *infer* it from <topic/>: set it to `turn` if <topic/> refers to the changes of the last (or previous) turn, to `session` if it refers to all changes of the current session, to `entry` if it refers to the last ChangeLog entry, and in all these cases strip the referring words from <topic/>. Otherwise, set it to `topic`. An explicitly given option always *overrides* the inference, and a remaining non-empty <topic/> always *narrows* the modes `entry`, `turn`, and `session`.

If <mode/> is `topic` and <topic/> is empty, only output the following <template/> and then immediately *STOP*:

<template> ⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no selection given -- neither a topic nor `--entry`, `--turn`, or `--session` </template>

Otherwise, set <selection/> to a brief rendering of <mode/> and <topic/> (like `topic "<topic/>"`, `last ChangeLog entry`, `last turn`, or `session, narrowed to "<topic/>"`) and only output the following <template/>:

<template> ⧉ **ASE**: ✪ skill: **ase-repo-stage**, ⇌ selection: **<selection/>** </template>

3. Determine the *repository root* by running the corresponding command (taken exactly as given) and capturing its output into <repo-root/>. If this command fails, only output the following <template/> and then immediately *STOP*:

`git rev-parse --show-toplevel`

<template> ⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no Git repository </template>

4. <if condition="<getopt-option-merge/> is not equal `true`"> The selection *replaces* the current index content. Determine the staged and the unstaged files by running the corresponding commands (taken exactly as given):

`git -C "<repo-root/>" -c core.quotepath=off diff --cached --name-only`

`git -C "<repo-root/>" -c core.quotepath=off diff --name-only`

If a file occurs in *both* lists, its staged version exists *nowhere else* and would be lost by resetting the index, so only output the following <template/> and then immediately *STOP*, leaving everything untouched:

<template> ⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: files with both staged and unstaged changes -- use `--merge` or commit the staged changes first </template>

Otherwise, if the first list is not empty, *unstage* everything by running the corresponding command (taken exactly as given), which leaves the working copy untouched:

`git -C "<repo-root/>" reset -q` </if> <else> The selection is staged *on top* of the current index content, which hence stays untouched. Do not output anything. </else>

5. Determine the *untracked files* by running the corresponding command (taken exactly as given), skipping every entry below the `.ase/` directory, as it carries *ASE*'s own state:

`git -C "<repo-root/>" -c core.quotepath=off ls-files

Read more
@rse
Ships withase

Agentic Software Engineering (ASE)

7561 skills11 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
75
Star history of rse/ase on GitHub, a chart by star-history.com

Other skills on ase.

hello

hello

Show a nice greeting message with a timestamp. Use this when the user wants to greet or say hello, optionally to a certain…

@rse@rseInstall Skill
ase-arch-analyze

ase-arch-analyze

Review software architecture, including package cohesion and inter-package coupling

@rse@rseInstall Skill
ase-arch-discover

ase-arch-discover

Discover additional, third-party components (libraries/frameworks) for the technology stack to provide needed functionality.

@rse@rseInstall Skill
ase-code-analyze

ase-code-analyze

Analyze the source code for problems in either the logic and semantics and its related control flow, performance and efficiency,…

@rse@rseInstall Skill
ase-code-edit

ase-code-edit

Edit Source Code: Use when the user wants to "edit" the code base in one shot from a query or a bare analyzer issue id like "P1",…

@rse@rseInstall Skill
ase-code-explain

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…

@rse@rseInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about ase-repo-stage.

Which coding agents can use ase-repo-stage?
ase-repo-stage installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.