Skip to content

Lesson 36 of 40AI at work

AI on a Real Team

Use AI tools at work the professional way: follow policy, own your code, write reviewable PRs, share team setup and keep your skills sharp.

15 min read0/4 questions

You have the tools, the quality loops and the production skills. The last unit is about using them in a job. Using AI alone on a side project and using it on a team at work are different jobs. At work there are rules about which tools you may use and what data you may paste into them. Your code is read, reviewed and maintained by other people. A mistake can reach real customers. And your teammates will judge you on whether you can explain what you shipped, not on how fast it appeared. This lesson covers the habits that make AI a strength on a team instead of a liability: following policy, owning every line, writing pull requests people can review, sharing one setup across the team, and checking whether the tools are actually helping.

Start with the policy

Most companies now have an AI usage policy: written rules about which AI tools are allowed and how. Read it in your first week, and ask your manager if there is none. It usually answers four questions:

  • Approved tools. Which assistants and plans you may use. A company plan usually comes with a contract that covers how your code and prompts are stored and used. A personal account usually does not, so check the terms rather than assuming.
  • What data may be shared. Source code is often allowed in approved tools. Customer personal data, secrets, credentials, health or payment data and unreleased financials usually are not, in any tool.
  • Licences and ownership. Rules about AI-generated code and open-source licences, for example whether suggestions that match public code must be blocked or reviewed.
  • Disclosure. Whether you must say when a change was AI-assisted.

The practical rule: if you would not paste it into a public forum, check the policy before you paste it into an AI tool. And never assume a tool is approved because a colleague uses it.

Quick checkPick all that apply
You are debugging a production issue and the fastest route is to paste a log into an AI chat. Which details make you stop and check the policy first? Pick all that apply.

None picked yet

Need a nudge? A hint rules out a wrong answer.

You own every line

The most important rule at work: you are responsible for every line you ship, whoever or whatever typed it. "The AI wrote that" is not an answer in a code review or an incident review. If you open the pull request, you are saying "I understand this change and I believe it is correct."

In practice that means:

  • You have read the whole diff, not just the summary the tool gave you.
  • You can explain why each part is there. If a reviewer asks "why is this retry here?", "I am not sure, the AI added it" is a red flag.
  • You have run it. Tests pass, and you checked the behaviour yourself where tests do not reach.
  • You removed what you do not need: unused helpers, debug output, speculative options.

The trust but verify lesson covers how to read AI-written code critically. At work, the bar is simple: if you could not have written it, you must at least be able to defend it.

Pull requests for AI-assisted work

AI makes it easy to produce a 2,000-line pull request in an afternoon. Nobody can review that well, so nobody does, and bugs slip through. Good AI-assisted PRs look like good human PRs, only more disciplined:

PR description template
## What and why
Adds coupon validation to checkout so expired codes show an error
instead of silently applying 0%. Fixes #312.
 
## How
- New `validateCoupon` in src/cart/coupons.ts (reuses existing `parseDate`)
- Checkout form shows the error message from the API
- No schema changes
 
## Testing
- Unit tests for expired, unknown and valid codes (fail without this change)
- Manually checked the form in the browser
 
## Notes
Drafted with Claude Code from a written plan; I reviewed every line
and rewrote the error handling.

Keep each PR to one purpose and a size a teammate can review in one sitting. Explain the why, not just the what. Show how you tested it. And if your team expects it, say briefly how the change was produced. That note is not a confession; it helps the reviewer know where to look harder, such as generated tests that may not assert much.

An AI-assisted change, start to merge
YouAI toolCITeammateplan for issue #312diff + testspush small PRlint, types, tests greenrequest reviewquestions, approve

Start in plan mode and agree a small plan before any code is written.

1/6

Reviewing teammates' AI-generated PRs

When you review, assume nothing about how the code was written and review the code itself. AI-written changes do have typical weaknesses, so look for them on purpose:

  • Duplicated helpers: a new formatDate when the codebase already has one.
  • Invented APIs: calls to library functions or options that do not exist in the version the project uses.
  • Hollow tests: tests that pass but assert almost nothing, or that mirror the implementation line by line.
  • Unasked-for scope: refactors, new config options or dependencies the task did not need.
  • Swallowed errors: broad try/except blocks that hide failures.

Review the author, not just the diff: ask them to explain a tricky part. That is fair for any PR, and it is the best check that the person owns the change. Tools like Copilot code review on GitHub or /review in Claude Code can give a useful first pass, but on GitHub a Copilot review does not count as a required approval, and it should not replace your own reading.

Match the pairs0/4 matched

Match each review finding to what it most likely means.

Choose an item, then its match on the other side.

One shared setup for the team

If every developer configures their AI tools differently, you get different conventions in every PR. The fix is to commit the setup to the repo, so everyone and every tool reads the same rules.

A repo with a shared AI setup
  • my-app/
  • CLAUDE.mdcommands, conventions, gotchas
  • AGENTS.mdsame rules for other tools
  • .mcp.jsonshared MCP servers
  • .claude/
  • settings.jsonpermissions and hooks, committed
  • settings.local.jsonpersonal, gitignored
  • agents/
  • code-reviewer.mdshared reviewer subagent
  • skills/
  • write-playwright-test/
  • SKILL.mda team skill
  • .github/
  • copilot-instructions.mdCopilot's repo instructions
  • .vscode/
  • mcp.jsonMCP servers for VS Code

What each part does for the team:

  • CLAUDE.md or AGENTS.md holds the project bible: how to run, test and lint, naming and folder conventions, things that trip people up. Copilot in VS Code reads AGENTS.md and CLAUDE.md too, along with .github/copilot-instructions.md. The context engineering lesson covers what to put in them.
  • .claude/settings.json holds shared permission rules and hooks. For example, allow Bash(npm run test *) for everyone, ask before Bash(git push *), and deny Read(./.env). A hook that formats files after every edit means AI-written code matches the house style automatically.
  • Shared subagents and skills encode team knowledge: how we review, how we write a Playwright test, how we name migrations. A plugin can bundle them for install across many repos.
  • .mcp.json (project scope) shares MCP servers such as the issue tracker, so everyone's agent has the same tools.

Personal preferences go in the personal files (CLAUDE.local.md, .claude/settings.local.json), which are gitignored. Treat changes to the shared files like code: open a PR, explain why.

Pairing with AI without blocking your team

AI tools can make one developer move very fast while everyone else waits on their reviews. A few habits keep you a good teammate:

  • Agree the plan before the code. For anything non-trivial, share the plan in the issue or a quick message. A teammate catching a wrong direction early saves you a rewrite and them a painful review.
  • Keep the review queue short. Five small PRs a day is a burden if each needs a careful review. Batch related small changes into one coherent PR, or pace them.
  • Do not rewrite shared code unasked. Agents happily refactor files other people are working on. Stay inside your task to avoid merge conflicts.
  • Share what works. A prompt, skill or hook that saved you an hour belongs in the shared setup, not only in your head.

Keep your own skills sharp

Here is the trap, and it catches juniors and seniors alike: you ship code you cannot explain. It works, the PR merges, and you learn nothing. After six months you are faster at prompting and no better at programming, and the first time the AI is wrong in a subtle way you cannot tell.

Guard against it on purpose:

  • Explain it back. Before you open a PR, explain the change in your own words, out loud or in the description. If you cannot, slow down.
  • Do some work by hand. Pick one small task a week and do it without AI, or write the first attempt yourself and then ask the AI to review it.
  • Debug before you delegate. When something breaks, spend ten minutes forming your own theory before asking. Then compare.
  • Ask for the why. "Why this approach and not X?" turns a code dump into a lesson. The learning with AI lesson has prompts for this.
Quick check
A teammate asks why your merged PR retries the payment call three times. You are not sure; the agent added it. What is the best response?
Need a nudge? A hint rules out a wrong answer.

Measure whether AI actually helps

It feels faster. Is it? Feelings are a poor measure: people are often bad judges of how much time a tool really saves them. Pick a few numbers your team already has and compare periods honestly:

  • Cycle time: from opening a PR to merging it.
  • Rework rate: the share of merged changes that needed a revert or a follow-up fix.
  • Review load: how many review comments and rounds each PR needs.
  • Escaped bugs: issues found after release.

This toy compares four weeks before and after a team adopted AI tools. Run it and read both lines before deciding anything.

Python
from statistics import median # Four weeks of merged PRs per period: (hours from open to merge, reverted or hotfixed later?)before = [(20, False), (31, False), (12, False), (44, True), (18, False), (26, False), (15, False), (38, False)]after = [(9, False), (14, True), (6, False), (22, False), (11, True), (8, False), (30, False), (7, False), (13, True), (10, False), (16, False), (5, False)] def report(name, prs): hours = [h for h, _ in prs] rework = sum(1 for _, bad in prs if bad) / len(prs) print(f"{name}: {len(prs):2} PRs, median {median(hours):4.1f} h to merge, {rework:.0%} needed rework") report("before AI", before)report("with AI ", after)
Output
Press Run (⌘ Enter) to see what happens.

More PRs and faster merges look great until you read the rework column: the share of changes that needed fixing later doubled. Some of the "speed" is being paid back as bugs. That does not mean the tools failed. It means the team should tighten review and tests, then measure again. A small sample like this one is noisy too, so look at trends over months, not one comparison.

Predict the outputPython

What does this print?

prs = [True, False, False, True]
print(f"{sum(prs) / len(prs):.0%}")
Need a nudge? Hints walk you through it.
Key terms
AI usage policy
A company's rules on which AI tools are approved, what data may be shared, and how AI-assisted work is handled.
ownership
The principle that you are responsible for every line you ship, whether you or an AI typed it.
shared setup
Committed AI configuration such as CLAUDE.md, settings, hooks, subagents, skills and MCP config used by the whole team.
cycle time
How long a change takes from opening a pull request to merging it.
rework rate
The share of merged changes that later needed a revert or a follow-up fix.
hollow test
A test that passes but checks too little to catch a real bug.