跳到正文
cccskills
免费在 GitHub 公开

bug-history-summarizer

Summarizes the complete lifecycle of a bug across code versions, tracking its introduction, detection, fixing attempts, and regression history. Use when users need to: (1) Understand how a bug evolved over time, (2) Trace when and how a bug was introduced, (3) Analyze fix attempts and their effectiveness, (4) Identify regression patterns, (5) Generate bug lifecycle reports for documentation or post-mortems. Takes a repository, bug identifier, and version history as input.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Bug History Summarizer

Trace and summarize the complete lifecycle of a bug across code versions.

Workflow

Follow these steps to generate a comprehensive bug history summary:

1. Identify the Bug and Gather Context

Collect essential information:

  • Bug identifier: Issue number, commit hash, or bug description
  • Repository: Target codebase with version history
  • Version range: Specific versions/commits to analyze (or entire history)
  • Related artifacts: Issue reports, pull requests, commit messages, test results

2. Trace Bug Introduction

Identify when and how the bug was introduced:

Using git blame and bisect:

  • Run git blame on affected files to find when problematic lines were added
  • Use git bisect to pinpoint the exact commit that introduced the bug
  • Analyze the introducing commit: author, date, purpose, related changes

Analyze introduction context:

  • What was the original intent of the change?
  • Was it a new feature, refactoring, or bug fix?
  • Were there code review comments or warnings?
  • What tests existed at the time?

3. Track Detection History

Document when and how the bug was discovered:

  • Initial detection: When was the bug first reported or noticed?
  • Detection method: User report, automated test, code review, production incident?
  • Time to detection: How long between introduction and discovery?
  • Severity assessment: How was the bug initially classified?

4. Analyze Fix Attempts

Chronicle all attempts to fix the bug:

For each fix attempt:

  • Commit hash and date
  • Author and reviewer
  • Fix approach and code changes
  • Test coverage added
  • Whether the fix was successful or reverted

Identify patterns:

  • Multiple fix attempts indicate complexity
  • Reverted fixes suggest incomplete understanding
  • Test additions show learning from the bug

5. Check for Regressions

Identify if the bug reappeared after being fixed:

  • Search for related bug reports after the fix
  • Check if the fix was reverted or modified
  • Look for similar bugs in related code
  • Analyze if the bug reoccurred in different contexts

6. Generate Summary Report

Create a structured timeline and analysis:

Timeline format:

## Bug History: [Bug Title/ID]

### Introduction
- **When**: [Date/Commit]
- **Where**: [File:Line]
- **How**: [Description of introducing change]
- **Context**: [Why the change was made]

### Detection
- **Discovered**: [Date]
- **Method**: [How it was found]
- **Time to Detection**: [Duration]
- **Initial Impact**: [Severity/Scope]

### Fix Attempts
1. **Attempt 1** ([Date/Commit])
   - Approach: [Description]
   - Outcome: [Success/Failure/Partial]
   - Tests Added: [Yes/No]

2. **Attempt 2** ([Date/Commit])
   - ...

### Regressions
- **Regression 1** ([Date])
  - Cause: [Why it reappeared]
  - Fix: [How it was resolved]

### Current Status
- [Fixed/Open/Recurring]
- Last modified: [Date]

### Lessons Learned
- [Key insights from the bug's history]

Example

Input:

  • Repository: myapp
  • Bug: "Null pointer exception in user login"
  • Issue: #456

Analysis Process:

  1. Git blame shows the problematic code was added in commit abc123 on 2024-01-15
  2. Commit analysis reveals it was part of a refactoring to improve performance
  3. Issue tracker shows bug reported on 2024-02-20 (36 days after introduction)
  4. Fix attempts:
    • First fix (commit def456, 2024-02-21): Added null check, but incomplete
    • Second fix (commit ghi789, 2024-02-25): Comprehensive fix with tests
  5. Regression check: No regressions found

Generated Summary:

## Bug History: Null Pointer Exception in User Login (#456)

### Introduction
- **When**: 2024-01-15 (commit abc123)
- **Where**: src/auth/LoginHandler.java:45
- **How**: Refactoring removed null check during performance optimization
- **Context**: Part of PR #234 to reduce login latency

### Detection
- **Discovered**: 2024-02-20
- **Method**: Production incident report
- **Time to Detection**: 36 days
- **Initial Impact**: High severity - blocking user logins

### Fix Attempts
1. **Attempt 1** (2024-02-21, commit def456)
   - Approach: Added null check for user object
   - Outcome: Partial - fixed main case but missed edge case
   - Tests Added: Yes (1 unit test)

2. **Attempt 2** (2024-02-25, commit ghi789)
   - Approach: Comprehensive null handling with validation
   - Outcome: Success
   - Tests Added: Yes (3 unit tests + 1 integration test)

### Regressions
- None detected

### Current Status
- Fixed (as of 2024-02-25)
- Last modified: commit ghi789

### Lessons Learned
- Performance optimizations should maintain defensive checks
- Initial fix was too narrow - comprehensive testing revealed edge cases
- Added regression tests to prevent reintroduction

Output Format

Provide:

  1. Structured timeline in Markdown format
  2. Key metrics:
    • Time to detection
    • Number of fix attempts
    • Time to resolution
    • Regression count
  3. Visual timeline (optional, using ASCII or Mermaid):
    2024-01-15: Bug introduced (commit abc123)
         |
         | (36 days)
         |
    2024-02-20: Bug detected (issue #456)
         |
         | (1 day)
         |
    2024-02-21: Fix attempt 1 (partial)
         |
         | (4 days)
         |
    2024-02-25: Fix attempt 2 (success)
    
  4. Lessons learned and recommendations

Git Commands Reference

Useful commands for bug history analysis:

# Find when a line was introduced
git blame <file>

# Find the commit that introduced a bug
git bisect start
git bisect bad <bad-commit>
git bisect good <good-commit>

# Search commit messages for bug references
git log --grep="<bug-id>" --oneline

# Show commits that modified a specific file
git log --follow -- <file>

# Show commits in a date range
git log --since="2024-01-01" --until="2024-12-31"

# Find commits by author
git log --author="<name>"

# Show detailed commit information
git show <commit-hash>

Tips for Effective Bug History Analysis

  1. Start with the fix - Work backwards from the fix commit to understand the bug
  2. Check related files - Bugs often span multiple files
  3. Read commit messages - They provide context about intent
  4. Review pull requests - Comments reveal decision-making
  5. Check test history - Tests added after bugs show learning
  6. Look for patterns - Similar bugs may have related causes
  7. Consider context - Deadlines, team changes, and technical debt affect bug introduction

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

中文简介正在准备中。当前显示原文说明。

ArabelaTso/Skills-4-SE2582026年8月21日 更新

查看 ArabelaTso 的全部技能

报告此技能的问题