process-builder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProcess Builder
流程构建器
Create new process definitions for the babysitter event-sourced orchestration framework.
为基于事件溯源的babysitter编排框架创建新的流程定义。
Quick Reference
快速参考
Processes live in: plugins/babysitter/skills/babysit/process/
├── methodologies/ # Reusable development approaches (TDD, BDD, Scrum, etc.)
│ └── [name]/
│ ├── README.md # Documentation
│ ├── [name].js # Main process
│ └── examples/ # Sample inputs
│
└── specializations/ # Domain-specific processes
├── [category]/ # Engineering specializations (direct children)
│ └── [process].js
└── domains/
└── [domain]/ # Business, Science, Social Sciences
└── [spec]/
├── README.md
├── references.md
├── processes-backlog.md
└── [process].jsProcesses live in: plugins/babysitter/skills/babysit/process/
├── methodologies/ # 可复用的开发方法(TDD、BDD、Scrum等)
│ └── [name]/
│ ├── README.md # 文档
│ ├── [name].js # 主流程文件
│ └── examples/ # 示例输入
│
└── specializations/ # 领域特定流程
├── [category]/ # 工程细分领域(直接子目录)
│ └── [process].js
└── domains/
└── [domain]/ # 业务、科学、社会科学领域
└── [spec]/
├── README.md
├── references.md
├── processes-backlog.md
└── [process].js3-Phase Workflow
三阶段工作流
Phase 1: Research & Documentation
阶段1:调研与文档编写
Create foundational documentation:
bash
undefined创建基础文档:
bash
undefinedCheck existing specializations
查看现有细分领域流程
ls plugins/babysitter/skills/babysit/process/specializations/
ls plugins/babysitter/skills/babysit/process/specializations/
Check methodologies
查看现有方法
ls plugins/babysitter/skills/babysit/process/methodologies/
**Create:**
- `README.md` - Overview, roles, goals, use cases, common flows
- `references.md` - External references, best practices, links to sourcesls plugins/babysitter/skills/babysit/process/methodologies/
**需创建:**
- `README.md` - 概述、角色、目标、用例、通用流程
- `references.md` - 外部参考资料、最佳实践、来源链接Phase 2: Identify Processes
阶段2:识别流程
Create with identified processes:
processes-backlog.mdmarkdown
undefined创建文档,记录已识别的流程:
processes-backlog.mdmarkdown
undefinedProcesses Backlog - [Specialization Name]
流程待办列表 - [细分领域名称]
Identified Processes
已识别流程
-
process-name - Short description of what this process accomplishes
- Reference: [Link to methodology or standard]
- Inputs: list key inputs
- Outputs: list key outputs
-
another-process - Description ...
undefined-
process-name - 该流程实现目标的简短描述
- 参考:[方法或标准链接]
- 输入:关键输入列表
- 输出:关键输出列表
-
another-process - 描述 ...
undefinedPhase 3: Create Process Files
阶段3:创建流程文件
Create process files following SDK patterns (see below).
.js遵循SDK模式创建流程文件(详见下文)。
.jsProcess File Structure
流程文件结构
Every process file follows this pattern:
javascript
/**
* @process [category]/[process-name]
* @description Clear description of what the process accomplishes end-to-end
* @inputs { inputName: type, optionalInput?: type }
* @outputs { success: boolean, outputName: type, artifacts: array }
*
* @example
* const result = await orchestrate('[category]/[process-name]', {
* inputName: 'value',
* optionalInput: 'optional-value'
* });
*
* @references
* - Book: "Relevant Book Title" by Author
* - Article: [Title](https://link)
* - Standard: ISO/IEEE reference
*/
import { defineTask } from '@a5c-ai/babysitter-sdk';
/**
* [Process Name] Process
*
* Methodology: Brief description of the approach
*
* Phases:
* 1. Phase Name - What happens
* 2. Phase Name - What happens
* ...
*
* Benefits:
* - Benefit 1
* - Benefit 2
*
* @param {Object} inputs - Process inputs
* @param {string} inputs.inputName - Description of input
* @param {Object} ctx - Process context (see SDK)
* @returns {Promise<Object>} Process result
*/
export async function process(inputs, ctx) {
const {
inputName,
optionalInput = 'default-value',
// ... destructure with defaults
} = inputs;
const artifacts = [];
// ============================================================================
// PHASE 1: [PHASE NAME]
// ============================================================================
ctx.log?.('info', 'Starting Phase 1...');
const phase1Result = await ctx.task(someTask, {
// task inputs
});
artifacts.push(...(phase1Result.artifacts || []));
// Breakpoint for human review (when needed)
await ctx.breakpoint({
question: 'Review the results and approve to continue?',
title: 'Phase 1 Review',
context: {
runId: ctx.runId,
files: [
{ path: 'artifacts/output.md', format: 'markdown', label: 'Output' }
]
}
});
// ============================================================================
// PHASE 2: [PHASE NAME] - Parallel Execution Example
// ============================================================================
const [result1, result2, result3] = await ctx.parallel.all([
() => ctx.task(task1, { /* args */ }),
() => ctx.task(task2, { /* args */ }),
() => ctx.task(task3, { /* args */ })
]);
// ============================================================================
// PHASE 3: [ITERATION EXAMPLE]
// ============================================================================
let iteration = 0;
let targetMet = false;
while (!targetMet && iteration < maxIterations) {
iteration++;
const iterResult = await ctx.task(iterativeTask, {
iteration,
previousResults: /* ... */
});
targetMet = iterResult.meetsTarget;
if (!targetMet && iteration % 3 === 0) {
// Periodic checkpoint
await ctx.breakpoint({
question: `Iteration ${iteration}: Target not met. Continue?`,
title: 'Progress Checkpoint',
context: { /* ... */ }
});
}
}
// ============================================================================
// COMPLETION
// ============================================================================
return {
success: targetMet,
iterations: iteration,
artifacts,
// ... other outputs matching @outputs
};
}
// ============================================================================
// TASK DEFINITIONS
// ============================================================================
/**
* Task: [Task Name]
* Purpose: What this task accomplishes
*/
const someTask = defineTask({
name: 'task-name',
description: 'What this task does',
// Task definition - executed externally by orchestrator
// This returns a TaskDef that describes HOW to run the task
inputs: {
inputName: { type: 'string', required: true },
optionalInput: { type: 'number', default: 10 }
},
outputs: {
result: { type: 'object' },
artifacts: { type: 'array' }
},
async run(inputs, taskCtx) {
const effectId = taskCtx.effectId;
return {
kind: 'node', // or 'agent', 'skill', 'shell', 'breakpoint'
title: `Task: ${inputs.inputName}`,
node: {
entry: 'scripts/task-runner.js',
args: ['--input', inputs.inputName, '--effect-id', effectId]
},
io: {
inputJsonPath: `tasks/${effectId}/input.json`,
outputJsonPath: `tasks/${effectId}/result.json`
},
labels: ['category', 'subcategory']
};
}
});每个流程文件需遵循以下模式:
javascript
/**
* @process [category]/[process-name]
* @description 流程端到端实现目标的清晰描述
* @inputs { inputName: type, optionalInput?: type }
* @outputs { success: boolean, outputName: type, artifacts: array }
*
* @example
* const result = await orchestrate('[category]/[process-name]', {
* inputName: 'value',
* optionalInput: 'optional-value'
* });
*
* @references
* - Book: "Relevant Book Title" by Author
* - Article: [Title](https://link)
* - Standard: ISO/IEEE reference
*/
import { defineTask } from '@a5c-ai/babysitter-sdk';
/**
* [流程名称] 流程
*
* 方法:实现方法的简要描述
*
* 阶段:
* 1. 阶段名称 - 执行内容
* 2. 阶段名称 - 执行内容
* ...
*
* 优势:
* - 优势1
* - 优势2
*
* @param {Object} inputs - 流程输入
* @param {string} inputs.inputName - 输入描述
* @param {Object} ctx - 流程上下文(详见SDK)
* @returns {Promise<Object>} 流程结果
*/
export async function process(inputs, ctx) {
const {
inputName,
optionalInput = 'default-value',
// ... 带默认值的解构赋值
} = inputs;
const artifacts = [];
// ============================================================================
// 阶段1: [阶段名称]
// ============================================================================
ctx.log?.('info', '开始阶段1...');
const phase1Result = await ctx.task(someTask, {
// 任务输入
});
artifacts.push(...(phase1Result.artifacts || []));
// 人工审核断点(按需使用)
await ctx.breakpoint({
question: '审核结果并批准继续?',
title: '阶段1审核',
context: {
runId: ctx.runId,
files: [
{ path: 'artifacts/output.md', format: 'markdown', label: '输出结果' }
]
}
});
// ============================================================================
// 阶段2: [阶段名称] - 并行执行示例
// ============================================================================
const [result1, result2, result3] = await ctx.parallel.all([
() => ctx.task(task1, { /* 参数 */ }),
() => ctx.task(task2, { /* 参数 */ }),
() => ctx.task(task3, { /* 参数 */ })
]);
// ============================================================================
// 阶段3: [迭代示例]
// ============================================================================
let iteration = 0;
let targetMet = false;
while (!targetMet && iteration < maxIterations) {
iteration++;
const iterResult = await ctx.task(iterativeTask, {
iteration,
previousResults: /* ... */
});
targetMet = iterResult.meetsTarget;
if (!targetMet && iteration % 3 === 0) {
// 定期检查点
await ctx.breakpoint({
question: `第${iteration}次迭代:未达成目标。是否继续?`,
title: '进度检查点',
context: { /* ... */ }
});
}
}
// ============================================================================
// 完成
// ============================================================================
return {
success: targetMet,
iterations: iteration,
artifacts,
// ... 其他与@outputs匹配的输出
};
}
// ============================================================================
// 任务定义
// ============================================================================
/**
* 任务: [任务名称]
* 用途: 该任务的实现目标
*/
const someTask = defineTask({
name: 'task-name',
description: '任务功能描述',
// 任务定义 - 由编排器外部执行
// 返回描述任务运行方式的TaskDef
inputs: {
inputName: { type: 'string', required: true },
optionalInput: { type: 'number', default: 10 }
},
outputs: {
result: { type: 'object' },
artifacts: { type: 'array' }
},
async run(inputs, taskCtx) {
const effectId = taskCtx.effectId;
return {
kind: 'node', // 或 'agent', 'skill', 'shell', 'breakpoint'
title: `Task: ${inputs.inputName}`,
node: {
entry: 'scripts/task-runner.js',
args: ['--input', inputs.inputName, '--effect-id', effectId]
},
io: {
inputJsonPath: `tasks/${effectId}/input.json`,
outputJsonPath: `tasks/${effectId}/result.json`
},
labels: ['category', 'subcategory']
};
}
});SDK Context API Reference
SDK上下文API参考
The object provides these intrinsics:
ctx| Method | Purpose | Behavior |
|---|---|---|
| Execute a task | Returns result or throws typed exception |
| Human approval gate | Pauses until approved via breakpoints service |
| Time-based gate | Pauses until specified time |
| Parallel execution | Runs independent tasks concurrently |
| Parallel map | Maps items through task function |
| Deterministic time | Returns current Date (or provided time) |
| Logging | Optional logging helper |
| Run identifier | Current run's unique ID |
ctx| 方法 | 用途 | 行为 |
|---|---|---|
| 执行任务 | 返回结果或抛出类型化异常 |
| 人工批准节点 | 暂停流程,直到通过断点服务获得批准 |
| 时间触发节点 | 暂停到指定时间 |
| 并行执行 | 并发运行独立任务 |
| 并行映射 | 通过任务函数处理所有条目 |
| 确定性时间 | 返回当前时间(或指定时间) |
| 日志记录 | 可选的日志辅助方法 |
| 运行标识符 | 当前运行的唯一ID |
Task Kinds
任务类型
| Kind | Use Case | Executor |
|---|---|---|
| Scripts, builds, tests | Node.js process |
| LLM-powered analysis, generation | Claude Code agent |
| Claude Code skills | Skill invocation |
| System commands | Shell execution |
| Human approval | Breakpoints UI/service |
| Time gates | Orchestrator scheduling |
| Internal orchestrator work | Self-routed |
| 类型 | 适用场景 | 执行器 |
|---|---|---|
| 脚本、构建、测试 | Node.js进程 |
| 大语言模型驱动的分析、生成 | Claude Code agent |
| Claude Code技能 | 技能调用 |
| 系统命令 | Shell执行 |
| 人工批准 | 断点UI/服务 |
| 时间节点 | 编排器调度 |
| 编排器内部工作 | 内部路由 |
Breakpoint Patterns
断点模式
Basic Approval Gate
基础批准节点
javascript
await ctx.breakpoint({
question: 'Approve to continue?',
title: 'Checkpoint',
context: { runId: ctx.runId }
});javascript
await ctx.breakpoint({
question: '是否批准继续?',
title: '检查点',
context: { runId: ctx.runId }
});With File References (for UI display)
带文件引用的断点(用于UI展示)
javascript
await ctx.breakpoint({
question: 'Review the generated specification. Does it meet requirements?',
title: 'Specification Review',
context: {
runId: ctx.runId,
files: [
{ path: 'artifacts/spec.md', format: 'markdown', label: 'Specification' },
{ path: 'artifacts/spec.json', format: 'json', label: 'JSON Schema' },
{ path: 'src/implementation.ts', format: 'code', language: 'typescript', label: 'Implementation' }
]
}
});javascript
await ctx.breakpoint({
question: '审核生成的规范是否符合要求?',
title: '规范审核',
context: {
runId: ctx.runId,
files: [
{ path: 'artifacts/spec.md', format: 'markdown', label: '规范文档' },
{ path: 'artifacts/spec.json', format: 'json', label: 'JSON Schema' },
{ path: 'src/implementation.ts', format: 'code', language: 'typescript', label: '实现代码' }
]
}
});Conditional Breakpoint
条件断点
javascript
if (qualityScore < targetScore) {
await ctx.breakpoint({
question: `Quality score ${qualityScore} is below target ${targetScore}. Continue iterating or accept current result?`,
title: 'Quality Gate',
context: {
runId: ctx.runId,
data: { qualityScore, targetScore, iteration }
}
});
}javascript
if (qualityScore < targetScore) {
await ctx.breakpoint({
question: `质量分数${qualityScore}低于目标值${targetScore}。是否继续迭代或接受当前结果?`,
title: '质量节点',
context: {
runId: ctx.runId,
data: { qualityScore, targetScore, iteration }
}
});
}Common Patterns
通用模式
Quality Convergence Loop
质量收敛循环
javascript
let quality = 0;
let iteration = 0;
const targetQuality = inputs.targetQuality || 85;
const maxIterations = inputs.maxIterations || 10;
while (quality < targetQuality && iteration < maxIterations) {
iteration++;
ctx.log?.('info', `Iteration ${iteration}/${maxIterations}`);
// Execute improvement tasks
const improvement = await ctx.task(improveTask, { iteration });
// Score quality (parallel checks)
const [coverage, lint, security, tests] = await ctx.parallel.all([
() => ctx.task(coverageTask, {}),
() => ctx.task(lintTask, {}),
() => ctx.task(securityTask, {}),
() => ctx.task(runTestsTask, {})
]);
// Agent scores overall quality
const score = await ctx.task(agentScoringTask, {
coverage, lint, security, tests, iteration
});
quality = score.overall;
ctx.log?.('info', `Quality: ${quality}/${targetQuality}`);
if (quality >= targetQuality) {
ctx.log?.('info', 'Quality target achieved!');
break;
}
}
return {
success: quality >= targetQuality,
quality,
iterations: iteration
};javascript
let quality = 0;
let iteration = 0;
const targetQuality = inputs.targetQuality || 85;
const maxIterations = inputs.maxIterations || 10;
while (quality < targetQuality && iteration < maxIterations) {
iteration++;
ctx.log?.('info', `迭代 ${iteration}/${maxIterations}`);
// 执行优化任务
const improvement = await ctx.task(improveTask, { iteration });
// 并行检查质量
const [coverage, lint, security, tests] = await ctx.parallel.all([
() => ctx.task(coverageTask, {}),
() => ctx.task(lintTask, {}),
() => ctx.task(securityTask, {}),
() => ctx.task(runTestsTask, {})
]);
// 由Agent评估整体质量
const score = await ctx.task(agentScoringTask, {
coverage, lint, security, tests, iteration
});
quality = score.overall;
ctx.log?.('info', `质量分数: ${quality}/${targetQuality}`);
if (quality >= targetQuality) {
ctx.log?.('info', '达成质量目标!');
break;
}
}
return {
success: quality >= targetQuality,
quality,
iterations: iteration
};Phased Workflow with Reviews
带审核环节的分阶段工作流
javascript
// Phase 1: Research
const research = await ctx.task(researchTask, { topic: inputs.topic });
await ctx.breakpoint({
question: 'Review research findings before proceeding to planning.',
title: 'Research Review',
context: { runId: ctx.runId }
});
// Phase 2: Planning
const plan = await ctx.task(planningTask, { research });
await ctx.breakpoint({
question: 'Review plan before implementation.',
title: 'Plan Review',
context: { runId: ctx.runId }
});
// Phase 3: Implementation
const implementation = await ctx.task(implementTask, { plan });
// Phase 4: Verification
const verification = await ctx.task(verifyTask, { implementation, plan });
await ctx.breakpoint({
question: 'Final review before completion.',
title: 'Final Approval',
context: { runId: ctx.runId }
});
return { success: verification.passed, plan, implementation };javascript
// 阶段1:调研
const research = await ctx.task(researchTask, { topic: inputs.topic });
await ctx.breakpoint({
question: '审核调研结果后再进入规划阶段?',
title: '调研结果审核',
context: { runId: ctx.runId }
});
// 阶段2:规划
const plan = await ctx.task(planningTask, { research });
await ctx.breakpoint({
question: '审核规划方案后再进入实现阶段?',
title: '规划方案审核',
context: { runId: ctx.runId }
});
// 阶段3:实现
const implementation = await ctx.task(implementTask, { plan });
// 阶段4:验证
const verification = await ctx.task(verifyTask, { implementation, plan });
await ctx.breakpoint({
question: '完成前进行最终审核?',
title: '最终批准',
context: { runId: ctx.runId }
});
return { success: verification.passed, plan, implementation };Parallel Fan-out with Aggregation
并行分发与聚合
javascript
// Fan out to multiple parallel analyses
const analyses = await ctx.parallel.map(components, component =>
ctx.task(analyzeTask, { component }, { label: `analyze:${component.name}` })
);
// Aggregate results
const aggregated = await ctx.task(aggregateTask, { analyses });
return { analyses, summary: aggregated.summary };javascript
// 并行执行多份分析任务
const analyses = await ctx.parallel.map(components, component =>
ctx.task(analyzeTask, { component }, { label: `analyze:${component.name}` })
);
// 聚合结果
const aggregated = await ctx.task(aggregateTask, { analyses });
return { analyses, summary: aggregated.summary };Testing Processes
流程测试
CLI Commands
CLI命令
bash
undefinedbash
undefinedCreate a new run
创建新运行实例
babysitter run:create
--process-id methodologies/my-process
--entry ./plugins/babysitter/skills/babysit/process/methodologies/my-process.js#process
--inputs ./test-inputs.json
--json
--process-id methodologies/my-process
--entry ./plugins/babysitter/skills/babysit/process/methodologies/my-process.js#process
--inputs ./test-inputs.json
--json
babysitter run:create
--process-id methodologies/my-process
--entry ./plugins/babysitter/skills/babysit/process/methodologies/my-process.js#process
--inputs ./test-inputs.json
--json
--process-id methodologies/my-process
--entry ./plugins/babysitter/skills/babysit/process/methodologies/my-process.js#process
--inputs ./test-inputs.json
--json
Iterate the run
迭代运行实例
babysitter run:iterate .a5c/runs/<runId> --json
babysitter run:iterate .a5c/runs/<runId> --json
List pending tasks
列出待处理任务
babysitter task:list .a5c/runs/<runId> --pending --json
babysitter task:list .a5c/runs/<runId> --pending --json
Post a task result
提交任务结果
babysitter task:post .a5c/runs/<runId> <effectId>
--status ok
--value ./result.json
--status ok
--value ./result.json
babysitter task:post .a5c/runs/<runId> <effectId>
--status ok
--value ./result.json
--status ok
--value ./result.json
Check run status
查看运行状态
babysitter run:status .a5c/runs/<runId>
babysitter run:status .a5c/runs/<runId>
View events
查看事件日志
babysitter run:events .a5c/runs/<runId> --limit 20 --reverse
undefinedbabysitter run:events .a5c/runs/<runId> --limit 20 --reverse
undefinedSample Test Input File
测试输入文件示例
json
{
"feature": "User authentication with JWT",
"acceptanceCriteria": [
"Users can register with email and password",
"Users can login and receive a JWT token",
"Invalid credentials are rejected"
],
"testFramework": "jest",
"targetQuality": 85,
"maxIterations": 5
}json
{
"feature": "User authentication with JWT",
"acceptanceCriteria": [
"Users can register with email and password",
"Users can login and receive a JWT token",
"Invalid credentials are rejected"
],
"testFramework": "jest",
"targetQuality": 85,
"maxIterations": 5
}Process Builder Workflow
流程构建器工作流
1. Gather Requirements
1. 收集需求
Ask the user:
| Question | Purpose |
|---|---|
| Domain/Category | Determines directory location |
| Process Name | kebab-case identifier |
| Goal | What should the process accomplish? |
| Inputs | What data does the process need? |
| Outputs | What artifacts/results does it produce? |
| Phases | What are the major steps? |
| Quality Gates | Where should humans review? |
| Iteration Strategy | Fixed phases vs. convergence loop? |
询问用户以下问题:
| 问题 | 用途 |
|---|---|
| 领域/分类 | 确定目录位置 |
| 流程名称 | kebab-case格式的标识符 |
| 目标 | 流程需实现的核心目标 |
| 输入 | 流程所需的输入数据 |
| 输出 | 流程生成的产物/结果 |
| 阶段 | 主要执行步骤 |
| 质量节点 | 需要人工审核的关键节点 |
| 迭代策略 | 固定阶段还是收敛循环? |
2. Research Similar Processes
2. 调研同类流程
bash
undefinedbash
undefinedFind similar processes
查找同类流程
ls plugins/babysitter/skills/babysit/process/methodologies/
ls plugins/babysitter/skills/babysit/process/specializations/
ls plugins/babysitter/skills/babysit/process/methodologies/
ls plugins/babysitter/skills/babysit/process/specializations/
Read similar process for patterns
查看同类流程的实现模式
cat plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/atdd-tdd.js | head -200
cat plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/atdd-tdd.js | head -200
Check methodology README structure
查看方法类文档结构
cat plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/README.md
undefinedcat plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/README.md
undefined3. Check Methodologies Backlog
3. 查看方法类待办列表
bash
cat plugins/babysitter/skills/babysit/process/methodologies/backlog.mdbash
cat plugins/babysitter/skills/babysit/process/methodologies/backlog.md4. Create the Process
4. 创建流程
For Methodologies:
- Create (comprehensive documentation)
methodologies/[name]/README.md - Create (process implementation)
methodologies/[name]/[name].js - Create (sample inputs)
methodologies/[name]/examples/
For Specializations:
- If domain-specific:
specializations/domains/[domain]/[spec]/ - If engineering:
specializations/[category]/[process].js - Create README.md, references.md, processes-backlog.md first
- Then create individual process.js files
方法类流程:
- 创建(完整文档)
methodologies/[name]/README.md - 创建(流程实现)
methodologies/[name]/[name].js - 创建(示例输入)
methodologies/[name]/examples/
细分领域流程:
- 领域特定流程:
specializations/domains/[domain]/[spec]/ - 工程类流程:
specializations/[category]/[process].js - 先创建README.md、references.md、processes-backlog.md
- 再创建单个process.js文件
5. Validate Structure
5. 验证结构
Checklist:
- JSDoc header with @process, @description, @inputs, @outputs, @example, @references
- Import from
@a5c-ai/babysitter-sdk - Main
export async function process(inputs, ctx) - Input destructuring with defaults
- Clear phase comments ()
// === PHASE N: NAME === - Logging via
ctx.log?.('info', message) - Tasks via
ctx.task(taskDef, inputs) - Breakpoints at key decision points
- Artifact collection throughout
- Return object matches @outputs schema
检查清单:
- 包含@process、@description、@inputs、@outputs、@example、@references的JSDoc头部
- 从导入依赖
@a5c-ai/babysitter-sdk - 主函数
export async function process(inputs, ctx) - 带默认值的输入解构
- 清晰的阶段注释()
// === 阶段N: 名称 === - 通过记录日志
ctx.log?.('info', message) - 通过调用任务
ctx.task(taskDef, inputs) - 在关键决策点设置断点
- 全程收集产物
- 返回对象与@outputs schema匹配
Examples by Type
按类型分类的示例
Methodology Process (atdd-tdd style)
方法类流程(atdd-tdd风格)
javascript
/**
* @process methodologies/my-methodology
* @description My development methodology with quality convergence
* @inputs { feature: string, targetQuality?: number }
* @outputs { success: boolean, quality: number, artifacts: array }
*/
export async function process(inputs, ctx) {
const { feature, targetQuality = 85 } = inputs;
// ... implementation
}javascript
/**
* @process methodologies/my-methodology
* @description 带质量收敛的自定义开发方法
* @inputs { feature: string, targetQuality?: number }
* @outputs { success: boolean, quality: number, artifacts: array }
*/
export async function process(inputs, ctx) {
const { feature, targetQuality = 85 } = inputs;
// ... 实现代码
}Specialization Process (game-development style)
细分领域流程(游戏开发风格)
javascript
/**
* @process specializations/game-development/core-mechanics-prototyping
* @description Prototype and validate core gameplay mechanics through iteration
* @inputs { prototypeName: string, mechanicsToTest: array, engine?: string }
* @outputs { success: boolean, mechanicsValidated: array, playtestResults: object }
*/
export async function process(inputs, ctx) {
const { prototypeName, mechanicsToTest, engine = 'Unity' } = inputs;
// ... implementation
}javascript
/**
* @process specializations/game-development/core-mechanics-prototyping
* @description 通过迭代实现并验证核心游戏机制原型
* @inputs { prototypeName: string, mechanicsToTest: array, engine?: string }
* @outputs { success: boolean, mechanicsValidated: array, playtestResults: object }
*/
export async function process(inputs, ctx) {
const { prototypeName, mechanicsToTest, engine = 'Unity' } = inputs;
// ... 实现代码
}Domain Process (science/research style)
领域流程(科学/研究风格)
javascript
/**
* @process specializations/domains/science/bioinformatics/sequence-analysis
* @description Analyze genomic sequences using standard bioinformatics workflows
* @inputs { sequences: array, analysisType: string, referenceGenome?: string }
* @outputs { success: boolean, alignments: array, variants: array, report: object }
*/
export async function process(inputs, ctx) {
const { sequences, analysisType, referenceGenome = 'GRCh38' } = inputs;
// ... implementation
}javascript
/**
* @process specializations/domains/science/bioinformatics/sequence-analysis
* @description 使用标准生物信息学工作流分析基因组序列
* @inputs { sequences: array, analysisType: string, referenceGenome?: string }
* @outputs { success: boolean, alignments: array, variants: array, report: object }
*/
export async function process(inputs, ctx) {
const { sequences, analysisType, referenceGenome = 'GRCh38' } = inputs;
// ... 实现代码
}Resources
参考资源
- SDK Reference:
plugins/babysitter/skills/babysit/reference/sdk.md - Methodology Backlog:
plugins/babysitter/skills/babysit/process/methodologies/backlog.md - Specializations Backlog:
plugins/babysitter/skills/babysit/process/specializations/backlog.md - Example: ATDD/TDD:
plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/ - Example: Spec-Driven:
plugins/babysitter/skills/babysit/process/methodologies/spec-driven-development.js - README: Root for full framework documentation
README.md
- SDK参考文档:
plugins/babysitter/skills/babysit/reference/sdk.md - 方法类待办列表:
plugins/babysitter/skills/babysit/process/methodologies/backlog.md - 细分领域待办列表:
plugins/babysitter/skills/babysit/process/specializations/backlog.md - 示例:ATDD/TDD:
plugins/babysitter/skills/babysit/process/methodologies/atdd-tdd/ - 示例:规范驱动开发:
plugins/babysitter/skills/babysit/process/methodologies/spec-driven-development.js - 主文档: 根目录(完整框架文档)
README.md