jira-task-donelisted
Install: claude install-skill mzd-hseokkim/jira-claude-code-integration
# jira-task-done: Complete a Jira Task
**Language Rule**: 프로젝트 CLAUDE.md의 Conventions 섹션 참고 (한국어 출력, Jira 코멘트 제목은 영어).
## Prerequisites
- A feature branch `feature/<TASK-ID>` must exist with commits
- Jira MCP server must be connected
## Workflow
### Step 1: Verify Context
Check for `.jira-context.json` to get the active task context.
If TASK-ID is provided as argument, use that instead.
`completedSteps`에 `"merge"` 또는 `"pr"`가 있으면 본 단계는 컨텍스트만으로 충분 — git 호출 불필요. 둘 다 없으면 (예외 경로: 사용자가 merge/pr 없이 done을 호출) 그때만 `git branch --list "feature/<TASK-ID>"`로 브랜치 존재 확인.
### Step 2: Fetch Current Issue Status
**Cache-first**: `.jira-context.json`의 `cachedIssue`를 먼저 확인 (CLAUDE.md "Issue Cache" 참고). hit이면 호출 생략하고 캐시된 `status`만 사용. miss이면 `mcp__atlassian__jira_get_issue` 호출 (`fields="summary,status,issuetype,assignee"`, `comment_limit=0`) 후 cache 갱신. **단 done 단계는 상태 전이 직전이므로 사용자가 신선도가 의심되면 cache 무시하고 재조회할 수 있음**.
### Step 3: Summarize Changes
**기본 경로 (merge/pr 완료 후 done 호출)**: git 호출 0회.
merge 단계에서 이미 Jira 코멘트(`## Task Merged Locally`)에 변경 파일·삽입/삭제 라인 수가 게시되어 있고, plan/design/impl/test 문서에 모든 요약이 있다. Step 2의 cachedIssue 코멘트 또는 PDCA 문서를 그대로 인용한다.
**예외 경로 (merge/pr 없이 done 직접 호출)**: 그때만 squash·merge 형태에 따라 적절한 git 명령으로 stat 1회 조회.
- squash-merged onto base: `git show --stat $(git log --grep="<TASK-ID>" -1 --format=%H <base-branch>)`
- 일반 merge: `git diff --stat <base-branch>..feature/<TASK-ID>`
- 판단 기준: `<base>..feature/<TASK-ID>`가 비어 있으면 squash, 비어있지 않으면 일반.
### Step 4: Generate C