mcpField
S
sciomc

sciomc

github.com/yeachan-heoAgent 工作流40.4k542 次安装1 天前更新
代码仓库

关于 sciomc

sciomc 是用于复杂研究任务的编排技能,面向需要并行调查、交叉验证和综合报告的用户。它支持带检查点的标准流程,也可通过 AUTO 模式自主执行,并能恢复中断的研究会话。

主要功能

  1. 01将目标拆分为多个研究阶段
  2. 02并行调用 scientist Agent
  3. 03交叉验证阶段发现
  4. 04综合生成研究报告
  5. 05自动执行及会话恢复

适用场景

  1. 01分析代码库中的复杂问题
  2. 02并行检验多个研究假设
  3. 03核对不同阶段的研究结果
  4. 04恢复中断的研究并生成报告

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill sciomc

安装后在 Claude Code 中输入/sciomc确认已加载。

详细介绍

Research Skill

编排并行科学家 Agent,开展全面的研究工作流,并可选择 AUTO 模式实现全自动执行。

概览

研究是一种多阶段工作流,会将复杂的研究目标拆解为并行调查:

  1. 拆解 - 将研究目标拆分为相互独立的阶段/假设
  2. 执行 - 针对每个阶段运行并行科学家 Agent
  3. 验证 - 交叉验证发现并检查一致性
  4. 综合 - 汇总结果,生成全面的报告

使用示例

/oh-my-claudecode:sciomc <goal>                    # Standard research with user checkpoints
/oh-my-claudecode:sciomc AUTO: <goal>              # Fully autonomous until complete
/oh-my-claudecode:sciomc status                    # Check current research session status
/oh-my-claudecode:sciomc resume                    # Resume interrupted research session
/oh-my-claudecode:sciomc list                      # List all research sessions
/oh-my-claudecode:sciomc report <session-id>       # Generate report for session
快速示例
/oh-my-claudecode:sciomc What are the performance characteristics of different sorting algorithms?
/oh-my-claudecode:sciomc AUTO: Analyze authentication patterns in this codebase
/oh-my-claudecode:sciomc How does the error handling work across the API layer?

研究协议

阶段拆解模式

收到研究目标后,将其拆解为 3-7 个相互独立的阶段:

## Research Decomposition

**Goal:** <original research goal>

### Stage 1: <stage-name>
- **Focus:** What this stage investigates
- **Hypothesis:** Expected finding (if applicable)
- **Scope:** Files/areas to examine
- **Tier:** LOW | MEDIUM | HIGH

### Stage 2: <stage-name>
...
并行调用科学家 Agent

通过 Task 工具并行启动相互独立的阶段:

// Stage 1 - Simple data gathering
Task(subagent_type="oh-my-claudecode:scientist", model="haiku", prompt="[RESEARCH_STAGE:1] Investigate...")

// Stage 2 - Standard analysis
Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[RESEARCH_STAGE:2] Analyze...")

// Stage 3 - Complex reasoning
Task(subagent_type="oh-my-claudecode:scientist", model="opus", prompt="[RESEARCH_STAGE:3] Deep analysis of...")
智能模型路由

重要:始终显式传入 model 参数!

任务复杂度Agent模型用途
数据收集scientist (model=haiku)haiku文件枚举、模式计数、简单查询
标准分析scientistsonnet代码分析、模式检测、文档审查
复杂推理scientistopus架构分析、跨领域问题、假设验证
路由决策指南
研究任务层级提示词示例
“统计 X 的出现次数”低“统计 useState hook 的所有用法”
“查找所有匹配 Y 的文件”低“列出项目中的所有测试文件”
“分析模式 Z”中“分析 API 路由中的错误处理模式”
“说明 W 的工作原理”中“说明身份验证流程”
“解释 X 发生的原因”高“解释缓存层中发生竞争条件的原因”
“比较方案 A 与 B”高“比较 Redux 与 Context 在此处用于状态管理的优劣”
验证循环

并行执行完成后,验证研究发现:

// Cross-validation stage
Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="
[RESEARCH_VERIFICATION]
Cross-validate these findings for consistency:

Stage 1 findings: <summary>
Stage 2 findings: <summary>
Stage 3 findings: <summary>

Check for:
1. Contradictions between stages
2. Missing connections
3. Gaps in coverage
4. Evidence quality

Output: [VERIFIED] or [CONFLICTS:<list>]
")

AUTO 模式

AUTO 模式通过循环控制自主运行完整的研究工作流。

循环控制协议
[RESEARCH + AUTO - ITERATION {{ITERATION}}/{{MAX}}]

Your previous attempt did not output the completion promise. Continue working.

Current state: {{STATE}}
Completed stages: {{COMPLETED_STAGES}}
Pending stages: {{PENDING_STAGES}}
Promise 标签
标签含义使用时机
[PROMISE:RESEARCH_COMPLETE]研究成功完成所有阶段均已完成并验证,报告已生成
[PROMISE:RESEARCH_BLOCKED]无法继续缺少数据、访问问题、循环依赖
AUTO 模式规则
  1. 最大迭代次数: 10(可配置)
  2. 持续运行直至: 输出 Promise 标签或达到最大迭代次数
  3. 状态跟踪: 每个阶段完成后持久化
  4. 取消: /oh-my-claudecode:cancel 或“停止”、“取消”
AUTO 模式示例
/oh-my-claudecode:sciomc AUTO: Comprehensive security analysis of the authentication system

[Decomposition]
- Stage 1 (LOW): Enumerate auth-related files
- Stage 2 (MEDIUM): Analyze token handling
- Stage 3 (MEDIUM): Review session management
- Stage 4 (HIGH): Identify vulnerability patterns
- Stage 5 (MEDIUM): Document security controls

[Execution - Parallel]
Firing stages 1-3 in parallel...
Firing stages 4-5 after dependencies complete...

[Verification]
Cross-validating findings...

[Synthesis]
Generating report...

[PROMISE:RESEARCH_COMPLETE]

并行执行模式

独立数据集分析(并行)

当各阶段分析不同的数据源时:

// All fire simultaneously
Task(subagent_type="oh-my-claudecode:scientist", model="haiku", prompt="[STAGE:1] Analyze src/api/...")
Task(subagent_type="oh-my-claudecode:scientist", model="haiku", prompt="[STAGE:2] Analyze src/utils/...")
Task(subagent_type="oh-my-claudecode:scientist", model="haiku", prompt="[STAGE:3] Analyze src/components/...")
假设组(并行)

当测试多个假设时:

// Test hypotheses simultaneously
Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:A] Test if caching improves...")
Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:B] Test if batching reduces...")
Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:C] Test if lazy loading helps...")
交叉验证(顺序执行)

当验证依赖于所有研究发现时:

// Wait for all parallel stages
[stages complete]

// Then sequential verification
Task(subagent_type="oh-my-claudecode:scientist", model="opus", prompt="
[CROSS_VALIDATION]
Validate consistency across all findings:
- Finding 1: ...
- Finding 2: ...
- Finding 3: ...
")
并发限制

最多同时运行 20 个科学家 Agent,以防止资源耗尽。

如果阶段数超过 20,则分批处理:

Batch 1: Stages 1-5 (parallel)
[wait for completion]
Batch 2: Stages 6-7 (parallel)

会话管理

目录结构
.omc/research/{session-id}/
  state.json              # Session state and progress
  stages/
    stage-1.md            # Stage 1 findings
    stage-2.md            # Stage 2 findings
    ...
  findings/
    raw/                  # Raw findings from scientists
    verified/             # Post-verification findings
  figures/
    figure-1.png          # Generated visualizations
    ...
  report.md               # Final synthesized report
状态文件格式
{
  "id": "research-20240115-abc123",
  "goal": "Original research goal",
  "status": "in_progress | complete | blocked | cancelled",
  "mode": "standard | auto",
  "iteration": 3,
  "maxIterations": 10,
  "stages": [
    {
      "id": 1,
      "name": "Stage name",
      "tier": "LOW | MEDIUM | HIGH",
      "status": "pending | running | complete | failed",
      "startedAt": "ISO timestamp",
      "completedAt": "ISO timestamp",
      "findingsFile": "stages/stage-1.md"
    }
  ],
  "verification": {
    "status": "pending | passed | failed",
    "conflicts": [],
    "completedAt": "ISO timestamp"
  },
  "createdAt": "ISO timestamp",
  "updatedAt": "ISO timestamp"
}
会话命令
命令操作
/oh-my-claudecode:sciomc status显示当前会话进度
/oh-my-claudecode:sciomc resume恢复最近中断的会话
/oh-my-claudecode:sciomc resume <session-id>恢复指定会话
/oh-my-claudecode:sciomc list列出所有会话及其状态
/oh-my-claudecode:sciomc report <session-id>生成/重新生成报告
/oh-my-claudecode:sciomc cancel取消当前会话(保留状态)

标签提取

科学家 Agent 使用结构化标签记录发现。使用以下模式提取:

发现标签
[FINDING:<id>] <title>
<evidence and analysis>
[/FINDING]

[EVIDENCE:<finding-id>]
- File: <path>
- Lines: <range>
- Content: <relevant code/text>
[/EVIDENCE]

[CONFIDENCE:<level>] # HIGH | MEDIUM | LOW
<reasoning for confidence level>
提取正则表达式模式
// Finding extraction
const findingPattern = /\[FINDING:(\w+)\]\s*(.*?)\n([\s\S]*?)\[\/FINDING\]/g;

// Evidence extraction
const evidencePattern = /\[EVIDENCE:(\w+)\]([\s\S]*?)\[\/EVIDENCE\]/g;

// Confidence extraction
const confidencePattern = /\[CONFIDENCE:(HIGH|MEDIUM|LOW)\]\s*(.*)/g;

// Stage completion
const stageCompletePattern = /\[STAGE_COMPLETE:(\d+)\]/;

// Verification result
const verificationPattern = /\[(VERIFIED|CONFLICTS):?(.*?)\]/;
证据窗口

提取证据时,请包含上下文窗口:

[EVIDENCE:F1]
- File: /src/auth/login.ts
- Lines: 45-52 (context: 40-57)
- Content:
  ```typescript
  // Lines 45-52 with 5 lines context above/below

[/EVIDENCE]


### Quality Validation

Findings must meet quality threshold:

| Quality Check | Requirement |
|---------------|-------------|
| Evidence present | At least 1 [EVIDENCE] per [FINDING] |
| Confidence stated | Each finding has [CONFIDENCE] |
| Source cited | File paths are absolute and valid |
| Reproducible | Another agent could verify |

## Report Generation

### Report Template

```markdown
# Research Report: {{GOAL}}

**Session ID:** {{SESSION_ID}}
**Date:** {{DATE}}
**Status:** {{STATUS}}

## Executive Summary

{{2-3 paragraph summary of key findings}}

## Methodology

### Research Stages

| Stage | Focus | Tier | Status |
|-------|-------|------|--------|
{{STAGES_TABLE}}

### Approach

{{Description of decomposition rationale and execution strategy}}

## Key Findings

### Finding 1: {{TITLE}}

**Confidence:** {{HIGH|MEDIUM|LOW}}

{{Detailed finding with evidence}}

#### Evidence

{{Embedded evidence blocks}}

### Finding 2: {{TITLE}}
...

## Visualizations

{{FIGURES}}

## Cross-Validation Results

{{Verification summary, any conflicts resolved}}

## Limitations

- {{Limitation 1}}
- {{Limitation 2}}
- {{Areas not covered and why}}

## Recommendations

1. {{Actionable recommendation}}
2. {{Actionable recommendation}}

## Appendix

### Raw Data

{{Links to raw findings files}}

### Session State

{{Link to state.json}}
图表嵌入协议

科学家使用此标记生成可视化内容:

[FIGURE:path/to/figure.png]
Caption: Description of what the figure shows
Alt: Accessibility description
[/FIGURE]

报告生成器会嵌入图表:

## Visualizations

![Figure 1: Description](figures/figure-1.png)
*Caption: Description of what the figure shows*

![Figure 2: Description](figures/figure-2.png)
*Caption: Description of what the figure shows*
图表类型
类型用途生成者
架构图系统结构科学家
流程图流程科学家
依赖关系图模块关系科学家
时间线事件顺序科学家
对比表A 与 B 的分析科学家

配置

.claude/settings.json 中的可选设置:

{
  "omc": {
    "research": {
      "maxIterations": 10,
      "maxConcurrentScientists": 5,
      "defaultTier": "MEDIUM",
      "autoVerify": true,
      "generateFigures": true,
      "evidenceContextLines": 5
    }
  }
}

取消

/oh-my-claudecode:cancel

或者说:“停止研究”“取消研究”“中止”

进度会保存在 .omc/research/{session-id}/ 中,以便恢复。

故障排除

卡在验证循环中?

  • 检查不同阶段之间是否存在相互冲突的发现
  • 查看 state.json,了解具体冲突
  • 可能需要采用不同方法重新运行特定阶段

科学家的发现质量较低?

  • 检查层级分配——复杂分析需要 HIGH 层级
  • 确保提示词包含明确的范围和预期输出格式
  • 检查研究目标是否过于宽泛

AUTO 模式的迭代次数耗尽?

  • 查看状态,确认卡在了哪一步
  • 检查目标是否能通过现有数据实现
  • 考虑将研究拆分为多个较小的会话

报告中缺少图表?

  • 确认 figures/ 目录存在
  • 检查发现中的 [FIGURE:] 标签
  • 确保路径是相对于会话目录的

评论

支持 Markdown