jmagly/aiwg/code-chunker
Claude Code and agent skill by jmagly/aiwg
- community
Checking that the SKILL.md file is still in the repository.
Map source file structure into navigable sections with line ranges and summaries for efficient agent navigation
Install
npx vskill@latest install jmagly/aiwg/code-chunkerSKILL.md
code-chunker
Analyze a source file's structure and produce a navigable map with logical sections, line ranges, and summaries for efficient agent navigation.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "map this file" → structural chunking for navigation
- "chunk for navigation" → file structure mapping
Purpose
Agents encounter large files they cannot immediately refactor — third-party code, generated code, legacy files awaiting decomposition. Without a structural map, agents must read the entire file to find relevant sections, wasting context window space.
The code-chunker produces a "table of contents" for source files, enabling agents to read only the sections they need. The doc-splitter does this for documentation; code-chunker does it for source code.
This skill complements /decompose-file — chunker maps files for navigation, decomposer splits them permanently.
Behavior
When triggered, this skill:
- Parse file structure:
- Detect language from file extension
- Identify top-level declarations (functions, classes, interfaces, types, constants)
- Group related declarations into logical sections
- Calculate line ranges for each section
- Generate section summaries:
- For each section, produce a one-line description of its purpose
- Count key elements (imports, exports, methods, functions)
- Note dependencies between sections
- Produce navigable map:
- Output structured map with section names, line ranges, and summaries
- Include quick-reference commands for reading specific sections
- Provide grep suggestions for common navigation needs
- Cache map (optional):
- Store generated map in
.aiwg/working/code-maps/for reuse during the session - Invalidate cache when file modification time changes
File Map Format
Arguments
| Argument | Required | Default | Description | |
|---|---|---|---|---|
<file-path> | Yes | — | File to map | |
--depth <level> | No | function | Granularity: function, class, block | |
--format <type> | No | map | Output: map, json, tree | |
--section <n> | No | — | Read a specific section immediately | |
--cache | No | true | Cache map for session reuse |
Depth Levels
Function (default)
Maps individual functions and methods:
Class
Maps at class/module level only:
Block
Maps at code block level (most granular):
Output Formats
Map (default)
Human-readable section listing with line ranges and summaries. See File Map Format above.
JSON
Tree
Language Detection
| Extension | Language | Parsing Strategy | |
|---|---|---|---|
.ts, .tsx | TypeScript | export, class, function, interface, type, const declarations | |
.js, .jsx, .mjs | JavaScript | export, class, function, const declarations | |
.py | Python | class, def, top-level assignments, decorators | |
.go | Go | func, type, var, const blocks | |
.rs | Rust | fn, struct, impl, mod, enum, trait | |
.java | Java | class, interface, enum, method declarations | |
| Other | Heuristic | Blank lines, comment blocks, indentation patterns |
Usage Examples
Basic File Map
Section Navigation
JSON for Agent Consumption
Auto-Trigger on Large File Read
When an agent attempts to read a file over 300 lines, the code-chunker can be invoked automatically to provide a map first:
Integration
This skill uses:
agent-friendly-coderule: Threshold for when to suggest chunkingrlm-context-managementrule: Aligns with Rule 2 (programmatic access over full-context loading)/decompose-fileskill: Chunker maps → decomposer splits permanently/codebase-healthcommand: Identifies files that benefit from chunking
Output Locations
- Cached maps:
.aiwg/working/code-maps/{filename}-map.json
References
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/rules/agent-friendly-code.md — Thresholds triggering chunker use
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/skills/decompose-file/SKILL.md — Permanent splitting
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/commands/codebase-health.md — File size scanning
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagentic/code/frameworks/sdlc-complete/skills/code-chunker/SKILL.md
Popularity
- Repository stars
- 96
- Repository forks
- 12
- Repository npm downloads, 7 days
- 2,424
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jmagly/aiwg/code-chunker)