/smith:smith-syncfrom smith
Sweeps team-shareable .smith/ artifacts and .specify debug reports into a single chore commit and pushes to the default branch. Runs automatically after smith-new/bugfix/debug workflows or manually.
Ships in smith. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Smith workflows stage only the files they explicitly touch (every workflow
enforces "never git add -A"). So the team-shareable .smith/ artifacts made
committable by the gitignore policy — index/manifest.md, the
index/files/ + index/systems/ .meta describe layer, vault/ledger/,
vault/bank/, vault/agents/, vault/sessions/*.md — accumulate unstaged in
the primary repo and never reach teammates. The same is true of the debug
reports /smith-debug writes to .specify/systems/<system>/debug/ (or
.specify/debug/ in un-systematized projects): the debug workflow is read-only
and never commits, so its reports would otherwise sit untracked forever.
/smith-sync closes that loop: it sweeps the committable .smith/ artifacts
and any debug reports into one chore commit and pushes it directly to the
default branch, giving the repo owner full, reliable transparency into activity
without anyone needing to remember a manual command.
This skill operates in the primary repo on the default branch — NOT a
worktree. The artifacts live in the primary repo's .smith/ (vault logging,
index rebuilds, reflection writes), outside the /tmp worktree a workflow's PR
is built from. That is why the sync runs as a terminal step after worktree
cleanup, and why it cannot be part of a worktree's PR.
/smith-new, /smith-bugfix, and
/smith-debug (chained in those skills)./smith-sync. It is idempotent and safe to re-run.git add .smith/ relies on .gitignore as the filter: git natively skips the
ignored paths (.current-session*, queue/, todo/, active-workflows/,
timesheets/, checkpoints, config/) and stages only the committable ones.
There is no sentinel-block parsing — the gitignore policy is the single
source of truth, so when the policy changes (via /smith-update) the sweep
automatically follows.
The sweep has a second, narrowly-scoped staging surface: the debug-report
directories .specify/systems/*/debug/ and .specify/debug/. These are the
only .specify/ paths ever staged — feature specs, plans, and other .specify/
content remain the responsibility of the workflows that author them.
Run all steps from the primary repo root.
.smith/ existsif [ ! -d .smith ]; then
echo "/smith-sync: no .smith/ directory — nothing to sync."
exit 0
fi
Per Q2-A, never switch the user's checkout. If not on the default branch, skip with a clear report.
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh 2>/dev/null || echo main)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ "$CURRENT_BRANCH" != "$BASE_BRANCH" ]; then
echo "/smith-sync: on '$CURRENT_BRANCH', not the default branch '$BASE_BRANCH' — skipping."
echo " (Re-run /smith-sync once you are on '$BASE_BRANCH'; nothing was changed.)"
exit 0
fi
.smith/ and the debug-report directories — nothing elsegit add .smith/
[ -d .specify/debug ] && git add .specify/debug
[ -d .specify/systems ] && find .specify/systems -mindepth 2 -maxdepth 2 -type d -name debug -exec git add {} +
The existence checks and glob-free find keep this a clean no-op in projects
with no debug reports, in both bash and zsh (a bare .specify/systems/*/debug
glob would abort zsh with "no matches found" when the directories don't exist).
NEVER git add -A or git add . — staging is scoped to .smith/ plus the
debug-report directories so unrelated dirty work is never swept in.
Covers repos where neither surface stages anything (e.g. .gitignore ignores
.smith/ wholesale and no debug reports exist): we no-op.
if git diff --cached --quiet; then
echo "/smith-sync: nothing to sync (no committable .smith/ or debug-report changes)."
exit 0
fi
.smith/ ∪ debug reportsDefense against a misconfigured .gitignore letting something unexpected in.
If anything outside .smith/ or the debug-report directories is staged, ABORT
(unstage) rather than commit.
OUTSIDE=$(git diff --cached --name-only | grep -Ev '^\.smith/|^\.specify/(systems/[^/]+/)?debug/' || true)
if [ -n "$OUTSIDE" ]; then
echo "/smith-sync: ABORT — staged paths outside .smith/ and debug-report dirs detected:"
printf ' %s\n' $OUTSIDE
git reset -- $OUTSIDE >/dev/null 2>&1 || true
echo " Unstaged the offending paths. Investigate the project's .gitignore; nothing committed."
exit 1
fi
N_SESSIONS=$(git diff --cached --name-only -- '.smith/vault/sessions/' | wc -l | tr -d ' ')
N_META=$(git diff --cached --name-only -- '.smith/index/files/' | grep -c '\.meta$' || true)
N_LEDGER=$(git diff --cached --name-only -- '.smith/vault/ledger/' | wc -l | tr -d ' ')
N_BANK=$(git diff --cached --name-only -- '.smith/vault/bank/' | wc -l | tr -d ' ')
N_AGENTS=$(git diff --cached --name-only -- '.smith/vault/agents/' | wc -l | tr -d ' ')
N_DEBUG=$(git diff --cached --name-only | grep -Ec '^\.specify/(systems/[^/]+/)?debug/' || true)
N_TOTAL=$(git diff --cached --name-only | wc -l | tr -d ' ')
chore with [skip ci]The [skip ci] token is REQUIRED so artifact-only syncs don't trigger GitHub
Actions / deploys.
git commit -m "chore(smith): sync vault & index artifacts [skip ci]
Sweep team-shareable .smith/ artifacts and debug reports to the default branch
so teammates receive accumulated index + vault context. Artifact-only; no
source changes.
Files: ${N_TOTAL} total — ${N_SESSIONS} sessions, ${N_META} .meta,
${N_LEDGER} ledger, ${N_BANK} bank, ${N_AGENTS} agents, ${N_DEBUG} debug reports."
if git push origin "$BASE_BRANCH"; then
echo "/smith-sync: pushed ${N_TOTAL} artifact files (${N_DEBUG} debug reports) to origin/${BASE_BRANCH}."
else
echo "/smith-sync: PUSH FAILED (non-fast-forward, branch protection, or remote moved ahead)."
echo " The sync commit is kept locally on '$BASE_BRANCH'. NOT force-pushing."
echo " Resolve manually: git pull --rebase origin $BASE_BRANCH && git push origin $BASE_BRANCH"
exit 1
fi
Per the decision, never force-push. On failure the local commit is kept and the user resolves manually.
git add .smith/ plus the debug-report directories
(.specify/systems/*/debug/, .specify/debug/) — never git add -A /
git add .. No other .specify/ path is ever staged.[skip ci] is mandatory in the commit message.2>, 2>>) and /dev/null
redirections — the workflow-gate denies any other redirection when no
marker exists. Keep it that way when editing this file.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
36 skills in this plugin
/smithInitialize SpecKit on a new or existing project — scans the codebase, interviews you about project details, and generates CLAUDE.md, constitution.md, and the full .specify/ scaffolding with commands and agents./smith-activityOpen the local Smith activity dashboard — one loopback daemon serving every registered project, showing live workflow phases, sessions, subagents, worktrees, token usage and divergence findings. Start, stop, restart or check the daemon, or open a new tab for the current project./smith-analyzePerform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.Other plugins' skills for the same job