From bb26b3a1a86895c0fec5f8cce2ed29c93b9006a7 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sun, 11 Oct 2026 17:05:47 -0700 Subject: [PATCH] agents: clarify create-pr artifact publishing and monitor-ci pgrep Subagents cannot write artifacts directly to a parent conversation's artifact directory, and chaining pgrep with background script launches matches the parent shell command string. Instruct PR subagents to write the draft artifact locally for the main agent to publish, and require running pgrep as a standalone check before launching the CI monitor. --- .agents/skills/create-pr/SKILL.md | 21 ++++++++++++--------- .agents/skills/monitor-ci-results/SKILL.md | 4 +++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.agents/skills/create-pr/SKILL.md b/.agents/skills/create-pr/SKILL.md index a9cf923a3b..b4bcec70eb 100644 --- a/.agents/skills/create-pr/SKILL.md +++ b/.agents/skills/create-pr/SKILL.md @@ -20,11 +20,11 @@ to a subagent. NEVER create or draft PRs directly in the main conversation. rules/skills). - **PR Body**: Explain *why* and conceptual *how*. Wrap strictly at 72 columns max. Use concise, active phrasing (Strunk & White). - - **Artifact Requirements**: Create `pr_info.md` with: - - **User-facing**: Published directly in the user interface. - - **Interactive feedback enabled**: Allows selecting lines and leaving - inline comments on the draft (`RequestFeedback: true`). - - **User decision choices**: Present choices: + - **Artifact Requirements**: Create `pr_info.md` in the subagent's own + artifact directory (do not attempt to write to the parent's artifact + directory) with: + - PR title, 72-column wrapped body, and PR number/URL (if created). + - **User decision choices**: 1. Create a regular PR 2. Create a draft PR 3. Provide feedback on the draft text @@ -34,10 +34,13 @@ to a subagent. NEVER create or draft PRs directly in the main conversation. `gh pr create` when explicitly requested to create the PR. - **Targeting Upstream Repo**: When creating, target upstream using `--repo bazel-contrib/rules_python` and `--head :`. -4. **Return Status**: Direct subagent to report PR number/draft status to - caller. -5. **Link Artifact Before Asking**: Upon subagent completion, output a - clickable markdown link to `pr_info.md` before prompting for confirmation. +4. **Return Status**: Direct subagent to report the PR number/draft status and + the absolute file path to its `pr_info.md` artifact back to the caller. +5. **Publish and Link Artifact in Main Agent**: Upon subagent completion, read + the subagent's `pr_info.md` via `view_file`, publish it to the main agent's + own artifact directory via `write_to_file` (`UserFacing: true`, + `RequestFeedback: true`), and output a clickable markdown link to the main + agent's `pr_info.md` before prompting for confirmation. 6. **Interactive Actions**: When presenting choices via `ask_question`, always include the clickable markdown link to `pr_info.md` in the `question` prompt. diff --git a/.agents/skills/monitor-ci-results/SKILL.md b/.agents/skills/monitor-ci-results/SKILL.md index 599caa3c82..2e1190d12b 100644 --- a/.agents/skills/monitor-ci-results/SKILL.md +++ b/.agents/skills/monitor-ci-results/SKILL.md @@ -16,7 +16,9 @@ or when monitoring CI after PR updates: `pgrep -af "[m]onitor_remote_ci.py "`. Do NOT use a generic grep without ``, as other active agent conversations may be monitoring different PRs concurrently. If one is already running for this PR, do not - start another instance. + start another instance. Run `pgrep` as a standalone command—do NOT chain it + with `|| ... monitor_remote_ci.py ` in a single shell invocation, + as `pgrep -af` will match the parent `bash -c` command string and exit `0`. 2. **Launch Monitoring Script**: If no monitor process is active for ``, launch the script in the background: ```bash