Skip to content

feat(push): add --pull for two-way sync in one command - #354

Merged
runkids merged 8 commits into
mainfrom
feat/push-pull
Oct 3, 2026
Merged

runkids merged 8 commits into
mainfrom
feat/push-pull

Conversation

@runkids

@runkids runkids commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)

Summary

Adds skillshare push --pull: one explicit command for two-way cross-device sync.

skillshare push --pull -m "Update my-skill"
  1. Commits local changes (if any)
  2. Merges the remote's new commits with the same merge semantics pull uses (no rebase)
  3. Pushes
  4. Syncs targets for what the git root scope holds, like pull
Situation Result
Both machines committed Merge, push, sync
Content conflict Nothing pushed, targets not synced, local commit kept; hint to resolve and rerun
Empty remote / no upstream Pushes and sets upstream
Push succeeds, target sync fails Non-zero exit stating the remote is already updated; prints the scope's skillshare sync … --global retry command(s)
--dry-run Lists the steps, changes nothing
commit --pull Rejected instead of silently ignored (commit shares push's parser)

Never rebases or force-pushes.

Changes

  • cmd/skillshare/pull.go: extract integrateRemote (git integration) and syncPulledScope (target sync) from pullFromRemote so pull and push --pull share them; pull behavior unchanged.
  • cmd/skillshare/push.go / commit.go: --pull flag, help text, oplog pull arg; commit rejects --pull.
  • root scope now also syncs extras after pull / push --pull (CLI and dashboard); it previously synced only skills and agents.
  • Dashboard Git Sync: new Sync both ways button (commit if dirty → pull → push); a pull conflict stops at the existing review before pushing. Strings added to all 11 dashboard locales.
  • All five shell completions (bash, zsh, fish, PowerShell, nushell).
  • Docs: push reference (new "Push and Pull Together" section), cross-machine sync guide, quick reference, daily workflow, cross-machine recipe, built-in skill references/sync.md — English plus ja / ko / zh-Hans / zh-Hant.

Deliberately out of scope (follow-ups)

From the design review: blocking when the source sits inside an unrelated parent repo (git add -A would sweep it), a cross-process lock for concurrent runs, and stopping when config.yaml exclusion fails.

Linked Issue

None.

Verification (devcontainer)

  • New tests/integration/push_pull_test.go (5 tests): the merge+push+sync, dry-run and commit --pull tests failed before the implementation and pass after; the conflict and empty-remote tests guard behavior plain push already shared.
  • TestCompletion_PushPullFlag_AllShells covers all five completion scripts.
  • All unit tests pass; full integration suite ok.
  • make fmt-check lint docs-check, python3 scripts/ai-context.py check pass.
  • New E2E runbook ai_docs/tests/push_pull_runbook.md: 6/6 steps pass in a fresh ssenv (two machines + bare remote: empty remote, merge+sync, dry-run, conflict, commit --pull).
  • Server: TestHandlePull_RootScopeSyncsExtras (failed before the fix). UI: 3 new GitSyncPage tests; full Vitest suite (791) passes, pnpm run lint has no issues in changed files, pnpm run build passes. Visual check of the new button in Playful light and Clean dark on the isolated preview fixture, plus a real conflict → resolve → Sync both ways run that pushed the merge.
  • website pnpm run build succeeds for all five locales (broken-link check on).

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Users editing skills on several machines have to remember push on one and pull on the other, and a push from a machine that is behind fails until they pull first. push --pull commits local changes, merges the remote with the same merge semantics pull uses, pushes, and syncs the git root scope.

A conflict stops before anything is pushed and keeps the local commit; a target sync failure after a successful push is reported separately so the user knows the remote is already updated. It never rebases or force-pushes. commit rejects --pull instead of silently ignoring it, since both commands share the argument parser.
Cover the new flag on the push reference, the cross-machine sync guide, the quick reference, the daily workflow and the cross-machine recipe, in English and the ja, ko, zh-Hans and zh-Hant translations, plus the built-in skill's sync reference.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T10:46:14.561866Z 526ef5b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d5b46eddd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/skillshare/push.go Resolved
A bare 'skillshare sync' retry hint defaults to skills and may pick project mode, so it does not redo an agents, extras, or root sync. Derive both the sync and the hint from one per-scope list.
@runkids

runkids commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9b4d519db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/skillshare/pull.go Resolved
The root scope versions skills, agents and extras, but pull and push --pull only synced skills and agents, so merged extras changes never reached their targets.
@runkids

runkids commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: eac0c58c74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The root scope versions extras too, but the dashboard pull only synced skills and agents, so merged extras never reached their targets. Matches the CLI fix.
Mirrors skillshare push --pull: commit local changes, merge the remote and sync targets, then push, in one click. A pull conflict stops at the existing review before anything is pushed.
@runkids

runkids commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36b05a1970

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/src/pages/GitSyncPage.tsx Resolved
Comment thread ui/src/pages/GitSyncPage.tsx Resolved
Sync both ways commits, merges and pushes in one click, so ask first and show the concrete outcome (files to commit, remote commits to merge, scope, push target, conflict behavior) before changing anything.
@runkids

runkids commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6ad7cb5c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/server/handler_git.go Resolved
It skipped target sync when the pull was already up to date, stopped on an empty remote instead of pushing, and the pull dropped extras warnings. Add alwaysSync and a remote_empty code to /api/pull and surface all extras warnings.
@runkids

runkids commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 526ef5b1eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids
runkids merged commit 5d269e8 into main Oct 3, 2026
8 checks passed
@runkids
runkids deleted the feat/push-pull branch October 3, 2026 10:53
runkids added a commit to AdamMagued/skillshare that referenced this pull request Oct 3, 2026
Resolve the conflict in cmd/skillshare/pull.go: runkids#354 moved first-pull handling into integrateRemote, so the ErrRemoteTracksConfig guidance now lives there and also covers push --pull.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant