Logo Validate Business Logic Against Code

Validate Business Logic Against Code

Cộng đồng
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.

Tổng quan

Nhà phát hànhmeirm
Kho mãreverse-engineering-skill
Tên kỹ năngvalidate-business-logic-against-code
Sao
46
Bản fork
7
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được meirm công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Validate Business Logic Against Code trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Validate Business Logic Against Code trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Validate Business Logic Against Code ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Validate Business Logic Against Code không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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)

Câu hỏi thường gặp

Kỹ năng AI Validate Business Logic Against Code làm được gì?

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.

Vì sao nên dùng Validate Business Logic Against Code trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Validate Business Logic Against Code là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Validate Business Logic Against Code trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/meirm/reverse-engineering-skill/tree/main/skills/validate-business-logic-against-code. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Validate Business Logic Against Code?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Validate Business Logic Against Code với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Validate Business Logic Against Code với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Validate Business Logic Against Code có miễn phí không?

Có. Kỹ năng này được meirm phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇