Stats
Actions
Tags
How this command is triggered — by the user, by Claude, or both
Slash command
/testing:test-affected 티켓ID 또는 생략(자동감지)This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# 영향 엔드포인트 추적 + 스모크 테스트 코드 변경 사항을 분석하여 영향받는 엔드포인트를 자동 추적하고, Write→Verify 패턴 포함 스모크 테스트까지 실행합니다. ## Phase 1 — 변경 파일 수집 & 티켓 감지 1. 브랜치명에서 티켓 ID 감지: `git branch --show-current` → `WM-\d+`, `LA-\d+`, `LS-\d+` 2. `$ARGUMENTS`가 있으면 티켓 ID로 사용 3. 변경 파일 수집 (우선순위): - 스테이징: `git diff --staged --name-only` - 브랜치: `git diff master...HEAD --name-only` - 작업트리: `git diff --name-only` ## Phase 2 — 영향 엔드포인트 추적 변경 파일에서 Controller까지 역추적 (최대 3단계): | 파일 역할 | 경로 패턴 | 추적 방향 | |-----------|-----------|-----------| | Controller | `Controllers/` | → Routes.php에서 직접 매칭 | | Service | `Services/` | → Cont...
코드 변경 사항을 분석하여 영향받는 엔드포인트를 자동 추적하고, Write→Verify 패턴 포함 스모크 테스트까지 실행합니다.
git branch --show-current → WM-\d+, LA-\d+, LS-\d+$ARGUMENTS가 있으면 티켓 ID로 사용git diff --staged --name-onlygit diff master...HEAD --name-onlygit diff --name-only변경 파일에서 Controller까지 역추적 (최대 3단계):
| 파일 역할 | 경로 패턴 | 추적 방향 |
|---|---|---|
| Controller | Controllers/ | → Routes.php에서 직접 매칭 |
| Service | Services/ | → Controller 검색 → Routes.php |
| DAO/Model | Models/, DAO.php | → Service → Controller → Routes.php |
| Repository | Repositories/ | → Service → Controller → Routes.php |
| DTO/Entity/Enum/Library | 기타 | → 사용처 전체 검색 |
추적 방법:
Grep으로 new ClassName 또는 use Namespace\ClassName 검색Config/Routes.php에서 라우트 매칭testjob/{TICKET}/ 디렉토리 생성 후 TEST_ENDPOINTS.md 자동 생성:
# {TICKET} 테스트 엔드포인트 목록 (자동 생성)
- **생성일:** {date}
- **브랜치:** {branch}
- **변경 파일:** {N}개
## 영향 엔드포인트
| | METHOD | Path | verify | 비고 | 영향 경로 |
|-|--------|------|--------|------|-----------|
| [ ] | GET | representatives | - | 목록 조회 | DAO→Service→Controller |
| [ ] | POST | representatives | GET representatives | 생성 | DAO→Service→Controller |
| [ ] | DELETE | representatives/(:num) | GET representatives | 삭제 | DAO→Service→Controller |
verify 자동 추론 규칙:
POST /xxx → GET /xxxPUT /xxx → GET /xxxPATCH /xxx/1 → GET /xxx/1DELETE /xxx/1 → GET /xxx (부모 경로)-기존 TEST_ENDPOINTS.md가 있으면 덮어쓰지 않고 병합 제안.
urltest.http 탐색 (~/.claude-dotfiles/ → testjob/ → ../testjob/ → ~/workspace/testjob/)1. GET {verify_path} → verify_before_{name}.json 저장
2. {METHOD} {path} {body} → 상태코드 확인 (200/201/204)
3. GET {verify_path} → verify_after_{name}.json 저장
4. python3 -m json.tool 정렬 후 diff -u → 변경 분석
curl -sS -o {output_file} -w "%{http_code}" \
-X {METHOD} \
-H "Authorization: Bearer ${TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Requested-With: XMLHttpRequest" \
[-d '${BODY_JSON}'] \
"${URL}"
testjob/{TICKET}/results/에 저장SMOKE_TEST_REPORT.md 생성:
# {TICKET} Smoke Test Report (auto-generated by /test-affected)
- **Date:** {date}
- **Host:** {host}
- **Branch:** {branch}
- **변경 파일:** {N}개
- **영향 엔드포인트:** {N}개
## 영향 추적 요약
| 변경 파일 | 역할 | 영향 엔드포인트 |
|-----------|------|----------------|
| `DAO.php` | DAO | GET /api/v2/mail/... |
## GET 결과
| Endpoint | Status | Size | 비고 |
|----------|--------|------|------|
| ... | 200 | 1.2K | OK |
## Write→Verify 결과
| Endpoint | Method | Status | Verify | Diff | 비고 |
|----------|--------|--------|--------|------|------|
| representatives | POST | 201 | GET representatives | +1 항목 | ✓ |
## 미테스트 항목
- POST /sendMail — body 미제공, 수동 테스트 필요
npx claudepluginhub bradykim7/agcoco --plugin testing