with-jsdoc

Rules for writing and editing JSDoc comments, which are structured notes in JavaScript or TypeScript code used by editors, type checkers, and documentation tools. It includes checking the project's linting configuration and validating code examples.

In plain words
What is it for?
Adding function and API documentation, writing JSDoc examples, checking lint rules, and applying narrowly scoped linting exceptions when necessary.
Why use it?
It helps comments remain compatible with the tools that check code quality or generate documentation. It also reduces false warnings caused by incorrect comment syntax or unsupported examples.

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/deno-kit/with-jsdoc
Clone the repo
git clone --depth 1 https://github.com/zackiles/deno-kit

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,514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.03514
Opus 5 $0.00003 $0.01757
Sonnet 5 $0.00001 $0.00703
Haiku 4.5 $0.00001 $0.00351

Measured yesterday against content hash e8ff39cf1bfa, 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 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.

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

This is a copy

100% identical to with-jsdoc — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/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. yesterday First seen · 398 lines · 7 tokens per session scan A e8ff39cf1bfa

Subscribe to this mod's changes

with-jsdoc is a cursor rule published in the GitHub repository zackiles/deno-kit (3 stars, last pushed 5mo ago), licensed MIT. It adds 7 tokens to every session and 3,514 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to with-jsdoc, differing in 10 lines, and is treated as a copy.