Logo vun Use Case

Use Case

Communautéit
jdm4pku
use-case

Write structured use case specifications with triggers, flows, and exceptions. Use when documenting user-system interactions that require detailed behavioral specification beyond what user stories provide.

Iwwersiicht

Editeurjdm4pku
RepositoryRE-Skills
Skill-Nummuse-case
Stären
27
Forks
1
Matgeliwwert Fichieren
2
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum jdm4pku op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Use Case an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/jdm4pku/RE-Skills/tree/main/skills/use-case
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jdm4pku/RE-Skills.git /tmp/RE-Skills
mkdir -p .claude/skills
cp -r /tmp/RE-Skills/skills/use-case .claude/skills/use-case
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Use Case an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Use Case automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Use Case net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Purpose

Create detailed use case specifications that capture how users interact with a system to achieve specific goals. Each use case documents the actor, preconditions, trigger, normal flow, alternative flows, exceptions, and postconditions. Use this when user stories are insufficient for capturing complex interaction sequences, branching logic, or exception handling.

This is not a user story -- it is a more detailed behavioral specification that describes the full conversation between a user and the system, including what happens when things go wrong.

Key Concepts

Use Case vs. User Story

Both capture user needs, but at different levels of detail:

DimensionUser StoryUse Case
Detail levelBrief (1-3 sentences)Detailed (full flow)
Exception handlingMinimalComprehensive
FormatAs a / I want / So thatStructured template with steps
Best forAgile backlogs, conversation startersComplex flows, regulated systems
When to useMost featuresComplex interactions, safety-critical paths

Rule of thumb: Start with user stories. Escalate to use cases when the interaction has 3+ alternative flows or the domain requires detailed exception handling.

Use Case Anatomy

A use case has these elements:

  • Use Case ID -- Unique identifier (UC-1, UC-2, etc.)
  • Use Case Name -- Verb phrase describing the goal (e.g., "Process Prescription")
  • Primary Actor -- Who initiates the interaction
  • Preconditions -- What must be true before the use case starts
  • Trigger -- What event starts the use case
  • Normal Flow -- The "happy path" step-by-step sequence
  • Alternative Flows -- Valid variations from the normal flow
  • Exceptions -- Error conditions and how the system handles them
  • Postconditions -- What is true after successful completion
  • Business Rules -- Rules that govern behavior within the use case (reference skills/business-rule/SKILL.md)
  • Priority -- High / Medium / Low
  • Frequency -- How often this use case occurs

Levels of Use Cases

  • Summary level (kite) -- High-level business processes spanning multiple sessions (e.g., "Manage Chemical Inventory")
  • User goal level (sea level) -- A single user goal in one session (e.g., "Add Chemical to Inventory") -- most common
  • Subfunction level (fish) -- Reusable steps shared across use cases (e.g., "Authenticate User")

Anti-Patterns

  • The Mega Use Case -- One use case with 30 steps covering everything. Split into multiple use cases at user goal level.
  • Implementation in Disguise -- Steps that describe UI widgets ("Click the blue button in the top-right corner"). Keep steps technology-neutral.
  • Missing Exceptions -- Normal flow only, no alternative or exception handling. This is where most bugs hide.

Application

Use template.md for the full fill-in structure.

Step 1: Identify Use Cases

Start from your stakeholder analysis and user classes:

  1. For each user class, list their goals when interacting with the system
  2. Each goal at "sea level" becomes a candidate use case
  3. Name each use case with a verb phrase: "Place Order," "Generate Report," "Register New Chemical"

Identification techniques:

  • Derive from user stories (one complex user story may expand into one use case)
  • Derive from event list (each business/signal/temporal event suggests a use case)
  • Derive from context diagram (each data flow suggests interactions)
  • Ask users: "What do you come to the system to accomplish?"

Step 2: Write the Normal Flow

Write the happy path as numbered steps:

  1. Each step is one actor-system exchange
  2. Actor does something, system responds (or vice versa)
  3. Keep steps at a consistent level of abstraction
  4. Use active voice: "The system displays..." not "The list is displayed"

Step format:

1. The pharmacist scans the prescription barcode.
2. The system retrieves the prescription details and displays patient name,
   medication, dosage, and prescriber.
3. The pharmacist verifies the patient identity.
4. The system checks for drug interactions against the patient's medication history.
5. The system displays "No interactions found."
6. The pharmacist confirms the prescription fill.
7. The system records the fill, updates inventory, and prints the label.

Step 3: Identify Alternative Flows

For each step in the normal flow, ask:

  • "What else could happen here?"
  • "What if the user makes a different choice?"
  • "What if the data is different?"

Name each alternative flow and reference the step it branches from:

Alternative Flow 3a: Patient identity cannot be verified
  At step 3, if the patient cannot provide valid ID:
  3a.1 The pharmacist selects "Hold Prescription"
  3a.2 The system marks the prescription as "Pending Verification"
  3a.3 The use case ends

Step 4: Identify Exceptions

For each step, ask:

  • "What could go wrong?"
  • "What if the system is unavailable?"
  • "What if the data is invalid or missing?"
Exception 4a: Drug interaction detected
  At step 4, if the system detects a drug interaction:
  4a.1 The system displays the interaction warning with severity level
  4a.2 The pharmacist reviews the interaction details
  4a.3 The pharmacist contacts the prescriber for authorization
  4a.4 If authorized, the pharmacist enters the override code and
       the use case resumes at step 6
  4a.5 If not authorized, the pharmacist rejects the prescription
       and the use case ends

Step 5: Define Pre and Postconditions

Preconditions: What must be true before the use case can start. These are not tested by the use case -- they are assumed.

Preconditions:
- Pharmacist is logged in with valid credentials
- Prescription exists in the system (entered by intake staff)

Postconditions: What is guaranteed to be true after successful completion.

Postconditions:
- Prescription status is "Filled"
- Inventory count for the medication is decremented
- Fill record is logged with pharmacist ID and timestamp
- Label is printed

Step 6: Review the Use Case

Quality checks:

  • Every step has a clear actor (user or system)
  • Normal flow achieves the stated goal
  • All alternative flows are explored (ask "what else?" at each step)
  • All exception flows have defined system behavior (no "TBD" for error handling)
  • Preconditions are things the use case assumes, not things it tests
  • Postconditions are verifiable outcomes
  • Steps are technology-neutral (no UI-specific language)
  • Use case is at user-goal level (not too high, not too low)

Examples

See examples/sample.md for complete use case examples.

Mini example excerpt:

markdown
**UC-3: Add Chemical to Inventory**
- **Actor:** Lab Technician
- **Trigger:** Technician receives new chemical shipment
- **Normal Flow:**
  1. Technician selects "Add Chemical"
  2. System displays the chemical entry form
  3. Technician enters chemical name, CAS number, quantity, location, expiration date
  4. System validates the CAS number against the chemical database
  5. System confirms the entry and assigns an inventory ID
- **Alternative Flow 3a:** Chemical already exists in inventory
  - System prompts to update quantity instead of creating new entry
- **Exception 4a:** Invalid CAS number
  - System displays error, technician corrects or enters manually

Common Pitfalls

Pitfall 1: No Exceptions Documented

Symptom: Every use case is a sunny-day scenario with no error handling.

Consequence: Developers invent error handling at coding time, inconsistently. Testers have no basis for negative test cases.

Fix: For every step in the normal flow, ask "what could go wrong?" Document at least 2-3 exceptions per use case.


Pitfall 2: Implementation Details in Steps

Symptom: "User clicks the Submit button in the top-right corner of the modal dialog."

Consequence: Use case is coupled to a specific UI design. Any UI change invalidates the requirement.

Fix: Keep steps technology-neutral: "User submits the form." Let the UI designer decide the mechanism.


Pitfall 3: Too Many Steps

Symptom: A single use case with 25+ steps in the normal flow.

Consequence: The use case is too complex to review, test, or implement as a unit.

Fix: If the normal flow exceeds 10-12 steps, look for natural breakpoints and split into separate use cases. Use "include" relationships for shared subfunctions.


Pitfall 4: Actors Are Systems, Not People

Symptom: "The API calls the service" -- actors should be humans or external systems with goals.

Consequence: Use cases become system design documents instead of requirements.

Fix: Actors should be people (roles) or external systems that have goals. Internal system components are not actors.

References

Related Skills

  • skills/user-story-re/SKILL.md -- Simpler format for capturing user needs; use cases provide more detail
  • skills/business-rule/SKILL.md -- Business rules referenced within use case steps
  • skills/acceptance-criteria/SKILL.md -- Acceptance criteria can be derived from use case flows
  • skills/state-modeling/SKILL.md -- Complex use cases may need state diagrams to model object lifecycles

External Frameworks

  • Alistair Cockburn, Writing Effective Use Cases (2000) -- Definitive guide to use case levels and format
  • Karl Wiegers & Joy Beatty, Software Requirements, Third Edition (2013) -- Chapter 8: Understanding User Requirements
  • Ivar Jacobson, Object-Oriented Software Engineering (1992) -- Origin of use case concept

Skill type: Component Dependencies: References skills/business-rule/SKILL.md, skills/stakeholder-analysis/SKILL.md Used by: skills/requirements-analysis-process/SKILL.md, skills/srs-document/SKILL.md

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Use Case?

Write structured use case specifications with triggers, flows, and exceptions. Use when documenting user-system interactions that require detailed behavioral specification beyond what user stories provide.

Firwat Use Case op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Use Case besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Use Case an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/jdm4pku/RE-Skills/tree/main/skills/use-case an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Use Case benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Use Case benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Use Case domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Use Case gratis?

De Skill gëtt vum jdm4pku op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇