AGENT SKILL

direct

暂无简介

License 许可
MIT
最近更新
2026-11-14
Stars
★ 0
Forks
0

02 资源文件 8

03 SKILL.md 正文

Direct Repository Access

Agent tool: open_simple_repo_pr (ungated — no ticket required)

Lightweight direct-PR path for simple, low-risk changes. Creates a branch, commits the given files, and opens a reviewable pull request in one call — without requiring a mill ticket in BLOCKED state. The opened PR is the review gate: a human approves and merges it, so this path stays safe and reversible. Use this so an operator does NOT have to file a ticket just to get a trivial change reviewed.

Eligible task classes (use this tool):

  • Content / text edits — e.g. adding a project card to the robotsix-website PHP site, fixing copy.
  • Small documentation changes — README/docs wording, a new doc page.
  • Single-file or few-file tweaks with no behavioural risk.

NOT eligible — route through the ticket-gated flow instead:

  • Larger or complex work needing multi-step design, broad refactors, or careful review — file a mill ticket and use push_direct_repo_branch + open_direct_repo_pr (gated on BLOCKED state).
  • CI workflow / composite-action files (.github/workflows/, .github/actions/) — refused by the tool (they can alter CI behaviour and exfiltrate secrets).
  • Credential/secret-shaped files (private keys *.pem/*.key/*.pfx/*.p12, .env files, SSH keys) — refused by the tool.
  • Destructive changes, force-merge, or any merge operation — merges remain confirmation-gated (merge_direct_repo_pr) and require explicit operator approval in-chat.

Preconditions

  • direct_repo.enabled must be true.
  • Repository must be within the GitHub App installation scope (checked at call time; bypassed when the change is orchestrated through the component roster).
  • Every files_json entry must be one of the accepted forms ({path, content}, {path, content_b64}, {path, local_path}) and must pass the risky-file guard above.

Arguments

  • repo_full_name — GitHub owner/name (e.g. robotsix/robotsix-website).
  • branch_name — name for the new branch (e.g. chore/add-thalamus-card).
  • files_json — JSON array of file entries to create or overwrite.
  • title — PR title; use a conventional-commit subject (feat:/fix:/docs:/chore: …).
  • body — optional PR description (defaults to a note about the lightweight path).
  • commit_message — optional; defaults to title.

Error responses

Condition Message
Malformed files_json Error: files_json must be a valid JSON array of file entries …
Workflow/action file in the diff Refused: '<path>' is a CI workflow/action file …
Secret/credential file Refused: '<path>' looks like a credential/secret file …
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'

Agent tool: update_simple_repo_pr (ungated — no ticket required)

Lightweight companion to open_simple_repo_pr for adding a commit to an already-open PR. Commits a multi-file changeset to an EXISTING open pull request's head branch in one call, updating the PR in place (no close/reopen) — without requiring a mill ticket in BLOCKED state. The open PR is itself the review gate. Use this to iterate on a PR you opened via open_simple_repo_pr, including a directory/module rename expressed as (delete old paths + create new paths) in a single commit. Merging stays confirmation-gated via merge_direct_repo_pr.

The changeset supports create, overwrite, AND delete in one commit. Reuse the open_simple_repo_pr content forms and add a delete form:

  • {"path": "...", "content": "..."} — text.
  • {"path": "...", "content_b64": "..."} — base64 bytes (binary files).
  • {"path": "...", "local_path": "..."} — a file inside the file-hub work directory.
  • {"path": "...", "delete": true} — remove the path from the tree.

NOT eligible — refused by the tool (guard applies to added AND deleted paths):

  • CI workflow / composite-action files (.github/workflows/, .github/actions/).
  • Credential/secret-shaped files (private keys *.pem/*.key/*.pfx/*.p12, .env files, SSH keys).

Preconditions

  • direct_repo.enabled must be true.
  • Repository must be within the GitHub App installation scope (checked at call time; bypassed when the change is orchestrated through the component roster).
  • An OPEN PR must exist, identified by either pr_number or branch_name.
  • Every files_json entry must be one of the accepted forms above and must pass the risky-file guard.

Arguments

  • repo_full_name — GitHub owner/name (e.g. robotsix/robotsix-website).
  • files_json — JSON array of changeset entries (create/overwrite/delete).
  • pr_number — the open PR number to update. Provide EITHER this or branch_name.
  • branch_name — the head branch name of an open PR to update. Provide EITHER this or pr_number.
  • commit_message — optional; defaults to a message naming the target branch.

Error responses

Condition Message
Malformed files_json Error: files_json must be a valid JSON array of changeset entries …
Neither PR reference given Error: provide either 'pr_number' or 'branch_name' of an open PR …
Workflow/action file in the diff Refused: '<path>' is a CI workflow/action file …
Secret/credential file Refused: '<path>' looks like a credential/secret file …
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
PR number unknown / closed Error: PR #<n> in owner/name is <state>, not open …
Branch has no open PR Error: no open PR found with head branch '<branch>' in owner/name.

Agent tool: verify_pr_ci_status

Fetch live CI run status and PR state from GitHub — PR metadata (state, mergeability, draft status) plus an authoritative CI verdict computed over EVERY check-run of the PR's head commit, followed by the workflow runs as detail. The agent MUST call this tool before asserting success or signalling the operator about CI/PR status; never rely on cached, inferred, or incomplete data.

A PR is CI-green only when the CI verdict for head <sha>: line says GREEN. RED names the failed check-runs, PENDING the ones still running, NONE means no check-runs exist yet and UNKNOWN means the Checks API could not be read — none of those is green. The workflow-run list below the verdict is detail only: it is paginated by recency and can omit the workflow that carries the failing job (2026-10-25: chat #2208 was merged on "all 5 runs success" while its Tests check-run had been FAILED for hours).

Read-only. Does not modify any repository state and does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • The PR must exist and be accessible via the GitHub API.

Returned information

  • PR title, URL, state (open/closed/merged), draft flag, merged flag, mergeable state.
  • CI verdict for head <sha>: GREEN|RED|PENDING|NONE|UNKNOWN — … with counts and the failed / pending check-run names; a Merge gate: line when GitHub reports mergeable_state blocked, unstable, dirty or behind.
  • Workflow runs on the PR's head branch (up to 20; detail only), each with name, run id, status, and conclusion.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
PR not found / API error Error fetching PR #... in owner/name: <detail>
GitHub Actions unreachable CI status: could not fetch workflow runs — <detail>

Agent tool: inspect_pr_diff

Fetch the raw unified diff of an open pull request — every file changed, every line added or removed — as plain text. Use this BEFORE merging a PR to verify that the diff actually delivers what the ticket requires (e.g. whether a CI migration PR actually adopts shared workflows vs. reverting to inline jobs). The diff is returned as a unified diff; inspect it for the patterns the ticket's acceptance criteria require.

Read-only. Does not modify any repository state and does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • The PR must exist and be accessible via the GitHub API.

Returned information

  • The raw unified diff of the PR as a string, prefixed with a line count.
  • Diffs larger than 8000 characters are truncated with a note indicating how many more chars/lines remain — review the full diff at the PR URL when truncated.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
PR not found / API error Error fetching diff for PR #... in owner/name: <detail>

Agent tool: check_ci_health

Check recent CI history for a repository branch and classify failures. Lists the most recent workflow runs on the branch (default: the repository's default branch) and compares the latest run against the most recent green run, so the agent can verify whether a CI failure is pre-existing on the base branch rather than caused by a dependent PR.

Read-only. Does not modify any repository state and does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.

Returned information

  • Up to 20 recent workflow runs on the branch, each with name, run id, status, and conclusion.
  • A verdict classifying the latest failure as pre-existing (an earlier run was green), green, or inconclusive, plus a recommendation to rerun or escalate.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
GitHub Actions unreachable Error checking CI health for owner/name: <detail>

Agent tool: rerun_ci_workflow

Re-run a failed CI workflow run. Without a run_id, re-runs the most recent failed run on the given branch (default: the repository's default branch).

This is a confirmation-gated mutation. Re-run only after the operator has explicitly consented in the conversation. The operator's own direct request or a clear affirmative answer to your proposal IS that consent — once given, state the exact repo, branch, and run id and re-run without re-asking. Ask only when consent has not yet been clearly given. The endpoint triggers a new CI run (consuming Actions minutes); it does not modify repository source.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • A completed (failed) workflow run must exist on the target branch when run_id is omitted.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
No failed run found No failed workflow run found on '<branch>' in owner/name — nothing to re-run.
GitHub Actions unreachable Error listing workflow runs for owner/name: <detail>
GitHub Actions error Error rerunning workflow run <id>: <detail>

Agent tool: fetch_ci_job_logs

Fetch and parse job logs from a CI workflow run — extracts the exact log output from failing CI jobs (e.g., Trivy vulnerability scan results, test failures, build errors). Use this when check_ci_health shows a failure and you need the specific details from the failing step to propose a fix (upgrade a vulnerable package, fix a test assertion, etc.). When no run_id is provided, fetches logs from the most recent failed run on the branch.

Read-only. Does not modify any repository state and does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • The run (or branch) must have at least one job with accessible logs.

Returned information

  • Run metadata: name, branch, status, and conclusion.
  • One ### Job: section per matching job, each containing the raw log text (truncated to max_log_bytes total across all jobs).
  • When job_name is supplied, only jobs whose name contains that substring (case-insensitive) are included; otherwise all jobs appear.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
Run not found Error: workflow run <id> not found in owner/name.
No runs on branch No recent workflow runs found on '<branch>' in owner/name.
Specific job not found No job named '<job_name>' found in run <id>.

Agent tool: fetch_trivy_findings

Fetch and parse Trivy vulnerability scan results from a CI workflow run — extracts CVE identifiers, affected packages, severity levels, and fixed versions from the table-formatted output produced by aquasecurity/trivy-action. Use this when a ticket documents a Trivy scan failure and you need the exact vulnerability details to propose remediation (upgrade package X to version Y) or justify a scanner-ignore rule, instead of repeatedly providing only the job title and run ID.

Read-only. Does not modify any repository state and does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • The run (or branch) must have at least one job producing Trivy table-format output.

Returned information

  • Run metadata: name, branch, and link to the workflow run.
  • Parsed vulnerability summary: total count with CRITICAL / HIGH / MEDIUM / LOW breakdown.
  • Per-finding detail table: CVE ID, affected package/library, severity, installed version, and fixed version (when available).
  • When no Trivy table is detected, a raw log excerpt for manual review.

Invocation

When run_id is omitted, uses the most recent failed run on branch (default: repository default branch). Provide a specific run_id when the ticket references one.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
No runs on branch No recent workflow runs found on '<branch>' in owner/name.
Run not found Error: workflow run <id> not found in owner/name.
No Trivy job found Diagnostic with raw log excerpt for manual review.

Agent tool: file_ci_stabilization_ticket

File a dedicated CI-stabilization ticket on the board, flagging the repository/branch to a human operator for remediation. Use this when a dependent PR cannot merge due to pre-existing CI failures and a simple re-run is not appropriate or did not resolve the problem.

Mutation. Creates a board ticket — no confirmation gating required (it is a normal escalation action, not a repository-state change). Does not require a ticket to be in BLOCKED state.

Preconditions

  • Repository must be within the GitHub App installation scope.

Returned information

  • The created ticket id and title, e.g. Filed CI stabilization ticket <id>: CI stabilization needed: owner/name (main).

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
Board API failure Error filing CI stabilization ticket for owner/name: <detail>

Agent tool: list_open_prs

List pull requests for one repository or for the whole GitHub account in a single batched GitHub Search API query (/search/issues?q=type:pr …). Despite the name it lists merged and closed PRs too: state defaults to all with a since_days window (default 30), so a PR that was merged does not vanish into "No open PRs". Use this before iterating repository-by-repository with per-repo PR lookups.

Repository identity. repo accepts a mill repo_id (e.g. robotsix-central-deploy, resolved through the mill registry — see resolve_repo) or a full owner/repo. With repo empty the search spans the account the GitHub App is installed on (owner, defaulting to the installation's own account). Never pass a guessed organisation name — the fleet's code lives under a personal GitHub account, not an org named after it.

Read-only. Does not modify any repository state and does not require a ticket to be in blocked state. Results are limited to the repositories the robotsix-mill GitHub App is installed on.

Parameters

  • repo — mill repo_id or owner/repo; empty for account-wide.
  • repo_full_name — alias of repo (owner/repo), the same argument name every other GitHub tool takes; pass one or the other (both with different values is an error).
  • owner — account to search when repo is empty (default: the installation's account).
  • state — open, closed or all (default).
  • since_days — only PRs updated within this many days (default 30, 0 disables; ignored for open).

Returned information

  • Total count of PRs, grouped by repository.
  • Per PR: number, title, URL, author, state (open / merged / closed) and draft status.
  • A truncation note when GitHub's 1000-result search cap is reached.

Error responses

Condition Message
Unknown repo id Error: '<repo>' is neither a registered mill repo_id nor an 'owner/repo' full name. …
Search API error Error listing PRs for <scope>: <detail>
No matching PRs No <state> PRs found for <scope> … (in repositories the GitHub App can access).

Agent tool: merge_direct_repo_pr

Merge a pull request in a repository under the GitHub App installation scope. The merge is performed using the GitHub App installation token — the credential never leaves the server.

This is a confirmation-gated mutation. Merge only when the operator has explicitly consented in the conversation. The operator's own direct request (e.g. "merge PR #123") or a clear affirmative answer to your proposal IS that consent — once given, state the exact repo, PR number, PR title, and head/base branches and merge without re-asking. Ask only when consent has not yet been clearly given. The endpoint modifies live repository state.

CI gate (enforced by the tool itself)

The GitHub App this tool merges with can bypass branch rules, so GitHub will not stop a red PR. The tool therefore reads every check-run of the PR's head commit and refuses to merge unless all of them completed without failure; the refusal names the failed / pending checks. Wait for them or fix them. Only when the operator has explicitly instructed to merge DESPITE the stated verdict, call again with override_ci=true and say so in the conversation — the override and the bypassed verdict are echoed into the result.

Preconditions (also enforced server-side)

  • PR must be mergeable (no conflicts).
  • PR must not be in draft state.
  • Repository must be within the GitHub App installation scope.

Pre-merge diligence (agent responsibility)

Before proposing a merge or listing a PR as merge-ready, the agent MUST:

  • Inspect the PR title and description for any of: revert, Revert, REVERT, rollback, Rollback, roll back. If the PR title or description contains one of these keywords, flag it for operator review rather than listing it as a routine merge candidate.

  • Check recent commit messages on the PR branch — at minimum the most recent commit. A PR whose head commit message contains revert (or whose title is a GitHub-generated revert title like Revert "...") likely undoes a prior change rather than introducing the goal stated in its ticket. Flag it instead of auto-listing it.

  • When the PR diff is available (e.g. from inspect_pr_diff, verify_pr_ci_status, or a prior tool call), check whether the net diff reverses or removes the work the ticket was supposed to deliver. A PR that mostly deletes or reverts prior changes may be a rollback, not a completion — the operator should decide whether to merge it.

A revert PR may still be intentional and correct (e.g. rolling back a problematic deploy), but its purpose is the OPPOSITE of the ticket's stated goal — the operator must make the call, not the agent. Never bundle a revert PR with a batch of routine merge candidates.

Merge methods

Method Behaviour
squash Squash all commits into one (default).
merge Create a merge commit preserving the branch history.
rebase Rebase the branch commits onto the base branch (no merge commit).

Error responses

Condition Message
PR is a draft the PR is still in draft state
Merge conflicts merge conflicts detected
Mergeability still being computed mergeability is still being computed by GitHub
CI checks failing/pending the PR is not in a mergeable state (HTTP 405)
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'

| Repo not in installation scope | The robotsix-mill GitHub App is not installed on 'owner/name' |


Agent tool: close_direct_repo_pr

Close a pull request without merging it. The close is performed using the GitHub App installation token — the credential never leaves the server.

This is a confirmation-gated mutation. Before calling, state the exact repo, PR number, PR title, and head/base branches in-chat and obtain explicit operator approval. Never close a PR without the operator's explicit consent in the conversation — the endpoint modifies live repository state.

Closing a PR preserves the branch — it can be re-opened or a new PR created from it later. This is the appropriate tool for cleaning up abandoned or superseded PRs where merging is not desired.

Preconditions (enforced server-side)

  • PR must be open (not already closed or merged).
  • Repository must be within the GitHub App installation scope.

Error responses

Condition Message
PR already closed (merged) is already closed (merged)
PR already closed (unmerged) is already closed (unmerged)
PR not found Error fetching PR #N in owner/name (HTTP 404)
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'

Agent tool: check_direct_repo_auto_merge

Check whether a repository has auto-merge enabled at the repository level. Reads the allow_auto_merge setting from the GitHub repository metadata.

Read-only. This tool does not modify any state and does not require confirmation gating. Use it proactively before filing or managing tickets that require automatic merging — if auto-merge is disabled the operator should be informed that manual merging will be required and the workflow should be adjusted (e.g., skip waiting_auto_merge or set expectations early).

Preconditions

  • Repository must be within the GitHub App installation scope.

Response

Result Message
Auto-merge on Auto-merge is **enabled** on owner/name. PRs ... will be merged ...
Auto-merge off Auto-merge is **disabled** on owner/name. ... all merges must be manual
Repo not in scope The robotsix-mill GitHub App is not installed on 'owner/name'

Agent tool: arm_direct_repo_auto_merge

Enable GitHub native auto-merge on a pull request. Once armed, GitHub automatically merges the PR as soon as all required conditions are met (status checks pass, required reviews are submitted, branch protection rules are satisfied) — no further human intervention is needed.

This is a confirmation-gated mutation. Enable only when the operator has explicitly consented in the conversation. The operator's own direct request (e.g. "enable auto-merge on PR #123") or a clear affirmative answer to your proposal IS that consent — once given, state the exact repo, PR number, PR title, and head/base branches and enable it without re-asking. Ask only when consent has not yet been clearly given.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • PR must not be in draft state.
  • PR must not already be merged.
  • Repository must have auto-merge enabled (some repos disable it).

Merge methods (applied when auto-merge fires)

Method Behaviour
squash Squash all commits into one (default).
merge Create a merge commit preserving the branch history.
rebase Rebase the branch commits onto the base branch (no merge commit).

Error responses

Condition Message
PR is a draft the PR is still in draft state
Auto-merge not available on repo the repository may not have auto-merge enabled (HTTP 403/404) — use check_direct_repo_auto_merge first to detect this proactively
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'

Agent tool: enable_repo_pages

Enable GitHub Pages built from a GitHub Actions workflow on a repository. Calls POST /repos/{owner}/{repo}/pages with build_type: workflow using the GitHub App installation token, then reads the site back so the result reports its current status.

This is a confirmation-gated mutation. Enabling Pages changes live repository settings — the same class of mutation as set_repo_security_and_analysis. Only enable when the operator has explicitly consented in the conversation. The operator's own direct request (e.g. "enable GitHub Pages on robotsix-chat") or a clear affirmative answer to your proposal IS that consent — once given, state the exact repository and enable it without re-asking. Ask only when consent has not yet been clearly given.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • The GitHub App installation must hold the pages: write permission.

Behaviour

  • Fresh enable — creates the Pages site with build_type: workflow and reports the resulting site status (built, building, etc.), build type, and site URL.
  • Already enabled — a 409 (Pages already exists) is treated as success. When the existing build type differs from the requested one, the build type is switched via PUT; otherwise the existing site status is reported without error.
  • Permission denied — a 403 is reported as a permission error pointing at inspect_github_installation_token, never as a crash.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
Missing pages: write (403) Error enabling GitHub Pages on owner/name: permission denied — ...
Invalid build type Error: build_type must be 'workflow' or 'legacy', got ...
Other API failure Error enabling GitHub Pages on owner/name: <detail>

Agent tools: get_repo_settings / set_repo_delete_branch_on_merge

Branch-hygiene repository settings (used by the repo-hygiene periodic preset, PART 2). The central-deploy github component has no repository GET/PATCH route — use these tools instead of component_request for this.

  • get_repo_settings(repo_full_name) — read-only. Calls GET /repos/{owner}/{repo} and returns one - key: value line each for default_branch, delete_branch_on_merge, allow_auto_merge, allow_merge_commit, allow_squash_merge, allow_rebase_merge and archived.
  • set_repo_delete_branch_on_merge(repo_full_name, enabled=True) — calls PATCH /repos/{owner}/{repo} with a body containing only delete_branch_on_merge; no other setting can be changed through it. Idempotent. Read the current value with get_repo_settings first and only call it when the value differs. Call it when the operator asked for it, or when an operator-written periodic preset (e.g. repo-hygiene) instructs it — that preset is the operator's standing consent.

Preconditions

  • Repository must be within the GitHub App installation scope.
  • Setting the value requires the GitHub App permission Administration: write (reading needs only Metadata: read).
  • No BLOCKED-state requirement.

Error responses

Condition Message
Repo not in installation scope The robotsix-mill GitHub App is not installed on 'owner/name'
Missing Administration (403) Error updating delete_branch_on_merge on owner/name: permission denied — ...
Value not applied Error updating delete_branch_on_merge on owner/name: GitHub reported ...
Read failure Error fetching repository settings for owner/name: <detail>

Creating repos and forks: create_direct_repo / fork_direct_repo

create_direct_repo creates a repository under the operator's personal GitHub account (POST /user/repos); fork_direct_repo forks owner/name into that account (POST /repos/{owner}/{repo}/forks, then waits until the fork exists).

PAT requirement

Both tools authenticate with the personal access token in direct_repo.github_pat — never the GitHub App (an App installation token cannot create repos or forks on a personal account: GitHub answers 403 Resource not accessible by integration). The PAT needs, for a fine-grained token, Administration: Read and write on the account's repositories; for a classic token, the repo scope. When github_pat is empty the two tools are not offered at all.

Operator-instruction rule

  • Call them ONLY when the operator has explicitly asked, in this conversation, for that repo or fork. Never create or fork on your own initiative or as a side-step of another task.
  • They are not offered to periodic sessions or subsession workers — unattended runs cannot create repositories or forks.
  • Two-step confirmation: call first with confirmed=false (default). Nothing is created; the tool echoes the owner/name/visibility (or upstream → fork). Show the echo to the operator, wait for their confirmation, then call again with the same arguments and confirmed=true.
  • After a successful creation the result suggests (it does NOT run) registering the repo with mill (POST /repos on the board API) and applying the fleet ruleset (robotsix-github-workflows/scripts/apply-branch-protection.sh). Offer these to the operator; run them only on their instruction.

Refusals and errors

Condition Response
Invalid repo name / owner/name Refused: ... is not a valid ...
Forking a repo the PAT owner owns Refused: owner/name already belongs to ...
PAT rejected / account lookup Error: could not resolve the github_pat account: <detail>
GitHub rejects the create / fork Error creating repo: <detail> / Error forking repo: <detail>
Fork not visible before timeout Fork of 'owner/name' was accepted by GitHub but ... did not appear

Other direct-repo tools (read-only or gated on BLOCKED state)

The following tools are available for push/PR operations. They require the ticket to be in BLOCKED state and the repo to be in the installation scope:

  • push_direct_repo_branch — Push a new branch with file changes. files_json accepts three per-entry forms: {path, content} for text, {path, content_b64} for base64-encoded bytes, or {path, local_path} to commit the bytes of a file downloaded into the file-hub work directory (via file_hub_get). local_path must resolve inside that directory or the push is rejected.
  • open_direct_repo_pr — Open a PR from an existing branch (no auto-merge — human review required).
  • update_pr_branch — Rebase a PR branch onto the latest base branch.
  • check_pr_merge_conflict — Check a PR's mergeability status (read-only, no confirmation gating).
  • apply_patch_to_file — Push a file patched with a unified diff to a new branch.

These tools are read-only or gated on BLOCKED state — they do not modify live repository state beyond what the agent has already been authorised to do via the BLOCKED ticket flow.


Diagnosing GitHub permission errors (403 "lacks <permission>")

When a GitHub API mutation fails with a 403 permission error — e.g. lacks pages: write when enabling GitHub Pages — do not immediately assume a cached token or restart the service. Instead:

  1. Call inspect_github_installation_token with the owner/repo that failed.
  2. Read the reported token expiry timestamp and permission map:
    • Permission present (e.g. pages: write) but the request still failed → the earlier request used a cached/stale token. A fresh token has now been minted; retry the operation, and if it still fails, re-check below.
    • Permission missing → the App installation genuinely lacks the permission; caching is NOT the cause. Give the user the exact steps below to grant it.
  3. Read the reported installation mode and configured installation id. The report no longer surfaces a separately-resolved per-repo installation id — the public token path does not expose it on the returned token, so resolved_installation_id mirrors the configured value. A pinned override that no longer exists on GitHub is called out explicitly via configured_installation_exists. If the grant was made on a different App or installation, point the user at the right one.

Granting a permission (exact GitHub UI paths):

For an organisation-installed App:

  1. Open https://github.com/organizations/<org>/settings/installations/<installation_id> (or: navigate to the organisation → Settings → Third-party access → GitHub Apps → click Configure next to the app).
  2. Under Permissions, find the relevant permission (e.g. Pages) and set it to Read and write.
  3. Click Save.

For a user-installed App:

  1. Open https://github.com/settings/installations/<installation_id> (or: click your avatar → Settings → Applications → GitHub Apps → click Configure next to the app).
  2. Under Permissions, find the relevant permission and set it to Read and write.
  3. Click Save.

After the grant is saved, call inspect_github_installation_token again to confirm the permission now appears in the fresh token's scope before retrying the original operation.

Operating rules (moved from the system prompt, 2026-09-08)

– Merge / PR management: push_direct_repo_branch and open_direct_repo_pr push branches and open PRs for blocked tickets, but these PRs require human review before merge. When a PR is approved and ready to merge and the ticket is in BLOCKED state, prefer merge_direct_repo_pr (direct-repo) — it merges the PR and returns the merge commit SHA. For pre-BLOCKED tickets or when merge_direct_repo_pr is unavailable, use the mill's merge endpoint via component_request (the mill API has merge-now and related endpoints for merging approved MRs). Do NOT claim you lack merge capability — you can merge through either path. Do NOT claim merged without verifying the merge commit SHA. – Credential verification before merge: when a PR modifies stored credentials, secrets, or password hashes, inspect the diff to confirm it does not contain a well-known default value (e.g. the hash of 'password', 'admin', 'root', '123456', or similar). If the diff contains a well-known default, block the merge and file a corrective ticket with the intended credential value. – direct_fix (LAST RESORT ONLY): when a ticket is BLOCKED and has exhausted the mill’s implement cycle limit (≥3 failed implement attempts), you may use direct_fix to push a commit directly to the target branch, bypassing the PR flow. This is an escape hatch for mechanically simple, validated-correct fixes (e.g. stale-SHA replacements, file deletions, find-replace) that are blocked on rebase churn. Before calling direct_fix: (a) confirm the ticket has ≥3 implement cycles; (b) verify the fix is deterministic, reviewable, and low-risk; (c) get explicit human operator approval via a user_chat subsession — never call direct_fix unilaterally. Every direct_fix invocation is audited at WARNING level. – Repo creation bootstrap: when creating a new repository (or working with a freshly created empty repo), tool-chains that require an existing commit or branch to push to (e.g. push_direct_repo_branch, open_direct_repo_pr) will deadlock if the repo has no commits. Proactively seed an initial commit during repo creation that includes every repo-baseline file: SECURITY.md, AGENT.md, README.md (with a robotsix-standards link), .gitignore, .github/dependabot.yml (at minimum the github-actions ecosystem and the repo's language ecosystem), and a .github/workflows/ci.yml with a top-level permissions: read-all block. Seeding every baseline file in the initial commit prevents follow-up standards-enforcement tickets that add missing files one at a time. Never create an empty repo and then attempt a push workflow without first seeding a commit.

04 同仓库更多 Skills