ralph-prompt-multi-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ralph Prompt Generator: Multi-Task

Ralph 多任务提示词生成器

Overview

概述

Generates structured prompts for multiple related tasks that need to be completed in sequence or parallel. Uses phase-based organization with milestone tracking, cumulative success criteria, and clear progression through tasks.
Best For:
  • CRUD operation implementations (Create, Read, Update, Delete)
  • Multi-step feature development
  • Database migrations with multiple stages
  • API endpoint suites
  • Test suite creation for multiple modules
  • Multi-file refactoring projects
Ralph Philosophy: This generator embraces the principle that failures are deterministic and fixable. Each phase iteration learns from previous attempts. Don't fear failures—they're expected and provide data for improvement through prompt tuning.
为需要按顺序或并行完成的多个关联任务生成结构化提示词。采用基于阶段的组织方式,包含里程碑追踪、累计成功标准以及清晰的任务推进流程。
最佳适用场景:
  • CRUD操作实现(创建、读取、更新、删除)
  • 多步骤功能开发
  • 多阶段数据库迁移
  • API端点套件开发
  • 多模块测试套件创建
  • 多文件重构项目
Ralph 理念:本生成器秉持“失败是可确定且可修复的”原则。每个阶段的迭代都会从之前的尝试中学习。无需惧怕失败——失败是预期之内的,且能为通过提示词调优进行改进提供数据支持。

Quick Start

快速开始

Input Required:
  1. List of tasks to complete
  2. Task dependencies (which tasks depend on others)
  3. Success criteria for each task
  4. Final completion promise
Generate prompt with:
Generate a Ralph multi-task prompt for:
Tasks:
1. [Task 1]
2. [Task 2]
3. [Task 3]
Dependencies: [Task 2 depends on Task 1, etc.]
Final promise: [COMPLETION_PHRASE]
所需输入:
  1. 待完成的任务列表
  2. 任务依赖关系(哪些任务依赖于其他任务)
  3. 每个任务的成功标准
  4. 最终完成承诺
生成提示词的命令:
Generate a Ralph multi-task prompt for:
Tasks:
1. [Task 1]
2. [Task 2]
3. [Task 3]
Dependencies: [Task 2 depends on Task 1, etc.]
Final promise: [COMPLETION_PHRASE]

Prompt Generation Workflow

提示词生成流程

Step 1: Map the Tasks

步骤1:梳理任务

Create a task inventory:
Task #Task NameDependenciesVerificationEst. Complexity
1[Name]None[How to verify]Low/Med/High
2[Name]Task 1[How to verify]Low/Med/High
3[Name]Task 1[How to verify]Low/Med/High
4[Name]Tasks 2, 3[How to verify]Low/Med/High
创建任务清单:
任务编号任务名称依赖关系验证方式预估复杂度
1[名称][验证方法]低/中/高
2[名称]任务1[验证方法]低/中/高
3[名称]任务1[验证方法]低/中/高
4[名称]任务2、3[验证方法]低/中/高

Step 2: Define Phases

步骤2:定义阶段

Group tasks into logical phases:
Phase Structure:
  • Phase 1: Foundation - Independent setup tasks, no dependencies
  • Phase 2: Core Implementation - Main functionality, depends on Phase 1
  • Phase 3: Enhancement - Additional features, depends on Phase 2
  • Phase 4: Validation - Testing, cleanup, verification
将任务分组为逻辑阶段:
阶段结构:
  • 阶段1:基础搭建 - 独立的准备任务,无依赖
  • 阶段2:核心实现 - 主要功能,依赖阶段1
  • 阶段3:功能增强 - 附加功能,依赖阶段2
  • 阶段4:验证验收 - 测试、清理、验证工作

Step 3: Create Phase Milestones

步骤3:创建阶段里程碑

Each phase needs:
  • Clear entry criteria (what must be done to start)
  • Specific tasks within the phase
  • Exit criteria (what proves phase is complete)
  • Phase milestone marker
每个阶段需要包含:
  • 明确的进入标准(开始前必须完成的事项)
  • 阶段内的具体任务
  • 退出标准(证明阶段完成的依据)
  • 阶段里程碑标记

Step 4: Structure the Prompt

步骤4:构建提示词结构

Use this template:
markdown
undefined
使用以下模板:
markdown
undefined

Multi-Task: [Overall Objective]

多任务:[整体目标]

Overview

概述

[1-2 sentences describing the overall goal and scope]
[1-2句话描述整体目标和范围]

Task Inventory

任务清单

#TaskPhaseDependenciesVerification
1[Task 1]1None[Verification]
2[Task 2]2Task 1[Verification]
3[Task 3]2Task 1[Verification]
4[Task 4]3Tasks 2, 3[Verification]
编号任务阶段依赖关系验证方式
1[任务1]1[验证方式]
2[任务2]2任务1[验证方式]
3[任务3]2任务1[验证方式]
4[任务4]3任务2、3[验证方式]

Phase 1: [Phase Name] (Foundation)

阶段1:[阶段名称](基础搭建)

Objective

目标

[What this phase accomplishes]
[本阶段要完成的内容]

Tasks

任务

  1. [Task 1 Name]
    • Requirements: [Specific requirements]
    • Files: [Files to create/modify]
    • Verification: [How to verify]
  1. [任务1名称]
    • 要求:[具体要求]
    • 文件:[需要创建/修改的文件]
    • 验证:[验证方法]

Phase 1 Success Criteria

阶段1成功标准

  • [Criterion 1]
  • [Criterion 2]
  • Tests pass:
    [test command]
  • [标准1]
  • [标准2]
  • 测试通过:
    [测试命令]

Phase 1 Checkpoint

阶段1检查点

When Phase 1 criteria met, document:
PHASE 1 COMPLETE:
- [Task 1]: Done - [evidence]
- Tests: [pass/fail status]
Continue to Phase 2.

当阶段1标准达成后,记录:
PHASE 1 COMPLETE:
- [任务1]: 完成 - [证明材料]
- 测试:[通过/失败状态]
进入阶段2。

Phase 2: [Phase Name] (Core)

阶段2:[阶段名称](核心实现)

Objective

目标

[What this phase accomplishes]
[本阶段要完成的内容]

Prerequisites

前置条件

  • Phase 1 complete
  • [Any specific requirements]
  • 阶段1已完成
  • [其他特定要求]

Tasks

任务

  1. [Task 2 Name]
    • Requirements: [Specific requirements]
    • Files: [Files to create/modify]
    • Verification: [How to verify]
  2. [Task 3 Name]
    • Requirements: [Specific requirements]
    • Files: [Files to create/modify]
    • Verification: [How to verify]
  1. [任务2名称]
    • 要求:[具体要求]
    • 文件:[需要创建/修改的文件]
    • 验证:[验证方法]
  2. [任务3名称]
    • 要求:[具体要求]
    • 文件:[需要创建/修改的文件]
    • 验证:[验证方法]

Phase 2 Success Criteria

阶段2成功标准

  • [Criterion 1]
  • [Criterion 2]
  • [Criterion 3]
  • Tests pass:
    [test command]
  • [标准1]
  • [标准2]
  • [标准3]
  • 测试通过:
    [测试命令]

Phase 2 Checkpoint

阶段2检查点

When Phase 2 criteria met, document:
PHASE 2 COMPLETE:
- [Task 2]: Done - [evidence]
- [Task 3]: Done - [evidence]
- Tests: [pass/fail status]
Continue to Phase 3.

当阶段2标准达成后,记录:
PHASE 2 COMPLETE:
- [任务2]: 完成 - [证明材料]
- [任务3]: 完成 - [证明材料]
- 测试:[通过/失败状态]
进入阶段3。

Phase 3: [Phase Name] (Enhancement/Validation)

阶段3:[阶段名称](功能增强/验证验收)

Objective

目标

[What this phase accomplishes]
[本阶段要完成的内容]

Prerequisites

前置条件

  • Phases 1-2 complete
  • [Any specific requirements]
  • 阶段1-2已完成
  • [其他特定要求]

Tasks

任务

  1. [Task 4 Name]
    • Requirements: [Specific requirements]
    • Files: [Files to create/modify]
    • Verification: [How to verify]
  1. [任务4名称]
    • 要求:[具体要求]
    • 文件:[需要创建/修改的文件]
    • 验证:[验证方法]

Phase 3 Success Criteria

阶段3成功标准

  • [Criterion 1]
  • [Criterion 2]
  • All tests pass:
    [test command]

  • [标准1]
  • [标准2]
  • 所有测试通过:
    [测试命令]

Final Verification

最终验证

Run complete verification:
bash
undefined
执行完整验证:
bash
undefined

All tests

所有测试

[full test command]
[完整测试命令]

Integration check

集成检查

[integration verification]
[集成验证命令]

Lint/Type check

代码检查/类型检查

[lint command]
undefined
[代码检查命令]
undefined

Completion Checklist

完成 checklist

  • Phase 1: All tasks complete and verified
  • Phase 2: All tasks complete and verified
  • Phase 3: All tasks complete and verified
  • All tests passing
  • No regressions
  • [Any additional requirements]
  • 阶段1:所有任务完成并验证
  • 阶段2:所有任务完成并验证
  • 阶段3:所有任务完成并验证
  • 所有测试通过
  • 无回归问题
  • [其他附加要求]

Completion

完成标识

When ALL phases complete and all checklist items verified:
Output: <promise>[COMPLETION_PHRASE]</promise>
当所有阶段完成且所有checklist项验证通过后:
输出:<promise>[COMPLETION_PHRASE]</promise>

Progress Tracking

进度追踪

As you work, track progress in this format:
PROGRESS:
Phase 1: [COMPLETE/IN PROGRESS] - [X/Y tasks]
Phase 2: [COMPLETE/IN PROGRESS/NOT STARTED] - [X/Y tasks]
Phase 3: [COMPLETE/IN PROGRESS/NOT STARTED] - [X/Y tasks]
Overall: [X/Y tasks complete]
工作过程中,按以下格式追踪进度:
PROGRESS:
Phase 1: [已完成/进行中] - [已完成任务数/总任务数]
Phase 2: [已完成/进行中/未开始] - [已完成任务数/总任务数]
Phase 3: [已完成/进行中/未开始] - [已完成任务数/总任务数]
Overall: [已完成任务数/总任务数] 任务完成

If Stuck

遇到阻塞时

  • Document which phase/task is blocking
  • List what's been tried
  • Identify the specific blocker
  • Do NOT skip tasks or output false promise
undefined
  • 记录哪个阶段/任务被阻塞
  • 列出已尝试的解决方法
  • 明确具体的阻塞点
  • 不要跳过任务或输出虚假的完成承诺
undefined

Example Prompts

示例提示词

Example 1: CRUD API Implementation

示例1:CRUD API实现

Input:
  • Tasks: Create, Read (single), Read (list), Update, Delete for Products
  • Dependencies: Create first, then others can be parallel
  • Promise: CRUD_API_COMPLETE
Generated Prompt:
markdown
undefined
输入:
  • 任务:产品的创建、读取(单个)、读取(列表)、更新、删除
  • 依赖关系:先完成创建,其他任务可并行
  • 完成承诺:CRUD_API_COMPLETE
生成的提示词:
markdown
undefined

Multi-Task: Product CRUD API Implementation

多任务:产品CRUD API实现

Overview

概述

Implement complete CRUD operations for Products resource with RESTful endpoints, validation, and comprehensive tests.
为产品资源实现完整的CRUD操作,包含RESTful端点、验证机制和全面的测试。

Task Inventory

任务清单

#TaskPhaseDependenciesVerification
1Product model/schema1NoneModel exists, validates
2POST /products (Create)2Task 1Returns 201, creates record
3GET /products/:id (Read)2Task 1Returns 200, correct data
4GET /products (List)2Task 1Returns array, pagination
5PUT /products/:id (Update)3Tasks 2,3Returns 200, updates record
6DELETE /products/:id3Tasks 2,3Returns 204, removes record
7Integration tests4Tasks 2-6All scenarios pass
编号任务阶段依赖关系验证方式
1产品模型/ schema1模型存在且验证有效
2POST /products(创建)2任务1返回201状态码并创建记录
3GET /products/:id(读取单个)2任务1返回200状态码和正确数据
4GET /products(读取列表)2任务1返回数组并支持分页
5PUT /products/:id(更新)3任务2、3返回200状态码并更新记录
6DELETE /products/:id(删除)3任务2、3返回204状态码并移除记录
7集成测试4任务2-6所有场景测试通过

Phase 1: Foundation

阶段1:基础搭建

Objective

目标

Create Product model with validation and database schema.
创建带有验证规则的产品模型和数据库schema。

Tasks

任务

  1. Product Model
    • Requirements:
      • Fields: id, name, description, price, category, createdAt, updatedAt
      • Validation: name required, price > 0, category from enum
    • Files:
      src/models/product.ts
      ,
      src/schemas/product.ts
    • Verification: Model compiles, validation tests pass
  1. 产品模型
    • 要求:
      • 字段:id、name、description、price、category、createdAt、updatedAt
      • 验证规则:name为必填项,price大于0,category为枚举值
    • 文件:
      src/models/product.ts
      ,
      src/schemas/product.ts
    • 验证:模型编译通过,验证测试通过

Phase 1 Success Criteria

阶段1成功标准

  • Product model created with all fields
  • Validation rules implemented
  • Database migration/schema created
  • Model tests pass:
    npm test -- --grep "Product model"
  • 产品模型已创建且包含所有字段
  • 验证规则已实现
  • 数据库迁移/schema已创建
  • 模型测试通过:
    npm test -- --grep "Product model"

Phase 1 Checkpoint

阶段1检查点

PHASE 1 COMPLETE:
- Product model: Done - all fields, validation working
- Tests: All model tests passing

PHASE 1 COMPLETE:
- 产品模型:完成 - 所有字段、验证规则生效
- 测试:所有模型测试通过

Phase 2: Core CRUD Operations

阶段2:核心CRUD操作

Objective

目标

Implement Create, Read (single), and Read (list) endpoints.
实现创建、读取(单个)、读取(列表)端点。

Prerequisites

前置条件

  • Phase 1 complete (Product model exists)
  • 阶段1已完成(产品模型存在)

Tasks

任务

  1. POST /products (Create)
    • Requirements:
      • Accept JSON body with product data
      • Validate input using schema
      • Return 201 with created product
      • Return 400 for validation errors
    • Files:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • Verification:
      curl -X POST -H "Content-Type: application/json" -d '{"name":"Test","price":9.99,"category":"electronics"}' localhost:3000/products
  2. GET /products/:id (Read Single)
    • Requirements:
      • Return 200 with product data
      • Return 404 if not found
    • Files:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • Verification:
      curl localhost:3000/products/1
  3. GET /products (List)
    • Requirements:
      • Return array of products
      • Support pagination: page, limit query params
      • Return metadata: total, page, limit, totalPages
    • Files:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • Verification:
      curl "localhost:3000/products?page=1&limit=10"
  1. POST /products(创建)
    • 要求:
      • 接受包含产品数据的JSON请求体
      • 使用schema验证输入
      • 返回201状态码和创建的产品信息
      • 验证错误时返回400状态码
    • 文件:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • 验证:
      curl -X POST -H "Content-Type: application/json" -d '{"name":"Test","price":9.99,"category":"electronics"}' localhost:3000/products
  2. GET /products/:id(读取单个)
    • 要求:
      • 返回200状态码和产品数据
      • 产品不存在时返回404状态码
    • 文件:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • 验证:
      curl localhost:3000/products/1
  3. GET /products(读取列表)
    • 要求:
      • 返回产品数组
      • 支持分页:page、limit查询参数
      • 返回元数据:total、page、limit、totalPages
    • 文件:
      src/routes/products.ts
      ,
      src/controllers/products.ts
    • 验证:
      curl "localhost:3000/products?page=1&limit=10"

Phase 2 Success Criteria

阶段2成功标准

  • POST /products creates product, returns 201
  • POST /products returns 400 for invalid data
  • GET /products/:id returns product
  • GET /products/:id returns 404 for missing
  • GET /products returns paginated list
  • All endpoint tests pass:
    npm test -- --grep "products"
  • POST /products可创建产品并返回201
  • POST /products对无效数据返回400
  • GET /products/:id可返回产品数据
  • GET /products/:id对不存在的产品返回404
  • GET /products可返回分页列表
  • 所有端点测试通过:
    npm test -- --grep "products"

Phase 2 Checkpoint

阶段2检查点

PHASE 2 COMPLETE:
- POST /products: Done - creates products, validates input
- GET /products/:id: Done - returns product or 404
- GET /products: Done - paginated list working
- Tests: All passing

PHASE 2 COMPLETE:
- POST /products:完成 - 可创建产品并验证输入
- GET /products/:id:完成 - 可返回产品或404
- GET /products:完成 - 分页列表功能正常
- 测试:所有测试通过

Phase 3: Update and Delete Operations

阶段3:更新与删除操作

Objective

目标

Complete CRUD with Update and Delete endpoints.
完成CRUD的更新和删除端点实现。

Prerequisites

前置条件

  • Phase 2 complete (Create and Read working)
  • 阶段2已完成(创建和读取功能正常)

Tasks

任务

  1. PUT /products/:id (Update)
    • Requirements:
      • Accept JSON body with update data
      • Partial updates allowed
      • Return 200 with updated product
      • Return 404 if not found
      • Return 400 for validation errors
    • Verification:
      curl -X PUT -H "Content-Type: application/json" -d '{"price":19.99}' localhost:3000/products/1
  2. DELETE /products/:id
    • Requirements:
      • Return 204 on success (no content)
      • Return 404 if not found
      • Actually remove record from database
    • Verification:
      curl -X DELETE localhost:3000/products/1
  1. PUT /products/:id(更新)
    • 要求:
      • 接受包含更新数据的JSON请求体
      • 支持部分更新
      • 返回200状态码和更新后的产品信息
      • 产品不存在时返回404状态码
      • 验证错误时返回400状态码
    • 验证:
      curl -X PUT -H "Content-Type: application/json" -d '{"price":19.99}' localhost:3000/products/1
  2. DELETE /products/:id(删除)
    • 要求:
      • 成功时返回204状态码(无内容)
      • 产品不存在时返回404状态码
      • 从数据库中实际移除记录
    • 验证:
      curl -X DELETE localhost:3000/products/1

Phase 3 Success Criteria

阶段3成功标准

  • PUT /products/:id updates product
  • PUT returns 404 for missing, 400 for invalid
  • DELETE /products/:id removes product
  • DELETE returns 404 for missing
  • All endpoint tests pass
  • PUT /products/:id可更新产品
  • PUT对不存在的产品返回404,对无效数据返回400
  • DELETE /products/:id可移除产品
  • DELETE对不存在的产品返回404
  • 所有端点测试通过

Phase 3 Checkpoint

阶段3检查点

PHASE 3 COMPLETE:
- PUT /products/:id: Done - updates work
- DELETE /products/:id: Done - deletes work
- Tests: All passing

PHASE 3 COMPLETE:
- PUT /products/:id:完成 - 更新功能正常
- DELETE /products/:id:完成 - 删除功能正常
- 测试:所有测试通过

Phase 4: Integration & Validation

阶段4:集成与验证

Objective

目标

Complete test coverage and integration verification.
完成测试覆盖和集成验证。

Tasks

任务

  1. Integration Tests
    • Requirements:
      • Full CRUD flow test (create, read, update, delete)
      • Error handling tests (400, 404 scenarios)
      • Pagination tests
      • Edge cases (empty database, special characters)
    • Files:
      tests/integration/products.test.ts
  1. 集成测试
    • 要求:
      • 完整的CRUD流程测试(创建、读取、更新、删除)
      • 错误处理测试(400、404场景)
      • 分页测试
      • 边缘场景测试(空数据库、特殊字符)
    • 文件:
      tests/integration/products.test.ts

Phase 4 Success Criteria

阶段4成功标准

  • Integration tests cover full CRUD flow
  • Error scenarios tested
  • All tests passing:
    npm test
  • No TypeScript errors:
    npm run typecheck

  • 集成测试覆盖完整CRUD流程
  • 错误场景已测试
  • 所有测试通过:
    npm test
  • 无TypeScript错误:
    npm run typecheck

Final Verification

最终验证

bash
undefined
bash
undefined

All tests

所有测试

npm test
npm test

Type check

类型检查

npm run typecheck
npm run typecheck

Manual CRUD flow test

手动CRUD流程测试

curl -X POST -H "Content-Type: application/json" -d '{"name":"Test Product","price":29.99,"category":"electronics"}' localhost:3000/products curl localhost:3000/products curl localhost:3000/products/1 curl -X PUT -H "Content-Type: application/json" -d '{"price":39.99}' localhost:3000/products/1 curl -X DELETE localhost:3000/products/1
undefined
curl -X POST -H "Content-Type: application/json" -d '{"name":"Test Product","price":29.99,"category":"electronics"}' localhost:3000/products curl localhost:3000/products curl localhost:3000/products/1 curl -X PUT -H "Content-Type: application/json" -d '{"price":39.99}' localhost:3000/products/1 curl -X DELETE localhost:3000/products/1
undefined

Completion Checklist

完成checklist

  • Phase 1: Product model complete
  • Phase 2: Create, Read single, Read list working
  • Phase 3: Update, Delete working
  • Phase 4: Integration tests complete
  • All tests passing
  • Manual verification successful
  • 阶段1:产品模型完成
  • 阶段2:创建、单个读取、列表读取功能正常
  • 阶段3:更新、删除功能正常
  • 阶段4:集成测试完成
  • 所有测试通过
  • 手动验证成功

Completion

完成标识

When ALL phases complete and all checklist items verified:
Output: <promise>CRUD_API_COMPLETE</promise>
当所有阶段完成且所有checklist项验证通过后:
输出:<promise>CRUD_API_COMPLETE</promise>

Progress Tracking

进度追踪

PROGRESS:
Phase 1: [status] - 1/1 tasks
Phase 2: [status] - 3/3 tasks
Phase 3: [status] - 2/2 tasks
Phase 4: [status] - 1/1 tasks
Overall: X/7 tasks complete
PROGRESS:
Phase 1: [状态] - 1/1 任务完成
Phase 2: [状态] - 3/3 任务完成
Phase 3: [状态] - 2/2 任务完成
Phase 4: [状态] - 1/1 任务完成
Overall: X/7 任务完成

If Stuck

遇到阻塞时

  • Document which phase/task is blocking
  • Note specific error messages
  • List approaches tried
  • Do NOT skip tasks or output false promise
undefined
  • 记录哪个阶段/任务被阻塞
  • 记录具体的错误信息
  • 列出已尝试的解决方法
  • 不要跳过任务或输出虚假的完成承诺
undefined

Example 2: CI/CD Pipeline Setup

示例2:CI/CD流水线搭建

Input:
  • Tasks: Lint, Test, Build, Deploy staging, Deploy prod
  • Dependencies: Sequential progression
  • Promise: PIPELINE_COMPLETE
Generated Prompt:
markdown
undefined
输入:
  • 任务:代码检查、测试、构建、部署到预发布环境、部署到生产环境
  • 依赖关系:按顺序推进
  • 完成承诺:PIPELINE_COMPLETE
生成的提示词:
markdown
undefined

Multi-Task: CI/CD Pipeline Implementation

多任务:CI/CD流水线实现

Overview

概述

Set up complete CI/CD pipeline with linting, testing, building, and staged deployments using GitHub Actions.
使用GitHub Actions搭建完整的CI/CD流水线,包含代码检查、测试、构建和分阶段部署。

Task Inventory

任务清单

#TaskPhaseDependenciesVerification
1Workflow file structure1NoneFile exists
2Lint job2Task 1Workflow runs lint
3Test job2Task 2Tests run in CI
4Build job3Task 3Build artifacts created
5Deploy staging4Task 4Staging deployment works
6Deploy production4Task 5Prod deployment works
编号任务阶段依赖关系验证方式
1工作流文件结构1文件存在
2代码检查任务2任务1工作流执行代码检查
3测试任务2任务2测试在CI中执行
4构建任务3任务3生成构建产物
5部署到预发布环境4任务4预发布部署成功
6部署到生产环境4任务5生产部署成功

Phase 1: Workflow Foundation

阶段1:工作流基础

Tasks

任务

  1. Workflow File Structure
    • Create
      .github/workflows/ci.yml
    • Define triggers (push to main, PRs)
    • Set up job structure
  1. 工作流文件结构
    • 创建
      .github/workflows/ci.yml
    • 定义触发条件(推送到main分支、PR)
    • 搭建任务结构

Phase 1 Success Criteria

阶段1成功标准

  • Workflow file exists and is valid YAML
  • Triggers defined for push and PR

  • 工作流文件存在且为有效的YAML格式
  • 已定义推送和PR的触发条件

Phase 2: Quality Gates

阶段2:质量门禁

Tasks

任务

  1. Lint Job
    • Run linter on all source files
    • Fail pipeline if lint errors
  2. Test Job
    • Depends on lint passing
    • Run full test suite
    • Upload coverage report
  1. 代码检查任务
    • 对所有源代码执行代码检查
    • 存在代码检查错误时流水线失败
  2. 测试任务
    • 依赖代码检查通过
    • 执行完整测试套件
    • 上传覆盖率报告

Phase 2 Success Criteria

阶段2成功标准

  • Lint job runs and catches errors
  • Test job runs full suite
  • Pipeline fails if tests fail

  • 代码检查任务执行并能捕获错误
  • 测试任务执行完整测试套件
  • 测试失败时流水线终止

Phase 3: Build

阶段3:构建

Tasks

任务

  1. Build Job
    • Depends on tests passing
    • Create production build
    • Upload build artifacts
  1. 构建任务
    • 依赖测试通过
    • 生成生产环境构建产物
    • 上传构建产物

Phase 3 Success Criteria

阶段3成功标准

  • Build creates production artifacts
  • Artifacts uploaded and accessible

  • 构建生成生产环境产物
  • 构建产物已上传且可访问

Phase 4: Deployments

阶段4:部署

Tasks

任务

  1. Deploy Staging
    • Automatic on main branch
    • Deploy to staging environment
  2. Deploy Production
    • Manual approval required
    • Deploy to production
  1. 部署到预发布环境
    • 推送到main分支时自动部署
    • 部署到预发布环境
  2. 部署到生产环境
    • 需要手动审批
    • 部署到生产环境

Phase 4 Success Criteria

阶段4成功标准

  • Staging auto-deploys on main
  • Production requires manual trigger
  • Both environments update correctly

  • 预发布环境在main分支推送时自动部署
  • 生产环境需要手动触发
  • 两个环境都能正确更新

Completion

完成标识

When all phases verified:
Output: <promise>PIPELINE_COMPLETE</promise>
undefined
当所有阶段验证通过后:
输出:<promise>PIPELINE_COMPLETE</promise>
undefined

Best Practices

最佳实践

Task Organization

任务组织

  • Group related tasks into phases
  • Clear dependencies between phases
  • Independent tasks within phases can be parallel
  • 将关联任务分组到同一阶段
  • 明确阶段间的依赖关系
  • 阶段内的独立任务可并行执行

Phase Design

阶段设计

  • Each phase has clear entry/exit criteria
  • Document checkpoint at each phase boundary
  • Phase names should reflect purpose (Foundation, Core, Enhancement, Validation)
  • 每个阶段有明确的进入/退出标准
  • 在每个阶段边界记录检查点
  • 阶段名称应反映其用途(基础搭建、核心实现、功能增强、验证验收)

Progress Tracking

进度追踪

  • Update progress marker after each task
  • Document evidence at checkpoints
  • Don't skip phases even if tasks seem simple
  • 完成每个任务后更新进度标记
  • 在检查点记录证明材料
  • 即使任务看似简单,也不要跳过阶段

DO:

建议:

  • Create clear phase boundaries
  • Define dependencies explicitly
  • Include verification for each task
  • Track progress systematically
  • Checkpoint after each phase
  • 创建清晰的阶段边界
  • 明确定义依赖关系
  • 为每个任务包含验证方式
  • 系统地追踪进度
  • 每个阶段后设置检查点

DON'T:

禁忌:

  • Skip phases or tasks
  • Leave dependencies unclear
  • Forget phase checkpoints
  • Output promise before all phases complete
  • 跳过阶段或任务
  • 依赖关系不明确
  • 遗漏阶段检查点
  • 所有阶段完成前输出完成承诺

Integration with Ralph Loop

与Ralph Loop集成

bash
/ralph-wiggum:ralph-loop "[paste generated prompt]" --completion-promise "YOUR_PROMISE" --max-iterations 50
Recommended iterations by complexity:
  • 4-5 tasks:
    --max-iterations 35-45
  • 6-8 tasks:
    --max-iterations 50-70
  • 9+ tasks:
    --max-iterations 80-100

For single-task prompts, see
ralph-prompt-single-task
. For project-level prompts, see
ralph-prompt-project
. For research/analysis prompts, see
ralph-prompt-research
.
bash
/ralph-wiggum:ralph-loop "[粘贴生成的提示词]" --completion-promise "YOUR_PROMISE" --max-iterations 50
按复杂度推荐的迭代次数:
  • 4-5个任务:
    --max-iterations 35-45
  • 6-8个任务:
    --max-iterations 50-70
  • 9个以上任务:
    --max-iterations 80-100

关于单任务提示词,请查看
ralph-prompt-single-task
。 关于项目级提示词,请查看
ralph-prompt-project
。 关于研究/分析类提示词,请查看
ralph-prompt-research