goodvibes-codebase-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoodvibes 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 BEFORE ANY . This is a BLOCKING REQUIREMENT.
mcp-cli info <server>/<tool>mcp-cli call <server>/<tool>暂停。在执行任何操作前,完成此检查清单。
关键前置要求:在调用任何之前,你必须先调用。这是一项强制性要求。
mcp-cli call <server>/<tool>mcp-cli info <server>/<tool>Task Start
任务启动
bash
undefinedbash
undefinedALWAYS 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 '{}'
undefinedmcp-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 '{}'
undefinedReview Phase
审查阶段
bash
undefinedbash
undefinedCheck 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 '{}'
undefinedmcp-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 '{}'
undefinedBefore Every Edit
每次编辑前
bash
undefinedbash
undefinedCheck 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 '{}'
undefinedmcp-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 '{}'
undefinedAfter Every Edit
每次编辑后
bash
undefinedbash
undefinedCheck 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 Of | Use | Why |
|---|---|---|
| | Extract modes, line ranges, outline/symbols |
| | Output modes, batch queries, context control |
| | Output modes, filters, preview |
| | Atomic transactions, validation, hints |
| | Atomic, templates, validation |
| | Batch commands, expectations, output control |
重要提示:使用Precision工具,而非系统工具。
| 替代工具 | 使用工具 | 原因 |
|---|---|---|
| | 提取模式、行范围、大纲/符号 |
| | 输出模式、批量查询、上下文控制 |
| | 输出模式、过滤器、预览 |
| | 原子事务、验证、提示 |
| | 原子操作、模板、验证 |
| | 批量命令、预期结果、输出控制 |
Precision Tool Patterns
Precision工具使用示例
yaml
undefinedyaml
undefinedFind 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 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重要提示:始终先进行发现再执行批量操作。
discoverDiscovery Tool Usage
发现工具使用示例
yaml
undefinedyaml
undefinedRun 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
undefineddiscover:
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
undefinedWorkflow Pattern
工作流模式
-
Discover - Run queries to understand scope
- Use first to gauge magnitude
count_only - Then to get target list
files_only
- Use
-
Plan - Build batch operations using discovery results
- Reference discovered files in batch operations
- Scope work to exactly what was found
-
Execute - Run batch with full context
-
发现 - 运行查询以了解范围
- 先使用评估规模
count_only - 再使用获取目标文件列表
files_only
- 先使用
-
规划 - 借助发现结果构建批量操作
- 在批量操作中引用发现的文件
- 将工作范围限定为已发现的内容
-
执行 - 结合完整上下文运行批量操作
Example: Feature Implementation
示例:功能实现
yaml
undefinedyaml
undefinedStep 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工具映射
| Category | Primary Tools | Fallback |
|---|---|---|
| Quality | | grep for patterns |
| Architecture | | manual analysis |
| Security | | grep for patterns |
| Performance | | none |
| Documentation | | file scan |
| Testing | | jest --coverage |
| Config | | env file scan |
| Dependencies | | npm audit |
| Errors | | tsc output |
| Style | | eslint output |
| 类别 | 主要工具 | 备选方案 |
|---|---|---|
| 质量 | | 模式匹配grep |
| 架构 | | 手动分析 |
| 安全 | | 模式匹配grep |
| 性能 | | 无 |
| 文档 | | 文件扫描 |
| 测试 | | jest --coverage |
| 配置 | | 环境文件扫描 |
| 依赖 | | npm audit |
| 错误 | | tsc输出 |
| 风格 | | 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.mdmarkdown
undefined生成:
codebase-review-report.mdmarkdown
undefinedCodebase 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
执行摘要
| Severity | Count | Description |
|---|---|---|
| 🔴 Critical | N | Issues requiring immediate attention |
| 🟠 High | N | Issues blocking production readiness |
| 🟡 Medium | N | Issues impacting maintainability |
| 🔵 Low | N | Minor improvements |
| 严重程度 | 数量 | 描述 |
|---|---|---|
| 🔴 Critical | N | 需要立即关注的问题 |
| 🟠 High | N | 阻碍生产就绪的问题 |
| 🟡 Medium | N | 影响可维护性的问题 |
| 🔵 Low | N | 微小改进点 |
Score Breakdown
得分细分
| Category | Weight | Raw | Deductions | Score | Grade |
|---|---|---|---|---|---|
| Quality | 15% | 10 | -X.X | X.X | A-F |
| Architecture | 15% | 10 | -X.X | X.X | A-F |
| Security | 20% | 10 | -X.X | X.X | A-F |
| Performance | 10% | 10 | -X.X | X.X | A-F |
| Documentation | 5% | 10 | -X.X | X.X | A-F |
| Testing | 15% | 10 | -X.X | X.X | A-F |
| Config | 5% | 10 | -X.X | X.X | A-F |
| Dependencies | 5% | 10 | -X.X | X.X | A-F |
| Errors | 5% | 10 | -X.X | X.X | A-F |
| Style | 5% | 10 | -X.X | X.X | A-F |
| TOTAL | 100% | - | - | X.X | X |
| 类别 | 权重 | 原始分 | 扣分项 | 得分 | 等级 |
|---|---|---|---|---|---|
| 质量 | 15% | 10 | -X.X | X.X | A-F |
| 架构 | 15% | 10 | -X.X | X.X | A-F |
| 安全 | 20% | 10 | -X.X | X.X | A-F |
| 性能 | 10% | 10 | -X.X | X.X | A-F |
| 文档 | 5% | 10 | -X.X | X.X | A-F |
| 测试 | 15% | 10 | -X.X | X.X | A-F |
| 配置 | 5% | 10 | -X.X | X.X | A-F |
| 依赖 | 5% | 10 | -X.X | X.X | A-F |
| 错误 | 5% | 10 | -X.X | X.X | A-F |
| 风格 | 5% | 10 | -X.X | X.X | A-F |
| 总计 | 100% | - | - | X.X | X |
Score Calculation
得分计算
{Show the math for each category deduction}
{展示每个类别扣分的计算方式}
Detailed Findings
详细发现结果
{Category Name}
{类别名称}
Finding: {Title}
发现:{标题}
| Field | Value |
|---|---|
| Severity | critical|high|medium|low |
| Location | |
| 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 |
| 位置 | |
| 量化指标 | {精确数字或百分比} |
| 阈值 | {可接受值} |
| 影响 | {业务/技术后果} |
| 扣分数值 | {-X.X 从该类别中扣除} |
证据:
{代码片段或工具输出}所需修复:
{具体修复代码或步骤}{重复所有发现结果}
What's Working Well
表现良好的部分
{List genuinely good patterns found, with file references}
{列出发现的优秀模式,并附带文件引用}
Improvement Roadmap
改进路线图
| Phase | Focus | Expected Impact | New Score |
|---|---|---|---|
| 1 | Critical fixes | +X.X points | X.X |
| 2 | High priority | +X.X points | X.X |
| 3 | Medium priority | +X.X points | X.X |
| 4 | Polish | +X.X points | X.X |
---| 阶段 | 重点 | 预期影响 | 新得分 |
|---|---|---|---|
| 1 | Critical问题修复 | +X.X 分 | X.X |
| 2 | High优先级问题 | +X.X 分 | X.X |
| 3 | Medium优先级问题 | +X.X 分 | X.X |
| 4 | 优化完善 | +X.X 分 | X.X |
---Phase 3: Remediation Plan
阶段3:修复计划
Generate :
remediation-plan.mdmarkdown
undefined生成:
remediation-plan.mdmarkdown
undefinedRemediation 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
执行规则
| Rule | Value |
|---|---|
| Max concurrent agents | 6 |
| Agent type | goodvibes background |
| Context model | Fresh per task (no accumulation) |
| Tool priority | MCP tools > bash |
| Monitoring | Self-report via SubagentStop hook |
| Workflow | WORK → 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:{描述}
| Field | Value |
|---|---|
| Severity | critical |
| Target Files | |
| Related Finding | {reference to report finding} |
| MCP Tools | |
| Estimated Duration | Xm |
Context from Report:
{relevant finding details}{repeat for all tasks, grouped by wave}
| 字段 | 值 |
|---|---|
| 严重程度 | critical |
| 目标文件 | |
| 相关发现结果 | {报告中发现结果的引用} |
| MCP工具 | |
| 预计时长 | 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角色映射
| Phase | Agent | Purpose |
|---|---|---|
| WORK | | Implements remediation task |
| REVIEW | | Verifies work quality (100% required) |
| FIX | | Addresses ALL review issues |
| CHECK | | Re-verifies fixes |
| 阶段 | Agent | 用途 |
|---|---|---|
| WORK | | 实施修复任务 |
| REVIEW | | 验证工作质量(100%必需) |
| FIX | | 解决所有审查问题 |
| CHECK | | 重新验证修复结果 |
Waiting for Agents (CRITICAL)
等待Agent(重要提示)
NEVER use these to check agent status:
- command on transcript files
tail - tool
TaskOutput - Any form of polling
INSTEAD, the orchestrator:
- Spawns agent with
run_in_background: true - Stops taking actions (turn ends)
- Receives SubagentStop hook notification when agent completes
- Hook message appears in context with status
绝不要使用以下方式检查Agent状态:
- 对转录文件使用命令
tail - 工具
TaskOutput - 任何形式的轮询
正确方式:编排器
- 使用启动Agent
run_in_background: true - 停止执行操作(当前轮次结束)
- 当Agent完成时,接收SubagentStop钩子通知
- 上下文会显示包含状态的钩子消息
Concurrency Rules
并发规则
| Rule | Value |
|---|---|
| Max concurrent agents | 6 |
| Agents per task | 1 (one agent works on a task at a time) |
| Completion requirement | 100% (not 99.9%) |
| 规则 | 值 |
|---|---|
| 最大并发Agent数 | 6 |
| 每个任务的Agent数 | 1(同一时间一个Agent处理一个任务) |
| 完成要求 | 100%完成(而非99.9%) |
WORK Agent Prompt Template
WORK Agent提示模板
markdown
undefinedmarkdown
undefinedRemediation Task: {TASK_ID}
修复任务:{TASK_ID}
MCP Tool Checklist (MANDATORY)
MCP工具检查清单(强制执行)
CRITICAL PREREQUISITE: You MUST call BEFORE ANY .
mcp-cli info <server>/<tool>mcp-cli call <server>/<tool>Before ANY edit:
bash
undefined关键前置要求:在调用任何之前,你必须先调用。
mcp-cli call <server>/<tool>mcp-cli info <server>/<tool>在进行任何编辑前:
bash
undefinedCheck 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:
```bashmcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}'
mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'
在每次编辑后:
```bashCheck 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 '{}'
undefinedmcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefinedAssignment
任务分配
| Field | Value |
|---|---|
| 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
说明
- Complete ONLY this assigned task
- Use goodvibes MCP tools BEFORE bash
- Use precision tools (precision_edit, precision_exec) for all operations
- Run validation tools after every edit
- If edit causes new errors, fix them before completing
- 仅完成分配的此任务
- 优先使用goodvibes MCP工具,再使用bash
- 所有操作均使用precision工具(precision_edit, precision_exec等)
- 每次编辑后运行验证工具
- 如果编辑导致新错误,在完成前修复这些错误
Tool Priority (MANDATORY)
工具优先级(强制执行)
- First: Check then
mcp-cli infomcp-cli call plugin_goodvibes_* - Second: Use precision tools (precision_edit, precision_read, etc.)
- Only then: Fall back to standard tools if no MCP/precision tool exists
- 首先:检查,然后调用
mcp-cli infomcp-cli call plugin_goodvibes_* - 其次:使用precision工具(precision_edit, precision_read等)
- 仅当没有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
undefinedmarkdown
undefinedReview Task: {TASK_ID}
审查任务:{TASK_ID}
MCP Tool Checklist (MANDATORY)
MCP工具检查清单(强制执行)
CRITICAL PREREQUISITE: You MUST call BEFORE ANY .
mcp-cli info <server>/<tool>mcp-cli call <server>/<tool>bash
undefined关键前置要求:在调用任何之前,你必须先调用。
mcp-cli call <server>/<tool>mcp-cli info <server>/<tool>bash
undefinedCheck 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 '{}'
undefinedmcp-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 '{}'
undefinedAssignment
任务分配
| Field | Value |
|---|---|
| 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
审查标准
| Criterion | Weight | Description |
|---|---|---|
| Correctness | 30% | Does it solve the problem correctly? |
| Completeness | 25% | Are all aspects addressed? |
| Quality | 20% | Is the code clean, maintainable? |
| Safety | 15% | No new errors, security issues? |
| Tests | 10% | Tests pass, coverage maintained? |
| 标准 | 权重 | 描述 |
|---|---|---|
| 正确性 | 30% | 是否正确解决了问题? |
| 完整性 | 25% | 是否解决了所有方面? |
| 质量 | 20% | 代码是否简洁、可维护? |
| 安全性 | 15% | 无新错误、安全问题? |
| 测试 | 10% | 测试通过、覆盖率保持? |
Review Process
审查流程
- Read all modified files
- Run MCP validation tools
- Check for:
- Type errors
- Test failures
- Security issues
- Code quality issues
- Incomplete fixes
- Calculate score based on criteria weights
- Provide verdict
- 读取所有修改的文件
- 运行MCP验证工具
- 检查:
- 类型错误
- 测试失败
- 安全问题
- 代码质量问题
- 未完成的修复
- 根据标准权重计算得分
- 提供 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
undefinedmarkdown
undefinedFix Task: {TASK_ID} (Iteration {N})
修复任务:{TASK_ID}(迭代 {N})
MCP Tool Checklist (MANDATORY)
MCP工具检查清单(强制执行)
CRITICAL PREREQUISITE: You MUST call BEFORE ANY .
mcp-cli info <server>/<tool>mcp-cli call <server>/<tool>Before ANY edit:
bash
undefined关键前置要求:在调用任何之前,你必须先调用。
mcp-cli call <server>/<tool>mcp-cli info <server>/<tool>在进行任何编辑前:
bash
undefinedCheck 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:
```bashmcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}'
mcp-cli call plugin_goodvibes_project-engine/find_tests_for_file '{"file":"{TARGET_FILE}"}'
在每次编辑后:
```bashCheck 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 '{}'
undefinedmcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
undefinedReview Feedback
审查反馈
{ISSUES_FROM_REVIEW}
{ISSUES_FROM_REVIEW}
Instructions
说明
- Address EVERY issue from the review - no skipping
- Follow the provided for each issue
fix_guidance - Use precision tools for all operations
- Run validation after each fix
- If you cannot fix an issue, document WHY and mark as blocked
- 解决审查中的所有问题 - 不得跳过
- 遵循每个问题提供的
fix_guidance - 所有操作均使用precision工具
- 每次修复后运行验证
- 如果无法修复某个问题,记录原因并标记为阻塞
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
undefinedmarkdown
undefinedCheck Task: {TASK_ID} (Verification Round {N})
检查任务:{TASK_ID}(验证轮次 {N})
MCP Tool Checklist (MANDATORY)
MCP工具检查清单(强制执行)
CRITICAL PREREQUISITE: You MUST call BEFORE ANY .
mcp-cli info <server>/<tool>mcp-cli call <server>/<tool>bash
undefined关键前置要求:在调用任何之前,你必须先调用。
mcp-cli call <server>/<tool>mcp-cli info <server>/<tool>bash
undefinedCheck 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 '{}'
undefinedmcp-cli call plugin_goodvibes_project-engine/project_issues '{}'
mcp-cli call plugin_goodvibes_analysis-engine/scan_patterns '{}'
undefinedAssignment
任务分配
| Field | Value |
|---|---|
| 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
验证流程
- Read all modified files
- Run MCP validation tools
- Verify each previous issue is resolved
- Check for new issues introduced by fixes
- Provide verdict
- 读取所有修改的文件
- 运行MCP验证工具
- 验证每个之前的问题是否已解决
- 检查修复是否引入新问题
- 提供 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
undefinedCompletion 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
undefinedRun 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 reviewsmv 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.mdmarkdown
undefined维护:
remediation-log.mdmarkdown
undefinedRemediation Log
修复日志
Active Agents
活跃Agent
| Task ID | Description | Agent | Phase | Started | Elapsed |
|---|---|---|---|---|---|
| TASK-002 | Remove secrets | agent-abc | WORK | 10:05:00 | 5m |
| TASK-003 | Fix auth flow | agent-def | REVIEW | 10:08:00 | 2m |
| 任务ID | 描述 | Agent | 阶段 | 开始时间 | 耗时 |
|---|---|---|---|---|---|
| TASK-002 | 移除密钥 | agent-abc | WORK | 10:05:00 | 5m |
| TASK-003 | 修复认证流程 | agent-def | REVIEW | 10:08:00 | 2m |
Completed Tasks
已完成任务
| Task ID | Description | Status | Duration | Iterations | Changes |
|---|---|---|---|---|---|
| TASK-001 | Fix SQL injection | ✅ PASS | 15m32s | 1 | |
| 任务ID | 描述 | 状态 | 时长 | 迭代次数 | 更改 |
|---|---|---|---|---|---|
| TASK-001 | 修复SQL注入 | ✅ PASS | 15m32s | 1 | |
Failed Tasks
失败任务
| Task ID | Description | Status | Iterations | Reason | Retry? |
|---|---|---|---|---|---|
| TASK-005 | Fix type errors | ❌ FAIL | 3 | Blocked by external dependency | No |
| 任务ID | 描述 | 状态 | 迭代次数 | 原因 | 重试? |
|---|---|---|---|---|---|
| TASK-005 | 修复类型错误 | ❌ FAIL | 3 | 被外部依赖阻塞 | 否 |
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
输出产物
| File | Purpose |
|---|---|
| Complete findings with quantified metrics and scores |
| Prioritized task checklist by severity with context |
| Real-time execution tracking with WORK-REVIEW-FIX-CHECK status |
Note: After all remediation tasks are completed, these files are archived to with timestamp suffixes. See "Completion Cleanup" section for details.
.goodvibes/completed/| 文件 | 用途 |
|---|---|
| 包含量化指标和得分的完整发现结果 |
| 按严重程度优先级排序的任务清单及上下文 |
| WORK-REVIEW-FIX-CHECK状态的实时执行跟踪 |
注意: 所有修复任务完成后,这些文件会被归档到并添加时间戳后缀。详情请见“完成清理”部分。
.goodvibes/completed/Memory Integration
内存集成
After review/remediation, update :
.goodvibes/memory/| File | Update With |
|---|---|
| Architectural decisions made during remediation |
| Patterns discovered or enforced |
| Failed remediations with root cause analysis |
| Tool preferences that worked well |
审查/修复完成后,更新:
.goodvibes/memory/| 文件 | 更新内容 |
|---|---|
| 修复过程中做出的架构决策 |
| 发现或强制执行的模式 |
| 失败的修复及根本原因分析 |
| 表现良好的工具偏好 |
Constraints
约束条件
| Constraint | Value | Rationale |
|---|---|---|
| Max concurrent agents | 6 | Resource management |
| Agent type | goodvibes background | Telemetry via hooks |
| Tasks per agent | 1 | Fresh context per task |
| Context inheritance | None | Prevent cross-contamination |
| Monitoring method | Self-report | SubagentStop hook handles |
| Tool priority | MCP > precision > bash | Consistency and telemetry |
| Review requirement | 100% | Ensure quality before commit |
| 约束 | 值 | 理由 |
|---|---|---|
| 最大并发Agent数 | 6 | 资源管理 |
| Agent类型 | goodvibes后台Agent | 通过钩子实现遥测 |
| 每个Agent的任务数 | 1 | 每个任务全新上下文 |
| 上下文继承 | 无 | 防止交叉污染 |
| 监控方式 | 自我报告 | 由SubagentStop钩子处理 |
| 工具优先级 | MCP > precision > bash | 一致性和遥测 |
| 审查要求 | 100% | 提交前确保质量 |