『Claude Code による AI 駆動開発入門』読書メモ — 仕様書から並列実装・レビューまでの全工程
요약
이 기술 기사는 'Claude Code를 활용한 AI 주도 개발'의 전 과정 워크플로우를 정리하고 있습니다. 단순히 코드를 생성하는 것을 넘어, 요구사항 정의서 작성부터 시작하여 가드레일 설정(Linter, CI/CD 등)을 거쳐 실제 구현 및 리뷰에 이르는 체계적인 표준 프로세스를 제시합니다. 핵심은 AI가 개발의 전 단계를 수행할 수 있도록 '사전 준비'와 '구조화된 환경 구축'에 초점을 맞추는 것입니다.
핵심 포인트
- AI 주도 개발은 '요구사항 정의서 → 가드레일 설정 → 구현 → 리뷰' 순서로 진행되어야 하며, 이 순서를 명확히 이해하는 것이 중요합니다.
- 개발 초기 단계에서 Linter, 테스트 프레임워크, CI/CD 등 '가드레일(Guardrail)'을 먼저 구축하여 AI의 실수를 시스템적으로 방지해야 합니다.
- 장기 개발 과정에서는 Context Management(clear, compact)를 통해 중요한 정보는 외부 문서나 Issue에 저장하고, AI의 메모리 부하를 관리하는 것이 필수적입니다.
- 구현된 코드는 반드시 Claude에게도 리뷰를 요청하여 PR 댓글 형태로 자동화된 검토 과정을 거치는 것이 권장됩니다.
- GitHub Issue와 Git Worktree 같은 주변 도구를 활용하여 태스크 분할 및 병렬 처리 능력을 극대화해야 합니다.
この記事を読むとわかること
- 書籍『Claude Code による AI 駆動開発入門』が示す、AI 駆動開発の全工程の流れ - 各フェーズで何を準備し、何を Claude にやらせ、何を機械(lint/CI/フック)に任せるか
- 並列タスク・サブエージェント・MCP まで含めた周辺ツールの使いどころ
書籍を読んで自分なりに整理した「Claude Code を使った開発の標準フロー」を、メモから漏らさず 1 本にまとめます。
課題・背景:AI 駆動開発の「順番」が分かりにくい
Claude Code を使い始めると、こんな迷い方をしがちです。
- 仕様書を先に作るべき?それともまず動くものを?
- Linter や CI はいつ入れる?
- 並列でタスク投げると速いの?それとも壊れる?
- サブエージェントとスラッシュコマンドの使い分けが曖昧
- そもそも「Claude にどこまで任せて、自分は何をする」のかが不明瞭
書籍はこの「順番」を明確に示してくれていました。仕様書 → ガードレール → タスク分割 → 実装 → レビュー という流れの中で、各フェーズの目的とツールを整理していきます。
全体像
| フェーズ | 目的 | 主要ツール / 仕組み |
|---|---|---|
| 0. 基本方針 | 思考のフレーム作り | テストルール / 設計の熟考 / Context7 |
| ... | clear / compact / 永続化 | |
| 4. 実装 | コードを書かせる | GitHub Issue / ブランチ / PR |
| 5. 並列タスク | スループットを上げる | Git Worktree |
| 6. サブエージェント | 専門領域を切り出す | エージェント単位のコンテキスト分離 |
| ... |
以下、フェーズごとに本書のポイントを整理します。
0. 基本方針
書籍が冒頭で挙げていた「思考の前提」がこちら。
- テストは厳格なルールを作っておく(後述のガードレールに繋がる) - 設計は熟考させる— Claude に "考えさせる" 工程を端折らない - コーディングでは Context7 を使う— 最新ドキュメントを取りに行く - 簡単な仕様書を作ってから作業する— 仕様書ファースト 一気に作ると手を抜くので、フェーズを分けて TODO にチェックを入れながら作ってもらう- 終わった後で振り返って TODO ファイルにまとめさせる(拡張思考を使う) → その後実装させる
「振り返り → 拡張思考でまとめさせる → 次の実装」のループが、コンテキスト疲弊を防ぐコツとして紹介されていました。
1. 仕様書
AI 駆動開発に良い仕様書は必須、と本書は強調しています。
作るべきドキュメント:
- 要件定義書
- DB 定義書
- 画面設計
- API 定義書
- テスト仕様書
運用のコツ:
- 定義書は(忘れずに)
@
マークで読み込ませる - 要約 or ディレクトリ分けでコンテキストを節約 - 仕様書作成用ライブラリ(例: claude-code-spec-workflow)も活用できる
2. ガードレール設定
要件定義とライブラリ選定が終わったら、実装前に 以下を入れます。実装が始まってからでは遅い。
プロセス系(実装前にセットアップ)
| 仕組み | 役割 |
|---|---|
| Linter | 書き方を機械的に揃える |
| テストライブラリ | テストの土台。書き方をきちんと指示する |
| Husky | コミット前に Format / Lint を強制 |
| CI/CD | push のたびに同じチェックを再走 |
| Makefile | デプロイ・ビルドコマンドを集約 |
# Husky のセットアップ例
npm install --save-dev husky
npx husky init
...
ガードレールとして機能するもの(コードの中に組み込む)
- コンパイルチェック
- テスト(書き方はきちんと指示する)
- Linter の設定をプロジェクト開始時に入れておく
- データベースの型定義はPrismaで出力 - API はOpenAPIを使って型出力 - Zodでデータスキーマを定義(OpenAPI 仕様書から作るライブラリも活用) - 使用技術を書いておく — 人気の言語の方が精度が上がる
狙いは一貫しています — 「Claude が間違ったら、コンパイラかランタイムが止める」状態を作ること。
3. コンテキスト管理
長丁場の開発では、コンテキストの使い方が成否を分けます。
- 意識的に
clear/compactを使う -compactで圧縮するときは何を重点的に残すか指示する(定義書に書いて永続化も可) - ガードレール設定が終わったらclearでリフレッシュし、claude.mdをベースにultrathinkを使って構築タスクを定義 → GitHub Issue として記録
「重要事項は外部(定義書 / Issue)に逃がし、メモリは流す」というのがコンテキスト運用の基本姿勢でした。
4. 開発フロー(実装本体)
書籍が示す実装の標準フロー:
- 仕様書作成(要件 / DB / API / 画面 / テスト)
- ライブラリ選定
- ガードレール設定(Linter / テスト / Husky / CI/CD)
clear
Context Refresh — ultrathink
Task Definition → gh
Create GitHub Issue via Command — Cut Branch to Implement → Submit PR for Review
Instructions for PR Review
Reviews are not only "for humans to see later" but also recommended by this book to have Claude review it.
- Specify the PR number
- Instruct to write review content as a comment on the pull request
Using Claude Code GitHub Action, you can automatically review in the PR comments section.
5. Parallel Tasks (Git Worktree)
A parallelization technique when wanting to increase throughput.
- Create subfolders using Git Worktree, set up separate branches, and submit PRs
- Also instruct on naming rules for subfolders — After merging, delete the worktrees (but keep the branches) — Because it consumes resources and makes understanding difficult
- Up to 2 parallel tasks — Only 1 branch can be integrated with IDE — Also put Linters and Husky into subdirectories
It was a realistic check that this book pointed out: "There is a practical limit where doing too much in parallel causes humans to break down."
6. Sub-agents
Sub-agents are "specialists in specific domains."
Agents do not share context with each other — Adopting a consulting / contract work approach →
- It is proper to write design documents thoroughly and assign implementation to sub-agents — When assigning tasks, for the sake of context saving
- Tag Issues beforehand
The book organized that "the design of context passed to sub-agents" is exactly the same as "the design of outsourced work", which was very convincing.
7. Useful Features
Custom Slash Commands
- If you put together instructions,
- They become reusable — It is also convenient to summarize workflows for tasks against Issues or splitting work into Worktrees into slash commands.
Hooks
Set up contents that should be executed after certain operations. Commands can be defined as .sh files.
- Launch Linters / Formatters
- Keep logs
- Notify after task completion
- Load instructions you must not forget
The consistent argument of this book was: "Write rules you want to enforce 100% into Hooks".
Skills
Something like an execution procedure manual for specific tasks (e.g., Excel operations, how to write tests, etc.).
- At places that can be used,
- Automatically use them — Slash commands are "workflows", Skills are "how-to", with a clear distinction.
8. Tools & Others
Surrounding tool groups mentioned in the book:
| Tool | Purpose |
|---|---|
| Makefile | Aggregate commands for build, package installation, etc. |
| Playwright | Screen testing. Automatically fixes itself by looking at the screen. |
| Claude Code GitHub Action | Enables development on mobile devices. Since it cannot converse, it is suitable for small tasks that can be started independently. |
| Figma MCP Server | Combined with Storybook to incorporate Figma designs and catalogize them. Confirmation and correction via Playwright are also possible. |
| Security-review Command | Check for security vulnerabilities. There is also an official GitHub Action. |
| Multi-agent Operation | Combine with terminal splitting services. |
Summary
If I translate the standard flow of AI-driven development from this book into my own words:
- Spec-driven: Document "OK criteria" before writing —
- Guardrails before implementation: Linters / Tests / Husky / CI / Type generation —
- Externalize Context: Intentionally use
compact/clear - Tasks are GitHub Issue units: Create with
gh, implement via Branch + PR — - Parallel up to 2: Utilize Worktrees, but don't overdo it —
- Sub-agents are outsourcing: Assign by passing design documents and letting them handle it
- Repeatable tasks go to Slash Commands / Hooks / Skills —
- Screens/Designs/Security are automated with dedicated tools: Playwright / Figma MCP / Security-review
When viewed as a whole, it becomes clear that everything is connected by the thought: "Before asking Claude to write, mechanically solidify where and how it can be written."
Next Actions
- For existing projects, first check for guardrail gaps (Linters / pre-commit / CI / Type generation) — For new ones, follow the book's flow strictly in order of Spec → Guardrails → Implementation — Slash Commands / Hooks / Skills should be started sequentially as repetitive tasks arise.
Reference: 『Claude Code by AI-driven Development Introduction』 Support Page
AI 자동 생성 콘텐츠
본 콘텐츠는 Zenn AI의 원문을 AI가 자동으로 요약·번역·분석한 것입니다. 원 저작권은 원저작자에게 있으며, 정확한 내용은 반드시 원문을 확인해 주세요.
원문 바로가기