@clipboard-health/ai-rules 2.20.12 → 2.20.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipboard-health/ai-rules",
3
- "version": "2.20.12",
3
+ "version": "2.20.14",
4
4
  "description": "Pre-built AI agent rules for consistent coding standards.",
5
5
  "keywords": [
6
6
  "ai",
@@ -25,11 +25,11 @@ This skill always runs exactly one pass. It never waits or repeats internally. F
25
25
 
26
26
  ## Sentinels
27
27
 
28
- The skill uses two HTML-comment sentinels.
28
+ The skill uses two sentinels. Each is a visible footer line wrapped in `<sub>` (a 🤖 mark plus the token in `<code>`).
29
29
 
30
- **Addressed sentinel**: `<!-- babysit-pr:addressed v1 core@3.4.1 -->`. The `core@<X.Y.Z>` suffix records which plugin version produced the reply. Appended on its own line at the end of every reply the skill posts (both thread replies and the review-body summary). This is how the skill knows, on re-runs, which threads and automated review-body comments it already handled. Dedupe matches by the version-agnostic prefix `<!-- babysit-pr:addressed v1` followed by a single space, so pre-versioning sentinels left by earlier plugin versions are still recognized. Grep `babysit-pr:addressed v1` (without `-->`) to find sentinels regardless of version; grep `babysit-pr:addressed v1 core@3.4.1` to find ones from a specific version.
30
+ **Addressed sentinel**: `<sub>🤖 <code>babysit-pr:addressed v1 core@3.4.1</code></sub>`. Appended on its own line at the end of every reply the skill posts (both thread replies and the review-body summary); this is how re-runs know which threads and review-body comments are already handled. Dedupe matches the version-agnostic substring `babysit-pr:addressed v1` followed by a space (also matches legacy `<!-- babysit-pr:addressed v1 ... -->` sentinels). Grep `babysit-pr:addressed v1` for any version; add `core@3.4.1` for a specific one.
31
31
 
32
- **Follow-up sentinel**: `<!-- babysit-pr:followup v1 core@3.4.1 -->`. Attached to replies that defer an out-of-scope comment as a tracked follow-up (see the Scope subsection and the Defer verdict in step 6). Grep `babysit-pr:followup` across PR conversation JSON to enumerate deferred items. This sentinel is additive — the post-reply scripts still append the `addressed` sentinel at the end, so a deferred thread is correctly machine-classified as addressed (the skill _has_ handled it — by deferring). Human reviewers and future sweeps distinguish deferred from resolved by looking for the follow-up sentinel.
32
+ **Follow-up sentinel**: `<sub>🤖 <code>babysit-pr:followup v1 core@3.4.1</code></sub>`. Attached to replies that defer an out-of-scope comment as a tracked follow-up (see the Scope subsection and the Defer verdict in step 6). Grep `babysit-pr:followup` across PR conversation JSON to enumerate deferred items. This sentinel is additive — the post-reply scripts still append the `addressed` sentinel at the end, so a deferred thread is correctly machine-classified as addressed (the skill _has_ handled it — by deferring). Human reviewers and future sweeps distinguish deferred from resolved by looking for the follow-up sentinel.
33
33
 
34
34
  **Sentinel recency rules.** The script emits a per-thread `activityState` with three values:
35
35
 
@@ -280,7 +280,7 @@ Body templates (the script appends the `addressed` sentinel if missing):
280
280
  - **Agree**: `Addressed in <commit-url>. <one-line what-changed>.`
281
281
  - **Disagree**: `Leaving current behavior. <reasoning>.`
282
282
  - **Already fixed**: `Already handled by <commit-url-or-file:line>. <brief pointer>.`
283
- - **Defer**: `Out of scope for this PR; this looks like follow-up work rather than something introduced or required by this change. <one-line rationale or pointer if useful>.\n\n<!-- babysit-pr:followup v1 core@3.4.1 -->`
283
+ - **Defer**: `Out of scope for this PR; this looks like follow-up work rather than something introduced or required by this change. <one-line rationale or pointer if useful>.\n\n<sub>🤖 <code>babysit-pr:followup v1 core@3.4.1</code></sub>`
284
284
 
285
285
  For Defer replies, include the follow-up sentinel on its own line as shown. The script will append the `addressed` sentinel after it on its own line, so the final body ends with the follow-up sentinel followed by a blank line followed by the `addressed` sentinel — `grep babysit-pr:followup` finds the deferral and `grep babysit-pr:addressed` still marks the thread handled for dedupe.
286
286
 
@@ -296,7 +296,7 @@ The PR-level summary should:
296
296
 
297
297
  - Group by source. Use `## Review-body findings` for step-7 work and `## Conversation-tab comments` for step-6b work. Omit a section if its list is empty.
298
298
  - Inside each section, group verdicts under **Agree / Disagree / Already fixed / Deferred (out of scope)** subheadings. Omit a subheading if its list is empty.
299
- - Under **Deferred (out of scope)**, list each deferred item as a bullet, followed on its own line by `<!-- babysit-pr:followup v1 core@3.4.1 -->` so grep catches them individually.
299
+ - Under **Deferred (out of scope)**, list each deferred item as a bullet, followed on its own line by `<sub>🤖 <code>babysit-pr:followup v1 core@3.4.1</code></sub>` so grep catches them individually.
300
300
  - Include the commit URL for fixes.
301
301
  - End with a fenced fingerprint block listing every current fingerprint — addressed and deferred — one per line. Include both `reviewBodyComments[].fingerprint` (whole-body, one per automated review) and `activeIssueComments[].fingerprint` (per Conversation-tab comment). Future runs dedupe by matching these against `priorBabysitSentinels`.
302
302
 
@@ -2,13 +2,14 @@
2
2
  # _sentinel.sh — shared SENTINEL constants + append helper.
3
3
  # Sourced by unresolvedPrComments.sh, postSentinelReply.sh, postSentinelPrComment.sh.
4
4
  #
5
- # SENTINEL_PREFIX is the version-agnostic substring used for matching/dedupe so
6
- # pre-versioning sentinels (`<!-- babysit-pr:addressed v1 -->`) are still
7
- # recognized alongside versioned ones. SENTINEL is the literal emitted on new
8
- # replies; the `core@X.Y.Z` suffix records which plugin version produced it.
5
+ # SENTINEL is the literal emitted on new replies: a visible footer (robot mark +
6
+ # token in `<code>`, wrapped in `<sub>`). SENTINEL_PREFIX is the wrapper-free
7
+ # substring used for matching/dedupe, so it matches both this footer and legacy
8
+ # `<!-- babysit-pr:addressed v1 ... -->` sentinels. The `core@X.Y.Z` suffix is
9
+ # substituted at build time by embedPluginVersion.mts.
9
10
 
10
- SENTINEL_PREFIX='<!-- babysit-pr:addressed v1 '
11
- SENTINEL='<!-- babysit-pr:addressed v1 core@3.4.1 -->'
11
+ SENTINEL_PREFIX='babysit-pr:addressed v1 '
12
+ SENTINEL='<sub>🤖 <code>babysit-pr:addressed v1 core@3.4.1</code></sub>'
12
13
 
13
14
  # Bot author allowlist (JSON array literal). Used by unresolvedPrComments.sh
14
15
  # as a fallback when GraphQL's `author.__typename == "Bot"` misses a GitHub
@@ -1,5 +1,5 @@
1
1
  ---
2
- allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr view:*), Bash(gh pr create:*), Bash(gh pr edit:*), Bash(git diff:*), Bash(git merge-base:*), Bash(bash scripts/find-session-id.sh:*)
2
+ allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr view:*), Bash(gh pr create:*), Bash(gh pr edit:*), Bash(git diff:*), Bash(git merge-base:*)
3
3
  description: Commit, push, and open a PR. Use when the user wants to ship changes, create a pull request, or says things like 'commit and push', 'open a PR', 'ship it', 'send it', 'create a PR for this', or 'push this up'.
4
4
  ---
5
5
 
@@ -43,8 +43,8 @@ Script paths in this procedure are written as `scripts/...`, relative to this SK
43
43
  2. Run the `simplify` skill on the full PR diff — `git diff $(git merge-base HEAD origin/HEAD)..HEAD` plus any uncommitted changes. When it returns, your very next action is to restate the remaining steps (3–7) and continue with step 3 in the same turn. Do not stop, do not end the turn with a simplify summary.
44
44
  3. If `git status --short` shows changes, create a single conventional commit with `git commit --no-gpg-sign`.
45
45
  4. Push the branch to origin.
46
- 5. Look up the current agent session ID by running this skill's bundled script: `bash scripts/find-session-id.sh '<phrase>'`. Pass a distinctive verbatim chunk (≥10 words) from the most recent user message; see the script header for quoting constraints. If the script prints `codex <id>`, use `Agent session: codex resume <id>`. If it prints `claude-code <id>`, use `Agent session: claude --resume <id>`. If empty, there is no session footer line.
46
+ 5. Look up the current agent session ID by running this skill's bundled script: `bash scripts/find-session-id.sh '<phrase>'`. Pass a distinctive verbatim chunk (≥10 words) from the most recent user message; see the script header for quoting constraints. If the script prints `codex <id>`, use ``Agent session: `codex resume <id>` ``. If it prints `claude-code <id>`, use ``Agent session: `claude --resume <id>` ``. Keep the resume command in backticks so it renders as code in the PR description. If empty, there is no session footer line.
47
47
  6. Check for an existing PR with `gh pr view`.
48
- - No PR: create with `gh pr create`. Title = commit subject. Description = the PR body shape above, followed by the session footer line if known and `<!-- commit-push-pr:created v1 core@3.4.1 -->`.
49
- - PR exists: refresh the body via `gh pr edit --body` so (a) the new commit's changes are reflected in the prose while existing `## Summary`, `## Validation`, and `## Notes` sections are preserved unless clearly stale, (b) any known session footer line is appended if missing, never removing or rewriting existing `Agent session: ...` or `Agent session ID: ...` lines, and (c) any existing `<!-- commit-push-pr:created v1 ... -->` line is preserved verbatim, appending `<!-- commit-push-pr:created v1 core@3.4.1 -->` if absent. Then report the URL.
48
+ - No PR: create with `gh pr create`. Title = commit subject. Description = the PR body shape above, followed by the session footer line if known and the agent footer `<sub>🤖 <code>commit-push-pr:created v1 core@3.4.1</code></sub>` on its own line.
49
+ - PR exists: refresh the body via `gh pr edit --body` so (a) the new commit's changes are reflected in the prose while existing `## Summary`, `## Validation`, and `## Notes` sections are preserved unless clearly stale, (b) any known session footer line is appended if missing, never removing or rewriting existing `Agent session: ...` or `Agent session ID: ...` lines, and (c) any existing footer carrying the substring `commit-push-pr:created v1` is preserved verbatim, appending `<sub>🤖 <code>commit-push-pr:created v1 core@3.4.1</code></sub>` only if absent. Then report the URL.
50
50
  7. End with one short text response: branch name and the full PR URL (e.g., `https://github.com/clipboardhealth/core-utils/pull/123`). Never use shorthand like `repo#123` — always output the complete URL.