@clipboard-health/ai-rules 2.15.9 → 2.15.10
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
|
@@ -59,7 +59,12 @@ for my $section (@sections) {
|
|
|
59
59
|
my $raw_file_name = trim($1);
|
|
60
60
|
my $file_content = $2;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
# Category prefix is optional. CodeRabbit emits 0–N `_…_` tags
|
|
63
|
+
# separated by `|` (e.g. `_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_`
|
|
64
|
+
# or just `_💤 Low value_` on lower-confidence findings). The previous
|
|
65
|
+
# regex required exactly two tags and silently dropped one-tag and
|
|
66
|
+
# three-tag variants.
|
|
67
|
+
while ($file_content =~ /`(\d+(?:-\d+)?)`:\s*(?:_[^_]+_(?:\s*\|\s*_[^_]+_)*\s*)?\*\*([^*]+)\*\*\s*([\s\S]*?)(?=---|\n`\d|<\/blockquote>|$)/g) {
|
|
63
68
|
my $line_range = $1;
|
|
64
69
|
my $title = trim($2);
|
|
65
70
|
my $clean_body = clean_comment_body(trim($3));
|
|
@@ -14,20 +14,13 @@ description: Commit, push, and open a PR. Use when the user wants to ship change
|
|
|
14
14
|
|
|
15
15
|
## Your task
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
If `Commits ahead of default branch` is `(unknown)`, `origin/HEAD` couldn't be resolved — stop and tell the user to run `git remote set-head origin -a` (or otherwise set the default branch) before retrying, since the simplify step also depends on it. Otherwise, if `Git status`, `Commits ahead of default branch`, and `Existing PR` are all empty/none, stop and reply `nothing to ship.`. Otherwise:
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Based on the above changes:
|
|
24
|
-
|
|
25
|
-
1. Create a new branch if on main (e.g., `feat/add-user-validation`, `fix/null-check-in-parser`)
|
|
26
|
-
2. Run the `simplify` skill on the files included in the PR before committing, pushing, or opening the PR. If the working tree is clean, run `simplify` against `git diff $(git merge-base HEAD origin/HEAD)..HEAD`. If the working tree has changes, run it against `git diff HEAD`; when local commits also exist, include `git diff $(git merge-base HEAD origin/HEAD)..HEAD` as additional PR context. Invoke the skill by name using this agent's normal skill invocation mechanism. Wait for the skill to finish, then include any resulting fixes in the commit step below.
|
|
27
|
-
3. Re-check `git status --short`. If there are changes, create a single conventional commit message.
|
|
28
|
-
4. Push the branch to origin
|
|
19
|
+
1. Create a new branch if on main (e.g., `feat/add-user-validation`, `fix/null-check-in-parser`).
|
|
20
|
+
2. Run the `simplify` skill on the full PR diff — `git diff $(git merge-base HEAD origin/HEAD)..HEAD` plus any uncommitted changes. Wait for it to finish, then include any resulting fixes in the commit.
|
|
21
|
+
3. If `git status --short` shows changes, create a single conventional commit.
|
|
22
|
+
4. Push the branch to origin.
|
|
29
23
|
5. Check for an existing PR with `gh pr view`.
|
|
30
|
-
- No PR
|
|
31
|
-
- PR exists:
|
|
32
|
-
6.
|
|
33
|
-
7. After tool calls complete, send one short final text response with the 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 so it is clickable.
|
|
24
|
+
- No PR: create with `gh pr create`. Title = commit subject. Description = brief explanation of **why**, not what. Append `<!-- commit-push-pr:created v1 -->` on its own line at the end so skill-created PRs can be identified later.
|
|
25
|
+
- PR exists: report the URL and move on.
|
|
26
|
+
6. 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.
|
package/skills/go/SKILL.md
CHANGED
|
@@ -4,59 +4,43 @@ description: Implement a plan file or direct request end-to-end, then hand off t
|
|
|
4
4
|
|
|
5
5
|
# Go: Execute Work and Ship It
|
|
6
6
|
|
|
7
|
-
Given a plan file or direct implementation request, implement the requested work, then invoke the `commit-push-pr` skill to
|
|
7
|
+
Given a plan file or direct implementation request, implement the requested work, then invoke the `commit-push-pr` skill to create a PR.
|
|
8
8
|
|
|
9
9
|
This skill is the bridge between intent and shipping. It does not re-plan or re-design unless the user asked for that. If the request is wrong or cannot be implemented safely, surface that; do not silently improvise.
|
|
10
10
|
|
|
11
|
-
## Phase 1:
|
|
11
|
+
## Phase 1: Resolve the Input
|
|
12
12
|
|
|
13
|
-
The user
|
|
13
|
+
The user invokes this skill with either a plan file path/identifier or a direct request like "add a login button."
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
4. **Natural-language request** (for example, contains spaces or reads like an implementation task): treat it as the implementation request. There may be no separate plan file.
|
|
19
|
-
5. **No argument given**: ask the user to provide either the plan file path or the implementation request. Do not guess.
|
|
15
|
+
- **Path-like input** (absolute, relative, or bare name): try to read it. For bare names, check the host's plans directory first. Resolve the path first; if it lies outside the workspace/repo or the host's plans directory, ask the user to confirm before reading it (applies to both absolute and relative inputs — `..` escapes count). If the input doesn't resolve to a readable file, stop and tell the user — do not reinterpret a missing path as a direct request.
|
|
16
|
+
- **Natural-language request**: treat as the implementation task. There may be no plan file.
|
|
17
|
+
- **No argument**: ask for either a plan path or the implementation request.
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
When using a plan, read it fully before starting. Note **Critical files**, **Approach**, and **Verification** sections (or equivalents).
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
## Phase 2: Implement
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
The plan or request is the source of truth for scope:
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- If you discover the request is wrong (the codebase has moved, an assumption is invalid, a constraint was missed), stop and report. Do not silently rewrite the approach.
|
|
32
|
-
- For direct implementation requests, inspect the relevant code before editing and use the repo's existing patterns.
|
|
33
|
-
- Do **not** modify the plan file itself when working from a plan.
|
|
25
|
+
- Make exactly the changes requested — no extra refactors, tests, or cleanup.
|
|
26
|
+
- If the plan references files or utilities that no longer exist, stop and report.
|
|
27
|
+
- If an assumption is invalid or a constraint was missed, stop and report. Do not silently rewrite the approach.
|
|
28
|
+
- Do not modify the plan file itself.
|
|
34
29
|
|
|
35
30
|
## Phase 3: Validate
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
1. **Repo instructions.** Look up the repo's standard validation guidance. Common signals, in priority order:
|
|
42
|
-
- An explicit instruction in the repo's agent or contributor instructions, such as `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, or an equivalent host-specific instruction file (e.g. "MUST run before opening PRs"). This wins over everything else.
|
|
43
|
-
- A relevant `package.json` script when the repo instructions point to it, such as `affected`, `precommit`, `validate`, `check`, `verify`, `test`, `lint`, `typecheck`, or repo-equivalent.
|
|
44
|
-
- A repo-specific equivalent in the rare case the project does not use `package.json`.
|
|
45
|
-
|
|
46
|
-
If the repo primarily relies on git pre-commit or pre-push hooks and does not mandate a manual validation command, do not invent one. Let the hooks run during the `commit-push-pr` handoff.
|
|
47
|
-
|
|
48
|
-
2. **Request-specific verification.** If the plan or user request names specific checks, run them when they are practical and consistent with the repo instructions. If a requested check is clearly a slow CI-only suite, ask before running it.
|
|
49
|
-
|
|
50
|
-
If any check you run fails, fix the failures and re-run the same check. Do not hand off to `commit-push-pr` with known failing checks unless the user explicitly accepts a pre-existing or unrelated failure.
|
|
32
|
+
- Read `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, or equivalent contributor instructions for the mandated pre-PR command (e.g. `npm run affected`). That wins over everything.
|
|
33
|
+
- If the repo relies on pre-commit/pre-push hooks and mandates no manual command, don't invent one — let the hooks run during the `commit-push-pr` handoff.
|
|
34
|
+
- If the plan names specific checks, run them when practical. Ask before running anything that's clearly a slow CI-only suite.
|
|
51
35
|
|
|
52
|
-
|
|
36
|
+
Fix any failures before handing off. Do not hand off with known failing checks unless the user explicitly accepts a pre-existing or unrelated failure.
|
|
53
37
|
|
|
54
|
-
|
|
38
|
+
## Phase 4: Hand Off
|
|
55
39
|
|
|
56
|
-
Do
|
|
40
|
+
Invoke the `commit-push-pr` skill. Do not commit, push, or open the PR yourself.
|
|
57
41
|
|
|
58
|
-
If `commit-push-pr` reports `nothing to ship
|
|
42
|
+
If `commit-push-pr` reports `nothing to ship.`, surface that.
|
|
59
43
|
|
|
60
44
|
## Phase 5: Final Output
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
Ensure the user sees the branch name and full PR URL.
|