windsurfrules

windsurfrules is a cursor rule for Windsurf from MervinPraison/PraisonAI. It costs 4,722 tokens per session, scanned A, original, MIT.

A project rule and example folder layout for converting a Python-style AI project into TypeScript and Node.js. It lists areas such as agents, knowledge, memory, tasks, and tools.

In plain words
What is it for?
Use it to plan or organise a TypeScript version of an AI project, including tools for files, data, web searches, and Python execution.
Why use it?
It gives a starting structure when moving an AI application to TypeScript instead of deciding every folder and replacement alone.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule.

Good fit Use it to plan or organise a TypeScript version of an AI project, including tools for files, data, web searches, and Python execution.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mervinpraison/praisonai/windsurfrules
About the project

PraisonAI is a framework and SDK for building AI agents and teams that research, generate code or content, analyze data, support users, and automate workflows. Developers use it to create autonomous task-running agents with memory, retrieval-augmented generation, and support for many language models.

MervinPraison/PraisonAI · 9,028 stars · on GitHub · praison.ai

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/MervinPraison/PraisonAI

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/mervinpraison/praisonai/windsurfrules.svg)](https://agentmods.dev/rules/mervinpraison/praisonai/windsurfrules)
Your own site
<a href="https://agentmods.dev/rules/mervinpraison/praisonai/windsurfrules"><img src="https://agentmods.dev/badge/rules/mervinpraison/praisonai/windsurfrules.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,722 This file is loaded in full into every session.
When invoked 4,722 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.04722 $0.04722
Opus 5 $0.02361 $0.02361
Sonnet 5 $0.00944 $0.00944
Haiku 4.5 $0.00472 $0.00472

Measured yesterday against content hash 21888aa34134, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 yesterday.

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.

src/praisonai-ts/.windsurfrules · 360 lines

How it starts

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

Below is an example TypeScript/Node.js folder structure replicating the Python package's layout. Each subfolder matches the Python counterpart (agent, agents, knowledge, etc.). All "LLM" or "litellm" references are replaced by aisdk usage.

Feel free to rename or restructure to suit your project's Node.js conventions.


Folder Structure

praisonai-ts/
├── package.json
├── tsconfig.json
├── src/
│   ├── index.ts
│   ├── main.ts
│   ├── agent/
│   │   └── agent.ts
│   ├── agents/
│   │   ├── agents.ts
│   │   └── autoagents.ts
│   ├── knowledge/
│   │   ├── chunking.ts
│   │   └── knowledge.ts
│   ├── llm/
│   │   └── llm.ts
│   ├── memory/
│   │   └── memory.ts
│   ├── process/
│   │   └── process.ts
│   ├── task/
│   │   └── task.ts
│   └── tools/
│       ├── README.md
│       ├── index.ts
│       ├── test.ts
│       ├── arxivTools.ts
│       ├── calculatorTools.ts
│       ├── csvTools.ts
│       ├── duckdbTools.ts
│       ├── duckduckgoTools.ts
│       ├── excelTools.ts
│       ├── fileTools.ts
│       ├── jsonTools.ts
│       ├── newspaperTools.ts
│       ├── pandasTools.ts
│       ├── pythonTools.ts
│       ├── shellTools.ts
│       ├── spiderTools.ts
│       ├── tools.ts
│       ├── wikipediaTools.ts
│       ├── xmlTools.ts
│       ├── yamlTools.ts
│       └── yfinanceTools.ts
└── ...

Below is a high-level table describing the main files/folders, the classes or functions inside them, their parameters, and return values.


File / Folder Contents Functions / Classes Parameters Return Purpose
src/index.ts Main entry point that re-exports key classes/functions - Typically re-exports Agent, Agents, Task, etc. - - Provides a simple import path for consumers.
src/main.ts Equivalent of main.py, sets up logging, callbacks, registers display callbacks, and integrates with aisdk if needed - registerDisplayCallback(type: string, callbackFn, isAsync: boolean): void- executeCallback(type: string, ...args): Promise<void>- displayInteraction(...), displayError(...), etc. - Possibly some global logs array or error logs. Depending on the function, e.g. registerDisplayCallback(type, fn, isAsync) Varies by function type. Typically void or Promise<void> Central place for logging and "display callbacks," mirroring the Python approach (prints, error logs, etc.). Uses or references aisdk for generating text if needed.
src/agent/agent.ts Contains Agent class, mirroring agent.py. Handles single-agent logic, possible references to LLM calls via aisdk. - class Agent - constructor(name: string, role: string, goal: string, ...) - chat(...): main method for handling "chat" or LLM calls - achat(...): async method, if needed constructor: (name, role, goal, tools, ... ) etc. chat: (prompt: string, ...) achat: (prompt: string, ...) Promise<string> or string for the chat methods. Encapsulates a single agent's role, name, and the methods for calling the LLM using aisdk. Also may manage context, tools, roles, etc.
src/agents/agents.ts Contains PraisonAIAgents (like agents.py). Manages multiple agents, tasks, memory, process type, etc. - class PraisonAIAgents - constructor(agents: Agent[], tasks?: Task[], ...) - addTask(task: Task): number - executeTask(taskId: number): TaskOutput - runTask(taskId: number): void - runAllTasks(): void - start(...): starts them all - getTaskResult(...) The constructor takes arrays of Agent, optional tasks, manager config, memory config, etc. Other methods take Task IDs. Most methods return void, or a Promise<void>, or a custom object. Coordinates multiple agents and tasks in a "manager" style. The top-level orchestrator for tasks and agent interactions.
src/agents/autoagents.ts The AutoAgents class, an advanced manager that can auto-create tasks/agents from instructions. Uses aisdk to parse config. - class AutoAgents extends PraisonAIAgents - constructor(instructions: string, tools?: any[], ...) - _generateConfig(...) - _createAgentsAndTasks(...) - start(): overrides the parent to handle auto generation - etc. Takes user instructions, tools, config (like memory usage, manager LLM, etc.). Typically Promise<object> or void for the start() method. High-level convenience for automatically generating agent/task configuration from user instructions.
src/knowledge/chunking.ts Chunking class for text chunking. Similar logic to the Python version. - class Chunking - constructor(chunkerType: string, ... ) - `chunk(text: string string[], addContext: boolean, contextParams: any): Chunk[]<br/> - Possibly _get_overlap_refinery(...)`, etc. Similar to Python (chunkerType, chunkSize, etc.). Returns an array of chunked text or objects describing the chunk.
src/knowledge/knowledge.ts Knowledge class for storing & retrieving data from memory, chunking, vector DB, etc. - class Knowledge - constructor(config: any, verbose?: number) - store(content: string, userId?: string, ...): any - search(query: string, ...): any - deleteAll(...): etc. Takes a config object for local or external DB. Methods get or store docs, do RAG searching, etc. Return types typically objects or arrays. Central interface to handle knowledge storage, chunking, retrieval, e.g. vector store, RAG.
src/llm/llm.ts LLM class referencing aisdk instead of litellm. Basic usage of generateText or streamText. - class LLM - constructor(options: { model: string, apiKey?: string, ... }) - response(prompt: string, ...): Promise<string> (calls aisdk.generateText) - possibly streamResponse(...) if needed model, prompt, temperature, ... Promise<string> for final text. The bridging layer between your code and aisdk, so Agent can call LLM.response(...).
src/memory/memory.ts Memory class for short-term or long-term memory references, entity memory, user memory, etc. - class Memory - constructor(config: MemoryConfig, verbose?: number) - storeShortTerm(...), storeLongTerm(...), searchShortTerm(...), etc. - buildContextForTask(...) Varies, e.g. (text: string, metadata?: any) Typically void or some object referencing stored docs. Takes a config describing how/where memory is stored: local DB, RAG, or aisdk embeddings.
src/process/process.ts Process class that handles sequential or workflow processes between tasks. - class Process - constructor(tasks: Map<number, Task>, agents: Agent[], ... ) - sequential(), workflow(), hierarchical(), etc. Receives tasks, agents, process type. Returns an iterator or array describing the next tasks to run. Logic for ordering tasks in "sequential", "hierarchical", or "workflow" modes.
src/task/task.ts Task class for describing a single piece of work, the agent assigned, context, etc. - class Task - constructor(description: string, expectedOutput?: string, ... ) - executeCallback(taskOutput: TaskOutput), storeInMemory(...), etc. The constructor has many options: (description, expectedOutput, agent, tools, ...). Methods return void, or custom objects. Encapsulates a single unit of work, references an agent, has optional callback, memory usage, etc.
src/tools/README.md Short README describing how to write "tools" in JS/TS. - - - Provides docs for tool developers.
src/tools/index.ts Entry point that re-exports tool functions (like internetSearch, getArxivPaper, etc.) - Possibly a map of functionName -> import - import * as calculatorTools from './calculatorTools', etc. - - Simplifies import of tools (e.g. import { getArticle } from "praisonai/tools").
src/tools/test.ts Script for running each tool's internal test or example. - Typically a script that import ... from './someTool.ts' then tries them. - - Quick local tests.
src/tools/arxivTools.ts Example "arxiv_tools.py" logic in TS. Searching arXiv, returning results. - function searchArxiv(query: string, ...): Promise<any[]> - function getArxivPaper(id: string): Promise<any> etc. (query, maxResults=10, ... ) Promise<ArxivPaper[]> or something like that. Tools for searching and retrieving from arXiv.

Read the full file on GitHub · 360 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. yesterday First seen · 360 lines · 4,722 tokens per session scan A 21888aa34134

Subscribe to this mod's changes

windsurfrules is a cursor rule published in the GitHub repository MervinPraison/PraisonAI (9,028 stars, last pushed today), licensed MIT. It adds 4,722 tokens to every session, about $0.0236 per session on Opus 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-06.

Related

Other cursor rules, from other repositories