From f9c72c817290bb5433e593b2a8d1cfaa25431d20 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 26 May 2026 01:57:48 -0500 Subject: refactor(workflows): split triage-intake into engine + source plugins The triage-intake workflow had every source baked into one file, so adding or changing a source meant editing the workflow itself. I replaced it with a source-agnostic engine plus per-source plugins named triage-intake..org. The engine carries the anchor/sentinel logic, the four-bucket model, the Phase A-D orchestration, the todo.org persistence convention, and the exit criteria. Each source's scan, classify, render, and action knowledge moved into its own plugin. Four general plugins ship in the template: personal-gmail, personal-calendar, cmail, and github-prs. Project-specific sources live in the project's .ai/project-workflows/ and are never synced. Phase 0 globs both directories so a project source can't silently drop out of the sweep. I taught INDEX.org and the startup workflow-discovery drift check the namespace. A file matching .*.org is a plugin of that engine, not an orphan, and gets no trigger entry of its own. A "run the triage-intake workflow" request routes to the engine, never to a plugin. --- .ai/workflows/triage-intake.github-prs.org | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .ai/workflows/triage-intake.github-prs.org (limited to '.ai/workflows/triage-intake.github-prs.org') diff --git a/.ai/workflows/triage-intake.github-prs.org b/.ai/workflows/triage-intake.github-prs.org new file mode 100644 index 0000000..c1bc796 --- /dev/null +++ b/.ai/workflows/triage-intake.github-prs.org @@ -0,0 +1,71 @@ +#+TITLE: Triage Intake — Personal GitHub PRs Source +#+AUTHOR: Craig Jennings & Claude +#+DATE: 2026-05-26 + +# Source plugin for the triage-intake engine. See triage-intake.org for the +# contract and the Phase A-D orchestration. This file declares ONE source. +# +# This is the GENERAL (github.com) PR source. A work project on GitHub +# Enterprise declares its own triage-intake.-prs.org plugin with +# --hostname and its own repos/conventions; it does not edit this file. + +* Source: github-prs +:PROPERTIES: +:ORDER: 40 +:ENABLED: command -v gh && gh auth status +:ANCHOR: iso8601 +:SUBAGENT_OVER: 40 +:END: + +** Scan + +Open PRs needing Craig's attention across his personal GitHub projects. Two queries — PRs returns *state*, so the anchor is advisory (the engine substitutes == into the optional =--updated= filter for recency; open-PR state is the real signal): + +#+begin_src bash +# PRs Craig opened +gh search prs --author=@me --state=open \ + --json number,title,repository,state,isDraft,updatedAt,url + +# PRs awaiting Craig's review +gh search prs --review-requested=@me --state=open \ + --json number,title,repository,state,isDraft,updatedAt,url +#+end_src + +=@me= resolves to the authenticated personal GitHub account, so no username is hardcoded. Add =--owner = to scope to specific personal projects when the full-account search is too broad. + +=gh search prs= can't return =reviewDecision= or CI status. For the handful that survive Phase B as Action candidates, drill in per-PR: + +#+begin_src bash +gh pr view --repo --json reviewDecision,statusCheckRollup,mergeable +#+end_src + +** Classify + +Action items, in priority order: + +- *Craig's PRs that are mergeable* — approved, or no review required on a solo project, with CI green and no outstanding CHANGES_REQUESTED. +- *Craig's PRs with CHANGES_REQUESTED* — needs his response: rework and re-request, or push back with reasoning. +- *PRs awaiting Craig's review* — review requested from him, or new commits since his last review on a PR he's reviewing. +- *@mentions on any PR* — explicit ask. + +FYI: approval landings with no remaining action, merge events on PRs already shipped, comments without questions. + +Noise: stale draft updates, bot/CI status pings. + +** Render + +#+begin_example +**PRs () — N open.** +- Mergeable now: +- Changes requested on yours: +- Review owed: +#+end_example + +Omit if nothing open needs attention. + +** Actions + +- merge :: =gh pr merge --repo --squash --delete-branch= when no other PR stacks on the branch (verify via =gh pr list --repo --search "base:"=). If something stacks, =--squash= without =--delete-branch= and rebase the dependent PR afterward. +- comment :: =gh pr comment --repo = +- review :: =gh pr review --repo = (per Craig's call — approve / request-changes / comment) +- branch-clean :: =git push origin --delete = when the merge happened earlier and only branch deletion remains. -- cgit v1.2.3