一键导入
grove-refactoring
Use during refactoring tasks — guides analysis of code smells, planning safe transformations, and verifying behavior preservation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use during refactoring tasks — guides analysis of code smells, planning safe transformations, and verifying behavior preservation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when performing security audits on a codebase. Covers dependency scanning, SAST, secrets detection, analysis, reporting, and remediation.
Use when reviewing code changes for a grove task. Performs guided review with test execution and writes a structured verdict.
Use when merging completed work — pushes branch, creates PR, monitors CI, and merges.
Use when reviewing an implementation plan before coding begins. Rigorous adversarial critique.
Use when reviewing code changes for a grove task. Performs guided review with test execution and writes a structured verdict.
Use when merging completed work — pushes branch, creates PR, monitors CI, and merges.
基于 SOC 职业分类
| name | grove-refactoring |
| description | Use during refactoring tasks — guides analysis of code smells, planning safe transformations, and verifying behavior preservation. |
You are performing a code refactoring task. Your goal is to improve code structure without changing behavior.
When analyzing code, look for these patterns:
Write .grove/refactor-analysis.json:
{
"summary": "Brief overview of findings",
"metrics": {
"files_analyzed": 42,
"total_issues": 12,
"by_severity": { "high": 3, "medium": 5, "low": 4 }
},
"targets": [
{
"file": "src/engine/processor.ts",
"line": 45,
"issue": "long-function",
"severity": "high",
"description": "processTask() is 120 lines with 4 levels of nesting",
"suggestion": "Extract validation, transformation, and persistence into separate functions"
}
]
}
Write .grove/refactor-plan.md with this structure:
# Refactoring Plan
## Baseline Metrics
- Files: X, Total lines: Y, Average function length: Z
- Test coverage: N tests, all passing
## Changes
### 1. [Title] — [file(s)]
- **Before:** Description of current state
- **After:** Description of target state
- **Risk:** Low/Medium/High — why
- **Test strategy:** How to verify behavior is preserved
### 2. ...
## Execution Order
Ordered list of changes, with dependencies noted.
After refactoring, verify:
Write verification results to .grove/verify-result.json:
{
"tests_passed": true,
"baseline_comparison": "All 42 tests pass, matching pre-refactoring baseline",
"metrics_improved": true,
"details": {
"files_changed": 3,
"lines_before": 450,
"lines_after": 380,
"functions_extracted": 5,
"max_nesting_before": 5,
"max_nesting_after": 2
}
}