You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directive currently uses gh CLI commands directly in skills and tasks — GitHub-specific, agent-hostile (pager issues, noisy output, poor polling), and not abstracted for other platforms. Establish a scm:* task namespace that encodes agent best practices once and supports platform swapping via conditional includes.
Current problems
1. GitHub lock-in
Skills (deft-review-cycle, deft-swarm) and task operations call gh directly. Companies on GitLab, Linear, or Azure DevOps cannot use these skills without forking. As the practices/processes split (#878) positions directive as general-purpose, this coupling increasingly undercuts that goal.
2. Pager issues gh pr view, gh issue view, and similar commands open a pager by default. Agents see truncated output or hang. This must be suppressed (e.g. GH_PAGER=cat) on every call. Currently this is done inconsistently or not at all.
3. Noisy output
Human-readable gh output (table headers, color codes, status icons, separators) is not agent-consumable. Agents fail to parse it or waste tokens processing decoration.
4. Suboptimal polling
Directive skills use sleep 30; gh pr view style polling. This is the worst-case pattern. Better options exist:
gh pr checks --watch — built-in watching for CI checks (Level 1)
ETag-based conditional API requests — only fetches when data changes (Level 2, shown in deftai/bridge PR#53 pr:reviews task)
Webhook callbacks — GitHub pushes to agent (Level 3, future)
5. Not using JSON output gh supports --json field1,field2 for most commands, eliminating noise, pager triggers, and token waste. Agent-facing calls should always use this.
Proposed: scm:* task namespace
Establish a scm: namespace in directive's Taskfile that:
Encodes agent best practices once — every scm:* task uses GH_PAGER=cat, --json output, ETag polling where applicable, and ghx (brunoborges/ghx) as the caching proxy
Provides a clean interface — calling agent does task scm:pr:view PR=42 and gets structured JSON with no paging, no noise
Enables platform swapping — via go-task conditional includes (or wrapper scripts pending upstream support), swap tasks/scm-github.yml for tasks/scm-gitlab.yml based on SCM_PLATFORM env var
Proposed command set (v1)
Task
Purpose
scm:issue:list
List open issues
scm:issue:view
Read a single issue (JSON)
scm:issue:create
Create an issue
scm:issue:close
Close with comment
scm:pr:list
List open PRs
scm:pr:view
Read a PR (JSON)
scm:pr:create
Open a PR
scm:pr:checks
Get CI check status
scm:pr:reviews
Poll for review comments (ETag-based, Level 2)
scm:pr:watch
Watch PR checks until complete
scm:pr:merge
Merge/squash a PR
Task design rules for scm:*
! All tasks MUST use --json output or emit a JSON envelope
! All tasks MUST suppress pager (GH_PAGER=cat or equivalent)
! Polling tasks MUST use at minimum Level 1 (--watch) or Level 2 (ETag) patterns -- never sleep N; gh ...
~ Tasks SHOULD use ghx instead of gh when available for caching/singleflight
Reference implementation
deftai/bridge PR#53 (task pr:watch, task pr:view, task pr:reviews) demonstrates the patterns this namespace should standardize. The ETag-based pr:reviews task is the reference for Level 2 polling.
Migration
deft-review-cycle currently polls at Level 0 -- should be upgraded to use task scm:pr:reviews
deft-swarm PR monitoring similarly should be upgraded
Existing direct gh calls in skills can be migrated incrementally
Summary
Directive currently uses
ghCLI commands directly in skills and tasks — GitHub-specific, agent-hostile (pager issues, noisy output, poor polling), and not abstracted for other platforms. Establish ascm:*task namespace that encodes agent best practices once and supports platform swapping via conditional includes.Current problems
1. GitHub lock-in
Skills (deft-review-cycle, deft-swarm) and task operations call
ghdirectly. Companies on GitLab, Linear, or Azure DevOps cannot use these skills without forking. As the practices/processes split (#878) positions directive as general-purpose, this coupling increasingly undercuts that goal.2. Pager issues
gh pr view,gh issue view, and similar commands open a pager by default. Agents see truncated output or hang. This must be suppressed (e.g.GH_PAGER=cat) on every call. Currently this is done inconsistently or not at all.3. Noisy output
Human-readable
ghoutput (table headers, color codes, status icons, separators) is not agent-consumable. Agents fail to parse it or waste tokens processing decoration.4. Suboptimal polling
Directive skills use
sleep 30; gh pr viewstyle polling. This is the worst-case pattern. Better options exist:gh pr checks --watch— built-in watching for CI checks (Level 1)pr:reviewstask)5. Not using JSON output
ghsupports--json field1,field2for most commands, eliminating noise, pager triggers, and token waste. Agent-facing calls should always use this.Proposed:
scm:*task namespaceEstablish a
scm:namespace in directive's Taskfile that:scm:*task usesGH_PAGER=cat,--jsonoutput, ETag polling where applicable, and ghx (brunoborges/ghx) as the caching proxytask scm:pr:view PR=42and gets structured JSON with no paging, no noisetasks/scm-github.ymlfortasks/scm-gitlab.ymlbased onSCM_PLATFORMenv varProposed command set (v1)
scm:issue:listscm:issue:viewscm:issue:createscm:issue:closescm:pr:listscm:pr:viewscm:pr:createscm:pr:checksscm:pr:reviewsscm:pr:watchscm:pr:mergeTask design rules for
scm:*--jsonoutput or emit a JSON envelopeGH_PAGER=cator equivalent)--watch) or Level 2 (ETag) patterns -- neversleep N; gh ...audience: agentwhen go-task supports it (chore(vbrief): complete #845 triage v1 lifecycle housekeeping #880)Reference implementation
deftai/bridge PR#53 (
task pr:watch,task pr:view,task pr:reviews) demonstrates the patterns this namespace should standardize. The ETag-basedpr:reviewstask is the reference for Level 2 polling.Migration
task scm:pr:reviewsghcalls in skills can be migrated incrementallyRelated