ertac.paprat.com
EN

← Writing

A Small, Reviewable Cursor Workflow — June 2025

· 3 min read · English

Rewritten: . Rewritten with AI assistance. Examples and tool references follow the original publication period.

A useful Cursor session starts with a bounded task and a clear sign that it is done.

Consider a hypothetical issue: an authenticated user sees an error when searching for a whitespace-only string. The desired behavior is an empty result, while ordinary searches and permission checks continue to work.

This walkthrough uses the editor workflow available in early June 2025. It does not depend on a separate AI command-line agent or on undocumented command flags.

1. Define the behavior before asking for a patch

Start with a compact task statement:

For an authenticated request, treat a query containing only whitespace as empty and return the endpoint’s existing empty-result response. Preserve the current behavior for nonempty queries. Keep authentication and authorization checks in their current order. Add a regression test using the repository’s existing test style.

The order of the permission checks matters. An early return placed before authentication could satisfy the visible search example while changing the endpoint’s access behavior.

Do not prescribe a new search abstraction before inspecting the code. The existing handler may already have the right branch and simply need to normalize input at the appropriate point.

2. Give context a purpose

Open or reference the handler, its tests, and the existing empty-result path. Ask the assistant to locate any shared query normalization and describe the proposed change before editing.

If it claims a helper is unused elsewhere, inspect that claim. If the behavior is shared with another endpoint, include the relevant caller. Include context that answers a specific question about the change.

Cursor’s 0.45 release notes from January 2025 introduced project rules under .cursor/rules. Use project-scoped rules for durable repository conventions, such as where tests belong and which architectural boundaries matter. Keep task-specific acceptance conditions in the task itself.

A rule saying “always produce perfect code” is not a convention. A rule naming the existing test directory and explaining that handlers must preserve an authorization boundary is actionable. Rules guide the assistant; they do not enforce a security boundary or prove compliance.

3. Make the test distinguish the wrong fix

Run the relevant existing tests first so you know the starting state. Then add a case for whitespace-only input. Confirm that it reproduces the problem before relying on it to judge the fix.

The focused checks should cover an authenticated empty query, an ordinary matching query, and an unauthenticated request. Add other cases when the actual contract requires them. The point is to distinguish the intended behavior from easy but incorrect fixes such as returning an empty list for every request.

Use the project’s documented commands. This workflow needs no invented cursor run subcommand, special “YOLO” configuration key, or universal test command that supposedly works across repositories.

4. Review the complete difference

Inspect every changed file, including lockfiles and configuration. A small search fix should have an explanation for any dependency addition or unrelated cleanup.

Read the code and the test together. Ask whether the assertion captures the requirement or merely matches the new implementation. Run the appropriate checks yourself or inspect their actual output in the tool session. A summary saying “tests pass” is weaker evidence than the recorded result.

If the patch grows unexpectedly, stop and narrow the scope. Saving a known version before the session makes rejecting an unsuitable change much easier.

Add integrations when the task requires them

The Model Context Protocol, announced in November 2024, provides a way to connect models and tools with external context. If your configured workflow uses such an integration, understand what information and actions it exposes.

The whitespace fix probably needs only the repository and its tests. More connected tools would not make the requirement clearer. A good session ends with a small patch, a verified behavior, and enough understanding to maintain the code after the chat is gone.