Install

/plugin install automation-tools@claude-integration

Run it inside Claude Code after adding the marketplace with /plugin marketplace add m16khb/claude-integration.

Contents

Discovered from source

Skills 5

AI Partner System

MISSION

사용자에게 맞춤형 AI 전문가 파트너를 제공하고 지속적인 협업 관계를 구축합니다.


PARTNER ARCHITECTURE

AI PARTNER SYSTEM:
├─ Partner Profiles (전문 분야, 성격, 소통 스타일)
├─ Matching Algorithm (작업 분석, 호환성 점수)
├─ Collaboration Interface (컨텍스트 메모리, 진행 추적)
└─ Growth System (경험치, 스킬 진화, 관계 레벨)

PARTNER PERSONAS

파트너전문 분야성격특기
The Architect시스템 설계체계적, 전략적복잡성 관리, 장기 계획
The Pragmatist실용적 구현직설적, 효율 지향빠른 프로토타이핑, MVP
The Mentor교육, 코드 리뷰인내심, 설명 중심실력 향상, 오류 교정
The Innovator최신 기술창의적, 호기심트렌드 파악, 혁신 솔루션
The Guardian보안, 테스트꼼꼼함, 신중함취약점 발견, 재난 방지

MATCHING SYSTEM

작업 기반 매칭

task_profile:
  type: feature | bugfix | refactor | review | learn
  complexity: simple | moderate | complex | expert
  urgency: low | medium | high | critical
  domain: [backend, frontend, security, ...]
  context:
    experience_level: beginner | intermediate | advanced
    preferred_style: guided | independent | collaborative

학습 알고리즘

피드백(만족도, 효과성, 소통)을 수집하여 파트너 프로필을 동적으로 업데이트합니다.


COLLABORATION FEATURES

컨텍스트 메모리

memory:
  project_context:
    name: "프로젝트명"
    tech_stack: [NestJS, React, PostgreSQL]
    architecture: Microservices

  preferences:
    code_style: "Prettier + ESLint"
    commit_style: "Conventional Commits"

  history:
    - session: "sess-001"
      task: "API Gateway 설계"
      outcome: "Successful"

동적 적응

사용자 패턴 분석 후 소통 스타일, 예시 빈도, 상세도 조정합니다.


COMMANDS

파트너 선택

/partner select
# 출력: 선택 가능한 AI 파트너 목록 (일치율 순)

파트너십 대시보드

/partner status
# 출력: 협업 통계, 최근 성과, 성취 배지

ADVANCED FEATURES

파트너 팀

team:
  name: "Dream Team"
  members:
    - The Architect (리드 + 설계)
    - The Pragmatist (구현)
    - The Guardian (QA + 보안)
    - The Mentor (코드 리뷰)

  workflow:
    design: [Architect]
    implement: [Pragmatist]
    review: [Mentor, Guardian]
    deploy: [Guardian]

파트너 성장

experience_points:
  task_completion:
    simple: 10 XP
    moderate: 25 XP
    complex: 50 XP
    expert: 100 XP

  quality_bonus:
    exceptional: +50%
    creative_solution: +30%

  unlockables:
    level_5: Custom Communication Style
    level_10: Team Leadership
    level_15: Cross-domain Expertise

BEST PRACTICES

파트너 선택 가이드

작업 유형추천 파트너
Simple tasksGeneralist
Complex tasksSpecialist
Learning tasksMentor

효과적 협업

context_providing:
  background: 배경과 이유
  goals: 명확한 목표
  constraints: 제약 조건
  preferences: 선호사항

TROUBLESHOOTING

문제원인해결
Partner Mismatch초기 매칭 오류/partner re-evaluate
Communication Issues소통 스타일 불일치파트너 설정 조정
Performance Decline번아웃/컨텍스트 부족/partner reset

QUICK START

/partner init          # 최초 설정
/partner select        # 파트너 선택
/partner status        # 현재 상태 확인
/partner feedback      # 피드백 제공
/partner history       # 협업 기록

AI와의 협업을 더욱 의미 있고 효과적으로 만들어보세요!

Factory Generator Skill

ROLE

컴포넌트 생성의 핵심 로직을 담당하며, 인자 파싱, 사용자 입력 수집, 파일 생성을 처리합니다.

GUIDELINES

1. 인자 파싱 규칙

  • 빈 인자: 타입 선택 TUI 표시
  • command [name]: 타입=command, 이름 추출
  • skill [name]: 타입=skill, 이름 추출
  • agent [name]: 타입=agent, 이름 추출
  • 그외: 오류 메시지와 유효한 형식 제시

2. 이름 검증

  • kebab-case 형식 (소문자, 하이픈)
  • 3-30자 길이
  • 공백이나 특수문자 불가
  • 유효하지 않으면 다시 입력 요청

3. 경로 생성 규칙

  • command: {base_path}/commands/{name}.md
  • skill: {base_path}/skills/{name}/SKILL.md
  • agent: {base_path}/agents/{name}.md

4. 사용자 정보 수집

  • 목적 (purpose) 명확히 수집
  • 설치 위치 (프로젝트/사용자/플러그인)
  • 모델 선택 (Command/Agent만)
  • 도구 선택 (Command/Agent만)

EXAMPLES

Input

Type: agent
Name: typescript-validator
Purpose: TypeScript 코드 유효성 검사 자동화
Location: project
Model: Sonnet
Tools: Read, Grep, Write

Output

---
name: typescript-validator
description: 'TypeScript 코드 유효성 검사 자동화 에이전트'
model: claude-sonnet-4-20250414
allowed-tools:
  - Read
  - Grep
  - Write
---

# TypeScript Validator
...

TRIGGER CONDITIONS

  • 컴포넌트 생성 요청 시
  • 사용자 입력 수집 필요 시
  • 파일 경로 결정 필요 시
  • 유효성 검사 필요 시

Factory Orchestrator Skill

ROLE

복잡한 다영역 작업을 위해 여러 전문가 에이전트를 조합하는 오케스트레이터를 생성합니다.

GUIDELINES

1. 구성 전략

  • 단독 에이전트: 독립적 전문가
  • 오케스트레이터: 여러 전문가 조합
  • 전문가 확장: 기존 에이전트 기반 확장
  • 하이브리드: 직접 작업 + 위임 혼합

2. 오케스트레이션 패턴

  • SINGLE_EXPERT: 하나의 전문가가 전체 처리
  • SEQUENTIAL_CHAIN: 의존성 있는 순차적 처리
  • PARALLEL_EXECUTION: 독립적 병렬 처리
  • HIERARCHICAL_DELEGATION: 다계층 위임
  • DYNAMIC_ROUTING: 동적 라우팅

3. 전문가 분류

  • Backend Development: DB, API, Messaging, Frameworks
  • Frontend Development: Frameworks, State, Styling
  • DevOps & Infrastructure: Cloud, Containers, CI/CD
  • Quality & Testing: Unit, Integration, Review
  • Documentation: API Docs, Guides, Writing

4. 라우팅 로직

  • 키워드 기반 매칭
  • 컨텍스트 기반 분석
  • 워크플로우 기반 실행
  • 복합 라우팅

5. 오케스트레이션 구조

SPECIALIZED EXPERTS:
- 전문가 목록과 역할

ORCHESTRATION LOGIC:
- 요청 분석
- 전문가 선택
- 작업 위임

DELEGATION EXAMPLES:
- Task tool 호출 패턴
- 컨텍스트 전달 방식

EXAMPLES

Input

Agent name: fullstack-reviewer
Composition: 오케스트레이터
Selected experts: code-reviewer, testing-expert
Pattern: sequential

Output

## 전문가 에이전트

| 전문가 | 전문 분야 | 트리거 키워드 | 경로 |
|--------|----------|--------------|------|
| code-reviewer | 코드 리뷰 | 리뷰, 검토 | backend |
| testing-expert | 테스트 | 테스트, 검증 | backend |

## 오케스트레이션 로직

1. 코드 리뷰 실행
2. 리뷰 결과 기반 테스트 케이스 생성
3. 최종 보고서 통합

TRIGGER CONDITIONS

  • agent 생성 시 조합 옵션 선택
  • 여러 전문가 필요한 작업
  • 복잡한 워크플로우 필요 시
  • 기존 전문가 확장 시
  • 하이브리드 아키텍처 필요 시

Factory Researcher Skill

ROLE

컴포넌트 생성에 필요한 최신 정보와 예제를 웹에서 수집하여 최적의 결과물을 생성하도록 지원합니다.

GUIDELINES

1. 리서치 전략

  • 공식문서 우선 (anthropic.com, claude.ai)
  • GitHub 예제 분석 (anthropic-ai, claude-ai 관련)
  • 기술 블로그 (Medium, Dev.to)
  • Stack Overflow 참고

2. 검색 쿼리 패턴

  • "{keyword} official documentation 2025"
  • "{keyword} best practices tutorial"
  • "{keyword} NestJS/React/etc integration"
  • "Claude Code {type} {keyword} example"

3. 콘텐츠 추출 규칙

  • 설치 명령어
  • 설정 예제
  • API 패턴과 코드 스니펫
  • 일반적인 문제점과 해결책
  • 버전별 주의사항

4. 품질 평가 기준

  • 2024년 이후 발행
  • 코드 예제 포함
  • Claude Code 특정 언급
  • 명확하고 실행 가능한 내용

5. 연구 결과 구조

{
  "sources": ["URL 목록"],
  "key_findings": {
    "installation": ["설치 명령어"],
    "configuration": ["설정 예제"],
    "best_practices": ["모범 사례"],
    "common_issues": ["일반적인 문제"]
  },
  "code_examples": [
    {
      "language": "typescript",
      "code": "코드",
      "source": "URL",
      "description": "설명"
    }
  ]
}

EXAMPLES

Input

Component: typescript-linter
Research preference: 공식문서 분석

Output

{
  "sources": [
    "https://typescript-eslint.io/",
    "https://docs.nestjs.com/techniques/validation"
  ],
  "key_findings": {
    "installation": ["npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin"],
    "configuration": [".eslintrc.js 설정 예제"],
    "best_practices": ["strict 모드 사용", "규칙 커스터마이징"],
    "common_issues": ["파스 오류", "규칙 충돌"]
  },
  "code_examples": [
    {
      "language": "typescript",
      "code": "module.exports = { extends: ['@typescript-eslint/recommended'] }",
      "source": "typescript-eslint.io",
      "description": "기본 ESLint 설정"
    }
  ]
}

TRIGGER CONDITIONS

  • "공식문서 분석" 선택 시
  • "GitHub 예제 분석" 선택 시
  • 웹 검색이 필요할 때
  • 베스트 프랙티스 수집 시
  • 코드 예제가 필요할 때

Factory Validator Skill

ROLE

생성된 컴포넌트의 품질을 보증하고 스키마 준수 여부, 모범 사례 적용 여부를 검증합니다.

GUIDELINES

1. 스키마 검증

  • 필수 필드 확인 (name, description)
  • 필드 형식 검증
  • 타입별 필수 섹션 확인
  • Anthropic 2025 스키마 호환성

2. 내용 품질 평가

  • 명확성 점수 (1-5)
  • 완전성 점수 (1-5)
  • 사용성 점수 (1-5)
  • 종합 품질 점수 (100점 만점)

3. 기술적 정확성

  • 도구 사용 정확성
  • 코드 예시 유효성
  • 오류 처리 완성도
  • 모범 사례 준수

4. 자동 수정 대상

  • Frontmatter 형식
  • 마크다운 구조
  • 링크 검증
  • 스키마 호환성

5. 품질 등급

  • 90-100: Excellent (A) - 즉시 사용 가능
  • 80-89: Good (B) - 사소한 개선 필요
  • 70-79: Acceptable (C) - 일부 개선 필요
  • 60-69: Needs Work (D) - 수정 필요
  • <60: Poor (F) - 전면 수정 필요

EXAMPLES

Input

Component: newly-created-agent.md
Validation type: full

Output

## 🔍 컴포넌트 검증 보고서

| 항목 | 점수 | 상태 |
|------|------|------|
| 구조 | 28/30 | ✅ |
| 내용 | 35/40 | ⚠️ |
| 기술 | 25/30 | ✅ |

### 발견된 문제
#### ⚠️ 주요 (Major)
- ERROR HANDLING 섹션이 누락되었습니다
- 예제 코드가 너무 적습니다

#### 💡 개선 (Minor)
- 일부 설명이 모호합니다
- 더 많은 사용 예시가 필요합니다

### 자동 수정 제안
- ERROR HANDLING 섹션 템플릿 추가
- 기본 예제 코드 삽입

TRIGGER CONDITIONS

  • 컴포넌트 생성 완료 후
  • 스키마 검증 필요 시
  • 품질 점수 확인 필요 시
  • 자동 수정 적용 시
  • 플러그인 등록 전 검증 시

Commands 6

EXECUTION

사용자가 /claude-sync 명령을 실행했습니다.

입력 인자: $ARGUMENTS

실행 지시

1단계: 인자 파싱

$ARGUMENTS에서 다음을 추출하세요:

  • --target <path>: 특정 플러그인/디렉토리만 동기화
  • --only routing-table: routing-table.json만 갱신
  • --dry-run: 변경 없이 분석 결과만 출력

인자가 없으면 전체 프로젝트 동기화를 수행하세요.

2단계: Phase별 순차 실행

아래 Phase들을 순서대로 수행하세요:

Phase 0: Component Registry Sync
  1. Glob("**/agents/*.md") → 에이전트 정의 수집
  2. Glob("**/skills/**/SKILL.md") → 스킬 정의 수집
  3. Glob("**/commands/*.md") → 커맨드 정의 수집
  4. .claude-plugin/routing-table.json 업데이트

--only routing-table 옵션이면 여기서 종료.

Phase 1: Hierarchical Scan
  1. Root CLAUDE.md 읽기
  2. Glob("plugins/*/CLAUDE.md") → 모듈 CLAUDE.md 수집
  3. 각 모듈의 agent-docs 디렉토리 스캔
Phase 2: Gap Analysis

라인 수 제한 검사:

  • ROOT: Soft 300 / Hard 500
  • MODULE: Soft 200 / Hard 350
  • SUBMODULE: Soft 150 / Hard 250

분류: CREATE_CLAUDE_MD, NEEDS_AGENT_DOCS, RECOMMEND_AGENT_DOCS, UPDATE_LINKS, OK

Phase 3: Report & Confirm

--dry-run이면 분석 결과만 출력하고 종료. 그렇지 않으면 AskUserQuestion으로 사용자 확인:

  • 전체 적용
  • 선택 적용
  • 취소
Phase 4: Parallel Execution

Task(subagent_type="documentation-generation:document-builder")로 문서 생성/수정 위임.

Phase 5: Orphan Detection & Fix
  1. 상위에서 참조되지 않는 CLAUDE.md → 링크 추가
  2. CLAUDE.md에서 참조되지 않는 agent-docs → 테이블에 추가
  3. parent 링크 누락 → [parent](../CLAUDE.md) 추가
Phase 6: Validation
  1. 모든 링크 경로 유효성 검사
  2. 라인 수 제한 준수 확인
  3. 고아 파일 0개 확인
  4. agent-docs에 @ 참조 없음 확인

3단계: 결과 출력

동기화 결과 요약 표시:

  • 생성된 파일 수
  • 수정된 파일 수
  • 발견된 문제점

REFERENCE

핵심 원칙

  • 모듈마다 CLAUDE.md 작성
  • LOC 초과 시 agent-docs로 분할
  • 플러그인 CLAUDE.md는 상위에서 일반 링크로 참조
  • agent-docs는 @ 참조 금지 (테이블/일반 링크 사용)
  • 고아 파일 0개 보장

ARCHITECTURE

Root CLAUDE.md
├── [plugins/*/CLAUDE.md](링크) (MODULE)
│   └── `agent-docs/*.md` (테이블로 참조, 동적 로딩)
└── `agent-docs/*.md` (테이블로 참조, 동적 로딩)

⚠️ CRITICAL (헌법 규칙 4):
- CLAUDE.md → agent-docs: @ 참조 금지 (자동 로드되어 토큰 낭비)
- 테이블 또는 일반 링크로 참조, 필요 시 Read 도구로 로드

EXECUTION PHASES

Phase 0: Component Registry Sync

SCAN:
├─ Glob("**/agents/*.md") → agent definitions
├─ Glob("**/skills/**/SKILL.md") → skill definitions
└─ Glob("**/commands/*.md") → command definitions

UPDATE: .claude-plugin/routing-table.json
├─ 새 컴포넌트 추가
├─ 삭제된 컴포넌트 제거
└─ last_synced 갱신

Phase 1: Hierarchical Scan

COLLECT HIERARCHY:
├─ Root → has_claude_md, has_agent_docs, children
├─ Modules → plugins/*/CLAUDE.md
└─ Submodules → 중첩된 모듈

Phase 2: Gap Analysis

LINE LIMITS (헌법 규칙):
├─ ROOT: Soft 300 / Hard 500
├─ MODULE: Soft 200 / Hard 350
└─ SUBMODULE: Soft 150 / Hard 250

CLASSIFY:
├─ CREATE_CLAUDE_MD: 누락
├─ NEEDS_AGENT_DOCS: Hard Limit 초과
├─ RECOMMEND_AGENT_DOCS: Soft Limit 초과
├─ UPDATE_LINKS: 참조 깨짐
└─ OK: 최신 상태

Phase 3: Report & Confirm

TUI로 작업 계획 표시 후 사용자 확인:

  • 전체 적용 (병렬 처리)
  • 선택 적용 (작업별 확인)
  • 미리보기
  • 취소

Phase 4: Parallel Execution

Task(subagent_type="document-builder"):
  Action: CREATE/UPDATE/REFACTOR
  Target Path: {path}
  Target Type: MODULE/SUBMODULE

Phase 5: Orphan Detection & Fix

ORPHAN TYPES:
├─ CLAUDE.md → 상위에서 참조 안됨 → 일반 링크로 참조 추가
├─ agent-docs → CLAUDE.md에서 링크 안됨 → 테이블에 추가
└─ parent 링크 누락 → [parent](../CLAUDE.md) 추가

⚠️ agent-docs 참조 시 @ 사용 금지 (헌법 규칙 4)

Phase 6: Validation

FINAL CHECK:
├─ 모든 링크 경로 유효 (일반 링크 + 테이블)
├─ 라인 수 제한 준수
├─ 고아 파일 0개
├─ 계층 무결성 유지
└─ agent-docs에 @ 참조 없음 (헌법 규칙 4)

CLAUDE.md STRUCTURE TEMPLATE

# {Module Name}

{1-2문장 개요}

## 핵심 기능
{간결한 기능 설명}

## 주요 구성요소
| 이름 | 역할 | 설명 |
|------|------|------|

## 빠른 시작
{필수 명령어만}

## 상세 문서 (필요 시 Read 도구로 로드)
| 문서 | 설명 |
|------|------|
| `agent-docs/{topic}.md` | {설명} |

## 하위 모듈 (있을 경우)
- [submodule](submodule/CLAUDE.md) - 설명

[parent](../CLAUDE.md)  ← parent 참조 (root 제외)

⚠️ 동적 로딩 원칙:

  • agent-docs는 코드 스팬 또는 [링크](경로) 형태로 참조
  • @ 참조 사용 금지 (토큰 낭비 방지)

USAGE

# 전체 동기화
/automation-tools:claude-sync

# 특정 플러그인만
/automation-tools:claude-sync --target plugins/nestjs-backend

# routing-table만
/automation-tools:claude-sync --only routing-table

# 검증만 (변경 없음)
/automation-tools:claude-sync --dry-run

ERROR HANDLING

ErrorResponse
document-builder 실패경고 후 스킵
Parent CLAUDE.md 없음부모 먼저 생성
순환 참조 감지에러 리포트, 수동 수정 요청
병렬 작업 충돌순차 재실행

FOLLOW-UP TUI

동기화 완료 후 선택:

  • 커밋 → /git-commit
  • 문서 검토 → 생성된 파일 열기
  • 재동기화 → 다시 실행
  • 완료 → 종료

EXECUTION

사용자가 /constitution 명령을 실행했습니다.

입력 인자: $ARGUMENTS

실행 지시

1단계: 인자 파싱

$ARGUMENTS에서 다음을 추출하세요:

  • action: list | add | edit | remove | check | history (첫 번째 인자)
  • rule-name: 규칙명 (두 번째 인자, edit/remove 시 필요)

인자가 없거나 help이면 사용법을 표시하세요.

2단계: action별 분기 처리

action = list
  1. Read로 agent-docs/constitution.md 읽기
  2. 규칙 목록을 TUI 형식으로 출력
action = add
  1. AskUserQuestion으로 규칙 정보 수집 (규칙명, 설명, 우선순위 1-4)
  2. Context7로 관련 베스트 프랙티스 조회 (선택적)
  3. 중복 검사 수행
  4. Edit로 agent-docs/constitution.md 업데이트
  5. Edit로 CLAUDE.md 헌법 테이블 업데이트
  6. MCP Memory에 변경 이력 저장
action = edit <name>
  1. Read로 기존 규칙 내용 조회
  2. AskUserQuestion으로 수정 사항 수집
  3. Edit로 양쪽 파일 업데이트
  4. MCP Memory에 변경 이력 저장
action = remove <name>
  1. AskUserQuestion으로 삭제 확인
  2. Edit로 양쪽 파일에서 규칙 제거
  3. MCP Memory에 변경 이력 저장
action = check
  1. 무결성 검사 수행:
    • agent-docs/constitution.md 존재 확인
    • CLAUDE.md 요약과 상세 동기화 확인
    • 규칙 형식 일관성 확인
  2. 문제 발견 시 자동 수정 제안
action = history
  1. MCP Memory에서 constitution, changelog 태그로 검색
  2. 변경 이력 출력

3단계: 결과 출력

수행 결과를 TUI 스타일로 표시하세요.


REFERENCE

대상 파일

  • agent-docs/constitution.md - 규칙 상세
  • CLAUDE.md 헌법 테이블 - 요약

ACTIONS 요약

액션설명
list규칙 목록 표시
add새 규칙 추가
edit <name>규칙 수정
remove <name>규칙 삭제
check무결성 검사
history변경 이력 조회

우선순위 레벨

레벨설명
1보안 규칙
2버전/호환성
3코드 품질
4워크플로우

PHASE 상세: List Rules

READ agent-docs/constitution.md
EXTRACT "## 규칙 목록" table
OUTPUT:
┌───────────────────────────────┐
│ 📜 프로젝트 헌법               │
├───────────────────────────────┤
│ 1. {rule} (우선순위: {p})     │
│    └─ {description}          │
└───────────────────────────────┘

PHASE 2: Add Rule

  1. 규칙 정보 수집: 규칙명, 설명, 우선순위(1-4)
  2. Context7 조회: 베스트 프랙티스 참조
  3. 검증: 중복 검사
  4. 적용: constitution.md + CLAUDE.md 업데이트
  5. Memory 저장: 변경 이력 기록

우선순위 레벨:

레벨설명
1보안 규칙
2버전/호환성
3코드 품질
4워크플로우

PHASE 3-4: Edit/Remove

RESOLVE rule_name from arguments
DISPLAY current content
GATHER modifications / confirmation
VALIDATE & APPLY
STORE to Memory

PHASE 5: Integrity Check

CHECKS:
├─ agent-docs/constitution.md 존재
├─ 규칙 목록-상세 동기화
├─ CLAUDE.md 요약 동기화
├─ 규칙 형식 일관성
└─ 앵커 링크 유효성

PHASE 6: View History

mcp__mm__search_by_tag: ["constitution", "changelog"]

OUTPUT:
=== 헌법 변경 이력 ===
{date}: {change_description}

RULE FORMAT

constitution.md 규칙 형식:

## {번호}. {규칙명}

### 개요
규칙 설명 (1-2문장)

### 상세 규칙
| 항목 | 설명 |

### 체크리스트
- [ ] 체크 항목

### 예시

USAGE

/automation-tools:constitution list
/automation-tools:constitution add
/automation-tools:constitution edit "플러그인 버전 관리"
/automation-tools:constitution check
/automation-tools:constitution history

ERROR HANDLING

ErrorResponse
파일 없음자동 생성 제안
중복 규칙명기존 규칙 수정 제안
동기화 불일치자동 수정 제안

Component Factory

MISSION

Generate Claude Code components (agent, skill, command) following Anthropic 2025 schema and best practices. Support research-driven generation via WebFetch and orchestrator composition from existing experts.

Input: $ARGUMENTS


SKILL INTEGRATION

This command uses four specialized skills for component generation:

1. Factory Generator Skill

  • Path: skills/factory-generator/
  • Role: Core generation logic (parsing, creation, file writing)
  • Triggers: Component type selection, user input collection

2. Factory Researcher Skill

  • Path: skills/factory-researcher/
  • Role: Web documentation and GitHub example analysis
  • Triggers: Research request, keyword extraction

3. Factory Validator Skill

  • Path: skills/factory-validator/
  • Role: Component validation and quality assurance
  • Triggers: Schema validation, quality scoring

4. Factory Orchestrator Skill

  • Path: skills/factory-orchestrator/
  • Role: Orchestrator agent creation and expert composition
  • Triggers: Multi-expert selection, composition patterns

EXECUTION FLOW

Phase 1: Initial Setup

1. PARSE $ARGUMENTS → extract type, name
2. USE factory-generator skill:
   - Handle argument parsing
   - Show type selection TUI if needed
   - Collect basic info (name, purpose)

Phase 2: Research (Optional)

3. IF user wants research → USE factory-researcher skill:
   - Execute WebSearch/WebFetch
   - Extract best practices and examples
   - Return structured research_context

Phase 3: Advanced Configuration

4. RETURN to factory-generator skill:
   - Collect location, model, tools preferences
   - Handle agent-specific configuration
   - Prepare generation context

Phase 4: Agent Composition (Agent only)

5. IF type = "agent" AND wants composition:
   USE factory-orchestrator skill:
   - Present composition options
   - Select and compose experts
   - Generate orchestration structure

Phase 5: Generation

6. SYNTHESIZE all inputs:
   - User preferences
   - Research findings (if any)
   - Composition design (if agent)
   - Generation templates

7. USE factory-generator skill:
   - Generate component content
   - Write files to disk
   - Update plugin.json if needed

Phase 6: Validation

8. USE factory-validator skill:
   - Validate schema compliance
   - Assess content quality
   - Generate validation report
   - Apply auto-fixes if approved

COORDINATION EXAMPLES

Example 1: Command with Research

User: /factory command typescript-linter "예, 공식문서 분석"

Flow:
1. factory-generator: Parse args, collect info
2. factory-researcher: Analyze TypeScript linting docs
3. factory-generator: Generate with research context
4. factory-validator: Validate and report

Example 2: Agent Orchestrator

User: /factory agent fullstack-reviewer

Flow:
1. factory-generator: Parse args, collect info
2. factory-orchestrator:
   - Select code-reviewer + testing-expert
   - Design orchestration pattern
3. factory-generator: Generate with orchestration
4. factory-validator: Validate and report

INTEGRATION BENEFITS

Modular Design

  • Each component has single responsibility
  • Easy to maintain and update individually
  • Clear interfaces between components

Flexible Research

  • Research is optional and on-demand
  • Results cached and reused when possible
  • Multiple research sources supported

Quality Assurance

  • Automatic validation for all components
  • Consistent schema compliance
  • Quality scoring and improvement suggestions

Expert Composition

  • Powerful orchestrator creation
  • Reuse existing specialized agents
  • Dynamic routing and delegation patterns

ERROR HANDLING

ComponentCommon ErrorsRecovery
GeneratorInvalid arguments, permission errorsClear error messages, suggestions
ResearcherNo results, rate limitsTry alternative sources, use defaults
ValidatorSchema violations, low scoresAuto-fix suggestions, manual review
OrchestratorExpert conflicts, timeoutFallback to single agent, retry

EXECUTE NOW

1. Start orchestration
2. Route to appropriate components
3. Coordinate information flow
4. Synthesize final results
5. Ensure quality standards met
6. Provide completion report

EXECUTION

사용자가 /optimize 명령을 실행했습니다.

입력 인자: $ARGUMENTS

실행 지시

1단계: 인자 파싱

$ARGUMENTS에서 다음을 추출하세요:

  • target: agent | command | prompt (첫 번째 인자)
  • file-path: 최적화할 파일 경로 (두 번째 인자)
  • options: --mcp, --interactive, --dry-run 등 (나머지 인자)

인자가 부족하면 AskUserQuestion으로 확인하세요.

2단계: target별 분기 처리

target = agent
  1. Read 도구로 에이전트 파일 읽기
  2. 다음 항목 분석:
    • Role clarity (역할 명확성)
    • Trigger effectiveness (트리거 효과)
    • Tool utilization (도구 활용도)
    • Prompt structure (프롬프트 구조)
  3. 개선 사항 적용 후 Edit으로 수정
target = command
  1. Read 도구로 커맨드 파일 읽기
  2. 다음 항목 분석:
    • Argument parsing (인자 파싱 로직 존재 여부)
    • Execution logic (실행 지시 존재 여부)
    • Help text clarity (도움말 명확성)
  3. 개선 사항 적용 후 Edit으로 수정
target = prompt
  1. --interactive 옵션: AskUserQuestion으로 프롬프트 입력 받기
  2. 파일 경로 제공: Read로 프롬프트 파일 읽기
  3. URL 제공: webReader로 내용 가져오기
  4. 프롬프트 최적화 수행 후 결과 출력

3단계: 옵션 처리

  • --mcp: Context7 (resolve-library-id, get-library-docs)로 최신 문서 참조
  • --dry-run: 수정하지 않고 제안 사항만 출력
  • --interactive: AskUserQuestion으로 대화형 진행

4단계: 결과 출력

최적화 전/후 비교 및 개선 사항 요약을 출력하세요.


REFERENCE

아래는 최적화 수행 시 참고할 지침입니다.

OPTIMIZATION PRINCIPLES

1. CLARITY

  • 명확한 목표와 제약 조건
  • 모호하지 않은 지시
  • 성공 기준 정의

2. EFFICIENCY

  • 토큰 사용량 최소화
  • 컨텍스트 윈도우 최적화
  • 불필요한 복잡성 제거

3. EFFECTIVENESS

  • 행동 지향적 프롬프트
  • 측정 가능한 결과
  • 실용적 적용 가능성

4. MAINTAINABILITY

  • 모듈식 구조
  • 쉬운 업데이트
  • 버전 관리 친화적

OPTIMIZATION WORKFLOWS

1. Agent Optimization

# 기본 에이전트 최적화
/optimize agent plugins/code-quality/agents/code-reviewer.md

# MCP 통합으로 최신 문서 반영
/optimize agent plugins/nestjs-backend/agents/typeorm-expert.md --mcp
Agent Optimization Process
1. Current State Analysis
   ├─ Role clarity assessment
   ├─ Trigger effectiveness review
   ├─ Tool utilization check
   └─ MCP integration opportunities

2. Best Practices Application
   ├─ Prompt structure optimization
   ├─ Context window efficiency
   ├─ Response format standardization
   └─ Error handling improvements

3. Integration Testing
   ├─ Simulated task execution
   ├─ Performance benchmarking
   └─ Compatibility validation

2. Command Optimization

# 커맨드 최적화
/optimize command plugins/code-quality/commands/review.md

# 배치 최적화
/optimize command plugins/full-stack-orchestration/commands/*.md
Command Optimization Checklist
✓ Argument parsing efficiency
✓ Help text clarity
✓ Error message usefulness
✓ Integration patterns
✓ Performance optimization
✓ Security considerations

3. Prompt Optimization

# 대화형 최적화
/optimize prompt --interactive

# 파일에서 프롬프트 최적화
/optimize prompt my-prompt.txt

# URL 기반 문서를 프롬프트로
/optimize prompt https://docs.example.com/guide
Prompt Enhancement Features
ENHANCEMENT TYPES:
├─ Task Decomposition
│   ├─ Complex task breakdown
│   ├─ Step-by-step clarification
│   └─ Dependency identification
│
├─ Context Optimization
│   ├─ Relevant information extraction
│   ├─ Noise reduction
│   └─ Structure organization
│
├─ Output Formatting
│   ├─ Structured responses
│   ├─ Code block optimization
│   └─ Example integration
│
└─ Resource Integration
    ├─ Latest documentation
    ├─ Best practices
    └─ Tool recommendations

OPTIMIZATION PRINCIPLES

1. CLARITY

  • Clear objectives and constraints
  • Unambiguous instructions
  • Well-defined success criteria

2. EFFICIENCY

  • Minimize token usage
  • Optimize for context window
  • Reduce unnecessary complexity

3. EFFECTIVENESS

  • Action-oriented prompts
  • Measurable outcomes
  • Practical applicability

4. MAINTAINABILITY

  • Modular structure
  • Easy to update
  • Version-friendly

ADVANCED FEATURES

1. Template-Based Optimization

# .claude/optimize-templates.yml
templates:
  agent:
    sections:
      - overview
      - capabilities
      - triggers
      - examples
    max_tokens: 8000

  command:
    sections:
      - description
      - usage
      - examples
      - integration
    max_tokens: 4000

2. Batch Operations

# 전체 플러그인 최적화
/optimize agent plugins/nestjs-backend/agents/ --batch

# 특정 패턴의 파일들 최적화
/optimize command "**/*review*.md" --recursive

3. Performance Analytics

{
  "optimization_report": {
    "file": "code-reviewer.md",
    "improvements": [
      {
        "type": "token_efficiency",
        "before": 2450,
        "after": 1890,
        "improvement": "23%"
      },
      {
        "type": "response_quality",
        "score_before": 7.2,
        "score_after": 8.9,
        "improvement": "24%"
      }
    ]
  }
}

INTEGRATION EXAMPLES

1. CI/CD Pipeline

# .github/workflows/optimize.yml
- name: Optimize Components
  run: |
    /optimize agent agents/ --batch --dry-run
    /optimize command commands/ --batch --dry-run

    # Check if optimization suggestions exist
    if [ -f .optimizations.md ]; then
      echo "Optimization suggestions found"
      cat .optimizations.md
    fi

2. Development Workflow

# 개발 사이클 통합
1. 에이전트/커맨드 작성
2. /optimize로 개선
3. 테스트 실행
4. PR 생성

BEST PRACTICES

Before Optimization

  1. Backup Originals: Always keep original versions
  2. Understand Context: Know the purpose and constraints
  3. Identify Metrics: Define what improvement means

During Optimization

  1. Incremental Changes: Apply changes gradually
  2. Test Each Change: Validate modifications
  3. Document Rationale: Note why changes were made

After Optimization

  1. Benchmark Performance: Measure improvements
  2. Gather Feedback: Collect user experiences
  3. Iterate: Continue refining based on results

QUALITY ASSURANCE

Optimization Validation

CHECKLIST:
□ Clear objective definition
□ Appropriate complexity level
□ Efficient token usage
□ Proper error handling
□ Consistent formatting
□ Adequate examples
□ Integration compatibility
□ Performance benchmarking

Common Pitfalls to Avoid

  1. Over-optimization: Don't sacrifice clarity for brevity
  2. Context Loss: Preserve essential information
  3. Tool Overload: Don't add unnecessary tools
  4. Generic Responses: Maintain specificity

TROUBLESHOOTING

Optimization Not Applied

Issue: Changes not taking effect
Solution:
1. Check file permissions
2. Verify file paths
3. Clear any caches
4. Restart Claude Code

Performance Degradation

Issue: Slower responses after optimization
Solution:
1. Profile token usage
2. Check for circular references
3. Simplify complex logic
4. Reduce context window usage

FUTURE ENHANCEMENTS

Planned Features

  • Auto-optimization: Scheduled optimization runs
  • A/B Testing: Compare old vs new versions
  • Custom Metrics: Define optimization KPIs
  • Integration Templates: Pre-built optimization patterns

Community Contributions

  • Share optimization templates
  • Contribute best practices
  • Report optimization success stories
  • Suggest new optimization strategies

QUICK REFERENCE

# Common commands
/optimize agent <file>                    # Optimize agent
/optimize command <file>                  # Optimize command
/optimize prompt --interactive           # Interactive prompt
/optimize prompt <file>                   # Optimize from file
/optimize prompt <url>                    # Convert URL to prompt

# Options
--mcp                                    # Enable MCP
--dry-run                                # Preview only
--batch                                  # Batch mode
--interactive                            # TUI mode
--template <name>                       # Use template
--output <file>                         # Save report

EXECUTION

사용자가 /partner 명령을 실행했습니다.

입력 인자: $ARGUMENTS

실행 지시

1단계: 인자 파싱

$ARGUMENTS에서 다음을 추출하세요:

  • action: select | status | feedback | switch | team | memory (첫 번째 인자)
  • options: --auto, --detailed, --history 등 (나머지 인자)

인자가 없으면 AskUserQuestion으로 action을 선택받으세요.

2단계: action별 분기 처리

action = select
  1. 현재 작업 컨텍스트 분석 (Git status, 열린 파일 등)
  2. 파트너 프로필 목록 표시 (Architect, Pragmatist, Mentor, Innovator, Guardian)
  3. --auto 옵션: 작업 유형에 맞는 파트너 자동 추천
  4. 사용자 선택 후 파트너십 시작 메시지 출력
action = status
  1. 현재 파트너 정보 조회 (MCP Memory에서)
  2. --detailed: 협업 시간, 완료 작업, 성과 지표 표시
  3. --history: 이전 협업 기록 표시
action = feedback
  1. AskUserQuestion으로 피드백 수집 (만족도 1-5, 코멘트)
  2. MCP Memory에 피드백 저장
  3. 파트너 XP 업데이트 메시지 출력
action = switch
  1. 현재 파트너 세션 종료
  2. 새 파트너 선택 (select 플로우)
action = team
  1. 서브액션 파싱: create, add, list
  2. 팀 구성 관리 (Memory 저장)
action = memory
  1. 서브액션 파싱: view, clear, export
  2. 파트너 컨텍스트 메모리 관리

3단계: 결과 출력

선택된 action에 따른 TUI 스타일 결과 표시.


REFERENCE

ACTIONS 요약

1. select

현재 작업에 가장 적합한 AI 파트너를 선택합니다.

/partner select                    # 대화형 선택
/partner select --auto            # 자동 매칭
/partner select the-architect     # 특정 파트너 직접 선택

2. status

현재 파트너십 상태를 확인합니다.

/partner status                   # 기본 상태
/partner status --detailed        # 상세 정보
/partner status --history         # 협업 기록

3. feedback

파트너에게 피드백을 제공합니다.

/partner feedback                 # 대화형 피드백
/partner feedback --rate 4.5      # 평점 제공
/partner feedback --file feedback.txt  # 파일에서 피드백

4. switch

다른 파트너로 변경합니다.

/partner switch                   # 파트너 선택창 표시
/partner switch the-pragmatist    # 특정 파트너로 변경

5. team

파트너 팀을 구성하고 관리합니다.

/partner team create "Dev Team"   # 새 팀 생성
/partner team add the-mentor      # 팀에 멤버 추가
/partner team list                # 팀 목록

6. memory

파트너의 컨텍스트 메모리를 관리합니다.

/partner memory view              # 메모리 확인
/partner memory clear             # 메모리 초기화
/partner memory export            # 메모리 내보내기

PARTNER PROFILES

Available Partners

  1. The Architect (🏛️)

    • 전문 분야: 시스템 아키텍처, 설계 패턴
    • 적합한 작업: 복잡한 시스템 설계, 기술 결정
  2. The Pragmatist (🔧)

    • 전문 분야: 실용적 구현, 빠른 프로토타이핑
    • 적합한 작업: MVP 개발, 즉각적인 문제 해결
  3. The Mentor (👨‍🏫)

    • 전문 분야: 교육, 코드 리뷰, 베스트 프랙티스
    • 적합한 작업: 학습, 기술 향상, 리팩토링
  4. The Innovator (💡)

    • 전문 분야: 최신 기술, 실험적 접근
    • 적합한 작업: R&D, 혁신적 솔루션
  5. The Guardian (🛡️)

    • 전문 분야: 보안, 테스트, 품질 보증
    • 적합한 작업: 코드 리뷰, 보안 감사, QA

USAGE EXAMPLES

Selecting a Partner

$ /partner select

🔍 현재 작업 분석 중...
✅ "React 컴포넌트 개발" task detected
✅ 복잡도: moderate
✅ 사용자 수준: intermediate

🎯 추천 파트너:
1. The Pragmatist (92% 일치) - 빠른 구현에 특화
2. The Mentor (78% 일치) - 학습 지원에 특화
3. The Innovator (65% 일치) - 새로운 접근법 제공

선택 > 1

🤝 The Pragmatist와 파트너십이 시작되었습니다!

Checking Status

$ /partner status --detailed

🤝 현재 파트너: The Pragmatist
📊 관계 레벨: Trusted Partner (Level 6)
⏱️  협업 시간: 47시간 32분

📈 성과 지표:
├─ 완료된 작업: 89개
├─ 평균 만족도: 4.7/5.0
├─ 반복 작업률: 12%
└─ 성공률: 96%

🎯 강점 분석:
├─ ⚡ 빠른 프로토타이핑 (Expert)
├─ 🎯 문제 해결 (Advanced)
├─ 💡 실용적 솔루션 (Expert)
└─ 📚 문서화 (Intermediate)

🔥 최근 성취:
├─ ✅ 30분 만에 API 엔드포인트 5개 구현
├─ ✅ 성능 저하 원인 2가지 식별 및 수정
└─ 🏆 Efficiency Badge 획득

Providing Feedback

$ /partner feedback

📝 피드백 제공 (The Pragmatist)

1. 작업 만족도 (1-5): 5
2. 솔루션 품질 (1-5): 4
3. 소통 명확성 (1-5): 5
4. 추가 코멘트:
   "정말 빠르고 실용적인 해결책을 제공해줘서 만족합니다.
    다만 때로는 더 창의적인 접근도 좋을 것 같아요."

✅ 피드백이 기록되었습니다.
🎉 The Pragmatist가 50 XP를 획득했습니다!
📈 파트너와의 관계가 강화되었습니다.

CONFIGURATION

Partner Preferences

# .claude/partner-config.yml
preferences:
  auto_select: true
  learning_mode: false
  feedback_reminder: true

communication:
  style: "friendly"
  detail_level: "balanced"
  examples: true

team:
  enable_collaboration: false
  auto_assemble: false

Partner Customization

# 파트너 설정 커스터마이징
/partner config the-architect

설정 옵션:
□ Formal communication style
□ Include diagrams automatically
□ Ask clarifying questions
□ Provide alternatives
□ Risk assessment mode
□ Documentation first approach

INTEGRATION

With Workflow Commands

# dev-flow와 통합
/dev-flow --partner the-guardian    # 보안 중심 개발
/dev-flow --partner the-mentor     # 학습 중심 개발

# 특정 작업에 파트너 지정
/feature "인증 시스템" --partner the-architect
/refactor "레거시 코드" --partner the-mentor

With Project Management

# 프로젝트별 파트너 할당
/partner assign --project e-commerce --team fullstack
/partner assign --project mobile-app --partner the-pragmatist

ADVANCED FEATURES

Partner Training

# 파트너 학습 데이터 제공
/partner train --file my-coding-style.js
/partner train --project-standards
/partner train --from-feedback feedback.log

Collaborative Mode

# 여러 파트너와 동시 작업
/partner team create "Dream Team"
/partner team add the-architect --role lead
/partner team add the-pragmatist --role implementer
/partner team add the-guardian --role reviewer

# 팀 작업 시작
/partner team work-on "새로운 기능 개발"

Performance Analytics

# 파트너 성과 분석
/partner analytics --period week
/partner analytics --by-task-type
/partner analytics --compare partners

BEST PRACTICES

  1. Consistent Partner Usage

    • 비슷한 작업에는 같은 파트너 활용
    • 파트너의 학습 곡선 고려
  2. Regular Feedback

    • 매 세션 후 간단한 피드백 제공
    • 구체적인 예시와 함께 제공
  3. Context Sharing

    • 프로젝트 배경 정보 공유
    • 이전 작업 결과 공유
  4. Relationship Building

    • 긍정적 강화 regular
    • 장기적 관계 perspective

TROUBLESHOOTING

Partner Not Responsive

# 해결 방법
/partner reset               # 파트너 세션 초기화
/partner memory clear        # 컨텍스트 클리어
/partner switch             # 다른 파트너로 변경

Poor Match

# 개선 방법
/partner re-evaluate        # 재평가 요청
/partner feedback --negative # 부정적 피드백
/partner config             # 설정 조정

STATS AND ACHIEVEMENTS

Relationship Levels

  1. New Partner (0-100 XP)
  2. Getting Familiar (100-500 XP)
  3. Working Partner (500-1500 XP)
  4. Trusted Partner (1500-5000 XP)
  5. Expert Collaborator (5000+ XP)

Badges

  • 🏆 Speed Demon - 10개 작업을 평균 시간 미만으로 완료
  • 💎 Quality Master - 연속 20개 5점 리뷰
  • 🎯 Problem Solver - 100개 복잡한 문제 해결
  • 👥 Team Player - 성공적인 팀 프로젝트 10회
  • 📚 Knowledge Sharer - 50개 베스트 프랙티스 공유

QUICK REFERENCE

# 기본 명령어
/partner select              # 파트너 선택
/partner status              # 상태 확인
/partner feedback            # 피드백 제공
/partner switch              # 파트너 변경

# 고급 명령어
/partner team <action>       # 팀 관리
/partner memory <action>     # 메모리 관리
/partner config <partner>    # 설정 변경
/partner analytics           # 성과 분석

# 옵션
--auto                        # 자동 선택
--detailed                    # 상세 정보
--history                     # 기록 보기
--export                      # 데이터 내보내기

최고의 AI 파트너를 찾아 생산성을 극대화하세요! 🚀

Setup Status Line

MISSION

Configure Claude Code status line with YAML-based Single Source of Truth architecture. Platform-specific scripts (Bash for Unix, PowerShell for Windows) read shared YAML config.

Args: $ARGUMENTS (옵션: --user, --project, --reset, --update, --disable)


PHASE 1: Detect Platform

DETECTION LOGIC:
├─ IF $env:OS == "Windows_NT" → PLATFORM = "windows"
├─ IF $OSTYPE contains "msys/mingw/cygwin" → PLATFORM = "windows"
├─ IF uname -s starts with "MINGW" → PLATFORM = "windows"
├─ IF uname -r contains "microsoft" → PLATFORM = "unix" (WSL uses bash)
└─ ELSE → PLATFORM = "unix"

⚠️ Windows: Use PowerShell, NOT Git Bash (PATH issues with cat/jq)

PHASE 1.5: Handle --reset or --disable Flag

IF $ARGUMENTS contains "--disable":
  ⚠️ statusLine 설정만 제거 (스크립트 파일은 유지)
  1. Remove statusLine key from ~/.claude/settings.json (if exists)
  2. Remove statusLine key from ./.claude/settings.local.json (if exists)
  3. REPORT "Status line이 비활성화되었습니다. 스크립트 파일은 유지됩니다."
  4. EXIT

IF $ARGUMENTS contains "--reset":
  ⚠️ 모든 설정과 파일 완전 삭제
  1. Remove statusLine key from ~/.claude/settings.json (if exists)
  2. Remove statusLine key from ./.claude/settings.local.json (if exists)
  3. Delete ~/.claude/statusline.sh (or .ps1)
  4. Delete ~/.claude/statusline.yaml
  5. Delete ~/.claude/statusline-debug.sh (if exists)
  6. Delete ~/.claude/statusline-input.log (if exists)
  7. REPORT "Status line 설정이 완전히 초기화되었습니다."
  8. EXIT

PHASE 2: Find Plugin Templates

⚠️ CRITICAL: Glob 도구는 현재 작업 디렉토리 기준으로만 검색합니다.
   ~/.claude/plugins/ 경로를 검색하려면 반드시 path 파라미터에 절대 경로를 명시해야 합니다!

SEARCH ORDER (Unix & Windows 공통):
├─ 1. ~/.claude/plugins/ 하위 전체 검색 (path 파라미터 필수!)
│     ├─ cache/claude-integration/automation-tools/*/templates/
│     └─ marketplaces/claude-integration/plugins/automation-tools/templates/
├─ 2. 현재 작업 디렉토리의 ./plugins/automation-tools/templates/
└─ 3. ./templates/ (local fallback)

ACTION SEQUENCE:
1. DETECT HOME_DIR:
   ├─ Unix: $HOME (예: /Users/username)
   └─ Windows: $env:USERPROFILE (예: C:\Users\username)

2. GLOB with absolute path parameter:
   ├─ Unix:   Glob(pattern: "**/statusline.sh", path: "$HOME/.claude/plugins")
   └─ Windows: Glob(pattern: "**/statusline.ps1", path: "$HOME/.claude/plugins")

3. IF results found → SELECT latest version from cache/ or marketplaces/
   IF empty → Glob(pattern: "**/templates/statusline.*", path: ".")
   IF still empty → ERROR "plugin_not_found"

EXPECTED PATHS:
├─ ~/.claude/plugins/cache/claude-integration/automation-tools/{version}/templates/
├─ ~/.claude/plugins/marketplaces/claude-integration/plugins/automation-tools/templates/
└─ ./plugins/automation-tools/templates/ (개발 환경)

PHASE 2.5: Check Existing Installation & Confirm Scope

CHECK EXISTING:
├─ ~/.claude/settings.json → HAS_USER_STATUSLINE = statusLine exists?
├─ ./.claude/settings.local.json → HAS_PROJECT_STATUSLINE = statusLine exists?
├─ Unix: ~/.claude/statusline.sh → SCRIPT_EXISTS?
└─ Windows: ~/.claude/statusline.ps1 → SCRIPT_EXISTS?

⚠️ CRITICAL: 기존 스크립트 버전 비교
IF SCRIPT_EXISTS:
  1. READ template file (from plugin)
  2. READ installed file (from ~/.claude/)
  3. COMPARE contents:
     ├─ IF different → NEEDS_UPDATE = true
     └─ IF same → NEEDS_UPDATE = false
  4. IF NEEDS_UPDATE:
     SHOW "기존 설치된 스크립트가 템플릿과 다릅니다."
     AskUserQuestion:
       question: "설치된 스크립트를 최신 템플릿으로 업데이트하시겠습니까?"
       header: "업데이트"
       options:
         - label: "업데이트 (Recommended)"
           description: "최신 기능(Context Window 표시 등)을 사용합니다"
         - label: "현재 버전 유지"
           description: "기존 설치된 스크립트를 그대로 사용합니다"
         - label: "취소"
           description: "설치를 취소합니다"
     IF "취소" selected → EXIT
     IF "현재 버전 유지" selected → SKIP_SCRIPT_COPY = true

IF HAS_USER_STATUSLINE OR HAS_PROJECT_STATUSLINE:
  SHOW current configuration summary

DETERMINE SCOPE from $ARGUMENTS or ASK:
├─ IF "--user" in $ARGUMENTS → SCOPE = "user"
├─ IF "--project" in $ARGUMENTS → SCOPE = "project"
├─ IF "--update" in $ARGUMENTS → FORCE_UPDATE = true (기존 스크립트 무조건 덮어쓰기)
└─ ELSE → AskUserQuestion

AskUserQuestion:
  question: "Status line을 어느 범위에 적용하시겠습니까?"
  header: "적용 범위"
  options:
    - label: "사용자 레벨 (Recommended)"
      description: "~/.claude/settings.json - 모든 프로젝트에 적용"
    - label: "프로젝트 레벨"
      description: "./.claude/settings.local.json - 현재 프로젝트에만 적용"
    - label: "취소"
      description: "설치를 취소합니다"

IF "취소" selected → EXIT with message "설치가 취소되었습니다."

PHASE 3: Copy Templates (Always to ~/.claude/)

스크립트 파일은 항상 ~/.claude/에 저장 (scope와 무관)

⚠️ IF SKIP_SCRIPT_COPY == true → SKIP script copy, only copy YAML if missing

Unix (macOS/Linux/WSL):

IF NOT SKIP_SCRIPT_COPY:
  FILES:
  ├─ statusline.sh → ~/.claude/statusline.sh
  └─ statusline.yaml → ~/.claude/statusline.yaml

  COMMANDS:
    mkdir -p ~/.claude
    cp {plugin_dir}/templates/statusline.sh ~/.claude/statusline.sh
    chmod +x ~/.claude/statusline.sh
    cp {plugin_dir}/templates/statusline.yaml ~/.claude/statusline.yaml

⚠️ Copy templates AS-IS without modifications!

Windows:

IF NOT SKIP_SCRIPT_COPY:
  FILES:
  ├─ statusline.ps1 → ~/.claude/statusline.ps1
  └─ statusline.yaml → ~/.claude/statusline.yaml

  NOTE: Use Write tool (not cp). No chmod needed for PowerShell.

PHASE 4: Update settings.json (Scope-Dependent)

DETERMINE TARGET FILE:
├─ IF SCOPE == "user" → TARGET = ~/.claude/settings.json
└─ IF SCOPE == "project" → TARGET = ./.claude/settings.local.json

READ TARGET (create if missing with {})

MERGE statusLine config:

Unix:
{
  "statusLine": {
    "type": "command",
    "command": "/bin/bash ~/.claude/statusline.sh"
  }
}

Windows:
{
  "statusLine": {
    "type": "command",
    "command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\statusline.ps1"
  }
}

PRESERVE existing settings, only update statusLine key.

⚠️ Project-level settings override user-level settings

PHASE 5: Verify Installation

⚠️ CRITICAL: 테스트 방법은 플랫폼별로 다름

TEST JSON (실제 Claude Code 스키마):
{
  "session_id": "test-session",
  "cwd": "/test",
  "model": {
    "id": "claude-opus-4-5-20251101",
    "display_name": "Opus 4.5"
  },
  "workspace": {
    "current_dir": "/test",
    "project_dir": "/test"
  },
  "version": "2.0.69",
  "context_window": {
    "total_input_tokens": 50000,
    "total_output_tokens": 10000,
    "context_window_size": 200000
  }
}

⚠️ NOTE: context_window 값은 /context 명령어와 다를 수 있음
  - context_window: API 호출 토큰 (total_input + total_output)
  - /context: 전체 컨텍스트 (시스템+도구+MCP+메모리+메시지)

---

### Unix (macOS/Linux/WSL) 테스트:

방법 1: 직접 파이프 (권장)
  echo '{"cwd":"/test","model":{"id":"claude-opus-4-5-20251101","display_name":"Opus 4.5"},"context_window":{"total_input_tokens":50000,"total_output_tokens":10000,"context_window_size":200000}}' | ~/.claude/statusline.sh

방법 2: 임시 파일 사용 (파이프 문제 시)
  1. WRITE test JSON to /tmp/statusline-test.json
  2. cat /tmp/statusline-test.json | ~/.claude/statusline.sh
  3. rm /tmp/statusline-test.json

---

### Windows 테스트 (임시 스크립트 방식 필수):

⚠️ Bash에서 PowerShell 직접 호출 시 이스케이프 충돌 발생
   → 반드시 임시 .ps1 테스트 스크립트 생성 후 실행

STEP 1: 임시 테스트 스크립트 생성
  Write to: ~/.claude/test-statusline.ps1
  Content:
  ```powershell
  # Temporary test script
  $json = '{"cwd":"C:\\test","model":{"id":"claude-opus-4-5-20251101","display_name":"Opus 4.5"},"context_window":{"total_input_tokens":50000,"total_output_tokens":10000,"context_window_size":200000}}'
  $json | & "$env:USERPROFILE\.claude\statusline.ps1"

STEP 2: 테스트 실행 powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$HOME/.claude/test-statusline.ps1"

또는 Git Bash에서: powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$USERPROFILE.claude\test-statusline.ps1"

STEP 3: 임시 파일 정리 Remove-Item ~/.claude/test-statusline.ps1 (또는 rm 명령)


EXPECTED OUTPUT: 🤖 Opus 4.5 │ 📂 /test │ [███░░░░░░░] 70%남음 (60K/200K)

(Git 브랜치는 테스트 경로가 Git 저장소가 아니면 표시되지 않음)

EXPECTED OUTPUT (context.enabled: false): 🤖 Opus 4.5 │ 📂 /test │ 🌿 main

(Context window bar가 표시되지 않음)

FEATURES TO VERIFY: ├─ 모델명 표시 (색상: cyan) ├─ 경로 표시 (색상: blue, 동적 길이) ├─ Git 브랜치 (색상: green) - 해당 경로가 Git 저장소인 경우만 ├─ Git 상태 (색상: yellow) - 변경사항이 있는 경우만 ├─ 진행률 바 (색상: 사용량에 따라 green/yellow/red) └─ 남은 퍼센트 (터미널 기본색)

IF output invalid → ERROR "test_failed" IF PowerShell execution policy error → "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser" 안내


### 스크립트 기능

| 기능 | 설명 |
|------|------|
| 공식 JSON 스키마 | `context_window.total_input_tokens` + `total_output_tokens` |
| 경로 최대 길이 | 기본 150자 (짧은 경로는 전체 표시, CLAUDE_TERM_WIDTH로 오버라이드) |
| 크로스 플랫폼 | Unix (Bash) / Windows (PowerShell) 동일 기능 |
| 하위 호환성 | 레거시 `contextWindow` 필드도 지원 |
| Context 표시 On/Off | `~/.claude/statusline.yaml`의 `context.enabled` 설정으로 제어 |

---

## PHASE 6: Report (Korean, Scope-Aware)

```markdown
## ✅ Status Line 설정 완료

### 적용 범위: {SCOPE}

| 항목 | 경로 |
|------|------|
| 스크립트 | `~/.claude/statusline.{sh|ps1}` |
| 설정 파일 | `~/.claude/statusline.yaml` |
| Claude 설정 | `{TARGET}` |

### 적용 방법
Claude Code를 **재시작**하면 활성화됩니다.

### 범위별 설명

**사용자 레벨** (`~/.claude/settings.json`):
- 모든 프로젝트에 적용
- 프로젝트 레벨 설정이 없으면 기본 적용

**프로젝트 레벨** (`./.claude/settings.local.json`):
- 현재 프로젝트에만 적용
- 사용자 레벨 설정보다 우선

### 커스터마이징
`~/.claude/statusline.yaml` 수정 → 즉시 적용 (재시작 불필요)

**Context Window Bar 비활성화 방법:**
\`\`\`yaml
# ~/.claude/statusline.yaml
context:
  enabled: false  # true → false로 변경
\`\`\`

**주요 설정 옵션:**
| 설정 | 기본값 | 설명 |
|------|--------|------|
| `context.enabled` | `false` | Context window bar 표시 여부 |
| `display.path_max_length` | `30` | 경로 최대 길이 |
| `display.bar_width` | `10` | 진행률 바 너비 |
| `display.language` | `ko` | 언어 (ko/en) |

| 플랫폼 | 스크립트 | 상태 |
|--------|----------|------|
| macOS/Linux | statusline.sh | ✅ |
| Windows | statusline.ps1 | ✅ |
| WSL | statusline.sh | ✅ |

PHASE 7: Follow-up TUI

AskUserQuestion:
  question: "Status line 설정이 완료되었습니다. 다음 작업을 선택하세요."
  header: "후속"
  options:
    - label: "설정 커스터마이징"
      description: "statusline.yaml 파일을 열어 설정을 수정합니다"
    - label: "테스트 재실행"
      description: "status line 스크립트를 다시 테스트합니다"
    - label: "완료"
      description: "작업을 종료합니다"

ERROR HANDLING

ErrorDetectionResponse
plugin_not_foundGlob returns empty"플러그인 템플릿을 찾을 수 없습니다. 수동 설치 가이드를 확인하세요."
settings_missingFile not exists"settings.json이 없습니다. 새로 생성합니다."
permission_deniedWrite/chmod fails"권한 오류: 적절한 권한으로 다시 실행하세요."
test_failed_unixScript output invalid"테스트 실패: 스크립트 문법 검증이 필요합니다."
test_failed_windowsPowerShell error"테스트 실패: PowerShell 실행 정책을 확인하세요."
copy_failedcp/Write fails"템플릿 복사 실패: 디스크 공간 및 권한을 확인하세요."

EXECUTE NOW

1. DETECT platform (Windows vs Unix)
2. IF "--disable" in $ARGUMENTS → REMOVE statusLine from settings, REPORT, EXIT
3. IF "--reset" in $ARGUMENTS → EXECUTE PHASE 1.5 (full cleanup) and EXIT
4. DETECT HOME_DIR:
   ├─ Unix: echo $HOME (또는 ~)
   └─ Windows: echo $env:USERPROFILE
5. GLOB find plugin templates with absolute path:
   ├─ Glob(pattern: "**/statusline.*", path: "$HOME/.claude/plugins")
   └─ IF empty → Glob(pattern: "**/templates/statusline.*", path: ".")
6. CHECK existing installation (PHASE 2.5):
   a. CHECK script file exists (statusline.sh or statusline.ps1)
   b. IF exists:
      ├─ READ template content
      ├─ READ installed content
      ├─ COMPARE contents
      └─ IF different → ASK "업데이트하시겠습니까?" (AskUserQuestion)
   c. IF "--update" in $ARGUMENTS → FORCE_UPDATE (덮어쓰기)
7. DETERMINE SCOPE:
   ├─ IF "--user" in $ARGUMENTS → SCOPE = "user"
   ├─ IF "--project" in $ARGUMENTS → SCOPE = "project"
   └─ ELSE → AskUserQuestion (PHASE 2.5) ← REQUIRED
8. IF "취소" selected → EXIT with message
9. READ template files
10. IF NOT SKIP_SCRIPT_COPY:
    a. IF Windows:
       ├─ WRITE statusline.ps1 → ~/.claude/
       └─ WRITE statusline.yaml → ~/.claude/
    b. IF Unix:
       ├─ WRITE statusline.sh → ~/.claude/
       ├─ BASH chmod +x ~/.claude/statusline.sh
       └─ WRITE statusline.yaml → ~/.claude/
11. DETERMINE TARGET:
    ├─ IF SCOPE == "user" → TARGET = ~/.claude/settings.json
    └─ IF SCOPE == "project" → TARGET = ./.claude/settings.local.json
12. READ TARGET (or create empty {})
13. WRITE merged TARGET with statusLine config
14. TEST script (platform-specific):
    ├─ Unix: echo JSON | ~/.claude/statusline.sh
    └─ Windows: CREATE test-statusline.ps1 → EXECUTE → DELETE
15. REPORT in Korean (with SCOPE info)
16. SHOW follow-up TUI ← REQUIRED

Sponsors

Details

Marketplace
m16khb/claude-integration
Source
plugins/automation-tools
Category
Productivity

More from m16khb/claude-integration

All 7