reason-classify
Classifies the stated return reason against the reason-code taxonomy with the deterministic reason_classify engine, recording confidence and candidate codes. Use after return-intake in every case, or on "what reason code is this", "classify the return reason", "which reason code", "code this return", "why are they returning it". Do NOT use for sentiment or complaint triage; not for eligibility or red flags - use eligibility-check instead; not for policy text - use policy-retrieve.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 107
- Forks
- 120
01 前言 Front Matter
- name
- reason-classify
- license
- MIT
- metadata
- { "icon": "TextBulletListLtr", "author": "Microsoft Retail & CPG Skills", "version": "1.0.4", "category": "analysis" }
- description
- Classifies the stated return reason against the reason-code taxonomy with the deterministic reason_classify engine, recording confidence and candidate codes. Use after return-intake in every case, or on "what reason code is this", "classify the return reason", "which reason code", "code this return", "why are they returning it". Do NOT use for sentiment or complaint triage; not for eligibility or red flags - use eligibility-check instead; not for policy text - use policy-retrieve.
02 资源文件 6
- 参考文档config/reason-taxonomy.json678 B
- 参考文档config/return-windows.json275 B
- 参考文档contracts/rtl.returns-refund-case.v1.json6.5 KB
- 许可证LICENSE1.1 KB
- 参考文档references/returns-rules.md2.1 KB
- 脚本scripts/reason_classify.py3.2 KB
03 SKILL.md 正文
Reason Classify
Purpose
Deterministic taxonomy classification of the verbatim reason text - the {reason} hop.
When to use
- After return-intake in every case; or when asked which reason code a stated reason maps to.
When NOT to use
- Sentiment, complaint or ticket categorisation outside a return case.
- Eligibility, refund or fraud questions - eligibility-check.
- Retrieving policy - policy-retrieve. Drafting - case-packet.
Where the data comes from
This plugin ships no sample data. The reason-code taxonomy (config/reason-taxonomy.json) is retailer configuration inside this skill folder. The case is the user's own content:
case.jsonwritten earlier in the session by return-intake, or a case file the user names, links or attaches in the chat.- Their OneDrive or SharePoint, found with Work IQ search (Microsoft 365 search) by case ID or file name when no location is given.
- If the user only gives the customer's words (a note, email or chat line), build
case.jsonwith return-intake first soreason_textis verbatim.
Read each source with the file reader (ReadFileContent) and cite it by file name and row or line. Write the working JSON file (classified.json) to the session working folder, never into the plugin. If the case or its reason text cannot be found, say which is missing and ask the user. Never invent it or fall back to example values.
Inputs
Configuration ships inside this skill folder (synced from the plugin-root shared/ copy before packaging): config/, contracts/, references/returns-rules.md - paths below are relative to this skill folder.
case.json (from return-intake in this session, or the user's case file - see Where the data comes from; it must carry contract_version and return_request.reason_text) + config/reason-taxonomy.json. Engine: scripts/reason_classify.py.
Steps
- Run
python scripts/reason_classify.py --case case.json --taxonomy config/reason-taxonomy.json --out classified.json(case.json and classified.json live in the session working folder). - Quote
reason.categoryandreason.confidenceverbatim, with thecandidateslist when more than one category matched. - If confidence < 0.75 the engine appends an escalation: confirm the primary reason with the customer before the packet closes - never guess.
Example
$ python scripts/reason_classify.py --case case.json --taxonomy config/reason-taxonomy.json --out classified.json
reason_classify: not_as_described (conf 0.7) -> classified.json
Reply: "Reason code: not_as_described (confidence 0.7). Matched: 'looks different'. Alternative: defective ('broken').
Ambiguous - confirm the primary reason with the customer before the packet closes."
Output format
classified.json - the case payload plus reason: {category, confidence, candidates[], tie_break, source, citation}. In chat: "Reason code: <category> (confidence <n>) - <matched keywords>; alternatives: <...>".
Grounding requirements
Category cites the taxonomy file; matched keywords are listed so the pick is auditable.
Guardrails
- Never fabricate a reason code or a confidence; both come only from the engine output.
- Taxonomy-only; never invent a new reason code (e.g. "suspected_fraud") - fraud is not a reason code.
- Never overwrite the engine's category or confidence to make a case "flow through".
- Never skip the customer confirmation on an ambiguous classification because the queue is long.
Escalation / uncertainty
If the engine fails (contract mismatch, unreadable taxonomy) stop and report the error; never hand-pick a category. If reason_text is missing, send the case back to return-intake.
Confidence < 0.75 -> confirm with the customer before the packet closes; unclassified -> ask the customer to restate and, if still unmatched, escalate to the taxonomy owner.
04 同仓库更多 Skills
work-iq-sphere
Build or refresh a personal "My Work IQ" visual from the signed-in user's own Microsoft 365 work (mail, calendar, Teams chats and the OneDrive and SharePoint files they worked on, with Week, Month and 3 months views from one read of their data, about all their work or one customer, programme or topic they name) as an interactive 3D sphere (self-contained HTML), a customer-safe copy and a matching Microsoft-style PowerPoint slide. Every build is a fresh, evidence-checked analysis of that one person's own data. Use when someone says "build my Work IQ sphere", "show my Work IQ", "refresh" or "update my Work IQ", "make my Work IQ slide", "visualise my work graph", "show me the Work IQ sphere demo", or wants to show customers what Work IQ (context, memory, skills) means using their own work. Do NOT use for generic decks, Work IQ product or licensing questions with no personal data, or anyone else's, team or org-wide analytics.
severity-recordability
Runs the deterministic local v2 draft classifier; reporting/deadlines remain undetermined. Use for "explain blocked reporting determination", "is this recordable", "classify this incident", "what severity is this", or "is this OSHA reportable". Do NOT use for source intake, history retrieval or routing — use incident-intake, ehs-knowledge-retrieve or routing-notify. No diagnosis or operational decision; EHS REVIEW REQUIRED.
routing-notify
Computes proposed investigators and unsent recipients from validated local classification, history and governance. Use for "propose unsent incident recipients", "who investigates this", "route this incident", "who do we notify", or "start the OSHA clock" (only to explain the blocked clock). Do NOT use for classification or terminal drafting — use severity-recordability or incident-writeup. Never sends, files or starts a clock; EHS REVIEW REQUIRED.
incident-writeup
Revalidates and recomputes every terminal v2 hop, then renders a null-aware local Markdown draft and blank RCA template. Use for "prepare an evidence-grounded incident draft", "draft the incident summary", "write up the incident", "give me the RCA template", or "prepare the OSHA writeup". Do NOT use for intake, classification or routing — use incident-intake, severity-recordability or routing-notify. No operational actions; EHS REVIEW REQUIRED.
incident-intake
Preserves cited authorized user-supplied incident files, including real incidents, as v2 inputs for human-reviewed drafts only. Use for "preserve conflicting incident accounts", "intake this incident", "process this safety report", "extract incident facts", or "intake this near miss". Do NOT use for classification, routing or terminal drafting — use severity-recordability, routing-notify or incident-writeup respectively. No live retrieval or official determinations; EHS REVIEW REQUIRED.
ehs-knowledge-retrieve
Attaches cited local OSHA, ISO summaries, JHA and policies and computes supplied-log history. Use for "find cited local safety evidence", "pull the OSHA criteria", "get the JHA", "attach local EHS evidence", or "have we had this incident before". Do NOT use for incident intake, recordability decisions or drafting — use incident-intake, severity-recordability or incident-writeup. No live retrieval; EHS REVIEW REQUIRED.