Provides chunking strategies for RAG systems. An agent skill from giuseppe-trisciuoglio/developer-kit.

MITAuto-check: notesAI & LLM Engineering

Install Chunking Strategy

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill chunking-strategy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit chunking-strategy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-ai/skills/chunking-strategy .claude/skills/chunking-strategy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
chunking-strategy
GitHub stars
357
Token cost
~1.6k tokens
SKILL.md length
438 words
Files
9 (incl. references)
Skills in repo
115
Repo updated
First seen
Licence
MIT

At a glance

Provides chunking strategies for RAG systems. An agent skill from giuseppe-trisciuoglio/developer-kit.

  • Works in 5 steps: Fixed-Size Chunking (Level 1) → Recursive Character Chunking (Level 2) → Structure-Aware Chunking (Level 3) → …
  • Building retrieval-augmented generation systems
  • SKILL.md covers Overview, When to Use, Instructions and Examples, plus 3 more sections
  • Calls python

What it does

Chunking Strategy is an agent skill from giuseppe-trisciuoglio/developer-kit. 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.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/advanced-strategies.md`, `references/evaluation.md` and `references/implementation.md`).

It sits in AI & LLM Engineering, covering Retrieval-augmented generation and Vector databases. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Building retrieval-augmented generation systems
  • Vector databases
  • Processing large documents

Example prompts

  • “Use the chunking-strategy skill to provide chunking strategies for RAG systems. An agent skill from giuseppe-trisciuoglio/developer-kit”
  • “/chunking-strategy”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Bash

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Fixed-Size Chunking (Level 1)
  2. Recursive Character Chunking (Level 2)
  3. Structure-Aware Chunking (Level 3)
  4. Semantic Chunking (Level 4)
  5. Advanced Methods (Level 5)

What it can do on your machine

Read from SKILL.md and the folder at commit fe73fb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Chunking Strategy loads about 1.6k tokens when it runs, and up to ~64k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 438 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~64k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 438 words, ~1,646 tokens.

Download SKILL.mdSave it as .claude/skills/chunking-strategy/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
chunking-strategy
description
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.
allowed-tools
Read, Write, Bash

Chunking Strategy for RAG Systems

Overview

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.

When to Use

Use when building or optimizing RAG systems, vector search pipelines, document chunking workflows, or performance-tuning existing systems with poor retrieval quality.

Instructions

Choose Chunking Strategy

Select based on document type and use case:

  1. Fixed-Size Chunking (Level 1)

    • Use for simple documents without clear structure
    • Start with 512 tokens and 10-20% overlap
    • Adjust: 256 for factoid queries, 1024 for analytical
  2. Recursive Character Chunking (Level 2)

    • Use for documents with structural boundaries
    • Hierarchical separators: paragraphs → sentences → words
    • Customize for document types (HTML, Markdown, JSON)
  3. Structure-Aware Chunking (Level 3)

    • Use for structured content (Markdown, code, tables, PDFs)
    • Preserve semantic units: functions, sections, table blocks
    • Validate structure preservation post-split
  4. Semantic Chunking (Level 4)

    • Use for complex documents with thematic shifts
    • Embedding-based boundary detection with 0.8 similarity threshold
    • Buffer size: 3-5 sentences
  5. Advanced Methods (Level 5)

    • Late Chunking for long-context models
    • Contextual Retrieval for high-precision requirements
    • Monitor computational cost vs. retrieval gain

Reference: references/strategies.md.

Implement Chunking Pipeline
  1. Pre-process documents

    • Analyze structure, content types, information density
    • Identify multi-modal content (tables, images, code)
  2. Select parameters

    • Chunk size: embedding model context window / 4
    • Overlap: 10-20% for most cases
    • Strategy-specific settings
  3. Process and validate

    • Apply chunking strategy
    • Validate coherence: run evaluate_chunks.py --coherence (see below)
    • Test with representative documents
  4. Evaluate and iterate

    • Measure precision and recall
    • If precision < 0.7: reduce chunk_size by 25% and re-evaluate
    • If recall < 0.6: increase overlap by 10% and re-evaluate
    • Monitor latency and memory usage

Reference: references/implementation.md.

Show full SKILL.md (163 more words)Show less
Validate Chunk Quality

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.

Examples

Fixed-Size Chunking
python
from langchain.text_splitter import RecursiveCharacterTextSplitter

splitter = RecursiveCharacterTextSplitter(
    chunk_size=256,
    chunk_overlap=25,
    length_function=len
)
chunks = splitter.split_documents(documents)
Structure-Aware Code Chunking
python
import 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
Semantic Chunking
python
def 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

Best Practices

Core Principles
  • Balance context preservation with retrieval precision
  • Maintain semantic coherence within chunks
  • Optimize for embedding model context window constraints
Implementation
  • Start with fixed-size (512 tokens, 15% overlap)
  • Iterate based on document characteristics
  • Test with domain-specific documents before deployment
Pitfalls to Avoid
  • Over-chunking: context-poor small chunks
  • Under-chunking: missing information in oversized chunks
  • Ignoring semantic boundaries and document structure
  • One-size-fits-all for diverse content types

Constraints and Warnings

Resource Considerations
  • Semantic methods require significant compute resources
  • Late chunking needs long-context embedding models
  • Complex strategies increase processing latency
  • Monitor memory for large document batches
Quality Requirements
  • Validate semantic coherence post-processing
  • Test with representative documents before deployment
  • Ensure chunks maintain standalone meaning
  • Implement error handling for malformed content

References

© giuseppe-trisciuoglio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in plugins/developer-kit-ai/skills/chunking-strategy of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/advanced-strategies.md
  • references/evaluation.md
  • references/implementation.md
  • references/research.md
  • references/semantic-methods.md
  • references/strategies.md
  • references/tools.md
  • references/visualization-tools.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

Chunking Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Chunking Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Chunking Strategy this skillgiuseppe-trisciuoglio/developer-kit357—~1.6kAutomated safety check: NotesMIT
Chroma Vector DatabaseOrchestra-Research/AI-Research-SKILLs13k7 repos~2.3kAutomated safety check: PassMIT
Ms Agent Framework RAGshuyu-labs/WebCode278—~1.1kAutomated safety check: PassCustom licence
Convex Agentswaynesutton/builder-skills406—~2.2kAutomated safety check: PassApache-2.0
Pgvector Semantic Searchtimescale/pg-aiguide1.9k—~3.8kAutomated safety check: PassApache-2.0
Postgres Hybrid Text Searchtimescale/pg-aiguide1.9k—~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • Chroma Vector Database

    Orchestra-Research/AI-Research-SKILLs

    Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.

    13k GitHub starsUsed in 7 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Ms Agent Framework RAG

    shuyu-labs/WebCode

    Comprehensive guide for building Agentic RAG systems using Microsoft Agent Framework in C.

    278 GitHub stars~1.1k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Convex Agents

    waynesutton/builder-skills

    Builds AI agents on the Convex agent component: threads, messages, tools that call queries and mutations, streaming, RAG with vector search, and workflows for multi step jobs.

    406 GitHub stars~2.2k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check passed
  • Pgvector Semantic Search

    timescale/pg-aiguide

    A skill your agent uses for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.

    1.9k GitHub stars~3.8k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Postgres Hybrid Text Search

    timescale/pg-aiguide

    A skill your agent uses to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF).

    1.9k GitHub stars~3.1k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • RAG Implementation

    wshobson/agents

    Build retrieval-augmented generation systems: pick a vector database and embedding model, choose retrieval and reranking strategies, and start from a LangGraph pipeline.

    40k GitHub starsUsed in 9 repos~1.1k tokens
    AI & LLM EngineeringAuto-check passed

More from giuseppe-trisciuoglio/developer-kit

All 115 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    357 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    357 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    357 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    357 GitHub stars~3.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • AWS CLI Beast

    giuseppe-trisciuoglio/developer-kit

    Provides advanced AWS CLI patterns for managing EC2, Lambda, S3, DynamoDB, RDS, VPC, IAM, and CloudWatch.

    357 GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check: notes
  • PR Review Comments

    giuseppe-trisciuoglio/developer-kit

    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line.

    357 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check: notes

Questions about Chunking Strategy

What does Chunking Strategy do?

Provides chunking strategies for RAG systems. An agent skill from giuseppe-trisciuoglio/developer-kit. Chunking Strategy is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides chunking strategies for RAG systems.

When should I use Chunking Strategy?

Chunking Strategy fits situations like: building retrieval-augmented generation systems; vector databases; processing large documents.

How do I install Chunking Strategy in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill chunking-strategy -a claude-code`. Or copy the skill folder (plugins/developer-kit-ai/skills/chunking-strategy in giuseppe-trisciuoglio/developer-kit) into .claude/skills/chunking-strategy in your project. Claude Code loads it when a task matches its description.

How do I install Chunking Strategy in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill chunking-strategy -a codex`. Or copy the skill folder (plugins/developer-kit-ai/skills/chunking-strategy in giuseppe-trisciuoglio/developer-kit) into .agents/skills/chunking-strategy in your project. Codex loads it when a task matches its description.

Can I use Chunking Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add giuseppe-trisciuoglio/developer-kit --skill chunking-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/chunking-strategy, .gemini/skills/chunking-strategy, .github/skills/chunking-strategy and .opencode/skills/chunking-strategy in your project.

What does Chunking Strategy need to run?

Going by SKILL.md and its folder, Chunking Strategy needs the command-line tools its instructions call (python). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Bash.

Does Chunking Strategy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Chunking Strategy safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Chunking Strategy use?

Chunking Strategy is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Chunking Strategy use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 62k tokens, read only when the agent opens those files.

What are the alternatives to Chunking Strategy?

Skills that share tags, products or a category with Chunking Strategy: Chroma Vector Database (Orchestra-Research/AI-Research-SKILLs, 13k stars), Ms Agent Framework RAG (shuyu-labs/WebCode, 278 stars), Convex Agents (waynesutton/builder-skills, 406 stars) and Pgvector Semantic Search (timescale/pg-aiguide, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Chunking Strategy?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 357 GitHub stars. The repository holds 115 skills in this directory. The repository was last updated on September 10, 2026.

Source: giuseppe-trisciuoglio/developer-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.