repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(pi): add merge plan skill

ff709953f3e65558c2f63604d8df36585fb45917

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

+135 / −0 text lines

Diff layout

pi/agent/skills/merge-plan/SKILL.md

Added
new file mode 100644

+71 / −0 text lines

1---
2name: merge-plan
3description: "Use when planning or performing a pull, sync, merge, or rebase with upstream, especially in dirty repositories with conflicts, submodules, or worktrees."
4---
5
6# Merge Plan
7
8Synchronize local work with upstream safely.
9
10## Contract
12- A request to make a plan authorizes inspection only.
13- A request to pull, sync, merge, or rebase authorizes safe, reversible local execution.
14- Fetch only the required upstream state. Never push.
15- Preserve all local work. Unknown disposition blocks execution.
16- Decide obvious mechanics and conflict outcomes autonomously.
17- When intent, history, or a lossless path is unclear, ask one blocker at a time with evidence, consequences, and a recommendation; continue after the answer.
18- Use generic concepts in reasoning and reports. Use native terminology only for exact evidence or actions.
20Read [nested repository risks](references/nested-repositories.md) when submodules, nested repositories, or linked workspaces are present.
22## Workflow
241. **Resolve intent**
25 - Distinguish the configured tracking upstream from an integration target.
26 - Explicit target wins. A plain pull uses the configured tracking upstream.
27 - Derive integration strategy from explicit intent, repository policy, then effective configuration. Ask if still ambiguous.
292. **Inspect before changing**
30 - Discover the repository, related workspaces, and recursive submodules.
31 - Read instructions for every affected scope.
32 - Inspect active operations, conflicts, locks, workspace collisions, local work, recovery points, local history, and divergence.
33 - Refresh only the required target state.
353. **Design the integration**
36 - Partition dirty work into logical chunks: intent first, dependency cohesion second, conflict isolation third.
37 - Prefer coherent checkpoint commits. Recommend a temporary snapshot only when work cannot sensibly be committed.
38 - Compare local and incoming intent. Forecast overlapping paths and semantic conflicts.
39 - Order repositories and chunks by dependency.
40 - Plan recovery, verification, and recovery-point cleanup.
424. **Resolve blockers**
43 - Resolve evident choices without interruption.
44 - Ask only when plausible outcomes differ semantically or no lossless route is clear.
45 - Tests validate a resolution; they do not decide intent.
475. **Act when authorized**
48 - Create the planned recovery points and dirty-work snapshots.
49 - Apply checkpoint chunks and integrate in dependency order.
50 - Resolve obvious conflicts, verify them, and continue.
51 - Stop only for a blocker or unsafe state. Never push.
536. **Verify and finish**
54 - Run structural checks, targeted checks for each resolution, then repository-prescribed checks.
55 - Repair clear integration mistakes. Report unrelated or pre-existing failures without expanding scope.
56 - Keep rollback references until every repository matches the plan, local work is accounted for, verification passes, and the result is acknowledged.
57 - Before cleanup, check final state once more.
59## Output
61Stay terse. Expand only blockers and predicted conflicts.
631. Verdict
642. Blockers, when present
653. Repository graph
664. Dirty-work chunks
675. Conflict forecast
686. Ordered actions
697. Verification and rollback
71A plan is complete when action requires following it, not redesigning intent, preservation, ordering, resolution, verification, or rollback.

pi/agent/skills/merge-plan/references/nested-repositories.md

Added
new file mode 100644

+64 / −0 text lines

1# Nested Repository Risks
2
3## Recursive submodules
4
5Treat every submodule as an independent repository.
6For each one, distinguish:
7
8- dirty nested files;
9- the parent-recorded revision;
10- the checked-out revision;
11- local commits that record different nested revisions;
12- local and upstream divergence;
13- initialized versus unavailable worktree state.
15Inspect initialized submodules recursively.
16For uninitialized submodules, inventory metadata and the parent-recorded revision; initialize only when authorized execution requires it.
18Integrate and verify nested work before updating its parent pointer.
19Pushing is out of scope.
20Warn when the resulting parent pointer would reference a nested commit unavailable from its remote.
22Git subtrees receive ordinary tracked-file conflict analysis.
23Do not inspect subtree remotes, split history, pulls, or pushes.
25## Linked workspaces
27Inspect shared topology, active operations, locks, and target branch occupancy.
28Do not inspect unrelated workspace contents unless they can block or alter this synchronization.
30A lock is active or stale only after ownership and operation state establish which.
31Never remove one merely because it exists.
33## Git worktrees with submodules
35Git worktrees share refs and object storage while keeping worktree state such as HEAD and index separate.
36Git documents submodule support across multiple worktrees as incomplete.
37Do not assume nested checkout isolation.
39Before modifying a submodule in this topology, establish:
41- its worktree-specific Git directory;
42- its HEAD and branch ownership;
43- sibling worktrees using the same submodule repository;
44- active operations or locks in those worktrees.
46Conflict resolution is safe when the nested checkout has isolated worktree state, uses detached HEAD or a uniquely owned branch, and no sibling operation collides.
47Resolve mechanical collisions without changing work intent.
48Ask only when alternatives change work intent or no lossless route is clear.
49After resolution, verify the nested commit and update only the intended parent pointer.
51## Semantic conflicts
53For every predicted or actual conflict, state both intents, dependency impact, proposed semantic result, validation, and confidence.
54Never use blanket side selection as a substitute for intent.
55A passing test validates a candidate result but cannot choose between plausible behaviors.
57## Recovery points
59Use a named rollback reference for history rewrites or complex multi-repository integration.
60A clean fast-forward needs its original revision recorded.
61Dirty content needs a checkpoint commit or temporary snapshot in addition to a revision anchor.
63Retain existing and new recovery points until all local work is accounted for, verification passes, and the result is acknowledged.
64Then check final state and remove only the recovery points created for this synchronization.