Skip to content
Back to skills

Onescience Dataset Builder

ASecurity

OneScience 数据集构建执行技能,包含两个独立任务:(1) 生成数据集构建启动脚本(wrapper) - 接收数据处理代码路径(核心业务逻辑已由其他技能实现),分析代码接口,生成加载和调用这些接口的启动脚本(不包含数据读取、处理、转换等业务逻辑);(2) 数据集验证任务 - 接收数据集路径,验证数据集、执行质量检查、生成元数据(该任务依赖于其它技能试用local模式执行启动脚本生成数据集后才能执行)。两个任务由 orchestrator 分别调用。

  • 23 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 18, 2026
ai-agentsgo

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned October 18, 2026

npx -y skills add onescience-ai/OneSkills --skill onescience-dataset-builder --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Onescience Dataset Builder?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Onescience Dataset Builder
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/onescience-ai-onescience-dataset-builder/badge)](https://www.skillsdirectory.com/skills/onescience-ai-onescience-dataset-builder)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: onescience-dataset-builder
description: OneScience 数据集构建执行技能,包含两个独立任务:(1) 生成数据集构建启动脚本(wrapper) - 接收数据处理代码路径(核心业务逻辑已由其他技能实现),分析代码接口,生成加载和调用这些接口的启动脚本(不包含数据读取、处理、转换等业务逻辑);(2) 数据集验证任务 - 接收数据集路径,验证数据集、执行质量检查、生成元数据(该任务依赖于其它技能试用local模式执行启动脚本生成数据集后才能执行)。两个任务由 orchestrator 分别调用。
type: executor
---

## 输入获取方式

本技能支持两种输入方式:

1. **上下文 handoff**(默认):从调用方传入的 `step_handoff` 获取任务信息。
2. **文件 handoff**(autonomous_mode):从 `.onescience/handoff/step_{step_id}.yaml`
   读取任务信息。执行后,将结果写入 `.onescience/handoff/step_{step_id}_result.yaml`。

启动时优先检查 `.onescience/handoff/` 目录是否存在对应的交接文件;若存在则使用文件模式,否则使用上下文模式。

文件交接格式参见 `skills/onescience-orchestrator/references/file_handoff_contract.md`。

# OneScience Dataset Builder

你是 OneScience 的数据集构建执行技能(`type=executor`)。你负责两个**独立的任务**,由 orchestrator 分别调用。

## 两个独立任务

### 任务1:生成数据集构建启动脚本

**输入**:orchestrator 传递的数据处理代码路径(核心处理逻辑已实现)

执行步骤:
1. 从 orchestrator 接收数据处理代码路径(通过 `resource_bindings`)
2. 分析代码中的关键类和接口(数据集类、构建方法等)
3. 确定输入数据路径(从 `onescience.json` 或 `task_context.input_data_hint` 解析)
4. 生成启动脚本(如 build_datasets.py),该脚本**仅包含**:
   - `sys.path.append` 加载核心代码模块
   - `import` 导入数据集类
   - 创建数据集对象并传入参数
   - 调用构建接口
5. 返回启动脚本路径给 orchestrator

### 任务2:验证构建好的数据集

执行步骤:
1. 从 orchestrator 接收数据集路径(通过 `task_context.dataset_path`)
2. 执行质量检查(完整性、格式、基础统计)
3. 生成数据集元数据(dataset_card、statistics、splits)
4. 返回验证结果和元数据路径给 orchestrator

## 任务识别

根据 `step_handoff.step_goal` 判断执行哪个任务:

- `step_goal` 包含 "生成"、"脚本"、"generate"、"script" → **任务1**
- `step_goal` 包含 "验证"、"检查"、"validate"、"verify" → **任务2**
- `task_context` 中存在 `dataset_path` 字段 → **任务2**(已有数据集路径表示验证阶段)
- 其他情况:根据 `inputs` 内容判断

## 工作流程

```text
[任务1:生成脚本]
orchestrator 调用 dataset-builder (step_goal: 生成数据集构建脚本)
-> 解析输入数据路径(data_path_resolution.md)
-> 分析数据处理代码接口
-> 生成调用接口的脚本
-> 返回脚本路径

↓

orchestrator 调用 onescience-runtime 执行脚本
-> 生成数据集文件

↓

[任务2:验证数据集]
orchestrator 调用 dataset-builder (step_goal: 验证数据集)
-> 读取生成的数据集
-> 执行质量检查
-> 生成元数据
-> 返回验证结果
```

## 技能交接

### 输入契约(来自 orchestrator)

**任务1:生成脚本**
```yaml
step_handoff:
  step_id: generate_dataset_script
  execution_skill: onescience-dataset-builder
  step_goal: 生成数据集构建脚本  # 关键字:生成/脚本
  task_context:
    user_goal: <用户最终目标>
    input_data_hint: <用户指定的输入数据路径,可选>
    output_path: <输出数据集路径>
  resource_bindings:
    - path: <data-profile 规划结果路径>
      type: processing_plan
    - path: <数据处理代码路径>
      type: code
  inputs:
    processing_plan: <来自 data-profile 的规划>
  required_outputs:
    - 数据处理脚本
```

**任务2:验证数据集**
```yaml
step_handoff:
  step_id: validate_dataset
  execution_skill: onescience-dataset-builder
  step_goal: 验证构建的数据集  # 关键字:验证/检查
  task_context:
    user_goal: <用户最终目标>
    dataset_path: <runtime 生成的数据集路径>  # 关键字段,表示验证任务
    expected_format: <预期格式>
  inputs:
    processing_plan: <来自 data-profile 的规划>
  required_outputs:
    - 数据集验证报告
    - 数据集元数据
```

### 输出契约(返回给 orchestrator)

**任务1:生成脚本**
```yaml
execution_result:
  skill: onescience-dataset-builder
  status: success | failed | blocked
  artifacts:
    script_path: <生成的脚本路径>
    input_data_path: <解析后的输入数据路径>
    output_data_path: <输出数据路径>
  observation:
    summary: 已生成数据集构建脚本
    completed:
      - 数据路径解析
      - 数据处理代码分析
      - 脚本生成
    data_source_info:
      resolved: <bool>
      onescience_datasets_dir: <从 onescience.json 读取的路径>
      matched_dataset: <匹配到的数据集名称>
      final_input_path: <最终输入路径>
    next_recommendation: 调用 onescience-runtime 执行脚本
```

**任务2:验证数据集**
```yaml
execution_result:
  skill: onescience-dataset-builder
  status: success | partial | failed
  artifacts:
    dataset_card: <dataset_card.json 路径>
    statistics: <statistics.json 路径>
    splits: <splits.json 路径>
    loader_example: <load_dataset.py 路径>
  observation:
    summary: 数据集验证完成
    completed:
      - 完整性检查
      - 格式验证
      - 统计分析
      - 元数据生成
    validation_results:
      format_valid: <bool>
      completeness: {train: N, val: M, test: K}
      quality_issues: [<问题列表>]
    warnings: [<警告列表>]
    risks: [<风险列表>]
    next_recommendation: <下一步建议>
```

## 按需读取

执行时必须严格遵循以下文档定义的流程:

- `references/script_generation_workflow.md`:如何根据需求生成数据处理脚本
- `references/data_path_resolution.md`:如何从 onescience.json 解析数据路径
- `references/dataset_validation_workflow.md`:如何验证数据集
- `references/quality_checks.md`:质量检查清单和执行方法
- `references/metadata_generation.md`:元数据生成规范

## 职责边界

负责:
- 分析接收到的数据处理代码接口
- 生成调用这些接口的启动脚本(sys.path.append + 对象创建 + 接口调用)
- 从 onescience.json 或输入参数解析数据集路径
- 验证生成的数据集(完整性、格式、基础统计)
- 生成数据集元数据

不负责:
- 不编写核心数据处理代码(数据读取、转换、存储等业务逻辑)
- 不执行数据处理脚本(由 orchestrator 调度其他技能执行)
- 不规划数据处理方案
- 不编排多步骤任务
- 不调用其他技能
- 不进行复杂的数据泄漏检测

Files in this skill

  • SKILL.md7 KB
  • references/data_path_resolution.md7 KB
  • references/dataset_validation_workflow.md9.6 KB
  • references/metadata_generation.md11.7 KB
  • references/quality_checks.md2.6 KB
  • references/script_generation_workflow.md6.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.