Skip to content

rse/ase / plugin/skills/ase-spec-lint

ase-spec-lint

Verified

Lint 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

  1. The project source artifacts are classified as a black box, so the user does not want them inspected or their problems surfaced (the --force option lifts this skip). Skip the entire investigation and reporting: do not invoke any Bash, Glob, or Agent tool 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 grey and is not equal true, 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 none sentinel and any empty token. If a token is not one of the aspect ids S01...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...S10 if 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 of S07...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 Agent tool 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 SPEC artifacts by calling the ase_artifact_list(kind: [ "spec" ]) tool of the ase MCP 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 equal true, and set unstaged otherwise. Determine the repository root by running the command git 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-standard

    Keep 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 the Glob tool. 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 the Glob tool, 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 std if is empty, where each entry std is replaced by the path of the bundled file meta/ase-format-specbook.yaml. Set to the space-separated paths of the bundled files meta/ase-format-specbook.md and meta/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 Agent tool invocation as a JSON array and concatenate all those arrays. Determine the anchor of each problem as its file and line fields. Then deduplicate the combined list: when two problems share the same anchor and aspect, silently drop all but the first one (sub-agents may have read overlapping related files for comprehension). Finally sort the list by the anchor file and then numerically by the anchor line, 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 severity field is ACCEPTED or rank(severity) is greater than or equal to rank(<floor/>); silently drop all other problems. With the floor LOW, all problems are kept. ACCEPTED problems are never dropped.

    Finally, sort the surviving problems in by their severity field from highest to lowest in the fixed order HIGH, MEDIUM, LOW, ACCEPTED, so the subsequent reporting starts with the most severe problem. Within the same severity, keep the file/line order established above.

    You MUST NOT output anything else in this STEP 1.

  2. 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.

    1. Mark this skill as the active edit-capable skill so that the ASE pre-tool-use hook auto-approves the subsequent Edit invocations on any invocation path (slash command or Skill tool). Call the ase_state_set(key: "skill", val: "ase-spec-lint", session: "<ase-session-id/>") tool from the ase MCP server. Then call the ase_timestamp(format: "yyyy-LL-dd HH:mm") tool of the ase MCP 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 Edit auto-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. an Edit failure, 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, unrelated Edit.

    2. Set to the number of problems in and to 0. Then iterate over all problems:

      1. Increment by one (the 1-based position of the current within ). Set to the aspect field of . Set to the severity field of . Set to the description field of . Set to `<anchor-file/>`:<anchor-line/>, where is the file and the line field of . Set to the change-set field of . Set to true if starts with S09 or S10 (a gap-filling best-guess correction), and to false otherwise.

      2. Set (set to empty). Set (set to empty). Set (set to empty).

      3. Iterate over the change set:

        1. Set to the file field of . Set to the change-hunks field 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 the Read tool - reusing the content read for the same earlier in this iteration, unless an Edit was 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 :

        2. Iterate over the change hunks.

          1. Set to the line field of . Set to the context_before field of . Set to the old_text field of . Set to the new_text field of . Set to the context_after field of .

            Then normalize the hunk to its minimal form, so that the proposed diff shows exactly the lines the later Edit will 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.

          2. 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 as 0).

            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 of 1 whenever is greater than 0 (the corrected side then has a real first line).

          3. If is not empty, set , (append a comma). Then append the following to :

            <file/>:

          4. 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):

        3. Unless is equal true (where is unused), append to .

        If is still empty (an empty ), set .

      4. Report the problem with the following :

      5. 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)

      6. 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-dialog definition. You MUST closely follow this definition:

        Set ACCEPT. You MUST NOT output anything else in this sub-step 6.

      7. Check and dispatch accordingly:

        • Skip this without any Edit call and continue with the next .

    3. For every file in which carries a Modified: <timestamp-modified-old/> frontmatter line, invoke the Edit tool to replace with , keeping the spacing behind Modified: unchanged. Do not output anything in this substep.

    4. Clear the active edit-capable skill marker now that all Edit invocations are done, so a later unrelated Edit is not auto-approved. Call the ase_state_delete(key: "skill", session: "<ase-session-id/>") tool from the ase MCP server. Do not output anything in this substep.

    5. You MUST NOT output any further additional explanations or summaries at the end of this skill processing, except for the following final :

    6. 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):

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: 197kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall