Repository navigation
v1.0.2 — Auto Remote Setup & Security Hardening
Highlights
Scripts now auto-configure the upstream remote when UPSTREAM_URL is set in .env — no manual git remote add needed. Security audit fixed shell injection and incomplete input validation.
New Features
Auto Remote Setup
- New
ensureRemote()ingit-utils.js— automatically runsgit remote add upstream <url>if remote doesn't exist andUPSTREAM_URLis configured - Both
upstream-status.jsandconflict-preview.jsuse it before any operation - If neither remote nor URL is configured, provides clear guidance on what to set up
- Does not touch
origin—git pushstill goes to your fork
Cherry-pick Conflict Preview
- New
previewCherryPickConflicts()analyzes a specific commit against locally modified files - Usage:
node conflict-preview.js --strategy cherry-pick --commit <hash> - Reports which files in the target commit overlap with local changes
Security Fixes
- Shell injection eliminated —
execSyncreplaced withexecFileSync+ args array across all git calls - Input validation —
validateArg()regex on all user-facing args (remote, branch, commit, since) - NaN guard —
--limitfalls back to default on invalid input
Bug Fixes
- Truncated merge-base regression —
previewRebaseConflictsnow uses full hash internally, truncates only for display - Silent fetch failures —
fetchRemote()returns boolean, callers surface warnings in both text and JSON output - Missing test in npm test —
git-utils.test.jsadded topackage.jsontest script - fetchWarning in JSON —
conflict-preview.jsnow includesfetchWarningin JSON output (matchingupstream-status.js)
Configuration
New .env variable:
# URL of the original repo (auto-creates remote if not configured)
UPSTREAM_URL=https://github.com/original-author/original-repo.gitSetup flow:
origin → your fork (unchanged, git push still works)
upstream → original repo (auto-created from UPSTREAM_URL)
Tests
- 26 tests, all passing (was 25)
- Added cherry-pick strategy test with real git repos
v1.0.0 — Upstream Sync Skill for Claude Code
What's New
A Claude Code agent skill that automates syncing forked/cloned open source repositories with upstream changes.
Core Scripts
upstream-status.js— Detects upstream remote, fetches latest commits, lists new changes with diffstat and ahead/behind countsconflict-preview.js— Dry-run merge/rebase conflict detection with file-level risk categorization (HIGH/LOW) and actionable recommendations (SAFE_TO_MERGE,MERGE_WITH_MANUAL_RESOLUTION,CONSIDER_CHERRY_PICK)git-utils.js— Shared utilities with git wrapper,.envcascade loading
Integration Strategies
- Merge — Full branch integration with conflict analysis
- Rebase — Linear history with local commit replay count estimation
Reference Guides
- 5-phase sync workflow (setup, review, analyze, integrate, verify)
- Upstream commit review methodology with decision matrix
- Conflict resolution strategies prioritized by dependency order
Quality
- 25 integration tests using real temporary git repos (zero mocks)
- Zero runtime dependencies — Node.js >= 18 only
- Cross-platform support (Linux/macOS/Windows)
Documentation
- Full README with installation (copy/symlink), CLI usage examples, sample outputs, and real-world scenarios