goodvibes-codebase-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Goodvibes Codebase Review & Remediation

Goodvibes 代码库审查与修复

Systematic codebase analysis with parallelized remediation using goodvibes agents.
CRITICAL: Be objective & completely honest. No sugar coating, EVER.
  • Honest Review: Honest reviews yield better results. Never consider emotions or feelings in your assessments.
借助goodvibes Agent实现系统化代码库分析与并行修复。
重要提示:保持客观且完全诚实。绝不粉饰,永远如此。
  • 诚实审查:诚实的审查才能带来更好的结果。评估时绝不考虑情绪或感受。

Filesystem Boundaries

文件系统边界

CRITICAL: Write-local, read-global.
  • WRITE/EDIT/CREATE: ONLY within the current working directory and its subdirectories. This is the project root. All changes must be git-trackable.
  • READ: Can read any file anywhere for context (node_modules, global configs, other projects for reference, etc.)
  • NEVER WRITE to: parent directories, home directory, system files, other projects, anything outside project root.
The working directory when you were spawned IS the project root. Stay within it for all modifications.
重要提示:本地写入,全局读取。
  • 写入/编辑/创建:仅可在当前工作目录及其子目录内操作。此目录即为项目根目录。所有更改必须可被git追踪。
  • 读取:可读取任意位置的文件以获取上下文(如node_modules、全局配置、其他参考项目等)
  • 禁止写入:父目录、主目录、系统文件、其他项目及项目根目录以外的任何内容。
启动你的工作目录即为项目根目录。所有修改操作均需在此范围内进行。

MCP Tool Checklist (MANDATORY)

MCP工具检查清单(强制执行)

STOP. Before doing ANYTHING, complete this checklist.
CRITICAL PREREQUISITE: You MUST call
mcp-cli info <server>/<tool>
BEFORE ANY
mcp-cli call <server>/<tool>
. This is a BLOCKING REQUIREMENT.
暂停。在执行任何操作前,完成此检查清单。
关键前置要求:在调用任何
mcp-cli call <server>/<tool>
之前,你必须先调用
mcp-cli info <server>/<tool>
。这是一项强制性要求。

Task Start

任务启动

bash
undefined
bash
undefined

ALWAYS check schema first

始终先检查 schema

mcp-cli info plugin_goodvibes_analysis-engine/detect_stack mcp-cli info plugin_goodvibes_registry-engine/recommend_skills mcp-cli info plugin_goodvibes_project-engine/project_issues
mcp-cli info plugin_goodvibes_analysis-engine/detect_stack mcp-cli info plugin_goodvibes_registry-engine/recommend_skills mcp-cli info plugin_goodvibes_project-engine/project_issues

Then make the calls

然后进行调用

mcp-cli call plugin_goodvibes_analysis-engine/detect_stack '{}' mcp-cli call plugin_goodvibes_registry-engine/recommend_skills '{"task":"codebase review quality audit"}' mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined
mcp-cli call plugin_goodvibes_analysis-engine/detect_stack '{}' mcp-cli call plugin_goodvibes_registry-engine/recommend_skills '{"task":"codebase review quality audit"}' mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined

Review Phase

审查阶段

bash
undefined
bash
undefined

Check schemas first

先检查 schema

mcp-cli info plugin_goodvibes_analysis-engine/find_circular_deps mcp-cli info plugin_goodvibes_analysis-engine/scan_for_secrets mcp-cli info plugin_goodvibes_project-engine/analyze_dependencies mcp-cli info plugin_goodvibes_analysis-engine/find_dead_code mcp-cli info plugin_goodvibes_project-engine/get_test_coverage
mcp-cli info plugin_goodvibes_analysis-engine/find_circular_deps mcp-cli info plugin_goodvibes_analysis-engine/scan_for_secrets mcp-cli info plugin_goodvibes_project-engine/analyze_dependencies mcp-cli info plugin_goodvibes_analysis-engine/find_dead_code mcp-cli info plugin_goodvibes_project-engine/get_test_coverage

Then execute

然后执行

mcp-cli call plugin_goodvibes_analysis-engine/find_circular_deps '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_for_secrets '{}' mcp-cli call plugin_goodvibes_project-engine/analyze_dependencies '{}' mcp-cli call plugin_goodvibes_analysis-engine/find_dead_code '{}' mcp-cli call plugin_goodvibes_project-engine/get_test_coverage '{}'
undefined
mcp-cli call plugin_goodvibes_analysis-engine/find_circular_deps '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_for_secrets '{}' mcp-cli call plugin_goodvibes_project-engine/analyze_dependencies '{}' mcp-cli call plugin_goodvibes_analysis-engine/find_dead_code '{}' mcp-cli call plugin_goodvibes_project-engine/get_test_coverage '{}'
undefined

Before Every Edit

每次编辑前

bash
undefined
bash
undefined

Check schemas

检查 schema

mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file mcp-cli info plugin_goodvibes_analysis-engine/validate_edits_preview
mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file mcp-cli info plugin_goodvibes_analysis-engine/validate_edits_preview

Execute

执行

mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"path/to/file.ts"}' mcp-cli call plugin_goodvibes_analysis-engine/validate_edits_preview '{}'
undefined
mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"path/to/file.ts"}' mcp-cli call plugin_goodvibes_analysis-engine/validate_edits_preview '{}'
undefined

After Every Edit

每次编辑后

bash
undefined
bash
undefined

Check schema

检查 schema

mcp-cli info plugin_goodvibes_project-engine/project_issues
mcp-cli info plugin_goodvibes_project-engine/project_issues

Execute

执行

mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'

**THE LAW: If a goodvibes MCP tool can do it, USE THE TOOL. No exceptions.**

---
mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'

**规则:如果goodvibes MCP工具可完成该操作,务必使用工具。无例外。**

---

Precision Tools (MANDATORY)

Precision工具(强制执行)

CRITICAL: Use precision tools, NOT system tools.
Instead OfUseWhy
Read
precision_read
Extract modes, line ranges, outline/symbols
Grep
precision_grep
Output modes, batch queries, context control
Glob
precision_glob
Output modes, filters, preview
Edit
precision_edit
Atomic transactions, validation, hints
Write
precision_write
Atomic, templates, validation
Bash
precision_exec
Batch commands, expectations, output control
重要提示:使用Precision工具,而非系统工具。
替代工具使用工具原因
Read
precision_read
提取模式、行范围、大纲/符号
Grep
precision_grep
输出模式、批量查询、上下文控制
Glob
precision_glob
输出模式、过滤器、预览
Edit
precision_edit
原子事务、验证、提示
Write
precision_write
原子操作、模板、验证
Bash
precision_exec
批量命令、预期结果、输出控制

Precision Tool Patterns

Precision工具使用示例

yaml
undefined
yaml
undefined

Find files with pattern (minimal output)

查找包含指定模式的文件(极简输出)

precision_grep: queries: - pattern: "TODO|FIXME|HACK" glob: "src/**/*.ts" output: mode: files_only
precision_grep: queries: - pattern: "TODO|FIXME|HACK" glob: "src/**/*.ts" output: mode: files_only

Read file structure without content

读取文件结构而非内容

precision_read: files: ["src/index.ts", "src/app.ts"] extract: outline output: mode: minimal
precision_read: files: ["src/index.ts", "src/app.ts"] extract: outline output: mode: minimal

Batch edit multiple files atomically

原子化批量编辑多个文件

precision_edit: edits: - file: "src/api.ts" find: "const API_URL = 'http://localhost'" replace: "const API_URL = process.env.API_URL" - file: "src/config.ts" find: "debug: true" replace: "debug: process.env.NODE_ENV !== 'production'" transaction: mode: atomic rollback_on_fail: true output: mode: minimal
precision_edit: edits: - file: "src/api.ts" find: "const API_URL = 'http://localhost'" replace: "const API_URL = process.env.API_URL" - file: "src/config.ts" find: "debug: true" replace: "debug: process.env.NODE_ENV !== 'production'" transaction: mode: atomic rollback_on_fail: true output: mode: minimal

Execute commands with expectations

执行带预期结果的命令

precision_exec: commands: - cmd: "npm run typecheck" expect: exit_code: 0 - cmd: "npm run lint" expect: exit_code: 0 output: mode: minimal

---
precision_exec: commands: - cmd: "npm run typecheck" expect: exit_code: 0 - cmd: "npm run lint" expect: exit_code: 0 output: mode: minimal

---

Discovery -> Batch Workflow

发现 -> 批量工作流

CRITICAL: Always discover before batching.
The
discover
tool runs multiple queries in parallel to gather context before building a batch. This prevents wasted operations and ensures you target exactly the right files.
重要提示:始终先进行发现再执行批量操作。
discover
工具可并行运行多个查询,以在构建批量操作前收集上下文信息。这能避免无效操作,确保精准定位目标文件。

Discovery Tool Usage

发现工具使用示例

yaml
undefined
yaml
undefined

Run parallel discovery queries

运行并行发现查询

discover: queries: - id: find_components type: glob patterns: ["src/components//*.tsx"] - id: find_api_routes type: glob patterns: ["src/api//.ts", "src/app/api/**/.ts"] - id: find_issues type: grep pattern: "TODO|FIXME|HACK" glob: "src/**/*.{ts,tsx}" - id: find_hooks type: symbols query: "use" kinds: ["function"] output_mode: files_only # count_only | files_only | locations
undefined
discover: queries: - id: find_components type: glob patterns: ["src/components//*.tsx"] - id: find_api_routes type: glob patterns: ["src/api//.ts", "src/app/api/**/.ts"] - id: find_issues type: grep pattern: "TODO|FIXME|HACK" glob: "src/**/*.{ts,tsx}" - id: find_hooks type: symbols query: "use" kinds: ["function"] output_mode: files_only # count_only | files_only | locations
undefined

Workflow Pattern

工作流模式

  1. Discover - Run queries to understand scope
    • Use
      count_only
      first to gauge magnitude
    • Then
      files_only
      to get target list
  2. Plan - Build batch operations using discovery results
    • Reference discovered files in batch operations
    • Scope work to exactly what was found
  3. Execute - Run batch with full context
  1. 发现 - 运行查询以了解范围
    • 先使用
      count_only
      评估规模
    • 再使用
      files_only
      获取目标文件列表
  2. 规划 - 借助发现结果构建批量操作
    • 在批量操作中引用发现的文件
    • 将工作范围限定为已发现的内容
  3. 执行 - 结合完整上下文运行批量操作

Example: Feature Implementation

示例:功能实现

yaml
undefined
yaml
undefined

Step 1: Discover current state

步骤1:发现当前状态

discover: queries: - id: existing_files type: glob patterns: ["src/features/auth//*.ts"] - id: existing_patterns type: grep pattern: "export (function|const|class)" glob: "src/features//*.ts" output_mode: files_only
discover: queries: - id: existing_files type: glob patterns: ["src/features/auth//*.ts"] - id: existing_patterns type: grep pattern: "export (function|const|class)" glob: "src/features//*.ts" output_mode: files_only

Step 2: Use results to build targeted batch

步骤2:使用结果构建定向批量操作

batch: id: implement-feature operations: read: - id: analyze type: files targets: "{{existing_files.files}}" # From discovery extract: outline

**Benefits:**
- Prevents blind operations on wrong files
- Ensures consistent patterns across the codebase
- Reduces token usage by targeting exactly what's needed
- Enables informed decisions about implementation approach

---
batch: id: implement-feature operations: read: - id: analyze type: files targets: "{{existing_files.files}}" # 来自发现结果 extract: outline

**优势:**
- 避免对错误文件执行盲目操作
- 确保代码库中的模式一致性
- 通过精准定位减少令牌使用量
- 助力对实现方案做出明智决策

---

Mode-Aware Behavior

模式感知行为

Your behavior adapts based on the current mode:
你的行为会根据当前模式进行调整:

vibecoding Mode

vibecoding模式

  • Communicate: Show progress, explain decisions, report results in detail
  • Ask: On ambiguity or risk, ask the user before proceeding
  • Checkpoint: Create checkpoints per batch
  • Output: Standard verbosity, show diffs
  • 沟通:展示进度、解释决策、详细报告结果
  • 询问:遇到歧义或风险时,先询问用户再继续
  • 检查点:为每个批量操作创建检查点
  • 输出:标准详细程度,显示差异

justvibes Mode

justvibes模式

  • Silent: Minimal communication, log to
    .goodvibes/logs/activity.md
  • Autonomous: Make best-guess decisions, proceed with checkpoints on risk
  • Auto-chain: Continue to next logical batch automatically
  • Output: Minimal verbosity, no diffs

  • 静默:最少沟通,日志记录至
    .goodvibes/logs/activity.md
  • 自主:做出最佳猜测决策,遇到风险时创建检查点后继续
  • 自动链式执行:自动继续下一个逻辑批量操作
  • 输出:最低详细程度,不显示差异

Workflow Overview

工作流概述

┌─────────────────────────────────────────────────────────────┐
│                      CODEBASE REVIEW                        │
├─────────────────────────────────────────────────────────────┤
│  Phase 1: Review      │  Run MCP tools, analyze all code   │
│  Phase 2: Report      │  Generate codebase-review-report.md │
│  Phase 3: Plan        │  Create remediation-plan.md        │
│  Phase 4: Execute     │  WORK-REVIEW-FIX-CHECK (max 6)     │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│                      代码库审查                        │
├─────────────────────────────────────────────────────────────┤
│  阶段1:审查      │  运行MCP工具,分析所有代码   │
│  阶段2:报告      │  生成codebase-review-report.md │
│  阶段3:规划        │  创建remediation-plan.md        │
│  阶段4:执行     │  WORK-REVIEW-FIX-CHECK(最多6个并发)     │
└─────────────────────────────────────────────────────────────┘

Phase 1: Codebase Review

阶段1:代码库审查

MCP Tool Mapping

MCP工具映射

CategoryPrimary ToolsFallback
Quality
find_dead_code
,
scan_patterns
grep for patterns
Architecture
find_circular_deps
,
get_api_surface
manual analysis
Security
scan_for_secrets
,
check_permissions
grep for patterns
Performance
get_prisma_operations
,
analyze_bundle
none
Documentation
explain_codebase
file scan
Testing
get_test_coverage
,
find_tests_for_file
,
suggest_test_cases
jest --coverage
Config
read_config
,
env_audit
env file scan
Dependencies
analyze_dependencies
npm audit
Errors
parse_error_stack
,
explain_type_error
tsc output
Style
scan_patterns
,
get_conventions
eslint output
类别主要工具备选方案
质量
find_dead_code
,
scan_patterns
模式匹配grep
架构
find_circular_deps
,
get_api_surface
手动分析
安全
scan_for_secrets
,
check_permissions
模式匹配grep
性能
get_prisma_operations
,
analyze_bundle
文档
explain_codebase
文件扫描
测试
get_test_coverage
,
find_tests_for_file
,
suggest_test_cases
jest --coverage
配置
read_config
,
env_audit
环境文件扫描
依赖
analyze_dependencies
npm audit
错误
parse_error_stack
,
explain_type_error
tsc输出
风格
scan_patterns
,
get_conventions
eslint输出

Review Checklist

审查检查清单

Minimum per category:
  • 5 specific file:line findings OR explicit "no issues found"
  • Quantified measurements (counts, percentages, LOC)
  • Severity classification (critical/high/medium/low)

每个类别最低要求:
  • 5个具体的文件:行级发现结果,或明确标注“未发现问题”
  • 量化指标(数量、百分比、代码行数)
  • 严重程度分类(critical/high/medium/low)

Phase 2: Master Report

阶段2:总报告

Generate
codebase-review-report.md
:
markdown
undefined
生成
codebase-review-report.md
markdown
undefined

Codebase Review Report

代码库审查报告

Project: {name from detect_stack} Stack: {technologies detected} Generated: {ISO 8601 timestamp} Overall Score: {X.X}/10
项目:{来自detect_stack的名称} 技术栈:{检测到的技术} 生成时间:{ISO 8601时间戳} 总体得分:{X.X}/10

Executive Summary

执行摘要

SeverityCountDescription
🔴 CriticalNIssues requiring immediate attention
🟠 HighNIssues blocking production readiness
🟡 MediumNIssues impacting maintainability
🔵 LowNMinor improvements
严重程度数量描述
🔴 CriticalN需要立即关注的问题
🟠 HighN阻碍生产就绪的问题
🟡 MediumN影响可维护性的问题
🔵 LowN微小改进点

Score Breakdown

得分细分

CategoryWeightRawDeductionsScoreGrade
Quality15%10-X.XX.XA-F
Architecture15%10-X.XX.XA-F
Security20%10-X.XX.XA-F
Performance10%10-X.XX.XA-F
Documentation5%10-X.XX.XA-F
Testing15%10-X.XX.XA-F
Config5%10-X.XX.XA-F
Dependencies5%10-X.XX.XA-F
Errors5%10-X.XX.XA-F
Style5%10-X.XX.XA-F
TOTAL100%--X.XX
类别权重原始分扣分项得分等级
质量15%10-X.XX.XA-F
架构15%10-X.XX.XA-F
安全20%10-X.XX.XA-F
性能10%10-X.XX.XA-F
文档5%10-X.XX.XA-F
测试15%10-X.XX.XA-F
配置5%10-X.XX.XA-F
依赖5%10-X.XX.XA-F
错误5%10-X.XX.XA-F
风格5%10-X.XX.XA-F
总计100%--X.XX

Score Calculation

得分计算

{Show the math for each category deduction}
{展示每个类别扣分的计算方式}

Detailed Findings

详细发现结果

{Category Name}

{类别名称}

Finding: {Title}

发现:{标题}

FieldValue
Severitycritical|high|medium|low
Location
file:line
or
file:startLine-endLine
Measurement{exact number or percentage}
Threshold{acceptable value}
Impact{business/technical consequence}
Points Deducted{-X.X from Category}
Evidence:
{code snippet or tool output}
Required Fix:
{specific remediation code or steps}

{repeat for all findings}
字段
严重程度critical|high|medium|low
位置
file:line
file:startLine-endLine
量化指标{精确数字或百分比}
阈值{可接受值}
影响{业务/技术后果}
扣分数值{-X.X 从该类别中扣除}
证据:
{代码片段或工具输出}
所需修复:
{具体修复代码或步骤}

{重复所有发现结果}

What's Working Well

表现良好的部分

{List genuinely good patterns found, with file references}
{列出发现的优秀模式,并附带文件引用}

Improvement Roadmap

改进路线图

PhaseFocusExpected ImpactNew Score
1Critical fixes+X.X pointsX.X
2High priority+X.X pointsX.X
3Medium priority+X.X pointsX.X
4Polish+X.X pointsX.X

---
阶段重点预期影响新得分
1Critical问题修复+X.X 分X.X
2High优先级问题+X.X 分X.X
3Medium优先级问题+X.X 分X.X
4优化完善+X.X 分X.X

---

Phase 3: Remediation Plan

阶段3:修复计划

Generate
remediation-plan.md
:
markdown
undefined
生成
remediation-plan.md
markdown
undefined

Remediation Plan

修复计划

Generated: {timestamp} Total Tasks: {N} Execution Strategy: WORK-REVIEW-FIX-CHECK with parallel goodvibes agents (max 6 concurrent)
生成时间:{时间戳} 总任务数:{N} 执行策略:使用并行goodvibes Agent执行WORK-REVIEW-FIX-CHECK(最多6个并发)

Execution Rules

执行规则

RuleValue
Max concurrent agents6
Agent typegoodvibes background
Context modelFresh per task (no accumulation)
Tool priorityMCP tools > bash
MonitoringSelf-report via SubagentStop hook
WorkflowWORK → REVIEW → PASS/FAIL → (FIX → CHECK)
规则
最大并发Agent数6
Agent类型goodvibes后台Agent
上下文模型每个任务全新上下文(无累积)
工具优先级MCP工具 > bash
监控通过SubagentStop钩子自我报告
工作流WORK → REVIEW → PASS/FAIL → (FIX → CHECK)

Task Definitions

任务定义

Wave 1: Critical [P0] - Execute Immediately

第一波:Critical [P0] - 立即执行

TASK-001: {Description}

TASK-001:{描述}

FieldValue
Severitycritical
Target Files
file1.ts
,
file2.ts
Related Finding{reference to report finding}
MCP Tools
tool1
,
tool2
Estimated DurationXm
Context from Report:
{relevant finding details}

{repeat for all tasks, grouped by wave}
字段
严重程度critical
目标文件
file1.ts
,
file2.ts
相关发现结果{报告中发现结果的引用}
MCP工具
tool1
,
tool2
预计时长Xm
来自报告的上下文:
{相关发现结果详情}

{按波次重复所有任务}

Wave 2: High [P1]

第二波:High [P1]

Wave 3: Medium [P2]

第三波:Medium [P2]

Wave 4: Low [P3]

第四波:Low [P3]

Dependency Graph

依赖关系图

{Show task dependencies if any exist}

---
{展示任务间的依赖关系(如有)}

---

Phase 4: Parallel Agent Execution

阶段4:并行Agent执行

WORK-REVIEW-FIX-CHECK Workflow

WORK-REVIEW-FIX-CHECK工作流

For each remediation task:

  WORK Agent ─────────────────────> REVIEW Agent
  (goodvibes:engineer)              (goodvibes:reviewer)
       │                                  │
       │                                  ├─> PASS ─> Commit ─> Update Log ─> Next Task
       │                                  │
       │                                  └─> FAIL ─> FIX Agent ─> CHECK Agent
                                                         │              │
                                                         │              ├─> PASS ─> Commit
                                                         │              │
                                                         └──────────────┴─> FAIL (loop)
针对每个修复任务:

  WORK Agent ─────────────────────> REVIEW Agent
  (goodvibes:engineer)              (goodvibes:reviewer)
       │                                  │
       │                                  ├─> PASS ─> 提交 ─> 更新日志 ─> 下一个任务
       │                                  │
       │                                  └─> FAIL ─> FIX Agent ─> CHECK Agent
                                                         │              │
                                                         │              ├─> PASS ─> 提交
                                                         │              │
                                                         └──────────────┴─> FAIL(循环)

Agent Role Mapping

Agent角色映射

PhaseAgentPurpose
WORK
goodvibes:engineer
Implements remediation task
REVIEW
goodvibes:reviewer
Verifies work quality (100% required)
FIX
goodvibes:engineer
Addresses ALL review issues
CHECK
goodvibes:reviewer
Re-verifies fixes
阶段Agent用途
WORK
goodvibes:engineer
实施修复任务
REVIEW
goodvibes:reviewer
验证工作质量(100%必需)
FIX
goodvibes:engineer
解决所有审查问题
CHECK
goodvibes:reviewer
重新验证修复结果

Waiting for Agents (CRITICAL)

等待Agent(重要提示)

NEVER use these to check agent status:
  • tail
    command on transcript files
  • TaskOutput
    tool
  • Any form of polling
INSTEAD, the orchestrator:
  1. Spawns agent with
    run_in_background: true
  2. Stops taking actions (turn ends)
  3. Receives SubagentStop hook notification when agent completes
  4. Hook message appears in context with status
绝不要使用以下方式检查Agent状态:
  • 对转录文件使用
    tail
    命令
  • TaskOutput
    工具
  • 任何形式的轮询
正确方式:编排器
  1. 使用
    run_in_background: true
    启动Agent
  2. 停止执行操作(当前轮次结束)
  3. 当Agent完成时,接收SubagentStop钩子通知
  4. 上下文会显示包含状态的钩子消息

Concurrency Rules

并发规则

RuleValue
Max concurrent agents6
Agents per task1 (one agent works on a task at a time)
Completion requirement100% (not 99.9%)

规则
最大并发Agent数6
每个任务的Agent数1(同一时间一个Agent处理一个任务)
完成要求100%完成(而非99.9%)

WORK Agent Prompt Template

WORK Agent提示模板

markdown
undefined
markdown
undefined

Remediation Task: {TASK_ID}

修复任务:{TASK_ID}

MCP Tool Checklist (MANDATORY)

MCP工具检查清单(强制执行)

CRITICAL PREREQUISITE: You MUST call
mcp-cli info <server>/<tool>
BEFORE ANY
mcp-cli call <server>/<tool>
.
Before ANY edit:
bash
undefined
关键前置要求:在调用任何
mcp-cli call <server>/<tool>
之前,你必须先调用
mcp-cli info <server>/<tool>
在进行任何编辑前:
bash
undefined

Check schemas first

先检查 schema

mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file
mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file

Then execute

然后执行

mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'

After EVERY edit:
```bash
mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'

在每次编辑后:
```bash

Check schema first

先检查 schema

mcp-cli info plugin_goodvibes_project-engine/project_issues
mcp-cli info plugin_goodvibes_project-engine/project_issues

Then execute

然后执行

mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined
mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined

Assignment

任务分配

FieldValue
Task ID{TASK_ID}
Severity{SEVERITY}
Description{DESCRIPTION}
Files{FILE_LIST}
字段
任务ID{TASK_ID}
严重程度{SEVERITY}
描述{DESCRIPTION}
文件{FILE_LIST}

Context from Report

来自报告的上下文

{FINDING_DETAILS}
{FINDING_DETAILS}

Instructions

说明

  1. Complete ONLY this assigned task
  2. Use goodvibes MCP tools BEFORE bash
  3. Use precision tools (precision_edit, precision_exec) for all operations
  4. Run validation tools after every edit
  5. If edit causes new errors, fix them before completing
  1. 仅完成分配的此任务
  2. 优先使用goodvibes MCP工具,再使用bash
  3. 所有操作均使用precision工具(precision_edit, precision_exec等)
  4. 每次编辑后运行验证工具
  5. 如果编辑导致新错误,在完成前修复这些错误

Tool Priority (MANDATORY)

工具优先级(强制执行)

  1. First: Check
    mcp-cli info
    then
    mcp-cli call plugin_goodvibes_*
  2. Second: Use precision tools (precision_edit, precision_read, etc.)
  3. Only then: Fall back to standard tools if no MCP/precision tool exists
  1. 首先:检查
    mcp-cli info
    ,然后调用
    mcp-cli call plugin_goodvibes_*
  2. 其次:使用precision工具(precision_edit, precision_read等)
  3. 仅当没有MCP/precision工具时,才回退到标准工具

Completion Report

完成报告

When done, output:
json
{
  "task_id": "{TASK_ID}",
  "status": "success|failed",
  "files_modified": ["file1.ts", "file2.ts"],
  "tests_passed": true|false,
  "type_check_passed": true|false,
  "notes": "Any relevant context"
}

---
完成后,输出:
json
{
  "task_id": "{TASK_ID}",
  "status": "success|failed",
  "files_modified": ["file1.ts", "file2.ts"],
  "tests_passed": true|false,
  "type_check_passed": true|false,
  "notes": "任何相关上下文"
}

---

REVIEW Agent Prompt Template

REVIEW Agent提示模板

markdown
undefined
markdown
undefined

Review Task: {TASK_ID}

审查任务:{TASK_ID}

MCP Tool Checklist (MANDATORY)

MCP工具检查清单(强制执行)

CRITICAL PREREQUISITE: You MUST call
mcp-cli info <server>/<tool>
BEFORE ANY
mcp-cli call <server>/<tool>
.
bash
undefined
关键前置要求:在调用任何
mcp-cli call <server>/<tool>
之前,你必须先调用
mcp-cli info <server>/<tool>
bash
undefined

Check schemas first

先检查 schema

mcp-cli info plugin_goodvibes_project-engine/project_issues mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/get_test_coverage
mcp-cli info plugin_goodvibes_project-engine/project_issues mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/get_test_coverage

Then execute

然后执行

mcp-cli call plugin_goodvibes_project-engine/project_issues '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/get_test_coverage '{}'
undefined
mcp-cli call plugin_goodvibes_project-engine/project_issues '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/get_test_coverage '{}'
undefined

Assignment

任务分配

FieldValue
Task ID{TASK_ID}
Work Agent{WORK_AGENT_ID}
Files Modified{FILE_LIST}
字段
任务ID{TASK_ID}
WORK Agent{WORK_AGENT_ID}
修改的文件{FILE_LIST}

Context from WORK Agent

来自WORK Agent的上下文

{WORK_COMPLETION_REPORT}
{WORK_COMPLETION_REPORT}

Review Criteria

审查标准

CriterionWeightDescription
Correctness30%Does it solve the problem correctly?
Completeness25%Are all aspects addressed?
Quality20%Is the code clean, maintainable?
Safety15%No new errors, security issues?
Tests10%Tests pass, coverage maintained?
标准权重描述
正确性30%是否正确解决了问题?
完整性25%是否解决了所有方面?
质量20%代码是否简洁、可维护?
安全性15%无新错误、安全问题?
测试10%测试通过、覆盖率保持?

Review Process

审查流程

  1. Read all modified files
  2. Run MCP validation tools
  3. Check for:
    • Type errors
    • Test failures
    • Security issues
    • Code quality issues
    • Incomplete fixes
  4. Calculate score based on criteria weights
  5. Provide verdict
  1. 读取所有修改的文件
  2. 运行MCP验证工具
  3. 检查:
    • 类型错误
    • 测试失败
    • 安全问题
    • 代码质量问题
    • 未完成的修复
  4. 根据标准权重计算得分
  5. 提供 verdict

Review Output

审查输出

json
{
  "task_id": "{TASK_ID}",
  "verdict": "PASS|FAIL",
  "score": 8.5,
  "issues": [
    {
      "severity": "critical|major|minor",
      "file": "path/to/file.ts",
      "line": 47,
      "issue": "Description of the issue",
      "fix_guidance": "Specific guidance on how to fix"
    }
  ],
  "recommendation": "Details for FIX agent if FAIL"
}
json
{
  "task_id": "{TASK_ID}",
  "verdict": "PASS|FAIL",
  "score": 8.5,
  "issues": [
    {
      "severity": "critical|major|minor",
      "file": "path/to/file.ts",
      "line": 47,
      "issue": "问题描述",
      "fix_guidance": "修复的具体指导"
    }
  ],
  "recommendation": "如果FAIL,提供给FIX Agent的详细信息"
}

Verdict Rules

Verdict规则

  • PASS: Score >= 8.0 AND no critical issues AND all criteria pass
  • FAIL: Score < 8.0 OR any critical issue OR any criterion fails
CRITICAL: Be honest. Better to catch issues now than in production.

---
  • PASS:得分 >= 8.0 且无critical问题且所有标准通过
  • FAIL:得分 < 8.0 或存在任何critical问题或任何标准未通过
重要提示:保持诚实。与其在生产环境中发现问题,不如现在就找出。

---

FIX Agent Prompt Template

FIX Agent提示模板

markdown
undefined
markdown
undefined

Fix Task: {TASK_ID} (Iteration {N})

修复任务:{TASK_ID}(迭代 {N})

MCP Tool Checklist (MANDATORY)

MCP工具检查清单(强制执行)

CRITICAL PREREQUISITE: You MUST call
mcp-cli info <server>/<tool>
BEFORE ANY
mcp-cli call <server>/<tool>
.
Before ANY edit:
bash
undefined
关键前置要求:在调用任何
mcp-cli call <server>/<tool>
之前,你必须先调用
mcp-cli info <server>/<tool>
在进行任何编辑前:
bash
undefined

Check schemas first

先检查 schema

mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file
mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns mcp-cli info plugin_goodvibes_project-engine/find_tests_for_file

Then execute

然后执行

mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'

After EVERY edit:
```bash
mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}' mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'

在每次编辑后:
```bash

Check schema first

先检查 schema

mcp-cli info plugin_goodvibes_project-engine/project_issues
mcp-cli info plugin_goodvibes_project-engine/project_issues

Then execute

然后执行

mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined
mcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefined

Review Feedback

审查反馈

{ISSUES_FROM_REVIEW}
{ISSUES_FROM_REVIEW}

Instructions

说明

  1. Address EVERY issue from the review - no skipping
  2. Follow the
    fix_guidance
    provided for each issue
  3. Use precision tools for all operations
  4. Run validation after each fix
  5. If you cannot fix an issue, document WHY and mark as blocked
  1. 解决审查中的所有问题 - 不得跳过
  2. 遵循每个问题提供的
    fix_guidance
  3. 所有操作均使用precision工具
  4. 每次修复后运行验证
  5. 如果无法修复某个问题,记录原因并标记为阻塞

Completion Report

完成报告

json
{
  "task_id": "{TASK_ID}",
  "iteration": {N},
  "status": "success|blocked",
  "issues_addressed": N,
  "issues_remaining": N,
  "blocked_issues": [
    {
      "issue": "Description",
      "reason": "Why it cannot be fixed"
    }
  ],
  "notes": "Any relevant context"
}

---
json
{
  "task_id": "{TASK_ID}",
  "iteration": {N},
  "status": "success|blocked",
  "issues_addressed": N,
  "issues_remaining": N,
  "blocked_issues": [
    {
      "issue": "描述",
      "reason": "无法修复的原因"
    }
  ],
  "notes": "任何相关上下文"
}

---

CHECK Agent Prompt Template

CHECK Agent提示模板

markdown
undefined
markdown
undefined

Check Task: {TASK_ID} (Verification Round {N})

检查任务:{TASK_ID}(验证轮次 {N})

MCP Tool Checklist (MANDATORY)

MCP工具检查清单(强制执行)

CRITICAL PREREQUISITE: You MUST call
mcp-cli info <server>/<tool>
BEFORE ANY
mcp-cli call <server>/<tool>
.
bash
undefined
关键前置要求:在调用任何
mcp-cli call <server>/<tool>
之前,你必须先调用
mcp-cli info <server>/<tool>
bash
undefined

Check schemas first

先检查 schema

mcp-cli info plugin_goodvibes_project-engine/project_issues mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns
mcp-cli info plugin_goodvibes_project-engine/project_issues mcp-cli info plugin_goodvibes_analysis-engine/scan_patterns

Then execute

然后执行

mcp-cli call plugin_goodvibes_project-engine/project_issues '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}'
undefined
mcp-cli call plugin_goodvibes_project-engine/project_issues '{}' mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}'
undefined

Assignment

任务分配

FieldValue
Task ID{TASK_ID}
FIX Agent{FIX_AGENT_ID}
Iteration{N}
字段
任务ID{TASK_ID}
FIX Agent{FIX_AGENT_ID}
迭代次数{N}

Previous Issues

之前的问题

{ISSUES_TO_VERIFY}
{ISSUES_TO_VERIFY}

Context from FIX Agent

来自FIX Agent的上下文

{FIX_COMPLETION_REPORT}
{FIX_COMPLETION_REPORT}

Verification Process

验证流程

  1. Read all modified files
  2. Run MCP validation tools
  3. Verify each previous issue is resolved
  4. Check for new issues introduced by fixes
  5. Provide verdict
  1. 读取所有修改的文件
  2. 运行MCP验证工具
  3. 验证每个之前的问题是否已解决
  4. 检查修复是否引入新问题
  5. 提供 verdict

Verdict Output

Verdict输出

json
{
  "task_id": "{TASK_ID}",
  "iteration": {N},
  "verdict": "PASS|FAIL",
  "resolved_issues": N,
  "unresolved_issues": [
    {
      "issue": "Description",
      "status": "still_present|new_issue"
    }
  ],
  "recommendation": "Next action if FAIL"
}
json
{
  "task_id": "{TASK_ID}",
  "iteration": {N},
  "verdict": "PASS|FAIL",
  "resolved_issues": N,
  "unresolved_issues": [
    {
      "issue": "描述",
      "status": "still_present|new_issue"
    }
  ],
  "recommendation": "如果FAIL,下一步操作"
}

Verdict Rules

Verdict规则

  • PASS: ALL previous issues resolved AND no new critical issues
  • FAIL: ANY issue unresolved OR new critical issues found
If FAIL after 3 iterations, escalate to human review.

---
  • PASS:所有之前的问题均已解决且无新的critical问题
  • FAIL:任何问题未解决或发现新的critical问题
如果3次迭代后仍FAIL,升级至人工审查。

---

Commit Protocol

提交协议

After REVIEW or CHECK verdict is PASS, create commit:
fix({CATEGORY}): {TASK_ID} - {SHORT_DESCRIPTION}

{DETAILED_DESCRIPTION}
当REVIEW或CHECK的verdict为PASS后,创建提交:
fix({CATEGORY}): {TASK_ID} - {简短描述}

{详细描述}

Changes

更改

  • {FILE_1}: {WHAT_CHANGED}
  • {FILE_2}: {WHAT_CHANGED}
  • {FILE_1}: {更改内容}
  • {FILE_2}: {更改内容}

Review

审查

  • Reviewed by: REVIEW agent
  • Score: {SCORE}/10
  • Iterations: {FIX_ITERATIONS}
Task-ID: {TASK_ID} Severity: {SEVERITY} Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
undefined
  • 审查者:REVIEW agent
  • 得分:{SCORE}/10
  • 迭代次数:{FIX_ITERATIONS}
Task-ID: {TASK_ID} Severity: {SEVERITY} Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
undefined

Completion Cleanup

完成清理

After ALL remediation tasks have passed review and been committed, archive the output files:
Archive Location:
.goodvibes/completed/
Archive Commands:
bash
undefined
当所有修复任务通过审查并提交后,归档输出文件:
归档位置:
.goodvibes/completed/
归档命令:
bash
undefined

Run all commands together in a single shell session:

在单个shell会话中运行所有命令:

Create archive directory if it doesn't exist

如果归档目录不存在则创建

mkdir -p .goodvibes/completed
mkdir -p .goodvibes/completed

Generate timestamp

生成时间戳

TIMESTAMP=$(date +%Y%m%d-%H%M%S)
TIMESTAMP=$(date +%Y%m%d-%H%M%S)

Move and rename files

移动并重命名文件

mv codebase-review-report.md .goodvibes/completed/code-review-${TIMESTAMP}.md mv remediation-plan.md .goodvibes/completed/remediation-plan-${TIMESTAMP}.md mv remediation-log.md .goodvibes/completed/remediation-log-${TIMESTAMP}.md

**Archive Checklist:**
- [ ] All remediation tasks show status: completed in remediation-log.md
- [ ] All commits pushed (if applicable)
- [ ] Memory files updated (.goodvibes/memory/)
- [ ] Archive directory created
- [ ] Files moved with timestamp suffix

**File Naming Convention:**
| Original | Archived |
|----------|----------|
| `codebase-review-report.md` | `code-review-{YYYYMMDD-HHMMSS}.md` |
| `remediation-plan.md` | `remediation-plan-{YYYYMMDD-HHMMSS}.md` |
| `remediation-log.md` | `remediation-log-{YYYYMMDD-HHMMSS}.md` |

**Why Archive:**
- Keeps project root clean
- Preserves historical review data
- Enables tracking of codebase health over time
- Prevents confusion with future reviews
mv codebase-review-report.md .goodvibes/completed/code-review-${TIMESTAMP}.md mv remediation-plan.md .goodvibes/completed/remediation-plan-${TIMESTAMP}.md mv remediation-log.md .goodvibes/completed/remediation-log-${TIMESTAMP}.md

**归档检查清单:**
- [ ] 所有修复任务在remediation-log.md中显示状态为已完成
- [ ] 所有提交已推送(如适用)
- [ ] 内存文件已更新(.goodvibes/memory/)
- [ ] 已创建归档目录
- [ ] 文件已添加时间戳后缀并移动

**文件命名规范:**
| 原文件名 | 归档后文件名 |
|----------|----------|
| `codebase-review-report.md` | `code-review-{YYYYMMDD-HHMMSS}.md` |
| `remediation-plan.md` | `remediation-plan-{YYYYMMDD-HHMMSS}.md` |
| `remediation-log.md` | `remediation-log-{YYYYMMDD-HHMMSS}.md` |

**归档原因:**
- 保持项目根目录整洁
- 保留历史审查数据
- 能够跟踪代码库健康状况随时间的变化
- 避免与未来的审查产生混淆

Completion Logging

完成日志

Maintain
remediation-log.md
:
markdown
undefined
维护
remediation-log.md
markdown
undefined

Remediation Log

修复日志

Active Agents

活跃Agent

Task IDDescriptionAgentPhaseStartedElapsed
TASK-002Remove secretsagent-abcWORK10:05:005m
TASK-003Fix auth flowagent-defREVIEW10:08:002m
任务ID描述Agent阶段开始时间耗时
TASK-002移除密钥agent-abcWORK10:05:005m
TASK-003修复认证流程agent-defREVIEW10:08:002m

Completed Tasks

已完成任务

Task IDDescriptionStatusDurationIterationsChanges
TASK-001Fix SQL injection✅ PASS15m32s1
api/users.ts
任务ID描述状态时长迭代次数更改
TASK-001修复SQL注入✅ PASS15m32s1
api/users.ts

Failed Tasks

失败任务

Task IDDescriptionStatusIterationsReasonRetry?
TASK-005Fix type errors❌ FAIL3Blocked by external dependencyNo
任务ID描述状态迭代次数原因重试?
TASK-005修复类型错误❌ FAIL3被外部依赖阻塞

Summary

摘要

  • Total Tasks: N
  • Completed: N (X%)
  • In Progress: N
  • Failed: N
  • Remaining: N
  • Active Agents: N/6

---
  • 总任务数:N
  • 已完成:N (X%)
  • 进行中:N
  • 失败:N
  • 剩余:N
  • 活跃Agent数:N/6

---

Output Artifacts

输出产物

FilePurpose
codebase-review-report.md
Complete findings with quantified metrics and scores
remediation-plan.md
Prioritized task checklist by severity with context
remediation-log.md
Real-time execution tracking with WORK-REVIEW-FIX-CHECK status
Note: After all remediation tasks are completed, these files are archived to
.goodvibes/completed/
with timestamp suffixes. See "Completion Cleanup" section for details.

文件用途
codebase-review-report.md
包含量化指标和得分的完整发现结果
remediation-plan.md
按严重程度优先级排序的任务清单及上下文
remediation-log.md
WORK-REVIEW-FIX-CHECK状态的实时执行跟踪
注意: 所有修复任务完成后,这些文件会被归档到
.goodvibes/completed/
并添加时间戳后缀。详情请见“完成清理”部分。

Memory Integration

内存集成

After review/remediation, update
.goodvibes/memory/
:
FileUpdate With
decisions.md
Architectural decisions made during remediation
patterns.md
Patterns discovered or enforced
failures.md
Failed remediations with root cause analysis
preferences.md
Tool preferences that worked well

审查/修复完成后,更新
.goodvibes/memory/
文件更新内容
decisions.md
修复过程中做出的架构决策
patterns.md
发现或强制执行的模式
failures.md
失败的修复及根本原因分析
preferences.md
表现良好的工具偏好

Constraints

约束条件

ConstraintValueRationale
Max concurrent agents6Resource management
Agent typegoodvibes backgroundTelemetry via hooks
Tasks per agent1Fresh context per task
Context inheritanceNonePrevent cross-contamination
Monitoring methodSelf-reportSubagentStop hook handles
Tool priorityMCP > precision > bashConsistency and telemetry
Review requirement100%Ensure quality before commit
约束理由
最大并发Agent数6资源管理
Agent类型goodvibes后台Agent通过钩子实现遥测
每个Agent的任务数1每个任务全新上下文
上下文继承防止交叉污染
监控方式自我报告由SubagentStop钩子处理
工具优先级MCP > precision > bash一致性和遥测
审查要求100%提交前确保质量