$npx -y skills add NeoLabHQ/context-engineering-kit --skill setup-codemap-cliGuide for setup Codemap CLI for intelligent codebase visualization and navigation
| 1 | User Input: |
| 2 | |
| 3 | ```text |
| 4 | $ARGUMENTS |
| 5 | ``` |
| 6 | |
| 7 | # Guide for setup Codemap CLI |
| 8 | |
| 9 | ## 1. Determine setup context |
| 10 | |
| 11 | Ask the user where they want to store the configuration: |
| 12 | |
| 13 | **Options:** |
| 14 | |
| 15 | 1. **Project level (shared via git)** - Configuration tracked in version control, shared with team |
| 16 | - CLAUDE.md updates go to: `./CLAUDE.md` |
| 17 | - Hook settings go to: `./.claude/settings.json` |
| 18 | |
| 19 | 2. **Project level (personal preferences)** - Configuration stays local, not tracked in git |
| 20 | - CLAUDE.md updates go to: `./CLAUDE.local.md` |
| 21 | - Hook settings go to: `./.claude/settings.local.json` |
| 22 | - Verify these files are listed in `.gitignore`, add them if not |
| 23 | |
| 24 | 3. **User level (global)** - Configuration applies to all projects for this user |
| 25 | - CLAUDE.md updates go to: `~/.claude/CLAUDE.md` |
| 26 | - Hook settings go to: `~/.claude/settings.json` |
| 27 | |
| 28 | Store the user's choice and use the appropriate paths in subsequent steps. |
| 29 | |
| 30 | ## 2. Check if Codemap is already installed |
| 31 | |
| 32 | Check whether codemap is installed by running `codemap -help`. |
| 33 | |
| 34 | If not installed, proceed with setup. |
| 35 | |
| 36 | ## 3. Load Codemap documentation |
| 37 | |
| 38 | Read the following documentation to understand Codemap's capabilities: |
| 39 | |
| 40 | - Load <https://raw.githubusercontent.com/JordanCoin/codemap/refs/heads/main/README.md> to understand what Codemap is and its capabilities |
| 41 | |
| 42 | ## 4. Guide user through installation |
| 43 | |
| 44 | ### macOS/Linux (Homebrew) |
| 45 | |
| 46 | ```bash |
| 47 | brew tap JordanCoin/tap && brew install codemap |
| 48 | ``` |
| 49 | |
| 50 | ### Windows (Scoop) |
| 51 | |
| 52 | ```bash |
| 53 | scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap |
| 54 | scoop install codemap |
| 55 | ``` |
| 56 | |
| 57 | ## 5. Verify installation |
| 58 | |
| 59 | After installation, verify codemap works: |
| 60 | |
| 61 | ```bash |
| 62 | codemap . |
| 63 | ``` |
| 64 | |
| 65 | ## 6. Update CLAUDE.md file |
| 66 | |
| 67 | Use the path determined in step 1. Once Codemap is successfully installed, update the appropriate CLAUDE.md file with the following content: |
| 68 | |
| 69 | ```markdown |
| 70 | ## Use Codemap CLI for Codebase Navigation |
| 71 | |
| 72 | Codemap CLI is available for intelligent codebase visualization and navigation. |
| 73 | |
| 74 | **Required Usage** - You MUST use `codemap --diff --ref master` to research changes different from default branch, and `git diff` + `git status` to research current working state. |
| 75 | |
| 76 | ### Quick Start |
| 77 | |
| 78 | ```bash |
| 79 | codemap . # Project tree |
| 80 | codemap --only swift . # Just Swift files |
| 81 | codemap --exclude .xcassets,Fonts,.png . # Hide assets |
| 82 | codemap --depth 2 . # Limit depth |
| 83 | codemap --diff # What changed vs main |
| 84 | codemap --deps . # Dependency flow |
| 85 | ``` |
| 86 | |
| 87 | ### Options |
| 88 | |
| 89 | | Flag | Description | |
| 90 | |------|-------------| |
| 91 | | `--depth, -d <n>` | Limit tree depth (0 = unlimited) | |
| 92 | | `--only <exts>` | Only show files with these extensions | |
| 93 | | `--exclude <patterns>` | Exclude files matching patterns | |
| 94 | | `--diff` | Show files changed vs main branch | |
| 95 | | `--ref <branch>` | Branch to compare against (with --diff) | |
| 96 | | `--deps` | Dependency flow mode | |
| 97 | | `--importers <file>` | Check who imports a file | |
| 98 | | `--skyline` | City skyline visualization | |
| 99 | | `--json` | Output JSON | |
| 100 | |
| 101 | **Smart pattern matching** - no quotes needed: |
| 102 | - `.png` - any `.png` file |
| 103 | - `Fonts` - any `/Fonts/` directory |
| 104 | - `*Test*` - glob pattern |
| 105 | |
| 106 | ### Diff Mode |
| 107 | |
| 108 | See what you're working on: |
| 109 | |
| 110 | ```bash |
| 111 | codemap --diff |
| 112 | codemap --diff --ref develop |
| 113 | ``` |
| 114 | |
| 115 | ``` |
| 116 | |
| 117 | if the default branch is not `main`, but instead `master` (or something else) update content accordingly: |
| 118 | - use `codemap --diff --ref master` instead of regular `codemap --diff` |
| 119 | |
| 120 | |
| 121 | ## 7. Update .gitignore file |
| 122 | |
| 123 | Update .gitignore file to include `.codemap/` directory: |
| 124 | |
| 125 | ```text |
| 126 | .codemap/ |
| 127 | ``` |
| 128 | |
| 129 | ## 8. Test Codemap |
| 130 | |
| 131 | Run a quick test to verify everything works: |
| 132 | |
| 133 | ```bash |
| 134 | codemap . |
| 135 | codemap --diff |
| 136 | ``` |
| 137 | |
| 138 | ## 9. Add hooks to settings file |
| 139 | |
| 140 | - Use the settings path determined in step 1. Create the settings file if it doesn't exist and add the following content: |
| 141 | |
| 142 | ```json |
| 143 | { |
| 144 | "hooks": { |
| 145 | "session-start": "codemap hook session-start && echo 'git diff:' && git diff --stat && echo 'git status:' && git status" |
| 146 | } |
| 147 | } |
| 148 | ``` |
| 149 | |
| 150 | if default branch is not `main`, but instead `master` (or something else) update content accordingly: |
| 151 | - use `codemap hook session-start --ref=master` instead of regular `codemap hook session-start` |
| 152 | - For rest of commands also add `--ref=master` flag. |
| 153 | |
| 154 | - Ask user whether he want to add any other hooks and provide list of options with descriptions. Add hooks that he asks for. |
| 155 | |
| 156 | ### Available Hooks |
| 157 | |
| 158 | | Command | Trigger | Description | |
| 159 | |---------|---------|-------------| |
| 160 | | `codemap hook session-start` | SessionStart | Full tree, hubs, branch diff, last session context | |
| 161 | | `codemap hook pre-edit` | PreToolUse (Edit\|Write) | Who imports file + what hubs it imports | |
| 162 | | `codemap hook post-edit` | PostToolUse (Edit\|Write) | Impact of changes (same as pre-edit) | |
| 163 | | `codemap hook prompt-submit` | UserPromptSubmit | Hub context for mention |