generate-bug-fix
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "generate-bug-fix" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ff3e623e9b1d75d834deb22053e1c0a3ed24450e84d18056168bcafc6bea5a59. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Generate minimal and safe bug fixes for PHP 8.4, providing for each error category a fix template based on DDD / clean architecture patterns.
Introduction source: third_party · dykyi-roman · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Generates minimal, safe bug fixes for PHP 8.4. Provides fix templates for each bug category with DDD/Clean Architecture patterns.
- Testing
- Not tested
Browse files
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>Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供针对 PHP 8.4 的最小化、安全错误修复模板,实用性强
- 涵盖多种常见错误类别并结合 DDD/清洁架构模式,适用性广
Highlights
- description 明确描述了 Skill 的功能和目标,触发词清晰
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
Skill 缺少 When to Use 章节,用户可能不清楚具体使用场景。
Recommendation: 建议添加 When to Use 章节,明确说明 Skill 的适用场景和使用方法。
-
缺少端到端完整示例 Reported severity: Minor
Skill 提供了代码片段,但缺少一个完整的端到端示例来展示整个修复流程。
Recommendation: 建议添加一个完整的端到端示例,展示如何从识别错误到应用模板完成修复。
Highlights
- 结构清晰,包含修复原则、模板分类、快速参考和组合规则等章节
Areas to improve
-
少量异常未覆盖 Reported severity: Minor
对于某些复杂场景(如特定框架集成)的异常处理可能未完全覆盖。
Recommendation: 建议补充更多复杂场景的异常处理模板,提升覆盖范围。
Highlights
- 提供了多种错误类别的修复模板和代码示例,工具来源明确
- 覆盖了主要异常处理场景,整体可靠性良好
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.