windsurfrules

windsurfrules is a cursor rule for Windsurf from Larens94/codedna. It costs 1,203 tokens per session, scanned A, original, MIT.

A rule set requiring supported source files to begin with a CodeDNA header written in the file's normal comment syntax. It also defines commands for checking project structure and tracing changes to public interfaces.

In plain words
What is it for?
Adding consistent source-file headers, checking a project's setup, assessing the effect of changing a public contract, and verifying structural edits.
Why use it?
It records module purpose, dependencies, constraints, and agent observations near the code, while requiring checks before and after structural edits.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule.

Good fit Adding consistent source-file headers, checking a project's setup, assessing the effect of changing a public contract, and verifying structural edits.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/larens94/codedna/windsurfrules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Larens94/codedna

Made for: Windsurf.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for windsurfrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/larens94/codedna/windsurfrules/github.svg)](https://agentmods.dev/rules/larens94/codedna/windsurfrules)
Your own site
<a href="https://agentmods.dev/rules/larens94/codedna/windsurfrules"><img src="https://agentmods.dev/badge/rules/larens94/codedna/windsurfrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for windsurfrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/larens94/codedna/windsurfrules"><img src="https://agentmods.dev/badge/rules/larens94/codedna/windsurfrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,203 This file is loaded in full into every session.
When invoked 1,203 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01203 $0.01203
Opus 5.5 $0.00481 $0.00481
Sonnet 5.5 $0.00241 $0.00241
Haiku 4.5 $0.00120 $0.00120

Measured 1mo ago against content hash a5ee0a1a52dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

windsurfrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/.windsurfrules · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CodeDNA v0.9 — In-Source Communication Protocol

Setup: pipx install git+https://github.com/Larens94/codedna.git && codedna install --path . --tools windsurf --no-wiki-sync && codedna init . --no-llm

Every supported source file must start with a CodeDNA header using native comment syntax. Python uses a module docstring; non-Python files must use their language's valid comment form.

Required command workflow

  • Onboarding: codedna doctor --path .
  • Before changing a public contract: codedna impact <file-or-symbol> --path .
  • After structural edits: codedna verify .; review evidence before codedna refresh .
  • Use --json in automation; verification is structural, not semantic

Module docstring format

"""filename.py — <what it does, ≤15 words>.

exports: public_function(arg) -> return_type
used_by: consumer_file.py → consumer_function
rules:   <hard constraint agents must never violate>
agent:   <model-id> | <provider> | <YYYY-MM-DD> | <session_id> | <what you did and what you noticed>
         message: "<open hypothesis or observation for the next agent>"
"""

Rules on every edit

  • Read .codedna at repo root first — project structure and recent session history
  • Re-read rules: as your first step — never violate these constraints
  • Read Rules: in function docstrings before writing logic there
  • Check used_by: after changes — update callers if signatures change
  • Never rename exports: symbols without explicit instruction
  • If you discover a constraint or fix a bug, add it to rules: for the next agent
  • After editing, append a new agent: line to the module docstring. Keep only the last 5 entries — drop the oldest if adding a 6th. Full history is in git and .codedna.

Rules on generate

  • Write the module docstring before any imports
  • Every public function must have a Rules: docstring
  • Use semantic variable names: list_dict_users_from_db = get_users()

Writing good rules:

rules: must be specific and actionable — never vague.

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 129 lines · 1,203 tokens per session scan A a5ee0a1a52dc

Subscribe to this mod's changes

windsurfrules is a cursor rule published in the GitHub repository Larens94/codedna (151 stars, last pushed 9d ago), licensed MIT. It adds 1,203 tokens to every session, about $0.0048 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.