usecase-flows

A map of the ways an automation handles events such as issues, pull requests, pushes, and one-off actions. It shows which use case and ordered steps run for each event.

In plain words
What is it for?
Tracing execution from mainRun through permission checks, branch preparation, issue or pull-request handling, and commit handling. It can also help review or change the order of those steps.
Why use it?
It makes a large event-handling system easier to understand and helps developers see why a particular action path was chosen.

Cursor rule for Cursor

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 rules/vypdev/copilot/usecase-flows
Clone the repo
git clone --depth 1 https://github.com/vypdev/copilot

Made for: Cursor.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,630 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.00017 $0.01630
Opus 5 $0.00009 $0.00815
Sonnet 5 $0.00003 $0.00326
Haiku 4.5 $0.00002 $0.00163

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

Security

Grade A, and why

usecase-flows 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 yesterday.

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.

.cursor/rules/usecase-flows.mdc · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Use case flows (schematic)

Entry point: mainRun(execution) in src/actions/common_action.ts. After execution.setup() and optionally waitForPreviousRuns, the dispatch is:

mainRun
├── runnedByToken && singleAction → SingleActionUseCase (only if validSingleAction)
├── issueNumber === -1 → SingleActionUseCase (only if isSingleActionWithoutIssue) or skip
├── welcome → log boxen and continue
└── try:
    ├── isSingleAction        → SingleActionUseCase
    ├── isIssue                → issue.isIssueComment ? IssueCommentUseCase : IssueUseCase
    ├── isPullRequest          → pullRequest.isPullRequestReviewComment ? PullRequestReviewCommentUseCase : PullRequestUseCase
    ├── isPush                 → CommitUseCase
    └── else                   → core.setFailed

1. IssueUseCase (on: issues, not a comment)

Step order:

  1. CheckPermissionsUseCase → if it fails (not allowed): CloseNotAllowedIssueUseCase and return.
  2. RemoveIssueBranchesUseCase (only if cleanIssueBranches).
  3. AssignMemberToIssueUseCase
  4. UpdateTitleUseCase
  5. UpdateIssueTypeUseCase
  6. LinkIssueProjectUseCase
  7. CheckPriorityIssueSizeUseCase
  8. PrepareBranchesUseCase (if isBranched) or RemoveIssueBranchesUseCase (if not).
  9. RemoveNotNeededBranchesUseCase
  10. DeployAddedUseCase (deploy label)
  11. DeployedAddedUseCase (deployed label)
  12. If issue.opened:
    • If not release and not question/help → RecommendStepsUseCase
    • If question or help → AnswerIssueHelpUseCase

2. IssueCommentUseCase (on: issue_comment)

Step order:

  1. CheckIssueCommentLanguageUseCase (translation)
  2. DetectBugbotFixIntentUseCase → payload: isFixRequest, isDoRequest, targetFindingIds, context, branchOverride
  3. ProjectRepository.isActorAllowedToModifyFiles(owner, actor, token) (permission to modify files)
  4. Branch A – if runAutofix && allowed:
    • BugbotAutofixUseCaserunBugbotAutofixCommitAndPush → if committed: markFindingsResolved
  5. Branch B – if !runAutofix && canRunDoUserRequest && allowed:
    • DoUserRequestUseCaserunUserRequestCommitAndPush
  6. If no file-modifying action ranThinkUseCase

Read the full file on GitHub · 149 lines

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. yesterday First seen · 149 lines · 17 tokens per session scan A e546d0ecebfc

Subscribe to this mod's changes

usecase-flows is a cursor rule published in the GitHub repository vypdev/copilot (2 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 1,630 once invoked, about $0.0001 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-31.