Skip to main content
ClaudeWave
Slash Command745 repo starsupdated 24d ago

suggest-automation

The suggest-automation slash command analyzes recent git commit patterns and CLAUDE.md rules to identify repetitive workflows and recommend appropriate automations. Use this command periodically to discover opportunities for creating new Claude commands, skills, or agents that could eliminate redundant manual work, such as generating test files, creating boilerplate components, or automating common git workflows.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/sangrokjung/claude-forge/HEAD/commands/suggest-automation.md -o ~/.claude/commands/suggest-automation.md
Then start a new Claude Code session; the slash command loads automatically.

suggest-automation.md

## Task

### 0단계: 분석 범위 결정
- $ARGUMENTS 숫자 있으면 → 해당 커밋 수
- 없으면 → 기본 50개 커밋

### 1단계: 데이터 수집

#### 커밋 패턴 수집
```bash
git log --oneline -[N]
git log --name-status -[N] --pretty=format:"%s"
```

#### 기존 자동화 확인
Read 도구로 다음 디렉토리 확인:
- `.claude/commands/` - 기존 command 목록
- `.claude/agents/` - 기존 agent 목록
- `.claude/skills/` - 기존 skill 목록 (있으면)

#### CLAUDE.md 분석
- Read 도구로 CLAUDE.md 읽기
- 반복되는 규칙 패턴 확인
- 자주 언급되는 작업 유형 파악

### 2단계: 패턴 분석

#### 커밋 메시지 패턴
- 같은 prefix 빈도 분석 (fix:, feat:, docs:, test: 등)
- 같은 키워드 반복 횟수 (API, migration, test, config 등)
- 유사한 작업 패턴 그룹화

#### 파일 변경 패턴
- 자주 생성되는 파일 유형 (*.test.ts, *.spec.ts 등)
- 자주 수정되는 디렉토리
- 함께 변경되는 파일 그룹

#### CLAUDE.md 패턴
- 비슷한 규칙 그룹
- 반복 추가되는 규칙 유형

### 3단계: 제안 생성

**패턴 → 제안 매핑:**

| 발견 패턴 | 제안 유형 | 예시 |
|----------|----------|------|
| 테스트 파일 자주 생성 | command | `/generate-test` |
| 특정 구조 파일 반복 생성 | skill | `api-generator` |
| 복잡한 작업 반복 위임 | agent | `migration-helper` |
| 같은 git 명령 조합 반복 | command | `/quick-deploy` |
| 보일러플레이트 반복 | skill | `component-template` |

**제안 조건:**
- 최소 3회 이상 반복된 패턴만 제안
- 이미 존재하는 자동화와 중복 제외

### 4단계: 결과 출력

```
🔍 자동화 기회 분석 (최근 [N]개 커밋)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

## 발견된 패턴

### 1. [패턴 이름] ([반복 횟수]회)
- 패턴: [구체적 패턴 설명]
- 제안: [command/skill/agent 이름]
- 효과: [자동화 시 이점]

### 2. [패턴 이름] ([반복 횟수]회)
- 패턴: [구체적 패턴 설명]
- 제안: [command/skill/agent 이름]
- 효과: [자동화 시 이점]

[추가 패턴...]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

## 이미 있는 자동화
- /[command1] ✓
- /[command2] ✓
- [agent1] ✓

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

## 권장 액션
1. [높음] [제안 내용]
2. [중간] [제안 내용]
3. [낮음] [제안 내용]

생성할 번호를 입력하세요 (또는 'skip'):
```

### 5단계: 선택적 생성

사용자가 번호 선택하면:

1. 해당 유형(command/skill/agent) 템플릿 생성
2. 적절한 디렉토리에 파일 생성
3. 기본 구조 채워넣기

**생성 예시 (command):**
```markdown
# 생성: .claude/commands/[이름].md

---
allowed-tools: [필요한 도구]
description: [자동 생성된 설명]
argument-hint: [인자 힌트]
---

## Task

[기본 템플릿 - 사용자가 수정 필요]

### 0단계: 환경 확인
[프로젝트 상태 확인]

### 1단계: 실행
[핵심 작업]

### 완료 안내
[결과 출력]
```

**생성 완료 안내:**
```
✅ 자동화 생성 완료

생성된 파일:
- .claude/commands/[이름].md

다음 단계:
1. 파일 내용 확인 및 수정
2. 테스트 실행: /[이름]
```

### 패턴 없을 때
```
🔍 자동화 기회 분석 (최근 [N]개 커밋)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✨ 뚜렷한 반복 패턴이 발견되지 않았습니다.

가능한 이유:
- 다양한 작업을 진행 중
- 이미 충분히 자동화됨
- 분석 범위가 작음 (커밋 수 늘려서 재시도)

💡 Tip: /suggest-automation 100 으로 더 넓은 범위 분석
```
architectSubagent

Software architecture specialist for system design, scalability, and technical decision-making. Use PROACTIVELY when planning new features, refactoring large systems, or making architectural decisions.

build-error-resolverSubagent

Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.

code-reviewerSubagent

Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code. MUST BE USED for all code changes.

database-reviewerSubagent

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

doc-updaterSubagent

Documentation and codemap specialist. Use PROACTIVELY for updating codemaps and documentation. Runs /update-codemaps and /update-docs, generates docs/CODEMAPS/*, updates READMEs and guides.

e2e-runnerSubagent

End-to-end testing specialist using Vercel Agent Browser (preferred) with Playwright fallback. Use PROACTIVELY for generating, maintaining, and running E2E tests. Manages test journeys, quarantines flaky tests, uploads artifacts (screenshots, videos, traces), and ensures critical user flows work.

plannerSubagent

Expert planning specialist for complex features and refactoring. Use PROACTIVELY when users request feature implementation, architectural changes, or complex refactoring. Automatically activated for planning tasks.

refactor-cleanerSubagent

Dead code cleanup and consolidation specialist. Use PROACTIVELY for removing unused code, duplicates, and refactoring. Runs analysis tools (knip, depcheck, ts-prune) to identify dead code and safely removes it.