@remixhq/claude-plugin 0.1.17 → 0.1.19
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/.claude-plugin/plugin.json +1 -1
- package/README.md +35 -0
- package/agents/remix-collab.md +14 -5
- package/dist/historical.d.ts +31 -0
- package/dist/historical.js +443 -0
- package/dist/historical.js.map +1 -0
- package/dist/hook-post-collab.cjs +29 -62
- package/dist/hook-post-collab.cjs.map +1 -1
- package/dist/hook-pre-git.cjs +19 -13
- package/dist/hook-pre-git.cjs.map +1 -1
- package/dist/hook-stop-collab.cjs +3592 -1810
- package/dist/hook-stop-collab.cjs.map +1 -1
- package/dist/hook-user-prompt.cjs +7656 -74
- package/dist/hook-user-prompt.cjs.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.cjs +40997 -37432
- package/dist/mcp-server.cjs.map +1 -1
- package/package.json +14 -3
- package/skills/identity-and-scope-routing/SKILL.md +1 -0
- package/skills/init-or-remix/SKILL.md +12 -2
- package/skills/review-merge-request/SKILL.md +5 -3
- package/skills/safe-collab-workflow/SKILL.md +43 -11
- package/skills/submit-change-step/SKILL.md +75 -16
- package/skills/sync-and-reconcile/SKILL.md +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remixhq/claude-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Claude Code plugin for Remix collaboration workflows",
|
|
5
5
|
"homepage": "https://github.com/RemixDotOne/remix-claude-plugin",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,16 +23,27 @@
|
|
|
23
23
|
"hooks",
|
|
24
24
|
"agents"
|
|
25
25
|
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./historical": {
|
|
32
|
+
"types": "./dist/historical.d.ts",
|
|
33
|
+
"import": "./dist/historical.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
26
36
|
"scripts": {
|
|
27
37
|
"build": "tsup",
|
|
28
38
|
"postbuild": "node -e \"const fs=require('node:fs'); for (const p of ['dist/mcp-server.cjs','dist/hook-pre-git.cjs','dist/hook-user-prompt.cjs','dist/hook-post-collab.cjs','dist/hook-stop-collab.cjs']) fs.chmodSync(p, 0o755);\"",
|
|
29
39
|
"dev": "tsx src/mcp-server.ts",
|
|
30
40
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
41
|
+
"test": "node --import tsx --test src/**/*.test.ts",
|
|
31
42
|
"prepack": "npm run build"
|
|
32
43
|
},
|
|
33
44
|
"dependencies": {
|
|
34
|
-
"@remixhq/core": "^0.1.
|
|
35
|
-
"@remixhq/mcp": "^0.1.
|
|
45
|
+
"@remixhq/core": "^0.1.14",
|
|
46
|
+
"@remixhq/mcp": "^0.1.14"
|
|
36
47
|
},
|
|
37
48
|
"devDependencies": {
|
|
38
49
|
"@types/node": "^25.4.0",
|
|
@@ -28,6 +28,7 @@ Recommended sequence:
|
|
|
28
28
|
Important rules:
|
|
29
29
|
|
|
30
30
|
- In a bound repo, treat the app as the default anchor for scope reasoning.
|
|
31
|
+
- When the user asks for any URL, link, dashboard, or web address of a Remix-bound repo or app — phrasings like "URL of this repo", "link to this app", "where do I see it on the dashboard", "remix URL" — use `remix_collab_status` and answer with `binding.dashboardUrl`. That value is already in the canonical `https://dashboard.remix.one/apps/<appId>` form. Do NOT use `binding.remoteUrl` for this — that is the git remote URL, which is unrelated to the Remix dashboard. If `binding.dashboardUrl` is null but `binding.currentAppId` is set, fall back to constructing `https://dashboard.remix.one/apps/<currentAppId>`.
|
|
31
32
|
- Do not assume the bound app's project or organization is readable just because the app is readable.
|
|
32
33
|
- Treat warnings on cwd-derived results as meaningful partial context, not as failure.
|
|
33
34
|
- If cwd inference cannot safely resolve a broader scope, prefer the app-level answer and explain the boundary.
|
|
@@ -5,6 +5,12 @@ description: Use when deciding whether to bind the current repo to Remix or crea
|
|
|
5
5
|
|
|
6
6
|
# Init, Remix, Or Checkout
|
|
7
7
|
|
|
8
|
+
## Silent-init rule
|
|
9
|
+
|
|
10
|
+
If during any turn you find yourself on an unbound branch in a Remix-bound repo — whether the user mentioned Remix or not, whether the prompt is trivial or not — **silently run `remix_collab_init` on the current branch without asking**. This is not a decision point. Do not present init as one option among several. Do not switch to a bound branch to avoid init. Init the branch you are on.
|
|
11
|
+
|
|
12
|
+
The user-facing decision tree below (init vs. remix vs. checkout) only applies when the user is explicitly choosing how to bring a repo into Remix for the first time. Mid-turn unbound-branch recovery is always silent init.
|
|
13
|
+
|
|
8
14
|
Use this skill when onboarding a repository into Remix, starting from an existing Remix app lineage, or checking out an exact existing Remix app.
|
|
9
15
|
|
|
10
16
|
This is the entry-point choice:
|
|
@@ -15,8 +21,8 @@ This is the entry-point choice:
|
|
|
15
21
|
|
|
16
22
|
Decision rule:
|
|
17
23
|
|
|
18
|
-
- Use `remix_collab_init` when the user wants to
|
|
19
|
-
- Use `remix_collab_remix` when the user wants a new local
|
|
24
|
+
- Use `remix_collab_init` when the user wants the current repo to become a Remix app. This is the only way to bring a non-Remix repo into Remix — remix and checkout both require an existing appId.
|
|
25
|
+
- Use `remix_collab_remix` ONLY when an existing Remix appId is already known or provided or the user indicated that they want to remix or fork and the user wants to fork that app into a new directory. If no appId exists and no indication is given and this is an unbound local repo, this tool does not apply — you cannot 'remix' an unbound local repo.
|
|
20
26
|
- Use `remix_collab_checkout` when the user wants the exact existing app checked out locally as-is.
|
|
21
27
|
|
|
22
28
|
Recommended sequence:
|
|
@@ -29,12 +35,14 @@ Recommended sequence:
|
|
|
29
35
|
4. If the task starts from an existing app id and the user wants a new fork, prefer `remix_collab_remix`.
|
|
30
36
|
5. If the task starts from an existing app id and the user wants the same app id locally, prefer `remix_collab_checkout`.
|
|
31
37
|
6. After init, remix, or checkout, use `remix_collab_status` in the resulting repo to inspect readiness.
|
|
38
|
+
7. After a successful `remix_collab_init` (i.e. the user just bound a brand-new repo), include a one-line collaboration hint in your user-facing summary, phrased naturally and conversationally — for example: "You can invite teammates to collaborate at any time by asking me to invite their email (e.g. \"invite alice@example.com\")." Show this once, right after the post-init summary; do not repeat it on subsequent turns, on `remix_collab_remix`, or on `remix_collab_checkout` (those flows join an app that already has collaborators). When the user actually asks you to invite someone by email, use `remix_collab_invite` with the email and let the tool default the scope to the current binding.
|
|
32
39
|
|
|
33
40
|
Important note:
|
|
34
41
|
|
|
35
42
|
- `remix_collab_init` is a repo-level, history-preserving bind of the current git repository.
|
|
36
43
|
- Do not treat init as a subdirectory import workflow.
|
|
37
44
|
- `remix_collab_remix` creates a new bound checkout in a newly created directory under the provided or current working directory.
|
|
45
|
+
- `remix_collab_remix` forks an existing Remix app (requires appId) into a new directory under the provided or current working directory. It never reads or binds the current repo.
|
|
38
46
|
- `remix_collab_checkout` creates a new bound checkout for the exact existing app id without creating a new fork.
|
|
39
47
|
- Do not treat remix as binding the current repository in place.
|
|
40
48
|
- When app discovery is only about \"what can I actually work on?\", prefer membership-oriented listing (`accessScope=\"explicit_member\"`) over broad readable discovery.
|
|
@@ -42,3 +50,5 @@ Important note:
|
|
|
42
50
|
- If the user wants to start from an existing Remix app lineage with a new fork, use `remix_collab_remix`.
|
|
43
51
|
- If the user wants to continue work on the same existing app id, use `remix_collab_checkout`.
|
|
44
52
|
- After init, remix, or checkout, run `remix_collab_status` in the resulting repo and then follow the normal bound-repo workflow there.
|
|
53
|
+
- If the user's request was ambiguous, ask for clarification in a very easy to understand and explanatory way. Remix is a new concept and you need to assume the user is not familiar with it.
|
|
54
|
+
- If the user suggest creating a remix, initializing a remix, or something that indicates they want to start using remix on the local repo without mentioning anything specific about an app and the app is unbound, they probably want `remix_collab_init`.
|
|
@@ -19,17 +19,19 @@ Recommended sequence:
|
|
|
19
19
|
- `app_outgoing` for requests opened from this app
|
|
20
20
|
- `app_related_visible` for all open visible requests where this app is source or target
|
|
21
21
|
2. Use `remix_collab_view_merge_request` to inspect the request.
|
|
22
|
-
3.
|
|
23
|
-
4.
|
|
22
|
+
3. If the current repo reports `await_finalize`, use `remix_collab_drain_finalize_queue`, then re-check `remix_collab_status` before request-merge or target-mutating approval flows.
|
|
23
|
+
4. Request bounded diff output first. Only request a larger diff if needed to answer the review task accurately.
|
|
24
|
+
5. If approval is requested:
|
|
24
25
|
- use `remix_collab_approve_remote` when local target repo sync is not needed
|
|
25
26
|
- use `remix_collab_approve_and_sync_target` only when you are in the correct target repo context and the user wants local sync too
|
|
26
|
-
|
|
27
|
+
6. Use `remix_collab_reject` when the correct outcome is rejection.
|
|
27
28
|
|
|
28
29
|
Important rules:
|
|
29
30
|
|
|
30
31
|
- In a bound repo, use Remix review tools as the default path for MR handling.
|
|
31
32
|
- Choose an explicit queue instead of treating merge requests as one broad inbox.
|
|
32
33
|
- Do not treat raw `git merge` as the way Remix merge requests are approved or applied.
|
|
34
|
+
- Do not assume a successful `remix_collab_finalize_turn` already created a remote change step; drain and re-check when status reports `await_finalize`.
|
|
33
35
|
- If approval would mutate the local target repo, explain that before applying it.
|
|
34
36
|
- If the repo context is unclear, stay in remote-only review mode until the target repo is confirmed.
|
|
35
37
|
- Before the final response, use `remix_collab_finalize_turn` to record the completed review turn.
|
|
@@ -7,19 +7,32 @@ description: Use when working in a repo that may be bound to Remix, especially f
|
|
|
7
7
|
|
|
8
8
|
In a Remix-bound repo, treat Remix MCP tools as the authoritative workflow layer for collaboration state and historical reasoning.
|
|
9
9
|
|
|
10
|
+
## Runtime override (read this first)
|
|
11
|
+
|
|
12
|
+
When this turn's context contains a Remix runtime status note (recognizable by the literal `[Remix runtime status]` prefix from the Remix `UserPromptSubmit` hook), recording and queue draining for **this** turn are handled automatically by the runtime's `Stop` hook. In that case:
|
|
13
|
+
|
|
14
|
+
- Do **not** call `remix_collab_finalize_turn` for this turn — the runtime is recording it. Calling it would create a duplicate record.
|
|
15
|
+
- Do **not** call `remix_collab_drain_finalize_queue` as a precondition for anything. The runtime drains the queue automatically in the background; mutation tools (`remix_collab_request_merge`, `remix_collab_reconcile_apply`) also drain internally before they run.
|
|
16
|
+
|
|
17
|
+
The runtime status note is authoritative for the override. The rest of this skill — including the "before the final response, you must record" rule — still applies for **tool errors**, **explicit recovery flows**, and **turns where no runtime status note is present**.
|
|
18
|
+
|
|
10
19
|
Canonical rules:
|
|
11
20
|
|
|
12
21
|
- In a bound repo, Remix tools are the required workflow layer for collaboration work.
|
|
13
22
|
- In a bound repo, branch switches are collaboration-state transitions because each branch can resolve to its own Remix lane and app lineage.
|
|
23
|
+
- Never switch git branches on your own. Branch switches are user-initiated only. If a Remix tool points at a different branch, do not "fix" it by switching — run `remix_collab_status` and follow its recommendation for the current branch.
|
|
24
|
+
- An unbound branch is always a silent-init situation. Run `remix_collab_init` without asking. The user's intent when working on a branch is that the branch be bound.
|
|
14
25
|
- Historical intent questions go to Remix memory before raw git history.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
26
|
+
- Remix is source-blind: any local content change since the last recorded turn — whether you typed it, the user typed it, a merge produced it, `git pull` brought it in, or an IDE saved it — is captured by exactly one `remix_collab_finalize_turn`. Do not pick a different command based on what produced the change. `re-anchor` is for the narrow missing-baseline case only (status reports `re_anchor`).
|
|
27
|
+
- Raw git mutation is allowed in a bound repo, but it never substitutes for `remix_collab_finalize_turn`. After raw git mutations, run `remix_collab_status` and record with `finalize-turn`.
|
|
28
|
+
- Before the final response, you must record exactly one completed turn with `remix_collab_finalize_turn` — **unless the runtime override at the top of this skill applies** (a `[Remix runtime status]` note from the Remix hook stating that the Stop hook will record this turn).
|
|
29
|
+
- `remix_collab_finalize_turn` is queued only. It captures the local boundary first; a remote change step does not exist yet until the finalize queue drains.
|
|
17
30
|
- The recording call must include the exact user prompt and your final assistant response.
|
|
18
|
-
- Do not finish the response before recording the completed turn.
|
|
31
|
+
- Do not finish the response before recording the completed turn (subject to the runtime override).
|
|
19
32
|
- Prefer preview tools before apply tools whenever both exist.
|
|
20
33
|
- Treat reconcile as high risk and use it only when sync is unavailable and clearly required.
|
|
21
34
|
|
|
22
|
-
Raw git mutation commands
|
|
35
|
+
Raw git mutation commands are not the normal collaboration path, but they are allowed. When they are used, treat the result the same as any other local content change: run `remix_collab_status` and follow its `recommendedAction` (almost always `record` → `remix_collab_finalize_turn`). Raw git reads are reserved for exact repository facts, not for normal collaboration-state or historical-reasoning flows.
|
|
23
36
|
|
|
24
37
|
Follow this order:
|
|
25
38
|
|
|
@@ -28,29 +41,48 @@ Follow this order:
|
|
|
28
41
|
3. Prefer preview tools before apply tools:
|
|
29
42
|
- `remix_collab_sync_preview` before `remix_collab_sync_apply`
|
|
30
43
|
- `remix_collab_reconcile_preview` before `remix_collab_reconcile_apply`
|
|
31
|
-
4.
|
|
32
|
-
5.
|
|
44
|
+
4. If status reports `await_finalize`, use `remix_collab_drain_finalize_queue`, then re-check `remix_collab_status` before merge-related or recovery flows.
|
|
45
|
+
5. Prefer Remix merge request tools over raw git merge flows for collaboration review work.
|
|
46
|
+
6. When you need historical context, hidden intent, failed attempts, merge/reconcile lineage, or pre-change risk context, check Remix memory before falling back to broader repo exploration:
|
|
33
47
|
- `remix_collab_memory_summary`
|
|
34
48
|
- `remix_collab_memory_search`
|
|
35
49
|
- `remix_collab_memory_timeline`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
7. Only call `remix_collab_memory_change_step_diff` after you already have a specific `changeStepId`.
|
|
51
|
+
8. Use raw git history only after Remix memory has narrowed the relevant change, or when the user explicitly asks for exact commit, blame, ancestry, or patch-level detail.
|
|
52
|
+
9. Before the final response, call `remix_collab_finalize_turn`, **unless** the runtime override at the top of this skill applies for this turn — in which case the runtime records it on your behalf and a manual call would be a duplicate.
|
|
39
53
|
|
|
40
54
|
After switching branches:
|
|
41
55
|
|
|
42
56
|
1. Run `remix_collab_status`.
|
|
43
57
|
2. If the branch is healthy and bound, continue with the requested workflow.
|
|
44
|
-
3. If the branch is unbound,
|
|
58
|
+
3. If the branch is unbound, silently run `remix_collab_init` on that branch before mutation commands. Do not ask, do not offer to switch back to another branch — init the branch you are on.
|
|
45
59
|
4. If status reports a branch mismatch, stop and recover the correct branch binding before recording, syncing, reconciling, or opening a merge request.
|
|
46
60
|
5. Do not assume another branch's binding is safe to reuse on the current checkout.
|
|
47
61
|
|
|
62
|
+
Detecting an unexpected branch or binding state:
|
|
63
|
+
|
|
64
|
+
Branch state can change between turns by means you did not initiate — external git operations, IDE actions, or hook side effects. You must detect and recover, not assume continuity.
|
|
65
|
+
|
|
66
|
+
**Treat any of the following as a mandatory trigger to run `remix_collab_status` before any other Remix mutation or response:**
|
|
67
|
+
|
|
68
|
+
- A Remix tool returns an error mentioning a branch name you did not just switch to.
|
|
69
|
+
- A Remix tool returns an error mentioning "not yet bound", "branch mismatch", "binding missing", or "baseline missing".
|
|
70
|
+
- `git status` or a bash command reveals a branch that does not match your mental model of the session.
|
|
71
|
+
- Any hook reminder, system-reminder, or preflight message flags an unexpected binding condition.
|
|
72
|
+
|
|
73
|
+
**NEVER skip `remix_collab_status` on one of these triggers.** Do not work around the error by calling the next tool in the expected sequence, stashing, switching branches blindly, or declaring the situation unresolvable. The status tool is the only source of truth for the current lane binding, and every recovery decision must be grounded in its output — not in your memory of an earlier state, not in the error message alone, not in shell output.
|
|
74
|
+
|
|
75
|
+
**NEVER end your response with an unhandled Remix error.** If a Remix tool fails and you cannot resolve it this turn, at minimum: run `remix_collab_status`, report the real state to the user, and explicitly ask how to proceed. Silently giving up is not an option in a bound repo.
|
|
76
|
+
|
|
77
|
+
**NEVER switch branches to "recover" from an unexpected binding state.** If status shows the current branch is unbound or mismatched, the recovery is `remix_collab_init` (silent) or a user-facing question — never `git checkout` another branch. Branch switches belong to the user.
|
|
78
|
+
|
|
48
79
|
Important rules:
|
|
49
80
|
|
|
50
81
|
- If the repo is unbound, use `remix_collab_init` for the current repo, `remix_collab_remix` for a new fork from an existing app lineage, or `remix_collab_checkout` to materialize an existing app as-is.
|
|
51
|
-
- In a bound repo,
|
|
82
|
+
- In a bound repo, raw git mutations (`commit`, `pull`, `merge`, `rebase`, `reset`) are allowed but never replace `remix_collab_finalize_turn`. After any raw git mutation, run `remix_collab_status` and record with `finalize-turn`. Do not assume `re-anchor` is the recovery — that command is only for missing-baseline cases (`recommendedAction: re_anchor`).
|
|
52
83
|
- In a bound repo, do not start why/history/failed-attempt questions with raw git `log`, `show`, `blame`, or `diff`; start with Remix memory reads instead.
|
|
53
84
|
- In a bound repo, do not finish the response before recording the completed turn yourself.
|
|
85
|
+
- Do not treat a successful `remix_collab_finalize_turn` call as proof that the turn is already available for merge-request or remote-history workflows. Drain and re-check when status reports `await_finalize`.
|
|
54
86
|
- After the final recording call, avoid further repo mutations unless you intend to record another final turn.
|
|
55
87
|
- Use raw git reads only when the task is clearly about exact repository facts or a separate GitHub-only branch workflow rather than Remix state.
|
|
56
88
|
- When viewing merge requests, request bounded diff output first and only ask for more detail if needed.
|
|
@@ -1,32 +1,91 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: Use when code edits are complete in a Remix-bound repo and the
|
|
2
|
+
name: finalize-turn-workflow
|
|
3
|
+
description: Use when code edits or review work are complete in a Remix-bound repo and the turn should be recorded with `remix_collab_finalize_turn`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Finalize A Remix Turn
|
|
7
7
|
|
|
8
|
-
Use this skill after edits are complete and the task should be captured as the final recorded turn in a Remix-bound repo.
|
|
8
|
+
Use this skill after edits or review work are complete and the task should be captured as the final recorded turn in a Remix-bound repo.
|
|
9
9
|
|
|
10
|
-
This skill is specifically about
|
|
10
|
+
This skill is specifically about the queued-finalize model behind `remix_collab_finalize_turn`.
|
|
11
|
+
|
|
12
|
+
## Source-blind recording rule
|
|
13
|
+
|
|
14
|
+
Remix records turns source-blind. Any local content change since the last recorded turn — whether you typed it, the user typed it, a `git pull` brought it in, a `git merge` or `git rebase` produced it, or an IDE saved it — is captured by exactly one `remix_collab_finalize_turn`. `finalize-turn` automatically attaches `preTurnEvents` metadata describing any commits, merges, or uncommitted state captured at the boundary; you do not need to summarize that yourself.
|
|
15
|
+
|
|
16
|
+
Do **not** pick a different command (`re-anchor`, `sync`, `reconcile`) based on what produced the local change. Those commands are only correct when `remix_collab_status.recommendedAction` explicitly names them:
|
|
17
|
+
|
|
18
|
+
- `record` (or `repoState: local_only_changed`) → `remix_collab_finalize_turn`. This is the catch-all and the most common case.
|
|
19
|
+
- `re_anchor` → `remix_collab_re_anchor_*`. Only when no local Remix baseline exists for this lane (fresh clone, deleted `.remix/`, or first init didn't seed). Re-anchor seeds the baseline; it is not a recovery for "the local content changed."
|
|
20
|
+
- `pull` → `remix_collab_sync_*`. Only when the server lane advanced and local did not.
|
|
21
|
+
- `reconcile` → `remix_collab_reconcile_*`. Only when both sides changed since the agreed baseline.
|
|
22
|
+
|
|
23
|
+
## Runtime override (read this first)
|
|
24
|
+
|
|
25
|
+
When a Remix runtime status note appears in this turn's context — recognizable by the literal `[Remix runtime status]` prefix and originating from the Remix `UserPromptSubmit` hook — recording and queue draining for **this** turn are handled automatically by the runtime's `Stop` hook. In that case:
|
|
26
|
+
|
|
27
|
+
- Do **not** call `remix_collab_finalize_turn` for this turn. The runtime is recording it. A redundant call would create a duplicate record.
|
|
28
|
+
- Do **not** call `remix_collab_drain_finalize_queue` for this turn. The runtime drains the queue automatically in the background. Mutation tools (`remix_collab_request_merge`, `remix_collab_reconcile_apply`) drain internally before they run, so manual draining is never required as a precondition.
|
|
29
|
+
|
|
30
|
+
The runtime status note is authoritative for the override. Everything else in this skill — the mandates, the "NEVER" rules, the recovery sequences — still applies for **error recovery**, **tool failures**, and **turns where no runtime status note is present**. Treat the override as covering only the routine "I just finished a healthy turn, time to record it" case.
|
|
11
31
|
|
|
12
32
|
Workflow:
|
|
13
33
|
|
|
14
34
|
1. Run `remix_collab_status` first to confirm the repo is bound and inspect current warnings.
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
35
|
+
2. If status recommends `await_finalize`, do not record again and do not request a merge yet. Use `remix_collab_drain_finalize_queue`, then re-check `remix_collab_status`.
|
|
36
|
+
3. When the repo is ready, use `remix_collab_finalize_turn` before the final response, with the exact user prompt and your final assistant response — **unless the runtime override above applies**.
|
|
37
|
+
4. Treat `remix_collab_finalize_turn` as capturing the local workspace boundary and queueing remote processing, not as immediate proof that a remote change step already exists.
|
|
18
38
|
|
|
19
39
|
Important behavior:
|
|
20
40
|
|
|
21
41
|
- `remix_collab_finalize_turn` is the authoritative recording path for completed work instead of raw git commit or push.
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- Surface these side effects clearly to the user when they matter.
|
|
42
|
+
- `remix_collab_finalize_turn` is queued only. A remote change step does not exist yet until the finalize queue drains successfully.
|
|
43
|
+
- A successful finalize call means local capture and queueing succeeded. It does not mean merge-request or remote-history workflows can assume the turn is already materialized remotely.
|
|
44
|
+
- If `remix_collab_status` reports `await_finalize`, use `remix_collab_drain_finalize_queue` and re-check status before merge-related or recovery flows.
|
|
26
45
|
- If the user wants to understand current repo state before recording, re-run `remix_collab_status`.
|
|
27
46
|
- Do not make further repo mutations after the final recording call unless you intend to record another completed turn.
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- If the
|
|
47
|
+
- Do not retry finalize immediately just because a remote record is not visible yet; queue drain is the next step, not a second finalize.
|
|
48
|
+
- If finalize or drain returns `recommendedNextActions` or an `error.hint`, those fields are **authoritative and mandatory**. Do not ignore them. Do not improvise around them. Call `remix_collab_status` first and use its result plus the hint together to choose the next tool. Skipping this step is the single most common way agents fail in this skill.
|
|
49
|
+
- If the tool surfaces a preserved local recovery artifact, mention it explicitly and keep it available while you repair repo state.
|
|
50
|
+
|
|
51
|
+
Use the live worktree as the source of truth for finalized work. If the repo is not ready, fix the preflight state first rather than trying to bypass it.
|
|
52
|
+
|
|
53
|
+
## Finalize errors — non-negotiable rules
|
|
54
|
+
|
|
55
|
+
When `remix_collab_finalize_turn` returns an error, you are in a state-recovery situation. You do not have permission to end your turn until it is resolved.
|
|
56
|
+
|
|
57
|
+
**NEVER, UNDER ANY CIRCUMSTANCES, END A TURN WITH AN UNHANDLED FINALIZE ERROR.**
|
|
58
|
+
|
|
59
|
+
This means:
|
|
60
|
+
|
|
61
|
+
- Do not decide "finalize isn't applicable here" because the user's prompt was trivial (e.g. "hello world"). The recording rule fires on any turn that touches the bound repo — including the very finalize call that just failed. The call touched the repo. You must record.
|
|
62
|
+
- Do not skip finalize because the error seems like a state problem outside your control. State problems are exactly what the error's `hint` and `recommendedNextActions` fields are there to resolve. Read them. Follow them.
|
|
63
|
+
- Do not run a random bash command to "check what happened" and then give up. That is the failure pattern. `remix_collab_status` is the correct first tool, every time, without exception.
|
|
64
|
+
|
|
65
|
+
**Mandatory recovery sequence when finalize errors:**
|
|
66
|
+
|
|
67
|
+
1. Read the error's `message`, `hint`, and `recommendedNextActions` fields in full. They are authoritative. If the hint names a tool, that tool is almost certainly the next correct call.
|
|
68
|
+
2. Call `remix_collab_status` immediately. The hint from status supersedes anything you inferred from the error alone — status sees the actual current binding, branch, worktree, alignment, and queue state.
|
|
69
|
+
3. Based on status, pick the correct recovery tool:
|
|
70
|
+
- `local_only_changed` (or `recommendedAction: record`) → `remix_collab_finalize_turn`. This is the catch-all for any local mutation, including raw `git commit`, `git pull`, `git merge`, `git rebase`, or `git reset`. The source of the change does not matter.
|
|
71
|
+
- `baseline_missing` or `external_local_base_changed` (or `recommendedAction: re_anchor`) → commit any pending edits, then `remix_collab_re_anchor_preview` → `remix_collab_re_anchor_apply`. This applies only when no local Remix baseline exists for this lane yet, not whenever local content moved.
|
|
72
|
+
- `await_finalize` → `remix_collab_drain_finalize_queue`, then re-check status.
|
|
73
|
+
- Unbound or mismatched branch → follow the branch-recovery rules below.
|
|
74
|
+
- `delta_ready` for sync (or `recommendedAction: pull`) → `remix_collab_sync_preview` → `remix_collab_sync_apply`.
|
|
75
|
+
- `both_changed` (or `recommendedAction: reconcile`) → `remix_collab_reconcile_preview` → `remix_collab_reconcile_apply`.
|
|
76
|
+
4. Retry `remix_collab_finalize_turn` only after status confirms the blocker is cleared.
|
|
77
|
+
5. Only then produce your final user-facing response.
|
|
78
|
+
|
|
79
|
+
**If finalize fails because the current branch is unbound:**
|
|
80
|
+
|
|
81
|
+
The error hint will explicitly name the branch (e.g., `"Run remix collab init on branch X"`). That hint is the answer. Sequence:
|
|
82
|
+
|
|
83
|
+
1. Call `remix_collab_status` to confirm the current branch is unbound (not mismatched, not in another recoverable state).
|
|
84
|
+
2. **Silently run `remix_collab_init` on the current branch.** Do not ask the user first. Do not offer alternatives. Do not switch branches. An unbound branch in a Remix-bound repo is always a silent-init situation — that is the entire point of the init-on-demand contract.
|
|
85
|
+
3. Retry `remix_collab_finalize_turn`. Only after it succeeds, respond.
|
|
86
|
+
|
|
87
|
+
**NEVER switch git branches to resolve a finalize error.** Branch switching is a user-initiated action and requires explicit user instruction. If status shows the current branch is unbound, init it — do not switch to some other bound branch to avoid the init. Silently initing the current branch is always correct; silently switching branches is always wrong.
|
|
88
|
+
|
|
89
|
+
**Cross-branch finalize** (`allowBranchMismatch: true`) applies only when the user has explicitly asked for it. Do not infer it from status.
|
|
31
90
|
|
|
32
|
-
|
|
91
|
+
**The triviality of the user's current prompt is irrelevant.** "Say hello world" does not exempt you from the protocol. Neither does "what time is it", "thanks", or any other small talk. If the bound repo was touched — including by a failing Remix tool call — you finalize. No exceptions, **except** the explicit runtime override at the top of this skill (a `[Remix runtime status]` note from the runtime hook stating that the Stop hook will record this turn automatically). The runtime override is the **only** sanctioned way to skip a finalize call; nothing else exempts you.
|
|
@@ -11,10 +11,11 @@ This skill is only about repository alignment. Use the general collaboration wor
|
|
|
11
11
|
|
|
12
12
|
Mental model:
|
|
13
13
|
|
|
14
|
-
- `remix_collab_sync_*` is for pulling Remix-known app state into the local repo when fast-forward sync is possible.
|
|
15
|
-
- `remix_collab_reconcile_*` is for
|
|
14
|
+
- `remix_collab_sync_*` is for pulling Remix-known app state into the local repo when fast-forward sync is possible (i.e. `recommendedAction: pull`, `repoState: server_only_changed`).
|
|
15
|
+
- `remix_collab_reconcile_*` is for the rare case where both the local workspace and the server lane changed since the last agreed baseline (i.e. `recommendedAction: reconcile`, `repoState: both_changed`).
|
|
16
16
|
- `remix_collab_sync_upstream` is for bringing new upstream app changes into a remix.
|
|
17
17
|
- `remix_collab_finalize_turn` is not a sync tool. It records the completed turn, but it does not replace sync, reconcile, or upstream-sync workflows.
|
|
18
|
+
- `re-anchor` is **not** a sync or recovery tool for diverged history. It only seeds a missing local Remix baseline (`recommendedAction: re_anchor`). See the finalize-turn-workflow skill for full handling. If status reports `local_only_changed` (or `recommendedAction: record`), the answer is `finalize-turn`, never reconcile.
|
|
18
19
|
|
|
19
20
|
Workflow:
|
|
20
21
|
|