Use Case Extractor
Transform requirements documents and functional specifications into structured, role-based use case documentation following established business-analysis practice.
Languages
Source and output languages are independent: a source may be in any language, and
several sources may each be in a different one.
- Output language: whatever the request states. When the request states none, ask in
Step 2 and apply this default to a reply that still does not choose: the language of the
request if that is Italian or English, Italian otherwise. User-facing messages always
follow the language of the request, including Step 2's question.
- Written in the output language: section headings, sheet names, field labels, priority
values, the Coverage Assessment value, the five relationship-type words, and the
flagged-item categories — one fixed term per relationship type across the whole document,
listed in a legend: the Appendix in the document formats, under the dependencies matrix in
the Excel workbook.
- Kept in the source language: the
Source citation, which quotes the document's
own section wording and identifier. The (inferred) marker beside it is the analysis's
own annotation rather than part of the quotation, so it follows the output language.
- Translated with the source term kept: the document's own vocabulary — entity,
status, screen, and field names — written as the output-language term with the
source's term in parentheses at first use, as in
Draft status (Bozza) (English
output citing an Italian source's Bozza); later mentions use the output-language
term alone. Descriptive prose — Target, Main Flow, Variations, User Story — is
written fully in the output language.
- Never translated: use case codes and role prefixes. A prefix follows the source,
the way a citation does: the ten standard prefixes are a fixed vocabulary in every
language, and a custom prefix takes three letters from the role name as the source
document writes it (
Medico gives MED); when that script is not Latin, the three
letters come from a standard romanization of the role name (医師 gives ISH). The
same analysis therefore carries the same codes in every output language, and the
legend gives each prefix its role name in the output language — the Appendix in the
document formats, Sheet 1's Roles Summary Table in the Excel workbook.
Reference files — read each when its step runs
references/examples.md (Steps 4–5) — worked extraction examples across domains and languages. Read it before extracting and structuring use cases.
references/format-templates.md (Steps 2, 7) — exact output templates for each format, and the format-selection logic. Read its Format Selection Logic section when Step 2 must recommend a format, and the whole file before generating the output file(s).
Workflow
Step 1: Comprehensive Document Analysis
Read all source documents thoroughly before extracting anything — uploaded files and requirements text supplied in the conversation. Then say in a sentence or two what kind of document it is and what it appears to cover. Accepted inputs: PDF, Word (.doc/.docx), Rich Text (.rtf), Excel (.xlsx), CSV (.csv), Markdown, and plain text. If a file's text cannot be read on this platform — a scanned, image-only PDF, or an attachment type the platform cannot parse, such as legacy .doc on claude.ai — handle it under Unreadable Input (see Edge Cases).
Identify:
- Business domain and context
- Project scope and objectives
- All functional and technical requirements
- Non-functional requirements — performance, security, usability, compliance (they feed the non-functional requirements section)
- Stakeholder needs and expectations
- Constraints and assumptions
- Explicitly stated use cases
- Implicitly described use cases (inferred from requirements)
- Ambiguities, contradictions, and missing information (they feed Flagged Items)
Step 2: Output Configuration
The output language decides the words of every field extracted in Steps 4–5, so settle it
here, before any of that prose is written.
Ask only after Step 1 has produced readable requirements content. A source whose text cannot
be read takes the Unreadable Input path, and a source that carries no requirements content
takes the Source Without Requirements Content path — neither reaches a configuration question
or a deliverable.
Prompt user ONCE. The template below shows every question; ask only the ones the request has not already answered:
Language for the output document?
- 1) Italian
- 2) English
- 3) Other (please specify)
No choice means [the default that applies to this request].
Output format?
- A) Word document (.docx) - default
- B) Excel spreadsheet (.xlsx)
- C) PDF document (.pdf)
- D) Markdown file (.md)
- E) Multiple formats - name the combination
Reply with language and format, or just say "proceed" for those defaults.
Special requirements are welcome.
Rules:
- Ask only what the user's request has not already stated
- Compute the default language from the Languages section and name it in the question, rather
than printing the placeholder
- Apply any special requirement from the answers to the deliverable where the format allows it; name anything that could not be applied in the completion message
- A special requirement that narrows the analysis — one role only, one section only — applies
from Step 3 onward, rather than as a filter over a finished extraction
- If the user's reply does not choose, the defaults apply — the Languages section's output language, and
.docx
- If the user asks for a format outside A-E, say so and offer the closest supported format; wait for a supported choice before generating
- When the user is undecided or asks for a recommendation, recommend one format using the selection logic at the end of
references/format-templates.md, and wait for the user's choice before generating
After the answers: "Proceeding with the use case documentation in [LANGUAGE] as [FORMAT]. No further questions unless the source or the environment forces one."
Step 3: Actor and Role Identification
Extract and categorize all actors:
- Explicit actors: Users, roles, and stakeholders mentioned directly
- Implicit actors: Roles inferred from actions and requirements
- System actors: External systems, APIs, automated processes
Assign clear identifier prefixes (3 letters, uppercase):
- ADM = Administrator
- USR = End User / General User
- DEV = Developer
- OPR = Operator
- MGR = Manager
- SYS = System (automated processes)
- API = API Consumer / External System
- AUD = Auditor
- SUP = Support Staff
- CST = Customer
- Create custom prefixes for domain-specific roles as needed (e.g., DOC for Doctor, NUR for Nurse)
- Each prefix must be unique across the analysis; if two roles suggest the same three letters, differentiate one of them
Write a 2-3 sentence description of each role — its responsibilities and its position in the system. Every output format carries it.
Step 4: Use Case Extraction and Numbering
For each identified role:
- Extract explicit use cases already defined in document
- Infer use cases from functional requirements, business processes, user needs, and data flows
- Assign sequential numbering starting at 001 for each role prefix
- Format:
[PREFIX]-[NUMBER] (e.g., ADM-001, ADM-002, USR-001)
- Maintain logical order based on workflow or document structure
Granularity:
- An entity the source creates, reads, updates and deletes yields one use case per operation,
rather than one use case that manages the entity
- An interaction with an external system splits into the initiating role's use case and a
system-role use case that handles the response, rather than one use case spanning both
sides; the failure of that response is a
Variations entry, not a third use case
Each use case belongs to exactly one owning role — the role that performs it. A role that only takes part in it reaches it through Dependencies, never as a second copy under its own prefix. A role that inherits another role's access states that in its description, rather than re-listing that role's use cases.
An actor that owns no use case — one the document names only as the receiver of an output — gets no section, no prefix, and no place in the role count. Name it in the description of the role it interacts with, and under Flagged Items when the source implies it should act but never says how.
Step 5: Detailed Information Extraction
For each use case (worked examples: references/examples.md), extract and structure the
fields below, written in the output language Step 2 settled. A field with nothing to
record carries the output language's word for none — one fixed term across the whole
document — the way Dependencies does, rather than being dropped or filled with invented
content. Acceptance Criteria is the one exception, stated at the field itself.
Code: [PREFIX]-[NUMBER]
Name: Concise, action-oriented name (3-7 words)
- Use verbs: Create, Update, Delete, View, Generate, Approve, Configure, Process
- Example: "Register New User", "Generate Monthly Report", "Approve Purchase Order"
Title: [PREFIX]-[NUMBER]: [Name]
- Example:
ADM-001: Configure System Settings
Priority: High, Medium, or Low
- Follows the priority the source states, when it states one: a MoSCoW rating maps
Must have to High, Should have to Medium, and Could have to Low
- A
Won't have requirement is outside the release's scope, so it reaches Flagged Items
rather than a use case (see Edge Cases)
- A numbered scale —
P1–P4, 1–5, or any other the source uses — maps its most critical
tier to High, its least critical tier to Low, and every tier between them to Medium
- The source's own legend names the most critical tier; with no legend, the lower number is the
more critical one, so
P1 outranks P4 and 1 outranks 5, and that reading goes under
Flagged Items as an ambiguity, since inverting it would re-rank every use case
- Otherwise assign it from business criticality and expected frequency of use together: a High
use case is core functionality that is both frequently used and business-critical, so a
frequently used supporting step stays Medium
- Drives the detail level applied to this use case (see Quality Guidelines)
Target: Clear goal description — length follows the assigned Priority (see Quality Guidelines)
- Explain what user wants to accomplish
- Describe business value and purpose
- Include relevant context
Main Flow: Numbered steps of the primary path (3-7 steps)
- One actor action or system response per step
- Example: 1. Customer selects a product 2. System checks availability 3. System adds the item to the cart 4. System updates the cart totals
Variations: Alternative and exception paths, each numbered against the main-flow step it branches from
- Example:
2a. Product unavailable: system suggests similar products and keeps the customer on the page
- High and Medium priority use cases: alternative and exception paths; Low priority: exception paths only
Input Data: Comprehensive list categorized as:
Mandatory (required):
- Authentication/authorization credentials
- Primary data fields and values
- Required documents or files
- Preconditions
- Configuration parameters
- Validation criteria
Optional (enhance functionality):
- Additional data fields
- Optional documents or attachments
- Preferences and settings
- Contextual information
- Historical data
Output Data: Complete list of all outputs, results, and effects:
- Data created/modified (records, documents, files)
- Results (calculations, reports, analytics)
- Artifacts (documents, exports, printouts)
- Notifications (emails, alerts, messages)
- Events (triggered processes, workflow steps)
- Side effects (logs, audit records, cache updates)
- Status changes (state transitions, flags)
- User feedback (confirmations, error messages)
Dependencies: Related use cases with relationship type:
- Format:
CODE-XXX: Name (relationship type)
- Relationship types: prerequisite, data dependency, workflow sequence, shared resource, triggering
- The type reads from this use case outward:
prerequisite — the listed use case must complete first
data dependency — this use case reads data the listed one produces or holds
workflow sequence — the listed use case is the next step of the same process
shared resource — both use the same resource, in no fixed order
triggering — this use case automatically starts the listed one
workflow sequence and triggering point forward, so a listed use case is not always one this use case waits for
- The two use cases at the ends of one relationship may each list it, with the type that
reads true from their own side:
TEC-001 lists CAP-001: Approve Closed Service Ticket (workflow sequence) while CAP-001 lists TEC-001: Open Service Ticket (prerequisite).
The Critical Dependencies Matrix carries one row per listed entry, so that pair appears
in it twice, once per direction
- Example:
USR-001: User Authentication (prerequisite), ADM-005: View Audit Log (shared resource)
- With no dependency, write the output language's word for none, followed by the reason where
it carries information:
None — triggered automatically by every use case that touches patient data.
triggering and data dependency have no opposite among the five types, so a use case on
the receiving end of one writes that none line rather than inventing a sixth type
Source: Section of the requirements document this use case comes from, quoted in the document's own wording, with the document's own requirement or use-case identifier when it has one; with several documents, name the document before the section
- Example:
Source: §3.2 User management (REQ-101)
- Example with several documents:
Source: core-spec.pdf, §3.2 User management
- With a spreadsheet source, the sheet name and the requirement identifier stand in for the section:
Source: Requirements!REQ-101; a sheet-less CSV counts as a spreadsheet source and names the file instead: Source: requirements.csv!REQ-101
- With a source that has no sections — pasted text, or an uploaded section-less file such as a plain-text file — cite the sentence itself, quoted in its own wording:
Source: «A member can reserve a spot in a class up to 7 days in advance»
- An inferred use case cites the section or sentence that implies it, marked
(inferred)
User Story: One per use case, in the standard format
- Example:
As a customer, I want to save items in a cart, so that I can buy them in one order later.
- For a use case with no human actor (system roles), write the story as the role that benefits from the automation, and name that role in the story; it need not be a registered actor
Acceptance Criteria: 2-3 criteria in Given/When/Then form
- High-priority use cases only; the field is absent from a Medium or Low use case,
rather than carrying the word for none
Step 6: Pre-Delivery Verification
Before writing the file(s), verify silently:
- Numbering starts at 001 for each role prefix and is sequential
- Every role prefix is unique across the analysis
- Each use case code appears under exactly one role prefix; a role that inherits
another's access states that in its description, without re-listing the inherited use cases
- Every use case carries every Step 5 field, with Priority assigned and a User Story written;
Acceptance Criteria is the exception — a High-priority use case carries its 2-3 criteria,
and the field is absent below High
- Every role carries its 2-3 sentence description
- Target length and input/output item counts match each use case's Priority (see Quality
Guidelines); Main Flow has 3-7 steps, and a Low-priority use case's Variations carry
exception paths only
- Dependencies use only the five declared relationship types and reference codes that exist in
the analysis (anything else goes to Flagged Items)
- The Critical Dependencies Matrix (Excel: the Dependencies Matrix sheet) matches the use
cases' Dependencies lists — the same code pairs with the same relationship types, in the
same direction
- Headings, field labels, and priority values are in the output language, while codes,
prefixes, and
Source citations follow the source, as the Languages section requires
- Executive Summary counts match the body: roles, use cases, user stories, the High,
Medium and Low priority counts, and the dependency count, which is the number of rows
in the Critical Dependencies Matrix
- Ambiguities and contradictions found in Step 1 or Step 5 appear under Flagged Items
- Every functional requirement of the source is cited by at least one use case's
Source, named
under Flagged Items, or excluded by a special requirement the user gave — counted in the unit the
source states them in, the same unit Source cites: a section in a document, a row in a
spreadsheet, a sentence in pasted text or another section-less source
- Every non-functional requirement of the source is listed in the format's non-functional
requirements section — the Appendix's subsection in the document formats, the Non-Functional
Requirements table on Sheet 1 in the Excel workbook — or named under Flagged Items
- Word and PDF output is set to A4, and the filename to write follows the convention below
Fix every failed check silently, before writing the file.
Step 7: Output Generation
Generate the deliverable(s) in the selected format(s) with role-based organization, following
the matching template in references/format-templates.md. Pick the branch per format, since a
platform may provide a document skill for one format and none for another:
- For a format the platform provides a document skill for — claude.ai's built-in file creation,
or Claude Code with the
docx/xlsx/pdf skills installed — use it; for .docx / .xlsx /
.pdf, read and follow its documentation when the platform exposes it. On claude.ai, let the
platform's file delivery present the file in the conversation — that delivery is the only
reference to the file, so give no path and no download link. On Claude Code the document skill
writes the file to disk, so report its absolute path, as the local-Python branch below does.
.md belongs to neither branch: it needs no document skill. Deliver it as a file through
the platform's file delivery where there is one, and by writing the file directly on Claude
Code. If the platform cannot present a .md file, present the Markdown content in the
conversation instead, under the filename the convention gives it.
- For a format with no document skill (Claude Code without them, local Python): build that file with a short Python script —
.docx via python-docx, .xlsx via openpyxl, .pdf via weasyprint, falling back to
fpdf2 if weasyprint is unavailable or fails (load a Unicode TTF font when the text falls
outside Latin-1). For a right-to-left output language,
keep weasyprint for the PDF — it shapes RTL text and fpdf2 does not by default — and set
paragraph direction in the Word file and sheet direction in the workbook (openpyxl exposes
sheet_view.rightToLeft); the fpdf2 fallback is off for a right-to-left language,
so if weasyprint is unavailable, ask the user to install it or take Markdown instead. Save to
the working directory or a path the user gives you, and report the absolute file path. If a
library is missing, ask the user before running pip install, or offer Markdown as a fallback.
- Page size: A4 for the Word and PDF files, on every platform
- With several formats, every file renders the same analysis: the same use cases, the same
counts, the same flagged items
Filename convention: Use_Cases_[Source_Name]_[LANG]_[YYYY-MM-DD].[ext] — underscores
as field separators, ISO date, LANG = the uppercase ISO 639-1 code of the output language (EN, IT,
AR), or the shortest ISO code the language has when it has no two-letter one (SCN for Sicilian);
in the source name, spaces and every character outside letters, digits, hyphens and underscores
become underscores, and [Source_Name] is shortened to at most 60 characters so the whole filename
stays under 100; two languages must never share one filename. With one source file, [Source_Name]
is its name without the extension. With multiple source documents, it is a short combined name or
the project name; a source that never enters the analysis — unreadable, or carrying no requirements
content — does not count among them. With pasted text and no file, use the project or domain name. On regeneration,
append _v2, _v3, … before the extension when the filename would otherwise repeat, so the
earlier file is never overwritten; the filename keeps the first deliverable's date.
Step 8: Final Summary
After delivering the output file(s), provide:
Statistics:
- Total roles identified
- Total use cases extracted
- Total user stories
- Dependency entries mapped, one per Critical Dependencies Matrix row
Coverage Assessment:
- Sections analyzed — the source's own units: document sections, spreadsheet sheets (the file
itself for a sheet-less CSV), or the sentences of pasted text or another section-less source
- Confidence level — the first of these that applies: low when any source could not be read or
carried no requirements, or most use cases rest on inference; medium when Flagged Items carry
ambiguities or contradictions, or a share of the use cases is
(inferred); high when every
functional requirement of the source reached a use case, no source was lost, and nothing is
flagged
- Areas needing clarification
Key Insights:
- Most complex roles
- Critical dependencies
- Potential gaps or risks
Next Steps Recommendation:
- Follow-up questions, including every decision a Flagged Item leaves to the user
- Stakeholder review areas
- Integration suggestions
Quality Guidelines
Relevance-Based Detail Level
Detail level follows the Priority assigned in Step 5; input item counts cover the mandatory and
optional lists together:
High-Priority Use Cases (core functionality, frequently used, critical for business):
- Detailed Target descriptions (3-5 sentences)
- Comprehensive Input/Output lists (5-15 items each)
- Thorough dependency documentation
Medium-Priority Use Cases (supporting functionality, moderate use):
- Moderate Target descriptions (2-3 sentences)
- Essential Input/Output lists (3-8 items each)
- Important dependencies
Low-Priority Use Cases (edge cases, administrative tasks, infrequent use):
- Concise Target descriptions (1-2 sentences)
- Core Input/Output lists (2-5 items each)
- Critical dependencies only
Writing Standards
- Business language: Name actions and data in the actor's business terms, not in implementation terms
- Evidence-based: Base all statements on actual document content
- Inference marked: Where a use case is inferred, give the reasoning and mark it
(inferred)
- Consistent terminology: Use same terms throughout for same concepts
- Defined acronyms: Spell out each acronym the first time it appears
- Numbers inside right-to-left text: in a right-to-left output language, keep numeric runs — use case codes such as
ADM-001, step numbers, dates, signed or unit-bearing values — reading left-to-right with direction marks, so a code or a unit never breaks apart
Edge Cases
Unclear, Incomplete, or Missing Information
- Extract with confidence what you can, and continue with the available information
- Create a "Flagged Items" section: name what is unclear or missing, explain why it matters,
and suggest where the answer could be found
- A prerequisite dropped because a special requirement narrowed the analysis, a
requirement the source itself rates
Won't have, and — with several sources, where
other sources keep the run alive — a source excluded because it cannot be read or
carries no requirements, are recorded as Missing Information; the three flagged-item
categories stay as they are
- Provide best-effort inferences with clear notation, and suggest clarifying questions
Contradictory Requirements
- Note both contradictory statements and explain the conflict
- Suggest possible resolutions
- Record all of that under Flagged Items and continue to the deliverable; the user's decision
belongs in Step 8's follow-up questions, rather than gating the file
Source Without Requirements Content
- A document with no functional or requirements content — a brochure, a meeting transcript,
a price list — yields no use cases
- Say what the document appears to be, and ask for the requirements document before extracting
- With several sources this applies per document: continue with the sources that carry
requirements, name the one that does not under Flagged Items and in the completion message,
and stop only when no source carries requirements content
- Never invent a catalog from material that describes no system behaviour
Unreadable Input (Scanned or Image-Only PDF, Unparsable Attachment)
- A scanned, image-only PDF has no extractable text; some platforms also cannot parse other attachment types, such as legacy
.doc on claude.ai
- Say plainly that the file's text cannot be read on this platform
- On Claude Code, offer to convert the file locally if a suitable tool is available (for example LibreOffice for legacy
.doc), and continue from the converted copy
- Otherwise, ask for a text version, a searchable PDF, or a different format
- With several sources, continue from the readable ones, name the unreadable file under Flagged
Items and in the completion message, and stop only when no source can be read
- Never guess or invent the document's content
Very Large Documents
A source beyond roughly 100 pages, or a pasted, Markdown or spreadsheet source of comparable
length where pages do not exist:
- Offer to process in sections
- Create summary structure first
- Generate detailed use cases per section
- Continue each role's numbering across sections rather than restarting at 001 in a new section
- Write each section's completed use cases to the output file before generating the next section, where the environment supports incremental writes, so progress survives context limits
- Combine into final output
1---2name: usecase-extractor3description: Turn a requirements document or spec into use cases and user stories grouped by actor, with codes, flows and dependencies. Use for 'estrai i casi d'uso', 'extract the use cases'. DOCX/XLSX/PDF/MD.4---56# Use Case Extractor78Transform requirements documents and functional specifications into structured, role-based use case documentation following established business-analysis practice.910## Languages1112Source and output languages are independent: a source may be in any language, and13several sources may each be in a different one.1415- **Output language**: whatever the request states. When the request states none, ask in16 Step 2 and apply this default to a reply that still does not choose: the language of the17 request if that is Italian or English, Italian otherwise. User-facing messages always18 follow the language of the request, including Step 2's question.19- **Written in the output language**: section headings, sheet names, field labels, priority20 values, the Coverage Assessment value, the five relationship-type words, and the21 flagged-item categories — one fixed term per relationship type across the whole document,22 listed in a legend: the Appendix in the document formats, under the dependencies matrix in23 the Excel workbook.24- **Kept in the source language**: the `Source` citation, which quotes the document's25 own section wording and identifier. The `(inferred)` marker beside it is the analysis's26 own annotation rather than part of the quotation, so it follows the output language.27- **Translated with the source term kept**: the document's own vocabulary — entity,28 status, screen, and field names — written as the output-language term with the29 source's term in parentheses at first use, as in `Draft status (Bozza)` (English30 output citing an Italian source's `Bozza`); later mentions use the output-language31 term alone. Descriptive prose — Target, Main Flow, Variations, User Story — is32 written fully in the output language.33- **Never translated**: use case codes and role prefixes. A prefix follows the source,34 the way a citation does: the ten standard prefixes are a fixed vocabulary in every35 language, and a custom prefix takes three letters from the role name as the source36 document writes it (`Medico` gives `MED`); when that script is not Latin, the three37 letters come from a standard romanization of the role name (`医師` gives `ISH`). The38 same analysis therefore carries the same codes in every output language, and the39 legend gives each prefix its role name in the output language — the Appendix in the40 document formats, Sheet 1's Roles Summary Table in the Excel workbook.4142## Reference files — read each when its step runs4344- `references/examples.md` (Steps 4–5) — worked extraction examples across domains and languages. Read it before extracting and structuring use cases.45- `references/format-templates.md` (Steps 2, 7) — exact output templates for each format, and the format-selection logic. Read its Format Selection Logic section when Step 2 must recommend a format, and the whole file before generating the output file(s).4647## Workflow4849### Step 1: Comprehensive Document Analysis5051Read all source documents thoroughly before extracting anything — uploaded files and requirements text supplied in the conversation. Then say in a sentence or two what kind of document it is and what it appears to cover. Accepted inputs: PDF, Word (`.doc`/`.docx`), Rich Text (`.rtf`), Excel (`.xlsx`), CSV (`.csv`), Markdown, and plain text. If a file's text cannot be read on this platform — a scanned, image-only PDF, or an attachment type the platform cannot parse, such as legacy `.doc` on claude.ai — handle it under Unreadable Input (see Edge Cases).5253Identify:54- Business domain and context55- Project scope and objectives56- All functional and technical requirements57- Non-functional requirements — performance, security, usability, compliance (they feed the non-functional requirements section)58- Stakeholder needs and expectations59- Constraints and assumptions60- Explicitly stated use cases61- Implicitly described use cases (inferred from requirements)62- Ambiguities, contradictions, and missing information (they feed Flagged Items)6364### Step 2: Output Configuration6566The output language decides the words of every field extracted in Steps 4–5, so settle it67here, before any of that prose is written.6869Ask only after Step 1 has produced readable requirements content. A source whose text cannot70be read takes the Unreadable Input path, and a source that carries no requirements content71takes the Source Without Requirements Content path — neither reaches a configuration question72or a deliverable.7374Prompt user ONCE. The template below shows every question; ask only the ones the request has not already answered:7576```77Language for the output document?78- 1) Italian79- 2) English80- 3) Other (please specify)81No choice means [the default that applies to this request].8283Output format?84- A) Word document (.docx) - default85- B) Excel spreadsheet (.xlsx)86- C) PDF document (.pdf)87- D) Markdown file (.md)88- E) Multiple formats - name the combination8990Reply with language and format, or just say "proceed" for those defaults.91Special requirements are welcome.92```9394Rules:95- Ask only what the user's request has not already stated96- Compute the default language from the Languages section and name it in the question, rather97 than printing the placeholder98- Apply any special requirement from the answers to the deliverable where the format allows it; name anything that could not be applied in the completion message99- A special requirement that narrows the analysis — one role only, one section only — applies100 from Step 3 onward, rather than as a filter over a finished extraction101- If the user's reply does not choose, the defaults apply — the Languages section's output language, and `.docx`102- If the user asks for a format outside A-E, say so and offer the closest supported format; wait for a supported choice before generating103- When the user is undecided or asks for a recommendation, recommend one format using the selection logic at the end of `references/format-templates.md`, and wait for the user's choice before generating104105After the answers: "Proceeding with the use case documentation in [LANGUAGE] as [FORMAT]. No further questions unless the source or the environment forces one."106107### Step 3: Actor and Role Identification108109Extract and categorize all actors:110- **Explicit actors**: Users, roles, and stakeholders mentioned directly111- **Implicit actors**: Roles inferred from actions and requirements112- **System actors**: External systems, APIs, automated processes113114Assign clear identifier prefixes (3 letters, uppercase):115- **ADM** = Administrator116- **USR** = End User / General User117- **DEV** = Developer118- **OPR** = Operator119- **MGR** = Manager120- **SYS** = System (automated processes)121- **API** = API Consumer / External System122- **AUD** = Auditor123- **SUP** = Support Staff124- **CST** = Customer125- Create custom prefixes for domain-specific roles as needed (e.g., DOC for Doctor, NUR for Nurse)126- Each prefix must be unique across the analysis; if two roles suggest the same three letters, differentiate one of them127128Write a 2-3 sentence description of each role — its responsibilities and its position in the system. Every output format carries it.129130### Step 4: Use Case Extraction and Numbering131132For each identified role:1331. Extract explicit use cases already defined in document1342. Infer use cases from functional requirements, business processes, user needs, and data flows1353. Assign sequential numbering starting at 001 for each role prefix136 - Format: `[PREFIX]-[NUMBER]` (e.g., ADM-001, ADM-002, USR-001)1374. Maintain logical order based on workflow or document structure138139Granularity:140- An entity the source creates, reads, updates and deletes yields one use case per operation,141 rather than one use case that manages the entity142- An interaction with an external system splits into the initiating role's use case and a143 system-role use case that handles the response, rather than one use case spanning both144 sides; the failure of that response is a `Variations` entry, not a third use case145146Each use case belongs to exactly one owning role — the role that performs it. A role that only takes part in it reaches it through Dependencies, never as a second copy under its own prefix. A role that inherits another role's access states that in its description, rather than re-listing that role's use cases.147148An actor that owns no use case — one the document names only as the receiver of an output — gets no section, no prefix, and no place in the role count. Name it in the description of the role it interacts with, and under Flagged Items when the source implies it should act but never says how.149150### Step 5: Detailed Information Extraction151152For each use case (worked examples: `references/examples.md`), extract and structure the153fields below, written in the output language Step 2 settled. A field with nothing to154record carries the output language's word for none — one fixed term across the whole155document — the way `Dependencies` does, rather than being dropped or filled with invented156content. `Acceptance Criteria` is the one exception, stated at the field itself.157158**Code**: `[PREFIX]-[NUMBER]`159160**Name**: Concise, action-oriented name (3-7 words)161- Use verbs: Create, Update, Delete, View, Generate, Approve, Configure, Process162- Example: "Register New User", "Generate Monthly Report", "Approve Purchase Order"163164**Title**: `[PREFIX]-[NUMBER]: [Name]`165- Example: `ADM-001: Configure System Settings`166167**Priority**: High, Medium, or Low168- Follows the priority the source states, when it states one: a MoSCoW rating maps169 `Must have` to High, `Should have` to Medium, and `Could have` to Low170- A `Won't have` requirement is outside the release's scope, so it reaches Flagged Items171 rather than a use case (see Edge Cases)172- A numbered scale — `P1`–`P4`, `1`–`5`, or any other the source uses — maps its most critical173 tier to High, its least critical tier to Low, and every tier between them to Medium174 - The source's own legend names the most critical tier; with no legend, the lower number is the175 more critical one, so `P1` outranks `P4` and `1` outranks `5`, and that reading goes under176 Flagged Items as an ambiguity, since inverting it would re-rank every use case177- Otherwise assign it from business criticality and expected frequency of use together: a High178 use case is core functionality that is both frequently used and business-critical, so a179 frequently used supporting step stays Medium180- Drives the detail level applied to this use case (see Quality Guidelines)181182**Target**: Clear goal description — length follows the assigned Priority (see Quality Guidelines)183- Explain what user wants to accomplish184- Describe business value and purpose185- Include relevant context186187**Main Flow**: Numbered steps of the primary path (3-7 steps)188- One actor action or system response per step189- Example: 1. Customer selects a product 2. System checks availability 3. System adds the item to the cart 4. System updates the cart totals190191**Variations**: Alternative and exception paths, each numbered against the main-flow step it branches from192- Example: `2a. Product unavailable: system suggests similar products and keeps the customer on the page`193- High and Medium priority use cases: alternative and exception paths; Low priority: exception paths only194195**Input Data**: Comprehensive list categorized as:196197*Mandatory* (required):198- Authentication/authorization credentials199- Primary data fields and values200- Required documents or files201- Preconditions202- Configuration parameters203- Validation criteria204205*Optional* (enhance functionality):206- Additional data fields207- Optional documents or attachments208- Preferences and settings209- Contextual information210- Historical data211212**Output Data**: Complete list of all outputs, results, and effects:213- Data created/modified (records, documents, files)214- Results (calculations, reports, analytics)215- Artifacts (documents, exports, printouts)216- Notifications (emails, alerts, messages)217- Events (triggered processes, workflow steps)218- Side effects (logs, audit records, cache updates)219- Status changes (state transitions, flags)220- User feedback (confirmations, error messages)221222**Dependencies**: Related use cases with relationship type:223- Format: `CODE-XXX: Name (relationship type)`224- Relationship types: prerequisite, data dependency, workflow sequence, shared resource, triggering225- The type reads from this use case outward:226 - `prerequisite` — the listed use case must complete first227 - `data dependency` — this use case reads data the listed one produces or holds228 - `workflow sequence` — the listed use case is the next step of the same process229 - `shared resource` — both use the same resource, in no fixed order230 - `triggering` — this use case automatically starts the listed one231- `workflow sequence` and `triggering` point forward, so a listed use case is not always one this use case waits for232- The two use cases at the ends of one relationship may each list it, with the type that233 reads true from their own side: `TEC-001` lists `CAP-001: Approve Closed Service Ticket234 (workflow sequence)` while `CAP-001` lists `TEC-001: Open Service Ticket (prerequisite)`.235 The Critical Dependencies Matrix carries one row per listed entry, so that pair appears236 in it twice, once per direction237- Example: `USR-001: User Authentication (prerequisite)`, `ADM-005: View Audit Log (shared resource)`238- With no dependency, write the output language's word for none, followed by the reason where239 it carries information: `None — triggered automatically by every use case that touches patient data`.240 `triggering` and `data dependency` have no opposite among the five types, so a use case on241 the receiving end of one writes that none line rather than inventing a sixth type242243**Source**: Section of the requirements document this use case comes from, quoted in the document's own wording, with the document's own requirement or use-case identifier when it has one; with several documents, name the document before the section244- Example: `Source: §3.2 User management (REQ-101)`245- Example with several documents: `Source: core-spec.pdf, §3.2 User management`246- With a spreadsheet source, the sheet name and the requirement identifier stand in for the section: `Source: Requirements!REQ-101`; a sheet-less CSV counts as a spreadsheet source and names the file instead: `Source: requirements.csv!REQ-101`247- With a source that has no sections — pasted text, or an uploaded section-less file such as a plain-text file — cite the sentence itself, quoted in its own wording: `Source: «A member can reserve a spot in a class up to 7 days in advance»`248- An inferred use case cites the section or sentence that implies it, marked `(inferred)`249250**User Story**: One per use case, in the standard format251- Example: `As a customer, I want to save items in a cart, so that I can buy them in one order later.`252- For a use case with no human actor (system roles), write the story as the role that benefits from the automation, and name that role in the story; it need not be a registered actor253254**Acceptance Criteria**: 2-3 criteria in Given/When/Then form255- High-priority use cases only; the field is absent from a Medium or Low use case,256 rather than carrying the word for none257258### Step 6: Pre-Delivery Verification259260Before writing the file(s), verify silently:261262- Numbering starts at 001 for each role prefix and is sequential263- Every role prefix is unique across the analysis264- Each use case code appears under exactly one role prefix; a role that inherits265 another's access states that in its description, without re-listing the inherited use cases266- Every use case carries every Step 5 field, with Priority assigned and a User Story written;267 `Acceptance Criteria` is the exception — a High-priority use case carries its 2-3 criteria,268 and the field is absent below High269- Every role carries its 2-3 sentence description270- Target length and input/output item counts match each use case's Priority (see Quality271 Guidelines); Main Flow has 3-7 steps, and a Low-priority use case's Variations carry272 exception paths only273- Dependencies use only the five declared relationship types and reference codes that exist in274 the analysis (anything else goes to Flagged Items)275- The Critical Dependencies Matrix (Excel: the Dependencies Matrix sheet) matches the use276 cases' Dependencies lists — the same code pairs with the same relationship types, in the277 same direction278- Headings, field labels, and priority values are in the output language, while codes,279 prefixes, and `Source` citations follow the source, as the Languages section requires280- Executive Summary counts match the body: roles, use cases, user stories, the High,281 Medium and Low priority counts, and the dependency count, which is the number of rows282 in the Critical Dependencies Matrix283- Ambiguities and contradictions found in Step 1 or Step 5 appear under Flagged Items284- Every functional requirement of the source is cited by at least one use case's `Source`, named285 under Flagged Items, or excluded by a special requirement the user gave — counted in the unit the286 source states them in, the same unit `Source` cites: a section in a document, a row in a287 spreadsheet, a sentence in pasted text or another section-less source288- Every non-functional requirement of the source is listed in the format's non-functional289 requirements section — the Appendix's subsection in the document formats, the Non-Functional290 Requirements table on Sheet 1 in the Excel workbook — or named under Flagged Items291- Word and PDF output is set to A4, and the filename to write follows the convention below292293Fix every failed check silently, before writing the file.294295### Step 7: Output Generation296297Generate the deliverable(s) in the selected format(s) with role-based organization, following298the matching template in `references/format-templates.md`. Pick the branch per format, since a299platform may provide a document skill for one format and none for another:300301- **For a format the platform provides a document skill for** — claude.ai's built-in file creation,302 or Claude Code with the `docx`/`xlsx`/`pdf` skills installed — use it; for `.docx` / `.xlsx` /303 `.pdf`, read and follow its documentation when the platform exposes it. On claude.ai, let the304 platform's file delivery present the file in the conversation — that delivery is the only305 reference to the file, so give no path and no download link. On Claude Code the document skill306 writes the file to disk, so report its absolute path, as the local-Python branch below does.307- **`.md` belongs to neither branch:** it needs no document skill. Deliver it as a file through308 the platform's file delivery where there is one, and by writing the file directly on Claude309 Code. If the platform cannot present a `.md` file, present the Markdown content in the310 conversation instead, under the filename the convention gives it.311- **For a format with no document skill (Claude Code without them, local Python):** build that file with a short Python script —312 `.docx` via `python-docx`, `.xlsx` via `openpyxl`, `.pdf` via `weasyprint`, falling back to313 `fpdf2` if weasyprint is unavailable or fails (load a Unicode TTF font when the text falls314 outside Latin-1). For a right-to-left output language,315 keep weasyprint for the PDF — it shapes RTL text and fpdf2 does not by default — and set316 paragraph direction in the Word file and sheet direction in the workbook (`openpyxl` exposes317 `sheet_view.rightToLeft`); the fpdf2 fallback is off for a right-to-left language,318 so if weasyprint is unavailable, ask the user to install it or take Markdown instead. Save to319 the working directory or a path the user gives you, and report the absolute file path. If a320 library is missing, ask the user before running `pip install`, or offer Markdown as a fallback.321- Page size: A4 for the Word and PDF files, on every platform322- With several formats, every file renders the same analysis: the same use cases, the same323 counts, the same flagged items324325**Filename convention:** `Use_Cases_[Source_Name]_[LANG]_[YYYY-MM-DD].[ext]` — underscores326as field separators, ISO date, LANG = the uppercase ISO 639-1 code of the output language (EN, IT,327AR), or the shortest ISO code the language has when it has no two-letter one (`SCN` for Sicilian);328in the source name, spaces and every character outside letters, digits, hyphens and underscores329become underscores, and `[Source_Name]` is shortened to at most 60 characters so the whole filename330stays under 100; two languages must never share one filename. With one source file, `[Source_Name]`331is its name without the extension. With multiple source documents, it is a short combined name or332the project name; a source that never enters the analysis — unreadable, or carrying no requirements333content — does not count among them. With pasted text and no file, use the project or domain name. On regeneration,334append `_v2`, `_v3`, … before the extension when the filename would otherwise repeat, so the335earlier file is never overwritten; the filename keeps the first deliverable's date.336337### Step 8: Final Summary338339After delivering the output file(s), provide:340341**Statistics**:342- Total roles identified343- Total use cases extracted344- Total user stories345- Dependency entries mapped, one per Critical Dependencies Matrix row346347**Coverage Assessment**:348- Sections analyzed — the source's own units: document sections, spreadsheet sheets (the file349 itself for a sheet-less CSV), or the sentences of pasted text or another section-less source350- Confidence level — the first of these that applies: low when any source could not be read or351 carried no requirements, or most use cases rest on inference; medium when Flagged Items carry352 ambiguities or contradictions, or a share of the use cases is `(inferred)`; high when every353 functional requirement of the source reached a use case, no source was lost, and nothing is354 flagged355- Areas needing clarification356357**Key Insights**:358- Most complex roles359- Critical dependencies360- Potential gaps or risks361362**Next Steps Recommendation**:363- Follow-up questions, including every decision a Flagged Item leaves to the user364- Stakeholder review areas365- Integration suggestions366367## Quality Guidelines368369### Relevance-Based Detail Level370371Detail level follows the Priority assigned in Step 5; input item counts cover the mandatory and372optional lists together:373374**High-Priority Use Cases** (core functionality, frequently used, critical for business):375- Detailed Target descriptions (3-5 sentences)376- Comprehensive Input/Output lists (5-15 items each)377- Thorough dependency documentation378379**Medium-Priority Use Cases** (supporting functionality, moderate use):380- Moderate Target descriptions (2-3 sentences)381- Essential Input/Output lists (3-8 items each)382- Important dependencies383384**Low-Priority Use Cases** (edge cases, administrative tasks, infrequent use):385- Concise Target descriptions (1-2 sentences)386- Core Input/Output lists (2-5 items each)387- Critical dependencies only388389### Writing Standards390391- **Business language**: Name actions and data in the actor's business terms, not in implementation terms392- **Evidence-based**: Base all statements on actual document content393- **Inference marked**: Where a use case is inferred, give the reasoning and mark it `(inferred)`394- **Consistent terminology**: Use same terms throughout for same concepts395- **Defined acronyms**: Spell out each acronym the first time it appears396- **Numbers inside right-to-left text**: in a right-to-left output language, keep numeric runs — use case codes such as `ADM-001`, step numbers, dates, signed or unit-bearing values — reading left-to-right with direction marks, so a code or a unit never breaks apart397398## Edge Cases399400### Unclear, Incomplete, or Missing Information401- Extract with confidence what you can, and continue with the available information402- Create a "Flagged Items" section: name what is unclear or missing, explain why it matters,403 and suggest where the answer could be found404- A prerequisite dropped because a special requirement narrowed the analysis, a405 requirement the source itself rates `Won't have`, and — with several sources, where406 other sources keep the run alive — a source excluded because it cannot be read or407 carries no requirements, are recorded as Missing Information; the three flagged-item408 categories stay as they are409- Provide best-effort inferences with clear notation, and suggest clarifying questions410411### Contradictory Requirements412- Note both contradictory statements and explain the conflict413- Suggest possible resolutions414- Record all of that under Flagged Items and continue to the deliverable; the user's decision415 belongs in Step 8's follow-up questions, rather than gating the file416417### Source Without Requirements Content418- A document with no functional or requirements content — a brochure, a meeting transcript,419 a price list — yields no use cases420- Say what the document appears to be, and ask for the requirements document before extracting421- With several sources this applies per document: continue with the sources that carry422 requirements, name the one that does not under Flagged Items and in the completion message,423 and stop only when no source carries requirements content424- Never invent a catalog from material that describes no system behaviour425426### Unreadable Input (Scanned or Image-Only PDF, Unparsable Attachment)427- A scanned, image-only PDF has no extractable text; some platforms also cannot parse other attachment types, such as legacy `.doc` on claude.ai428- Say plainly that the file's text cannot be read on this platform429- On Claude Code, offer to convert the file locally if a suitable tool is available (for example LibreOffice for legacy `.doc`), and continue from the converted copy430- Otherwise, ask for a text version, a searchable PDF, or a different format431- With several sources, continue from the readable ones, name the unreadable file under Flagged432 Items and in the completion message, and stop only when no source can be read433- Never guess or invent the document's content434435### Very Large Documents436437A source beyond roughly 100 pages, or a pasted, Markdown or spreadsheet source of comparable438length where pages do not exist:439440- Offer to process in sections441- Create summary structure first442- Generate detailed use cases per section443- Continue each role's numbering across sections rather than restarting at 001 in a new section444- Write each section's completed use cases to the output file before generating the next section, where the environment supports incremental writes, so progress survives context limits445- Combine into final output