Use automated diagnostics

Lesson 15 of 35 · Working with AI coding agents

Tests are one feedback source. Other tools examine different properties and can point to problems before a particular behavior is exercised.

A type checker compares uses of values with declared or inferred types. For example, if a function expects a date and receives a number, a configured checker may report a mismatch. Its reach depends on the language, annotations, settings, and code included in the check. A valid type does not establish that a date is the correct date or that a booking rule is correct.

A linter reports patterns its rules flag, such as an unused variable or a suspicious construct. A formatter adjusts presentation such as indentation and spacing according to its configuration. A compiler translates or checks code for languages that use one and may report invalid constructs. These categories can overlap; a project may use only some of them.

Ask the agent to discover the project’s existing checks and configuration instead of assuming a universal command. A formatter may modify files, and broad formatting can obscure the intended diff. Review its changes and run the appropriate check again after edits. A linter warning may be a genuine defect or may need investigation in context; disabling a rule just to make a check green hides evidence rather than resolving it.

Small tools can also be composed: for example, one program produces a text report and another selects matching lines. Consistent names and structured output make such results easier to locate and inspect. Composition is not always the best choice: an unsuitable text filter can discard context or misread structured data, so check each tool’s input, output, and limitations.

A clean type check, formatted files, and passing tests answer different questions. None guarantees security, accessibility, correctness for untested cases, or a successful deployment. Report which tools ran and their actual results rather than treating a tidy file as proof of correct behavior.