Logo vun Validate Business Logic Against Code

Validate Business Logic Against Code

Communautéit
meirm
validate-business-logic-against-code

Verifies whether documented business logic is actually implemented by mapping BL rules to code evidence. Flags rules as implemented, partially implemented, contradicted, or not found. Use when validating business logic documents, checking code coverage against requirements, or verifying BL-to-code alignment.

Iwwersiicht

Editeurmeirm
Repositoryreverse-engineering-skill
Skill-Nummvalidate-business-logic-against-code
Stären
46
Forks
7
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum meirm op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Validate Business Logic Against Code an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/meirm/reverse-engineering-skill.git /tmp/reverse-engineering-skill
mkdir -p .claude/skills
cp -r /tmp/reverse-engineering-skill/skills/validate-business-logic-against-code .claude/skills/validate-business-logic-against-code
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Validate Business Logic Against Code an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Validate Business Logic Against Code automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Validate Business Logic Against Code net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Validating Business Logic Against Code

Project-agnostic. Use BDD/project_config.yaml → bl_output.root and validation (or entry_points) for BL and code paths when present (see tailor-bdd-skills-for-project).

Purpose

Build trust between documented business logic and actual implementation by systematically mapping each BL rule to concrete evidence in the codebase.

Prerequisites

  • A business logic document (markdown, YAML, or structured text)
  • Access to the relevant code files
  • Understanding of the project structure

Instructions

Step 1: Parse Business Logic Document

Read the BL document and extract all explicit rules:

bash
# Read the BL document
cat path/to/bl_document.md

Extract and categorize rules:

  • Validation rules: What conditions are checked
  • State transition rules: How state changes
  • Billing/credit rules: When charges occur
  • Error handling rules: How failures are processed
  • Workflow rules: Sequential/parallel operations
  • Routing/fallback rules: Provider selection logic

Step 2: Identify Relevant Code Files

For each rule category, identify the code files that would implement it:

bash
# Search for relevant code
grep -r "keyword" django_app/

Common mapping (adapt to your project):

  • Validation rules → views, serializers, validators
  • State transitions → models, state handlers
  • Billing rules → billing/ledger services, models
  • Error handling → views, task handlers
  • Workflow → entry points, background tasks
  • Routing → route handlers, middleware

Use BDD/project_config.yaml → entry_points and validation for actual paths when present.

Step 3: Map Each Rule to Code Evidence

For each extracted rule, search for implementation evidence:

Status Categories:

StatusDefinition
ImplementedClear, direct implementation matching BL
Partially ImplementedSome cases covered, edge cases missing
ContradictedCode does opposite of what BL states
Not FoundNo evidence of implementation
Hidden BehaviorCode does something not documented in BL

Evidence to collect:

  • File path and line numbers
  • Function/method names
  • Relevant code snippets
  • Model fields or constants

Step 4: Generate Coverage Matrix

Create a markdown table with this structure:

markdown
| BL Rule | Status | Evidence | Notes |
|---------|--------|----------|-------|
| [Rule summary] | [Status] | [file:line] | [Details] |

Step 5: Generate Summary Report

After mapping all rules, create a summary with:

  1. Coverage Statistics:

    • Total rules documented
    • Rules implemented (count and %)
    • Rules partially implemented (count and %)
    • Rules contradicted (count and %)
    • Rules not found (count and %)
  2. Critical Issues:

    • All contradicted rules
    • All not-found rules
    • Hidden behaviors that could impact billing or security
  3. Recommendations:

    • Which BL rules need clarification
    • Which code needs updates to match BL
    • Which tests are needed to verify alignment

Step 6: Save the Report

Save the coverage matrix and report to a file (e.g. under project root or [bl_root]):

bash
# Example: reports or BL output directory
mkdir -p reports/bl-validation
# or use BDD/project_config.yaml bl_output.root if desired
cat > reports/bl-validation/<domain>-validation.md

Best Practices

  • Be specific with evidence: Always include file:line references
  • Distinguish intent from bug: Code may implement correctly but have a bug
  • Check both happy and sad paths: Validate error handling too
  • Look for side effects: Some rules have hidden implementation side effects
  • Verify model constraints: Some rules are enforced at the database level
  • Check for multiple implementations: Same rule may be implemented in multiple places
  • Be thorough: Search multiple terms for each rule (e.g., "timeout", "retry", "fallback")
  • Read actual code: Don't rely on function names alone

Examples

Example 1: Validating request/operation BL

User request:

Validate the [feature] business logic against the backend code

You would:

  1. Read the BL document extracting rules, e.g.:

    • "Reject requests with invalid identifier format"
    • "Charge only on successful completion"
    • "Fallback to secondary handler after 30 second timeout"
    • "Reject when account has insufficient balance"
  2. Search code for evidence (use project config paths or typical locations):

    bash
    grep -r "identifier\|validate" <code_root>/
    grep -r "charge\|credit\|balance" <code_root>/
    grep -r "timeout\|fallback\|secondary" <code_root>/
  3. Read implementation files to verify and note file:line.

  4. Generate coverage matrix:

    markdown
    | BL Rule | Status | Evidence | Notes |
    |--------|--------|----------|------|
    | Reject invalid identifier | Implemented | path/to/views.py:88-97 | Validation matches BL |
    | Charge on success only | Contradicted | path/to/billing.py:145-160 | Charges before completion |
    | Fallback on timeout | Partially implemented | path/to/service.py:210-235 | Only for timeout, not 5xx |
    | Reject insufficient balance | Implemented | path/to/views.py:102-115 | Check before operation |
  5. Report findings with coverage %, critical issues, and gaps.

Example 2: Validating export/workflow BL

User request:

Check if the [export/workflow] feature matches the documented business rules

You would:

  1. Extract BL rules from documentation (e.g. state requirements, filters, limits, audit).

  2. Search codebase using project paths (from config or standard layout).

  3. Read relevant files and map each rule to evidence.

  4. Generate matrix with Status (Implemented / Partially / Contradicted / Not found) and file:line Evidence.

  5. Report coverage %, critical gaps (e.g. missing filter, wrong limit), and any hidden behavior not in BL.

Example 3: Validating billing/admin workflow

User request:

Verify the [replenishment/adjustment] workflow against business logic

You would:

  1. Extract BL rules (minimum amount, who can perform, ledger entry, quota update, audit).

  2. Search and read code using project config or typical admin/billing paths.

  3. Generate matrix mapping each rule to Status and Evidence (file:line).

  4. Report coverage and any contradictions or hidden behavior.

Output Format

The validation produces:

  1. Coverage Matrix (table format)
  2. Summary Statistics (counts and percentages)
  3. Critical Issues List (contradictions and missing implementations)
  4. Recommendations (actionable next steps)

Heefeg gestallte Froen

Wat mécht de KI-Skill Validate Business Logic Against Code?

Verifies whether documented business logic is actually implemented by mapping BL rules to code evidence. Flags rules as implemented, partially implemented, contradicted, or not found. Use when validating business logic documents, checking code coverage against requirements, or verifying BL-to-code alignment.

Firwat Validate Business Logic Against Code op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Validate Business Logic Against Code besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Validate Business Logic Against Code an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Validate Business Logic Against Code benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Validate Business Logic Against Code benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Validate Business Logic Against Code domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Validate Business Logic Against Code gratis?

Jo. De Skill gëtt vum meirm ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇