Skip to content
한국어

AI Guide for Developers

In short
  • For developers, AI is a tool that cuts down repetitive work like understanding code, finding the cause of bugs, writing tests and docs, and review.
  • Tools that work directly with your code include Claude Code and Cursor, while a chat AI is enough for questions and design discussions.
  • Code that AI produces should go in only after you’ve read it, run it, and tested it.
  • Before you start, decide what you will and won’t enter: secret keys, customer data, and internal code.

This guide suits web, app, and server developers, people with side projects, and people who want to introduce AI tools to their team.

  • You need to get up to speed on a codebase you’ve never seen before.
  • You have a lot of repetitive testing, documentation, and review work.
  • You need a standard for how far to trust the code AI gives you.

Asking it to explain the file structure and what each function does shortens onboarding time. For work that involves reading an entire repository, coding tools like Claude Code and Cursor are a good fit (Understand and fix existing code with Cursor).

Copy and paste this prompt

I want to understand the structure of this repository. Explain the role of the main directories, the entry points, and the order in which data flows. Then tell me, in order, which files I should read first to modify [feature name]. Mark anything you’re not sure about as a guess.

Give it the error message and how to reproduce it, and you can get candidate causes ranked by priority. Remove secret keys and personal information before pasting.

Copy and paste this prompt

I’m getting the error below. My environment is [language/framework/version], and the steps to reproduce are [reproduction steps]. Give me 3 possible causes in order of likelihood, and for each one, tell me how to check it, with the command or log location. Don’t fix it right away; let’s confirm the cause first.

[Error message and related code]

You can quickly draft unit tests for existing functions, edge cases, a README, and comments. Also check that the generated tests can actually fail.

Copy and paste this prompt

Write unit tests for the function below using [test framework]. Separate normal cases, boundary values, and invalid-input cases, and add a one-line comment for each test saying what it verifies. Don’t change the implementation.

[Function code]

You can get another check on bugs, error handling, and readability issues that are easy to miss in a PR’s changes. Use it as a first pass rather than a replacement for human review.

Copy and paste this prompt

Review the changes below. Look for problems in this order: potential bugs, missing error handling, security issues, performance issues, readability. Give each item a severity (high/medium/low) and a suggested fix. If there are no problems, say so. Don’t nitpick just to have something to say.

[diff]

5. Automate repetitive work and build agents

Section titled “5. Automate repetitive work and build agents”

Repetitive work like scheduled checks or deployment assistance can be handed off to skills, routines, and CI. The concepts are covered in Delegate recurring tasks to agents, and how to build one yourself with the API is covered in Build a work bot with tool use.

Copy and paste this prompt

I want to automate [task name], which I repeat every week. My current manual process is [process]. Break it into steps that can be automated, and mark the approval points where a person must confirm. Also suggest how to roll back if it fails.

A day adding one feature
  1. MorningHave AI explain the related code and decide the order to read it→ Understand the scope of changes
  2. Late morningGet a plan first, then request implementation in small pieces→ Small changes you can verify
  3. AfternoonWrite tests and run them yourself; if they fail, narrow down the cause→ Passing tests
  4. Before leavingDo a first review of the diff with AI, then draft the PR description→ Ready for human review

This is a simplified flow. See the official help page for the actual screens.

  1. The first 30 minutes: Cover how AI basically works and where its limits are.
  2. Asking good questions: The habit of giving context works just as well for code questions.
  3. Protecting personal and company information: Set standards for how far you’ll enter code and secret keys.
  4. Claude Code overview: Learn the installation and basic concepts.
  5. Getting started with Claude Code: Practice plan mode and the approval flow.
  6. Claude Code core features: Refine how you work with CLAUDE.md, hooks, subagents, and more.
  7. Hand off GitHub work with cloud sessions: Try delegating repository work remotely.
  8. Understand and fix existing code with Cursor: Compare working inside an editor.
  9. Getting started with the Claude API: Get an API key and make your first call to prepare to build things yourself.
  10. Manage output quality with evals: Check the quality of what you’ve built with numbers.

To go deeper, the Developer Deep Dives section has topics like the Agent SDK, MCP servers, and headless mode and CI.

Replace the [square-bracket] parts with your own details, then paste the prompt into your AI chat. Don’t paste personal or confidential information; the basics are in Using AI while protecting personal and company information. Always check the results yourself before you use them.

Explain unfamiliar code

Explain what the code below does, at the level of a developer new to this codebase. Give: purpose in 2 sentences, the main flow step by step, inputs and outputs, side effects, and anything that looks risky or surprising. Language and framework: [language, framework].

[Paste the code, with secrets and customer data removed]

Tip: Put the relevant code in the prompt, as in Debugging with AI.

Narrow down a bug

I have a bug. Expected behavior: [expected]. Actual behavior: [actual]. Steps to reproduce: [steps]. Environment: [versions, OS]. Error message: [paste]. Relevant code: [paste]. List the 3 most likely causes ranked by probability, and for each give a quick check I can run to confirm or rule it out. Do not suggest a fix until I report back.

Tip: The full method is in Debugging with AI.

Explain a stack trace

Here is a stack trace from [language/framework]: [paste]. Explain in plain words where the failure starts, which frames are my code and which are libraries, and what to inspect first. If you are unsure, say what extra information would help.

Tip: Never paste keys or tokens, per Protect personal and company information.

Unit tests with edge cases

Write unit tests for the function below using [test framework]. Cover the normal case, boundaries, empty or null input, and invalid input. Name each test so it reads as a sentence. Before writing, list the edge cases you plan to cover so I can add or remove some.

[Paste the function]

Tip: Review generated tests carefully; see Reviewing agent work.

README for a module

Write a README for the module below. Sections: what it does, install, quick start with a minimal example, configuration options in a table, and common errors. Use only what the code shows; mark anything you had to guess with TODO.

[Paste the code or file list]

Tip: More patterns are in Write docs with AI.

SQL query with explanation

Write a [PostgreSQL / MySQL] query for this: [goal in plain words]. Tables: [table names with columns and types]. Explain each clause, mention performance concerns such as missing indexes, and give a small sample result so I can check the logic. Do not modify data.

Tip: See SQL with AI, and test on a copy first.

Pull request review

Review this diff as a careful senior engineer. Check correctness, error handling, security issues, naming, and test coverage. Group comments as must fix, should fix, and nitpick. For each, point to the line and explain the risk briefly. Context for the change: [what the PR is for].

[Paste the diff]

Tip: See Code review with AI, and keep human review as the final gate.

Refactor in small steps

I want to refactor the code below to [goal, e.g., remove duplication, separate I/O from logic]. Propose a plan of small steps where each step keeps all existing tests passing. Do not change behavior. Show the first step only, then wait.

[Paste the code]

Tip: Work step by step as in Refactoring with AI.

Commit message and PR description

Write a commit message and a pull request description for the diff below. Commit: imperative subject under 50 characters, body explaining why. PR: summary, what changed, how to test, and risks. Do not claim anything the diff does not show.

[Paste the diff]

Tip: Git workflows with an AI agent are in Git with Claude Code.

  • Verification: AI can confidently write functions that don’t exist or outdated usage. Confirm by running and testing (how to fact-check).
  • Permissions: For tools that run and modify code directly, keep approval units small, and have a person confirm hard-to-undo actions like deletion, deployment, and payments (Using agents safely).
  • Licensing: Generated code can resemble existing open-source code. Review it according to your organization’s licensing policy.
  • Understand it before you merge it: Don’t merge code you don’t understand. The person who has to fix it later is ultimately you.