Skip to content

[v3.18 ops] sin triage: backlog auto-prioritizer via gh CLI #162

Description

@Delqhi

Backlog Triage CLI (sin triage)

A CLI that reads the open issues via gh and produces a prioritized BACKLOG.md based on labels, dependencies, and acceptance criteria.

Why

There are 20+ open issues, ungetriaged. The v0 Agent is working on the Loop-Engineering cluster (#150-155), but the rest (Skill-Fusion, Autopilot, Spec-Layer, CodeGraph) is silent. A triage CLI is the meta-tool that tells the operator "what's next."

SOTA-Agents do this themselves before starting a new task. SIN-Code currently relies on the operator to read the GitHub issue list manually.

What ships

Subcommand: sin triage

sin triage                      # show all open issues, grouped + prioritized
sin triage --label=loop-system  # filter by label
sin triage --format=md > BACKLOG.md  # write to a file
sin triage --format=json        # machine-readable

Prioritization heuristic

For each open issue, compute a score:

Signal Points
Has epic label +10
Blocks another issue (via issue reference) +5 per blocked
Has acceptance text in body +3
Has no v0 label (= v0 isn't doing it) +5
Has good first issue label -3 (deprioritize for the operator, prioritize for new contributors)
Last updated > 30 days -2
Last updated < 7 days +1

Then sort by score descending. Output is grouped by label (epic, loop-system, enhancement, etc.).

BACKLOG.md regeneration

A pre-commit hook that runs sin triage --format=md > BACKLOG.md and stages the result. Operator reviews the diff.

Acceptance criteria

  • sin triage shows the current backlog, sorted and grouped
  • BACKLOG.md is generated correctly, includes the score breakdown per issue
  • The CLI is fast (< 2s for 50 issues, uses gh issue list --json once)
  • The pre-commit hook is opt-in
  • Test coverage ≥ 80%

Mandates

  • M1 (n8n CI): the pre-commit hook runs locally, not in CI
  • M4 (permission engine): the CLI uses gh (already a dependency), no new perms

Related

  • BACKLOG.md (already exists, currently static) — what this CLI regenerates
  • cmd/sin-code/internal/ghbridge/ — the gh API wrapper that this could use instead of shelling out
  • cmd/sin-code/internal/sin-summary/cmd.go — similar pattern (read state, render)

Estimated scope

~2-3 days, 1 PR, 1 new package cmd/sin-code/internal/triage/ (~400 LOC). Small but high-leverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions