@clipboard-health/ai-rules 2.21.1 → 2.22.0

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.21.1",
3
+ "version": "2.22.0",
4
4
  "description": "Pre-built AI agent rules for consistent coding standards.",
5
5
  "keywords": [
6
6
  "ai",
@@ -27,9 +27,9 @@ This skill always runs exactly one pass. It never waits or repeats internally. F
27
27
 
28
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**: `<sub>🤖 <code>babysit-pr:addressed v1 core@3.5.0</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.5.0` for a specific one.
30
+ **Addressed sentinel**: `<sub>🤖 <code>babysit-pr:addressed v1 core@3.6.0</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.6.0` for a specific one.
31
31
 
32
- **Follow-up sentinel**: `<sub>🤖 <code>babysit-pr:followup v1 core@3.5.0</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.
32
+ **Follow-up sentinel**: `<sub>🤖 <code>babysit-pr:followup v1 core@3.6.0</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<sub>🤖 <code>babysit-pr:followup v1 core@3.5.0</code></sub>`
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.6.0</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 `<sub>🤖 <code>babysit-pr:followup v1 core@3.5.0</code></sub>` 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.6.0</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
 
@@ -9,7 +9,7 @@
9
9
  # substituted at build time by embedPluginVersion.mts.
10
10
 
11
11
  SENTINEL_PREFIX='babysit-pr:addressed v1 '
12
- SENTINEL='<sub>🤖 <code>babysit-pr:addressed v1 core@3.5.0</code></sub>'
12
+ SENTINEL='<sub>🤖 <code>babysit-pr:addressed v1 core@3.6.0</code></sub>'
13
13
 
14
14
  # Bot author allowlist (JSON array literal). Used by unresolvedPrComments.sh
15
15
  # as a fallback when GraphQL's `author.__typename == "Bot"` misses a GitHub
@@ -47,7 +47,7 @@ Script paths in this procedure are written as `scripts/...`, relative to this SK
47
47
  6. Check for an existing PR with `gh pr view`.
48
48
 
49
49
  PR title format: conventional-commit type + description, with no scope, plus the Linear ticket in parentheses at the end when one applies (e.g., `feat: add resume command (STAFF-123)`). This differs from the commit subject, which keeps its scope. Derive the ticket from the branch name, commit body, or session context; omit the parenthetical when no ticket applies.
50
- - No PR: create with `gh pr create` using the PR title format above. 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.5.0</code></sub>` on its own line.
51
- - PR exists: if the title doesn't match the format above, correct it with `gh pr edit --title`. 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.5.0</code></sub>` only if absent. Then report the URL.
50
+ - No PR: create with `gh pr create` using the PR title format above. 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.6.0</code></sub>` on its own line.
51
+ - PR exists: if the title doesn't match the format above, correct it with `gh pr edit --title`. 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.6.0</code></sub>` only if absent. Then report the URL.
52
52
 
53
53
  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.
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: create-groundcrew-ticket
3
+ description: "Create Linear tickets that Groundcrew can pick up: assigned to the current Linear user, labeled with agent-*, tied to an implementation repository in the description, optionally linked to parent and blocker tickets, and written to use the core:go implementation workflow."
4
+ ---
5
+
6
+ # Create Groundcrew Ticket
7
+
8
+ Create Linear issues that are ready for Groundcrew dispatch. This skill is agent-agnostic: use the structured Linear capability available in the current agent, following that tool's current schema instead of hard-coding one here.
9
+
10
+ ## Eligibility Contract
11
+
12
+ A Linear issue is Groundcrew-eligible when all of these are true:
13
+
14
+ - It is assigned to the current Linear user. Use the active Linear tool's "current user" value, commonly `me`, when available.
15
+ - It is in a Todo workflow state. Prefer the Linear state type for Todo when tooling accepts state types.
16
+ - It has exactly one appropriate `agent-*` label. Use `agent-any` unless the user explicitly asks for a specific model such as `agent-codex` or `agent-claude`.
17
+ - Its description contains the implementation repository text exactly as Groundcrew can match it, for example `Repository: groundcrew`.
18
+ - It is a leaf work item. Do not put `agent-*` labels on parent tickets that have children; Groundcrew skips parents with sub-issues.
19
+ - It is not blocked by non-terminal blockers if the user expects it to start immediately. If blockers are intentional, create `blocked-by` relations and tell the user Groundcrew will wait.
20
+
21
+ Groundcrew resolves the repository by scanning the description for a known repository name. Do not rely on Linear custom fields for repository routing.
22
+
23
+ ## Required Inputs
24
+
25
+ Before creating, know:
26
+
27
+ - `title`
28
+ - Linear `team`
29
+ - implementation `repository`
30
+ - enough task context to write a useful implementation ticket
31
+
32
+ If any required input is missing and cannot be inferred safely, ask a concise question before creating.
33
+
34
+ Repository inference:
35
+
36
+ - If the user names a repository, use that exact value.
37
+ - Otherwise infer from the current git remote or directory name.
38
+ - Prefer a value present in `crew.config.ts` `workspace.knownRepositories` when this repo is available.
39
+ - If multiple known repositories could match the same bare name, ask the user to choose.
40
+
41
+ Optional metadata:
42
+
43
+ - `parent`: parent Linear identifier, for example `ENG-123`
44
+ - blocked-by relations: tickets this new ticket depends on
45
+ - blocking relations: tickets this new ticket blocks
46
+
47
+ ## Description Template
48
+
49
+ Use a direct implementation-shaped ticket. Keep the repository line near the top.
50
+
51
+ ```md
52
+ ## Groundcrew
53
+
54
+ Repository: <repo>
55
+ Implementation workflow: use the `core:go`/`go` skill when available. If that skill is unavailable, follow this repo's AGENTS.md/CLAUDE.md implementation workflow and run the documented verification.
56
+
57
+ ## Task
58
+
59
+ <what to change>
60
+
61
+ ## Acceptance Criteria
62
+
63
+ - [ ] <observable outcome>
64
+
65
+ ## Notes
66
+
67
+ <links, constraints, parent/blocker context, or "None">
68
+ ```
69
+
70
+ Keep the ticket agent-agnostic. Do not mention Codex-only commands unless the user explicitly requested a Codex-specific ticket.
71
+
72
+ ## Creation Path
73
+
74
+ Use the current agent's structured Linear issue tool. Tool names and exact field names vary, so inspect the active tool schema/help and map these intents to the available fields:
75
+
76
+ - Set the `title`.
77
+ - Assign it to the current Linear user.
78
+ - Set its state to Todo.
79
+ - Apply the chosen `agent-*` label.
80
+ - Put the generated Markdown body in the issue description.
81
+ - Set the parent issue when the user provided one.
82
+ - Add dependency relations for blockers and blocked tickets.
83
+ - Apply optional project, cycle, milestone, priority, estimate, and due date metadata only when requested or clearly inferable.
84
+
85
+ Rules:
86
+
87
+ - Use a blocked-by relation for "this work is blocked by X".
88
+ - Use a blocking relation only when the user says the new ticket blocks another ticket.
89
+ - If the tool cannot create relations during creation, create the issue first, then update it to add the parent and dependency relations.
90
+ - If creating a parent and child tickets, create the parent without an `agent-*` label, then create labeled child tickets under that parent.
91
+
92
+ ## Verification
93
+
94
+ After creation:
95
+
96
+ - Confirm the resulting issue identifier and URL.
97
+ - Check that the issue has the intended assignee, state, `agent-*` label, repository line, parent, and relations.
98
+ - If this Groundcrew repo or `crew` CLI is available, run `node --run crew -- status <ISSUE>` and report whether Groundcrew sees the ticket as ready for dispatch or why it will wait.
99
+
100
+ Do not claim the ticket is eligible if verification fails. Report the missing field or blocking condition plainly.