doc-shard-manager

Partition large Markdown and JSON documents into configurable shard groups.

3|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/eaglhuang/cocos_new --skill doc-shard-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doc-shard-manager
Source: https://github.com/eaglhuang/cocos_new/tree/main/.github/skills/doc-shard-manager
Command: npx skills add https://github.com/eaglhuang/cocos_new --skill doc-shard-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large documents (Markdown/JSON) often exceed token limits, forcing costly workarounds. This skill introduces shard groups to split big files into small, independently loadable parts and maintain a lightweight index stub for efficient reassembly and validation.

Core Features & Use Cases

  • Core tool: tools_node/shard-manager.js, with per-group configuration (.shardrc.json) to orchestrate shifting large content into shard directories, rebuilds, and validations.
  • Workflow coverage: maintenance of existing shards, creating new shard groups for new large files, and auto-splitting when shards exceed thresholds; supports scan for new files and automated partitioning.
  • Practical scenario: break a 100 KB Markdown spec into 4 shards to keep per-part size under token limits, then progressively load shards as needed.

Quick Start

Run a shard operation on a new large file to split it into shard folders and update the index.

Frequently Asked Questions about doc-shard-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split large Markdown and JSON files to avoid exceeding token limits?

To split large Markdown and JSON files and avoid exceeding token limits, you can partition them into shard groups. This creates small, independently loadable parts and maintains a lightweight index stub for efficient reassembly and progressive loading.

What is document sharding and how does it help with large file indexing?

Document sharding is the process of breaking large documents into smaller, independently loadable parts to facilitate efficient indexing. It helps manage large files by maintaining a lightweight index stub, enabling incremental loading and validation without processing the entire file at once.

How do I configure shard groups for my large documents?

You configure shard groups for large documents using a .shardrc.json file. This configuration file orchestrates shifting large content into shard directories, setting thresholds for auto-splitting, and defining parameters for rebuilds and validations.

Can I automatically split files when shards exceed a specific size threshold?

Yes, you can automatically split files when shards exceed a specific size threshold by using the auto-split command. The system performs safety checks and scans for new large files to automate the partitioning process without manual intervention.

What commands are available for managing and validating document shards?

Available commands for managing and validating document shards include shard, rebuild-index, validate, status, and auto-split. These commands support initial splitting, index rebuilding, validation, and status checks across Markdown and JSON sources.

Does this large-file management approach work with both Markdown and JSON sources?

Yes, this large-file management approach works with both Markdown and JSON sources. The sharding architecture supports workflows involving initial splitting, index rebuilding, validation, and status checks specifically tailored for these file formats.