ワンクリックで
smith-finish
End-of-session workflow that commits, pushes, merges to main, updates specs, and cleans up the workspace.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
End-of-session workflow that commits, pushes, merges to main, updates specs, and cleans up the workspace.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Thorough, fact-based, hallucination-resistant research on a target website and the company behind it. Crawls the whole site, indexes it into a local vector store, runs deep background research (Bing/Reddit via stealth Playwright), then synthesizes a single fully-cited report where every published sentence is citation-gated and adversarially verified against stored evidence. Correctness over speed. All artifacts land in ~/Documents/smith-research/.
Initialize 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.
Lightweight fix workflow for bugs and small changes. Autonomous from invocation through merged PR — no questions gate, no spec generation, no planning phase.
Diagnostic workflow that systematically gathers evidence, identifies root causes, and produces a structured debug report. Read-only — does not modify code. Output feeds into /smith-bugfix if a fix is needed.
Start a new feature from scratch or from conversation context. Conversational requirements gathering, planning, questions gate, then fully autonomous build.
Autonomous build phase — generates tasks, implements, tests, commits, pushes, merges, and produces release notes. Runs without user interaction.
| name | smith-finish |
| description | End-of-session workflow that commits, pushes, merges to main, updates specs, and cleans up the workspace. |
End-of-session workflow that ensures all work is committed, pushed, merged to main, specs are updated, and the workspace is clean. Prevents losing work when closing a development session.
/smith-finishRun all steps autonomously. Only stop to ask the user if a decision is genuinely ambiguous (e.g., unrelated uncommitted changes that may need separate branches).
Gather all of the following in parallel:
# Resolve the configured base branch (falls back to main when unconfigured)
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
# What branch are we on?
git rev-parse --abbrev-ref HEAD
# Any uncommitted changes?
git status
# Any unpushed commits? (only if on a branch other than the base branch)
git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline 2>/dev/null
# What files changed vs the configured base branch?
git diff "$BASE_BRANCH" --name-only 2>/dev/null
# Any open PRs for this branch?
gh pr list --head $(git rev-parse --abbrev-ref HEAD) --state open --json number,title,url 2>/dev/null
Present a brief status summary to the user:
Session Status:
- Branch: <branch-name>
- Uncommitted changes: <count> files
- Unpushed commits: <count>
- Open PRs: <count>
- Files changed vs main: <count>
Decision tree based on state:
| State | Action |
|---|---|
On main, no changes | Nothing to do. Report "workspace is clean" and exit. |
On main, uncommitted changes | Create a feature branch (fix/<slug> or feat/<slug> based on changes), then continue to Step 2. Ask the user for a brief description to name the branch. |
| On feature branch, uncommitted changes | Continue to Step 2. |
| On feature branch, all committed + pushed + PR merged | Skip to Step 6 (verify clean state). |
| On feature branch, all committed + pushed + PR open | Skip to Step 4 (spec updates, then merge). |
| On feature branch, all committed + not pushed | Skip to Step 3 (push). |
Before any file is written (spec updates in Step 4, CHANGELOG/STATUS updates), create an active-workflow marker so the workflow-gate hook (PreToolUse) allows subsequent writes. smith-finish is often invoked standalone outside another workflow, so it must create its own marker.
Skip this step if the State table mapped to "Nothing to do" or "Skip to Step 6 (verify clean state)" — no edits will happen.
BRANCH=$(git rev-parse --abbrev-ref HEAD)
SAFE_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
mkdir -p .smith/vault/active-workflows
cat > .smith/vault/active-workflows/finish-${SAFE_BRANCH}.yaml << EOF
workflow: smith-finish
feature: session-finish
branch: ${BRANCH}
started: $(date -u +"%Y-%m-%dT%H:%M:%S")
EOF
The marker is cleared in Step 6.5 below, regardless of whether the run reached merge or stopped at any earlier step.
# Show what will be committed
git diff --stat
git diff --cached --stat
git add -A or git add .).env, credentials, secrets, and large binary filesWrite a conventional commit message:
git commit -m "$(cat <<'EOF'
<type>: <concise description>
EOF
)"
If there are changes across unrelated areas that clearly belong to different features, ask the user:
"I see changes to both [area A] and [area B]. Should I bundle these into one commit, or split them?"
git push -u origin <branch-name>
Before creating/merging the PR, update documentation:
Identify changed files relative to the configured base branch:
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
git diff "$BASE_BRANCH" --name-only
Map files to system specs using these rules:
services/command-center/ -> specs/system-15-command-center/spec.mdservices/email-pipeline/ -> specs/system-03-email-archive-contact-graph/spec.mdservices/sentiment-engine/ -> specs/sentiment-engine/spec.mdservices/communication-triage/ -> specs/system-05-communication-triage/spec.mdservices/content-strategy/ -> specs/system-12-content-social-engine/spec.mdservices/meeting-intelligence/ -> specs/system-09-meeting-intelligence/spec.mdservices/trend-intelligence/ -> specs/system-13-trend-intelligence/spec.mdservices/social-listening/ -> specs/system-10-social-listening/spec.mddocker-compose.yml -> specs/system-01-core-infrastructure/spec.mddb/ -> relevant system spec based on table namesFor each affected spec.md: Read it, then append a dated implementation history entry describing what changed and why. Keep it concise and factual.
Update CHANGELOG.md with a dated entry including:
Update STATUS.md if system progress percentages changed.
Commit spec updates on the same branch:
git add <spec files> CHANGELOG.md STATUS.md
git commit -m "docs: update specs and changelog for <feature/fix description>"
git push
Skip conditions:
If no open PR exists, create one:
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
gh pr create --base "$BASE_BRANCH" --title "<type>: <short title>" --body "$(cat <<'EOF'
## Summary
<bullet points of changes>
## Test plan
<what was tested or needs testing>
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Merge the PR:
gh pr merge <pr-number> --squash --delete-branch
Return to the base branch:
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
git checkout "$BASE_BRANCH"
git pull origin "$BASE_BRANCH"
Run these checks and report results:
BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh)
# On the base branch?
git rev-parse --abbrev-ref HEAD
# Clean working tree?
git status --porcelain
# Any stale local branches?
git branch --merged "$BASE_BRANCH" | grep -v "$BASE_BRANCH"
# Up to date with remote?
git log "origin/$BASE_BRANCH..HEAD" --oneline
If Docker services were affected (code changes to any service directory):
docker compose up -d --build <affected-services>
Wait for healthy status, then report.
If Step 1.5 created an active-workflow marker, remove it now via the shipped helper. Safe to run unconditionally — the helper is a no-op when the marker doesn't exist:
.specify/scripts/bash/clear-active-workflow.sh "finish-${SAFE_BRANCH}"
After this, the workflow-gate hook returns to denying ad-hoc edits — smith-finish no longer holds an active workflow.
Output a summary:
Session Complete:
- Committed: <commit hash> — <message>
- PR: #<number> (merged)
- Specs updated: <list of spec files>
- Services rebuilt: <list> (or "none needed")
- Branch: main (clean)
If there were any issues (failed merges, unhealthy services, skipped steps), flag them clearly:
Requires attention:
- <issue description>
If the user has been switching branches and has stashed changes:
git stash list
Alert the user if stashes exist — they may contain work from this session.
If gh pr merge fails due to conflicts:
If the workspace is already clean (on main, no changes, no open PRs):
Workspace is clean. Nothing to commit, push, or merge.