Unit 12 / 12

AI Coding Tools and Workflow Integration

Gains:

  • Ability to map editor completion, chat assistant, CLI agent and CI automation categories to tasks
  • Ability to adjust autonomy level according to risk and apply 'plan first' discipline to CLI agents
  • Ability to transform the use of AI into a team system based on a validated tool, verification gate, transparency and accountability

So far we have learned to use AI in individual tasks (coding, reviewing, testing, debugging). In this final unit, we put the pieces together: getting to know different AI coding tools, matching the right tool to the right job, and embedding them safely into your daily development flow—from editor to version control, from CI/CD pipeline to team governance. The goal is to turn the messy “ask the AI ​​every now and then” habit into a consistent and auditable working system.

We cover vehicle types with neutral categories (specific product names change quickly; it's what the category does that matters). Each category has a “sweet spot” and a risk profile; Mastery is knowing how much autonomy to give to which task.

Categories of AI Coding Tools

1. In-editor completion. Plugins that suggest lines/blocks as you type in your IDE (the development environment where you write code). Sweet spot: in-stream speed, boilerplate code. Risk: narrow context, accepting the suggestion without thinking.

2. Chat/side panel assistant. Chat interface embedded in the IDE with visibility into part of your codebase. Sweet spot: description, refactor, testing, bug analysis. Risk: limited to the context you give, requires verification.

3. CLI agents (agent tools). Tools that run from the command line, can read and modify multiple files, run commands, and execute multi-step tasks on their own. Sweet spot: multi-file changes, repetitive tasks, "add this property" type jobs. Risk: high autonomy = high impact; If left unchecked, it produces broad and difficult-to-verify changes.

4. Line/automation integration. CI (Continuous Integration) bots that leave automatic review comments on PRs, suggest tests, or produce changelogs. Sweet spot: first strainer without fatigue, consistency. Risk: noise, false confidence.

Hint: As autonomy increases, control should also increase. Because editor completion is small and instantaneous, it is lightly supervised; A CLI agent's multi-file modification should be examined just as, if not more carefully, than a human PR.

Step by Step: Embedding AI into Workflow

  1. Map the task to the tool. Small in-stream addition → completion; understand/refactor/test → chat; multi-file, repetitive work → CLI agent; continuous first filter → CI integration.
  2. Choose the level of autonomy. How much freedom does the agent have? Read-only suggestion or file modification + command execution? Adjust for risk.
  3. Nurture the context. Permanently introduce project rules (style, architecture, "don'ts") into the tool; Use a project instruction file instead of explaining it over and over again.
  4. Maintain verification gates. AI change is like human change: it goes through compilation, testing, review, and (if critical) expert approval. AI opening PR does not bypass approval.
  5. Measure and adjust. Watch what really accelerates, where the correction burden increases; Prune out uses that don't work.

Three Mini Cases

Case 1 — CLI agent handled multifile renaming. One team would rename a concept spread across 60 files. They gave the task to a CLI agent, first asked for a plan, approved the plan, then made the change and ran the entire test suite. Agent 3 missed an edge case in file; Tests caught it, fixed it. The job, which took approximately 3 hours manually, was completed in 50 minutes with supervision.

Case 2 — Unchecked autonomy backfired. Another developer told an agent to "improve this module" and released it; The agent modified 18 files and added two dependencies. The change was so broad that it could not be reviewed and had to be withdrawn. Lesson: give agents narrow scope, clear acceptance criteria, and first-plan-later-do discipline.

Case 3 — CI review bot became the first filter. One team built a bot that leaves automated AI review comments on PRs. Once the bot caught null check omissions and style issues, human reviewers were able to devote their time to business logic. However, the team made it clear that the bot did not provide “approval”: at least one human approval was still required. To reduce noise, they tuned the boat to leave only high/medium intensity noise.

Four Copiable Templates

"Plan first" discipline for CLI agent:

Task: {{clear, narrow task}}Acceptance criteria: {{measurable result}}Constraint: work only on {{the following directory/files}}; adding new dependency.First present a plan WITHOUT CHANGE: which files, what will change, which tests to run. Wait for me to APPROVE the plan. Then apply it step by step, running tests at each step.

Project instruction file (persistent context to tools):

Persistent rules for AI tools in this project:- Language/version: {{...}}. Style: {{...}}.- Architectural constraint: {{e.g. direction between layers}}.- NEVER: embedding secrets, using production data, {{forbidden libraries}}.- Every change must be testable; Changing the public API signature WITHOUT asking. - When in doubt, stop and ask.

Task-tool mapping decision:

I define the following task: {{task}}. What class of tools should I do this with: (a) editor completion, (b) chat assistant,(c) CLI agent, (d) CI automation? Write your rationale, risk and recommended level of autonomy (mere suggestion / change file / run command).

CI review bot code of conduct:

Leave only HIGH and MEDIUM severity findings as comments in the PR review. Each finding: category, severity, suggested correction. Collect notes at the style preference level into a separate, single summary comment. You DO NOT CONSENT; human approval required.

Weak prompt / Strong prompt

Weak: (to CLI agent) "Make the payment module better."
Strong: (To CLI agent) "Only run under src/payments/. Task: Extract the recursive validation logic from the refund() function into a single helper; behavior and signatures do not change. First present the plan and wait for my approval; then execute and run the tests/payments/ package. Add new dependency."

The strong version narrows the scope, sets acceptance criteria and constraints, and imposes the "plan first" discipline. Vague “do better” demands are the root cause of vast and uncontrollable changes.

vehicle class

What he's best at

autonomy

inspection weight

Editor completion

Small in-stream addition

low

Light (instant reading)

chat assistant

Understand, test, refactor

medium

Medium (output verification)

CLI agent

Multi-file, recursive

high

Heavy (plan + full review)

CI automation

Continuous first filter

medium

Medium (rule + human approval)

Team Governance: From Individual Skill to Shared System

Using AI well on an individual basis is a start; real maturity is a consistent system at the team level. This system is based on several pillars: list of approved tools (which tools can be used with what data — from unit 10), verification gates (AI change goes through the same build/test/review gates — from unit 11), transparency (stating that a change is AI-powered provides traceability where necessary), and clarity of responsibility (the person who signs off and is accountable is clear). This framework limits risk while maintaining speed and ensures that new team members work with the same discipline.

Caution: The higher the autonomy of a tool—especially CLI agents that can modify files, run commands—the more tightly limit it from accessing the production environment, confidential data, and hard-to-revert operations. Tie destructive commands (permanent deletion, deployment) to human approval.

Common mistakes

  • Task-means incompatibility. Trying to do a multi-file job with editor completion or a small attachment with a heavy agent.
  • Releasing the agent. Agent tasks given with narrow scope and without a “plan first” produce unexamined changes.
  • Loosening the verification gates for AI. "AI did it, let's move on quickly" is the most dangerous exception; The doors are the same for everyone.
  • Giving the context manually every time. Not writing project rules into a permanent instruction file produces inconsistency and duplication.
  • Mistaking the CI bot's approval for human approval. A bot is a filter; Accountable human approval is mandatory.

In summary

AI coding tools fall into four main categories: editor completion, chat assistant, CLI agents, and CI automation. Mastery is matching the task to the right tool and the right level of autonomy; As autonomy increases, control also increases. Give tools persistent project context, impose a “plan first” discipline on multi-file agents, and pass AI change through the same verification gates as human change. Individual skill; Transform it into a team system built on an approved tool list, verification gates, transparency and clarity of responsibility. AI is an end-to-end speed multiplier; The person who signs and gives the account is always a competent person.

Application task

List three real tasks you will do next week. Use the “task-to-vehicle matching decision” template for each to justify which vehicle class and what level of autonomy you will choose. Then run a narrow task for a CLI agent (or chat assistant) with a “plan first” discipline: approve the plan, enforce it, run the tests, and review the change like a human PR. Finally, draft a 5-point “AI usage rule” for your team (approved tools, data rule, verification gate, autonomy limit, accountability).

checklist

  • [ ] I can distinguish between AI coding tool categories and the sweet spot of each.
  • [ ] I map the task to the correct vehicle class and appropriate autonomy level.
  • [ ] I give permanent project context (instruction file) to the tools.
  • [ ] I apply narrow scope and "plan first" discipline to CLI agents.
  • [ ] I pass AI changes through the same verification gates as human changes.
  • [ ] I advocate for a validated tool, data rule, transparency and accountability framework at the team level.

Module Exam

1. What does the underlying large language model of a coding assistant actually do when it produces code?

  • A) Patternually predicts the most likely continuation based on the given context ✔
  • B) Guarantees the correct result by actually compiling and running the code
  • C) It scans the code all over the internet live and copies the most accurate one.
  • D) Understands the logic of the code like a human engineer and understands the intention

Clarification: LLM does not 'understand' code like a human; It generates the most likely continuation to the given context, based on patterns it learns from a very large pool of text and code. Therefore, the quality of the output directly depends on the quality of the context and instruction you give, and each output must be validated.

2. What do you call it when AI convincingly concocts a non-existent function or library, and what is the only real antidote?

  • A) This is called a compilation error; The antidote is stronger equipment
  • B) This is called hallucination; The antidote is to verify the code and each API used ✔
  • C) This is called regression; The antidote is to restart the model
  • D) This is called context overflow; The antidote is to shorten the prompt

Description: This is called hallucination and causes one of the most expensive bugs in software. The only real antidote is verification: confirming that every function, API, and package used actually exists and that the code works. The model's confident tone is not evidence of accuracy.

3. Which approach most improves the quality and consistency of output when generating code with AI?

  • A) Releasing the model by saying 'write this to me' without giving any context
  • B) Writing the longest and fancy prompt possible
  • C) Specify and give examples of input/output contract, edge cases, version and style ✔
  • D) Combining the generated code directly without reading it

Explanation: Determining the function's input/output types (contract), edge cases, language/version and style constraint and giving an example to the model enables the transition from prediction to precision. Contextless 'write me this' requests produce code that is different each time and often bypasses edge cases.

4. When exploring a foreign codebase with AI, a function's name may be 'validateAndSave' but the AI ​​digest may be incorrect. What is the right approach?

  • A) Full confidence in the AI summary as the name is self-explanatory
  • B) Changing the function directly without reading it
  • C) Deciding just by looking at the function name
  • D) Treat the AI description as a hypothesis and verify critical claims line by line in the code ✔

Explanation: AI may look at the name in the code and tell you 'what it looks like it's doing', but in reality the logic may be different (or even reversed). So the AI ​​explanation is a hypothesis; Critical claims, especially those involving security, authority or money flow, should be visually verified on the relevant lines.

5. What is the biggest danger in saying 'AI looked it, it's clear' in AI-assisted code review?

  • A) AI may produce false negatives; Real missed mistakes create false confidence ✔
  • B) AI review is too slow so it wastes time
  • C) The team does not understand because the AI only comments in English
  • D) PR does not converge because AI always over-interprets

Explanation: AI produces both false positives (flagging a problem where it doesn't exist) and false negatives (missing the real bug). False negatives are silent; The most dangerous mistakes are those that are not mentioned in the review at all. So AI is a first filter, not approval; The decision to merge belongs to an accountable person.

6. What is the most insidious trap that occurs when you just give the AI ​​the code and print tests?

  • A) AI always writes too many tests and bloats the codebase
  • B) AI tests the current (maybe wrong) behavior of the code as 'correct' and fixes the bug ✔
  • C) AI automatically deletes code when writing tests
  • D) AI writes tests not only for the happy path but always for the edge case

Explanation: AI tends to look at code and write assertions that test current behavior. If the code is wrong from the start, AI fixes this wrong behavior as 'correct'. Therefore, the expectations of the test should be written according to the required rule (specification), not according to the current output of the code.

7. What most determines the accuracy of hypotheses when debugging a bug with AI?

  • A) How politely the prompt is written.
  • B) How many times the question was asked again
  • C) Quality of evidence provided to the model: full error message, stack trace, input and expected behavior ✔
  • D) What color theme is the code written in?

Explanation: AI does not see the error the way you do; He only knows the evidence you give him. Given the full error message, stack trace, triggering input, and expected behavior, the model enumerates the real possibilities; If there is no evidence, it makes a guess (hallucination) and leads you on the wrong track.

8. What is the most critical step before giving production logs to AI for analysis?

  • A) Pasting the log as is, covering the whole day
  • B) Convert log to uppercase first
  • C) Arranging log lines in alphabetical order
  • D) Masking personal data and secrets and giving only the relevant window ✔

Description: Raw production logs contain IP, email, session ID, token and sometimes open secret. Sticking them into an AI tool without masking them is a serious privacy violation. Additionally, the log should be filtered to a narrow time window; But the first necessity is to clean sensitive data.

9. What should be done if the AI ​​says two events happened 'simultaneously' in log analysis and declares one as the root cause?

  • A) Disregarding correlation as causality and verifying the claim with metrics and code ✔
  • B) Accepting the cause as definitive because AI establishes a time relationship
  • C) Immediately restarting the first accused component
  • D) Deleting the logs completely and collecting them again

Explanation: The most common pitfall in log analysis is confusing correlation with causation. The time relationship established by the AI ​​is a clue, not evidence. True causality requires timing, mechanism, and, if possible, repeatability; The claim must be validated with metrics and code.

10. What is the non-negotiable golden rule when refactoring with AI and what secures it?

  • A) The code should be shorter; The number of lines guarantees this
  • B) No change in behavior; tests that capture current behavior ensure this ✔
  • C) The code contains more comments; AI guarantees this
  • D) Rewriting the entire file at once; the agent guarantees this

Explanation: Refactoring is improving the internal structure of the code without changing its external behavior; The golden rule is that behavior remains constant. What ensures this is testing: a testnet that captures current behavior before changing it is set up and run after each step. Refactoring without a testnet is a gamble.

11. What is the layer in documentation production that AI cannot know and is dangerous to make up?

  • A) How to run the installation steps
  • B) Parameter list of a function
  • C) Justification of 'why' a design decision was made that way ✔
  • D) What language is the code written in?

Description: AI can extract the 'what/how' layer (what does the function do, how is it setup) from the code; but it cannot know the 'why' layer (the design rationale for a decision, the reason for a limit value). A made-up 'reason' is more dangerous than no justification; The code owner must add this layer.

12. What should a developer do if they want to paste a configuration file containing a live API key into a non-approved AI tool while resolving an urgent bug?

  • A) For speed, paste the file as is and then delete the chat
  • B) Add a 'confidential' note at the end of the file and send it
  • C) Leave the key and change only the file name
  • D) Remove/mask secrets and give only necessary non-sensitive context ✔

Disclosure: Secrets, personal data and confidential assets should never be entered into unapproved means; Urgency does not suspend this red line. The correct approach is to extract/mask the secrets first and give only the necessary, non-sensitive context. If a secret still leaks, the first thing to do is to turn that key immediately.

13. An AI-generated code passes testing and runs in production. Does this prove that the code is safe?

  • A) No; 'working' does not mean secure, security requires a separate layer of authentication ✔
  • B) Yes; Code that passes the test is safe by definition
  • C) Yes; Running it in production eliminates all vulnerabilities
  • D) No; but security only matters if the code is slow

Clarification: 'Working' is not the same as 'secure'. Even if the code contains a vulnerability such as SQL injection, it can pass testing and run smoothly; The vulnerability is only revealed when an attacker finds it. Therefore, in addition to accuracy, security-oriented review and scans such as SAST should be performed as a separate layer.

14. What is the safest discipline when giving a multi-file task to a CLI agent (autonomous tool that can modify files and run commands)?

  • A) Telling the agent 'improve this module' and giving full freedom
  • B) Giving narrow scope and acceptance criteria, asking for a plan first, approving it, implementing it step by step, and running the tests ✔
  • C) Directly merge all changes of the agent without reviewing them
  • D) Giving the agent unrestricted access to the production environment and confidential data

Explanation: As autonomy increases, control should also increase. Giving the agent a narrow scope and clear acceptance criteria, first asking for a plan without changes, approving the plan, then having it implemented step by step and running tests at each step; It prevents changes that are broad, unreviewable, and need to be rolled back.

15. Who has liability arising from AI-generated code in security-critical software (e.g. payment or authentication)?

  • A) Since the code comes from AI, it is in the vehicle provider
  • B) If AI is sufficiently developed, no one has; no need to verify
  • C) The team/engineer who examines, assembles and distributes the code; AI does not replace consent ✔
  • D) Only the person who writes the prompt, not those who review it

Description: AI is a speed multiplier and blueprint generator; cannot assume responsibility. The responsibility for any errors, vulnerabilities or violations arising from the code in production lies with the team that reviews, assembles and distributes that code. In safety-critical areas, AI output is not a substitute for review and approval by a qualified engineer under any circumstances.