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.zipInstalls 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 (서브모듈 안전 검증 포함)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
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추가하지 않는다.
실패 처리
| 증상 | 대응 |
|---|---|
| 서브모듈 더티 또는 unpushed | Step 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| source-command-save (this skill) | 0 | 3mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.