rse/ase / plugin/skills/ase-code-analyze
ase-code-analyze
UnverifiedAnalyze the source code for problems in either the logic and semantics and its related control flow, performance and efficiency, or security.
@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
$ARGUMENTS
-
Only output the following and then STOP the entire flow (do not perform any further steps):
-
The project source artifacts are classified as a black box, so the user does not want them inspected or their problems surfaced (an explicitly given severity floor lifts this skip). Skip the entire investigation and analysis: do not invoke any
Bash,Glob, orAgenttool and do not read any source, only output the following and then SKIP the remaining step STEP 3:First, 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 determine the analysis lens : set performance if is equal
true, set security if is equaltrue, and set logic otherwise.Then silently restrict the analysis 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-standardSkip every listed path below the
.ase/directory (it carries ASE's own state) and every path which is not a source code file (e.g. a binary file), and prefix every remaining path with<repo-root/>/. If<getopt-arguments/>is not empty, keep only those files which lie within the source code referenced by it, expanding any directory or wildcard references with theGlobtool (or, if theGlobtool is not available, with thefindcommand via theBashtool). Set to the resulting list of individual source code files, preserving order.If is empty, only output the following and then SKIP the rest of this STEP 2 and the remaining step STEP 3:
Then silently resolve
<getopt-arguments/>to the list of individual source code files, expanding any directory or wildcard references with theGlobtool (or, if theGlobtool is not available, with thefindcommand via theBashtool).If is empty (no source-reference given or none of it resolvable), only output the following and then STOP the entire flow (do not perform any further steps):
Then partition , preserving order, into at most eight batches of roughly equal size (a single file yields a single batch), and invoke the following tool once per batch, emitting all invocations in one single message so they run in parallel:
Agent( description: "Analysis Investigation (<batch-index/>/<batch-count/>)", subagent_type: "ase:ase-code-analyze", prompt: "<lens/> <batch/>", run_in_background: false )Here is the space-separated list of the source code file paths of the corresponding batch, is the 1-based index of that batch, and is the total number of batches, 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. Then deduplicate the combined list: when two problems share the samefileandline, silently drop all but the first one (sub-agents may have read overlapping related files for comprehension). Finally sort the list byfileand then numerically byline, and set to that list.You MUST NOT output anything at all in this STEP 2 beyond the
Bash,Glob, andAgenttool invocations and the templates above. -
Before reporting, determine the problem id prefix : set - if is not empty, and set (set to empty) otherwise. Every reported problem id and every persisted key below carries this , so that analyses run under distinct prefixes occupy distinct id namespaces and hence do not overwrite each other.
Before reporting, determine the effective severity floor : define the ordinal rank
LOW=1,MEDIUM=2,HIGH=3.Then apply the effective severity floor : Keep a detected problem if and only if its
severityfield isACCEPTEDorrank(severity)is greater than or equal torank(<floor/>); silently drop all other problems (they are neither reported nor persisted). With the floorLOW, all problems are kept.ACCEPTEDproblems are never dropped.Then sort the surviving problems in by their
severityfield from highest to lowest in the fixed orderHIGH,MEDIUM,LOW,ACCEPTED, so the reporting starts with the most severe problem. Within the same severity, keep thefile/lineorder established in STEP 2.Then renumber the surviving problems contiguously as
<id-prefix/>P<n/>with = 1, 2, ... in that sorted ordering, so<id-prefix/>P1is the most severe problem and the persistedase-issue-<id-prefix/>P<n/>keys follow the reported sequence. If all problems are dropped, skip the per-problem report but still purge any stale persisted problems with a singlease_kv_batchcall to theaseMCP server withtransactionalset totrueand acommandsparameter array holding exactly one{ command: "clear", prefix: "ase-issue-<id-prefix/>" }entry, and still emit the final hint below.In this STEP 3, for EVERY surviving problem in , set to its
severityfield, to itstitlefield, to itsdescriptionfield, to itsevidencefield, and to itstrade-offfield, and immediately report it with the following output , based on concise bullet points.PROBLEM (Severity: ): P:
⊙ EVIDENCE: ⊖ TRADEOFF:
PROBLEM (Severity: ): P:
Hints:
-
For the final results, do not output anything else, especially do not give any further explanations or information.
-
Uniquely identify the problems with
<id-prefix/>P<n/>where is 1, 2, ... -
Additionally, persist all reported problems in a single
ase_kv_batchcall to theaseMCP server withtransactionalset totrue. Thecommandsparameter array of this call starts with one{ command: "clear", prefix: "ase-issue-<id-prefix/>" }entry (which removes only the previously persistedase-issue-<id-prefix/>*keys, leaving any unrelated keys in the shared store intact), followed by one{ command: "set", key: "ase-issue-<id-prefix/>P<n/>", val: "<title/>: <description/>" }entry per reported problem.
Finally, give a final hint by expanding the following (which, depending on the configured , may expand into nothing and hence emit no output at all):
You MUST not output anything else in this STEP 3, especially not any further explanations.
-
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 463k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 463k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 463k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |