sap-pm-diagnosis

A guided process for diagnosing broken equipment in SAP Plant Maintenance, the part of SAP used to manage industrial equipment and repairs.

In plain words
What is it for?
Use it to investigate recurring equipment failures, review SAP maintenance records, calculate MTBF and MTTR, assess production impact, and plan preventive maintenance.
Why use it?
It organizes symptoms, equipment history, failure codes, repair times, and maintenance plans so possible causes are easier to trace. It also keeps analysis separate from creating or changing maintenance orders until the user approves.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/boxlogodev/sapstack/sap-pm-diagnosis
Clone the repo
git clone --depth 1 https://github.com/BoxLogoDev/sapstack
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 789 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.00789
Opus 5 $0.00028 $0.00394
Sonnet 5 $0.00011 $0.00158
Haiku 4.5 $0.00006 $0.00079

Measured 3d ago against content hash ba36a3853e48, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sap-pm-diagnosis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/sap-pm-diagnosis.md · 64 lines

What it actually says

SAP PM 설비 고장 진단

입력: $ARGUMENTS

목표

설비 고장 또는 보전 이슈를 체계적으로 진단합니다. 증상 수집 → 장비 이력 분석 → 고장 원인 추적 → 대응 방안 제시 순서로 진행합니다.

안전 규칙

  • 조회/분석만 수행 — 보전오더 생성/변경은 사용자 확인 후
  • 장비번호·플랜트 값은 사용자가 제공

실행 절차

Step 1 — 증상 수집

사용자에게 다음을 질문:

  • 장비번호 (EQUNR) 또는 기능위치 (TPLNR)
  • 고장 증상 (어떤 현상이 발생했는가?)
  • 발생 시점 (언제부터? 갑자기? 점진적?)
  • 플랜트 + SAP 릴리스

Step 2 — 장비 이력 조회 안내

  1. IE03 — 장비 마스터 확인 (카테고리, 위치, 원가센터)
  2. IW29 — 과거 통보 이력 조회 (동일 장비 반복 고장?)
  3. IW39 — 과거 보전오더 이력 조회
  4. IW65 — 카운터/측정 이력 (가동시간, 사이클 수)

Step 3 — 고장 원인 분석

  1. 고장코드 카탈로그 확인 (QM/PM 카탈로그 프로파일)
  2. 원인코드 분류 (기계적/전기적/인적/환경적)
  3. MTBF 계산: 이전 고장 간격 분석
  4. MTTR 추적: 평균 수리 시간 확인

Step 4 — 대응 방안

  1. 긴급 대응: 보전통보 생성 (IW21) → 보전오더 생성 (IW31)
  2. 근본 원인 해결: IMG 구성 점검 → 예방보전 계획 수정 (IP02)
  3. 재발 방지: 보전전략 검토 (IP11), 점검 주기 조정 (IP10)

Step 5 — KPI 영향 분석

  • OEE 영향도 (가동률 × 성능률 × 양품률)
  • 예방보전 이행률 vs 긴급보전 비율
  • 보전 비용 추이 (KO88 정산 내역)

Evidence Loop 연동

복잡한 진단 시 /sap-session-start 호출하여 Evidence Loop 진입 가능:

  • Turn 1: 증상 + 장비 이력 업로드
  • Turn 2: 가설 생성 + 추가 조사 요청
  • Turn 3: 오퍼레이터가 현장 확인 후 증거 추가
  • Turn 4: 최종 진단 + Fix/Rollback

위임

  • sap-pm-consultant — 상세 PM 분석
  • sap-co-consultant — 보전 비용 분석
  • sap-mm-consultant — 예비부품 재고 확인
  • sap-qm-consultant — 품질 연관 고장 시

참조

  • plugins/sap-pm/skills/sap-pm/SKILL.md
  • plugins/sap-pm/skills/sap-pm/references/best-practices/
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 64 lines · 57 tokens per session scan A ba36a3853e48

Subscribe to this mod's changes

sap-pm-diagnosis is a command published in the GitHub repository BoxLogoDev/sapstack (18 stars, last pushed 3d ago), licensed MIT. It adds 57 tokens to every session and 789 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.