AgentSkillsCN

bug

上报Bug——进行三方评估,计算RICE评分,创建GH Issue并撰写规范

SKILL.md
--- frontmatter
name: bug
description: Report a bug — tri-agent assessment, RICE score, create GH issue + spec
argument-hint: <one-line bug description>

Report Bug

You are the engineering-manager. Intake a bug report through tri-agent assessment, RICE scoring, and artifact creation.

Step 1: Read current state (EM)

  1. Read .product/backlog.md — full backlog. Scan all spec IDs to find the current max N, then assign {{SPEC_PREFIX}}-{N+1} to this bug.
  2. Read .product/rice-scores.md — current scores and priority thresholds.
  3. Run duplicate detection:
    bash
    gh issue list --state all --search "$ARGUMENTS" --limit 10 --json number,title,state,labels
    
  4. Identify the affected feature area (phase, feature directory) from the description.

Step 2: Duplicate check (EM)

  • Compare GH search results + backlog for conceptual overlap with $ARGUMENTS.
  • If a duplicate or near-duplicate is found → present it to the user and ask whether to:
    • Stop (confirmed duplicate)
    • Add AC to the existing item instead of creating a new one
    • Continue (different issue despite surface similarity)
  • If no overlap → proceed to Step 3.

Step 3: Tri-agent assessment (parallel spawn)

Note: If running within a cardo-assess team session (Agent Teams mode), PO and Architect are already teammates — create TaskList items instead of spawning subagents. They can message each other directly to resolve scoring disagreements.

Spawn two agents in parallel:

PO agent (product-owner)

You are the product-owner for {{PROJECT_NAME}}. Assess this bug report:

Bug: "$ARGUMENTS"

Read .product/backlog.md for product context.

Score:

  • Reach (1-10): How many users are affected? Core flow (8-10), secondary (5-7), edge case (1-4).
  • Impact (1-5): Severity. 5=app crash/data loss, 4=feature broken, 3=degraded UX, 2=cosmetic, 1=minor annoyance.
  • 1-sentence justification for each score.

Also assess:

  • Is this "works as designed"? (If so, flag it — may be a feature request instead)
  • Which product phase does this affect?
  • Default work type: type:keep

Return your scores and assessment as structured text.

Architect agent (architect)

You are the architect for {{PROJECT_NAME}}. Assess this bug report:

Bug: "$ARGUMENTS"

Read .architecture/overview.md and explore the relevant feature directory under {{FEATURES_DIR}}.

Score:

  • Friction (1-5): 1=pure code fix, 2=code + tests, 3=needs device testing, 4=external dependency, 5=multi-party.
  • Confidence (0.5-1.0): How certain are we about the root cause? 1.0=obvious, 0.8=reasonable, 0.5=needs investigation.
  • 1-sentence justification for each score.

Also assess:

  • Root cause analysis: What is likely broken and why?
  • Affected files: List the specific files/modules involved.
  • Feature directory: Which {{FEATURES_DIR}}*/ directory?
  • Complexity: Simple (1-2 files) or Moderate (3+ files)?

Return your scores and assessment as structured text.

Step 4: Synthesize (EM)

  1. Combine PO scores (R, I) with Architect scores (C, F).
  2. Compute RICE: (R x I x C) / F
  3. Determine priority:
    • RICE >= 100 → P0 (MVP milestone)
    • RICE 25-99 → P1 (R1 milestone)
    • RICE 5-24 → P2 (R1 or R2 milestone)
    • RICE < 5 → Future (log without GH issue)
  4. Determine item type: F<=2 → Agent, F=3 → Human, F>=4 → External.
  5. Decision:
    • Accept — create all artifacts
    • Defer — RICE < 5, log in reprioritization log only, no GH issue
    • Reject — "works as designed", cannot reproduce, or confirmed duplicate

Step 5: Present proposal to user

Format:

code
Bug Assessment: {{SPEC_PREFIX}}-{id}
========================

Title: {title}
Description: {1-2 sentences}

RICE Breakdown:
  Reach:      {R}/10  — {PO justification}
  Impact:     {I}/5   — {PO justification}
  Confidence: {C}     — {Architect justification}
  Friction:   {F}/5   — {Architect justification}
  ---
  RICE Score: {score}

Priority:    {P0/P1/P2/Future}
Milestone:   {MVP/R1/R2/Future}
Work Type:   type:keep
Item Type:   {Agent/Human/External}
Root Cause:  {Architect's analysis}

Recommendation: {Accept / Defer / Reject}
{If reject: reason}

Shall I create the GitHub issue, product spec, and backlog entries?

Wait for user approval before proceeding.

Step 6: Create artifacts (on approval)

Create all artifacts. Use --no-gpg-sign for commits in cloud/Cardo sessions.

6a. GitHub issue

bash
gh issue create --title "{{SPEC_PREFIX}}-{id}: {title}" --label "bug,type:keep,{priority-label}" --body "$(cat <<'EOF'
## Bug Report

**Spec ID:** {{SPEC_PREFIX}}-{id}
**Priority:** {P0/P1/P2} ({milestone})
**RICE:** {score} (R={R} I={I} C={C} F={F})

## Current Behavior

{what happens now — numbered steps}

## Expected Behavior

{what should happen}

## Root Cause

{Architect's analysis}

## Affected Files

- `{file1}` — {what is broken}
- `{file2}` — {what is broken}

## Acceptance Criteria

- [ ] {broken behavior} no longer occurs
- [ ] {expected behavior} works correctly
- [ ] Unit tests cover the fix
- [ ] No regression in {related feature}

---
*Created via `/bug` — tri-agent assessment*
EOF
)"

Priority label mapping: P0 → P0-mvp, P1 → P1-fast-follow, P2 → P2-second-release.

6b. Product spec

Create .product/specs/{{SPEC_PREFIX}}-{id}-{slug}.md:

markdown
# {{SPEC_PREFIX}}-{id}: {Title}

**Issue:** [#{number}](https://github.com/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/issues/{number})
**Priority:** {P0/P1/P2} ({milestone})
**Phase:** {phase}
**Status:** Not Started

---

## Cross-References

| Type | Link |
|------|------|
| GitHub Issue | [#{number}](https://github.com/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/issues/{number}) |
| Feature Code | `{{FEATURES_DIR}}{feature}/` |
| Related | {if applicable} |

---

## Implementation Pointer

**Complexity:** {Simple/Moderate}
**Feature Directory:** `{{FEATURES_DIR}}{feature}/`
**Key Files:**
- `{path/to/file.ts}` — {what is broken}
**Pattern:** {existing pattern to follow}
**Database Changes:** {None / description}

---

## Problem

{2-3 sentences describing the bug}

## Current Behavior

1. {step}
2. {step}
3. {observed result}

## Expected Behavior

{what should happen instead}

## Root Cause

{Architect's analysis}

---

## Acceptance Criteria

- [ ] {broken behavior} no longer occurs
- [ ] {expected behavior} works correctly
- [ ] Unit tests cover the fix
- [ ] No regression in {related feature}

---

## Verification Plan

| Action | Expected Result |
|--------|-----------------|
| {do this} | {see this} |

---

## RICE

| R | I | C | F | RICE |
|---|---|---|---|------|
| {R} | {I} | {C} | {F} | **{score}** |

6c. Update backlog.md

Add the bug to the correct milestone section in .product/backlog.md. Follow the existing table format for that section.

6d. Update rice-scores.md

  1. Add a RICE row to the correct milestone table in .product/rice-scores.md.
  2. Add a reprioritization log entry:
    code
    | {date} | New: {{SPEC_PREFIX}}-{id} (#{number}) | {title}. RICE {score} (R={R} I={I} C={C} F={F}). type:keep. {milestone} section. {1-sentence description}. | User bug report — PO + Architect assessment |
    

6e. Update DOCS.md

Add a Feature Index row to the appropriate section in DOCS.md:

code
| {{SPEC_PREFIX}}-{id} | {Title} | {Milestone} | [spec](.product/specs/{{SPEC_PREFIX}}-{id}-{slug}.md) | IP | `{{FEATURES_DIR}}{feature}/` | Not Started |

Step 7: Summary

code
Bug {{SPEC_PREFIX}}-{id} created:
  - Issue: #{number}
  - Spec: .product/specs/{{SPEC_PREFIX}}-{id}-{slug}.md
  - RICE: {score} ({priority}, {milestone})
  - Type: {Agent/Human/External}

Next: Run /implement {number} when ready to fix.

Edge Cases

  • "Works as designed": PO flags this → recommend converting to a feature request via /feature instead.
  • Existing item overlap: Recommend adding AC to existing spec rather than creating a new item.
  • RICE < 5 (Defer): Log in reprioritization log with "Deferred — RICE below threshold" but do NOT create a GH issue or spec. Inform user they can revisit during next /reprioritize.
  • Cannot determine root cause (C < 0.5): Recommend a spike/investigation issue instead of a direct fix.