The Deska blog
Writing Acceptance Criteria an Agent Can Verify
Learn to write acceptance criteria an agent can verify to improve AI coding results. Master structured specs for Claude Code and OpenCode in Deska.
· 10 min read
Writing acceptance criteria an agent can verify is the most critical skill for developers moving from manual coding to agentic workflows. When we write requirements for human colleagues, we often rely on shared context and intuition. Humans can infer that a button should probably be blue if the rest of the app is blue. AI agents, however, operate on literal instructions and deterministic checks. To get the most out of tools like Claude Code or OpenCode, your specifications must move away from "the feature should work" toward "the following command must return a zero exit code."
The shift toward agentic development requires a more rigorous approach to definition. If an agent cannot programmatically confirm that a task is complete, the task is likely poorly defined. This post explores how to structure your requirements so that your local AI tools can prove their own success.
The Gap Between Intent and Verification
Traditional acceptance criteria focus on the "what" from a user perspective. For an agent, the "what" must be tethered to the "how it is tested." If you ask an agent to "improve the performance of the login script," the agent might refactor the code but have no way to verify the improvement.
A verifiable criterion would be: "The login script must execute in under 200ms when tested with the provided benchmark script." This gives the agent a clear target and a method to check its progress. In a multi-panel environment like Deska, you can see this process unfold in real time. You might have a terminal panel running the benchmark while the agent panel iterates on the code.
Structuring Criteria for LLM Consumption
Agents perform best when criteria are broken down into atomic, testable units. Use the following structure to ensure your agent has a clear path to completion.
Definition of Done as Code
Whenever possible, define the acceptance criteria as a failing test case. If you are using coding agents like Codex CLI or Claude Code, start by asking the agent to create a test that reproduces the missing feature or the bug. Once the test exists, the criterion is simple: the test must pass.
Precise Environmental Constraints
Agents need to know the boundaries of their workspace. Specify paths, environment variables, and expected dependencies. Because Deska is a local-first application, the agent has access to your actual file system. You should specify exactly which directories it should focus on to prevent it from wandering through unrelated parts of your codebase.
Visual and UI Verification
Verifying UI changes is historically difficult for CLI agents. However, when using agents within a workspace that includes browser widgets, you can instruct the agent to check the DOM structure or run Playwright tests. Be specific about CSS selectors or ARIA roles rather than visual descriptions like "make it look modern."
Comparing Verification Methods
Different agents and tools handle verification in various ways. It is important to choose the right approach based on the complexity of your task.
| Method | Best For | Verification Logic |
|---|---|---|
| Unit Tests | Logic and Functions | Exit codes from test runners like Vitest or Jest. |
| Integration Tests | API and Database | Status codes and payload validation. |
| Linting / Types | Code Quality | Success of tsc or eslint commands. |
| Manual Inspection | UX and Design | Human review via mobile or local browser. |
While tools differ in approach, the goal remains the same: reducing the ambiguity of the "done" state. Some tools emphasize cloud-based execution, while others focus on the local environment. Deska allows you to run these agents side by side so you can compare how different models interpret the same set of criteria.
Using the Workspace to Validate
The benefit of an infinite canvas is the ability to maintain context. When writing acceptance criteria, you can use notes to draft your requirements before feeding them to the agent.
- Open a Note panel and list the specific technical requirements.
- Use Ask Deska to open the necessary terminals and editor panels.
- Paste the requirements into the agent panel (e.g., Claude Code).
- Monitor the agent as it runs commands in the terminal panels.
- Verify the output in a browser panel or by running a final test suite.
This workflow ensures that the agent is not operating in a vacuum. You provide the criteria, and the workspace provides the infrastructure for verification. If you are away from your desk, you can use the mobile app to check if the agent has finished its task and passed the criteria you defined.
Managing Complex Agent Threads
For larger features, a single prompt is rarely enough. You should break the project into multiple agent threads. Each thread should have its own subset of acceptance criteria. This prevents the agent from losing context or becoming overwhelmed by a massive list of requirements.
For example, if you are building a new authentication module:
- Thread 1: Database schema and migrations.
- Thread 2: Backend API endpoints and unit tests.
- Thread 3: Frontend login form and validation logic.
Each thread ends only when its specific criteria are met. This modular approach makes it easier to debug when an agent fails to meet a particular requirement.
Frequently Asked Questions
How do I write criteria for an agent to refactor legacy code?
Focus on regression testing. The primary criterion should be that all existing tests pass after the refactor. If tests do not exist, the first requirement must be for the agent to write a test suite that captures current behavior before making any changes.
Can agents verify accessibility requirements?
Yes, if you provide specific tools. You can include a criterion that requires the agent to run an accessibility linter or a headless browser check using an automated tool like Axe. Specify the target score or the absence of specific error types.
What if the agent claims it met the criteria but it did not?
This usually happens when criteria are too vague. Tighten the requirements by adding a "verification command." Instead of "ensure the API is fast," use "ensure curl returns a response in less than 50ms." If the agent fails, you can use Ask Deska to point out the specific discrepancy.
Get Started with Agentic Workflows
Transitioning to agent-led development is easier when you have the right environment to monitor and verify their work. Deska provides the canvas, the terminals, and the agent integration you need to stay in control of the process.
You can download the app for Mac, Windows, or Linux to start building your own verifiable workflows today. Whether you are using a lifetime tier with your own keys or a managed subscription, the workspace is designed to keep your code local and your agents productive.