blueprint-prp-execute

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/blueprint:prp-execute

/blueprint:prp-execute

Execute a PRP (Product Requirement Prompt) with systematic implementation, validation gates, TDD workflow, and quality assurance.
Usage:
/blueprint:prp-execute [prp-name]
Prerequisites:
  • PRP exists in
    docs/prps/[prp-name].md
  • Confidence score >= 7 (if lower, suggest
    /blueprint:prp-create
    refinement)
For detailed report templates, deferred items workflow, feature tracker sync, and error handling patterns, see REFERENCE.md.
执行PRP(Product Requirement Prompt,产品需求提示),包含系统化实现、验证关卡、TDD工作流和质量保证。
用法
/blueprint:prp-execute [prp-name]
前提条件
  • PRP已存在于
    docs/prps/[prp-name].md
  • 置信度评分 >=7(若低于该值,建议使用
    /blueprint:prp-create
    进行优化)
关于详细的报告模板、延期项工作流、功能跟踪器同步和错误处理模式,请查看REFERENCE.md

When to Use This Skill

何时使用该技能

Use this skill when...Use alternative when...
Ready to implement a planned feature from a PRPPRP is not yet ready (confidence < 7)
Want to execute with full validation and TDD workflowImplementing ad-hoc features without documentation
Need feature tracker and GitHub issue trackingWorking on isolated bug fixes
Want automatic progress reporting and deferred items trackingQuick prototyping without formal tracking
适合使用本技能的场景...适合使用替代方案的场景...
准备从PRP实现已规划的功能PRP尚未就绪(置信度 <7)
希望通过完整的验证和TDD工作流执行实现无文档记录的临时功能
需要功能跟踪器和GitHub问题跟踪处理孤立的Bug修复
希望自动跟踪进度和延期项无需正式跟踪的快速原型开发

Context

上下文

  • PRP file path: !
    find . -maxdepth 1 -name \'docs/prps/${1:-unknown}.md\' 2>/dev/null
  • PRP confidence score: !
    grep -m1 "^confidence:" docs/prps/${1:-unknown}.md 2>/dev/null
  • Feature tracker enabled: !
    test -f docs/blueprint/feature-tracker.json 2>/dev/null
  • Current branch: !
    git rev-parse --abbrev-ref HEAD 2>/dev/null
  • Uncommitted changes: !
    git status --porcelain 2>/dev/null
  • PRP文件路径:!
    find . -maxdepth 1 -name \'docs/prps/${1:-unknown}.md\' 2>/dev/null
  • PRP置信度评分:!
    grep -m1 "^confidence:" docs/prps/${1:-unknown}.md 2>/dev/null
  • 功能跟踪器已启用:!
    test -f docs/blueprint/feature-tracker.json 2>/dev/null
  • 当前分支:!
    git rev-parse --abbrev-ref HEAD 2>/dev/null
  • 未提交的更改:!
    git status --porcelain 2>/dev/null

Parameters

参数解析

Parse
$ARGUMENTS
:
  • prp-name
    (required): Name of PRP file in
    docs/prps/
    (without .md extension)
    • Example:
      feature-auth-oauth2
      → loads
      docs/prps/feature-auth-oauth2.md
解析
$ARGUMENTS
  • prp-name
    (必填):
    docs/prps/
    目录下PRP文件的名称(不含.md扩展名)
    • 示例:
      feature-auth-oauth2
      → 加载
      docs/prps/feature-auth-oauth2.md

Execution

执行流程

Execute the complete PRP implementation workflow:
执行完整的PRP实现工作流:

Step 1: Load and validate PRP

步骤1:加载并验证PRP

  1. Read PRP file:
    docs/prps/{prp-name}.md
  2. Extract confidence score from frontmatter
  3. If confidence < 7 → Error: "PRP confidence too low. Run
    /blueprint:prp-create {prp-name}
    to refine"
  4. If confidence >= 9 → Offer delegation: "This PRP has high confidence. Execute now (current session) or create work-order for delegation?"
    • If work-order chosen → Run
      /blueprint:work-order --from-prp {prp-name}
      and exit
    • If delegation to multiple subagents chosen → Create focused work-orders per module from Implementation Blueprint and exit
  5. Continue to Step 2 if executing now OR confidence 7-8
  6. Load all referenced ai_docs entries for context
  7. Parse Implementation Blueprint and create TodoWrite entries ordered by dependencies
  1. 读取PRP文件:
    docs/prps/{prp-name}.md
  2. 从前置元数据中提取置信度评分
  3. 若置信度 <7 → 错误提示:"PRP置信度过低。请运行
    /blueprint:prp-create {prp-name}
    进行优化"
  4. 若置信度 >=9 → 提供委托选项:"该PRP置信度较高。立即执行(当前会话)还是创建工单进行委托?"
    • 若选择工单 → 运行
      /blueprint:work-order --from-prp {prp-name}
      并退出
    • 若选择委托给多个子Agent → 根据实现蓝图为每个模块创建针对性工单并退出
  5. 若选择立即执行,或置信度为7-8,则继续步骤2
  6. 加载所有相关的ai_docs条目以获取上下文
  7. 解析实现蓝图并按依赖顺序创建TodoWrite条目

Step 2: Establish baseline with validation gates

步骤2:通过验证关卡建立基线

Run pre-implementation validation gates (see REFERENCE.md) to establish clean starting state:
  1. Linting gate:
    [command from PRP]
    - Expected: PASS
  2. Existing tests gate:
    [command from PRP]
    - Expected: PASS
If gates fail:
  • Document existing issues
  • Decide: fix first or proceed with note
  • Continue when ready
运行实现前的验证关卡(参见REFERENCE.md)以建立干净的起始状态:
  1. 代码检查关卡:
    [PRP中指定的命令]
    - 预期结果:通过
  2. 现有测试关卡:
    [PRP中指定的命令]
    - 预期结果:通过
若关卡未通过:
  • 记录现有问题
  • 决策:先修复问题还是附带说明继续执行
  • 准备就绪后继续

Step 3: Execute TDD implementation cycle

步骤3:执行TDD实现周期

For each task in Implementation Blueprint:
  1. RED phase: Write failing test matching PRP TDD Requirements
    • Create test file if needed
    • Run tests → Confirm FAILURE (test is meaningful)
  2. GREEN phase: Implement minimal code to pass test
    • Follow Codebase Intelligence patterns from PRP
    • Apply patterns from ai_docs references
    • Watch for Known Gotchas
    • Run tests → Confirm SUCCESS
  3. REFACTOR phase: Improve code while keeping tests green
    • Extract common patterns
    • Improve naming, add type hints
    • Follow project conventions
    • Run tests → Confirm PASS
    • Run validation gates frequently (not just at end)
  4. Mark progress: Update TodoWrite:
    ✅ Task N: [Description]
针对实现蓝图中的每个任务:
  1. RED阶段:编写符合PRP中TDD要求的失败测试
    • 若需要则创建测试文件
    • 运行测试 → 确认失败(确保测试有实际意义)
  2. GREEN阶段:实现最小化代码以通过测试
    • 遵循PRP中的代码库智能模式
    • 应用ai_docs引用中的模式
    • 注意已知陷阱(Known Gotchas)
    • 运行测试 → 确认成功
  3. REFACTOR阶段:在保持测试通过的同时优化代码
    • 提取通用模式
    • 优化命名、添加类型提示
    • 遵循项目规范
    • 运行测试 → 确认通过
    • 频繁运行验证关卡(而非仅在最后执行)
  4. 标记进度:更新TodoWrite:
    ✅ 任务N:[描述]

Step 4: Run comprehensive final validation

步骤4:运行全面的最终验证

Execute all validation gates from PRP (see REFERENCE.md):
  • Linting:
    [cmd]
    - Expected: PASS
  • Type checking:
    [cmd]
    - Expected: PASS
  • Unit tests:
    [cmd]
    - Expected: PASS (all tests)
  • Integration tests:
    [cmd]
    - Expected: PASS (if applicable)
  • Coverage check:
    [cmd]
    - Expected: Meets threshold
  • Security scan:
    [cmd]
    - Expected: No high/critical issues (if applicable)
  • Performance tests:
    [cmd]
    - Expected: Meets baseline (if defined)
Verify each success criterion from PRP.
执行PRP中所有的验证关卡(参见REFERENCE.md):
  • 代码检查:
    [命令]
    - 预期结果:通过
  • 类型检查:
    [命令]
    - 预期结果:通过
  • 单元测试:
    [命令]
    - 预期结果:通过(所有测试)
  • 集成测试:
    [命令]
    - 预期结果:通过(若适用)
  • 覆盖率检查:
    [命令]
    - 预期结果:达到阈值
  • 安全扫描:
    [命令]
    - 预期结果:无高/严重问题(若适用)
  • 性能测试:
    [命令]
    - 预期结果:符合基线(若已定义)
验证PRP中的所有成功标准。

Step 5: Document deferred items

步骤5:记录延期项

Identify and track any deferred work:
  1. Review Implementation Blueprint - items not completed
  2. Categorize each deferred item:
    • Phase 2 (Required): Must have GitHub issues created
    • Nice-to-Have: Optional, no issue required
    • Blocked: Cannot complete - document blocker, create issue
  3. Create GitHub issues for all Phase 2 and Blocked items (see REFERENCE.md)
  4. Update PRP with deferred items section linking to GitHub issues
  5. Do NOT proceed to Step 6 until all required issues are created
识别并跟踪所有延期工作:
  1. 审查实现蓝图 - 未完成的项
  2. 对每个延期项进行分类:
    • 第二阶段(必填):必须创建GitHub问题
    • 锦上添花项:可选,无需创建问题
    • 受阻项:无法完成 - 记录阻塞原因,创建问题
  3. 为所有第二阶段和受阻项创建GitHub问题(参见REFERENCE.md
  4. 更新PRP,添加链接到GitHub问题的延期项部分
  5. 在所有必填问题创建完成前,不得进入步骤6

Step 6: Sync feature tracker (if enabled)

步骤6:同步功能跟踪器(若已启用)

If feature tracker exists (
docs/blueprint/feature-tracker.json
):
  1. Identify which feature codes (e.g., FR2.1) were addressed from PRP
  2. Update feature tracker for each code:
    • Status:
      complete
      (all criteria met) or
      partial
      (some criteria met) or
      in_progress
    • Files: List of modified/created files
    • Tests: List of test files
    • Commits: Commit hashes
    • Notes: Implementation notes
  3. Recalculate statistics: completion percentages, phase status
  4. Update TODO.md: Check boxes for completed features
  5. Report feature tracker changes
若功能跟踪器存在(
docs/blueprint/feature-tracker.json
):
  1. 识别PRP中涉及的功能代码(例如FR2.1)
  2. 为每个代码更新功能跟踪器:
    • 状态:
      complete
      (所有标准已满足)或
      partial
      (部分标准已满足)或
      in_progress
    • 文件:已修改/创建的文件列表
    • 测试:测试文件列表
    • 提交:提交哈希值
    • 备注:实现说明
  3. 重新计算统计数据:完成百分比、阶段状态
  4. 更新TODO.md:勾选已完成的功能
  5. 报告功能跟踪器的变更

Step 7: Report results and next steps

步骤7:报告结果和下一步行动

Generate comprehensive execution summary report:
  • Tasks completed: X/Y
  • Tests added: N
  • Files modified: [list]
  • Validation results: Table of all gates (PASS/FAIL status)
  • Success criteria: All verified
  • Deferred items summary: Count and GitHub issue numbers
  • Feature tracker updates: Features updated and percentages
  • New gotchas discovered: [documented for future reference]
  • Recommendations: Follow-up work or ai_docs updates
Prompt user for next action:
  • Commit changes (Recommended) → Run
    /git:commit
  • Create work-order for follow-up → Run
    /blueprint:work-order
  • Update ai_docs with patterns → Run
    /blueprint:curate-docs
  • Continue to next PRP → Run
    /blueprint:prp-execute [next]
  • Done for now → Exit
生成全面的执行总结报告:
  • 已完成任务:X/Y
  • 新增测试:N
  • 已修改文件:[列表]
  • 验证结果:所有关卡的状态表(通过/未通过)
  • 成功标准:全部已验证
  • 延期项摘要:数量及GitHub问题编号
  • 功能跟踪器更新:已更新的功能及百分比
  • 新发现的陷阱:[记录以供未来参考]
  • 建议:后续工作或ai_docs更新
提示用户选择下一步行动:
  • 提交更改(推荐)→ 运行
    /git:commit
  • 创建后续工单 → 运行
    /blueprint:work-order
  • 更新ai_docs中的模式 → 运行
    /blueprint:curate-docs
  • 继续执行下一个PRP → 运行
    /blueprint:prp-execute [next]
  • 暂时结束 → 退出

Agentic Optimizations

Agent优化

ContextCommand
Check PRP exists
test -f docs/prps/${1}.md && echo "EXISTS" || echo "MISSING"
Extract confidence
head -50 docs/prps/${1}.md | grep -m1 "^confidence:" | sed 's/^[^:]*:[[:space:]]*//'
List all PRPs
ls docs/prps/*.md 2>/dev/null | xargs basename -s .md
Check feature tracker
test -f docs/blueprint/feature-tracker.json && echo "YES" || echo "NO"
Fast validationRun validation gates in parallel when possible

For detailed validation gate definitions, deferred items workflow, error handling procedures, and agent team coordination, see REFERENCE.md.
上下文命令
检查PRP是否存在
test -f docs/prps/${1}.md && echo "EXISTS" || echo "MISSING"
提取置信度
head -50 docs/prps/${1}.md | grep -m1 "^confidence:" | sed 's/^[^:]*:[[:space:]]*//'
列出所有PRP
ls docs/prps/*.md 2>/dev/null | xargs basename -s .md
检查功能跟踪器
test -f docs/blueprint/feature-tracker.json && echo "YES" || echo "NO"
快速验证尽可能并行运行验证关卡

关于详细的验证关卡定义、延期项工作流、错误处理流程和Agent团队协作,请查看REFERENCE.md