3.5 KiB
| name | description |
|---|---|
| up-defect-fix | Review code from the current iteration and fix approved defects one at a time, including real-runtime API and browser-E2E portal findings, escalating to a Change Request whenever the root cause turns out to be an incomplete or wrong requirement rather than a coding mistake. Use this after up-code-generate has produced a story's implementation, during code review, QA, or UAT of the current iteration. This is Stage 14 (Construction) of the UP-AI v1.0 Process (00_prompts/AI_Native_Unified_Process_v1.md). |
up-defect-fix — Stage 14 (Construction, per iteration)
Objective
Review and fix defects for the current iteration's code, and correctly distinguish a coding bug (fix in code, done) from a requirements gap (the FR/UC itself was incomplete or wrong — must be raised as a CR-xxx, not just patched).
When to invoke
- After
up-code-generateproduces a story's implementation, as part of code review. - During QA or UAT of the current iteration, for any defect logged against iteration code.
Read first
defect_register.md/code_review_log.md(iteration-scoped)- Related source code
- Related
functional-reqs.md(the FR the defect's story implements) - Related
TC-xxxtest cases - Current iteration's
iteration_surface_matrix.md
Procedure
Fix the next approved defect from the defect register.
Pick the first defect with Status = "Approved for Fix." Fix only that defect.
Rules:
- Do not introduce unrelated changes or refactor unrelated files.
- Preserve existing behavior unless the defect requires correction.
- Add a targeted regression test to prevent recurrence (coordinate with
up-test-model-generate), then run the regression suite scoped to the affectedUC-xxx/FR-xxxviascripts/run_tests.sh --scope uc-xxxbefore closing the defect. - Update documentation if behavior changes.
- Update traceability if requirement coverage changes.
- If the defect exposes an unimplemented frontend/API/data/integration/runtime surface, update the surface matrix and treat it as a blocking integration finding until implemented or explicitly deferred by
CR-xxx/DEC-xxx.
Before closing the defect, classify the root cause:
- If the root cause is a coding error (logic bug, missed edge case the requirement already specified) → fix in code as normal.
- If the root cause is that the requirement itself was incomplete, ambiguous, or wrong — do not just fix the code. Raise
CR-xxxviaup-change-request-impact, citing theFR-xxx/UC-xxxthat needs correction, get its impact analyzed and approved, and only then apply the code fix alongside the requirement correction.
For the defect fix, provide: Defect ID, root cause, files changed, fix implemented, tests added/updated, verification steps, regression risk, requirement references.
Output expected
Code fix; updated defect register and traceability entries; a CR-xxx if the defect was requirements-rooted.
Exit criteria
Defect closed with root cause documented; real-runtime/API/browser-E2E regression evidence added where applicable; the affected surface matrix row is current; if requirements-rooted, the linked CR-xxx shows disposition Approved/Re-baselined/Verified.
Sample invocation
"Run up-defect-fix for DEF-002 (order status transitions to CANCELLED from an invalid state) — check whether this is a code bug or whether UC-003's status FSM itself is missing this transition rule."
Related skills
Previous: up-code-generate. Next: up-traceability-gate (Gate 14.1). If requirements-rooted: up-change-request-impact.