shakacode / shakacode/reactonrails.com

Docs inventory + scoring pipeline: npm run audit:inventory

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Part of the docs & demos tracking issue: #140. Phase 0 of the docs-quality program: make the audit repeatable instead of one-shot.

Problem

The docs corpus is 176 pages / ~308k words (2026-07-09 measurement) with large quality variance that currently requires manual archaeology to see:

  • Critical pages that are far too thin: oss/getting-started/pro-quick-start.md is 207 words — the entry point for the paid tier
  • Pages too long to navigate: oss/migrating/rsc-troubleshooting.md (8.7k words), oss/upgrading/changelog.md (35.8k words inside the docs tree)
  • A stale cluster untouched since 2026-03-10 (angular-js-integration-migration, troubleshooting-when-using-webpacker, asset-pipeline at 92 words, rails-engine-integration with zero site references, project-structure)

Docs churn is high (dozens of pages changed in the first week of July alone), so any manual audit rots within weeks. We need npm run audit:inventory to regenerate the picture on demand.

Work

  • scripts/inventory-docs.mjs following the audit-docs.mjs conventions (ESM, --docs-root/--output/--fail-on args, report to workspace root)
  • Resolve the monorepo the same way sync-docs.mjs does (REACT_ON_RAILS_REPO env var, then sibling ../react_on_rails) and analyze <repo>/docs directly so git history is available for last-modified dates
  • Per-page metrics: word count, heading/code-block counts, title, frontmatter description presence, last commit date (one batched git log --name-only pass), inbound links from other docs pages (resolved relative markdown links, not substring matches), sidebar presence (prototypes/docusaurus/sidebars.ts)
  • Per-page flags: tooShort (<300 words, excluding index/release-note pages), tooLong (>4000 words), stale (>90 days untouched), orphan (no inbound links and not in sidebar), missingDescription
  • Output: JSON dataset + markdown summary report (extremes tables, flag counts), mirroring the VALIDATION_REPORT pattern
  • npm scripts: audit:inventory and test:inventory-docs (unit tests for the pure helpers via node --test)

Follow-ups (not this issue)

  • Join with an importance signal (Cloudflare Web Analytics page views, or GSC if a property exists) to complete the Importance × Quality triage
  • Feed tooShort/stale/orphan flags into audit:docs CI severities once thresholds are tuned

Acceptance criteria

  • npm run audit:inventory runs against a sibling react_on_rails checkout and produces the JSON + markdown report; unit tests pass via node --test.

🤖 Generated with Claude Code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading scripts/audit-docs.mjs and scripts/sync-docs.mjs for the reporting and repository-resolution conventions, then inspect prototypes/docusaurus/sidebars.ts and the docs tree. Implement the inventory and pure-helper tests, and run npm run audit:inventory plus node --test to verify the JSON dataset, markdown summary, flags, and acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, node.js
Domain
documentation, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.