Skip to content

feat(agent): add windsurf as an install target#29

Open
Davidson3556 wants to merge 1 commit into
TestSprite:mainfrom
Davidson3556:feat/add-windsurf-target
Open

feat(agent): add windsurf as an install target#29
Davidson3556 wants to merge 1 commit into
TestSprite:mainfrom
Davidson3556:feat/add-windsurf-target

Conversation

@Davidson3556

@Davidson3556 Davidson3556 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #28

Describe the changes you have made in this PR -

Adds Windsurf (Codeium's Cascade editor) as an agent install target, so testsprite agent install --target windsurf and testsprite setup --agent windsurf wire the verification-loop skill into a Windsurf project.

  • New own-file target windsurf.windsurf/rules/testsprite-verify.md.
  • Cascade frontmatter trigger: model_decision + description: — the equivalent of the Cursor .mdc alwaysApply: false mode (only the description is surfaced up front; Cascade pulls in the full rule body when the description shows it is relevant), which matches how this skill should activate.
  • Budget handling: a .windsurf/rules/*.md file is capped at ~12 K characters and Cascade silently truncates beyond it. The full skill body (~21 KB) would be cut in half, so the windsurf target renders the compact body — the same trimmed variant the Codex/AGENTS.md target already ships (~5 KB) — selected via a new compactBody flag on the target spec. The rendered file is ~5.5 KB: well within budget, and it still carries the H1, the when-to-run guidance, and the load-bearing testsprite test run … --wait / test artifact get commands. agent.ts and renderForTarget choose the same body so the installed bytes equal the asserted render.
  • Everything else derives from the TARGETS map automatically (the agent list table, the setup --agent choices, skill-nudge install detection). Updated the two hardcoded help strings in agent.ts, the --help snapshot, the unit tests (render test for the Cascade frontmatter + a budget test asserting the windsurf render stays under 12 K and uses the compact body), the e2e matrix guards / multi-target / content-integrity coverage, and the README / DOCUMENTATION target lists.

Demo/Screenshot for feature changes and bug fixes -

image

Tests:

npm test          
image
npm run test:e2e  # e2e  
image
npm run typecheck && npm run lint && npm run format:check
image

Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • No, I wrote all the code myself
  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:

Problem: TestSprite's value is wiring the verify skill into coding agents, but Windsurf — a top-tier AI editor — wasn't a supported target.

The target system is a clean table (TARGETS in agent-targets.ts) with a per-target wrap() for the file's frontmatter, so the core addition is one entry plus a wrap function. I chose trigger: model_decision after checking Windsurf's rules docs: its semantics match the existing Cursor target (alwaysApply: false) — surface the description, load the body on demand — rather than always_on (injects the whole skill into every prompt) or manual (needs an @-mention, defeating an auto-verify skill).

The non-obvious part is the size budget. Windsurf caps a .windsurf/rules/*.md file at ~12 K characters and truncates silently beyond it; the full skill body renders to ~22 KB, so half the skill would be lost. The repo already maintains a trimmed/compact body for the Codex/AGENTS.md target, which is agent-agnostic (no Codex- or AGENTS.md-specific wording), so I reused it for Windsurf via a compactBody flag rather than authoring a third asset. Both the renderForTarget default and the agent.ts install path branch on this flag (loading each source body at most once), so what gets written equals what the unit test renders.

Alternatives considered: (1) reuse wrapMdc (Cursor's wrapper) — rejected, Cursor's description/alwaysApply keys are not Windsurf's trigger/description; (2) ship the full body and just emit a budget warning like the Codex target — rejected, because unlike Codex (whose body fits its 32 K budget) the full body always exceeds Windsurf's cap, so it would warn on every install and still truncate; (3) the legacy single-file .windsurfrules — rejected in favour of the current .windsurf/rules/*.md directory format.

Edge cases handled/tested: a render test asserts the Windsurf output carries trigger: model_decision + description: and not the name:/alwaysApply: keys; a budget test asserts the real windsurf render is < 12 K characters, uses the compact body (a full-body-only sentence is absent) yet keeps the load-bearing commands, and is smaller than the full claude render; the "install all own-file targets" unit test derives its list from OWN_FILE_TARGETS; and the e2e content-integrity loop gates the full-body assertion on non-compact targets while adding a Windsurf frontmatter branch.


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • If it is a core feature, I have added thorough tests
  • My code follows the project's style guidelines and conventions

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

Windsurf (Cascade) is a widely-used AI editor that reads workspace rules
from `.windsurf/rules/*.md`. Add it as an own-file agent target so
`testsprite agent install --target windsurf` (and `setup --agent windsurf`)
wires the verification-loop skill into a Windsurf project.

The rule file uses Cascade's YAML frontmatter with `trigger: model_decision`
— the equivalent of the Cursor `.mdc` `alwaysApply: false` mode: only the
`description` is surfaced up front and Cascade pulls in the full body when it
is relevant, which matches how this skill should activate. (Cascade's other
triggers are `always_on`, `manual`, and `glob`.)

Budget handling: a `.windsurf/rules/*.md` file is capped at ~12 K characters,
and the full skill body (~21 KB) would be silently truncated by Cascade. The
windsurf target therefore renders the COMPACT body (the same trimmed variant
the codex/AGENTS.md target already uses, ~5 KB) via a new `compactBody` flag
on the target spec — the rendered file is ~5.5 KB, well within budget, while
still carrying the H1, the when-to-run guidance, and the load-bearing
`testsprite test run … --wait` / `test artifact get` commands. `agent.ts` and
`renderForTarget` select the same body so installed bytes match the asserted
render.

The target otherwise flows through existing machinery automatically — the
`agent list` table, `setup --agent` choices, and skill-nudge install
detection all derive from the TARGETS map. Updated the hardcoded help strings
in `agent.ts`, the help snapshot, the agent-targets + agent unit tests (incl.
a render test asserting the Cascade frontmatter and a budget test that the
windsurf render stays under 12 K and uses the compact body), the e2e matrix
guards and multi-target/content-integrity coverage, and the
README/DOCUMENTATION target lists.
@Davidson3556 Davidson3556 force-pushed the feat/add-windsurf-target branch from 4e02451 to eea1d02 Compare June 25, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Windsurf (Cascade) as an agent install target

1 participant