Global Rank · of 601 Skills
stacked-diffs AI Agent Skill
View Source: rarestg/rarestg-skills
CriticalInstallation
npx skills add rarestg/rarestg-skills --skill stacked-diffs 10
Installs
Stacked Diffs
Break large work into a chain of small, dependent PRs. Each PR is one logical unit — easy to review, test, and revert. The stack merges bottom-up into main.
Core Rule
Move to a new stacked branch whenever the current diff reaches a natural boundary. Do not accumulate a large changeset on one branch. Commit, push, open a PR, then branch off and keep going.
A natural boundary is any of:
- A self-contained logical step is complete (new type, new endpoint, new test file)
- The diff is approaching ~200–400 changed lines
- The next change serves a different concern than the current one
When to Stack
Stack when the work has multiple logical steps that build on each other:
- Scaffolding + core logic + edge cases
- Data model + API endpoint + UI integration
- Refactor + feature that depends on the refactor
Do NOT stack independent, unrelated changes — use separate PRs instead.
Workflow
1. Plan the stack
Before writing code, sketch the stack — an ordered list of diffs, each one logical step:
Stack: <feature>
01-<description> — <what and why>
02-<description> — <what and why>
03-<description> — <what and why>The plan can evolve. If a diff grows too large or a new step emerges during implementation, split on the fly.
2. Execute each diff
Work through the stack sequentially. For each diff:
# First diff branches from main
git checkout main && git pull && git checkout -b <feature>/01-<description>
# Subsequent diffs branch from the previous
git checkout -b <feature>/02-<description>When the diff is complete, commit, push, and open a PR:
git add <files> && git commit -m "<message>"
git push -u origin <branch>
# First PR targets main
gh pr create --base main --title "<title>" --body "$(cat <<'EOF'
...
EOF
)"
# Subsequent PRs target the previous branch
gh pr create --base <feature>/01-<description> --title "<title>" --body "$(cat <<'EOF'
...
EOF
)"Then immediately check out a new branch for the next diff and keep working.
3. PR descriptions
Include a stack table so reviewers see the full chain:
## Stack
PR N/M for <feature>.
| # | PR | Description |
|---|-----|-------------|
| 1 | #<number> | <description> |
| 2 | **this PR** | <description> |
## Changes
<what this specific PR does>Update earlier PRs with the table as new PRs are created.
4. Updating earlier diffs
If an earlier diff needs changes, rebase all downstream branches:
git checkout <feature>/01-<description>
# ... make changes, commit, push ...
git checkout <feature>/02-<description>
git rebase <feature>/01-<description>
git push --force-with-lease
git checkout <feature>/03-<description>
git rebase <feature>/02-<description>
git push --force-with-leaseAlways --force-with-lease, never --force.
Branch Naming
Pattern: <feature>/<NN>-<short-description>
auth/01-user-model
auth/02-login-endpoint
auth/03-session-middlewareNotes
- Work one diff at a time — do not batch-create all branches upfront.
- If a diff grows beyond ~400 lines, split it before pushing.
- To extend an existing stack, branch from the current top.
Installs
Security Audit
View Source
rarestg/rarestg-skills
More from this source
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
How to use this skill
Install stacked-diffs by running npx skills add rarestg/rarestg-skills --skill stacked-diffs in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.
No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.
The skill enhances your agent's understanding of stacked-diffs, helping it follow established patterns, avoid common mistakes, and produce production-ready output.
What you get
Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.
Compatibility
This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.