Agent skill
writing-use-cases
Create structured use case documentation with sequence diagrams for backend systems. Use when documenting API endpoints, service interactions, event flows, or system behaviors. Triggers on requests like "document this use case", "create use case for X endpoint", "write flow documentation", or "explain how X feature works".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/writing-use-cases
SKILL.md
Writing Use Cases
Create use case markdown files that document backend flows with mermaid sequence diagrams.
Discovery Workflow
- Identify entry point - Find the controller/handler for the endpoint
- Trace the flow - Follow method calls, service interactions, external calls
- Find events - Look for message publishing (SNS, Kafka, RabbitMQ, etc.)
- Map state transitions - Identify entity state changes
- Note validations - Document validation rules and constraints
Output Structure
# {Feature Name} Use Case
## Overview
{1-2 sentences: what this use case does and when it's triggered}
## Flow
{mermaid sequence diagram - see references/mermaid-patterns.md}
## Key Points
- **Entry Point:** `{HTTP method} {path}` ([`{ControllerName}`]({relative-path}))
- **Request Model:** [`{DtoName}`]({relative-path})
- **State Transition:** {from} → {to}
- **Event:** `{EventName}` published to {destination}
- **Validation:** {key validation rules}
Output File
- Use the
docs/{use case name}-use-case.mdas output file location (DEFAULT). - Ask the User, if the default is fine or another location should be used.
Writing Guidelines
- Keep overview concise (1-2 sentences)
- Use relative links to source files
- Include all actors and systems in the diagram
- Group related operations with
Note overblocks - Use
alt/elsefor conditional flows - Document both success and error paths when relevant
Mermaid Patterns
See references/mermaid-patterns.md for sequence diagram syntax and examples.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?