footPrint: Cursor rule for Windsurf

.windsurfrules

windsurfrules is a cursor rule for Windsurf from footprintjs/footPrint. It costs 1,218 tokens per session, scanned A, original, MIT.

A set of coding rules for footprint.js, a JavaScript library that represents backend work as a flowchart. It describes how the library collects information during one depth-first traversal and how its code is organised.

In plain words
What is it for?
It helps build flowcharts with functions, decisions, branches, selectors, lists, and subflows. It is intended for work on the library's execution engine, state handling, validation, and API contract.
Why use it?
It gives an agent clear boundaries for changing or extending the library without adding a second pass over the flowchart. It also documents the public entry points and internal areas.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule.

This is footprintjs/footPrint's own configuration. It tells Windsurf how to work on footPrint itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything footPrint configures →

Reuse

Borrowing it

Nothing to install: this file belongs to footprintjs/footPrint. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/footprintjs/footPrint/main/.windsurfrules
Clone the repo
git clone --depth 1 https://github.com/footprintjs/footPrint

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/footprintjs/footprint/windsurfrules/github.svg)](https://agentmods.dev/rules/footprintjs/footprint/windsurfrules)
Your own site
<a href="https://agentmods.dev/rules/footprintjs/footprint/windsurfrules"><img src="https://agentmods.dev/badge/rules/footprintjs/footprint/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/footprintjs/footprint/windsurfrules"><img src="https://agentmods.dev/badge/rules/footprintjs/footprint/windsurfrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,218 This file is loaded in full into every session.
When invoked 1,218 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.01218 $0.01218
Opus 5.5 $0.00487 $0.00487
Sonnet 5.5 $0.00244 $0.00244
Haiku 4.5 $0.00122 $0.00122

Measured 14d ago against content hash 106173b10be3, 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 14d 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.

.windsurfrules · 121 lines

How it starts

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

footprint.js

This is the footprint.js library — the flowchart pattern for backend code. Self-explainable systems that AI can reason about.

Core Principle

Collect during traversal, never post-process. All data collection happens as side effects of the single DFS traversal. Never walk the tree after execution.

Architecture

src/lib/
├── memory/    → Transactional state (SharedMemory, StageContext, TransactionBuffer)
├── schema/    → Validation (Zod optional, duck-typed)
├── builder/   → Fluent DSL (FlowChartBuilder, flowChart())
├── scope/     → Per-stage facades + recorders + providers
├── reactive/  → TypedScope<T> deep Proxy (typed property access, $-methods)
├── decide/    → decide()/select() decision evidence capture
├── engine/    → DFS traversal + narrative + handlers
├── runner/    → FlowChartExecutor
└── contract/  → I/O schema + OpenAPI

Entry points (seven doors): footprintjs (main API) · footprintjs/recorders (recorder factories) · footprintjs/trace (read a finished run) · footprintjs/write (write a record yourself) · footprintjs/advanced (engine internals) · footprintjs/detach (fire-and-forget children) · footprintjs/zod (opt-in zod bridge).

import { flowChart, FlowChartExecutor, decide } from 'footprintjs';

interface State {
  creditScore: number;
  riskTier: string;
  decision?: string;
}

const chart = flowChart<State>('Intake', async (scope) => {
  scope.creditScore = 750;          // typed write (no setValue needed)
  scope.riskTier = 'low';           // typed write
}, 'intake')
  .addDeciderFunction('Route', (scope) => {
    return decide(scope, [
      { when: { riskTier: { eq: 'low' } }, then: 'approved', label: 'Low risk' },
    ], 'rejected');
  }, 'route', 'Route based on risk')
    .addFunctionBranch('approved', 'Approve', async (scope) => {
      scope.decision = 'Approved';
    })
    .addFunctionBranch('rejected', 'Reject', async (scope) => {
      scope.decision = 'Rejected';
    })
    .setDefault('rejected')
    .end()
  .build();

const executor = new FlowChartExecutor(chart);
executor.enableNarrative();      // the narrative is OFF until enabled
await executor.run();
executor.getNarrativeEntries();  // CombinedNarrativeEntry[] — causal trace with decision evidence

Read the full file on GitHub · 121 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. 14d ago Changed · +13 tokens per session 106173b10be3
  2. 20d ago Changed · +41 lines · +499 tokens per session 19173a636b55
  3. 1mo ago First seen · 80 lines · 706 tokens per session scan A 54167395b8f0

Subscribe to this mod's changes

windsurfrules is a cursor rule published in the GitHub repository footprintjs/footPrint (21 stars, last pushed yesterday), licensed MIT. It adds 1,218 tokens to every session, about $0.0049 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.