context-sync
Safe repo pull/push workflow that targets the repository integration branch, uses deterministic planning, and keeps PRs moving with a bounded autonomous resolution loop.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-08-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- name
- context-sync
- description
- Safe repo pull/push workflow that targets the repository integration branch, uses deterministic planning, and keeps PRs moving with a bounded autonomous resolution loop.
- allowed-tools
- Read, Grep, Glob, Bash, Write, Task
- argument-hint
- [pull|push|status|plan|sync] [--remote <name>] [--branch <name>] [--dry-run]
- disable-model-invocation
- true
02 资源文件 5
- 参考文档commands/context-sync.md28.4 KB
- 参考文档manifest.yaml1.2 KB
- 参考文档references/acceptance-contract.md1.6 KB
- 参考文档references/evaluation-process.md2.9 KB
- 脚本scripts/evaluate-context-sync.mjs3.8 KB
03 SKILL.md 正文
Context Sync
Purpose
Provide a safe, repeatable, non-technical-friendly way to either:
- pull the latest repository changes from the active integration branch (or a referenced branch), or
- push local repository changes by safely creating/updating a branch, opening or reusing a PR to the integration branch (or a referenced branch), and keeping that PR moving until it resolves successfully or safely escalates.
The command should feel simple for non-technical users while still preserving protected-branch, secret-handling, and conflict-safety rules.
Inputs
-
Optional subcommand:
pull,push,status,plan, or legacy aliassync -
Optional flags:
--remote <name>,--branch <name>,--dry-run -
Template paths are resolved from
${AGENTS_SKILLS_ROOT}/context-sync/.
Steps
- Follow the command specification in
${AGENTS_SKILLS_ROOT}/context-sync/commands/context-sync.mdexactly. - Keep
statusandplanlocal-only and deterministic. They must not rungit fetchor mutate the repository. - Default branch targeting must be simple:
- if the user references a branch, use it
- if running inside an issue-flow worktree with a matching
.issue-flow-state.json, default to the issue's base branch (minimizes conflicts by avoiding unrelated work from the integration branch) - otherwise prefer the repository integration branch from
.jarvis/context/profiles/ci.json - if no integration branch is configured, fall back to
dev
pullshould fetch only when needed for the selected target branch, then safely rebase local work onto that target branch only.pushshould use a deterministic publish flow: sync the working branch with its remote branch, stage only the eligible change set, verify locally, commit, push, and create or reuse the PR.- Prefer pushing from the user's current non-protected working branch when it already exists remotely; first sync that remote working branch locally before attempting the final push.
- Prevent direct local-change pushes to
mainanddevby switching to a deterministic safety branch during write flows. - Before the final push, always run full repository verification that mirrors CI as closely as practical, and report the exact commands and outcomes in the summary.
- If the working tree is dirty before a rebase, protect those changes first with a named temporary stash, then restore them only after the branch-sync step completes.
- If merge, rebase, or stash-restore conflicts occur, do not leave non-technical users stranded.
- Explain in plain English what happened.
- Show which files are in conflict.
- Offer a safe guided recovery path.
- For non-technical users, default to pausing the sync and offering an assisted conflict-resolution follow-up instead of expecting manual git expertise.
- Generate commit messages from the actual staged eligible change set and repository context. When issue-flow is active, append the issue reference (e.g.,
(#123)) to the commit subject. - When issue-flow is active and creating a new PR, include
Closes #<issue_number>in the PR body. - When a rebase conflict involves only
.issue-flow-state.jsonfiles, ask the user how to resolve (keep mine / accept theirs / abort) instead of aborting immediately. - After
push, automatically create or reuse the PR for the selected target branch without rebasing ontodevas part of the normal push flow. - After PR creation or reuse, start or resume a bounded autonomous PR-resolution loop.
- The PR-resolution loop must keep ownership until the PR reaches a terminal success state or an explicit safe escalation state. No failed PR may be left unattended.
- Use a persistent run ledger inside
.git/context-sync/forpushso retries, watcher restarts, and follow-up fixes remain deterministic.
Output
- Friendly sync summary including user intent (
pullorpush), selected remote/branch, actions performed, commit message used, and final status. - Include protected-branch guard outcome and any generated safety branch.
- Include whether a PR to the selected target branch was created, updated existing, or why creation could not be completed.
- Include whether the PR-resolution loop finished inline, transferred to a background task, or safely escalated.
- Include issue-flow detection status and any target branch overrides when active.
04 同仓库更多 Skills
wiki-research
Autonomous research orchestrator for Jarvis Wiki domains. Spawns a Claude agent with web tools to find new sources, drops them into raw/, runs the compile pipeline, and emits autoresearch traces for the autoflow ratchet.
tmux-agent-launcher
Launch Claude, OpenCode, or Codex in a named tmux session from the command line or agent workflows.
test-quality-validator
Validate generated or hand-written tests for coverage completeness, correctness, and false-green risks using the canonical QA runtime, regression artifacts, and optional delivery-profile rules.
tech-spec
Generate production-ready technical specifications from product specs.
tech-spec-review
Seven-lens engineering review for technical_spec.md files, including an explicit simplicity and architectural fitness gate.
spec-to-regression
Generate browser and API regression scenarios from approved product and technical specs using the Harnessy delivery profile and regression artifact contract.