Validate Business Logic Against Code logo

Validate Business Logic Against Code

Community
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.

Overview

Publishermeirm
Repositoryreverse-engineering-skill
Skill namevalidate-business-logic-against-code
Stars
46
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by meirm on GitHub. Read the source before you install it.

Installation

Install the Validate Business Logic Against Code AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Validate Business Logic Against Code in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Validate Business Logic Against Code on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Validate Business Logic Against Code is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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)

Frequently asked questions

What does the Validate Business Logic Against Code AI skill do?

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.

Why use Validate Business Logic Against Code on TypingMind?

Because you install it once and use it with any model. Validate Business Logic Against Code is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Validate Business Logic Against Code in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Validate Business Logic Against Code?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Validate Business Logic Against Code?

As many as you like. As long as a model supports skills, you can use Validate Business Logic Against Code with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Validate Business Logic Against Code AI skill free?

Yes. It is published on GitHub by meirm under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇