Repo Management
Intro
repo-management gives agents a provider-neutral workflow for routine
repository stewardship: inspect open issues and change requests, plan
safe actions, merge only ready work, commit local changes, and push.
Use it when the user asks to check all open issues or PRs, clean up a
repo, reconcile repository state, merge ready work, commit and push, or
perform repo-maintenance across providers.
Overview
The default workflow is plan-first and guarded:
- Call
detect_repo_provider(project_root, remote) to identify the
remote platform and available local CLI.
- Call
inspect_repo_state(project_root) to inspect branch, dirty
state, upstream, ahead/behind status, remotes, and provider support.
- Call
list_repo_issues() and list_repo_change_requests() for the
current provider when supported.
- Call
plan_repo_reconcile(scope) to build a concrete action plan.
- Apply only actions that pass the safety rules below. Use
run_repo_reconcile(dry_run=false) for guarded batch work, or call
the narrow mutating tools directly.
When the task involves branch policy, review judgment, or release work,
also follow the local git-workflow, code-review, and
release-semver skill guidance.
/pk-repo-reconcile is the user command for the same workflow. Without
extra arguments it means scope=all: local git state, open issues,
open change requests, and push readiness. Users may narrow it with
issues, prs, local, or push.
Provider support
| Provider |
Detection |
Read support |
Mutating support |
| GitHub |
github.com remotes |
gh issue list, gh pr list |
issue comments/close, PR merge, commit, push |
| GitLab |
gitlab.com or REPO_PROVIDER=gitlab |
capability report, local git |
local commit/push only |
| Gitea |
REPO_PROVIDER=gitea |
capability report, local git |
local commit/push only |
| Forgejo / Codeberg |
codeberg.org or REPO_PROVIDER=forgejo |
capability report, local git |
local commit/push only |
| Bitbucket Cloud |
bitbucket.org remotes |
capability report, local git |
local commit/push only |
| Azure DevOps |
dev.azure.com or visualstudio.com remotes |
capability report, local git |
local commit/push only |
| SourceHut |
git.sr.ht remotes |
capability report, local git |
local commit/push only |
Unsupported provider actions must return structured evidence instead
of pretending the work is complete. Agents should still commit and push
local changes through git when the repository policy allows it.
MCP tools
| Tool |
Purpose |
detect_repo_provider(project_root, remote) |
Detect remote host, owner/repo, provider, and local CLI availability. |
inspect_repo_state(project_root, include_remote) |
Inspect branch, dirty state, upstream, ahead/behind, remotes, and provider capabilities. |
list_repo_issues(state, limit) |
List open issues when the provider adapter supports it. |
list_repo_change_requests(state, limit) |
List open PRs/MRs/change requests when supported. |
plan_repo_reconcile(scope, dry_run) |
Produce the action plan and blockers without mutating. |
resolve_repo_issue(id, resolution, comment, close, confirmation) |
Comment and optionally close a supported issue. |
merge_change_request(id, method, auto_queue, confirmation) |
Merge or queue a supported ready change request. |
commit_local_changes(paths, message, checks) |
Run optional checks, stage paths, and commit local changes. |
push_current_branch(remote, branch) |
Push the current branch to its remote. |
run_repo_reconcile(dry_run, max_items, commit_message, push) |
Apply the guarded batch workflow. |
Gotchas
- Do not close issues without evidence. A close action needs a
linked merged change, a duplicate reference, a clear no-repro
disposition, or explicit user instruction.
- Do not merge drafts or WIP change requests. Draft state is a hard
blocker even if checks are green.
- Do not bypass branch protection. Never force-push, override
required reviews, skip required checks, or bypass merge queues.
- Do not assume GitHub-only behavior. Detect the provider first and
return unsupported evidence for adapters that are not configured.
- Do not treat listing as resolving. If issues or change requests
remain open, report the plan or blocker that remains.
- Do not push unrelated local work blindly. Inspect
git status
and commit only the intended paths or the current complete worktree
when the user asked for all local changes.
- Do not run mutating batch actions without a dry-run plan.
run_repo_reconcile(dry_run=false) should report the plan it applied
and every command result.
- Do not hide external auth failures. Missing
gh, glab, tea,
bb, az, or hut authentication is an actionable blocker, not a
successful no-op.
Full reference
Safety policy
The skill is deliberately conservative:
- No force pushes.
- No direct API bypass of provider protection rules.
- No draft/WIP merge.
- No issue close without a comment or explicit resolution evidence.
- Mutating issue and merge tools require exact confirmation tokens:
close-issue:<id> and merge-change-request:<id>.
- Provider-specific actions are serialized by the caller; batch tools
return per-action evidence.
Scope names
plan_repo_reconcile() and /pk-repo-reconcile accept these scopes:
| Scope |
Includes |
all |
local, push, issues, and change requests |
local |
dirty state and commit readiness |
push |
ahead/behind and push readiness |
issues |
open issue listing and resolution candidates |
prs |
open pull requests, merge requests, or provider change requests |
change-requests |
Alias for prs |
Provider notes
GitHub is the first fully mutating adapter because the gh CLI is
common in aibox environments and enforces provider-side checks. GitLab,
Gitea, Forgejo/Codeberg, Bitbucket Cloud, Azure DevOps, and SourceHut
are first-class provider identities in the schema and detection layer;
their remote issue and change-request mutation paths return
unsupported until the matching local CLI or API credential contract is
implemented.
1---2name: repo-management3description: Reconcile repository issues, pull requests, merge requests, local git state, commits, and pushes across GitHub, GitLab, Gitea, Forgejo, Codeberg, Bitbucket, Azure DevOps, and SourceHut.4---56# Repo Management78## Intro910`repo-management` gives agents a provider-neutral workflow for routine11repository stewardship: inspect open issues and change requests, plan12safe actions, merge only ready work, commit local changes, and push.13Use it when the user asks to check all open issues or PRs, clean up a14repo, reconcile repository state, merge ready work, commit and push, or15perform repo-maintenance across providers.1617## Overview1819The default workflow is plan-first and guarded:20211. Call `detect_repo_provider(project_root, remote)` to identify the22 remote platform and available local CLI.232. Call `inspect_repo_state(project_root)` to inspect branch, dirty24 state, upstream, ahead/behind status, remotes, and provider support.253. Call `list_repo_issues()` and `list_repo_change_requests()` for the26 current provider when supported.274. Call `plan_repo_reconcile(scope)` to build a concrete action plan.285. Apply only actions that pass the safety rules below. Use29 `run_repo_reconcile(dry_run=false)` for guarded batch work, or call30 the narrow mutating tools directly.3132When the task involves branch policy, review judgment, or release work,33also follow the local `git-workflow`, `code-review`, and34`release-semver` skill guidance.3536`/pk-repo-reconcile` is the user command for the same workflow. Without37extra arguments it means `scope=all`: local git state, open issues,38open change requests, and push readiness. Users may narrow it with39`issues`, `prs`, `local`, or `push`.4041### Provider support4243| Provider | Detection | Read support | Mutating support |44|---|---|---|---|45| GitHub | `github.com` remotes | `gh issue list`, `gh pr list` | issue comments/close, PR merge, commit, push |46| GitLab | `gitlab.com` or `REPO_PROVIDER=gitlab` | capability report, local git | local commit/push only |47| Gitea | `REPO_PROVIDER=gitea` | capability report, local git | local commit/push only |48| Forgejo / Codeberg | `codeberg.org` or `REPO_PROVIDER=forgejo` | capability report, local git | local commit/push only |49| Bitbucket Cloud | `bitbucket.org` remotes | capability report, local git | local commit/push only |50| Azure DevOps | `dev.azure.com` or `visualstudio.com` remotes | capability report, local git | local commit/push only |51| SourceHut | `git.sr.ht` remotes | capability report, local git | local commit/push only |5253Unsupported provider actions must return structured evidence instead54of pretending the work is complete. Agents should still commit and push55local changes through git when the repository policy allows it.5657### MCP tools5859| Tool | Purpose |60|---|---|61| `detect_repo_provider(project_root, remote)` | Detect remote host, owner/repo, provider, and local CLI availability. |62| `inspect_repo_state(project_root, include_remote)` | Inspect branch, dirty state, upstream, ahead/behind, remotes, and provider capabilities. |63| `list_repo_issues(state, limit)` | List open issues when the provider adapter supports it. |64| `list_repo_change_requests(state, limit)` | List open PRs/MRs/change requests when supported. |65| `plan_repo_reconcile(scope, dry_run)` | Produce the action plan and blockers without mutating. |66| `resolve_repo_issue(id, resolution, comment, close, confirmation)` | Comment and optionally close a supported issue. |67| `merge_change_request(id, method, auto_queue, confirmation)` | Merge or queue a supported ready change request. |68| `commit_local_changes(paths, message, checks)` | Run optional checks, stage paths, and commit local changes. |69| `push_current_branch(remote, branch)` | Push the current branch to its remote. |70| `run_repo_reconcile(dry_run, max_items, commit_message, push)` | Apply the guarded batch workflow. |7172## Gotchas7374- **Do not close issues without evidence.** A close action needs a75 linked merged change, a duplicate reference, a clear no-repro76 disposition, or explicit user instruction.77- **Do not merge drafts or WIP change requests.** Draft state is a hard78 blocker even if checks are green.79- **Do not bypass branch protection.** Never force-push, override80 required reviews, skip required checks, or bypass merge queues.81- **Do not assume GitHub-only behavior.** Detect the provider first and82 return unsupported evidence for adapters that are not configured.83- **Do not treat listing as resolving.** If issues or change requests84 remain open, report the plan or blocker that remains.85- **Do not push unrelated local work blindly.** Inspect `git status`86 and commit only the intended paths or the current complete worktree87 when the user asked for all local changes.88- **Do not run mutating batch actions without a dry-run plan.**89 `run_repo_reconcile(dry_run=false)` should report the plan it applied90 and every command result.91- **Do not hide external auth failures.** Missing `gh`, `glab`, `tea`,92 `bb`, `az`, or `hut` authentication is an actionable blocker, not a93 successful no-op.9495## Full reference9697### Safety policy9899The skill is deliberately conservative:100101- No force pushes.102- No direct API bypass of provider protection rules.103- No draft/WIP merge.104- No issue close without a comment or explicit resolution evidence.105- Mutating issue and merge tools require exact confirmation tokens:106 `close-issue:<id>` and `merge-change-request:<id>`.107- Provider-specific actions are serialized by the caller; batch tools108 return per-action evidence.109110### Scope names111112`plan_repo_reconcile()` and `/pk-repo-reconcile` accept these scopes:113114| Scope | Includes |115|---|---|116| `all` | local, push, issues, and change requests |117| `local` | dirty state and commit readiness |118| `push` | ahead/behind and push readiness |119| `issues` | open issue listing and resolution candidates |120| `prs` | open pull requests, merge requests, or provider change requests |121| `change-requests` | Alias for `prs` |122123### Provider notes124125GitHub is the first fully mutating adapter because the `gh` CLI is126common in aibox environments and enforces provider-side checks. GitLab,127Gitea, Forgejo/Codeberg, Bitbucket Cloud, Azure DevOps, and SourceHut128are first-class provider identities in the schema and detection layer;129their remote issue and change-request mutation paths return130`unsupported` until the matching local CLI or API credential contract is131implemented.