Skip to content
Back to skills

Common Documentation

ASecurity

Assuming a TypeScript/JavaScript retry function: ```ts /** * Retries an operation using exponential backoff with jitter. * * JSDoc documents the public API, while inline comments explain why * each retry decision exists. * * @param operation Operation that may temporarily fail. * @param maxRetries Maximum number of retries after the initial attempt. * @param baseDelayMs Initial backoff duration in milliseconds. * @param maxDelayMs Upper bound for the calculated delay. * @returns The successfu...

  • 584 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 5, 2026
developmentjavascripttypescriptjavaapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill common-documentation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Common Documentation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Common Documentation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-common-documentation-f713dbe5/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-common-documentation-f713dbe5)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
Assuming a TypeScript/JavaScript retry function:

```ts
/**
 * Retries an operation using exponential backoff with jitter.
 *
 * JSDoc documents the public API, while inline comments explain why
 * each retry decision exists.
 *
 * @param operation Operation that may temporarily fail.
 * @param maxRetries Maximum number of retries after the initial attempt.
 * @param baseDelayMs Initial backoff duration in milliseconds.
 * @param maxDelayMs Upper bound for the calculated delay.
 * @returns The successful operation result.
 *
 * @example
 * // Usage
 * const result = await retryWithBackoff(() => fetchData(), 5, 100, 10_000);
 */
async function retryWithBackoff<T>(
  operation: () => Promise<T>,
  maxRetries: number,
  baseDelayMs: number,
  maxDelayMs: number,
): Promise<T> {
  for (let attempt = 0; ; attempt++) {
    try {
      return await operation();
    } catch (error) {
      // Stop retrying once the failure is no longer considered transient.
      if (attempt >= maxRetries) {
        throw error;
      }

      // Exponential growth gives a recovering dependency time to stabilize.
      const exponentialDelay = Math.min(
        maxDelayMs,
        baseDelayMs * 2 ** attempt,
      );

      // Jitter prevents many clients from retrying simultaneously—the
      // thundering herd problem—after a shared failure.
      const delay = Math.random() * exponentialDelay;

      await new Promise((resolve) => setTimeout(resolve, delay));
    }
  }
}
```

Files in this skill

  • eval-1.baseline.md1.1 KB
  • eval-1.with-skill.md1.4 KB
  • eval-2.baseline.md5.7 KB
  • eval-2.with-skill.md4.9 KB
  • eval-3.baseline.md590 B
  • eval-3.with-skill.md829 B
  • trigger-1.md139 B
  • trigger-2.md137 B
  • trigger-3.md170 B
  • trigger-4.md146 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.