AgentSkillsCN

Bug Phase Classification

Bug 阶段分类

SKILL.md

Skill: bug-phase-classification

Purpose: Consistently classify bugs by Detected Phase and Injected Phase so quality metrics are reliable.

This skill is used whenever a bug is logged in docs/quality/BUG_LOG.md.


Detected phase (objective)

Answer: When was the problem first noticed?

Use exactly one:

  • requirement – noticed while reading the requirement
  • analysis – noticed during analysis reasoning
  • design – noticed during architecture/UX/API design
  • implementation – noticed while coding or running locally
  • testing – noticed during QA or test execution
  • deployment – noticed during rollout or staging checks
  • maintenance – noticed in production or via monitoring/users

Rule:

Detection phase = when someone first saw the problem.


Injected phase (diagnostic)

Answer: Where should this bug have been prevented if that phase were done correctly?

Choose the earliest applicable phase:

Injection decision rules (in order)

  1. Requirement
  • Requirement was wrong, incomplete, contradictory, or misleading.
  • Even a perfect design/implementation would fail.
  1. Analysis
  • Requirement was correct, but assumptions or reasoning were wrong.
  • Edge cases or constraints were missed despite being implied.
  1. Design
  • Architecture, API contract, UX flow, or data model made correct behavior impossible or fragile.
  • Validation, permissions, or performance issues stem from the plan itself.
  1. Implementation
  • Design was sound, but code is incorrect or incomplete.
  • Logic bugs, wrong conditions, incorrect API usage.
  1. Testing
  • Bug existed but should reasonably have been caught by tests or QA.
  • Missing test coverage for known scenarios.
  1. Deployment
  • Bug introduced by configuration, migration order, environment mismatch, or feature flags.
  1. Maintenance
  • Bug emerged over time due to scale, data drift, dependency changes, or accumulated debt.
  1. Unknown
  • Multiple phases plausible or insufficient evidence.
  • Must explain briefly in Notes.

Rule:

Injection phase = the first phase that made the bug possible.


Anti-patterns (do not do this)

  • Do NOT default everything to implementation.
  • Do NOT copy detected phase into injected phase without reasoning.
  • Do NOT blame later phases for earlier mistakes.

Output expectation

When logging a bug:

  • Always set both detected phase and injected phase.
  • If uncertain, choose the best candidate and explain briefly.