@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
$ARGUMENTS
First, use the following to give a hint on this step:
Dispatch the investigation to a sub-agent via the
Agenttool so that no investigation details leak into the user-visible transcript. The sub-agent performs the silent reading and checking; only its final structured return value is consumed here.For this, invoke exactly once the tool:
Agent( name: "ase-docs-proofread", description: "Proofread Investigation", subagent_type: "ase:ase-docs-proofread", mode: "plan", prompt: <getopt-arguments/> )Parse the single result message of the
Agenttool as a JSON array and set to that list.You MUST NOT output anything at all in this step 1 beyond the single
Agenttool invocation.Use the following to give a summary of the detected problems in :
Proofread Type Proofread Result SPELLING: problems found PUNCTUATION: problems found GRAMMAR: problems found Hints:
- is the number of problems with
typeequal toSPELLINGin - is the number of problems with
typeequal toPUNCTUATIONin - is the number of problems with
typeequal toGRAMMARin
- is the number of problems with
Mark this skill as the active edit-capable skill so that the ASE
pre-tool-usehook auto-approves the subsequentEditinvocations on any invocation path (slash command orSkilltool). Call thease_config_set(key: "agent.skill", val: "ase-docs-proofread", scope: "session:<ase-session-id/>")tool from theaseMCP server. Do not output anything in this substep.Critical safety invariant: the marker set here grants
Editauto-approval and MUST be cleared again (substep 3 below) before this skill yields control, regardless of how the iteration in substep 2 ends - whether it completes normally, is aborted early (e.g. anEditfailure, an unparseable value, or any other unexpected condition), or is otherwise interrupted. If you ever stop or bail out of substep 2 early, you MUST still perform substep 3 first. Never leave this marker active for a later, unrelatedEdit.Iterate over all problems:
Set to the
typefield of . Set to thefilefield of . Set to thelinefield of . Set to thedescriptionfield of . Set to thecontext_beforefield of . Set to theold_textfield of . Set to thenew_textfield of . Set to thecontext_afterfield of .Report the problem with the following :
Determine the hunk body as an ordered list of lines, each carrying a one-character prefix (
for context,-for old-side,+for new-side). Build it by concatenating, in order and skipping any part that is empty:- one
-prefixed line for each line of (if non-empty), - one
--prefixed line for each line of (if non-empty; split on newlines), - one
+-prefixed line for each line of (if non-empty; split on newlines), - one
-prefixed line for each line of (if non-empty).
Set to those prefixed lines joined by newlines.
Set to the number of old-side hunk lines, i.e., the combined line count of , , and (each empty part counts as
0). Set to the number of new-side hunk lines, i.e., the combined line count of , , and (each empty part counts as0).Set to the 1-based line number of the first old-side hunk line: if is non-empty, that is its line (one before ); otherwise it is itself (the first line of ). For a hunk that only inserts new lines (empty and empty context), set it to the line before which the insertion happens, clamped to a minimum of
0, so a top-of-file insertion yields@@ -0,0 ... @@. Set to the same value as , but clamped to a minimum of1whenever is greater than0(the corrected side then has a real first line).Render the proposed correction as a unified diff with up to two lines of context in a fenced block based on the following , emitting verbatim (one already-prefixed line per line, with no extra blank or space-only lines):
CORRECTION:
--- <file/> (original) +++ <file/> (corrected) @@ -<old-start/>,<old-count/> +<new-start/>,<new-count/> @@ <hunk-body/>- one
In the following, you MUST NOT use your built-in tool! Instead, you MUST just show a custom dialog according to the expanded
custom-dialogdefinition. You MUST closely follow this definition:Set ACCEPT.
Check and dispatch accordingly:
Invoke the
Edittool to apply the change by replacing with at :. The operation will be auto-approved by the ASEpre-tool-usehook (which tracks the active skill), so no interactive permission prompt will appear. Then continue with the next .Generate a new proposal for the same , incorporating the user's free-text hint from after the "OTHER:" prefix. Reassign , , and to reflect this refined proposal ( stays anchored to the existing text at :; and carry the refinement) so the subsequent rendering and any
Edituse the new proposal rather than the original. Then go back to substep 2 of thisfor-iteration. There is no cap on refinement rounds - keep refining until the user picksACCEPTorREJECT.-
Skip this without any
Editcall and continue with the next .
Clear the active edit-capable skill marker now that all
Editinvocations are done, so a later unrelatedEditis not auto-approved. Call thease_config_delete(key: "agent.skill", scope: "session:<ase-session-id/>")tool from theaseMCP server. Do not output anything in this substep.You MUST NOT output any further additional explanations or summaries at the end of this skill processing, except for the following final :