update agent-ops bin scripts
This commit is contained in:
parent
c0ae523ee3
commit
19e4f0da6e
2 changed files with 47 additions and 11 deletions
|
|
@ -27,20 +27,38 @@ append_unique_line() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_project_agent_ops_dirs() {
|
||||||
|
local agent_ops_dir="$1"
|
||||||
|
|
||||||
|
mkdir -p "$agent_ops_dir/rules/project/domain"
|
||||||
|
mkdir -p "$agent_ops_dir/rules/private"
|
||||||
|
mkdir -p "$agent_ops_dir/skills/project"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_common_agent_ops() {
|
||||||
|
local source_dir="$1"
|
||||||
|
local target_agent_ops_dir="$2"
|
||||||
|
|
||||||
|
mkdir -p "$target_agent_ops_dir/rules"
|
||||||
|
mkdir -p "$target_agent_ops_dir/skills"
|
||||||
|
|
||||||
|
cp "$source_dir/.version" "$target_agent_ops_dir/"
|
||||||
|
rm -rf "$target_agent_ops_dir/bin"
|
||||||
|
rm -rf "$target_agent_ops_dir/rules/common"
|
||||||
|
rm -rf "$target_agent_ops_dir/skills/common"
|
||||||
|
cp -r "$source_dir/bin" "$target_agent_ops_dir/"
|
||||||
|
cp -r "$source_dir/rules/common" "$target_agent_ops_dir/rules/"
|
||||||
|
cp -r "$source_dir/skills/common" "$target_agent_ops_dir/skills/"
|
||||||
|
}
|
||||||
|
|
||||||
echo "Initializing agent-ops in: $TARGET_DIR"
|
echo "Initializing agent-ops in: $TARGET_DIR"
|
||||||
echo "Source agent-ops: $SOURCE_DIR"
|
echo "Source agent-ops: $SOURCE_DIR"
|
||||||
|
|
||||||
# 1. 대상 폴더 생성
|
# 1. 대상 폴더 생성 (프로젝트 전용 폴더는 내용 복사 없이 폴더만 생성)
|
||||||
mkdir -p "$TARGET_DIR/agent-ops/rules/project/domain"
|
create_project_agent_ops_dirs "$TARGET_DIR/agent-ops"
|
||||||
mkdir -p "$TARGET_DIR/agent-ops/rules/private"
|
|
||||||
mkdir -p "$TARGET_DIR/agent-ops/skills/project"
|
|
||||||
|
|
||||||
# 2. 공통 요소 복사 (프로젝트 전용 설정은 제외)
|
# 2. 공통 요소 복사 (프로젝트 전용 설정은 제외)
|
||||||
cp "$SOURCE_DIR/.version" "$TARGET_DIR/agent-ops/"
|
copy_common_agent_ops "$SOURCE_DIR" "$TARGET_DIR/agent-ops"
|
||||||
rm -rf "$TARGET_DIR/agent-ops/bin"
|
|
||||||
cp -r "$SOURCE_DIR/bin" "$TARGET_DIR/agent-ops/"
|
|
||||||
cp -r "$SOURCE_DIR/rules/common" "$TARGET_DIR/agent-ops/rules/"
|
|
||||||
cp -r "$SOURCE_DIR/skills/common" "$TARGET_DIR/agent-ops/skills/"
|
|
||||||
|
|
||||||
# 3. 에이전트 진입 파일 생성 (common/rules.md 복사)
|
# 3. 에이전트 진입 파일 생성 (common/rules.md 복사)
|
||||||
COMMON_RULES="$SOURCE_DIR/rules/common/rules.md"
|
COMMON_RULES="$SOURCE_DIR/rules/common/rules.md"
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,24 @@ sync_common() {
|
||||||
sync_folder "$src/bin" "$dst/bin"
|
sync_folder "$src/bin" "$dst/bin"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_project_agent_ops_dirs() {
|
||||||
|
local agent_ops_dir="$1"
|
||||||
|
mkdir -p "$agent_ops_dir/rules/project/domain"
|
||||||
|
mkdir -p "$agent_ops_dir/rules/private"
|
||||||
|
mkdir -p "$agent_ops_dir/skills/project"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_common_scaffold() {
|
||||||
|
local src="$1" dst="$2"
|
||||||
|
mkdir -p "$dst/rules" "$dst/skills"
|
||||||
|
cp "$src/.version" "$dst/"
|
||||||
|
rm -rf "$dst/bin" "$dst/rules/common" "$dst/skills/common"
|
||||||
|
cp -r "$src/bin" "$dst/"
|
||||||
|
cp -r "$src/rules/common" "$dst/rules/"
|
||||||
|
cp -r "$src/skills/common" "$dst/skills/"
|
||||||
|
create_project_agent_ops_dirs "$dst"
|
||||||
|
}
|
||||||
|
|
||||||
# ── 사용법 ────────────────────────────────────────────────────────────────────
|
# ── 사용법 ────────────────────────────────────────────────────────────────────
|
||||||
usage() {
|
usage() {
|
||||||
echo "사용법: $0 [--pull] <target>"
|
echo "사용법: $0 [--pull] <target>"
|
||||||
|
|
@ -134,8 +152,8 @@ echo "▶ $(basename "$PROJECT_ROOT") → $(basename "$TARGET")"
|
||||||
# ── agentic-framework에서 다른 프로젝트로 ────────────────────────────────────
|
# ── agentic-framework에서 다른 프로젝트로 ────────────────────────────────────
|
||||||
if [[ "$IS_FRAMEWORK" == "1" ]]; then
|
if [[ "$IS_FRAMEWORK" == "1" ]]; then
|
||||||
if [[ ! -d "$DST_AO" ]]; then
|
if [[ ! -d "$DST_AO" ]]; then
|
||||||
echo " 최초 진행: agent-ops 전체 복사"
|
echo " 최초 진행: agent-ops 공통 scaffold 복사"
|
||||||
cp -r "$SRC_AO" "$TARGET/"
|
copy_common_scaffold "$SRC_AO" "$DST_AO"
|
||||||
apply_agent_ops_entry_files "$SRC_AO/rules/common/rules.md" "$TARGET"
|
apply_agent_ops_entry_files "$SRC_AO/rules/common/rules.md" "$TARGET"
|
||||||
echo -e "${YELLOW} init-agent-ops 스킬로 초기화를 진행하세요.${RESET}"
|
echo -e "${YELLOW} init-agent-ops 스킬로 초기화를 진행하세요.${RESET}"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue