From 234a1e547b1353ed94123136d9871a923f118d6f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 23 Nov 2026 10:40:10 +0100 Subject: [PATCH] :paperclip: Update several skills --- .agents/skills/code-review-criteria/SKILL.md | 10 +- .agents/skills/issue-walkthrough/SKILL.md | 141 +++++++++++++++++++ .agents/skills/review-code/SKILL.md | 86 +++++------ .agents/skills/review-plan/SKILL.md | 60 ++++---- 4 files changed, 225 insertions(+), 72 deletions(-) create mode 100644 .agents/skills/issue-walkthrough/SKILL.md diff --git a/.agents/skills/code-review-criteria/SKILL.md b/.agents/skills/code-review-criteria/SKILL.md index af926a26e2..6c6a1840ef 100644 --- a/.agents/skills/code-review-criteria/SKILL.md +++ b/.agents/skills/code-review-criteria/SKILL.md @@ -10,11 +10,11 @@ the diff in context, its intent and relevant tests. Follow project conventions and module memories. Do not block on personal preferences or invent problems. Apply each axis in proportion to the change and its risks. -Follow `review-code` for delegation and its read-only contract. Never run tests, -builds, linters or other state-changing checks during a review or follow-up. -Inspect prior test results or CI evidence when available. Identify their source -and scope; if evidence is missing, stale or inaccessible, say what is -unverified. Never claim a suite passed without evidence. +Follow `review-code` for delegation, read-only rules and the exception for a +focused check in a temporary worktree. Inspect prior test results or CI +evidence when available. Identify their source and scope; if evidence is +missing, stale or inaccessible, say what is unverified. Never claim a suite +passed without evidence. ## Review axes diff --git a/.agents/skills/issue-walkthrough/SKILL.md b/.agents/skills/issue-walkthrough/SKILL.md new file mode 100644 index 0000000000..67ef4e7fb4 --- /dev/null +++ b/.agents/skills/issue-walkthrough/SKILL.md @@ -0,0 +1,141 @@ +--- +name: issue-walkthrough +description: Walk through findings or open questions one decision at a time. Record clear resolutions without asking. Return decisions to the calling review or offer to prepare a plan where appropriate. Never edit or implement. +--- + +# Issue Walkthrough + +Turn a list of findings or open questions into a decision table. Ask the user +only about decisions the evidence cannot settle. Record clear resolutions +without applying them. + +## When to use + +- I ask to go through the findings of a review, one by one. +- I ask to discuss a list of issues or open questions and decide each one. +- I ask what to do about something and want options, not an implementation. +- I mention `@issue-walkthrough`. + +## Hard rules + +- **Read-only for the whole walkthrough.** No edits, no commits, no builds, no + test runs that change state. Read-only commands, reads and `SELECT`s are fine. + Any later edits belong to a separate flow, not to this walkthrough. +- **One issue per turn.** Explain it, ask, and wait. Do not queue the next + explanation in the same message. +- **Never implement.** Not even the "obvious one-line" fix derived from an item. +- **Never invent a finding.** Before presenting an item, check it in the code. + If it does not hold, say so and drop it. +- **Do not merge items** to finish faster. Only group two items when they share + the same decision and the same context. + +## Before the first issue + +1. Fix the list of items and keep their IDs (`R1`, `M2`, `L3`, …). The IDs are + how we refer to each decision later, in the plan and in the commits. +2. Verify each item against the relevant code, plan, or other available + evidence. Say when the evidence is insufficient; do not run tests to fill + that gap. +3. Read relevant earlier plans, project guidance and decisions, if they exist. + If an item reopens something already decided, say it before asking: the + decision, its date, and what changed since. +4. Separate **Decisions to ask** from **Clear resolutions**. For each clear + resolution, show its ID, proposed remedy, and a short reason it follows + from the evidence or an agreed decision. Do not ask about it or describe + it as applied. Ask when the remedy would change scope or intended behavior, + reopen a decision, or require choosing between meaningful tradeoffs. +5. Show the order of the questions by ID and title, then ask the first one. + If none remain, skip the question round and go to closing. + +## Per issue: the fixed shape + +In this order, in plain words: + +**Starting situation.** State the goal of this part of the system. Name the +objects involved, their roles and initial state, and what action or condition +brings this case about. Say what normally happens and what is different here. +Separate facts and earlier decisions from assumptions and example values. If +an unconfirmed assumption changes the scope or the options, ask about that +assumption first and wait before asking about its consequences. + +**What happens.** The situation, with `file:line` and the failing case. When it +exists, the evidence goes here: the test error, the measured query, the +`EXPLAIN`. Explain why the case can occur and what the evidence shows. If the +case is hypothetical, say so. Explain every technical term the first time. + +**Why it matters.** What breaks, for whom, and when. If it never breaks and is +only cost or consistency, say exactly that. Never inflate an item. + +**Options.** Two to four real options. For each: what changes, cost, and risk. +Include "do nothing" when it is a real choice. When an option contradicts an +earlier decision of mine, say so with the decision and its date. + +**Recommendation.** One option and the reason, in two or three sentences. + +Then ask, and stop. + +## The question + +- One `question` call per issue, unless two items share the same decision and + context. If the tool is unavailable, ask in the conversation and wait. +- The recommended option goes first and is marked `(Recommended)`. +- Labels are short (1-5 words) and readable without the explanation. +- Every description says what the option makes the system do and its practical + consequence (downtime, data, operator work, future maintenance). +- Never ask about something the code or the plan can settle alone. + +## When I override the options + +My free-form answer wins. Do not re-ask, do not argue, do not treat my previous +answer as valid if I said I did not understand. + +- Restate the resulting shape in one or two sentences — the concrete SQL, + function, text or command you would write — so I can confirm you understood. +- If the override creates a new consequence or an extra decision, explain it + before the next issue. +- Record exactly what I said, not the option label. + +## When I ask for more context + +Address the premise the user is questioning before giving another example or +repeating the decision. Restate the objects, their starting state, and why +the case can happen. Explain when it does not matter. Then ask only about +what is still undecided. Do not move to the next item until the current one +has an answer. + +## Closing and handover + +When every item has a decision: + +1. Print the decision table: `ID | finding | decision | task sketch`. One row + per item, including clear resolutions and any "do nothing" decisions, with + the reason. Distinguish user decisions from clear resolutions. +2. Say which items are fixed requirements and which are optional. +3. In **decisions-only** mode, return the table to the calling flow and stop. + Do not offer planning or make edits. The caller owns any follow-up. +4. Otherwise, if there is work to plan and `@make-a-plan` accepts the scope + under the project rules, use `question` if available (ask in the + conversation if not) to offer **Prepare a plan** or **Stop**. Hand over the + table only if the user chooses to plan. Carry forward the agreed decisions + and clear resolutions without reopening them. +5. If planning does not apply, return the table and stop. Do not apply it; + direct corrections require a separate request. + +## Check before each turn + +Read your own message as someone who does not know this code: + +- Can I decide with what is on screen, without opening the editor? +- Do I know what objects are involved, their starting state, and what brings + this case about before I read the problem or the question? +- Is the failing case concrete, and is the reason it is real shown? +- Is there a recommendation, and does it say why this option and not another? +- On a decision turn, is there exactly one question, with the recommended + option first? +- Did you touch a file? It must be no. + +## User context + +Text passed after `@issue-walkthrough` can supply the findings or open +questions, a review reference, a plan path, or a scope limit. Explicit input +overrides session inference but never higher-level instructions. diff --git a/.agents/skills/review-code/SKILL.md b/.agents/skills/review-code/SKILL.md index 564db4faa8..bbb5f745a6 100644 --- a/.agents/skills/review-code/SKILL.md +++ b/.agents/skills/review-code/SKILL.md @@ -1,7 +1,6 @@ --- name: review-code description: Code review flow — review a diff, PR, or code change, delegating the review to a subagent that follows the code-review-criteria skill. Use it when the user asks to review code or a PR, in any phrasing. -slash: true --- # Review Code @@ -21,20 +20,18 @@ Act as a senior software engineer and perform a thorough code review. 1. **Determine what is being reviewed** from the user context: a working-tree diff, a commit range, a branch, a PR (number or URL), or specific files. If the target is ambiguous, ask before reviewing. -2. Delegate the review to the `general` subagent (via the task tool), unless the - user specifies another agent. The prompt carries the **`code-review-criteria`** - skill name, all user context, and these requirements: +2. Delegate the review to `general` unless the user specifies another + subagent. Pass all relevant user context, the read-only rules and isolated + verification exception below, and these instructions: - Load `code-review-criteria` and follow its process and output format. - Read `AGENTS.md` (if present) and the module memories it points to for the code being reviewed. - Return the COMPLETE review, verbatim, exactly as the skill instructs it to be produced. Never summarize it. - - Read-only: modify no file, create no commit, and run no tests, builds, - linters or other state-changing checks. Use prior results or CI evidence; - state explicitly when evidence is unavailable. + - Use prior results or CI evidence first; state any limits on verification. - Do not invent problems: every finding must be real and actionable. - - Missing tests are an issue, not a suggestion — a severity-tagged finding. - - For each finding, give a concrete remedy and the tests needed to verify it. + - Missing required tests are a finding, not a suggestion. + - For each finding, give a concrete remedy and the verification it needs. If a user decision is needed, include the real options and a recommendation in that finding. Do not pause to ask during the review. - Prioritize by impact: one structural issue outweighs ten nits, and "this @@ -45,49 +42,54 @@ Act as a senior software engineer and perform a thorough code review. summarize it and do not act on its findings. Retain the subagent session ID, review target and complete findings in the session context for follow-up; do not invent an ID if the tool does not provide one. -4. Right after the review, suggest how to proceed based on the findings. These - are suggestions — the user decides: - - **Approve (no required changes):** say so — there is nothing to address. - - **Minor findings:** suggest direct fixes after the user ends the review if - appropriate; no plan is required. - - **Substantive findings:** suggest `@make-a-plan` to make a plan to address - them. - - If the user wants to discuss findings one by one, use `@issue-walkthrough` - on request; do not start it automatically. The walkthrough returns its - decisions to `@make-a-plan`, not to automatic code editing. +4. If there are no findings, say so and stop. Otherwise, use `question` if + available (ask in the conversation if not) to offer these next steps: + - **Walk through findings:** start `@issue-walkthrough` only if the user + chooses it. Pass the findings and their IDs. Let the walkthrough offer + planning or stopping once it has recorded the decisions. + - **Prepare a plan directly:** offer `@make-a-plan` only when its scope and + the project's rules allow it. On selection, hand over the findings and any + existing decisions; do not treat undecided recommendations as agreed. + - **Stop:** end the review without edits. Any direct correction belongs to + a separate task after the review. ### Follow-up after implementation When the user agrees to verify corrections, resume the original reviewer using its session ID if the tool supports it. Give it the original review target and -findings, the decisions and plan, the exact correction commit range or diff, -and the test evidence. Require it to inspect the actual corrections and -evidence, not rely on its earlier context alone. If the original session is -unavailable or cannot be resumed, tell the user and delegate to a new reviewer -with the same context; never claim it is the original reviewer. If the review, -decisions or correction range cannot be established, ask for the missing -information rather than inventing it. +findings, and the exact correction commit range or diff. Include decisions, +the plan, and verification evidence if they exist. Require it to inspect the +actual corrections and evidence, not rely on its earlier context alone. +State what cannot be verified rather than assuming a result. If the original +session is unavailable or cannot be resumed, tell the user and delegate to a +new reviewer with the same context; never claim it is the original reviewer. +Ask for missing information only if it is needed to identify the original +review or check the correction. The reviewer follows `code-review-criteria` and remains read-only. It reports each original finding with its unchanged ID as **resolved**, **pending**, or **not addressed** (including the agreed reason); report any new problems with new, non-conflicting IDs. For pending and new problems, give evidence, a remedy, -tests and any user decision as in the original review. Summarize separately -whether all agreed corrections are resolved and whether any findings remain, -including deferred findings. Do not equate deferred with resolved. Present the -result without implementing fixes; the user chooses whether to iterate, request -an independent review, or stop. +appropriate verification and any user decision as in the original review. +Summarize separately whether all agreed corrections are resolved and whether +any findings remain, including deferred findings. Do not equate deferred with +resolved. Present the result without implementing fixes; the user chooses +whether to iterate, request an independent review, or stop. ### Hard rule — read-only while reviewing -This flow is read-only **for the duration of the review**: from the moment it -starts until the user considers the review finished (including any feedback, -questions, or clarifications about it). During that period, never fix, -implement, edit files or create commits — not even "obvious" fixes derived from -the findings. Never run tests, builds, linters or state-changing checks during -the review; inspect existing evidence instead. Once the user explicitly states -the review is done (or moves on to a different task), this rule no longer -applies and you act as a normal build agent again. +Never fix findings, implement changes, create commits, or alter the user's +working tree or index during a review or follow-up. Inspect the diff and use +existing test or CI results. Do not rerun the test suite. + +If existing evidence cannot settle a specific finding, a focused empirical +check may run without asking in a temporary detached Git worktree created for +the review, subject to the usual tool permissions. +Use the exact version under review, including uncommitted changes if they can +be reproduced without altering the user's working tree or index. Keep any +check artifacts in that worktree and remove it afterward. Do not use a worktree +as a security sandbox. If the version cannot be reproduced or the check cannot +run in isolation, report the limit instead of running it in the user's worktree. ## Posting as a GitHub comment @@ -97,8 +99,8 @@ session. PR comments go in English, with this minimal structure: 1. **Intro line** — one sentence: what was found and the overall tone. No greetings. 2. **`## Main issues`** — one subsection per required finding: what breaks, the - failure circumstances, and the minimal fix (code snippet when useful). A - missing test belongs here, not under minor suggestions. + failure circumstances, and the minimal fix (code snippet when useful). + Missing required tests belong here, not under minor suggestions. 3. **`## Minor suggestions`** — one bullet per minor finding: file/function, problem, concrete remedy. 4. **Closing** — optional and short. Cut it when it adds nothing. @@ -109,4 +111,4 @@ unambiguously. ## User input, overrides and additional context -$ARGUMENTS +Take the review target, focus, and overrides from the user's message. diff --git a/.agents/skills/review-plan/SKILL.md b/.agents/skills/review-plan/SKILL.md index b4beb20641..abcd704073 100644 --- a/.agents/skills/review-plan/SKILL.md +++ b/.agents/skills/review-plan/SKILL.md @@ -1,7 +1,6 @@ --- name: review-plan description: Review an implementation plan with a subagent, apply clear improvements and resolve consequential decisions with the user. -slash: true --- # Review Plan @@ -16,10 +15,12 @@ implementing it. Use this flow when the user asks for a plan review or invokes ambiguous, ask. If no saved file exists, ask for a path or have the user save it first. Do not edit a completed plan: propose a derived plan instead. 2. Delegate to `general`, unless the user specifies a different subagent or - model. Supply the plan path, relevant session context and these instructions: - - Load `plan-review-criteria`, read `AGENTS.md` and the relevant module and - testing memories, and review the plan against the criteria. - - Apply clear, evidence-based improvements directly to that plan file only. + model. Supply the plan path, relevant session context, whether editing is + permitted, and these instructions: + - Load `plan-review-criteria` and consult the project's instructions and + relevant guidance, if present. Review the plan against the criteria. + - If editing is permitted, apply clear, evidence-based improvements + directly to that plan file only. Otherwise, propose them without editing. Preserve the goal, scope, agreed decisions and intended behavior. Examples: clarify tasks, add missing tests, correct dependencies and specify actual verification commands. Do not guess commands or invent findings. @@ -33,28 +34,37 @@ implementing it. Use this flow when the user asks for a plan review or invokes - Do not change source files, other plans or documents, run state-changing checks, commit, or implement the plan. If the plan is not writable, report this and return the proposed edits instead. -3. Show the summary. If decisions remain, start `@issue-walkthrough` immediately - in the parent session with those questions and their IDs. Follow its one - question per turn and read-only rules. Do not ask questions that the code or - existing decisions settle. Wait for every answer. -4. Resume the same subagent with the decision table and plan path. It applies - the decisions to the plan, rechecks consistency and reports changes and any - newly discovered consequential decisions. Repeat the walkthrough for new - decisions, then apply those answers. If the original session cannot be - resumed, tell the user and apply the changes in the parent or delegate a new - subagent with the full context. If the reviewer cannot write, apply its - proposed edits in the parent only if the plan file is writable; otherwise - explain the blocker and stop. -5. Once all decisions are resolved and the plan is coherent, update its - metadata: when review feedback changed the plan, set `Status: reviewed` and - append one UTC ISO 8601 `Review Log` entry for this review, summarizing the - changes. Preserve prior log entries. If no feedback changed the plan, leave - status and log unchanged. Never record commit hashes. If decisions or - required changes remain unresolved, do not claim the plan is ready or mark - it reviewed. +3. Show what changed and list the remaining questions by ID. If any remain, + use `question` if available (ask in the conversation if not) to offer + **Start walkthrough** or **Stop here**. If the user stops, keep the changes + already made and report the unresolved questions without marking the plan + ready. If the user starts, run `@issue-walkthrough` in **decisions-only** + mode in the parent session. Pass the questions and their IDs; wait for the + decision table. The walkthrough does not edit or start another plan. +4. Apply the decisions to the same plan file in the parent session. Then + resume the original reviewer with that file, the decision table, and the + new changes. Ask it to verify the actual edits against each decision by ID + and recheck the affected parts of the plan for consistency. Report any + remaining problems and new questions without editing in this pass. Fix + clear gaps in the parent session and verify again. For new consequential + questions, return to step 3. If the original + reviewer cannot be resumed, tell the user and delegate verification to a + new reviewer with the full context. In read-only mode, report the proposed + changes without applying them or claiming they were verified in the file. +5. Once the plan is ready and review feedback changed it, record the review + only as prescribed by the plan's or project's existing conventions. For + plans that use this skill set's `Status` and `Plan Log`, set + `Status: reviewed` and append one UTC ISO 8601 entry summarizing the + changes, without rewriting entries or recording commit hashes. Do not + introduce a status or log where none is defined. If no feedback changed + the plan, leave its metadata alone. Do not mark a plan reviewed or ready + while required changes or decisions remain unresolved. 6. Show the final summary, plan path and verdict. Suggest `@implement-plan` only when the plan is ready. Never execute the plan automatically. The only permitted write in this flow is the specified local plan file, including its status and log. Do not stage or commit it. If a user instruction -overrides automatic editing, respect it and report findings without editing. +overrides automatic editing, respect it throughout the flow and report +proposed edits instead. If the subagent cannot write, the parent may apply +its proposed edits to the specified file if permitted; otherwise report the +blocker and stop.