Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides chunking strategies for RAG systems. Generates chunk size recommendations (256-1024 tokens), overlap percentages (10-20%), and semantic boundary detection methods. Validates semantic coherence and evaluates retrieval precision/recall metrics. Use when building retrieval-augmented generation systems, vector databases, or processing large documents.
.claude/skills/giuseppe-trisciuoglio-chunking-strategy/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 53% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 28% | 0% |
Provides chunking strategies for RAG systems, vector databases, and document processing. Recommends chunk sizes, overlap percentages, and boundary detection methods; validates semantic coherence; evaluates retrieval metrics.
Use when building or optimizing RAG systems, vector search pipelines, document chunking workflows, or performance-tuning existing systems with poor retrieval quality.
Select based on document type and use case:
Reference: references/strategies.md.
evaluate_chunks.py --coherence (see below)Reference: references/implementation.md.
Run validation commands to assess chunk quality:
bash# Check semantic coherence (requires sentence-transformers) python -c " from sentence_transformers import SentenceTransformer model = SentenceTransformer('all-MiniLM-L6-v2') chunks = [...] # your chunks embeddings = model.encode(chunks) similarity = (embeddings @ embeddings.T).mean() print(f'Cohesion: {similarity:.3f}') # target: 0.3-0.7 " # Measure retrieval precision python -c " relevant = sum(1 for c in retrieved if c in relevant_chunks) precision = relevant / len(retrieved) print(f'Precision: {precision:.2f}') # target: >= 0.7 " # Check chunk size distribution python -c " import numpy as np sizes = [len(c.split()) for c in chunks] print(f'Mean: {np.mean(sizes):.0f}, Std: {np.std(sizes):.0f}') print(f'Min: {min(sizes)}, Max: {max(sizes)}') "
Reference: references/evaluation.md.
pythonfrom langchain.text_splitter import RecursiveCharacterTextSplitter splitter = RecursiveCharacterTextSplitter( chunk_size=256, chunk_overlap=25, length_function=len ) chunks = splitter.split_documents(documents)
pythonimport ast def chunk_python_code(code): tree = ast.parse(code) chunks = [] for node in ast.walk(tree): if isinstance(node, (ast.FunctionDef, ast.ClassDef)): chunks.append(ast.get_source_segment(code, node)) return chunks
pythondef semantic_chunk(text, similarity_threshold=0.8): sentences = split_into_sentences(text) embeddings = generate_embeddings(sentences) chunks, current = [], [sentences[0]] for i in range(1, len(sentences)): sim = cosine_similarity(embeddings[i-1], embeddings[i]) if sim < similarity_threshold: chunks.append(" ".join(current)) current = [sentences[i]] else: current.append(sentences[i]) chunks.append(" ".join(current)) return chunks
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 18,965 | 15,890 | -16% | 1 | 1 | 0% | 3,051 | 4,253 | +39% | 0 | 0 | — |
case-02 | fail→pass | 17,197 | 19,734 | +15% | 1 | 1 | 0% | 3,081 | 5,346 | +74% | 0 | 0 | — |
case-03 | fail→pass | 14,601 | 14,424 | -1% | 1 | 1 | 0% | 2,585 | 3,943 | +53% | 0 | 0 | — |
case-04 | fail→pass | 13,349 | 14,012 | +5% | 1 | 1 | 0% | 2,235 | 3,283 | +47% | 0 | 0 | — |
case-05 | pass→pass | 11,598 | 8,492 | -27% | 1 | 1 | 0% | 1,861 | 3,010 | +62% | 0 | 0 | — |
case-06 | pass→pass | 16,297 | 14,051 | -14% | 1 | 1 | 0% | 2,573 | 4,104 | +60% | 0 | 0 | — |
case-07 | pass→pass | 16,819 | 12,457 | -26% | 1 | 1 | 0% | 2,594 | 3,589 | +38% | 0 | 0 | — |
case-08 | fail→pass | 16,138 | 10,621 | -34% | 1 | 1 | 0% | 2,525 | 3,221 | +28% | 0 | 0 | — |
case-09 | pass→pass | 14,436 | 12,694 | -12% | 1 | 1 | 0% | 2,217 | 3,594 | +62% | 0 | 0 | — |
case-10 | pass→pass | 24,140 | 10,854 | -55% | 1 | 1 | 0% | 2,441 | 3,287 | +35% | 0 | 0 | — |
case-11 | pass→pass | 10,108 | 11,206 | +11% | 1 | 1 | 0% | 1,490 | 3,330 | +123% | 0 | 0 | — |
case-12 | fail→pass | 9,758 | 5,754 | -41% | 1 | 1 | 0% | 1,553 | 2,519 | +62% | 0 | 0 | — |
case-13 | pass→pass | 13,864 | 9,609 | -31% | 1 | 1 | 0% | 2,150 | 2,999 | +39% | 0 | 0 | — |
case-14 | pass→pass | 15,914 | 11,104 | -30% | 1 | 1 | 0% | 2,399 | 3,211 | +34% | 0 | 0 | — |
case-15 | fail→fail | 14,364 | 10,972 | -24% | 1 | 1 | 0% | 2,287 | 3,321 | +45% | 0 | 0 | — |
case-16 | pass→pass | 5,956 | 5,235 | -12% | 1 | 1 | 0% | 883 | 2,416 | +174% | 0 | 0 | — |
case-17 | pass→pass | 32,677 | 17,831 | -45% | 1 | 1 | 0% | 2,778 | 4,276 | +54% | 0 | 0 | — |
case-18 | pass→pass | 10,780 | 9,360 | -13% | 1 | 1 | 0% | 1,679 | 2,998 | +79% | 0 | 0 | — |
case-19 | pass→pass | 13,274 | 11,416 | -14% | 1 | 1 | 0% | 2,245 | 3,493 | +56% | 0 | 0 | — |
case-20 | pass→pass | 8,427 | 4,236 | -50% | 1 | 1 | 0% | 1,511 | 2,249 | +49% | 0 | 0 | — |
case-21 | fail→fail | 18,715 | 19,956 | +7% | 1 | 1 | 0% | 3,040 | 5,072 | +67% | 0 | 0 | — |
case-22 | fail→fail | 20,439 | 14,207 | -30% | 1 | 1 | 0% | 2,531 | 3,953 | +56% | 0 | 0 | — |
case-23 | fail→fail | 14,882 | 12,214 | -18% | 1 | 1 | 0% | 2,483 | 3,537 | +42% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +26 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.