generate-bug-fix
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "generate-bug-fix":https://skillpi.com/zh/skills/deepskill-ff3e623e9b1d75d834deb22053e1c0a3ed24450e84d18056168bcafc6bea5a59。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
为 PHP 8.4 生成最小化且安全的错误修复,并为每个错误类别提供基于 DDD/清洁架构模式的修复模板。
介绍来源: third_party · dykyi-roman · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: generate-bug-fix
description: Generates minimal, safe bug fixes for PHP 8.4. Provides fix templates for each bug category with DDD/Clean Architecture patterns.Bug Fix Generator
Templates and patterns for generating minimal, safe bug fixes.
Fix Generation Principles
1. Minimal Change
- Fix only what's broken
- No refactoring
- No "improvements"
- No formatting changes
2. Safe Change
- Preserve existing behavior
- Maintain API contracts
- Keep backward compatibility
- Add, don't remove
3. Tested Change
- Reproduction test first
- Fix makes test pass
- Existing tests still pass
Fix Templates by Category
| Category | Patterns | See |
|---|---|---|
| Null Pointer | Guard clause, Null object, Optional return | templates.md |
| Logic Error | Condition correction, Boolean inversion, Missing case | templates.md |
| Boundary | Empty check, Index bounds, Range validation | templates.md |
| Race Condition | Database locking, Optimistic locking, Atomic operation | templates.md |
| Resource Leak | Try-finally, Higher-level API, Pool return | templates.md |
| Exception | Specific catch, Exception chaining, Proper re-throw | templates.md |
| Type Safety | Strict types, Type validation, Boundary coercion | templates.md |
| SQL Injection | Prepared statement, Query builder | templates.md |
| Infinite Loop | Iteration limit, Visited tracking, Depth limit | templates.md |
Quick Reference
Null Pointer → Guard Clause
$entity = $this->repository->find($id);
if ($entity === null) {
throw new EntityNotFoundException($id);
}
Logic Error → Condition Fix
// Wrong: if ($a > $b)
// Fixed: if ($a >= $b)
Boundary → Empty Check
if ($items === []) {
throw new EmptyCollectionException();
}
Race Condition → Locking
$this->em->beginTransaction();
try {
$entity = $this->repository->findWithLock($id);
// ... modify ...
$this->em->commit();
} catch (\Throwable $e) {
$this->em->rollback();
throw $e;
}
Resource Leak → Try-Finally
$resource = acquire();
try {
return process($resource);
} finally {
release($resource);
}
Fix Composition Rules
Order of Operations
- Add validation/guards at the top
- Make the minimal code change
- Keep existing code paths intact
- Add new exception types if needed
What NOT to Change
- Method signatures (unless required)
- Return types (unless fixing wrong type)
- Visibility modifiers
- Class structure
- Unrelated code
Commit Message Format
fix(<scope>): <short description>
<detailed description of what was wrong and how it's fixed>
Fixes #<issue-number>当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供针对 PHP 8.4 的最小化、安全错误修复模板,实用性强
- 涵盖多种常见错误类别并结合 DDD/清洁架构模式,适用性广
亮点
- description 明确描述了 Skill 的功能和目标,触发词清晰
待提升项
-
缺少 When to Use 章节 原报告严重程度:轻微
Skill 缺少 When to Use 章节,用户可能不清楚具体使用场景。
改进建议:建议添加 When to Use 章节,明确说明 Skill 的适用场景和使用方法。
-
缺少端到端完整示例 原报告严重程度:轻微
Skill 提供了代码片段,但缺少一个完整的端到端示例来展示整个修复流程。
改进建议:建议添加一个完整的端到端示例,展示如何从识别错误到应用模板完成修复。
亮点
- 结构清晰,包含修复原则、模板分类、快速参考和组合规则等章节
待提升项
-
少量异常未覆盖 原报告严重程度:轻微
对于某些复杂场景(如特定框架集成)的异常处理可能未完全覆盖。
改进建议:建议补充更多复杂场景的异常处理模板,提升覆盖范围。
亮点
- 提供了多种错误类别的修复模板和代码示例,工具来源明确
- 覆盖了主要异常处理场景,整体可靠性良好
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。