Skip to content

superspec sync

Sync git changes to context.md for Vibe Coding context restoration.

Syntax

bash
superspec sync [name] [options]

Arguments

ArgumentDescriptionRequired
[name]Change nameNo (syncs all by default)

Options

OptionDescriptionDefault
--base <branch>Base branchmain or master
--no-gitDon't collect git difffalse

Features

The sync command will:

  1. Collect git diff of current branch relative to base branch
  2. Read summaries of related artifacts
  3. Generate the context.md file

Examples

Sync a Specific Change

bash
superspec sync add-user-auth

Sync All Active Changes

bash
superspec sync

Specify Base Branch

bash
superspec sync add-user-auth --base develop

Skip git diff Collection

bash
superspec sync add-user-auth --no-git

Generated context.md

markdown
---
change: add-user-auth
synced_at: 2026-01-15T10:30:00Z
base_branch: main
---

## Change Overview

This change implements user authentication...

## Current Status

- proposal.md: Ready
- spec.md: Ready
- tasks.md: In Progress (3/5 complete)

## Git Changes

### New Files
- src/auth/middleware.ts
- src/auth/jwt.ts

### Modified Files
- src/routes/index.ts
- src/config/index.ts

### Git Diff

```diff
diff --git a/src/auth/middleware.ts b/src/auth/middleware.ts
new file mode 100644
...

Pending Tasks

  • [ ] Task 4: Implement token refresh
  • [ ] Task 5: Add tests

## Used with /ss-resume

The `context.md` generated by `sync` is used for AI assistant context restoration:

You: /ss-resume AI: → Runs superspec sync → Reads context.md → Understands current progress → Continues unfinished work


## Workflow Suggestions

### During Development

```bash
# Sync after significant progress
superspec sync

Before Committing

bash
# Ensure context.md is up to date
superspec sync
git add .
git commit -m "WIP: partial implementation"

Switching Tasks

bash
# Sync current change
superspec sync current-change

# Switch to another change
git checkout other-branch
superspec sync other-change

Notes

  1. Git repository: Must be run inside a git repository
  2. Base branch: Ensure the base branch exists
  3. Auto-detection: If not specified, automatically detects main or master
  4. Zero AI tokens: This is a pure CLI operation, no AI tokens consumed

Released under the MIT License