update agent-ops: sync skill restructuring

This commit is contained in:
toki 2026-04-19 19:52:42 +09:00
parent a2a10cafe5
commit 11d462b45c
4 changed files with 79 additions and 11 deletions

View file

@ -98,14 +98,21 @@ apply_entry_files() {
# ── 사용법 ────────────────────────────────────────────────────────────────────
usage() {
echo "사용법: $0 <target>"
echo "사용법: $0 [--pull] <target>"
echo ""
echo " 현재 프로젝트 → target 으로 동기화"
echo " (기본) 현재 프로젝트 → target(agentic-framework) 으로 push"
echo " --pull target(agentic-framework) → 현재 프로젝트 로 pull"
echo ""
echo " target: 폴더명 (동일 레벨 탐색) | 상대경로 | 절대경로"
}
# ─────────────────────────────────────────────────────────────────────────────
PULL_MODE="0"
if [[ "${1:-}" == "--pull" ]]; then
PULL_MODE="1"
shift
fi
TARGET_INPUT="${1:-}"
if [[ -z "$TARGET_INPUT" ]]; then
usage; exit 1
@ -121,6 +128,32 @@ SRC_AO="$AGENT_OPS_DIR"
DST_AO="$TARGET/agent-ops"
IS_FRAMEWORK="$([[ -f "$PROJECT_ROOT/.agent-ops-source" ]] && echo "1" || echo "0")"
# ── pull 모드: agentic-framework → 현재 프로젝트 ─────────────────────────────
if [[ "$PULL_MODE" == "1" ]]; then
if [[ "$IS_FRAMEWORK" == "1" ]]; then
echo -e "${RED}Error: agentic-framework에서는 --pull을 사용할 수 없습니다.${RESET}"
exit 1
fi
if [[ ! -f "$TARGET/.agent-ops-source" ]]; then
echo -e "${RED}Error: target이 agentic-framework가 아닙니다 (.agent-ops-source 없음)${RESET}"
exit 1
fi
SRC_VER="$(cat "$SRC_AO/.version" 2>/dev/null || echo "0.0.0")"
DST_VER="$(cat "$DST_AO/.version" 2>/dev/null || echo "0.0.0")"
echo "$(basename "$TARGET")$(basename "$PROJECT_ROOT") (pull)"
echo " 현재 버전: $SRC_VER | framework 버전: $DST_VER"
sync_common "$DST_AO" "$SRC_AO"
cp "$DST_AO/.version" "$SRC_AO/.version"
apply_entry_files "$DST_AO/rules/common/rules.md" "$PROJECT_ROOT"
cd "$PROJECT_ROOT"
git add agent-ops/rules/common agent-ops/skills/common agent-ops/bin agent-ops/.version \
CLAUDE.md GEMINI.md .cursorrules AGENTS.md
git commit -m "sync: pull from agentic-framework v$DST_VER"
git push
echo -e "${GREEN}✓ 완료 (pull v$DST_VER)${RESET}"
exit 0
fi
echo "$(basename "$PROJECT_ROOT")$(basename "$TARGET")"
# ── agentic-framework에서 다른 프로젝트로 ────────────────────────────────────
@ -139,7 +172,7 @@ if [[ "$IS_FRAMEWORK" == "1" ]]; then
exit 0
fi
# ── 일반 프로젝트에서 agentic-framework로 ────────────────────────────────────
# ── 일반 프로젝트에서 agentic-framework로 (push) ─────────────────────────────
if [[ ! -f "$TARGET/.agent-ops-source" ]]; then
echo -e "${RED}Error: target이 agentic-framework가 아닙니다 (.agent-ops-source 없음)${RESET}"
exit 1
@ -150,9 +183,8 @@ DST_VER="$(cat "$DST_AO/.version" 2>/dev/null || echo "0.0.0")"
echo " 현재 버전: $SRC_VER | framework 버전: $DST_VER"
if version_gt "$DST_VER" "$SRC_VER"; then
sync_common "$SRC_AO" "$DST_AO"
echo -e "${RED}⚠ 버전 충돌: framework($DST_VER) > current($SRC_VER)${RESET}"
echo -e "${YELLOW} 파일은 복사됐지만 push하지 않았습니다. 수동 머지 후 재시도하세요.${RESET}"
echo -e "${YELLOW} 먼저 sync-pull로 내려받은 뒤 재시도하세요.${RESET}"
exit 1
fi

View file

@ -8,5 +8,6 @@
| 계획 세워줘, 구현 계획, PLAN.md, plan | `agent-ops/skills/common/plan/SKILL.md` |
| 코드 리뷰해줘, code review, CODE_REVIEW.md, 리뷰 루프 | `agent-ops/skills/common/code-review/SKILL.md` |
| 커밋해줘, 푸시해줘, commit, push, 반영해줘 | `agent-ops/skills/common/commit-push/SKILL.md` |
| agent-ops 싱크해, agent-ops 동기화해, agentic-framework에 올려줘, agent-ops를 [프로젝트]로 싱크해 | `agent-ops/skills/common/sync-agent-ops/SKILL.md` |
| agent-ops 싱크해, agent-ops 동기화해, agentic-framework에 올려줘, agent-ops를 [프로젝트]로 싱크해 | `agent-ops/skills/common/sync-push/SKILL.md` |
| agent-ops pull해, agent-ops 가져와, agentic-framework에서 가져와, agent-ops 내려받아 | `agent-ops/skills/common/sync-pull/SKILL.md` |
| 도메인 업데이트, domain rule 갱신, 도메인 검토, domain 스캔 | `agent-ops/skills/common/update-domain-rule/SKILL.md` |

View file

@ -0,0 +1,36 @@
---
name: sync-pull
description: agentic-framework에서 현재 프로젝트로 agent-ops를 내려받는다. "agent-ops pull해", "agentic-framework에서 가져와" 요청 시 사용한다.
---
# sync-pull
## 목적
`agent-ops/bin/sync.sh --pull`을 호출해 agentic-framework → 현재 프로젝트 방향으로 agent-ops를 내려받는다.
## 언제 호출할지
- "agent-ops pull해", "agent-ops 가져와" 요청 시
- "agentic-framework에서 가져와" 요청 시
- "agent-ops 내려받아" 요청 시
## 실행 절차
1. 동일 레벨에 `agentic-framework` 폴더가 있는지 확인한다
2. **있으면**: `agent-ops/bin/sync.sh --pull agentic-framework` 실행
3. **없으면**: 사용자에게 agentic-framework 경로 입력을 안내하고, 입력받은 경로로 실행
```bash
agent-ops/bin/sync.sh --pull <target>
```
## 실행 결과 검증
- [ ] sync.sh 가 오류 없이 완료됐는가
- [ ] 현재 프로젝트 버전이 framework 버전과 일치하는가
- [ ] 진입 파일(CLAUDE.md 등)이 갱신됐는가
## 금지 사항
- sync.sh 를 거치지 않고 직접 파일을 복사하지 않는다

View file

@ -1,14 +1,13 @@
---
name: sync-agent-ops
description: agent-ops를 agentic-framework와 동기화한다. "agent-ops 싱크해", "agent-ops 동기화해" 요청 시 사용한다.
name: sync-push
description: 현재 프로젝트의 agent-ops를 agentic-framework로 올린다. "agent-ops 싱크해", "agent-ops 동기화해", "agentic-framework에 올려줘" 요청 시 사용한다.
---
# sync-agent-ops
# sync-push
## 목적
`agent-ops/bin/sync.sh`를 호출해 agent-ops를 동기화한다.
현재 프로젝트가 agentic-framework인지 여부에 따라 동작이 달라진다.
`agent-ops/bin/sync.sh`를 호출해 현재 프로젝트 → agentic-framework 방향으로 agent-ops를 올린다.
## 언제 호출할지