with-jsdoc

A style guide for writing and editing JSDoc comments, which document JavaScript and TypeScript code in the source files.

In plain words
What is it for?
Use it when adding JSDoc, checking project lint settings, writing code examples, or handling necessary lint exceptions.
Why use it?
It helps comments work with the project's linters, type checkers, and documentation generators.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/zackiles/cursor-config/with-jsdoc
Clone the repo
git clone --depth 1 https://github.com/zackiles/cursor-config

Made for: Cursor.

Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,519 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00007 $0.03519
Opus 5 $0.00003 $0.01759
Sonnet 5 $0.00001 $0.00704
Haiku 4.5 $0.00001 $0.00352

Measured 2d ago against content hash a305779a4f26, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

with-jsdoc scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

return await fetch(url, options);
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/global/with-jsdoc.mdc · 398 lines

How it starts

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

Comprehensive JSDoc Comment Style Guide for AI Agents

This rule provides comprehensive guidance for writing JSDoc comments in modern TypeScript/JavaScript projects, ensuring they work correctly with advanced linting tools, type checkers, and documentation generators.

Ensuring JSDoc Compatibility: Critical Linting Considerations

Identifying and Respecting Project Linter Configurations

Before writing JSDoc comments, ALWAYS check for and respect the project's linting configuration in:

  • deno.json or deno.jsonc
  • package.json or package.jsonc (eslint configuration)
  • .eslintrc.js, .eslintrc.json, or .eslintrc.yaml
  • biome.json
  • .vscode/settings.json
  • Any other project-specific linting configuration files
Utilizing Inline Linting Control Comments for False Positives

Use inline linting controls when necessary to prevent false positives:

// For file-level ignores:
// @ts-nocheck
// deno-lint-ignore-file
// biome-ignore-file
// eslint-disable

// For line-level ignores:
// @ts-ignore
// deno-lint-ignore <rule-name>
// biome-ignore <rule-name>
// eslint-disable-next-line <rule-name>
Requirements for Validating JSDoc Code Examples

Code examples in JSDoc comments MUST:

  • Be valid, compilable code that matches the codebase's style
  • Include all necessary imports
  • Use proper types that exist in the codebase
  • Follow the project's linting rules
  • Be properly escaped to prevent breaking documentation parsers

Core JSDoc Guidelines and Sections

Section 1: JSDoc Syntax Rules and Formatting Standards
Handling Special Characters: Escaping Double Asterisks

When documenting patterns containing double asterisks (**), use HTML entity &ast; to escape each asterisk.

Example:

/**
 * @example
 * ```
 * // BAD - Will break JSDoc parsers and linters
 * glob('src/**/*.ts')
 * 
 * // GOOD - Properly escaped
 * glob('src/&ast;&ast;/&ast;.ts')
 * ```
 */
Section 2: Essential JSDoc Decorators by Context

Read the full file on GitHub · 398 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. 2d ago First seen · 398 lines · 7 tokens per session scan A a305779a4f26

Subscribe to this mod's changes

with-jsdoc is a cursor rule published in the GitHub repository zackiles/cursor-config (17 stars, last pushed 1y ago), licensed MIT. It adds 7 tokens to every session and 3,519 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.