Przejdź do treści
Biblioteka skilli
Programowanie · Research

codemap

/codemap

Pozwala nawigować po bazach kodu przez indeksy strukturalne: znajduje definicje klas, funkcji i metod oraz kod po nazwie, ograniczając liczbę tokenów przez czytanie wybranych linii.

Repozytorium
archflow ↗
Licencja
MIT
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pozwala nawigować po bazach kodu przez indeksy strukturalne: znajduje definicje klas, funkcji i metod oraz kod po nazwie, ograniczając liczbę tokenów przez czytanie wybranych linii.

Oryginalny opis (EN)

Navigate codebases efficiently using structural indexes. Use when finding symbol definitions (classes, functions, methods), exploring file structure, or locating code by name. Reduces token consumption by 60-80% through targeted line-range reads instead of full file scans.

Jak działa

  1. When to Use This Skill
  2. Quick Reference
  3. Workflow: Finding Code
  4. Symbol Types
  5. Index Structure
  6. Direct JSON Access
  7. Validation
  8. Setup (If Not Initialized)
  9. Best Practices
  10. Example Session
Sekcje z nagłówków SKILL.md, w oryginale · 179 linii, 657 słów
Podgląd SKILL.md
---
name: codemap
description: Navigate codebases efficiently using structural indexes. Use when finding symbol definitions (classes, functions, methods), exploring file structure, or locating code by name. Reduces token consumption by 60-80% through targeted line-range reads instead of full file scans.
allowed-tools: Read, Bash, Glob, Grep
user-invocable: true
---

# CodeMap - Codebase Structural Index

Navigate codebases efficiently using pre-built structural indexes stored in `.codemap/` directories.

## When to Use This Skill

**USE CodeMap when:**
- Finding where a class, function, method, or type is defined
- Understanding a file's structure before reading it
- Searching for symbols by name
- Reducing token usage during codebase exploration

**READ full files when:**
- Understanding implementation details
- Making edits to code
- The symbol isn't in the index (new/untracked file)

## Quick Reference

```bash
# Find a symbol by name (case-insensitive)
codemap find "SymbolName"

# Filter by type
codemap find "handle" --type method
codemap find "User" --type class
codemap find "Config" --type interface

# Show file structure with all symbols
codemap show path/to/file.ts

# Check if index is up-to-date
codemap validate

# View index statistics
codemap stats
```

## Workflow: Finding Code

### Step 1: Find Symbol Location
```bash
codemap find "UserService"
```
Output:
```
src/services/user.ts:15-189 [class] UserService
  (config: Config)
```

### Step 2: Read Only Relevant Lines
Instead of reading the entire file, read just lines 15-189:
```
Read src/services/user.ts lines 15-189
```

### Step 3: Explore Nested Symbols
```bash
codemap show src/services/user.ts
```
Output:
```
File: src/services/user.ts (hash: a3f2b8c1)
Lines: 542
Language: typescript

Symbols:
- UserService [class] L15-189
  - constructor [method] L20-35
  - getUser [method] L37-98
    (userId: string) : Promise<User>
  - createUser [async_method] L100-145
    (data: CreateUserDto) : Promise<User>
```

## Symbol Types

| Type | Description |
|------|-------------|
| `class` | Class declaration |
| `function` | Function declaration |
| `method` | Class method |
| `async_function` | Async function |
| `async_method` | Async class method |
| `interface` | TypeScript interface |
| `type` | TypeScript type alias |
| `enum` | Enum declaration |

## Index Structure

The `.codemap/` directory mirrors the project structure:
```
.codemap/
├── .codemap.json              # Root manifest
├── _root.codemap.json         # Files in project root
├── src/
│   ├── .codemap.json          # Files in src/
│   └── services/
│       └── .codemap.json      # Files in src/services/
```

## Direct JSON Access

For programmatic access, read the JSON files directly:
```bash
cat .codemap/src/services/.codemap.json
```

## Validation

Before trusting cached line numbers (especially after context compaction):
```bash
codemap validate path/to/file.ts
```
- "up to date": Line ranges are valid
- "stale": File changed, re-read or run `codemap update`

## Setup (If Not Initialized)

If a project doesn't have a `.codemap/` directory:

### Prerequisites
- Python 3.10+ and pip must be installed
- Verify with: `python3 --version && pip --version`

### Installation
```bash
# Install codemap from GitHub (NOT from PyPI - there's a different package there)
# Pinned to the v1.3.1 release on purpose — see SECURITY.md. Never use a branch here.
pip install "git+https://github.com/AZidan/codemap.git@v1.3.1"

# Initialize index
codemap init .
```

**IMPORTANT**: Do NOT use `pip install codemap` - that installs a different package from PyPI. Always use the GitHub URL above.

### Start Watch Mode (Recommended)
Start watch mode in the background to keep the index automatically updated:
```bash
codemap watch . &
```

This runs in the background and updates the index whenever files change. No need to manually run `codemap update`.

To stop watch mode later:
```bash
pkill -f "codemap watch"
```

## Best Practices

1. **Search before scanning**: Always try `codemap find` before grep/glob
2. **Use line ranges**: Read specific line ranges instead of full files
3. **Check freshness**: Use `codemap validate` before trusting cached line numbers
4. **Explore structure first**: Use `codemap show` to understand file layout before diving in

## Example Session

Task: "Fix the authentication bug in the login handler"

```bash
# 1. Find relevant symbols
codemap find "login"
# → src/auth/handlers.ts:45-92 [function] handleLogin

# 2. Check file structure
codemap show src/auth/handlers.ts
# Shows handleLogin and related functions with line ranges

# 3. Read only the relevant function (lines 45-92)
# ... make your fix ...

# 4. If you need related code, find it
codemap find "validateToken"
# → src/auth/utils.ts:12-38 [function] validateToken
```

Wersje

RepozytoriumWynikLicencja
Ta strona · AZidan/archflow100MIT
jordancoin/codemap100MIT
alvinunreal/oh-my-opencode-slim100MIT
jordancoin/codemap100MIT
ils15/copilot-global-config100MIT
azidan/codemap100MIT
ialameh/sift-coder100MIT
jellydn/my-ai-tools96MIT
QDinvest/Code-Map-QD96MIT

Migawka bazy z 13.11.2026 · wersja paczki 15af954f7e98 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100codemap-export
    Eksportuje mapę kodu (codemap) jako JSON do dalszego przetwarzania przez inne narzędzia, z tymi samymi danymi co polecenie /codemap.
  • 90rc-codemap
    Buduje i odświeża pliki codemap.md w każdym katalogu jako tanią mapę struktury przed eksploracją dużego repozytorium.
  • 100code-map
    Buduje lub odpytuje mapę symboli i grafu wywołań projektu przez LSP: definicje, wywołujący i wywoływani, zasięg skutków zmiany, zapis w katalogu .codemap/.
  • 95codebase-search
    Przeszukuje duże bazy kodu i pomaga w nawigacji: wzorce kodu, śledzenie wywołań funkcji, struktura kodu i lokalizowanie błędów przez wyszukiwanie semantyczne, grep i analizę AST.
  • 100codemap-refresh
    Odświeża mapy kodu nieaktualne po zmianach, regenerując tylko przestarzałe pliki i zachowując ręczne poprawki.
  • 90explore
    Systematycznie bada bazę kodu narzędziami codemap, śledzi zależności i pomaga wejść w nowy obszar projektu.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.