business-logic-extractor

Extract business rules from code into a traceable specification with file:line provenance.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/Jin9/skillify-foundation --skill business-logic-extractor-jin9
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: business-logic-extractor
Source: https://github.com/Jin9/skillify-foundation/tree/main/treasury/business-logic-extractor
Command: npx skills add https://github.com/Jin9/skillify-foundation --skill business-logic-extractor-jin9

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Codebases accumulate business rules that are never written down, and summarizing them by hand drops edge cases and loses track of where each rule lives. This Skill reverse-engineers the implemented decision logic from a module or service into an auditable rules specification where every rule cites exact code locations and omissions are explicitly accounted for. ## Core Features & Use Cases - Provenance-bound rule extraction: Each rule is written as a testable EARS or Given-When-Then statement bound to exact file:line citations, with quoted load-bearing code spans. - Decision-logic rendering: Every rule is rendered as an ASCII flowchart plus provenance-annotated pseudo-code covering each branch and edge case, with no invented edges. - Loss ledger and coverage gating: A companion ledger records decision-site coverage, preserved-versus-abstracted content, omissions, and a human spot-check checklist. - Cross-referencing: Rules are optionally linked to requirement IDs and execution-trace spans (OTel GenAI / OpenInference) to distinguish live logic from dead code. - Use Case: Point it at a promo-validation service and receive a rules spec showing each guard condition, its rejection outcome, and its source lines, plus a ledger flagging any uninspected callers. ## Quick Start Extract the business rules from the payment validation module into a traceable spec with a coverage ledger.

Frequently Asked Questions about business-logic-extractor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract business rules from existing code?▼

Inventory the decision sites in the target module, then write each rule as an EARS or Given-When-Then statement bound to exact file:line citations. Render each rule as an ASCII flowchart plus pseudo-code covering every branch, and record coverage in a loss ledger.

How to reverse-engineer requirements from a codebase?▼

Walk the code-to-spec direction: extract rules with provenance, then link each rule to a requirement ID if a requirements source exists, marking links as proposed until a human confirms. Never invent requirement IDs when no source exists.

Can execution traces verify which business rules actually run?▼

Yes. Cross-reference each rule against OTel GenAI or OpenInference spans and annotate it as exercised, not-observed, or dead with the trace_id and span_id. Absence of trace evidence is recorded as a coverage gap, never as proof of behavior.

Does this generate code, tests, or architecture diagrams?▼

No. The skill is extraction-only in the code-to-spec direction; it produces no code, requirements, tests, or architecture diagrams. The only diagram emitted is a per-rule ASCII decision-logic flowchart of the extracted rules.

Why does the spec need a loss ledger alongside it?▼

Faithfulness checks cannot detect omission, so a correct-looking spec may silently drop edge cases. The ledger reports decision-site coverage, preserved-versus-abstracted content, and enumerated uncertainties, and delivery is gated on it.