Token导航 LogoToken导航TokenDH.com
待分类权限需确认github未标认证来源可访问clear审计通过

reshard-c4-data重新分片 c4 数据

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

783

周安装

32

GitHub Stars

93

下载量

253
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:reshard-c4-data(重新分片 c4 数据)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/reshard-c4-data
安装命令:
npx skills add https://github.com/letta-ai/skills --skill reshard-c4-data
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill reshard-c4-data

简介

用于辅助数据整理、表格处理和指标计算。reshard-c4-data 属于待分类类 Skill,可作为该场景下的辅助能力补充。

  • 适合清洗字段、汇总数据或生成统计口径说明。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限与联网能力。
  • 建议确认数据来源和时间范围,避免误用样本为全量事实。
  • 涉及敏感数据导出时需先确认脱敏边界和写入权限。

SKILL.md

Reshard C4 Data

Overview

This skill provides guidance for data resharding tasks where files must be reorganized across a directory structure while respecting constraints such as maximum file size limits and maximum items per directory. These tasks require careful consideration of how constraints apply recursively to all levels of the output structure.

Critical Concept: Recursive Constraint Application

When a constraint states "maximum N files or folders in each directory," this applies to ALL directories in the output structure, including:

  • The root output directory
  • Any intermediate grouping directories
  • The final shard/leaf directories

Common Mistake: Interpreting directory constraints as applying only to leaf directories while ignoring the root and intermediate levels.

Mathematical Validation

Before implementing, perform constraint arithmetic:

  1. Calculate the total number of output items (files, shards, or groups)
  2. If items exceed the per-directory limit, hierarchical nesting is required
  3. Recursively apply this calculation at each level

Example: For 9,898 files with a 30-item-per-directory limit:

  • Files per shard: 30 → ~330 shards needed
  • Shards per group: 30 → ~11 groups needed
  • Groups in root: 11 → Compliant (under 30)

This yields a three-level hierarchy: output/group_XXXX/shard_XXXX/files

Approach for Resharding Tasks

Step 1: Analyze Input Data

  • Inventory all input files (count, sizes, directory structure)
  • Identify files exceeding size limits that require splitting
  • Calculate total storage requirements

Step 2: Validate Constraint Mathematics

For each constraint, verify compliance at all directory levels:

total_files = count(input_files) + count(split_chunks)
shards_needed = ceil(total_files / max_files_per_shard)

if shards_needed > max_items_per_directory:
    groups_needed = ceil(shards_needed / max_items_per_directory)
    # Continue nesting until root directory complies

Step 3: Design Hierarchical Output Structure

Create a directory hierarchy that satisfies constraints at every level:

output/
  .metadata.json          # Reconstruction metadata
  group_0000/
    shard_0000/
      file_001.txt
      file_002.txt
      ... (up to max_files_per_shard)
    shard_0001/
    ... (up to max_items_per_directory shards)
  group_0001/
  ... (up to max_items_per_directory groups)

Step 4: Implement File Distribution

  • Split oversized files into chunks that comply with size limits
  • Distribute files/chunks across shards evenly
  • Track original file mappings in metadata for reconstruction
  • Use checksums to verify data integrity

Step 5: Generate Reconstruction Metadata

Include metadata that enables reversing the resharding:

  • Original file paths and their shard locations
  • Split file chunk mappings
  • Checksums for integrity verification

Verification Strategies

Constraint Verification Checklist

Execute these checks before declaring success:

  1. Root directory item count: ls <output_dir> | wc -l must be ≤ limit
  2. All intermediate directories: Recursively verify each directory level
  3. All leaf directories: Verify shard contents
  4. File size limits: Check no single file exceeds the maximum
  5. Data integrity: Verify checksums match originals

Automated Verification Script Pattern

def verify_directory_constraints(path, max_items):
    """Recursively verify all directories comply with item limit."""
    for root, dirs, files in os.walk(path):
        item_count = len(dirs) + len(files)
        if item_count > max_items:
            return False, f"{root} has {item_count} items (max: {max_items})"
    return True, "All directories compliant"

Common Verification Failures

SymptomLikely CauseSolution
Root directory exceeds limitFlat shard structureAdd grouping hierarchy
Checksums don't matchFile corruption during splitRe-implement split logic with verification
Missing files in reconstructionIncomplete metadataAudit metadata generation

Common Pitfalls

Pitfall 1: Partial Constraint Interpretation

Mistake: Applying "max N items per directory" only to leaf directories.

Prevention: Explicitly verify every directory level in the output structure.

Pitfall 2: Ignoring Metadata in Item Counts

Mistake: Forgetting that metadata files (e.g., .metadata.json) count toward directory limits.

Prevention: Include metadata files in constraint calculations.

Pitfall 3: False Confidence from Partial Testing

Mistake: Concluding success after verifying data integrity but not structural constraints.

Prevention: Create separate verification steps for each constraint type.

Pitfall 4: Underestimating Scale

Mistake: Testing with small datasets that don't trigger hierarchical nesting requirements.

Prevention: Calculate expected output structure mathematically before implementation.

Testing Recommendations

  1. Unit test constraint logic with edge cases (exactly at limits, one over, etc.)
  2. Test with representative scale that triggers all hierarchy levels
  3. Verify round-trip integrity by reconstructing and comparing checksums
  4. Check all constraint types independently before integration testing

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.04%
按下载量换算76

Gemini CLI

20.82%
按下载量换算53

Antigravity

18.07%
按下载量换算46

windsurf

12.71%
按下载量换算32

OpenCode

8.53%
按下载量换算22

Codex

3.21%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills