@shadowclone/skills 0.0.42 → 0.0.44
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: plan-with-review-page
|
|
3
|
-
description: 'Use before a change that touches many files, needs many steps, or has open design choices. Also use it when the user says "plan this first", "
|
|
3
|
+
description: 'Use before a change that touches many files, needs many steps, or has open design choices. Also use it when the user says "plan this first", "make a plan", "think this through", or "do not code yet". Explores the code read-only, asks the open decisions with the recommended option first, and writes one plan. Builds a self-contained HTML review page from a template, and checks the page with a validator. Not for checking finished work (use `verify-and-review`).'
|
|
4
4
|
metadata:
|
|
5
5
|
shadowclone-category: workflow
|
|
6
6
|
shadowclone-section: workflow
|
|
@@ -16,8 +16,8 @@ A change touches many files, needs many steps, or has a design choice that belon
|
|
|
16
16
|
|
|
17
17
|
1. Are you read-only until the user approves? Before approval, write only the plan file and the review page.
|
|
18
18
|
2. Did you read the code, the documents, and the history before you asked? Never ask what the code can answer.
|
|
19
|
-
3. Did you ask
|
|
20
|
-
4. Is each risky behavior choice in
|
|
19
|
+
3. Did you ask in rounds until no decision was open? Each round has at most 4 questions, each with 2 to 4 options and the recommended option first.
|
|
20
|
+
4. Is each risky behavior choice in a round, such as a skip, a block, a fallback, or a default?
|
|
21
21
|
5. Is there one plan file for this conversation, with each skipped step still visible and its reason?
|
|
22
22
|
6. Does the review page pass `scripts/validate-page.mjs` with 0 errors?
|
|
23
23
|
|
|
@@ -27,21 +27,24 @@ A change touches many files, needs many steps, or has a design choice that belon
|
|
|
27
27
|
|
|
28
28
|
1. Read the code that the request touches, and the instructions of the repository for that code.
|
|
29
29
|
2. Find the functions and patterns that the change can use again.
|
|
30
|
+
3. For a broad search, use a read-only subagent if the host has one.
|
|
31
|
+
4. Stop when you can name the change, its tests, and what users would see break. Write each follow-up as one line in the plan. Do not research a follow-up first.
|
|
30
32
|
|
|
31
33
|
### Ask
|
|
32
34
|
|
|
33
35
|
1. List each open decision about scope, behavior, edge cases, data, release, and tests.
|
|
34
|
-
2. Ask
|
|
35
|
-
3.
|
|
36
|
+
2. Ask at most 4 questions in each round. Put the recommended option first, with one reason.
|
|
37
|
+
3. Use the question tool of the host if it has one. If not, use a numbered list in the chat.
|
|
38
|
+
4. If an answer is not clear or opens a new decision, ask another round. Do not guess.
|
|
36
39
|
|
|
37
40
|
### Write
|
|
38
41
|
|
|
39
|
-
1. Put the plan at `/tmp/agent-artifacts/<repo>/<date>-<slug>/plan.md`. If the sandbox blocks `/tmp`, use the temporary folder of the agent.
|
|
40
|
-
2. Write the context, the decisions with their source, the approach
|
|
42
|
+
1. Put the plan at `/tmp/agent-artifacts/<repo>/<date>-<slug>/plan.md`. If the sandbox blocks `/tmp`, use the temporary folder of the agent. If the host gives a plan file path, use it for the plan and keep the review page in `/tmp/agent-artifacts/`.
|
|
43
|
+
2. Write the status (draft, approved, in progress, or done), the context, the decisions with their source, and the approach. Then write the files, the steps, and the verification commands. Name the files to change. For a change that repeats across many files, describe the pattern once and list a few example paths.
|
|
41
44
|
3. Copy `assets/review-page.html` to the same folder as `index.html`. Edit only the JSON block with the id `plan`, and replace each value that starts with `TEMPLATE:`.
|
|
42
45
|
4. Add Mermaid source in `diagram` when the change has more than two parts. The page shows the source as text, and draws it when the pinned Mermaid file loads.
|
|
43
46
|
5. Run `node scripts/validate-page.mjs <page>`. If Node is not available, run the script with `bun`. Fix each error.
|
|
44
|
-
6. Give the user both paths, the approach, and the main risk. Wait for approval.
|
|
47
|
+
6. Give the user both paths, the approach, and the main risk. If the host has a plan approval step, use it. If not, ask "Do you approve this plan?" Wait for approval in this conversation.
|
|
45
48
|
|
|
46
49
|
### Execute
|
|
47
50
|
|
|
@@ -69,5 +72,5 @@ A change touches many files, needs many steps, or has a design choice that belon
|
|
|
69
72
|
|
|
70
73
|
- The plan path and the review page path.
|
|
71
74
|
- The validator command and its result line.
|
|
72
|
-
-
|
|
75
|
+
- Each question round, with the recommended option first in each question.
|
|
73
76
|
- Each step with its status, and each skipped step with its reason.
|
|
@@ -15,7 +15,7 @@ You fix a bug, a regression, or a review finding that you confirmed. Only a repr
|
|
|
15
15
|
|
|
16
16
|
## Gates
|
|
17
17
|
|
|
18
|
-
1. Did you reproduce the issue before you changed code, with a test, a real command, or the real interface?
|
|
18
|
+
1. Did you reproduce the issue before you changed code, with a test, a real command, or the real interface? If the fix already exists, a test that fails when you undo the smallest part of the fix counts as the reproduction.
|
|
19
19
|
2. After the fix, does the same reproduction show the expected result?
|
|
20
20
|
3. If you could not reproduce the issue, did you label the cause as inferred, with the data and code that support it?
|
|
21
21
|
4. Does each changed line serve the fix, or a test or check that the fix needs?
|
|
@@ -32,11 +32,12 @@ Write in the user's voice. Before you write, read `~/.agents/voice.md`. If it do
|
|
|
32
32
|
- the real command in a temporary home, or
|
|
33
33
|
- the real interface, such as browser or desktop automation when the host has it.
|
|
34
34
|
3. Keep the reproduction and its wrong output, because you run it again after the fix.
|
|
35
|
-
4.
|
|
36
|
-
5.
|
|
37
|
-
6. Run the
|
|
38
|
-
7.
|
|
39
|
-
8.
|
|
35
|
+
4. For a performance problem, measure the cost of the suspect and compare it with the size of the symptom before you build a fix.
|
|
36
|
+
5. Find the cause in the code that the reproduction runs. Fix it at the boundary that owns it.
|
|
37
|
+
6. Run the same reproduction. It must now show the expected result.
|
|
38
|
+
7. Run the formatter and the linter on each touched file. Then run the focused tests and the required check of the repository.
|
|
39
|
+
8. Read the diff. Remove each line that does not serve the fix or its proof.
|
|
40
|
+
9. If reproduction is impossible, say why. Reason from logs, data, and code, and label the conclusion as inferred.
|
|
40
41
|
|
|
41
42
|
## Example
|
|
42
43
|
|
|
@@ -53,6 +54,12 @@ Write in the user's voice. Before you write, read `~/.agents/voice.md`. If it do
|
|
|
53
54
|
- Refactor only when the fix or its proof needs it.
|
|
54
55
|
- Do not add a guard for a case that cannot happen. Fix the cause of a case that can.
|
|
55
56
|
- Put each later review round in its own commit.
|
|
57
|
+
- List each defensive, style, or unrelated change as an optional follow-up. Never bundle it with the fix.
|
|
58
|
+
- If you chose to escape a check that flags false positives, do not add the same check somewhere else as a safety net.
|
|
59
|
+
- If a change proves marginal or causes a regression, revert it. Do not defend it.
|
|
60
|
+
- Ask before a side change that the request does not cover. Do not replace the choice of the user with your own.
|
|
61
|
+
- Say once what is wrong with a direction. After the user chooses, build that choice.
|
|
62
|
+
- In plan mode, write the plan and wait for approval before you edit code, even for a small fix.
|
|
56
63
|
|
|
57
64
|
## Completion
|
|
58
65
|
|
|
@@ -60,4 +67,5 @@ Write in the user's voice. Before you write, read `~/.agents/voice.md`. If it do
|
|
|
60
67
|
- The same reproduction after the fix, with the expected output.
|
|
61
68
|
- The focused test command and the required check, with their result lines.
|
|
62
69
|
- Each changed file, with the reason that it is in scope.
|
|
70
|
+
- Each check that you did not run, with the reason. Never call a check green if you did not run it.
|
|
63
71
|
- For an issue that you could not reproduce: the reason, and the evidence for the inferred cause.
|
|
@@ -47,7 +47,7 @@ You are about to say that a change is done, fixed, or ready for review. A questi
|
|
|
47
47
|
- Report each failure that existed before your change apart from new failures, with the evidence that it existed before.
|
|
48
48
|
- Keep captured user content and secrets out of the report.
|
|
49
49
|
- Keep unrelated work in the worktree. A worktree with other changes is not a reason to delete them.
|
|
50
|
-
-
|
|
50
|
+
- Report execution evidence and agent limitations in chat or local handoff notes. Do not add them to a pull request description unless the user asks for them.
|
|
51
51
|
|
|
52
52
|
## Completion
|
|
53
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify-review-findings
|
|
3
|
-
description: 'Use when a pull request has review comments or bot findings to check. Also use it
|
|
3
|
+
description: 'Use when a pull request has review comments or bot findings to check or address. Also use it for "are these comments right?", "triage the review", "address the review comments", "check the PR comments", or "check what the bot found". Checks each finding against the code at the head of the pull request, and confirms the file, the line, and the claim. Fixes each confirmed finding without waiting, replies by fixed rules, and reports each verdict. Asks the user before it declines a human comment. Not for writing a fix from a bug report (use `scope-confirmed-changes`).'
|
|
4
4
|
metadata:
|
|
5
5
|
shadowclone-category: review
|
|
6
6
|
shadowclone-section: workflow
|
|
@@ -13,47 +13,60 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
A pull request has review comments, bot findings, or a list of issues from another agent. A finding is a claim, not a fact. Check each one before you change code or reply.
|
|
15
15
|
|
|
16
|
+
This skill follows `shadowclone-work` for fixes, commits, pushes, and fix replies. It differs from `shadowclone-work` only in how it declines a finding. A wrong AI finding gets a one-line reply. A human comment is declined only after the user decides.
|
|
17
|
+
|
|
16
18
|
## Gates
|
|
17
19
|
|
|
18
20
|
1. Did you read each finding at the head commit of the pull request? A finding about an older commit can be stale.
|
|
19
|
-
2. For each finding, do the file and the line exist, and does the code
|
|
21
|
+
2. For each finding, do the file and the line exist, and does the code around them do what the finding says? A finding can be right about the problem and wrong about the place.
|
|
20
22
|
3. Can you show the claim with a test, a command, or the code itself? If not, label it as not verified.
|
|
21
23
|
4. Did you ask what each suggested fix would break, such as a caller, a test, or a documented behavior?
|
|
22
|
-
5. Does each finding have a verdict: confirmed, partly right, wrong, stale, or not verified?
|
|
23
|
-
6. Did you
|
|
24
|
+
5. Does each finding have a verdict: confirmed, partly right, pre-existing, wrong, stale, or not verified?
|
|
25
|
+
6. Did you fix each confirmed finding, reply on its thread with the commit SHA only, and ask the user before you declined a human comment?
|
|
24
26
|
|
|
25
27
|
## Process
|
|
26
28
|
|
|
27
29
|
Write in the user's voice. Before you write, read `~/.agents/voice.md`. If it does not exist, build it once from the user's merged pull requests, review comments, and commit messages. Use only text that the user wrote, and name those sources in your handoff. Never overwrite an existing or linked `voice.md`.
|
|
28
30
|
|
|
29
|
-
1. Fetch the pull request
|
|
30
|
-
2.
|
|
31
|
-
3.
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
34
|
-
6.
|
|
35
|
-
7.
|
|
36
|
-
8.
|
|
31
|
+
1. Fetch the head of the pull request from `origin`, because the local tree can be on another branch. Write down the commit hash.
|
|
32
|
+
2. Read the comments without their analysis blocks. Bot comments hold long `<details>` blocks. Remove them with `perl -0pe 's{<details>.*?</details>}{[analysis omitted]}gs'`. Inline comments come from `gh api repos/<owner>/<repo>/pulls/<number>/comments` and carry `path` and `line`.
|
|
33
|
+
3. List each finding in one table, with its source (a human or an AI reviewer), its `file:line`, and its claim.
|
|
34
|
+
4. For each finding, read the code at that location and its callers. Compare the claim with the real behavior.
|
|
35
|
+
5. When the claim is about behavior, run a focused test or a command that shows it.
|
|
36
|
+
6. For each suggested fix, list what it changes for callers, tests, and users. A fix that is right in one place can break another place.
|
|
37
|
+
7. If a finding is true but the same problem existed before this change, give it the verdict pre-existing. Leave it out of the fix, and say so in the report.
|
|
38
|
+
8. Give each finding a verdict, with the evidence that supports it.
|
|
39
|
+
9. If a finding is confirmed or partly right, fix the confirmed part without waiting for the user. Use `scope-confirmed-changes` to keep the fix small. Follow `shadowclone-work` to commit in the pull request that owns the code, restack if needed, and push.
|
|
40
|
+
10. After the final push, reply to each fixed thread with only the full 40-character SHA of the commit that fixed it. Write nothing else. This applies to human and AI threads.
|
|
41
|
+
11. Resolve each fixed AI thread with the `resolveReviewThread` mutation in `gh api graphql`. Leave each fixed human thread open for its reviewer.
|
|
42
|
+
12. If an AI finding is wrong or stale, reply with one line that declines it and gives the reason. Leave the thread open.
|
|
43
|
+
13. If you would decline a human comment, do not reply. Report the comment and your reason to the user, and wait for the user's decision.
|
|
44
|
+
14. Report to the user: each fix with its SHA, each declined AI finding with its reason, and each human comment that waits on a decision. Count the open threads again, and list them. An open thread blocks the merge when the repository requires resolved conversations.
|
|
37
45
|
|
|
38
46
|
## Example
|
|
39
47
|
|
|
40
48
|
**Situation:** A review bot says that a function can return null and crash its caller. It suggests a null check.
|
|
41
49
|
**Easy route:** Add the null check, and reply "Fixed".
|
|
42
50
|
**Hidden cost:** The function never returns null, because a type guard on the line above handles that case. The extra check hides the real contract, and the reply tells the reviewer something false.
|
|
43
|
-
**Best route:** Read the function at the head commit, and run its test with an empty input.
|
|
44
|
-
**Evidence:** The test with the empty input passed at the head commit. The
|
|
51
|
+
**Best route:** Read the function at the head commit, and run its test with an empty input. Give the finding the verdict "wrong", and reply with one line that names the guard.
|
|
52
|
+
**Evidence:** The test with the empty input passed at the head commit. The reply read "Declining: the type guard at `parse.ts:41` returns before the value can be null."
|
|
45
53
|
|
|
46
54
|
## Guardrails
|
|
47
55
|
|
|
48
|
-
- Never
|
|
56
|
+
- Never decline a human comment before the user decides.
|
|
57
|
+
- A fix reply is the commit SHA only. A declined AI finding gets one line with the reason. Write no other words on the pull request.
|
|
49
58
|
- Do not accept a finding because a bot or a senior reviewer wrote it. Do not reject it for that reason either.
|
|
50
59
|
- Quote the code that proves each verdict. Do not paraphrase it.
|
|
51
60
|
- Keep each finding separate. Do not merge two findings into one verdict.
|
|
52
|
-
- A finding that you cannot check stays "not verified" in the report.
|
|
61
|
+
- A finding that you cannot check stays "not verified" in the report, and gets no reply.
|
|
62
|
+
- A resolved or addressed marker is not proof. A bot can mark a finding as addressed because the commit was in the range it reviewed. Check the head.
|
|
63
|
+
- If the reason to decline is a claim about behavior, run a command that tests the claim before you reply.
|
|
53
64
|
|
|
54
65
|
## Completion
|
|
55
66
|
|
|
56
67
|
- The head commit hash that you checked.
|
|
57
68
|
- A table row for each finding: the source, the `file:line`, the claim, the verdict, and the evidence.
|
|
58
69
|
- Each command or test that you ran, with its result line.
|
|
59
|
-
- For each
|
|
70
|
+
- For each fix, its commit SHA and what it changes for callers and tests.
|
|
71
|
+
- For each thread, the reply and its resolved state. Each thread that stays open, with the reason.
|
|
72
|
+
- Each human comment that waits on the user's decision, with the reason to decline it.
|