chunking-strategy-advisor
Skill3 starsChanged 4 months agoMITView on GitHub
Recommend document chunking strategy: chunk size, overlap, boundaries, and metadata preservation for optimal retrieval quality. Use when working on RAG pipelines, chunking, embeddings, retrieval, or hybrid search.
In this repository59 other files it gives its agents.
- agent-memory-designerSkill
- ai-cost-optimizerSkill
- ai-evaluation-builderSkill
- ai-latency-optimizerSkill
- ai-solution-architectSkill
- ai-workflow-builderSkill
- context-engineeringSkill
- human-in-the-loop-designerSkill
- multi-agent-plannerSkill
- prompt-engineerSkill
- prompt-optimizerSkill
- prompt-reviewerSkill
- adr-generatorSkill
- api-designerSkill
- architecture-reviewSkill
- component-diagram-builderSkill
- container-diagram-builderSkill
- data-flow-analyzerSkill
- integration-plannerSkill
- observability-plannerSkill
- scalability-advisorSkill
- solution-architectureSkill
- system-context-builderSkill
- experiment-designerSkill
- go-to-market-plannerSkill
- pricing-strategy-advisorSkill
- mcp-best-practicesSkill
- mcp-client-generatorSkill
- mcp-security-reviewSkill
- mcp-server-generatorSkill
- mcp-tool-generatorSkill
- acceptance-criteria-generatorSkill
- analytics-instrumentation-plannerSkill
- competitive-analysisSkill
- epic-generatorSkill
- feature-prioritizationSkill
- idea-validatorSkill
- north-star-metric-advisorSkill
- okr-builderSkill
- persona-generatorSkill
- prd-generatorSkill
- problem-statement-builderSkill
- product-discovery-assistantSkill
- product-vision-builderSkill
- sprint-plannerSkill
- story-mappingSkill
- user-story-generatorSkill
- value-proposition-designerSkill
- embedding-strategy-advisorSkill
- hybrid-search-advisorSkill
- knowledge-ingestion-plannerSkill
- rag-architecture-designerSkill
- retriever-optimizerSkill
- ai-governance-advisorSkill
- ai-threat-modelingSkill
- guardrails-builderSkill
- owasp-llm-reviewerSkill
- prompt-injection-detectorSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Input: Document types, sample content (optional), query patterns, RAG architecture
- Distinctive: line 53
Do not split mid-sentence
- Distinctive: line 104
Start 256–512 tokens for prose.
- Distinctive: line 106
Use header-aware splitting for documentation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chunking Strategy Advisor
Purpose
Recommend document chunking strategy: chunk size, overlap, boundaries, and metadata preservation for optimal retrieval quality.
Input: Document types, sample content (optional), query patterns, RAG architecture
Output: Chunking specification with parameters, boundary rules, and eval recommendations
Examples: See examples.md for worked input/output.
Workflow
Step 1: Analyze document characteristics
| Doc type | Structure | Avg length | Update frequency |
Types: prose, technical docs, code, tables, FAQs, legal, chat logs.
Step 2: Select chunking method
| Method | Best for |
| Fixed-size | Uniform prose |
| Semantic | Variable structure, paragraphs |
| Recursive | Hierarchical docs (headers) |
| Document-specific | Code (functions), tables (rows) |
| Agentic | Complex mixed content |
Step 3: Define parameters
| Parameter | Value | Rationale |
| Chunk size (tokens) | ||
| Overlap (tokens) | ||
| Min chunk size | ||
| Max chunk size |
Step 4: Define boundary rules
- Respect section headers / code blocks / table rows
- Do not split mid-sentence
- Preserve metadata: source, page, section title
Step 5: Recommend eval approach
- Sample 20 chunks for manual review
- Retrieval recall@k on golden queries
- A/B chunk sizes if uncertain
Step 6: Validate
Run Validation checklist.
Decision Rules
| Condition | Action |
| Mixed document types | Use per-type chunking strategies |
| Code documents | Chunk by function/class, not token count |
| Tables | Chunk by row groups or whole table with summary |
| Very short docs (< chunk size) | Keep whole document as one chunk |
| No sample content | Use conservative defaults; mark for eval tuning |
Validation
- Document types analyzed
- Chunking method selected per type with rationale
- Size and overlap parameters specified
- Boundary rules documented
- Metadata preservation defined
- Eval approach recommended
- Parameters tied to embedding model context if known
Anti-patterns
- One size fits all — same chunk size for code and prose.
- Zero overlap — losing context at boundaries.
- Mid-sentence splits — hurting semantic coherence.
- No metadata — chunks without source attribution.
- Tiny chunks — fragments without context.
Best Practices
- Start 256–512 tokens for prose; tune with eval.
- 10–20% overlap for continuity.
- Use header-aware splitting for documentation.
- Store parent document ID and section path in metadata.
- Re-chunk when switching embedding models.
Output Structure
# Chunking Strategy: [Corpus Name]
## Document Analysis
| Type | Count | Method |
|------|-------|--------|
## Parameters
| Parameter | Value | Rationale |
|-----------|-------|-----------|
## Boundary Rules
1. [Rule]
## Metadata Schema
| Field | Source |
|-------|--------|
## Eval Plan
[Approach]
## Tuning Notes
[When to revisit]Next Skills
| Outcome | Recommended Skill |
| Select embeddings | rag/embedding-strategy-advisor |
| Optimize retrieval | rag/retriever-optimizer |
| RAG architecture | rag/rag-architecture-designer |
| Hybrid search | rag/hybrid-search-advisor |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

