OR Key
drop another .md file to compare - side-by-side diff against gh-triage

gh-triage

Surfaces open issues and stalled work across your projects so nothing sits.
description: "Triggers on prompt mention of 'gh-triage'."
personal 2 files 10 recent evals

What it does for you

Surfaces open issues and stalled work across your projects so nothing sits.

What it produces

A recent result, so you can see the kind of work it returns.

loading…

How to get it

These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.

Work with me
For developers how this skill is built, graded, and how it runs

at a glance- the short version

actorState/lib/github.ts - the listPrs + getIssues
auditorSkill's own shape gate - a deterministic post-processor
eval modeauto
categoryOps
stages4
dependsgithub

what's inside - the parts that make up a skill 2/4 present

A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.

The skill
state/skills/gh-triage/SKILL.md present
the skill itself, in plain text
The main file. It says what the skill is and lays out the steps in plain English.
Code
state/lib/gh-triage.ts not present
code the skill can run
Optional. Many skills are just words and need no code at all.
Scripts
state/bin/gh-triage/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/gh-triage/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

how it's graded - what counts as a good run 4 criteria · 4 deterministic

Each row is one thing a good run has to get right. deterministic means a quick check decides, pass or fail. judge means the AI reads the result and rates it. Grading each piece on its own (instead of one overall score) shows exactly where a run fell short, so the fix is obvious.

name
kind
check
output_shape_and_content
deterministic
The output JSON strictly conforms to the specified schema: { total_open, by_label: { [label]: count }, stale: [{ repo, number, title, kind, days_since_update, html_url, labels }] }, with correct data types and ranges for all fields.
stale_items_correctness
deterministic
All entries in the 'stale' array have 'days_since_update' greater than 'stale_days' (default 7 if not provided) and are sorted in descending order by 'days_since_update'.
no_side_effects
deterministic
Execute the skill with a mock GitHub API that logs all attempted writes. Verify no writes, comments, or CLI state mutations occurred during execution.
labels_clustering_accuracy
deterministic
The 'by_label' object accurately reflects a recount of all open items, where each item contributes to its respective label counts, and the 'total_open' count matches the sum of distinct open issues and PRs.

how it runs - the shared frame every skill uses 5/5 present

Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.

makes the work The worker
present
State/lib/github.ts - the listPrs + getIssues the worker
Does the actual work. Whatever it produces is what gets checked next.
checks the work The reviewer
present
Skill's own shape gate - a deterministic post-processor the checker
A separate checker grades the work, so the part that made it can't approve its own work.
frame
learns Self-correction
present
fixes itself learns from gaps
When a run hits a gap, the skill gets edited on the spot [FIXED] or queued for a bigger rewrite [LOGGED], so it keeps getting better.
tidies up Background fixes
present
queued for rewrite runs in the background
Bigger fixes that can't be made on the spot get queued and rewritten in the background later.
remembers Run history
present
state/log/evals.ndjson auto runs
Every run is written down here, so the next time this skill is used it already knows how the last runs went.
Critical rules the things this skill must not get wrong
  1. GitHub /issues returns PRs too. The REST endpoint includes pull requests — every PR has a pull_request key. Filter !item.pull_request when counting pure issues, or you'll double-count every PR.
  2. Staleness is updated_at, not created_at. updated_at includes comments, label changes, reviews. Using created_at will flag items that were discussed yesterday as stale.
  3. Never git push --force to main, never push directly to main on client repos. This skill is read-only by design; if graduated into a script that posts comments, the hard rule still applies to any sibling script that writes.
  4. Rate limit: unauthenticated 60/hr, with GITHUB_TOKEN 5000/hr. Triage > 100 repos in a loop will hit the cap — batch or paginate.

what it has learned - fixes written back in over time sample

When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.

  1. Loading feedback rows…

how the work flows- who makes it, who checks it

inputs github
actor State/lib/github.ts - the listPrs + getIssues
1 generator
invoke
actor = State/lib/github.ts - the listPrs + getIssues
prose skill — for each `{owner, repo}`: `listPrs(owner, repo, "open")` + `getIssues(owner, repo, "open")` in parallel
auditor Skill's own shape gate - a deterministic post-processor
2 auditor
inspect
auditor = Skill's own shape gate - a deterministic post-processor
shape gate — `total_open` + `by_label` + `stale` exist; every `stale` entry has `days_since_update > stale_days`; array sorted desc; `by_label` integers match a re-count
2 data
Log + eval
```typescript

SKILL.md- the skill, written out in plain English

gh-triage

Triage skill over GitHub. Reads open issues and PRs from a set of repos via state/lib/github.ts, clusters them by label, and surfaces items whose most recent activity is older than stale_days (default 7). Prevents the failure mode where a client issue sits untouched for two weeks because it wasn't in anyone's inbox.

Steps

1. Scope - no side effects

  • Parse repos input into [{owner, repo}, ...].
  • For each repo:
  • listPrs(owner, repo, "open") → open PRs.
  • getIssues(owner, repo, "open") → open issues (GitHub's issues endpoint

returns PRs too; filter with !item.pull_request so we don't double-count).

  • Return a shape:
  { total_open, by_label: { [label]: count },
    stale: [{ repo, number, title, kind, days_since_update, html_url, labels }] }
  • No writes. No comments. No CLI state mutation.

2. Gate

  • Throw if repos is missing or empty.
  • Throw if GITHUB_TOKEN is not in .env.cache (let env() do it).
  • stale_days defaults to 7 when not supplied; must be a positive integer.

3. Act (only if the gate passes)

  • For each repo, call listPrs and getIssues in parallel.
  • Cluster: bucket every open item by each of its label names (one item may

land in multiple buckets - that's fine, it's a view, not a partition).

  • Compute staleness: for each item compute

days_since_update = (now - new Date(item.updated_at)) / 86400000. Items with days_since_update > stale_days go into stale, sorted descending by age.

  • Return the shape above. The orchestrator chooses whether to post it,

print it, or feed it into a digest.

4. Log + eval

append("chain", { run_id, skill: "gh-triage", action: "triaged",
                  repos: repos.length, total_open, stale_count });
score("gh-triage", run_id, {
  score:
    shape_ok && labels_clustered && stale_sorted ? 1.0 :
    shape_ok ? 0.5 :
    0.0,
  primary_issue:
    !shape_ok ? "shape-mismatch" :
    !labels_clustered ? "cluster-missing" :
    !stale_sorted ? "stale-unsorted" :
    null,
  total_open, stale_count, repo_count: repos.length,
});

Eval

Actor: state/lib/github.ts - the listPrs + getIssues calls that hit the real GitHub REST API and return live data. Auditor: the skill's own shape gate - a deterministic post-processor that checks: (a) top-level keys total_open, by_label, stale exist, (b) every stale entry has days_since_update > stale_days and the array is sorted desc, (c) by_label values are integers matching a re-count of the raw list. Shape gate is pure code, no LLM, no GitHub call - different system than the actor.

Score convention:

OutcomeScore
All three shape checks pass on first try1.0
Shape checks pass but ordering/labels needed a fix-up pass0.5
Shape broken or GitHub fetch failed0.0

Gotchas

  • GitHub /issues returns PRs too. The REST endpoint for issues

includes pull requests - every PR has a pull_request key. Filter !item.pull_request when counting pure issues, or you'll double-count every PR.

  • Rate limit. Unauthenticated: 60 req/hr. With GITHUB_TOKEN: 5000/hr.

If you triage > 100 repos in a loop you will hit the cap - batch or paginate instead of hammering.

  • updated_at vs created_at. Staleness is measured against

updated_at (includes comments, label changes, reviews). Using created_at will flag items that were discussed yesterday as stale.

  • Client repos live in different owners. jcameron12/total,

snappy-ai/..., etc. Pass a flat repos list - the skill does not assume one org.

  • Never git push --force to main and never push directly to main on

client repos (kernel SKILL.md hard rule). This skill is read-only by design, but if you graduate it into a script that posts comments, the hard rule still applies to any sibling script that writes.

Rubric

criteria:
  - name: output_shape_and_content
    kind: deterministic
    check: "The output JSON strictly conforms to the specified schema: { total_open, by_label: { [label]: count }, stale: [{ repo, number, title, kind, days_since_update, html_url, labels }] }, with correct data types and ranges for all fields."
  - name: stale_items_correctness
    kind: deterministic
    check: "All entries in the 'stale' array have 'days_since_update' greater than 'stale_days' (default 7 if not provided) and are sorted in descending order by 'days_since_update'."
  - name: no_side_effects
    kind: deterministic
    check: "Execute the skill with a mock GitHub API that logs all attempted writes. Verify no writes, comments, or CLI state mutations occurred during execution."
  - name: labels_clustering_accuracy
    kind: deterministic
    check: "The 'by_label' object accurately reflects a recount of all open items, where each item contributes to its respective label counts, and the 'total_open' count matches the sum of distinct open issues and PRs."

AGENTS.md- what the AI loads when this skill comes up

gh-triage - loader

Per-turn rules for the gh-triage skill. Full reference: state/skills/gh-triage/SKILL.md. Do not skip these.

Critical Rules

  • GitHub /issues returns PRs too. The REST endpoint includes pull requests - every PR has a pull_request key. Filter !item.pull_request when counting pure issues, or you'll double-count every PR.
  • Staleness is updated_at, not created_at. updated_at includes comments, label changes, reviews. Using created_at will flag items that were discussed yesterday as stale.
  • Never git push --force to main, never push directly to main on client repos. This skill is read-only by design; if graduated into a script that posts comments, the hard rule still applies to any sibling script that writes.
  • Rate limit: unauthenticated 60/hr, with GITHUB_TOKEN 5000/hr. Triage > 100 repos in a loop will hit the cap - batch or paginate.

Commands

| ui dashboard | state/skills/gh-triage/resources/ui.openui | |invoke: prose skill - for each {owner, repo}: listPrs(owner, repo, "open") + getIssues(owner, repo, "open") in parallel |verify: shape gate - total_open + by_label + stale exist; every stale entry has days_since_update > stale_days; array sorted desc; by_label integers match a re-count |eval log: state/log/evals.ndjson (auto eval - skill: "gh-triage")

OpenUI Resource

  • Skill-owned OpenUI Lang resource: state/skills/gh-triage/resources/ui.openui. Read it before rendering or editing this skill's generated component surface.
  • Treat this resource as a first-class artifact of the skill, not a generic chat response. Improve it when the skill's user-facing output needs to become richer.
  • System resources compose OpenUI primitives and inherit SnappyChat tokens. Use ui_contract: branded in SKILL.md only for deliberate platform or client visuals.

Known Pitfalls

  • Client repos live in different owners (jcameron12/total, snappy-ai/..., etc.). Pass a flat repos list - no implicit org assumption.
  • An item may land in multiple label buckets (it's a view, not a partition) - that's fine, don't deduplicate

Self-Test

An agent reading this should correctly:

  1. [ ] Filter !item.pull_request on /issues results to avoid PR double-count
  2. [ ] Measure staleness against updated_at, not created_at
  3. [ ] Refuse to add a git push --force step even in a graduated script

Self-report

If this loader fell short, append a line:

echo "[$(date -u +%FT%TZ)] gh-triage: <what was missing>" >> state/log/loader-feedback.log

<!-- kernel-ok: historical attribution for the PID-loader pattern. -->

Self-correcting loader (PID feedback)

This is the rule that makes loaders learn. Ported from snappy-kernel, where it demonstrably worked: the snappy-dom-cartographer skill mapped Skool admin UI once, every later ship-agent inherited the full map for free.

Before you finish, do two things:

1. Fix gaps (P - proportional). MANDATORY. If this loader didn't cover your case - if you had to read another file, run an undocumented command, work around a wrong selector, or discover a quirk - you MUST attempt an Edit to this AGENTS.md before you log.

  • Default action: edit this file. Surgical. Add the missing line, table

row, or code example where it belongs. No restructuring.

  • Only LOGGED is allowed when: the fix needs >10 lines, spans multiple

files, or requires a structural rewrite. In that case the state/regen/drain.sh queue picks it up asynchronously.

  • "I didn't have time" / "it's minor" / "the next agent will figure it out"

are NOT valid reasons. Minor gaps compound - that's the whole point of this loop.

  • Concrete example of a valid P-fix: discover agent-browser screenshot

takes path positionally not as --output <path>. One line in a table. Edit it in. Do not just log it.

  • The goal: the next agent never has to leave the loader.

2. Log the result.

echo "[$(date -u +%FT%TZ)] gh-triage: <what was missing or fixed> [FIXED|LOGGED]" >> state/log/loader-feedback.log
  • FIXED = you patched this loader inline (P-fix).
  • LOGGED = too large for inline; the PostToolUse enqueue + Stop-hook drain

will rewrite the loader from scratch on next session-end.

Do not skip this. Every agent run must leave the system better than it found it. The loader is the setpoint; you are the sensor; the gap is the error signal; closing the gap is the correction.

api.ts- the code it can call

⚠ no api.ts - this skill has no typed action surface

scripts- helper scripts it can run

prose-only skill - 2 inline code blocks live in SKILL.md above (no state/bin/ sidecar yet).

how we check it- the checks, plus the last 10 runs

rubric auto no rubric declared
recent mean 1.00 · 10 runs actor/auditor: unverifiable
deps github
timestamp verb score primary_issue artifact
2026-04-25 04:11Z - 1.00 - -
2026-04-21 15:58Z - 1.00 - -
2026-04-21 15:56Z - 1.00 - -
2026-04-21 03:53Z - 1.00 - -
2026-04-16 18:52Z - 1.00 - -
2026-04-16 18:43Z - 1.00 - -
2026-04-16 03:53Z - 1.00 - -
2026-04-25 04:11Z - 1.00 - -
2026-04-21 15:58Z - 1.00 - -
2026-04-21 15:56Z - 1.00 - -