شعار Nim Defect Analysis

Nim Defect Analysis

المجتمع
planetis-m
nim-defect-analysis

Find reliability and security defects in Nim code. Use when reviewing Nim source for bugs, auditing parsers or protocol handlers for crashes, checking FFI or ownership code for memory safety, or reducing false positives in code review findings.

نظرة عامة

الناشرplanetis-m
المستودعskills
اسم المهارةnim-defect-analysis
النجوم
66
التفريعات
7
الملفات المرفقة
تعليمات فقط
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها planetis-m على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Nim Defect Analysis في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/planetis-m/skills/tree/master/nim-defect-analysis
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/planetis-m/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/nim-defect-analysis .claude/skills/nim-defect-analysis
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Nim Defect Analysis في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Nim Defect Analysis تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Nim Defect Analysis بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Nim Defect Analysis

A finding is real when you can demonstrate it; until then it is a hypothesis. Focus on finding and confirming defects, not on elaborate triage mechanics.

Rules

Look Broadly

Review the code for correctness and reliability defects. Do not restrict attention to a fixed checklist of patterns or API names. Common bug sites include:

  • parsing, decoding, deserialization, and any external input handling
  • indexing, slicing, integer arithmetic, and size conversions
  • allocation and accumulation in string, seq, buffers, tables, and queues
  • async I/O, cancellation, shared state, and callbacks
  • C FFI, ptr, cstring, cast, {.emit.}, manual allocation
  • custom =destroy, =copy, =dup, =sink, and =wasMoved
  • exception boundaries where Defect may escape CatchableError handlers
  • logic errors, off-by-one, wrong conditions, missing cases

This list is illustrative, not exhaustive. If something looks wrong, investigate it regardless of whether it matches a known pattern.

Search Efficiently

Use rg to locate risky operations quickly — parsing functions, allocation, pointer operations, casts, FFI imports, ownership hooks. But also read the code to understand its logic. Many bugs are logic errors that no pattern search will find.

Trace Across Function Boundaries

Most false positives and false negatives come from incomplete cross-function reasoning. Do not stop at the function where a risky operation sits.

When a function calls another function with external input:

  • Read the callee. Does it validate, bounds-check, or truncate the input?
  • Check what the callee returns. Does it return a consumed length, a partial result, or an error code the caller might ignore?
  • Trace the data path through every intermediate function, not just the entry point and the crash site.
  • Read type definitions and when defined(...) branches that affect the path.

If you cannot trace the full path from input to failure, you do not have a complete trace. Say so and mark the finding SUSPECTED.

Classify By Evidence, Not Feelings

Use four classes. They describe what you have done, not how confident you feel.

ClassMeans
CONFIRMEDA reproducer, sanitizer, or test demonstrates the failure.
TRACEDComplete static trace from external input to the failure, but no reproducer yet.
SUSPECTEDPartial trace or unclear control flow. Something looks wrong but the path is not fully verified.
FALSE_POSITIVEA guard, type constraint, catch boundary, or unreachable path blocks the issue.

Do not assign numbers. Do not invent probability or confidence scores. State what you found and what evidence you have.

Test Guards, Do Not Debate Them

If you are unsure whether a guard blocks a path, write a reproducer that tests it. Do not spend time reasoning about whether a guard is sufficient when a three-line test can settle it.

Common guard questions a reproducer can answer:

  • Does except CatchableError catch this exception? Defect subclasses (IndexDefect, OverflowDefect, AssertionDefect) are not caught by it.
  • Does -d:danger change the behavior? assert and range checks are disabled; doAssert remains active.
  • Does a bounds check, limit, range conversion, or parser guard actually block the input shape you are testing?
  • Does a consumed-length parser leave trailing input unvalidated?

Use Compiler And Runtime As Primary Evidence

Compiler output, runtime behavior, and sanitizer reports are stronger evidence than pure reasoning. The hybrid approach — use tools, then reason about their output — produces fewer false positives than reasoning alone.

Build and run reproducers with nim c -r. Use doAssert for assertions, not assert — assert is compiled out under -d:danger.

Default build:

bash
nim c -r repro.nim

Additional modes when the bug depends on them:

bash
nim c --panics:on -r repro.nim        # Defect termination behavior
nim c -d:danger -r repro.nim          # Overflow and assertion behavior
nim c --mm:arc -r repro.nim           # Ownership and hook behavior

Sanitizers for unsafe memory, FFI, or manual allocation:

bash
nim c --cc:clang -g -d:noSignalHandler -d:useMalloc \
  --passC:"-fsanitize=address,undefined -fno-omit-frame-pointer" \
  --passL:"-fsanitize=address,undefined -fno-omit-frame-pointer" \
  -r repro.nim

useMalloc exposes Nim allocations to ASan. noSignalHandler lets ASan report signal-based crashes.

Check For Guards

Before reporting, verify whether the path is actually reachable:

  • Does external input reach the defect site?
  • Is there a bounds check, limit, range type, or parser guard?
  • Does a catch boundary catch the exception? Defect subclasses (IndexDefect, OverflowDefect, AssertionDefect) are not caught by except CatchableError.
  • Does -d:danger change the behavior?
  • Are there when defined(...) branches that affect the path?
  • For parser defects: check whether functions that return a consumed length leave trailing input unvalidated.
  • For FFI defects: check pointer lifetime, nullability, struct layout, calling convention, and string ownership.
  • For ownership-hook defects: check move-after-destroy, self-copy, zero-length allocation, and destroy-after-move.

If a guard blocks the path, report FALSE_POSITIVE with the blocking line.

Report Concisely

Each finding needs:

  • file and line
  • what is wrong
  • how input reaches it
  • expected vs actual behavior
  • evidence: reproducer command and output for CONFIRMED, complete static trace for TRACED, partial trace and what is missing for SUSPECTED, blocking guard for FALSE_POSITIVE
  • remediation direction

Keep the report short. Prefer a few well-evidenced findings over many speculative ones.

Workflow

  1. Read the code. Understand what it does, where input enters, and where sensitive operations happen. Read callee functions and type definitions, not just the entry point. Look for anything that could go wrong.
  2. Trace candidate defects. For each suspicious site, trace the full path from input to the operation across function boundaries. Check for guards along the way. If you cannot complete the trace, mark it SUSPECTED and say what is missing.
  3. Write a minimal reproducer. Confirm the bug with the smallest possible input. If a guard's sufficiency is unclear, test it with a reproducer instead of debating it. If you cannot reproduce a traced finding, keep it as TRACED and state what is missing.
  4. Report. List CONFIRMED findings with reproducer evidence, TRACED findings with their complete static traces, SUSPECTED findings with what is missing, and FALSE_POSITIVE findings with the blocking guard.

Common Mistakes

MistakeWhy it is wrong
Marking a source-only claim CONFIRMEDConfirmation requires executable evidence.
Stopping the trace at the function with the risky APIMost false positives come from not reading callees and cross-function data flow.
Debating whether a guard blocks a path instead of testing itA three-line reproducer settles it faster and more reliably.
Reporting a risky API call without a reachable pathAPI presence is not a defect.
Ignoring Defect vs CatchableErrorIndexDefect, OverflowDefect, and AssertionDefect escape ordinary handlers.
Treating assert as a reliable guardassert is compiled out in -d:danger; use doAssert in tests.
Assigning numerical confidence scoresNumbers add false precision without improving the analysis.

References

No reference files.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Nim Defect Analysis؟

Find reliability and security defects in Nim code. Use when reviewing Nim source for bugs, auditing parsers or protocol handlers for crashes, checking FFI or ownership code for memory safety, or reducing false positives in code review findings.

لماذا تستخدم Nim Defect Analysis على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Nim Defect Analysis عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Nim Defect Analysis في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/planetis-m/skills/tree/master/nim-defect-analysis. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Nim Defect Analysis؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Nim Defect Analysis؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Nim Defect Analysis معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Nim Defect Analysis مجانية؟

نشرها planetis-m على GitHub. راجع المستودع للاطلاع على شروط الترخيص. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇