Back to list
atiati82

route-auditor-v1

by atiati82

0🍴 0📅 Jan 25, 2026

SKILL.md


name: route-auditor-v1 description: Prevent 404s by validating all routes exist and are accessible

Route Auditor Skill v1.0

Purpose: Ensure every route has a valid page and every page has a valid route.

1) Non-Negotiables (Policy)

Routing Rules

  • All routes MUST be defined in client/src/App.tsx
  • Route path MUST match page filename (without .tsx)
  • All pages in client/src/pages/ MUST have a corresponding route
  • Lazy loading REQUIRED for all page imports

Forbidden Patterns

  • ❌ Dead links (href to non-existent routes)
  • ❌ Orphan pages (pages without routes)
  • ❌ Duplicate routes (same path defined twice)
  • ❌ Missing lazy imports

2) Inputs & Outputs

Inputs (When to Run)

  • After creating new pages
  • After modifying App.tsx
  • Before deployment
  • As part of PR review

Output Contract

{
  "status": "PASS" | "FAIL",
  "totalRoutes": number,
  "totalPages": number,
  "issues": {
    "orphanPages": ["string"],
    "missingRoutes": ["string"],
    "deadLinks": [
      {
        "source": "string",
        "href": "string"
      }
    ],
    "duplicateRoutes": ["string"]
  }
}

3) Quality Gates

Route Integrity Check

Run before any deployment:

npm run guard:routes
npm run guard:route-integrity

Comprehensive Audit

tsx scripts/audit-routes.ts
npm run test:e2e -- tests/dead-link-crawler.spec.ts

Validation Scripts

Primary Scripts

ScriptPurpose
scripts/guard-routes.tsQuick route validation
scripts/guard-route-order.tsCheck route ordering
scripts/route-integrity-check.tsFull integrity audit
scripts/audit-routes.tsComprehensive audit

Sitemap Validation

npm run guard:sitemap

Validates against ANDARA_SITEMAP_V1_3.md


Common Issues & Fixes

Orphan Page (page exists, no route)

// In App.tsx, add:
const NewPage = lazy(() => import('./pages/new-page'));
// In routes:
<Route path="/new-page" component={NewPage} />
  1. Find the source file containing the bad link
  2. Either create the missing page/route, OR
  3. Update the link to point to existing route

Duplicate Route

  1. Search App.tsx for duplicate path definitions
  2. Remove the duplicate
  3. Ensure only one component handles the route

Integration with CI/CD

These guards run automatically:

{
  "prebuild": "npm run guard:all",
  "guard:routes": "tsx scripts/guard-route-order.ts",
  "guard:sitemap": "tsx scripts/guard-routes.ts"
}

Build FAILS if any route issues detected.

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon