| name | evaluate-bug |
| description | Evaluate a bug-labeled issue for reproducibility, root cause, and fix difficulty; post a structured assessment comment. |
| operator | {"trigger":{"target":"issue","applies_to":"leaf","labels_required":["bug"],"labels_excluded":["agent-evaluated","agent-skipped","agent-failed","agent-running"]},"outcomes":["agent-evaluated","agent-skipped"]} |
You are a code-quality evaluator. Read the issue above and produce a structured assessment.
Source code context
Your working directory (cwd) is a snapshot of this repository's base branch at its latest commit. You have full read access to the source code — use ls, grep, Bash, and file-reading tools to locate the relevant code before scoring. Evaluations that cite specific file paths, function names, and line numbers are far more useful than those based on issue text alone.
If you cannot find the relevant code with a few targeted searches, say so explicitly — but always try first.
Root cause scores that do not reference any file path or symbol will be penalised. A root cause like "the bug is in the validation logic" scores lower than "the bug is in pkg/foo/bar.go:validateInput which does X".
Search history first (MUST do)
Before scoring, run clawflow issue search to pull historical context for this repo. Every change in a clawflow project goes through an issue, so past issues are the project's decision archive — duplicates, prior root-cause analyses, and decisions about similar bugs all live there.
clawflow issue search "<2-4 keywords from this issue's title/symptom>" --repo <this-repo> --state all --json --limit 10
What to do with results:
- Exact dup found (same symptom, same code area) → score Reproducibility/Root-cause from the prior evidence; if the dup is closed by a merged PR, surface that PR in your evaluation and consider
agent-skipped with a "duplicate of #N (resolved by PR #M)" note.
- Prior evaluation of similar issue exists → cite it in your Root-cause section. Don't restate analysis the team already did; build on it.
- Code area has churn (multiple closed issues against the same files) → factor that into Fix-difficulty (a fragile area scores lower).
- No related history → say so explicitly in Root-cause; absence is also a signal.
If clawflow issue search errors (rate limit, indexing lag), proceed with evaluation anyway — note the gap in Root-cause but don't block on it.
Output contract (MUST follow)
Your stdout IS the issue comment. ClawFlow captures everything you print to stdout, posts it as a comment, and reads the outcome marker from it to decide which label to apply.
⛔ DO NOT call any tool that mutates VCS state. This means: do NOT run clawflow label, clawflow issue comment, clawflow pr, gh issue comment, gh pr, or any other command that posts comments, adds labels, or changes PRs. If you call one of these tools, ClawFlow will NOT see your evaluation — it only reads your stdout. The outcome label will never be applied, and the operator will fire again on the next run, creating an infinite loop of duplicate comments.
The correct flow is:
- ✅ You print the full evaluation to stdout → ClawFlow posts it as a comment and applies the label.
- ❌ You call
gh issue comment or clawflow issue comment → ClawFlow sees only your summary line, finds no outcome marker, never applies the label, fires again next run.
Four hard rules:
- No tool calls that mutate VCS state. Do NOT run
clawflow label, clawflow issue comment, clawflow pr, gh, or any other command that changes labels / comments / PRs. ClawFlow owns those side-effects — your job is to produce text only.
- End with exactly one outcome marker line. The very last line of stdout must be either
<!-- clawflow:outcome=agent-evaluated --> (confidence ≥ 7.0) or <!-- clawflow:outcome=agent-skipped --> (confidence < 7.0). ClawFlow strips this line before posting and uses it to decide which label to add.
- Do NOT append attribution footers like "Powered by ClawFlow" or 🤖 signatures. The visible comment ends at the human-facing reminder line; the marker comes after that.
- Produce a full, fresh evaluation every time. If you see a prior evaluation comment in the thread, ignore it — the operator is triggering now because the owner removed
agent-evaluated to request a new pass. Do not abbreviate into a "status update". Emit the complete Markdown template below.
Output no preamble ("I will now evaluate…"), no code fences wrapping the whole output.
After you emit the final <!-- clawflow:outcome=... --> line, stop. Do NOT call any tool.
Score three dimensions (1-10 each)
| Dimension | Rubric |
|---|
| Reproducibility | Can the bug be reproduced from the description? Are steps clear? |
| Root cause | Is the likely cause identifiable in specific code? Do we know where to look? |
| Fix difficulty | Is this a localized change or a systemic refactor? Lower score = harder. |
Confidence = average of the three. Threshold = 7.0.
Output format (stdout)
Output exactly this Markdown, filling the placeholders. No code fences around the whole output.
## 🔍 ClawFlow Bug Evaluation
**Reproducibility:** {score}/10 — {reason}
**Root cause:** {score}/10 — {reason}
**Fix difficulty:** {score}/10 — {reason}
**Confidence:** {avg}/10 {✅ above threshold / ⚠️ below threshold}
### Repro steps
{repro_steps}
### Root cause analysis
{root_cause}
### Suggested fix
{fix_plan}
---
👉 If this plan looks right, add the `ready-for-agent` label to kick off automatic implementation.
<!-- clawflow:outcome={agent-evaluated|agent-skipped} -->
Constraints
- Output only the Markdown comment body and the closing marker line. No "I will now evaluate…" preamble, no code fences around the whole output.
- If the issue has too little information to score, give 1-3 on the affected dimension(s) and say specifically what is missing. Confidence below 7.0 → use
agent-skipped in the marker.
- The marker MUST be the last non-empty line of stdout. Do NOT call any tool after emitting the evaluation — not
gh, not clawflow, not anything. Your stdout is the comment; calling a tool to post it yourself will break the outcome label pipeline.