From forgeplan-brownfield-pack
> Maps actions, events, and side-effects into causal chains. Builds "X causes Y" relations across the codebase.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forgeplan-brownfield-pack:causal-linkerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Maps actions, events, and side-effects into causal chains. Builds "X causes Y" relations across the codebase.
Maps actions, events, and side-effects into causal chains. Builds "X causes Y" relations across the codebase.
Business behavior is not per-function; it's end-to-end. "Invoice gets issued" is not just _issueInvoice; it also publishes an event, updates items, adjusts sales order, and affects downstream cancel.payment semantics. Scenarios and domain-models need this causal graph.
Graph edges in forgeplan (using new relation types):
causes: action A → outcome B (direct call, synchronous).emits: action → event (async).listens_to: handler ← event.loop: cycle marker (A → B → ... → A).mutates: action → entity state (DB write or in-memory change).requires: action → precondition invariant.Plus: metadata artifacts for bulk causal chains (per entity or per use-case).
trace-staticPer service file, enumerate all ctx.call, broker.emit, this.createJob, DB writes, ES indexing.
resolve-handlersFor each emitted event, find listener(s) in events: {...} blocks.
chainBuild chains from entry points through N hops.
detect-cyclesFind A → B → ... → A patterns.
aggregateAggregate per-entity: for each entity, list all actions that mutate it.
For each action:
ctx.call(actionName, ...) with argument shape.broker.emit(eventName, ...) with payload shape.broker.broadcast(eventName, ...) — same.this.createJob(queueName, ...) — queue push.throw new Error(code) — error emission.update, create, destroy, set.Match emitted event names to listener entries:
events: { 'event.name': handler } blocks.Flag dangling emits (no listener) and dangling listeners (no emitter) as problems.
Depth-first from entry point:
ctx.call, recurse into target action.Standard graph DFS with visit stack:
loop cluster.For each entity (from models/):
causes edges).resolved_edges / total_edges: target ≥ 0.95 (unresolved are dangling).cycles_detected: count; threshold for alert = > 5 (architectural smell).chains_per_use_case: average.dangling_emit_count, dangling_listener_count: target 0./autoresearch:predict --persona causality-analyst:
See references/resolve-handlers-prompt.md.
| Failure | Detection | Mitigation |
|---|---|---|
Dynamic call (ctx.call(variable)) can't resolve | AST shows non-literal | Flag as "dynamic dispatch" + list potential candidates via name pattern |
| Event name mismatch (emitter uses tag, listener uses topic) | Mismatch in grep | Require exact literal string matches; alert on near-matches |
| Library internals masquerade as events | Noise | Filter: only events defined in project code |
| Transitive explosion | > 1000 edges | Tiered view: high-level (service-service) vs low-level (action-action) |
For TripSales:
orders_Confirm(id) mutation.v5.orders.confirm → _confirm → v5.db.orders.update.status → (emit v5.db.orders.update.status event, DANGLING) → v5.orders.elastic.add → queue v5.orders.generate.cargo.markings → v5.orders.generate.cargo.markings handler.Fixture: known chains with known cycles → expect correct graph + cycle detection.
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.