@staff0rd/assist 0.541.1 → 0.542.0

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/README.md CHANGED
@@ -47,6 +47,7 @@ After installation, the `assist` command will be available globally. You can als
47
47
  - `/commit` - Commit only relevant files from the session
48
48
  - `/devlog` - Generate devlog entry for the next unversioned day
49
49
  - `/draft` - Draft a new backlog item with LLM-assisted questioning
50
+ - `/fix-conflict` - Resolve the current PR branch's merge conflicts against the remote default, verify, commit and push
50
51
  - `/forward-comments` - Split a coarse PR comment into per-line review comments, attributed to the original reviewer
51
52
  - `/handover` - Write a session handover note for the next conversation
52
53
  - `/pr` - Raise a PR with a concise description, then watch CI in the background
@@ -343,6 +344,7 @@ The Config tab of the sessions web dashboard never receives secret values: `GET
343
344
  - `assist bug [description] [--once]` - Launch Claude in `/bug` mode, chain into next on `/next` signal
344
345
  - `assist refine [id] [--once] [--harness <claude|codex|pi>]` - Launch a coding harness in `/refine` mode; `--harness` picks the engine, defaulting to the configured `harness.engine` (Claude)
345
346
  - `assist review-pr-comments [number] [--announce]` - Launch Claude in `/review-pr-comments` mode; a PR number is checked out first via `gh pr checkout`. `--announce` (requires a number) announces the PR in Slack via `/prs-slack <number> --no-confirm` once every comment thread has been processed
347
+ - `assist fix-conflict [number]` - Launch Claude in `/fix-conflict` mode to resolve the branch's conflicts against the remote default; a PR number is checked out first via `gh pr checkout`
346
348
  - `assist signal next [id]` - Write a next signal to chain into `assist next`
347
349
  - `assist signal done [id]` - Write a done signal marking the session's initial task complete; an optional `id` surfaces the backlog item the session created onto its card
348
350
 
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: Resolve the current PR branch's merge conflicts against the remote default
3
+ ---
4
+
5
+ Resolve the conflicts between this branch and the remote default branch, then push.
6
+
7
+ The branch is already checked out — `assist fix-conflict <number>` checks the PR out before launching this session. Never switch branches.
8
+
9
+ ## Step 1: Find the remote default branch
10
+
11
+ ```
12
+ git remote show origin | sed -n 's/.*HEAD branch: //p'
13
+ ```
14
+
15
+ Call the result `<default>`. If it comes back empty, fall back to `git symbolic-ref --short refs/remotes/origin/HEAD` and strip the `origin/` prefix.
16
+
17
+ ## Step 2: Fetch and merge
18
+
19
+ ```
20
+ git fetch origin
21
+ git merge origin/<default>
22
+ ```
23
+
24
+ If the merge reports "Already up to date" or completes cleanly with no conflicts, there is nothing to resolve — say so and stop. Do not push, do not create an empty commit.
25
+
26
+ ## Step 3: Resolve every conflicted file
27
+
28
+ List the conflicts with `git diff --name-only --diff-filter=U`, then work through them one at a time:
29
+
30
+ 1. Read the file and understand both sides. `git log --oneline origin/<default>..HEAD` and `git log --oneline HEAD..origin/<default>` show what each side changed and why.
31
+ 2. Write the resolution that keeps **both** intents. A conflict usually means two changes to the same region, not a choice between them — only drop a side when it is genuinely superseded.
32
+ 3. Remove every conflict marker (`<<<<<<<`, `=======`, `>>>>>>>`).
33
+ 4. `git add <file>`.
34
+
35
+ Handle the non-text cases explicitly:
36
+
37
+ - **Lock files** (`package-lock.json`, `pnpm-lock.yaml`): do not hand-merge. Take the default branch's version (`git checkout --theirs <file>`), then regenerate it with the project's install command and `git add` the result.
38
+ - **Delete/modify conflicts**: decide whether the deletion or the modification wins from the two logs, then `git rm <file>` or `git add <file>`.
39
+
40
+ Repeat until `git diff --name-only --diff-filter=U` is empty. Confirm no markers survived:
41
+
42
+ ```
43
+ git grep -n '^<<<<<<< \|^>>>>>>> ' -- . || true
44
+ ```
45
+
46
+ ## Step 4: Verify
47
+
48
+ Run `/verify`. Fix anything it reports — a merge that compiles on each side can still break where the two changes meet, so treat failures as part of the conflict resolution rather than pre-existing breakage.
49
+
50
+ Do not proceed to Step 5 until verify passes.
51
+
52
+ ## Step 5: Commit and push
53
+
54
+ ```
55
+ git commit --no-edit
56
+ git push
57
+ ```
58
+
59
+ `--no-edit` keeps git's generated merge message. Do not use `/commit` here — this is a merge commit, not a feature commit.
60
+
61
+ Report the resolved files and the pushed SHA when done.
62
+
63
+ ## Important
64
+
65
+ - Never `git merge --abort` or reset without being asked — the user launched this session to get the conflicts resolved.
66
+ - Never force-push on the merge strategy; a plain `git push` is correct because the merge only adds a commit.
67
+ - If a conflict genuinely cannot be resolved without a product decision, stop and ask the user rather than guessing.