# Route Scanning

Scan Express.js source files to discover all API route definitions.

- Repository: https://github.com/huangjia2019/claude-code-engineering (1147 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-07-23
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add huangjia2019/claude-code-engineering --skill route-scanning -g -a claude-code -y`
Codex: `npx skills add huangjia2019/claude-code-engineering --skill route-scanning -g -a codex -y`
Cursor: `npx skills add huangjia2019/claude-code-engineering --skill route-scanning -g -a cursor -y`
Gemini CLI: `npx skills add huangjia2019/claude-code-engineering --skill route-scanning -g -a gemini-cli -y`

## Description

Scan Express.js source files to discover all API route definitions.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Route Scanning Skill

Discover all API route definitions in Express.js source files.

## Process

### Step 1: Run Route Scanner

Execute the scanning script:

```bash
python3 scripts/scan-routes.py <source_directory>
```

The script outputs a structured route list with method, path, file, and line number.

### Step 2: Enrich Route Data

For each discovered route, also identify:
- Middleware applied (auth, validation, etc.)
- Whether it's a standard route or chained route (`router.route()`)

### Output Format

Return a JSON-compatible route manifest:

```json
[
  {
    "method": "GET",
    "path": "/api/products",
    "file": "src/routes/products.js",
    "line": 8,
    "middleware": ["requireAuth"],
    "type": "standard"
  }
]
```

This manifest will be consumed by the next pipeline stage (doc-writing).

