Logo Resolve Design Errors

Resolve Design Errors

Tổ chứcPhổ biến
matlab
resolve-design-errors

Use when asked to run Design Error Detection (quick defect scan), find design errors in a Simulink model, perform root cause analysis on DED findings, fix division-by-zero, overflow, dead logic or out-of-bounds defects detected by SLDV, or diagnose why missing coverage cannot be achieved (dead logic blocking coverage objectives). Do NOT use for requirement verification, test generation, Inf/NaN detection, active logic analysis, or coverage measurement.

Tổng quan

Nhà phát hànhmatlab
Kho mãsimulink-agentic-toolkit
Tên kỹ năngresolve-design-errors
Sao
1.2K
Bản fork
112
Tệp đi kèm
27
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 dùng hướng dẫn viết bằng Markdown thay vì 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ộ.

  • 27 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được matlab công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Resolve Design Errors 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 của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/verification-validation-and-test/resolve-design-errors
  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/matlab/simulink-agentic-toolkit.git /tmp/simulink-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/simulink-agentic-toolkit/skills-catalog/verification-validation-and-test/resolve-design-errors .claude/skills/resolve-design-errors
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 Resolve Design Errors 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ự nạp Resolve Design Errors 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 bạn có thể dùng Resolve Design Errors với cả những mô hình khác ngoài mô hình ban đầu. 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 khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổ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.

Detecting Design Errors (SLDV DED + Root Cause Analysis)

When to Use

  • User asks to check a Simulink model for design errors (division-by-zero, overflow, dead logic, out-of-bounds)
  • User asks to find root causes of DED findings
  • User asks to fix or understand an analysis finding
  • User asks why there is missing coverage due to dead logic (dead logic gates prevent coverage objectives from being satisfied)
  • User has SLDV artifacts (.mat file) and wants analysis without re-running DED

When NOT to Use

  • Requirement verification — checking if a model satisfies a requirement
  • Test generation or test authoring — creating test cases from requirements or for coverage
  • Comprehensive verification — this skill is a quick defect scan, not an exhaustive proof; a clean result does not guarantee the model is free of all errors
  • Coverage measurement — this skill does not measure or report model coverage; use Simulink Coverage tools

Safety Rules

  1. Never patch the original model directly. Always clone first before applying any fix.
  2. NEVER apply fixes without explicit user approval. After root cause analysis, present findings and suggest a fix strategy — then STOP and wait for the user to say "yes, apply it" or "go ahead." Even if the user's prompt says "suggest a fix" or "fix it," you must present the plan first and wait for confirmation. Do NOT create clone models, set parameters, or run verification until the user explicitly approves.
  3. SLDV results are always sound. Never assume SLDV returns false positives. If SLDV reports a defect, it is a real defect — treat every finding as a true positive and investigate accordingly.

Requires: MATLAB R2023b+, Simulink Design Verifier, Simulink Check / Model Slicer.

Prerequisites

All script functions live in the skill's scripts/ directory. Use evaluate_matlab_code with project_path set to that folder so MATLAB can find them.


Workflow

This skill provides two functions that automate SLDV-driven analysis the agent otherwise gets wrong when hand-rolling it, then hands you the facts to classify and fix findings. The workflow is four steps:

1. Detect errors      → sldv_run_defect_checker   (use the function; don't hand-roll DED)
2. Root cause errors  → sldv_find_de_root_cause    (use the function; don't hand-roll slicing)
3. Classify errors    → agent step (dead logic: intentional vs. design_error)
4. Fix errors         → agent step (propose, get approval, clone-fix-verify)

Steps 1–2 are the two functions. Steps 3–4 are agent judgment based on their output. Full API detail (return fields, options, caching, sub-functions) is in references/api-reference.md — load it when you need exact fields or options.

Step 1 — Detect errors

Call sldv_run_defect_checker(model) instead of writing your own SLDV DED invocation or parsing objectives by hand — it configures the analysis, runs DED, and auto-loads cached *_sldvdata.mat results when available.

matlab
result = sldv_run_defect_checker("my_model", OutputDir="artifacts/ded")

If result.Status == "pass": STOP. Report "No design errors of the checked types were detected" and end the workflow. Do NOT call sldv_find_de_root_cause or investigate further. DED is a quick scan, not an exhaustive proof — tell the user no defects of the checked types were found, not that the model is error-free.

Proceed to Step 2 only when result.Status == "fail".

Step 2 — Root cause errors

Call sldv_find_de_root_cause(model, DedResult=result.DedResult) instead of hand-building slices — it returns backward slices, counterexamples, locality (blast-radius) measures, and shared-root cascade annotations for every finding.

matlab
rca = sldv_find_de_root_cause("my_model", DedResult=result.DedResult, OutputDir="artifacts/ded")

Then trace each finding to its root cause:

  1. Follow the counterexample through rca.SliceBlocks to find which block produces the defect-triggering value
  2. Use model_overview / model_read to understand each block's role
  3. Prefer high-Locality blocks (narrow blast radius, safer) and high-FindingCount blocks (fix resolves more defects); check rca.Cascades — a shared-root fix resolves multiple findings at once

When the slice is shallow (< 3 blocks) or stops at a Stateflow / MATLAB Function block: the Model Slicer cannot trace through those constructs. Do NOT stop and report only what the tool returned — fall back to model_read / model_overview to interpret the finding: read the defect block and its upstream connections, read the Stateflow chart or MATLAB Function logic the slice stopped at, and cross-reference counterexample values to see which branch is active.


Step 3 — Classify errors (dead logic)

Classification happens after root cause analysis — you need to see the root cause (which block, what value) before deciding whether dead logic is intentional.

Findings arrive pre-enriched. For every dead logic finding, sldv_find_de_root_cause attaches on the finding struct:

  • finding.ModelContext — a model_read dump of the block's surrounding scope. You do not need to call model_read again for this. (If empty — model_read was unavailable — fall back to model_overview / model_read yourself for that block.)
  • finding.PatternCatalog — the entire dead-logic pattern library (catalog index + every pattern), concatenated. You do not need to open the YAML files yourself.
  • finding.Classification — "pending", awaiting your decision.

How to classify. For each dead logic finding, using ModelContext and PatternCatalog:

  1. Look at the root cause block — what value does it produce that makes the branch dead?
  2. Compare the model context against the patterns in PatternCatalog.
  3. Decide: is the block INTENTIONALLY producing this value (safety guard, disabled feature, complementary Stateflow guards) or is it a BUG (wrong parameter, cascading error)?

Set the classification:

  • "intentional" — defensive logic, enable-as-input, negation guard pairs → no fix needed; report to the user as expected behavior
  • "design_error" — wrong parameter, cascading dead logic, short-circuit → fix the root cause
  • "unclassified" — unclear → ask the user

Only apply fixes for "design_error" findings.


Step 4 — Fix errors

The functions provide facts; you identify root causes and decide fixes — there is no hardcoded defect-to-fix mapping.

When you are ready to propose or apply a fix, load and follow references/fix-strategy.md. It covers root-cause identification, the clone-fix-verify procedure, fix principles, and the blast-radius discussion required for every proposal.

Two rules that always apply (see Safety Rules): present findings and wait for explicit approval before applying anything, and propose a fix for every design_error finding — 2–3 ranked options each when possible — rather than stopping after only some.


Common Mistakes

MistakeFix
Continuing after Status == "pass"STOP. Zero falsified objectives = no defects. Do not call sldv_find_de_root_cause or investigate further. Report "no defects found" and end.
Calling sldv_find_de_root_cause without DedResult or DataFilePass one of the two — check result.DedResult from the checker
Running on an unsaved modelSave first; DED needs a file on disk
Applying fixes without presenting findings to userAlways show root cause analysis results first, get approval before fixing
Stopping at a shallow sliceFall back to model_read / model_overview (Step 2)
Running on large models without OutputDirSet OutputDir to avoid temp-dir clutter

Copyright 2026 The MathWorks, Inc.


Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

Kỹ năng AI Resolve Design Errors làm được gì?

Use when asked to run Design Error Detection (quick defect scan), find design errors in a Simulink model, perform root cause analysis on DED findings, fix division-by-zero, overflow, dead logic or out-of-bounds defects detected by SLDV, or diagnose why missing coverage cannot be achieved (dead logic blocking coverage objectives). Do NOT use for requirement verification, test generation, Inf/NaN detection, active logic analysis, or coverage measurement.

Vì sao nên dùng Resolve Design Errors 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. Resolve Design Errors 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 Resolve Design Errors trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/verification-validation-and-test/resolve-design-errors. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng 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 Resolve Design Errors?

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.

Có thể dùng Resolve Design Errors 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 Resolve Design Errors 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 Resolve Design Errors có miễn phí không?

Kỹ năng này được matlab phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. 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 các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công 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à những tiêu chí mà kết quả cần đáp ứng. 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 👇