Worktree PR Monitor
SkillMonitoring & opsCreate or continue an isolated Matrix OS worktree PR, validate it, push it, monitor CI and GitHub review feedback, iterate until the latest trusted Greptile result is 5/5, then add ready-for-ci and wait for triggered CI to pass before pinging completion. Use when asked to run a worktree to PR to monitor workflow, get a PR to Greptile 5/5 plus CI pass, or publish changes while keeping main clean.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Worktree PR Monitor skill
What this skill tells your AI
The instructions your AI receives, as published by hamedmp/matrix-os in .agents/skills/worktree-pr-monitor/SKILL.md and read by ahel’s review.
Use this skill only when the requester explicitly asks for the manual git
worktree -> PR -> monitor workflow. It keeps /home/deploy/matrix-os on main
while implementation happens in /home/deploy/matrix-os.worktrees/<slug>.
This skill does not coordinate Swarm or multi-agent runs. The repo-level Swarm
ban on isolation: "worktree" still applies; this workflow is a user-requested
manual git worktree flow for isolated PR publication.
Preconditions
ghis installed and authenticated.- The current repository is
HamedMP/matrix-os. - The repository has a label exactly named
ready-for-ci; if it is missing, stop and report the blocker instead of creating the label silently. - The requester wants a PR in a worktree, not only a local patch.
- The requester explicitly asked for a worktree or invoked this workflow.
Rules
- If the requester did not explicitly ask for a worktree, follow the current branch workflow instead.
- Keep
/home/deploy/matrix-osonmain. - Put feature work in
/home/deploy/matrix-os.worktrees/<slug>. - Use a semantic branch and PR title. Do not prefix titles with agent/tool tags.
- Stage only files in scope.
- Do not merge unless explicitly asked.
- If Greptile has reviewed the PR, the loop is complete only when the latest
trusted Greptile result is
5/5. - Add the
ready-for-cilabel only after the latest trusted Greptile result is5/5; this label triggers the broader PR CI workflows. - If the repository label
ready-for-ciis missing, report the blocker instead of creating the label or treating the PR as CI-ready. - If label-triggered CI fails, remove
ready-for-ci, fix the failures, commit and push, then return to the Greptile fulfillment loop before re-adding the label. - Treat unresolved human review threads, Codex review issue comments, and Greptile findings as blockers until they are fixed, acknowledged, or explicitly deferred by the requester.
Workflow
-
Establish scope.
- Inspect
git status --short --branch. - If main contains relevant uncommitted work, move only that work into the target worktree via a scoped stash or patch.
- If unrelated changes are present, leave them alone and ask only if they block the requested PR.
- Inspect
-
Create or enter the worktree.
- Slug: concise task slug, e.g.
fix-canvas-terminal-clicks. - Branch:
codex/<slug>unless the requester named a branch. - Path:
/home/deploy/matrix-os.worktrees/<slug>. - Command shape:
git worktree add -b codex/<slug> /home/deploy/matrix-os.worktrees/<slug> origin/main
- Slug: concise task slug, e.g.
-
Implement.
- Follow TDD where practical: add a failing focused regression before the fix, then make it green.
- Keep edits scoped and compatible with Matrix OS conventions.
-
Validate.
- Run the narrow changed-area tests.
- Run broader Matrix gates when feasible:
bun run typecheckbun run check:patternsbun run test
- Record any skipped broad check with the exact reason.
-
Commit and push.
- Commit with a Conventional Commit message.
- Push with
git push -u origin HEAD.
-
Open or update the PR.
- Use
gh pr viewto detect an existing PR for the branch. - Create or edit the PR with a semantic title.
- PR body must include:
SummaryTestsReview/MonitoringInvariantswhen backend code changed
- Use
-
Monitor review feedback until Greptile is complete.
- Use
gh pr checks --watchor equivalent GitHub API status reads for already-running checks. - Use thread-aware review inspection for unresolved GitHub review threads.
- Inspect issue comments for Codex reviews.
- Inspect Greptile feedback and rating. If the latest trusted Greptile
result is below
5/5, implement fixes, rerun relevant checks, commit, push, and continue monitoring.
- Use
-
Trigger and monitor label-gated CI.
- Before labeling, verify that the repository label exists:
gh label list --search ready-for-ci --json name. If the exactready-for-cilabel is missing, stop and report the blocker. - Once the latest trusted Greptile result is
5/5, add theready-for-cilabel withgh pr edit --add-label ready-for-ci. - Wait for the triggered checks with
gh pr checks --watchor equivalent GitHub API status reads. - If every required triggered check passes, the PR is ready.
- If any triggered check fails, remove the
ready-for-cilabel withgh pr edit --remove-label ready-for-ci, inspect the failure, implement the fix, rerun relevant local checks, commit, push, and return to step 7. Do not re-addready-for-ciuntil Greptile is again5/5on the latest commit.
- Before labeling, verify that the repository label exists:
-
Ping completion.
- Reply with:
- PR URL
- branch and worktree path
- latest commit SHA
- checks run and result
- latest Greptile status, explicitly
5/5 ready-for-cistatus and triggered CI result- skipped checks or residual risk
- If blocked, reply with the exact blocker and the next action needed.
- Reply with:
Useful Commands
git status --short --branch
git worktree list
git worktree add -b codex/<slug> /home/deploy/matrix-os.worktrees/<slug> origin/main
bun run typecheck
bun run check:patterns
bun run test
git push -u origin HEAD
gh pr view --json number,url,title,state,headRefName,baseRefName
gh label list --search ready-for-ci --json name
gh pr edit --add-label ready-for-ci
gh pr edit --remove-label ready-for-ci
gh pr checks --watch
Signals
- GitHub stars
- 64
- Forks
- 20
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
worktree-pr-monitor- Source
- github.com/hamedmp/matrix-os