analyze-code
Skill69 starsChanged 7 months agoMITView on GitHub
ABAP code analysis — size-gated review (one Opus sap-code-reviewer, or Haiku sap-checker detectors + Opus judge for large objects), Haiku evidence check on every finding, then a canned report or a richer briefing on the main thread
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Every response triggered by this skill MUST begin with [Model: <main-model> · Dispatched: <sub-summary>] per …
- Distinctive: line 31
Before releasing a transport, to catch issues early
- Distinctive: line 32
When taking over existing ABAP code and wanting to understand its quality
- Distinctive: line 33
When optimizing performance of an ABAP program or class
- Very specific: line 48
If .sc4sap/session-trust.log already has a line within the last 24h, skip silently.
- Distinctive: line 55
MANDATORY: Read the companion files below before executing.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SC4SAP Analyze Code
Reviews an ABAP object by delegating the heavy work (source read, structural/semantic/where-used analysis, 14-dimension rule matching) to sap-code-reviewer (Opus) — for objects over 1,500 lines, Haiku sap-checker detectors find candidates and the Opus reviewer judges them. Every finding's cited line is then checked by Haiku before it reaches the report. The main thread (session model, model: inherit) only handles Socratic intake, report formatting, and the follow-up action menu.
<Purpose>
sc4sap:analyze-code provides a comprehensive, severity-rated ABAP code review backed by the AST, semantic analysis, and where-used data that only the live SAP system can produce. The flow is deliberately thin on the main thread: the reviewer agent owns context-heavy work so the skill orchestrator stays light.
</Purpose><Response_Prefix>
Every response triggered by this skill MUST begin with [Model: <main-model> · Dispatched: <sub-summary>] per ../../common/model-routing-rule.md § Response Prefix Convention.
</Response_Prefix>
<Target_Object>The target object is looked up on the active profile's system only. Not found → stop and ask per ../../common/multi-profile-artifact-resolution.md § Target object not on the active system — never substitute a similar name, never switch profiles on your own.</Target_Object>
<Phase_Banner>
Multi-phase skill. Before each Agent(...) dispatch, emit ▶ phase=<id> (<label>) · agent=<name> · model=<Opus|Sonnet|Haiku> per ../../common/model-routing-rule.md § Phase Banner Convention. Resolve the dispatch mode first per ../../common/model-dispatch-mode.md: auto (default) uses the model below/in the rule; user-defined asks the user Opus / Sonnet / Haiku (recommended one first) before each dispatch group.
</Phase_Banner>
<Team_Mode>
Type B (Coder ↔ Consultant) teamMode — Opt-in, not automatic. It runs only when (a) the arguments contain team (e.g. /sc4sap:analyze-code ZSDR21500 team), or (b) the user accepts the offer at the end of Step 3. The offer is made only when the gate below holds: after the report, one AskUserQuestion — "Have the <modules> consultants review the N business-alignment findings? (about +$4, +10 min)" — options Skip (Recommended) / Run consultant review. Business-alignment findings in the report carry a consultant review recommended tag either way. Unattended runs never offer it. Gate for the offer: the verified findings include a business-alignment finding (business purpose, business-rule faithfulness, cross-module side-effects — judged by content, not dimension number) AND the object touches 2+ modules. Reviewer becomes Worker, module consultants become Peers; consultants live-validate the reviewer's business-alignment findings. See team-mode.md. Base protocol: ../../common/team-consultation-protocol.md § Type B.
</Team_Mode>
<Use_When>
- User says "analyze", "review code", "check this class", "what's wrong with", "analyze code", or "code review"
- Before releasing a transport, to catch issues early
- When taking over existing ABAP code and wanting to understand its quality
- When optimizing performance of an ABAP program or class
- User wants where-used impact analysis before modifying an object </Use_When>
<Do_Not_Use_When>
- User wants to modify the code immediately →
/sc4sap:create-program(full program flows) or directUpdateClass/UpdateProgram/UpdateIncludeMCP calls - Object doesn't exist yet →
/sc4sap:create-object - User just wants to read the source →
ReadClass,ReadProgrametc. directly </Do_Not_Use_When>
<Session_Trust_Bootstrap> MANDATORY — runs as Step 0 before any MCP call or user interaction.
Invoke /sc4sap:trust-session with parent_skill=sc4sap:analyze-code to pre-grant all MCP tool + file-op permissions for this session (eliminates per-tool "Allow this tool?" prompts during the review flow).
- If
.sc4sap/session-trust.logalready has a line within the last 24h, skip silently. - Otherwise run it and surface the one-line confirmation.
Full spec: see ../trust-session/SKILL.md.
</Session_Trust_Bootstrap>
<Companion_Files> MANDATORY: Read the companion files below before executing.
| Companion | Scope |
analysis-dimensions.md | 9 common/ rule files that the reviewer agent (not main) loads + 14 evaluation dimensions |
workflow.md | 4-step execution flow: Identify → Review (delegated, size-gated) → Report (branching) → Actions |
detect-judge.md | Step 2a size scout · 2b Haiku detectors · 2c Opus judge · 2d evidence verify · FINDING line format |
output-and-tools.md | Report output format + MCP tool list used by the reviewer agent |
| </Companion_Files> |
<Execution_Summary> Orchestration is 1 main-thread Socratic intake + a size-gated delegated review + a Haiku evidence check + a branching report + main-thread action menu.
- Step 1 (main) — Identify: ask for (or confirm) the ABAP object name + type; verify via
SearchObject. - Step 2a (delegated · Haiku) —
sap-checkerscout returns source units with line counts + caller count. - Step 2 (delegated · Opus) — ≤ 1,500 lines: dispatch to
sap-code-reviewerwith only the object reference. > 1,500 lines: Haiku detectors × N (5 rule groups) write candidates, then one Opussap-code-reviewerjudges them and evaluates the judgment dimensions (§1 / §4 / §9 / §14) — seedetect-judge.md. On the single path the reviewer agent itself reads source (viaGetClass/GetProgram/GetProgFullCode/...), runs structural analysis (GetAbapAST+GetAbapSemanticAnalysis+GetWhereUsed), loads the 9common/rule files, and evaluates all 14 dimensions. Returns: findings list (severity · location · rule ref · fix suggestion, oneFINDINGline each) + summary metrics. - Step 2d (delegated · Haiku) —
sap-checkerverify confirms each finding's evidence quote exists at the cited line; failures move to an Unverified section and leave the score. - Step 3 (branching):
- Branch A — canned (default: no Critical findings AND < 10 findings total) → main formats the standard report template from
output-and-tools.md. - Branch B — briefing (Critical present OR ≥ 10 findings) → main renders a richer reader-facing briefing (Critical/High with root cause + fix code, where-used impact, top-3 fixes) per
workflow.md§ Branch B. No extra agent dispatch.
- Branch A — canned (default: no Critical findings AND < 10 findings total) → main formats the standard report template from
- Step 4 (main) — Follow-up action menu: show where-used · explain finding #N · save report (Markdown · HTML · both) · delegate fix to
sap-executor(user's choice).
Full spec in workflow.md. Main thread NEVER calls ReadClass / GetAbapAST / GetWhereUsed directly — that context stays inside the reviewer and checker agents so the orchestrator window remains small even for large objects.
</Execution_Summary>
Task: $ARGUMENTS
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Azure/azure-sdk-for-rust★ 886same name
- jjmrocha/coding-skills★ 1same name
- lgtm-hq/ai-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- analyze-cbo-objSkill
- analyze-symptomSkill
- ask-consultantSkill
- compare-programsSkill
- config-to-documentSkill
- create-objectSkill
- create-programSkill
- ecoSkill
- interface-mapping-specSkill
- mcp-setupSkill
- module-to-processSkill
- package-to-processSkill
- program-to-manualSkill
- program-to-specSkill
- project-dashboardSkill
- role-matrixSkill
- sap-doctorSkill
- sap-optionSkill
- setupSkill
- smartform-from-pdfSkill
- smartform-previewSkill
- trust-sessionSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

