Github Issues Audit & Labeling
Use this skill to scan open GitHub issues and apply the Agent label only when an issue is clearly suitable for AI-driven execution.
This skill is intentionally conservative: it can classify issues for automation, add clarifying comments when additional details are missing, and validate planning hygiene (milestones and project cycles).
Scope and triggers
- Use when you need issue triage and pre-labeling, not implementation.
- Use for:
- "label issues for Agent"
- "mark auto-solvable issues with Agent"
- "find candidate issues for github-process-agent-issues"
Shortcut: $github-label-agent-issues
Preconditions
- Confirm GitHub CLI authentication with
gh auth status.
- Confirm write access for target repositories.
- Confirm all GitHub operations use
gh.
- If you want mutations, pass
--apply; without it, only reports are generated.
- Resolve portable Python launcher once and reuse it:
PYTHON_BIN="$(command -v python3 || command -v python || true)"; [ -n "$PYTHON_BIN" ] || { echo "No Python interpreter found" >&2; exit 1; }
- Never invoke raw
python ....
Core behavior
- Discover local repositories under a workspace root (or a single explicit
--repo).
- Fetch open issues.
- Exclude issues already labeled
Agent or blocked by explicit disqualifier labels.
- Score each issue with strict heuristics for:
- clarity of scope
- explicit acceptance criteria or reproducibility hints
- implementation risk
- external dependency / policy/architecture-heavy context
- Apply labels:
Agent for high-confidence, safely automatable issues
Needs-Spec for well-meaning but underspecified issues
- no label change for low-confidence or risky issues
- Provide a concise per-repo report and skip any issue that is ambiguous.
- For clarification-heavy issues, post comments with
@-mentions requesting missing information.
- Ensure milestone and planning health:
- assign/ recommend milestones for qualifying Agent issues when possible
- inspect project/board state and detect empty or closed project context
- raise alerts if upcoming milestone cycles need planning
- Use investigation mode where automation confidence is reduced:
- avoid hard coding a final status
- surface next checks (close/duplicate/fix verification) for human decision
How to use
Safe dry-run (recommended first pass)
"$PYTHON_BIN" "scripts/label_agent_issues.py" \
--root "." \
--threshold 78 \
--max-issues 200 \
--apply-needs-spec \
--json
Apply labels
"$PYTHON_BIN" "scripts/label_agent_issues.py" \
--root "." \
--apply \
--threshold 78 \
--max-issues 200 \
--apply-needs-spec \
--apply-comments \
--auto-assign-milestone \
--project-alert-days 14
Target a single repo
"$PYTHON_BIN" "scripts/label_agent_issues.py" \
--repo "owner/repo" \
--apply \
--apply-needs-spec \
--apply-comments \
--auto-assign-milestone \
--project-alert-days 14
Optional dry-run-only output format (no writes)
--json prints a machine-readable array.
- default output prints a readable report grouped by repository.
Clarification and mention policy
- If uncertainty markers are detected (
?, "needs more info", "missing information", "clarif"), classify as needing clarification.
- Post comments when clarification is needed and tag people with
@ (minimum: issue author).
- Ask for concrete acceptance criteria, reproducible steps, and expected/actual behavior in comments.
Heuristic labels and policy
Positive fit signals
- Issue has clear, implementable action words in title/body (e.g.,
fix, add, update, remove, implement, document, refactor, test).
- Title + body provide either:
- acceptance criteria, or
- reproduce steps, or
- expected/actual behavior.
- Issue scope is small/medium and has no known blocking dependency.
- No requirement for legal/product strategy/major architectural decision.
Explicit disqualifier labels / conditions
- Never add
Agent if existing labels include any of: Needs-Spec, Blocked, wontfix, epic, investigation, blocked, question.
- Never add
Agent when body contains strong external/decision language:
architecture, roadmap, policy, security review, legal, pricing, compliance, contract, brand decision, product decision, investigation.
Needs-Spec application
- If an issue is likely automatable but missing enough detail, add
Needs-Spec instead of Agent.
- Never add
Needs-Spec to anything already labeled Agent.
Milestone and project-cycle obligations
- If an issue is a strong Agent candidate but has no milestone, assign it to the nearest open milestone when
--auto-assign-milestone is enabled.
- If no suitable open milestone exists, post a planning alert in comments/summaries.
- Inspect project health via
gh project and flag empty/closed project boards and missing active planning context.
- Raise alerts when nearest milestone due dates are nearing (
--project-alert-days) or overdue.
- Surface planning risks where upcoming cycles should be planned immediately.
Script entry point
scripts/label_agent_issues.py
Main arguments
--root workspace root used for local repository discovery (default .)
--repo explicit owner/repo override (single repo)
--label label to apply for automatable issues (default Agent)
--needs-spec-label label for underspecified issues (default Needs-Spec)
--threshold confidence threshold for Agent (0-100)
--apply performs writes; without it, runs read-only mode
--max-issues max open issues checked per repo (default 150)
--json machine-readable output
--apply-needs-spec applies Needs-Spec on medium-confidence issues
--apply-comments posts comments with @-mentions for clarification/planning gaps
--auto-assign-milestone auto-assigns the recommended open milestone to strong Agent candidates
--project-alert-days when to raise milestone cycle alerts ahead of due date
--label-color, --needs-spec-color, and corresponding descriptions can be customized
Project mutation expectation
- This skill audits project visibility/health but does not currently create, edit, or move GitHub project items.
- Project checks are best-effort and skip with a clear alert when
gh project is unavailable or not permitted in the current context.
Required behavior for GitHub operations
- All reads and writes must use
gh commands.
- Do not use manual web UI clicks for labeling, milestone assignment, or project inspection.
- Keep actions auditable: output what changed.
Expected outputs for this skill
- Per issue summary includes:
- decision (
agent, needs_spec, skip, already_agent, investigate)
- confidence score
- milestone missing state
- clarification-needed state
- Planning section includes:
- milestone gap alerts
- project view warnings
- cycle alerts when milestones near/overdue
- Final report groups issues by repository and prints Markdown links to each issue.
- All human-attention items (
needs-spec, skip, investigate, missing milestone, clarification needed) are emitted last in a dedicated:
Immediate attention required
- each entry includes a link and actionable next steps
investigate entries should include:
- duplicate/fix history checks
- linked PR/issue cross-checking
- explicit recommendation: close, relabel, or continue backlog
1---2name: github-label-agent-issues3description: Scan open GitHub issues and label those suitable for autonomous Agent execution with `Agent`; flag unclear candidates with `Needs-Spec`, enforce milestone alignment, and surface project/milestone-cycle planning gaps.4---56# Github Issues Audit & Labeling78# Use this skill to scan open GitHub issues and apply the `Agent` label only when an issue is clearly suitable for AI-driven execution.910This skill is intentionally conservative: it can classify issues for automation, add clarifying comments when additional details are missing, and validate planning hygiene (milestones and project cycles).1112## Scope and triggers13- Use when you need issue triage and pre-labeling, not implementation.14- Use for:15 - "label issues for Agent"16 - "mark auto-solvable issues with Agent"17 - "find candidate issues for github-process-agent-issues"1819Shortcut: `$github-label-agent-issues`2021## Preconditions221. Confirm GitHub CLI authentication with `gh auth status`.232. Confirm write access for target repositories.243. Confirm all GitHub operations use `gh`.254. If you want mutations, pass `--apply`; without it, only reports are generated.265. Resolve portable Python launcher once and reuse it:27 - `PYTHON_BIN="$(command -v python3 || command -v python || true)"; [ -n "$PYTHON_BIN" ] || { echo "No Python interpreter found" >&2; exit 1; }`28 - Never invoke raw `python ...`.2930## Core behavior311. Discover local repositories under a workspace root (or a single explicit `--repo`).322. Fetch open issues.333. Exclude issues already labeled `Agent` or blocked by explicit disqualifier labels.344. Score each issue with strict heuristics for:35 - clarity of scope36 - explicit acceptance criteria or reproducibility hints37 - implementation risk38 - external dependency / policy/architecture-heavy context395. Apply labels:40 - `Agent` for high-confidence, safely automatable issues41 - `Needs-Spec` for well-meaning but underspecified issues42 - no label change for low-confidence or risky issues436. Provide a concise per-repo report and skip any issue that is ambiguous.447. For clarification-heavy issues, post comments with `@`-mentions requesting missing information.458. Ensure milestone and planning health:46 - assign/ recommend milestones for qualifying Agent issues when possible47 - inspect project/board state and detect empty or closed project context48 - raise alerts if upcoming milestone cycles need planning499. Use investigation mode where automation confidence is reduced:50 - avoid hard coding a final status51 - surface next checks (close/duplicate/fix verification) for human decision5253## How to use5455### Safe dry-run (recommended first pass)56```bash57"$PYTHON_BIN" "scripts/label_agent_issues.py" \58 --root "." \59 --threshold 78 \60 --max-issues 200 \61 --apply-needs-spec \62 --json63```6465### Apply labels66```bash67"$PYTHON_BIN" "scripts/label_agent_issues.py" \68 --root "." \69 --apply \70 --threshold 78 \71 --max-issues 200 \72 --apply-needs-spec \73 --apply-comments \74 --auto-assign-milestone \75 --project-alert-days 1476```7778### Target a single repo79```bash80"$PYTHON_BIN" "scripts/label_agent_issues.py" \81 --repo "owner/repo" \82 --apply \83 --apply-needs-spec \84 --apply-comments \85 --auto-assign-milestone \86 --project-alert-days 1487```8889### Optional dry-run-only output format (no writes)90- `--json` prints a machine-readable array.91- default output prints a readable report grouped by repository.9293### Clarification and mention policy94- If uncertainty markers are detected (`?`, "needs more info", "missing information", "clarif"), classify as needing clarification.95- Post comments when clarification is needed and tag people with `@` (minimum: issue author).96- Ask for concrete acceptance criteria, reproducible steps, and expected/actual behavior in comments.9798## Heuristic labels and policy99100### Positive fit signals101- Issue has clear, implementable action words in title/body (e.g., `fix`, `add`, `update`, `remove`, `implement`, `document`, `refactor`, `test`).102- Title + body provide either:103 - acceptance criteria, or104 - reproduce steps, or105 - expected/actual behavior.106- Issue scope is small/medium and has no known blocking dependency.107- No requirement for legal/product strategy/major architectural decision.108109### Explicit disqualifier labels / conditions110- Never add `Agent` if existing labels include any of: `Needs-Spec`, `Blocked`, `wontfix`, `epic`, `investigation`, `blocked`, `question`.111- Never add `Agent` when body contains strong external/decision language:112 - `architecture`, `roadmap`, `policy`, `security review`, `legal`, `pricing`, `compliance`, `contract`, `brand decision`, `product decision`, `investigation`.113114### `Needs-Spec` application115- If an issue is likely automatable but missing enough detail, add `Needs-Spec` instead of `Agent`.116- Never add `Needs-Spec` to anything already labeled `Agent`.117118### Milestone and project-cycle obligations119- If an issue is a strong Agent candidate but has no milestone, assign it to the nearest open milestone when `--auto-assign-milestone` is enabled.120- If no suitable open milestone exists, post a planning alert in comments/summaries.121- Inspect project health via `gh project` and flag empty/closed project boards and missing active planning context.122- Raise alerts when nearest milestone due dates are nearing (`--project-alert-days`) or overdue.123- Surface planning risks where upcoming cycles should be planned immediately.124125## Script entry point126`scripts/label_agent_issues.py`127128### Main arguments129- `--root` workspace root used for local repository discovery (default `.`)130- `--repo` explicit `owner/repo` override (single repo)131- `--label` label to apply for automatable issues (default `Agent`)132- `--needs-spec-label` label for underspecified issues (default `Needs-Spec`)133- `--threshold` confidence threshold for `Agent` (0-100)134- `--apply` performs writes; without it, runs read-only mode135- `--max-issues` max open issues checked per repo (default 150)136- `--json` machine-readable output137- `--apply-needs-spec` applies `Needs-Spec` on medium-confidence issues138- `--apply-comments` posts comments with `@`-mentions for clarification/planning gaps139- `--auto-assign-milestone` auto-assigns the recommended open milestone to strong Agent candidates140- `--project-alert-days` when to raise milestone cycle alerts ahead of due date141- `--label-color`, `--needs-spec-color`, and corresponding descriptions can be customized142143### Project mutation expectation144- This skill audits project visibility/health but does not currently create, edit, or move GitHub project items.145- Project checks are best-effort and skip with a clear alert when `gh project` is unavailable or not permitted in the current context.146147## Required behavior for GitHub operations148- All reads and writes must use `gh` commands.149- Do not use manual web UI clicks for labeling, milestone assignment, or project inspection.150- Keep actions auditable: output what changed.151152### Expected outputs for this skill153- Per issue summary includes:154 - decision (`agent`, `needs_spec`, `skip`, `already_agent`, `investigate`)155 - confidence score156 - milestone missing state157 - clarification-needed state158- Planning section includes:159 - milestone gap alerts160 - project view warnings161 - cycle alerts when milestones near/overdue162- Final report groups issues by repository and prints Markdown links to each issue.163- All human-attention items (`needs-spec`, `skip`, `investigate`, missing milestone, clarification needed) are emitted last in a dedicated:164 - `Immediate attention required`165 - each entry includes a link and actionable next steps166- `investigate` entries should include:167 - duplicate/fix history checks168 - linked PR/issue cross-checking169 - explicit recommendation: close, relabel, or continue backlog