agentleFS
narenaryannarenaryan/agent-skills/skills/git/sapling-stacked-pr-workflow/SKILL.md

sapling-stacked-pr-workflow

Skill0 starsChanged 39 days agoMITView on GitHub

Use when Sapling's `sl` needs an older stacked commit amended, a restack conflicts or orphans children, or GitHub stack PR diffs overlap unexpectedly

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run sl and sl status. Confirm @, target, and pending files.

    line 12
  2. Very specific:

    Use sl unamend on a draft leaf whose predecessor has matching parents.

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Repair and Review Sapling Stacks

Sapling replaces amended commits; descendants restack or orphan on conflicts. Review edits in Smartlog (sl).

Edit a lower commit

  1. Run sl and sl status. Confirm @, target, and pending files. Unlike Git's index, sl amend includes all pending changes by default.
  2. At stack top, preview with sl absorb --dry-run, then inspect sl absorb targets before confirming. Accept only unambiguous chunks; unmatched changes stay pending. Absorbing can restack descendants and delete empty commits.
  3. For a new file or ambiguous change, run sl addremove if needed, then sl amend --to REV with the intended target. Or sl goto REV before amending. Confirm only intended files are pending.
  4. Inspect sl after edit. If children are orphaned, run sl restack; resolve conflicts then sl rebase --continue, or sl rebase --abort if unsafe. Verify graph and tests before publishing.

Recover a mistaken edit

  • sl undo restores the graph before the last graph operation; sl redo reverses that undo. It does not restore working-copy edits or retract remote publication.
  • Use sl unamend on a draft leaf whose predecessor has matching parents; the delta becomes pending. Use sl uncommit on a mistaken draft leaf when no changes are pending.
  • Inspect an earlier version with sl log -r "predecessors(REV)", replacing REV with the target; inspect a candidate via sl show before sl unhide.

Choose the GitHub review shape

Use only already-authorized GitHub credentials. Sapling needs a PAT; docs recommend gh auth login --git-protocol https. If absent, ask the owner to configure credentials; never create or broaden them. Check sl ssl and default / default-push. Get owner authorization before remote changes: sl pr submit --stack, sl push --to remote/my-feature, or creating a GitHub PR. Stacked PRs include draft ancestors and all lower commits, so GitHub diffs overlap; use ReviewStack where supported. Branch-based PRs use one branch per review. sl push -f force-updates a branch; require explicit owner approval and follow team policy.

Pitfalls

  • Amend changes commit IDs. Follow Smartlog, not stale hashes.
  • sl unhide also reveals ancestors. Local undo/hide does not retract a pushed commit or close/update its PR.
  • Release 0.2.20260929 asks before goto of an obsolete commit or committing atop one; HGPLAIN=1 retains old script behavior. Don't bypass the interactive prompt.
  • For .github/workflows PRs, default gh scopes lack workflow; sl pr submit may create/update the PR, then abort on its archive-branch update. Check GitHub; stop and ask the owner to approve gh auth refresh -s workflow before expanding scope or retrying.

See SOURCES.md for official references, version scope, and validation limits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.