codemap
- Repo stars 22
- License MIT
- Author updated Live
- Author repo archflow
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @AZidan · MIT
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python >=3.10
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: codemap
description: Navigate codebases efficiently using structural indexes. Use when finding symbol definitions (cl…
category: other
runtime: Python
---
# codemap output preview
## PART A: Task fit
- Use case: 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..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “When to Use This Skill / Quick Reference / Workflow: Finding Code” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “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.”.
- **02** When the source has headings, the agent prioritizes “When to Use This Skill / Quick Reference / Workflow: Finding Code” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “When to Use This Skill / Quick Reference / Workflow: Finding Code”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: codemap
description: Navigate codebases efficiently using structural indexes. Use when finding symbol definitions (cl…
category: other
source: AZidan/archflow
---
# codemap
## When to use
- Navigate codebases efficiently using structural indexes. Use when finding symbol definitions (classes, functions, meth…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “When to Use This Skill / Quick Reference / Workflow: Finding Code” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "codemap" {
input -> user goal + target files + boundaries + acceptance criteria
context -> When to Use This Skill / Quick Reference / Workflow: Finding Code
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} 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
# 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
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
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:
cat .codemap/src/services/.codemap.json
Validation
Before trusting cached line numbers (especially after context compaction):
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
# Install codemap from GitHub (NOT from PyPI - there's a different package there)
pip install git+https://github.com/AZidan/codemap.git
# 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:
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:
pkill -f "codemap watch"
Best Practices
- Search before scanning: Always try
codemap findbefore grep/glob - Use line ranges: Read specific line ranges instead of full files
- Check freshness: Use
codemap validatebefore trusting cached line numbers - Explore structure first: Use
codemap showto understand file layout before diving in
Example Session
Task: "Fix the authentication bug in the login handler"
# 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
Decide Fit First
Design Intent
How To Use It
Boundaries And Review