/claude-forge:sync [--no-pull] [--check-only] [작업설명]from claude-forge
git pull + 문서 동기화 통합 (pull → sync-docs v7 순차 실행)
Ships in claude-forge. Installing the plugin adds it to Claude Code.
| 플래그 | 설명 |
|---|---|
--no-pull | pull 건너뛰고 문서 동기화만 실행 (/sync-docs와 동일) |
--check-only | 문서 변경 필요 사항만 보여주고 수정하지 않음 |
| (없음) | pull + 문서 동기화 모두 실행 |
--no-pull 시 스킵)git branch --show-current
git status --short
커밋되지 않은 변경사항이 있으면 경고:
작업 중인 변경사항이 있습니다. stash 후 진행할까요? (Y/n)
git stash 후 진행, pull 후 git stash popgit pull origin main
충돌 발생 시 Phase 2 진행하지 않고 충돌 보고 후 중단.
--check-only 플래그가 있으면:
인자로 전달된 작업 설명을 확인한다. 인자가 없으면 최근 커밋 메시지에서 작업 내용을 추론한다.
git log --oneline -5
diff 범위 자동 감지:
BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)
if [ -n "$BASE" ] && [ "$BASE" != "$(git rev-parse HEAD)" ]; then
git diff --name-only "$BASE"..HEAD
git diff --stat "$BASE"..HEAD
else
COMMIT_COUNT=$(git rev-list --count HEAD 2>/dev/null || echo "0")
if [ "$COMMIT_COUNT" -eq 0 ]; then
echo "NO_COMMITS"
elif [ "$COMMIT_COUNT" -ge 3 ]; then
git diff --name-only HEAD~3..HEAD
git diff --stat HEAD~3..HEAD
else
git diff --name-only HEAD~1..HEAD
git diff --stat HEAD~1..HEAD
fi
fi
NO_COMMITS가 출력되면 동기화할 변경사항이 없으므로 사용자에게 알리고 종료한다.
소스 코드(git diff)가 최우선 진실 소스(source of truth)이다.
Glob 패턴으로 prompt_plan.md를 탐색한다:
./prompt_plan.md./.claude/prompt_plan.md./docs/prompt_plan.md업데이트 항목:
- [x])파일이 없으면 건너뛴다.
Glob 패턴으로 spec.md를 탐색한다:
./spec.md./docs/spec.md./.claude/spec.md업데이트 항목:
파일이 없으면 건너뛴다.
Glob 패턴으로 CLAUDE.md를 탐색한다:
./CLAUDE.md./.claude/CLAUDE.md60줄 제한 규칙 (CRITICAL):
CLAUDE.md는 60줄 이하를 유지한다.
CLAUDE.md에 허용되는 내용 (Core 정보만):
CLAUDE.md에 넣으면 안 되는 내용 → rules/로 이동:
동기화 동작:
.claude/rules/ 디렉토리의 규칙 파일을 코드 변경에 맞게 동기화한다.
Glob: .claude/rules/**/*.md
판단 기준:
| 줄 수 | 상태 | 동작 |
|---|---|---|
| ≤ 60 | 정상 | 완료 |
| 61-80 | 경고 | 출력에 경고 표시, 분리 제안 |
| > 80 | 초과 | 상세 내용을 rules/로 분리 실행 |
════════════════════════════════════════════════════════════════
Sync v7 (pull + docs)
════════════════════════════════════════════════════════════════
[Pull]
브랜치: {branch}
상태: {up-to-date | N commits pulled}
[Docs]
작업: {작업 설명}
prompt_plan.md {업데이트 | 없음 | 변경없음}
spec.md {업데이트 | 없음 | 변경없음}
CLAUDE.md {업데이트 | 없음 | 변경없음} (N줄)
rules/ {N개 업데이트 | 변경없음}
변경 요약:
- {변경 항목 1}
- {변경 항목 2}
CLAUDE.md: N줄 (정상 / 경고: 60줄 초과)
다음: /quick-commit
════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════════════════
Sync v7 (docs only)
════════════════════════════════════════════════════════════════
작업: {작업 설명}
동기화 결과:
prompt_plan.md {업데이트 | 없음 | 변경없음}
spec.md {업데이트 | 없음 | 변경없음}
CLAUDE.md {업데이트 | 없음 | 변경없음} (N줄)
rules/ {N개 업데이트 | 변경없음}
CLAUDE.md: N줄 (정상 / 경고: 60줄 초과)
다음: /quick-commit
════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════════════════
Sync v7 (check-only)
════════════════════════════════════════════════════════════════
변경 필요 사항:
prompt_plan.md:
- [ ] → [x] Task 3: API 엔드포인트 구현
spec.md:
- API 섹션에 POST /api/users 추가 필요
CLAUDE.md (현재 N줄):
- 새 명령어 추가 필요: pnpm db:migrate
rules/:
- rules/api-design.md: POST /api/users 추가 필요
적용하려면: /sync (--check-only 없이 실행)
════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════════════════
Sync (중단)
════════════════════════════════════════════════════════════════
[Pull] 충돌 발생! 수동 해결 필요:
{충돌 파일 목록}
문서 동기화는 충돌 해결 후 /sync --no-pull 로 실행하세요.
════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════════════════
Sync v7 (pull + docs)
════════════════════════════════════════════════════════════════
[Pull]
브랜치: {branch}
상태: {up-to-date | N commits pulled}
[Docs]
동기화 대상 문서를 찾을 수 없습니다.
확인할 위치:
- prompt_plan.md (프로젝트 루트, .claude/, docs/)
- spec.md (프로젝트 루트, docs/, .claude/)
- CLAUDE.md (프로젝트 루트, .claude/)
- .claude/rules/*.md
════════════════════════════════════════════════════════════════
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
40 commands in this plugin
2 plugins ship this exact command · first indexed Nov 10, 2026
Other plugins' commands for the same job