بنقرة واحدة
prj-orchestrator
// PR Jangler cron heartbeat dispatcher. Use when cron invokes one heartbeat of the PR backlog workflow or when the user runs 'prj-orchestrator' for manual debug.
// PR Jangler cron heartbeat dispatcher. Use when cron invokes one heartbeat of the PR backlog workflow or when the user runs 'prj-orchestrator' for manual debug.
PR Jangler hub. Cron-driven autonomous workflow for triaging, verifying, reviewing, fix-planning, adversarially validating, fix-implementing, deciding, and daily-reporting on a GitHub PR backlog. Use when the user mentions "PR jangler", "pr-jangler", "PR backlog workflow", "PR triage", "autonomous PR review", "fix-plan", "fix-PR", "adversarial validator", "PleaseAdvise", or wants to install, configure, or extend the PR Jangler BMad module. Routes to 12 phase skills, owns the cross-cutting state-file conventions, idempotency rules, GitHub-label vocabulary, and 1Password/SMTP/`gh`/`op` dependency map shared by every phase. Triggers on prj-setup, prj-orchestrator, prj-discover, prj-triage, prj-verify-claim, prj-review, prj-detect-overlap, prj-plan-fix, prj-validate-adversarial, prj-implement-fix, prj-decision, prj-report-daily.
PR Jangler final-call workflow. Use when the orchestrator dispatches the decision phase for a reviewed PR or when the user runs 'prj-decision' to label, comment, and log a ready-to-merge / request-changes / close-as-not-now verdict.
PR Jangler duplicate and overlap detector. Use when the orchestrator dispatches the overlap check after triage marked a PR as possible-duplicate, or when the user runs 'prj-detect-overlap' for manual debug.
PR Jangler GitHub-to-queue sync. Use when the orchestrator dispatches the discovery sweep (on cadence or empty queue) or when the user runs 'prj-discover' for manual debug.
PR Jangler Tier-2 implementer. Use when prj-validate-adversarial passed for a PR and the orchestrator dispatches FixImpl. Pushes a fix branch and opens a fix-PR into the contributor's branch; falls back to a comment if the contributor's branch refuses PRs.
PR Jangler fix-planning workflow. Use when a Trello-like comment claim on a PR has been verified by prj-verify-claim and a fix plus failing-test plan must be designed before any implementation. Activated by prj-orchestrator when a PR's phase is FixPlan.
| name | prj-orchestrator |
| description | PR Jangler cron heartbeat dispatcher. Use when cron invokes one heartbeat of the PR backlog workflow or when the user runs 'prj-orchestrator' for manual debug. |
This skill is the cron heartbeat for the PR Jangler module. Each invocation executes exactly one state transition: load the persistent queue at _bmad-output/pr-workflow/state.json, pick the highest-priority next action, dispatch to the target phase skill, persist state, append a structured run-log entry, exit. Idempotent with atomic state writes. System actions (discovery on cadence, daily report at the configured hour) outrank per-PR actions.
Act as a reliability-minded ops engineer. Treat the queue as authoritative state, the run-log as the audit trail, and "never silently fail" as the prime directive.
scripts/run.py) resolve from the skill root.{project-root}/... resolves from the project working directory.[modules.prj] in {project-root}/_bmad/config.toml.Load configuration from {project-root}/_bmad/config.toml (the [modules.prj] block). Required key: prj_repo. If absent, exit early with a clear "configure prj_repo first" message and a run-log entry tagged misconfigured. Defaults for optional keys are applied by the scripts themselves.
Execute the heartbeat:
python3 scripts/run.py
That single script orchestrates everything: state initialization on first run, action selection, dispatch (with v1 stub fallback for not-yet-built phase skills), atomic state persistence, and run-log append. Flags:
--dry-run compute next action, log the intent, do not dispatch--verbose emit diagnostics to stderr--once no-op flag for cron clarity (always single-shot)--project-root <path> override autodetectSee python3 scripts/run.py --help for full detail.
The orchestrator is intentionally thin. All deterministic work lives in Python scripts. The LLM activation context exists so the Skill tool can dispatch to phase skills once they are installed; in v1 stub mode, the dispatch path falls back to bmad run subprocess invocations or logs a stub: not built entry when the target skill is missing.
| Concern | Lives in |
|---|---|
| State I/O (atomic load, validate, save, init) | scripts/state_io.py |
| Priority computation and next-action selection | scripts/select_next_action.py |
| Dispatch and run-log append | scripts/run.py |
| State schema (reference) | assets/state-schema.json |
| Initial empty state template | assets/state-empty.json |
Owned by this skill. All other phase skills MUST go through scripts/state_io.py to read or write state to preserve atomicity.
{project-root}/_bmad-output/pr-workflow/state.json{project-root}/_bmad-output/pr-workflow/prs/{pr_number}/{project-root}/_bmad-output/pr-workflow/logs/{YYYY-MM-DD}.jsonl{project-root}/_bmad-output/pr-workflow/reports/{YYYY-MM-DD}.mdSystem actions outrank per-PR actions.
prj_report_hour_local AND no report sent today.heartbeat_count % prj_discover_every_n == 0.Per-PR actions, in descending priority:
next_action set by the previous phase skill. Base 100, with bumps:
new_comments_since_triage > 0: +50needs_retriage == true: +30phase_entered_at, capped at 30.Terminal phases (ReadyToMerge, Blocked, Rejected, Archived) carry no next_action and are skipped. If no action qualifies, the heartbeat is a no-op: log idle, exit cleanly.
The other 10 phase skills (prj-discover, prj-triage, prj-verify-claim, prj-review, prj-detect-overlap, prj-plan-fix, prj-implement-fix, prj-validate-adversarial, prj-decision, prj-report-daily) do not exist yet. When the orchestrator dispatches to a target skill whose SKILL.md is not present at {project-root}/skills/{skill-name}/, it:
status: "stub: not built" in the run-log entryThis lets the orchestrator be exercised end-to-end before any other skill lands.
After install, smoke-test with:
python3 scripts/run.py --dry-run --verbose
Expected on a fresh project (no state, prj_repo configured): exit 0, run-log entry showing action: dispatch, skill: prj-discover, status: dry-run. On a project missing prj_repo: exit 2, run-log entry status: misconfigured.
Run unit tests:
python3 -m unittest discover scripts/tests