Skip to content
Back to skills

Update Code Index

ASecurity

Scan codebase exports and generate CODE_INDEX.md organized by capability. Check this index before writing new functions to prevent duplication (no more formatDate2 when formatDate exists).

  • 11 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
developmentjavascripttypescriptpythongojavabashreactnodeapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add brain-bootstrap/claude-code-brain-bootstrap --skill update-code-index --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Update Code Index?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Update Code Index
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/brain-bootstrap-update-code-index/badge)](https://www.skillsdirectory.com/skills/brain-bootstrap-update-code-index)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: update-code-index
description: Scan codebase exports and generate CODE_INDEX.md organized by capability. Check this index before writing new functions to prevent duplication (no more formatDate2 when formatDate exists).
---

# Update Code Index Skill

Scan source files for all exported functions, classes, hooks, and components. Generate `CODE_INDEX.md` as a "check before write" safety net.

> ⚠️ **Before writing any new function**, check `CODE_INDEX.md` for existing similar ones. Found a match? Use or extend it instead of creating a duplicate.

## Steps

### 1. Identify Source Directories
```bash
ls -d src/ lib/ app/ core/ 2>/dev/null || true
```

### 2. Scan for Exports

**TypeScript / JavaScript:**
```bash
grep -rn 'export function\|export const\|export class\|export default' \
  . --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' \
  --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build \
  --exclude-dir='.next' --exclude-dir=coverage 2>/dev/null | head -200
```

**Python:**
```bash
grep -rn '^def \|^async def \|^class ' \
  . --include='*.py' \
  --exclude-dir=__pycache__ --exclude-dir=.venv --exclude-dir=venv \
  2>/dev/null | head -200
```

### 3. Categorize by Capability

| Category | Match on name or description |
|----------|------------------------------|
| Date / Time | date, time, format, parse, duration, timestamp |
| Validation | validate, is*, check, verify, sanitize |
| API clients | fetch, get, post, put, delete, request, client |
| Auth | auth, login, logout, session, token, permission |
| Database | db, query, find, create, update, delete, repo |
| React Hooks | `use*` exports in `.tsx` files |
| Components | PascalCase exports in `.tsx` / `.jsx` |
| Utilities | helper, util, common (catch-all) |

### 4. Write CODE_INDEX.md

```markdown
# Code Index
*Auto-generated by /update-code-index — [TIMESTAMP]*
> Check this before writing new code. Find a match? Use or extend it instead.

## [Category]
- `functionName()` — src/path/to/file.ts:LINE — what it does in one line
```

### 5. Report Summary
- Total exports scanned (by language)
- ⚠️ Potential duplicates — same-purpose functions with different names in different files
- Functions/classes missing docstrings (warn, don't block)

Close with: "CODE_INDEX.md updated. I'll check it before writing any new code."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.