Use Cline Plan and Act in VS Code for a Small Patch

Use Plan mode to inspect how the existing code behaves and list the intended edits. Keep the task small enough to verify the diff and expected inputs after switching to Act.

Worked example

An implementation with extra hyphens for repeated spaces

export function makeSlug(text) {
  return text.trim().toLowerCase().replaceAll(" ", "-");
}

Steps

  1. In a practice branch, create slug.mjs with the sample and start a Cline task in Plan mode. Ask it to collapse repeated spaces before joining words in makeSlug and describe the expected behavior.
  2. Confirm the plan only touches the named function. Switch to Act, accept the intended edit, and inspect the diff in VS Code.
  3. Run a small Node.js check that passes ' Blue Chair ' and expects 'blue-chair'. Review normal one-space inputs and empty input as separate controls.

What to check

  • The sample currently yields blue---chair. Confirm the patch reduces it to blue-chair and leaves 'Desk Lamp' as 'desk-lamp'.
  • The test covers collapsing spaces. Unicode normalization and punctuation removal have separate requirements and need their own cases if you later implement them.

See the Cline tool profile

References