js-docs-sync

Verify and update hand-written docs/ documentation in JS packages against source code.

1.2k|302|Updated Dec 26, 2023
One-click install
npx skills add https://github.com/Arize-ai/openinference --skill js-docs-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: js-docs-sync
Source: https://github.com/Arize-ai/openinference/tree/main/.agents/skills/js-docs-sync
Command: npx skills add https://github.com/Arize-ai/openinference --skill js-docs-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hand-written documentation in JS packages drifts out of sync with source code as exports, function signatures, types, and enums evolve, causing coding agents that read these docs from node_modules to write broken code.

Core Features & Use Cases

  • Export Completeness Checks: Compares barrel file exports (src/index.ts) against the documented export list to find missing or stale entries.
  • Signature and Type Verification: Validates documented function signatures, generics, union types, interfaces, and enum values against actual TypeScript source.
  • Example Validation: Checks that code examples reference real exports, use correct parameter shapes, and contain valid TypeScript syntax.
  • Use Case: After modifying the public API of a package under js/packages/, run this Skill to re-verify only the affected doc files, fix discrepancies, and update the Source Code Map in docs/README.md.

Quick Start

Ask the AI to sync the docs for the JS package you just modified so the documentation matches the current source code.

Frequently Asked Questions about js-docs-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep package documentation in sync with TypeScript source code?

Compare the barrel file exports in src/index.ts against the documented export list, then verify each documented signature, type, and enum against the source. Update only the discrepancies while preserving accurate existing prose and examples.

How to check if docs are accurate after changing a JS package API?

Run git diff on the package's src/ directory to identify changed files, map them to doc files using the Source Code Map in docs/README.md, and re-verify only those affected docs for signature, type, and example accuracy.

Should internal exports be documented in package docs?

Only document functions reachable from the package's main entry point through the barrel index.ts chain. A function exported from its own file but not re-exported publicly is internal and should not appear in the docs.

What is the difference between hand-written docs and TypeDoc generated docs?

Hand-written docs in js/packages/*/docs/ focus on usage patterns and examples and ship with the npm package. TypeDoc-generated API docs at js/docs/ are gitignored, exhaustive API references, and serve a separate purpose.

Why do documented TypeScript examples fail type checking?

Examples often break when template literal types are documented as plain strings, imports reference renamed exports, or truncated arrays use invalid spread syntax. Verify each example against real exports and use comment placeholders for truncated arrays.