Claude Code로 전체 개발 워크플로우를 자동화하는 실전 예제
Claude Code를 사용하여 Issue 생성부터 PR 머지까지 개발 워크플로우를 자동화하는 실전 예제. 개발 시간을 대폭 단축하는 패턴.
Claude Code can automate not just one-off tasks but your entire development workflow. This article shows real examples for automating the path from issue creation to PR merge.
The Target Workflow
A typical development flow consists of these steps:
- Read an issue
- Create a branch
- Implement
- Write tests
- Open a PR
- Apply review feedback
- Merge
We’ll chain these together with Claude Code.
Step 1: From Issue to Implementation
Pass a GitHub issue number and Claude Code creates the branch, implements, and writes tests in one go.
#!/bin/bash
ISSUE_NUMBER=$1
claude -p "
Fetch GitHub Issue #${ISSUE_NUMBER} via the gh CLI and understand the content.
Then do the following:
1. Create branch issue/${ISSUE_NUMBER}-fix
2. Edit the necessary files to implement
3. Write tests (vitest)
4. Run npm test and ensure all tests pass
5. git add && git commit -m 'fix: #${ISSUE_NUMBER} ...'
"
./auto-fix.sh 123 is now all you need to fix issue #123.
Step 2: Automated PR Creation
Once implementation is done, let Claude Code create the PR too.
claude -p "
Use gh pr create to open the PR.
Auto-generate the title and body from the changes.
The body should include:
- Change summary
- List of modified files
- Test results
- Notes for reviewers
Finally open it with gh pr view --web.
"
A PR following your template is generated automatically.
Step 3: Self-Review Automation
Once the PR exists, run a self-review.
PR_NUMBER=$1
gh pr diff $PR_NUMBER | claude -p "
Review this PR for:
1. Possible bugs
2. Security risks
3. Performance concerns
4. Naming and readability
5. Test coverage
If issues exist, attach severity (high/medium/low) and post via gh pr review.
"
Self-reviews reduce the burden on human reviewers.
Step 4: CI/CD Integration
Combined with GitHub Actions, reviews run automatically on PR creation.
name: Claude Auto Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
- name: Run review
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr diff ${{ github.event.pull_request.number }} | \
claude -p "Review this PR and flag any issues"
See Claude Code Hooks Guide for related setup.
Step 5: Post-Merge Cleanup
Cleanup of branches and related issues can be automated too.
claude -p "
PR #${PR_NUMBER} has been merged. Do the following:
1. Delete the local branch (git branch -d)
2. Delete the remote branch (git push origin --delete)
3. Close any related issues (gh issue close)
4. Append the merged content to CHANGELOG.md
"
Full Automation Script
Here’s auto-dev.sh that ties it all together.
#!/bin/bash
set -e
ISSUE=$1
if [ -z "$ISSUE" ]; then
echo "Usage: ./auto-dev.sh <issue-number>"
exit 1
fi
# 1. Create branch
git checkout -b "issue/${ISSUE}-fix"
# 2. Implement
claude -p "Implement Issue #${ISSUE} and write tests"
# 3. Run tests
npm test
# 4. Commit
git add -A
claude -p "Generate a git commit message from the changes and commit"
# 5. Push
git push -u origin HEAD
# 6. Open PR
claude -p "Open a PR via gh pr create"
# 7. Self-review
PR=$(gh pr view --json number -q .number)
gh pr diff $PR | claude -p "Self-review and flag any issues"
echo "✅ Automation complete! PR: $(gh pr view --web)"
Now ./auto-dev.sh 123 handles everything from branch creation to PR.
Caveats
1. Don’t over-automate
Auto-merging is dangerous. Always have a human review and let humans decide on merges.
2. Maintain test coverage
Auto-implemented code can only be verified by tests. Including auto-test generation, keep coverage above 80%.
3. Have a rollback path
You need to be able to roll back fast if something breaks. Keep commits small to make git revert easy.
Conclusion
- Claude Code can automate from issue creation to PR merge
- Combined with GitHub Actions, it integrates into a full CI/CD pipeline
- Don’t over-automate; keep humans in the review/merge loop
- Coverage and rollback paths give you safe operation
Combined with CI/CD Setup Guide and Subagent Patterns, you can build even more powerful workflows. See the Anthropic Claude Code docs for more.
Claude Code 워크플로우를 한 단계 업그레이드하세요
지금 바로 Claude Code에 복사해 쓸 수 있는 검증된 프롬프트 템플릿 50선.
무료 PDF: 5분 완성 Claude Code 치트시트
이메일 주소만 등록하시면 A4 한 장짜리 치트시트 PDF를 즉시 보내드립니다.
개인정보는 엄격하게 관리하며 스팸은 보내지 않습니다.
이 글을 작성한 사람
Masa
Claude Code를 적극 활용하는 엔지니어. 10개 언어, 2,000페이지 이상의 테크 미디어 claudecode-lab.com을 운영 중.
관련 글
Claude Code 팀 협업 실전 가이드
팀에서 Claude Code를 사용할 때의 설정 공유, 코딩 규약, PR 리뷰 자동화 등 실전 노하우.
Claude Code로 리팩토링을 자동화하는 방법
Claude Code를 활용해 코드 리팩토링을 효율적으로 자동화하는 방법을 알아봅니다. 실전 프롬프트와 구체적인 리팩토링 패턴을 소개합니다.
Claude Code로 사이드 프로젝트 개발 속도를 극대화하는 방법 [예제 포함]
Claude Code를 활용해 개인 프로젝트 개발 속도를 획기적으로 높이는 방법을 알아봅니다. 실전 예제와 아이디어부터 배포까지의 워크플로를 포함합니다.