agents: refine Starlark, workspace merge, and CI monitor rules (#4214)

Prevent duplicate Label() definitions, mid-merge stashing issues, and
false-positive CI monitor process checks.

Require reusing `labels.<NAME>` from `common_labels.bzl` and preferring
`types.is_*` from `@bazel_skylib//lib:types.bzl` in Starlark rules and
review prompts, document committing or stashing before `git merge
upstream/main`, and use a bracketed character class in `pgrep -af` to
avoid matching the subshell command line.
diff --git a/.agents/rules/starlark.md b/.agents/rules/starlark.md
index bc440b5..b7dd659 100644
--- a/.agents/rules/starlark.md
+++ b/.agents/rules/starlark.md
@@ -10,8 +10,11 @@
 * In macro implementations, internal repository target references **MUST** be
   canonicalized using `str(Label("//path/to:target"))` so they resolve in the
   macro's module context rather than the caller's repository context.
-* Note that `python/private/common_labels.bzl` defines `labels`, a struct
-  containing common canonicalized label strings used across the project.
+* **Reuse `python/private/common_labels.bzl`**: When a target label is listed in
+  `python/private/common_labels.bzl` (or shared across multiple `.bzl` files
+  such as `flags.bzl` and `config_settings.bzl`), load `labels` from
+  `:common_labels.bzl` and use `labels.<NAME>` (or `Label(labels.<NAME>)`)
+  instead of redefining duplicate `Label("//...")` values.
 
 ## Manual Tag on Internal Macro Helper Targets
 * When macros instantiate internal helper targets (such as private rule targets
@@ -61,6 +64,9 @@
 ## Code Style & Conventions
 * **Dict union (`|`)**: Use `|` instead of `dicts.add(...)` from
   `@bazel_skylib//lib:dicts.bzl` when merging dictionaries.
+* **Type Checks (`@bazel_skylib//lib:types.bzl`)**: Prefer `types.is_*` helpers
+  (e.g., `types.is_dict(x)`, `types.is_list(x)`, `types.is_string(x)`) from
+  `@bazel_skylib//lib:types.bzl` instead of `type(x)` comparisons.
 * **Non-Info Provider Naming**: Add `# buildifier: disable=name-conventions`
   above `provider()` declarations that do not end in `Info` (e.g. `*Fileset`).
 * **Docstring Formatting Invariants**: Use triple-quoted strings for multi-line
diff --git a/.agents/rules/workspace.md b/.agents/rules/workspace.md
index b3bb174..20d8027 100644
--- a/.agents/rules/workspace.md
+++ b/.agents/rules/workspace.md
@@ -20,4 +20,7 @@
 * When pushing to a checked-out PR branch from an external fork, push
   explicitly to that remote (`git push <remote> HEAD:<branch>`). Do not rely on
   a bare `git push`.
-
+* When syncing a branch with `upstream/main`, commit or stash local changes
+  *before* running `git merge upstream/main` and conclude the merge in its own
+  dedicated commit. Never run `git stash` while `MERGE_HEAD` is active, as
+  `git stash` clears `MERGE_HEAD`.
diff --git a/.agents/skills/monitor-ci-results/SKILL.md b/.agents/skills/monitor-ci-results/SKILL.md
index 92b1dca..599caa3 100644
--- a/.agents/skills/monitor-ci-results/SKILL.md
+++ b/.agents/skills/monitor-ci-results/SKILL.md
@@ -12,10 +12,11 @@
 > launch duplicate monitoring jobs for the same PR.
 
 1. **Check Existing Process**: Check if a monitor script is already running for
-   **this specific PR** using `pgrep -f "monitor_remote_ci.py <pr_number>"`. Do
-   NOT use a generic grep without `<pr_number>`, as other active agent
-   conversations may be monitoring different PRs concurrently. If one is
-   already running for this PR, do not start another instance.
+   **this specific PR** using
+   `pgrep -af "[m]onitor_remote_ci.py <pr_number>"`. Do NOT use a generic grep
+   without `<pr_number>`, as other active agent conversations may be monitoring
+   different PRs concurrently. If one is already running for this PR, do not
+   start another instance.
 2. **Launch Monitoring Script**: If no monitor process is active for
    `<pr_number>`, launch the script in the background:
 ```bash
diff --git a/.agents/skills/review-code/review-starlark-prompt.md b/.agents/skills/review-code/review-starlark-prompt.md
index 5386b37..3d99f22 100644
--- a/.agents/skills/review-code/review-starlark-prompt.md
+++ b/.agents/skills/review-code/review-starlark-prompt.md
@@ -12,5 +12,9 @@
 5. Check multi-line rule/macro doc arguments: use triple-quoted strings
    (`"""`), and do NOT use trailing backslashes (`\`) on opening triple-quotes.
 6. Verify analysis tests use `rules_testing`, not `bazel_skylib`.
+7. Ensure shared labels use `labels.<NAME>` from
+   `python/private/common_labels.bzl` rather than redefining `Label("//...")`.
+8. Prefer `types.is_*` helpers from `@bazel_skylib//lib:types.bzl` over
+   `type(x)` comparisons.
 
 @.agents/skills/review-code/review-report-format.md