feat(agent): add windsurf as an install target#29
Open
Davidson3556 wants to merge 1 commit into
Open
Conversation
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.
4e02451 to
eea1d02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #28
Describe the changes you have made in this PR -
Adds Windsurf (Codeium's Cascade editor) as an
agent installtarget, sotestsprite agent install --target windsurfandtestsprite setup --agent windsurfwire the verification-loop skill into a Windsurf project.windsurf→.windsurf/rules/testsprite-verify.md.trigger: model_decision+description:— the equivalent of the Cursor.mdcalwaysApply: falsemode (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..windsurf/rules/*.mdfile 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 newcompactBodyflag 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-bearingtestsprite test run … --wait/test artifact getcommands.agent.tsandrenderForTargetchoose the same body so the installed bytes equal the asserted render.TARGETSmap automatically (theagent listtable, thesetup --agentchoices, skill-nudge install detection). Updated the two hardcoded help strings inagent.ts, the--helpsnapshot, 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 -
Tests:
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
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 (
TARGETSinagent-targets.ts) with a per-targetwrap()for the file's frontmatter, so the core addition is one entry plus a wrap function. I chosetrigger: model_decisionafter checking Windsurf's rules docs: its semantics match the existing Cursor target (alwaysApply: false) — surface the description, load the body on demand — rather thanalways_on(injects the whole skill into every prompt) ormanual(needs an@-mention, defeating an auto-verify skill).The non-obvious part is the size budget. Windsurf caps a
.windsurf/rules/*.mdfile 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 acompactBodyflag rather than authoring a third asset. Both therenderForTargetdefault and theagent.tsinstall 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'sdescription/alwaysApplykeys are not Windsurf'strigger/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/*.mddirectory format.Edge cases handled/tested: a render test asserts the Windsurf output carries
trigger: model_decision+description:and not thename:/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 fromOWN_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
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.