|
| 1 | +--- |
| 2 | +name: update-modules-doc |
| 3 | +description: Scan all source modules and regenerate MODULES.md with up-to-date exports and descriptions |
| 4 | +--- |
| 5 | + |
| 6 | +## What I do |
| 7 | + |
| 8 | +Regenerate the `MODULES.md` file at the project root so it accurately reflects every module in the package. |
| 9 | + |
| 10 | +## Steps |
| 11 | + |
| 12 | +1. **Scan entry points** — Find all `.ts` files matching `src/*/*.ts` (excluding `src/types/`). Each file is a module entry point. |
| 13 | +2. **Read each file** — For every entry point, identify all named exports and their types/signatures. Read JSDoc comments to extract descriptions. |
| 14 | +3. **Regenerate `MODULES.md`** — Overwrite the file using the exact format below. Modules should be listed in alphabetical order by their import path. |
| 15 | + |
| 16 | +## Output format |
| 17 | + |
| 18 | +The file must follow this exact structure: |
| 19 | + |
| 20 | +```markdown |
| 21 | +# Modules |
| 22 | + |
| 23 | +All modules are importable via subpath exports from `@dailydotdev/node-common`. |
| 24 | + |
| 25 | +## <directory>/<filename> |
| 26 | + |
| 27 | +**Import:** `@dailydotdev/node-common/<directory>/<filename>` |
| 28 | + |
| 29 | +<Brief description of what this module provides, derived from JSDoc or file contents.> |
| 30 | + |
| 31 | +| Export | Type | Description | |
| 32 | +| -------------- | ------------------ | ------------------------------------ | |
| 33 | +| `<exportName>` | `<type signature>` | <description from JSDoc or inferred> | |
| 34 | +``` |
| 35 | + |
| 36 | +Repeat the `## <directory>/<filename>` section for each module. |
| 37 | + |
| 38 | +## Rules |
| 39 | + |
| 40 | +- The module heading uses the path relative to `src/` without the `.ts` extension (e.g., `utils/env`, `logger`). |
| 41 | +- If the filename is `index`, omit it from the heading and import path (e.g., `src/logger/index.ts` becomes `logger`, not `logger/index`). |
| 42 | +- The import path is `@dailydotdev/node-common/<directory>/<filename>` (e.g., `@dailydotdev/node-common/utils/env`, `@dailydotdev/node-common/logger`). |
| 43 | +- If a module has behavioral notes (e.g., environment-dependent behavior), include a bullet list below the description and above the exports table. |
| 44 | +- Only include files that have at least one export. Skip empty files or files with no exports. |
| 45 | +- Do not include files under `src/types/` — those are ambient type declarations, not importable modules. |
| 46 | +- Always sort modules alphabetically by import path. |
| 47 | +- Always sort exports alphabetically within each module. |
| 48 | + |
| 49 | +## When to use me |
| 50 | + |
| 51 | +Use this skill whenever a new module is added, an existing module's exports change, or a module is removed. This keeps `MODULES.md` in sync with the source code. |
0 commit comments