@laitszkin/apollo-toolkit 3.9.6 → 3.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ All notable changes to this repository are documented in this file.
10
10
 
11
11
  ### Fixed
12
12
 
13
+ ## [v3.9.7] - 2026-05-09
14
+
15
+ ### Changed
16
+
17
+ - `merge-changes-from-local-branches`: restructure like `generate-spec` / `implement-specs` (Non-negotiables, Pause prompts, sample hints); drop mandatory `archive-specs` post-merge step; finalize via `commit-and-push` with local commit by default (push only when the user explicitly requests remote update); sync OpenAI agent `default_prompt`.
18
+
13
19
  ## [v3.9.6] - 2026-05-09
14
20
 
15
21
  ### Changed
@@ -1,167 +1,114 @@
1
1
  ---
2
2
  name: merge-changes-from-local-branches
3
3
  description: >-
4
- Read changes from local branches identified by branch name and merge them back
5
- into the current local branch. When conflicts arise, auto-resolve them by
6
- keeping correct functionality (preferring the more recent change on the same
7
- line, or the change that preserves working behavior). After merge verification,
8
- run `archive-specs` so completed plan sets are archived and durable project
9
- docs are synchronized, then hand the current branch state to `commit-and-push`
10
- so the final submit workflow commits and pushes on that same local branch.
11
- Use when the user asks to consolidate local branch work, merge named branches
12
- into the current branch, or prepare the current branch for integration.
4
+ Read changes from local branches identified by branch name and merge them back into the current local branch. Resolve conflicts by composing correct behavior (prefer the more recent change on the same line or the variant that preserves working behavior), using **`merge-conflict-resolver`** when needed. Verify after merges; remove successfully merged source branches and detached worktrees only after merge + verification succeed. Finalize through **`commit-and-push`** for submission-readiness gates and the **final local commit** on the same branch—**do not** push unless the user explicitly requested remote update in this thread (**`commit-and-push`** step 7). **Does not** run **`archive-specs`** as part of this skill.
5
+ Use when consolidating named local branch work into the current branch or preparing integration on that branch.
13
6
  ---
14
7
 
15
8
  # Merge Changes from Local Branches
16
9
 
17
10
  ## Dependencies
18
11
 
19
- - Required: `archive-specs` to archive completed plan sets and synchronize durable project docs after merge verification, and `commit-and-push` for the final current-branch submission flow.
20
- - Conditional: `merge-conflict-resolver` to resolve merge conflicts deterministically when conflicts arise.
12
+ - Required: **`commit-and-push`** for submission-readiness, mandated reviews, and the **final** commit on the original current branch (push **only** when the user explicitly asked for remote update in this thread—otherwise stop after commit).
13
+ - Conditional: **`merge-conflict-resolver`** when merge conflicts require deterministic resolution.
21
14
  - Optional: none.
22
- - Fallback: If git operations fail, stop and report the error.
15
+ - Fallback: If **`commit-and-push`** is unavailable, **MUST** stop and report—**MUST NOT** improvise readiness or use a bare `git commit` shortcut. If git merge operations fail irreparably, stop and report.
23
16
 
24
- ## Standards
17
+ ## Non-negotiables
25
18
 
26
- - Evidence: Inspect the original current branch, local branches, branch-name matches provided by the user or active spec names, actual conflicting files, and any active batch-spec `coordination.md` merge-order guidance before deciding what to merge.
27
- - Execution: Merge only the relevant named branches back into the original current branch, read any active batch-spec `coordination.md` and honor its documented merge order when present, resolve conflicts by reading both sides and editing the merged result to preserve shipped behavior, verify the merged state, delete each successfully merged source branch and its detached worktree only after the merged result is confirmed, run `archive-specs` after merge verification so completed plan sets are archived and durable docs are synchronized, then hand the final current-branch state to `commit-and-push` so changelog/readiness/commit/push work happens through the shared submission workflow on the same branch.
28
- - Quality: Never use blanket timestamp rules or default `-X ours/theirs` conflict resolution as the primary merge strategy, never infer in-scope branches from ancestry heuristics when branch names already define the target set, and do not declare success until the final current-branch state has been checked, verified, and cleared for post-merge archival/doc-sync work.
29
- - Output: Produce a clean current branch with all relevant named-branch changes integrated and ready for the shared submit workflow.
19
+ - **MUST** treat the branch that was current at workflow start as the **authoritative merge target** for the whole workflow; **MUST NOT** silently switch the destination to **`main`** or another branch unless the user explicitly rescopes.
20
+ - **MUST** determine in-scope branches from **explicit branch names** the user gives **or** from unambiguous mappings from active spec / `coordination.md` context—**MUST NOT** infer the merge set from ancestry heuristics alone when names already define intent.
21
+ - **MUST** read active batch **`coordination.md`** when present and honor a documented **`Merge order` / landing order**; if multiple batches conflict or branch-to-spec mapping is ambiguous, **MUST** stop and report instead of guessing order.
22
+ - **MUST** resolve conflicts by reading both sides and editing merged results that preserve shipped behavior—**MUST NOT** rely on blanket **`-X ours` / `-X theirs`** or timestamp guesses as the primary strategy.
23
+ - **`archive-specs`**: **MUST NOT** invoke **`archive-specs`** from this skill. Any archival or doc-sync routing belongs to **`commit-and-push`** (via **`submission-readiness-check`**) when that workflow’s gates require it—not a separate mandated step immediately after merges here.
24
+ - **MUST** verify the merged tree (targeted checks after conflictful merges; broader **`npm test` / equivalent** when the repo provides a standard command) before deleting source branches or handing off to **`commit-and-push`**.
25
+ - **MUST NOT** **`git push`**, tag, or release **from this skill**; **`commit-and-push`** owns push **only** when the user explicitly requested remote publication in this thread (**same rule as **`commit-and-push`** step 7**).
26
+ - **MUST** finalize through **`commit-and-push`** after staging the post-merge intent—**MUST NOT** bypass **`submission-readiness-check`** / mandated gates with a stray local commit path.
27
+ - **MUST NOT** force-delete merged branches (**`-D`**) when **`-d`** refuses; **MUST** stop and report branches that are not actually merged into the target.
30
28
 
31
- ## Goal
29
+ ## Standards (summary)
32
30
 
33
- Consolidate the intended named local branches back into the original current branch with automatic conflict resolution that preserves correct functionality.
31
+ - **Evidence**: `git branch`, `git log` / diff stats vs current branch, conflict file contents, `coordination.md` merge order when present.
32
+ - **Execution**: Inventory → clean target branch → sequential merges → verify → prune merged branches/worktrees → **`commit-and-push`** through local commit (push only if user asked).
33
+ - **Quality**: Scope strictly to named / mapped branches; no unrelated branch sweeps; no push-by-default from this workflow.
34
+ - **Output**: Integrated current branch ready for **`commit-and-push`**; concise report of merged/skipped branches, conflicts resolved, verification commands.
34
35
 
35
36
  ## Workflow
36
37
 
38
+ **Chain-of-thought:** Before each numbered step, answer the **`Pause →`** prompts. Validator or verification red **blocks** advancing to pruning or **`commit-and-push`**.
39
+
37
40
  ### 1) Inventory the current branch and in-scope named branches
38
41
 
39
- - Run `git branch` to list all local branches.
40
- - Check the current branch with `git branch --show-current` and capture `git status -sb`.
41
- - Inspect active planning artifacts under `docs/plans/` and look for batch roots that still contain live spec sets plus a `coordination.md`.
42
- - When an active batch is present, read its `coordination.md` before deciding merge order.
43
- - Treat the original current branch as the authoritative merge target for the whole workflow; do not silently switch that target to `main`.
44
- - Determine the in-scope branches directly from branch names:
45
- - prefer the exact branch names the user provided
46
- - otherwise map active spec-set names or documented merge-order entries to branch names
47
- - otherwise stop and report the missing branch-name target instead of inferring from ancestry
48
- - Accept a branch as in scope only when its branch name can be matched unambiguously to the requested merge set; skip unrelated local branches.
49
- - Compare each in-scope candidate branch against the current branch with `git log --oneline <current-branch>..<candidate>`, `git diff --stat <current-branch>...<candidate>`, or equivalent evidence so empty or already-merged branches are skipped.
50
- - For each branch, note:
51
- - Branch name
52
- - How the branch name was matched to the requested merge set
53
- - Commits ahead of the current branch
54
- - Last commit message (via `git log -1 --oneline`)
42
+ - Run `git branch`; capture `git branch --show-current` and `git status -sb`.
43
+ - Inspect `docs/plans/` for active batch roots that include **`coordination.md`**; read merge-order guidance **before** choosing sequence.
44
+ - Build the merge set from **user branch names**, else from unambiguous spec-name / **`coordination.md`** mappings—if a required name cannot be matched, stop and report.
45
+ - For each candidate: `git log --oneline <current>..<candidate>` and `git diff --stat <current>...<candidate>` (or equivalent); skip empty / already-up-to-date branches and record why.
46
+ - Per branch, note: name, match rationale, commits ahead, `git log -1 --oneline`.
47
+ - **Pause →** Is every in-scope branch matched **unambiguously**, not by “probably related” ancestry?
48
+ - **Pause →** If **`coordination.md`** gives a merge order, does my sequence match it literally?
55
49
 
56
50
  ### 1.5) Resolve merge order from active batch specs
57
51
 
58
- - Treat active batch specs as authoritative merge-order guidance when they include a concrete `Merge order / landing order` entry in `coordination.md`.
59
- - Map branch names to the corresponding spec sets or worktrees using the batch folder names, spec-set names, and documented merge-order entries; do not guess when the mapping is ambiguous.
60
- - Merge only the in-scope named branches in the documented order when that order is explicit.
61
- - If multiple active batches exist, reconcile their merge-order guidance before merging; if the orders conflict or the branch-to-spec mapping is unclear, stop and report the ambiguity instead of choosing an arbitrary sequence.
62
- - If no active batch spec provides an explicit merge order, fall back to the requested branch-name list and merge the relevant branches sequentially in that explicit name order.
52
+ - When **`coordination.md`** defines **`Merge order` / landing order**, merge **only** in that order after mapping branch names to specs/worktrees without guessing.
53
+ - When multiple active batches disagree or mapping is unclear, stop and report.
54
+ - When no explicit order exists, use the user’s branch list order sequentially.
55
+ - **Pause →** Would merging in a different order violate a written batch plan?
63
56
 
64
57
  ### 2) Ensure clean state on the original current branch
65
58
 
66
- - Check `git status` on the original current branch.
67
- - If the current branch has uncommitted changes that are unrelated to the merge request, stop and report them instead of stashing automatically.
68
- - Never change the authoritative target branch unless the user explicitly asks for a different destination.
69
- - Only proceed once you can state which branch or branches actually need to be merged.
59
+ - Inspect `git status`. If unrelated uncommitted changes block a safe merge, stop and report—**MUST NOT** stash or discard without user direction.
60
+ - **Pause →** Am I still on the **same** authoritative target branch I started with?
70
61
 
71
62
  ### 3) Merge branches sequentially in the resolved order
72
63
 
73
- For each in-scope named branch:
64
+ For each in-scope branch:
65
+
66
+ 1. `git checkout <current-branch>`
67
+ 2. `git merge <branch-name> --no-ff -m "Merge branch '<branch-name>' into <current-branch>"`
68
+ 3. On conflicts: use **`merge-conflict-resolver`**; then `git add` resolved paths.
69
+ 4. If resolution is ambiguous, prefer behavior that preserves tests, documented intent, and minimal semantic drift.
70
+ 5. Complete the merge commit if Git did not auto-complete.
74
71
 
75
- 1. Check out the original current branch:
76
- ```bash
77
- git checkout <current-branch>
78
- ```
72
+ ### 4) Verify merged state
79
73
 
80
- 2. Merge the branch:
81
- ```bash
82
- git merge <branch-name> --no-ff -m "Merge branch '<branch-name>' into <current-branch>"
83
- ```
74
+ - After conflictful merges, run the most relevant targeted tests or builds for touched areas.
75
+ - After all merges, run the repo’s usual validation (`npm test`, `cargo test`, etc.) when applicable.
76
+ - **Pause →** Did verification fail? **MUST** fix on the current branch before pruning or **`commit-and-push`**—**do not** hide red tests behind a merge report.
84
77
 
85
- 3. If conflicts occur, use $merge-conflict-resolver to resolve them deterministically.
78
+ ### 5) Prune merged sources (after verified success only)
86
79
 
87
- After resolving files:
88
- ```bash
89
- git add <resolved-files>
90
- ```
80
+ - `git worktree list`; remove worktrees for successfully merged branches when safe.
81
+ - `git branch -d <branch-name>` only for verified merges; refuse **`-D`** when **`-d`** fails—report instead.
82
+ - **Never** delete the original target branch, the checked-out branch, or branches that failed / were skipped.
91
83
 
92
- 4. If auto-resolution is ambiguous, prefer the change that:
93
- - Does not break existing tests
94
- - Preserves the documented feature intent
95
- - Aligns with the code currently shipped on the source branch
96
- - Minimizes hidden semantic drift between the merged modules
84
+ ### 6) Submit via **`commit-and-push`** (local commit; push optional)
97
85
 
98
- 5. Complete the merge:
99
- ```bash
100
- git commit -m "Merge branch '<branch-name>' into <current-branch>"
101
- ```
86
+ - Stage the post-merge / fix-up intent per user scope.
87
+ - Run **`commit-and-push`** through **commit**: inspect, classify gates, mandated reviews where applicable, **`submission-readiness-check`**, then commit with conventional message—**omit push** unless the user explicitly requested remote update in this thread ( **`commit-and-push`** step **7**).
88
+ - **MUST NOT** reintroduce **`archive-specs`** as a sibling step controlled by **this** skill; if **`submission-readiness-check`** routes archival work, **`commit-and-push`** owns that decision.
89
+ - **Pause →** Am I about to push without an explicit user request for remote publication?
90
+ - **Pause →** Does `git diff --cached` match intended merge scope—no stray unrelated paths?
102
91
 
103
- ### 4) Verify merged state
92
+ ### 7) Report
104
93
 
105
- - After each conflictful merge, run the most relevant targeted tests or build checks for the files that changed.
106
- - After all merges complete, run the repository's broader validation command when one exists:
107
- ```bash
108
- npm test # or yarn test, cargo test, etc.
109
- ```
110
- - If verification fails, fix the merged state on the current branch before proceeding.
111
-
112
- ### 5) Archive completed specs and sync durable project docs
113
-
114
- - After all in-scope merges succeed and the current-branch state has been verified, invoke `archive-specs`.
115
- - Let `archive-specs` convert and archive any completed `docs/plans/...` spec sets that now reflect the delivered outcome.
116
- - Let `archive-specs` synchronize durable project docs and `AGENTS.md/CLAUDE.md` when the merged result changed operator workflows, repository guidance, or user-visible behavior.
117
- - Do not proceed to the final submission commit while required archival or documentation updates remain unfinished.
118
- - If no completed spec sets or project-doc drift are present, record that evidence explicitly before moving on.
119
-
120
- ### 6) Hand off the merged result for shared submission handling
121
-
122
- - After a source branch has been merged successfully and the merged current-branch state has been verified, remove the source branch worktree if one exists:
123
- ```bash
124
- git worktree list
125
- git worktree remove <worktree-path>
126
- ```
127
- - Delete only branches that were merged successfully:
128
- ```bash
129
- git branch -d <branch-name>
130
- ```
131
- - If a branch still has an attached worktree, remove the worktree before deleting the branch.
132
- - Never delete:
133
- - the original current branch
134
- - the currently checked-out branch
135
- - branches that were skipped, failed to merge, or still need manual follow-up
136
- - If `git branch -d` refuses deletion because the branch is not actually merged, stop and report the branch instead of forcing deletion with `-D`.
137
- - Once merge verification and archival/doc synchronization pass, invoke `commit-and-push` for the original current branch so the final submission flow owns:
138
- - `CHANGELOG.md` readiness
139
- - the final commit creation on the original current branch
140
- - the user-requested push on that same branch
141
- - Do not duplicate commit-message or changelog-readiness logic inside this skill; post-merge archival must flow through `archive-specs`.
142
- - If a follow-up fix is required after verification or archival/doc sync, make that fix on the original current branch before handing off to `commit-and-push`.
143
-
144
- ### 7) Report completion
145
-
146
- - List all named branches that were merged.
147
- - List any branches intentionally skipped because they were already merged, empty, or out of scope.
148
- - Confirm the original current branch is updated with all merged changes.
149
- - Note any conflicts that were resolved and the rationale.
150
- - Report the verification commands that were run.
151
- - Report whether `archive-specs` updated durable docs or found no archival/doc-sync work to do.
152
- - Confirm whether the workflow stopped at the local commit boundary or continued into a remote push because the user explicitly requested it.
94
+ - List merged vs skipped branches and why.
95
+ - Current branch name; confirmation merges landed on original target.
96
+ - Conflicts resolved and brief rationale.
97
+ - Verification commands executed.
98
+ - State whether completion stopped at **local HEAD** (**no push**) or included push per explicit user ask.
99
+
100
+ ## Sample hints
101
+
102
+ - **Skip**: candidate shows no commits ahead of current—record “already merged / empty”.
103
+ - **`coordination.md`**: landing order **`api-layer`** then **`cli-wrapper`** merge matching branches in that sequence even if creation dates differ.
104
+ - **`commit-and-push` without push**: user said “merge and commit locally”—run **`commit-and-push`** gates and commit; report `HEAD` hash; **no** **`git push`**.
153
105
 
154
106
  ## Working Rules
155
107
 
156
- - Never force-push; use only merge or rebase with merge.
157
- - Prefer preserving functionality over keeping either branch's exact changes.
158
- - Do not push to remote from this skill directly; let `commit-and-push` own any later publish step only when the user explicitly requests it.
159
- - Never merge unrelated or ambiguously matched branches into the current branch; merge only branches whose names are explicitly requested or can be matched unambiguously from the active spec context.
160
- - If a branch contains no meaningful changes (empty merge), skip it.
161
- - Keep the current branch history clean and readable.
162
- - If a branch's merge breaks tests, resolve the conflict differently before committing.
163
- - Do not stash or discard unrelated work automatically; stop when the working tree state makes the merge ambiguous.
164
- - Delete merged source branches and their detached worktrees only after the merge commit and verification both succeed.
165
- - When active batch specs provide merge-order guidance for in-scope named branches, follow that order unless new evidence proves the plan is stale or inapplicable; if so, stop and report the mismatch instead of silently overriding the batch plan.
166
-
167
- Resolve conflicts using $merge-conflict-resolver.
108
+ - Never force-push from this workflow.
109
+ - Preserve functionality over winning either branchs raw diff verbatim.
110
+ - Do not merge ambiguously matched or unrelated branches.
111
+ - Do not delete merged sources until merge commit **and** verification succeed.
112
+ - When batch merge-order documentation applies, follow it unless you stop with evidence it is stale.
113
+
114
+ Resolve conflicts using **`merge-conflict-resolver`**.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Merge Changes from Local Branches"
3
3
  short_description: "Merge named local branches back into the current branch with checked conflict resolution"
4
- default_prompt: "Use $merge-changes-from-local-branches to inventory the current branch plus the named local branches that should be merged, inspect active batch-spec `coordination.md` files under `docs/plans/` and follow their documented merge order when present, match the merge scope by branch name instead of branch ancestry, merge only those in-scope branches back into the same current branch, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, run `archive-specs` so completed plan sets are archived and durable docs are synchronized before the final submit step, delete successfully merged source branches and detached worktrees only after verification succeeds, and leave remote publication to `commit-and-push`."
4
+ default_prompt: "Use $merge-changes-from-local-branches to inventory the current branch plus the named local branches that should be merged, inspect active batch-spec `coordination.md` files under `docs/plans/` and follow their documented merge order when present, match the merge scope by branch name instead of branch ancestry, merge only those in-scope branches back into the same current branch, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, delete successfully merged source branches and detached worktrees only after verification succeeds, then run $commit-and-push for submission-readiness and the final local commit on that branch without pushing unless the user explicitly requested remote update in the same thread. Do not invoke $archive-specs from this skill."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "3.9.6",
3
+ "version": "3.9.7",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",