SO

source-command-save

Saves and pushes Hames repository changes while ensuring submodules are clean and validated.

Install

mkdir -p .claude/skills/source-command-save && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13608" && unzip -o skill.zip -d .claude/skills/source-command-save && rm skill.zip

Installs to .claude/skills/source-command-save

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Hames 루트 전체 변경분 커밋 → main push (서브모듈 안전 검증 포함)
46 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Commit all changes in the Hames root
  • Push changes to the main branch
  • Verify submodule status before push
  • Generate automatic commit messages

How it works

The skill commits all changes in the Hames root and pushes them to the main branch, but first validates the current branch and ensures all submodules are clean and pushed. It generates commit messages based on the changes.

Inputs & outputs

You give it
Git repository with changes in Hames root
You get back
All changes committed and pushed to the main branch, or a report of submodule issues

When to use source-command-save

  • Saving project changes
  • Pushing to main
  • Validating submodule status before commit
  • Automating git commit workflow

About this skill

source-command-save

Use this skill when the user asks to run the migrated source command save.

Command Template

/save

Hames 루트의 모든 변경분(.gitignore 제외)을 한 번에 커밋하고 main에 push한다. 서브모듈이 이미 push된 상태라는 전제 위에서, 어떤 서브모듈이라도 unpushed/dirty 상태이면 즉시 멈춰 경고한다.

사용법

/save

인자 없음. 커밋 메시지는 자동 생성.

사전 조건

  • CWD가 Hames 루트({{HAMES_ROOT}})여야 한다.
  • 현재 브랜치가 main이어야 한다.

실행 순서

Step 1 — 환경 검증

git rev-parse --show-toplevel
git branch --show-current
  • 루트가 Hames 루트가 아니면 중단.
  • 브랜치가 main이 아니면 "main 브랜치에서만 실행 가능" 출력 후 중단.

Step 2 — 서브모듈 안전 검증 (블로킹)

.gitmodules에 등록된 모든 서브모듈을 순회하며 두 항목을 확인한다. 하나라도 걸리면 즉시 중단하고 문제 서브모듈을 모두 모아 한 번에 보고한다.

git config --file .gitmodules --get-regexp path

각 서브모듈에 대해:

cd <submodule_path>
git status --porcelain
git rev-list --left-right --count '@{u}...HEAD'

차단 조건:

  • git status --porcelain 출력이 비어있지 않다 → "더티 워킹트리"
  • ahead > 0 → "unpushed commit 있음"
  • upstream 미설정 → "upstream 미설정"

차단 시 출력 형식:

서브모듈 안전 검증 실패. push 중단.
- <path1>: 더티 워킹트리
- <path2>: unpushed commit 3개

이후 사용자에게 /subpush <path> 또는 직접 정리 후 재실행 안내.

Step 3 — 루트 변경 유무 확인

부정형 결론 안전장치: 아래 명령의 raw 출력을 화면에 그대로 박은 뒤에만 결론을 낸다. "변경사항 없음"이라는 부정형 결론을 raw 출력 표시 없이 내릴 수 없다.

cd {{HAMES_ROOT}}
git status --porcelain --untracked-files=all
  • raw 출력을 그대로(요약·재해석 금지) 사용자에게 표시.
  • raw 출력이 진짜로 0줄일 때만 "변경사항 없음" 후 종료.
  • 1줄이라도 있으면 Step 4로 (gitlink 변경이 있든 없든 무관).

Step 4 — 일괄 스테이징

git add -A

Step 5 — 자동 커밋 메시지 생성

git diff --cached --name-only로 스테이지 목록을 받아 다음 규칙으로 메시지 결정:

  • 서브모듈 gitlink 1개뿐: chore: bump <path> gitlink
  • 서브모듈 gitlink 2개 이상 + 루트 파일 변경 없음: chore: bump gitlinks (<path1>, <path2>, ...)
  • 그 외 (루트 파일 포함 / 혼합 / 루트만): chore: snapshot YYYY-MM-DD HH:MM (현지 시간)
git commit -m "<message>"

Step 6 — push

git push origin main

Step 7 — 검증 보고

git rev-list --left-right --count origin/main...HEAD
  • 0 0이면 "save 완료 — <commit message>" 한 줄.
  • 그 외엔 ahead/behind 숫자 + 다음 액션.

안전 규칙

  • Step 2에서 서브모듈 하나라도 더티/unpushed/upstream 미설정이면 어떤 스테이징도 하지 않는다.
  • --force, --no-verify 등 destructive 옵션 금지.
  • main 외 브랜치에서 호출되면 즉시 중단. 자동 브랜치 전환 금지.
  • 자동으로 git pull / git stash 시도하지 않는다.
  • 커밋 메시지에 Co-Authored-By 추가하지 않는다.

실패 처리

증상대응
서브모듈 더티 또는 unpushedStep 2에서 중단. 사용자가 정리 또는 /subpush 후 재실행.
Hames push 거부 (behind)커밋은 이미 됨을 알리고 git pull --rebase origin main 권유. 자동 실행 금지.
루트 변경 없음"변경사항 없음" 한 줄 후 종료. 빈 커밋 만들지 않는다.
conflict 발생자동 해결 시도 금지. 상태만 보고.

When not to use it

  • When the current working directory is not the Hames root
  • When submodules are dirty or have unpushed commits

Limitations

  • Can only be executed from the Hames root directory
  • Can only be executed on the 'main' branch
  • Does not automatically resolve dirty or unpushed submodules

How it compares

This skill automates a complete commit and push workflow for the Hames root, including submodule validation and automatic commit message generation, which is more structured than manual git operations.

Compared to similar skills

source-command-save side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
source-command-save (this skill)03moReviewIntermediate
resolve-conflicts818moReviewIntermediate
openspec-onboard106moReviewBeginner
codex-cli-bridge99moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry