Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
AI, ML & LLMMiddleSpecialistPractical

A coding agent keeps breaking a project rule that is already written in AGENTS.md or CLAUDE.md. How do you make the rule stick?

Answer

Instruction files are context, not enforcement, so first check the rule itself: is it short, specific, near the top of a lean file and not contradicted by other instructions or by the code the agent copies? Then move any rule that must always hold into something deterministic: a lint rule or structural test, a type, a hook that runs after each edit or before the agent may finish, and a required CI check. Write the failure message for the agent, saying what is wrong and how to fix it, and keep the original violation as a regression case.

Strong answer includes

  • treats instruction files as guidance rather than enforcement
  • trims and sharpens the instruction before adding more text
  • moves must-hold rules into linters, tests, types, hooks or CI gates
  • writes check output the agent can act on and keeps the violation as a regression case

Practical example

AGENTS.md says UI code must not import from the database layer, but the agent keeps doing it in new components. The team adds a lint rule whose message reads 'UI may only use the service layer; call CartService.load() instead' and makes it a required check; the next agent run fixes the import on its own after the first lint failure.

#coding-agents#agent-harness#agents-md#hooks#ai-qa

Sources

Top 30 AI-Native Engineer Interview Questions and Answers [2026]Second Talent · Coding-agent workflow questions: instruction files, making project rules stick, verifying an agent's 'all tests pass', reviewing agent diffs and agent permissionsWhat is asked in a Harness Engineer interview?Outcome School · Round-by-round harness-engineer interview: the agent loop, stopping criteria, loop detection, self-correction through tests, evaluating harness changes and designing a team harnessHow Claude remembers your projectAnthropic · CLAUDE.md and AGENTS.md loading; instruction files are context for the agent, not enforced configurationHooks referenceAnthropic · Hook events and exit codes: feedback after a tool call and blocking the agent from stopping until a check passesHarness engineering: leveraging Codex in an agent-first worldOpenAI · Short AGENTS.md as a map, invariants enforced by custom linters and structural tests, lint messages written as fix instructions