Skip to main content

Skill.md

bug-generate

缺陷生成 - 仅生成 bug.md

SKILL.md

---
name: "bug-generate"
description: "缺陷生成 - 仅生成 bug.md"
---

## 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-generate

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

## Command Template

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

**Output**:**仅** `bug.md`;trace → `status: draft`

## bug.md frontmatter

```yaml
---
bug_id: BUG-xxxx
title:
severity: high
status: draft
owner:
discovered_at:
environment:
related_requirement:
related_change:
---
```

正文:现象、复现、期望/实际、影响范围、严重等级说明。

## Next

`/bug-complete 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.generate --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:* -->`).