Menguasai Claude Code untuk Software Engineering: Tutorial Lengkap dari Nol sampai Otomasi
Oleh Eko Hadi Murwanto · ·
"Artificial intelligence is the new electricity. It will transform every industry and create massive new opportunities."
bash # 1. Cek Node.js version node --version # harus 18 atau lebih baru # 2. Install Claude Code CLI npm install -g @anthropic-ai/claude-code # 3. Login ke Claude account claude # akan diminta login via browser # 4. Cek Git git --version # 5. Install code editor (Cursor recommended) # Download dari cursor.com # 6. Pre-install codebase-memory MCP (recommended, lebih cepat) git clone https://github.com/deusdata/codebase-memory-mcp.git cd codebase-memory-mcp npm install # Register ke Claude Code claude mcp add codebase-memory --command "node $(pwd)/server.js" # Verifikasi claude # ketik /mcp — kamu harus lihat codebase-memory di daftar Kenapa pre-install? Karena saat workshop kamu gak mau spend 20 menit buat install di tengah lab. Pre-installed = 5 menit verifikasi aja. ### Glossarium cepat Sebelum lanjut, eight istilah yang akan sering muncul: | Istilah | Arti | |---------|------| | Prompt | Instruksi yang kamu kirim ke model | | Context | Informasi sekitar yang membentuk jawaban | | Context window | Total informasi yang bisa dibaca model sekaligus | | MCP | Model Context Protocol — bridge AI ke sistem eksternal | | Skill | Workflow yang di-encode jadi file, bisa di-invoke ulang | | Agent | Instance Claude autonomous yang jalanin multi-step task | | CLAUDE.md | File markdown di root repo yang kasih tahu Claude tentang project | | Token | Unit yang dibaca model — kurang lebih 0.75 kata Inggris | --- ## 3. Context Engineering ### Prompt itu cuma 10%. Konteks adalah 90%. Ini konsep paling penting di seluruh workshop. Lihat beda dua prompt ini: Prompt A — bare (tanpa konteks): Write me a function to validate email. Yang Claude nggak tau: - Bahasa apa? Framework apa? - Naming style? Module system? - Throw error, atau return object? - Edge case apa yang penting? - Taruh di mana? Prompt B — context-rich: Project: BookShelf (Node.js + Express). CommonJS, bukan ES modules. Existing validators live di utils/helpers.js sebagai named exports. Style: addDays, format_date, calc_fine — follow that pattern. Error handling: return { ok: false, error: "..." }. Do NOT throw. Accept: standard RFC 5322-ish. Reject: empty, no @, no dot, spaces, > 254 chars. Called from auth.js during register and login. No new dependencies — pure JS only. Task: Add validate_email(email) to utils/helpers.js. Update exports. Show me the diff only. Include 5 inline test calls at the bottom. Prompt B hasilnya beda jauh. Prompt B langsung masuk, bener style-nya, langsung bisa dipake. ### Empat layer konteks Konteks itu berlapis. Semakin ke bawah, semakin permanen: ┌─────────────────────────┐ │ Per-prompt context │ ← Apa yang kamu ketik sekarang. Sekali pake, buang. ├─────────────────────────┤ │ CLAUDE.md / repo memory │ ← Konvensi project, stack, keputusan. Permanent. ├─────────────────────────┤ │ Skills │ ← Workflow yang bisa diulang. Bisa di-share antar project. ├─────────────────────────┤ │ MCP servers │ ← Live data + tools. Bridge ke sistem asli. └─────────────────────────┘ Semakin bawah, semakin permanen. Yang bawah sekali set, langsung kepake setiap kali tanpa kamu ulang. ### CLAUDE.md template Drop file ini di root repo. Claude Code baca otomatis setiap kali kamu masuk ke project itu: markdown # Project: <nama project> ## Stack - Language: <e.g. Node.js 18, TypeScript 5> - Framework: <e.g. Express, Next.js 14> - Database: <e.g. PostgreSQL, SQLite> ## Conventions - Module system: <CommonJS | ESM> - Error handling: <throw | return { ok, error }> - Naming: <camelCase | snake_case> - Tests: <jest | vitest | none> ## Where things live - Routes: <path/to/routes> - Business logic: <path/to/...> - Helpers: <path/to/...> ## Don't do - <e.g. don't introduce new npm dependencies without asking> - <e.g. don't break the existing auth flow> Sekilas terasa simple — dan memang begitu. Tapi impact-nya besar. Sekali tulis CLAUDE.md, setiap prompt yang kamu kasih setelahnya langsung lebih baik tanpa kamu harus ulang-ulang konteks yang sama. --- ## 4. codebase-memory MCP ### Masalah klasik: onboard ke codebase baru Tanpa AI: - README expired 3 tahun - Grep sana-sini - Tanya satu-satunya orang yang tahu - Tunggu seminggu untuk jawaban - Lupa, tanya lagi - Ulang untuk setiap new joiner Dengan codebase-memory MCP: - Index repo sekali - Tanya dalam bahasa natural ke Claude - Dapat jawaban yang grounded di source code sebenarnya - Onboard dalam setengah hari - Memory yang sama serve joiner berikutnya - README jadi living document ### Apa itu MCP? MCP = Model Context Protocol. Standar terbuka untuk nyambungin AI assistant ke sistem tempat data kamu berada. Claude (the reasoning) ↓ MCP server (the bridge) ↓ Your data (browser, files, database, API, etc.) MCPs adalah cara Claude reaches outside its own brain — ngambil data dari luar, kasih ke context yang sedang diproses. ### Apa yang codebase-memory MCP track - Functions & their callers - Modules & their dependencies - Routes, endpoints, schemas - Configuration entry points - Cross-file references Contoh pertanyaan yang bisa kamu jawab setelah indexing: - “How does auth work here?” - “Where is the loan flow handled?” - “What touches the books table?” - “Show me callers of calc_fine.” - “Where do we validate input?” ### Install bash # 1. Clone git clone https://github.com/deusdata/codebase-memory-mcp.git cd codebase-memory-mcp npm install # 2. Register ke Claude Code claude mcp add codebase-memory --command "node $(pwd)/server.js" # 3. Verifikasi claude # ketik /mcp — harus muncul codebase-memory ### Cara pakai bash # Masuk ke project yang mau di-index cd /path/ke/project-kamu # Jalankan Claude Code claude # Di prompt, ketik: /codebase-memory index # Tunggu scan selesai. Lalu tanya: > Explain how the loan flow works in this repo. > Where is the bug in BUG-002? > Show me all files that touch the users table. ### Kapan re-index Re-run /codebase-memory index ketika: - Ada refactor signifikan - Pindah branch - Ada kontributor baru yang land big changes --- ## 5. Daily SDLC Workflow ### Empat peran, satu loop Software development sehari-hari sebenarnya empat peran yang terus berputar: | Peran | Output | Pain Point | |-------|--------|------------| | Software Analyst | Specs, AC, edge cases | Specs jadi stale pas build | | Backend Dev | API, data, business logic | Re-asks analyst, block frontend | | Frontend Dev | UI, state, integration | Wait on backend; types out specs by hand | | QA | Test, regression, sign-off | Discovers context gaps last | Hidden cost: Setiap handoff kehilangan informasi. Setiap loop menambah rework. Senior engineers lebih banyak waktu re-explaining daripada building. ### Analisis alurmu sendiri Sekarang, pikirin satu task yang kamu ulang berkali-kali. Jawab ini: 1. Apa trigger-nya? (ticket, email, chat message?) 2. Siapa yang kerja duluan? (analyst? kamu?) 3. Apa output yang diharapkan? (spec, code, test?) 4. Dimana bottleneck-nya? (tunggu balikan? konteks hilang?) 5. Dimana kamu sering ulang kerja karena someone lupa? Jawaban-jawaban ini jadi bahan untuk bikin Skill — yang bakal kita bahas sekarang. --- ## 6. Membuat Skill ### Apa itu Skill? Skill = workflow yang di-encode jadi file markdown dengan YAML front matter. Claude Code baca, tahu kapan harus pake, follow steps-nya. Kenapa beda sama prompt biasa? - Prompt manual: Hidup di kepala, diulang setiap kali, hilang kalau kamu pergi, gak konsisten antar tim, gak auditable. - Skill: Hidup di file, invoke dengan satu kata, stay kalau kamu pergi, sama untuk seluruh tim, versioned di git. ### Anatomy SKILL.md yaml --- name: bug-fixer description: | Use when fixing a bug ticket. Investigates code, proposes fix, writes test, opens PR. triggers: ["fix bug", "BUG-", "resolve ticket"] --- # Steps 1. Read the ticket + acceptance criteria. 2. Use codebase-memory to find related code. 3. Propose a minimal patch. WAIT for human approval. 4. Apply patch + add a regression test. 5. Run tests. Iterate until green. 6. Open a PR with a summary of what changed and why. # Constraints - Never modify auth.js without explicit approval. - Never bump dependencies as part of a bug fix. # Examples ## Good run Ticket: BUG-002. Investigated routes/loans.js, found the decrement was commented out. Re-enabled inside a transaction. Added a test that asserts available_copies goes to 0 after the last loan and the next borrow is rejected. ### Checklist anatomy skill yang bagus - [ ] Name — pendek, deskriptif, kebab-case (bug-fixer, api-builder) - [ ] Description — apa yang dilakukan + kapan harus pake. 2 baris pertama paling penting - [ ] Triggers — frase yang bikin skill aktif otomatis - [ ] Steps — numbered, atomic, berurutan. 5–10 step adalah sweet spot - [ ] Constraints — apa yang TIDAK boleh dilakukan. Explicit lebih baik dari clever - [ ] Examples — minimal 1 contoh good run, sebaiknya ada juga bad-run-corrected ### Where to put skills | Scope | Path | |-------|------| | Project-scoped | ./.claude/skills/<skill-name>/SKILL.md | | User-scoped | ~/.claude/skills/<skill-name>/SKILL.md | | Team-shared | Check .claude/ directory into git | ### Latihan: convert workflow jadi skill 1. Pick — pilih satu task yang kamu ulang weekly 2. Write down — steps yang kamu ambil (5–10) 3. Fill — SKILL.md template 4. Drop — taruh di .claude/skills/your-skill/ 5. Test — invoke dengan trigger phrase, lihat apakah flow-nya bener Contoh task yang cocok dijadikan skill pertama: - “Fix bug dari ticket” — umum, sering, impact langsung keliatan - “Review PR dan kasih feedback” — consistency penting - “Scaffold endpoint baru” — repetitive, banyak boilerplate - “Write release notes” — mudah terlewat, perfect buat automation --- ## 7. agent-dev-team ### Concept agent-dev-team adalah skill yang menjalankan empat peran — Analyst → Backend → Frontend → QA — secara berurutan pada satu ticket. Skill ini created by workshop trainer, tapi bisa kamu ambil, fork, replace peran mana aja dengan konvensi timmu sendiri. Source: uscloud3.dxn2u.net:3000/cipta/agent-dev-team ### Empat stage Stage 1 — Analyst Maper jelasin acceptance criteria, list asumsi, flag edge cases. Stage 2 — Backend Baca codebase-memory, propose changes, minta approval sebelum write. Stage 3 — Frontend Integrate dengan contract dari backend. Skip kalau change-nya backend-only. Stage 4 — QA Tulis tests, jalanin, report pass/fail dengan reproductions. ### ROI nyata | | Before | After | |—|--------|-------| | Per ticket | 2–3 jam | 3–5 menit | | Context switching | Between roles, re-reading specs, copy-paste fatigue | Satu invoke, semua peran, human review di final output | --- ## 8. Otomasi dari Inbox sampai PR ### Pattern: email-triggered agent run Inilah yang terjadi di edge-of-workshop demo — email masuk → agent jalan → reply terkirim → PR terbuka: Inbox ├── Customer feedback email ├── ↓ ├── Cowork watch (polls inbox, triggers) ├── ↓ ├── Claude Code runs agent-dev-team ├── ↓ └── Reply + commit ├── Auto reply dengan summary └── PR terbuka di branch, bukan main Yang dibuka: Feedback gak pernah nunggu di inbox. Ticket bergerak waktu kamu tidur. Human stay di loop buat review — bukan buat grunt work. ### Guardrails — non-negotiable Sebelum kamu implement automation, five guardrails ini WAJIB ada: | Guardrail | Why | |-----------|-----| | Human-in-the-loop review | Auto-commit ke branch, bukan main. PR butuh human merge. | | Audit trail | Every action logged. Every reply traceable ke source email. | | Cost caps | Daily budget per agent. Hard stop on runaway loops. | | Sandboxed write access | Agents work di dedicated repos/branches/containers. | | Kill switch | Satu command untuk disable semua automation. | ### Automation variants yang lebih kecil Gak harus langsung full email-to-PR. Mulai dari yang kecil: 1. Daily 6am report: “What changed in our repo yesterday?” → posted to Slack 2. PR triage bot: saat PR terbuka, run skill yang adds review comments 3. Weekly digest: scan support tickets, group by root cause, draft summary email --- ## 9. Troubleshooting ### Claude Code CLI masalah Problem: claude: command not found Fix: bash npm install -g @anthropic-ai/claude-code # Kalau masih gak works: npm list -g @anthropic-ai/claude-code # Verify installation: claude --version Problem: Login gagal atau token expired Fix: bash claude auth logout claude # akan minta login ulang via browser ### codebase-memory MCP masalah Problem: MCP gak muncul di /mcp Fix: bash # Verifikasi path claude mcp add codebase-memory --command "node /path/to/codebase-memory-mcp/server.js" # Verifikasi server.js executable cd /path/to/codebase-memory-mcp node server.js # harus jalan tanpa error Problem: Index stuck atau timeout Fix: - Repo terlalu besar — coba perkecil scope dengan .codebaseignore - Re-run dari awal: /codebase-memory reset lalu /codebase-memory index ### Skill gak ter-trigger Problem: Skill gak aktif pas dipanggil Fix: - Cek trigger phrases di front matter — apakah exact match atau proximity? - Skill paling spesifik akan lebih diutamakan (higher priority wins) - Verifikasi skill file ada di path yang benar: ~/.claude/skills/ atau ./.claude/skills/ --- ## 10. Penutup ### Rangkuman Kita sudah bahas: 1. Reality check — AI restrukturisasi who keeps a seat. AI fluency bukan pilihan, sudah jadi kebutuhan. 2. Context engineering — Prompts cuma 10%. Konteks adalah 90%. Layer your context dari per-prompt sampai MCP. 3. codebase-memory MCP — Onboard legacy app dalam menit, bukan minggu. Tanya codebase dalam bahasa natural. 4. Daily SDLC workflow — Nama role, find friction. AI bantu ngurangin context-switching cost. 5. Workflow → Skill — Encode once, reuse forever. Skill stays when you leave. 6. agent-dev-team — Empat peran dalam satu skill. 2–3 jam per ticket jadi 3–5 menit. 7. End-to-end automation — Email-triggered agents yang works while you sleep, dengan human-in-the-loop guardrails. ### Roadmap minggu pertama | Waktu | Aksi | |-------|------| | Hari ini | Install Claude Code di work machine | | Day 1 | Index SATU codebase dengan codebase-memory MCP | | Day 2 | Tulis CLAUDE.md untuk repo itu. Commit. | | Week 1 | Convert SATU recurring task jadi skill | | Week 2 | Share skill itu ke satu teammate | | Month 1 | Hook SATU automation trigger ke inbox atau chat | --- ### Download Materials | File | Ukuran | |------|--------| | 📊 Trainer Deck — 33 slides | 360 KB | | 📖 Participant Handbook — 15 pages | 212 KB | | ✏️ Lab Exercises | 149 KB | | 🐛 Bug Tickets | 106 KB | | 🗺️ The Claude Code Blueprint — visual guide | 16 MB | | 🏚️ Sample Legacy App | 94 KB | --- ### Referensi | Resource | URL | |----------|-----| | Claude Code home | https://claude.com/claude-code | | Claude Code docs | https://docs.claude.com/en/docs/claude-code/overview | | Claude Code skills | https://docs.claude.com/en/docs/claude-code/skills | | MCP overview | https://modelcontextprotocol.io | | Prompt engineering guide | https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/overview | | codebase-memory MCP | https://deusdata.github.io/codebase-memory-mcp/ | | agent-dev-team (Cipta) | https://uscloud3.dxn2u.net:3000/cipta/agent-dev-team | Source: AI Workshop “Maximizing Claude Code for Software Engineering”. Materials mencakup Trainer Deck (33 slides), Participant Handbook (15 pages), dan Claude Code Blueprint (14 pages visual guide).