From forgeplan-brownfield-pack
Maps entry points to user journeys — from trigger to business outcome. Triggers — "extract use case miner", "brownfield use case miner", "/use-case-miner".
How this skill is triggered — by the user, by Claude, or both
Slash command
/forgeplan-brownfield-pack:use-case-minerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Maps entry points to user journeys — from trigger to business outcome.
Maps entry points to user journeys — from trigger to business outcome.
Use cases capture flows in the system at a business level: "Forwarder confirms an order" is a use case; v5.orders.service.js:_confirm is implementation detail. Scenarios, invariants, and canonical docs all depend on a use-case catalog.
use-case artifacts.
Frontmatter:
kind: use-case
id: UC-{auto}
name: "Forwarder confirms an order"
domain: "orders"
actor: "forwarder employee"
entry_point:
type: "graphql_mutation" | "rest_endpoint" | "queue_job" | "scheduled" | "repl" | "event"
ref: "orders_Confirm(id: Int!)"
trigger: "User clicks 'Confirm' button in forwarder UI"
preconditions:
- "Order exists and has status in {created, cargo_owner_confirmed}"
- "Authenticated user belongs to company with type_company='forwarder'"
steps:
- step: 1
description: "Load order by id"
tier: factum
code_ref: {file: "...", line: ...}
- step: 2
description: "Authorize: user.company_id ∈ {order.cargo_owner_id, order.forwarder_id, order.operator_id}"
tier: factum
invariant_ref: INV-003
# ...
outcome:
success: "Order transitions to forwarder_confirmed, cargo markings job enqueued"
failures:
- "Unauthorized → __NOT_FOUND__"
- "Already confirmed by forwarder → no-op (hypothesis)"
invariants_invoked: [INV-005, INV-012]
events_emitted: [OrderStatusChanged, OrderConfirmedByForwarder]
side_effects:
- db_writes: ["orders.status update", "order_cargo init"]
- queue_jobs: ["v5.orders.generate.cargo.markings"]
- indexing: ["ES index update"]
- external: []
related_use_cases: [UC-008, UC-012]
confidence: inferred
Body sections:
enumerateFind all entry points in scope.
output: <entry_point_type, ref, definition_location>[]
traceFor each entry point, follow execution flow.
input: entry point
output: ordered step list with code refs and side effects
synthesizeAggregate traces into use-case artifacts (business-level summaries).
input: trace
output: use-case artifact
mutation: \`` blocks + query: `` blocks in service files.apiGateway.service.js) for routes.createJob( and .add( patterns.moleculer.config.js customCommands or equivalent.broker.emit, broker.broadcast, ctx.emit.grants: metadata on actions.For each entry point:
ctx.call / this.call with its argument shape.throw and its error code.status: 'X' assignments).Given this trace of code, write a business-level use case.
- Actor: {inferred from auth check}
- Trigger: {entry point signature}
- Preconditions: {from auth + validation checks}
- Steps: {summarize the trace at business level, merging consecutive factum steps}
- Outcome: {state transitions + side effects}
coverage = mapped_entry_points / total_entry_points (target ≥ 0.8).
Quality sub-metrics:
% with actor identified (not "unknown").% with preconditions listed.% with failure modes listed.% linked to ≥ 1 invariant.use-case, new relations triggers, causes, emits./autoresearch:learn --mode use-case:
/autoresearch:scenario --source use-case:
See references/trace-prompt.md and references/synthesize-prompt.md (to be created).
| Failure | Detection | Mitigation |
|---|---|---|
| Trace too deep (crosses service boundaries unnecessarily) | Trace > 20 steps | Cap depth, mark as "complex use case, split" |
| Actor ambiguous | Multi-actor code paths | Generate multiple use cases, one per actor branch |
| Entry point is internal (not user-facing) | Not called from outside | Skip (internal action, not a use case) |
| Trace misses async side effect | Queue job not followed | Post-hoc linking: if job consumer exists, add as side-effect |
See examples/tripsales-use-case-sample.md.
Fixture: fixtures/use-case-fixture/ with 3 entry points, expected use-cases documented.
npx claudepluginhub forgeplan/marketplace --plugin forgeplan-brownfield-packProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.