rse/ase / plugin/skills/ase-spec-lint
ase-spec-lint
VerifiedLint the SpecBook-based specification (SPEC) for potential quality problems: its syntax, its formatting, its statements, the logical gaps of its model, and its completeness for an implementation. Use when the user wants to "lint" or "check" the "spec" or "specification".
@${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
-
The project source artifacts are classified as a black box, so the user does not want them inspected or their problems surfaced (the
--forceoption lifts this skip). Skip the entire investigation and reporting: do not invoke anyBash,Glob, orAgenttool and do not read any source, only output the following and then SKIP the remaining steps STEP 2 and STEP 3:Set true if is equal
greyand is not equaltrue, and false otherwise: a condensed report suppresses the full unified diffs of STEP 3.First, determine the effective aspect set , i.e., the specification quality aspects which are checked at all. For this, parse and as comma-separated token lists, silently dropping the
nonesentinel and any empty token. If a token is not one of the aspect idsS01...S10, only output the following and then STOP the entire flow (do not perform any further steps):Otherwise set to all ten aspect ids
S01...S10if both lists are empty, to the include list if only it is non-empty, to all ten minus the exclude list if only it is non-empty, and to the include list minus the exclude list if both are non-empty. If the resulting is empty, only output the following and then STOP the entire flow (do not perform any further steps):Then split into the per-file aspects (those of
S01...S06) and the model-wide aspects (those ofS07...S10), as the latter can be judged on the entire specification model only.Then, use the following to give a hint on this step:
Dispatch the investigation to sub-agents via the
Agenttool so that no investigation details leak into the user-visible transcript. The sub-agents perform the silent reading and checking; only their final structured return values are consumed here.For this, first silently resolve the
SPECartifacts by calling thease_artifact_list(kind: [ "spec" ])tool of theaseMCP server once and set to the returned project-relative file list. If is empty, only output the following and then STOP the entire flow (do not perform any further steps):Then silently restrict the linting to the changed files of the Git working copy. Set staged and unstaged if both and are equal
true, set staged if only is equaltrue, and set unstaged otherwise. Determine the repository root by running the commandgit rev-parse --show-toplevel(taken exactly as given) and capturing its output into . Then determine the changed files by running the corresponding commands (taken exactly as given), each listing one path relative to per line, and collect all listed paths, dropping duplicates:git -C "<repo-root/>" -c core.quotepath=off ls-files --others --exclude-standardKeep only those listed paths which are contained in . If
<getopt-arguments/>is not empty, keep only those files which lie within the specification referenced by it, expanding any directory or wildcard references with theGlobtool. Set to the resulting list of individual specification files, preserving order.If is empty, only output the following and then SKIP the rest of this STEP 1 and the remaining steps STEP 2 and STEP 3:
Then silently resolve
<getopt-arguments/>to individual files, expanding any directory or wildcard references with theGlobtool, keep only those files which are contained in , and set to the resulting list, preserving order.If is empty (none of the spec-reference resolvable to a specification file), only output the following and then STOP the entire flow (do not perform any further steps):
Then set to , i.e., lint the entire specification.
Then set to the whitespace-separated entries of , or to the single entry
stdif is empty, where each entrystdis replaced by the path of the bundled filemeta/ase-format-specbook.yaml. Set to the space-separated paths of the bundled filesmeta/ase-format-specbook.mdandmeta/ase-tenets.md. Form each bundled file path by joining and the file name with exactly one/separator, as may or may not carry a trailing/.Then dispatch the sub-agents by invoking the following tool once per investigation, emitting all invocations in one single message so they run in parallel:
Agent( description: "Specification Lint Investigation (<index/>/<count/>)", subagent_type: "ase:ase-spec-lint", prompt: "ASPECTS: <investigation-aspects/>\nFILES: <investigation-files/>\nCORPUS: <corpus/>\nMETA: <meta/>\nSCHEMA: <schema/>\nDIAGNOSTICS:\n<investigation-diagnostics/>", run_in_background: false )The investigations are determined as follows:
Here every aspect list is comma-separated (without any spaces), every file list is space-separated, carries one line
- <file/>:<line/>:<column/>: <severity/>: <message/>per diagnostic (or the single line(none)if empty), is the 1-based index of the investigation, and is the total number of investigations, so that each parallel invocation is distinguishable in the progress display.Parse the result message of each
Agenttool invocation as a JSON array and concatenate all those arrays. Determine the anchor of each problem as itsfileandlinefields. Then deduplicate the combined list: when two problems share the same anchor andaspect, silently drop all but the first one (sub-agents may have read overlapping related files for comprehension). Finally sort the list by the anchorfileand then numerically by the anchorline, and set to that list.Then determine the effective severity floor : define the ordinal rank
LOW=1,MEDIUM=2,HIGH=3.Then apply the effective severity floor : Keep a problem in if and only if its
severityfield isACCEPTEDorrank(severity)is greater than or equal torank(<floor/>); silently drop all other problems. With the floorLOW, all problems are kept.ACCEPTEDproblems are never dropped.Finally, sort the surviving problems in by their
severityfield from highest to lowest in the fixed orderHIGH,MEDIUM,LOW,ACCEPTED, so the subsequent reporting starts with the most severe problem. Within the same severity, keep thefile/lineorder established above.You MUST NOT output anything else in this STEP 1.
-
Use the following to output a summary of the detected problems in (if any were found), in the original aspect ordering
S01 - XXX...S10 - XXX.SX - XXX: N issues SX - XXX: N issues [...]
Else, if no problems were found, use the following to output the summary instead:
(no problems detected)
You MUST NOT output anything else in this STEP 2.
-
-
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_state_set(key: "skill", val: "ase-spec-lint", session: "<ase-session-id/>")tool from theaseMCP server. Then call thease_timestamp(format: "yyyy-LL-dd HH:mm")tool of theaseMCP server once to find out the current time and store it in , and set to empty (the list of files changed by an applied correction). Do not output anything in this substep.Critical safety invariant: the marker set here grants
Editauto-approval and MUST be cleared again (substep 4 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 4 first. Never leave this marker active for a later, unrelatedEdit. -
Set to the number of problems in and to
0. Then iterate over all problems:-
Increment by one (the 1-based position of the current within ). Set to the
aspectfield of . Set to theseverityfield of . Set to thedescriptionfield of . Set to`<anchor-file/>`:<anchor-line/>, where is thefileand thelinefield of . Set to thechange-setfield of . Set totrueif starts withS09orS10(a gap-filling best-guess correction), and tofalseotherwise. -
Set (set to empty). Set (set to empty). Set (set to empty).
-
Iterate over the change set:
-
Set to the
filefield of . Set to thechange-hunksfield of .Unless is equal
true(where the full unified diff is suppressed and no context lines are rendered at all), silently read the current content of with theReadtool - reusing the content read for the same earlier in this iteration, unless anEditwas applied to it in between - and set to its lines, stripped of the line-number prefixes the tool adds. Set to empty if the file cannot be read.This content is the authoritative source of the context lines of substep 2 below, so the rendered diff shows real context even when a sub-agent supplied none.
Unless is equal
true(where the full unified diff is suppressed and this per-file header is unused), set to the following : -
Iterate over the change hunks.
-
Set to the
linefield of . Set to thecontext_beforefield of . Set to theold_textfield of . Set to thenew_textfield of . Set to thecontext_afterfield of .Then normalize the hunk to its minimal form, so that the proposed diff shows exactly the lines the later
Editwill actually change: while the first line of is identical to the first line of , move that line from both to the end of and increment by one; likewise, while the last line of is identical to the last line of , move that line from both to the front of . Finally, trim to its last two lines and to its first two lines.Then, whenever is non-empty, re-derive both context parts from it, overriding the sub-agent supplied values: set to the up to two lines of directly before line (empty if is
1) and to the up to two lines of starting at line ( + ), where is the number of lines in (empty if that line is beyond the end of the file). Keep the sub-agent supplied values only when is empty. -
Skip this substep entirely when is equal
true- the full unified diff is suppressed there, so none of the , , , , or values below are consumed (substep 4 builds only the condensed one-liner instead).Otherwise, 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 the line of its first context line, i.e. minus the number of lines in ; 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). - one
-
If is not empty, set , (append a comma). Then append the following to :
<file/>: -
The full unified diff is suppressed in a condensed report (see substep 5 below), so skip the full-diff append and instead build only a condensed one-line representation of this hunk: determine as the single-line collapse of (join its lines with
⏎, or∅when is empty for a pure insertion) and as the same collapse of (or∅when empty for a pure deletion). Then append the following to as a new line:Append the following to , emitting verbatim (one already-prefixed line per line, with no extra blank or space-only lines):
-
-
Unless is equal
true(where is unused), append to .
If is still empty (an empty ), set .
-
-
Report the problem with the following :
-
No correction could be derived for this problem, so report it with the following , set REJECT, and skip the remaining substep 6:
(no correction derivable -- manual action required)
The project source artifacts are classified as a grey box, so the user does not want the full artifact internals surfaced: suppress the full unified diff and instead show only the condensed one-line-per-hunk representation. Report the solution with the following :
Report the solution with the following :
<diff/>Report the solution with the following :
(corresponding change automatically applied)
-
A gap-filling correction carries best-guess content, which is never applied unattended. Report this with the following and set REJECT:
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. You MUST NOT output anything else in this sub-step 6.
-
Check and dispatch accordingly:
-
Skip this without any
Editcall and continue with the next .
-
-
-
For every file in which carries a
Modified: <timestamp-modified-old/>frontmatter line, invoke theEdittool to replace with , keeping the spacing behindModified:unchanged. Do not output anything in this substep. -
Clear the active edit-capable skill marker now that all
Editinvocations are done, so a later unrelatedEditis not auto-approved. Call thease_state_delete(key: "skill", 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 :
-
Finally, give the closing hints by expanding the following (which, depending on the configured , may each expand into nothing and hence emit no output at all):
-
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |