Skip to main content

Skill.md

bug-complete

缺陷完善 - 补齐 root-cause、workaround、acceptance、trace

SKILL.md

---
name: "bug-complete"
description: "缺陷完善 - 补齐 root-cause、workaround、acceptance、trace"
---

## Context Budget Guardrails(MUST)

- MUST 遵守 `rules/agent-context-budget.md`;同一会话已读且无变更的规则用摘要承接,不重复全量读取。
- 不要默认 `cat rules/*.md`、`cat AGENTS.md openspec/project.md rules/...` 或读取整目录;按本命令 Step 0 列表读取必要文件,已在同一会话读取过且无变更时用摘要承接。
- 检索先用 `rg -l` / `rg --files` 定位文件,再用 `sed -n '<start>,<end>p'` 或 `nl -ba ... | sed -n` 读取必要片段。
- 大范围 `rg` MUST 限制目录与输出:优先加 `--glob '!openspec/archive/**' --glob '!**/node_modules/**' --glob '!**/.git/**'`;只有追溯历史归档时才放开 archive,并说明原因。
- 对 Harness / 模板工程 / agent 资产目录执行搜索时,默认排除 `pm-harness*/**`、`**/assets/**`、历史/外部 agent 目录(如 `.claude/**`、`.kiro/**`、`.opencode/**`);除非当前任务明确要求分析这些目录。
- 命令输出优先控制在 `max_output_tokens <= 8000`;预期超出时先输出文件清单或命中计数,再分段读取。
- 不重复读取同一大文件集合;若需要再次确认,优先读取变更片段、`git diff -- <file>` 或具体 frontmatter/status 字段。

# bug-complete

Use this skill when the user asks to run the migrated source command `bug-complete`.

## Command Template

**Input**:`BUG-xxxx`(须 `bug.md`)

**Output**:root-cause.md、workaround.md、acceptance.md、trace.md;logs/、screenshots/ 目录(若需)

**禁止**:`openspec/`、`src/`

---

## 文档要点

| 文件 | 内容 |
|------|------|
| root-cause.md | 直接原因、根本原因、触发条件、分类(code/design/db/…) |
| workaround.md | 临时规避或无 |
| acceptance.md | 回归 AC-xxx |
| trace.md | status → enriching → pending_review |

## Readiness

Ready:bug + root-cause + acceptance + trace

## Next

`/bug-review BUG-xxxx`

---

## Final Step — Workflow Sync (MUST)

Read `.agents/skills/workflow-sync/SKILL.md` and run:

```bash
python scripts/sync-workflow-status.py --event bug.complete --bug <BUG-id> --sprint auto
```

- Exit code **MUST** be `0` before ending this command.
- Print the summary **Workflow Sync Report** to the user; use `--output detail` only for debugging.
- Do **not** hand-edit `sprint.md` Scope marker blocks (`<!-- workflow-sync:* -->`).