شعار Python Packaging Static Audit

Python Packaging Static Audit

مؤسسة
opendatahub-io
python-packaging-static-audit

Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.

نظرة عامة

الناشرopendatahub-io
المستودعai-helpers
اسم المهارةpython-packaging-static-audit
النجوم
39
التفريعات
76
الملفات المرفقة
2
الترخيصApache-2.0
الروابط
  • تعليمات بصيغة Markdown

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

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

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

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

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

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

التثبيت

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

1

التثبيت في TypingMind

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

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-static-audit
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-python-packaging/skills/python-packaging-static-audit .claude/skills/python-packaging-static-audit
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

يُحمّل النموذج Python Packaging Static Audit تلقائيًا بمجرد ورود طلب ذي صلة بها.

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

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

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

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

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

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

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

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

Python Packaging Static Audit

Runs hexora static analysis on a Python package repository to detect suspicious code patterns such as code execution, encoding/serialization, and native code usage. Produces a self-contained "Hexora Static Analysis" report section with triaged findings and a risk assessment.

Inputs

  • repo_path (required): Local filesystem path to an already-cloned repository
  • output_file (optional): Write the report section to this file path instead of returning it inline. The first line of the file must be RISK_RATING:<value> so the orchestrator can parse it without reading the full report.
  • hexora_results (optional): File path to pre-computed hexora JSON output (hexora-results.json). Schema: {status, total, findings[]}. When provided, skip running run-hexora.sh and parse this file directly for triage. Status values: "success", "unavailable", "timeout", "error".

Step 1: Obtain Hexora Results

Option A - Pre-computed results (CI mode)

If hexora_results is provided and the file exists, read and parse it as JSON:

  • If status is "success": use the findings array as the hexora output. Each entry is a raw hexora JSONL object (rule, severity, file, line, etc.). Rules HX1000, HX1020, HX1030, HX3010, HX3040, HX5000-HX5050, HX6020-HX6060, HX7000-HX7020 are already excluded by the CI runner; minimum confidence is medium. Proceed directly to Step 2 (Triage).
  • If status is "unavailable", "timeout", or "error": skip to the Output section and produce the report with risk_rating = needs_review, noting the degraded status and any error message from the JSON. Do not re-run hexora. The CI runner already attempted execution under controlled conditions, and re-running in the agent container would likely hit the same failure.
  • For any other status value not listed above: treat it as an error and report risk_rating = needs_review, noting the unrecognized status value.

Option B - Run hexora locally (standalone mode)

If hexora_results is not provided, run the wrapper script which handles hexora installation and applies the tuned rule exclusions:

bash
./scripts/run-hexora.sh <repo-path>
hexora_exit=$?

Check the exit code before proceeding:

  • Exit 0: hexora ran successfully. Capture the JSON output. Each finding contains: rule code, file path, line number, confidence level, and description.
  • Exit 2: hexora is not installed and cannot be auto-installed via uvx. Do not fail. Skip to the Output section and produce the report with risk_rating = needs_review stating hexora was unavailable.
  • Exit 1: hexora encountered a runtime error. Skip to the Output section and produce the report with risk_rating = needs_review noting the error.

The wrapper filters out rules that are too noisy for typical Python packages and sets a minimum confidence of medium. See the script comments for the full exclusion list and rationale.

Step 2: Triage

Review hexora findings in context. Read the relevant source files to understand the purpose of flagged code. Triage proceeds in two stages: deterministic rules first, then AI reasoning for anything unresolved.

Stage 1 — Deterministic Rules

Apply the following rules before any AI reasoning. These handle the most common clear-cut cases and make the triage reproducible.

ConditionVerdict
Finding is in a file under test/, tests/, benchmarks/, or examples/PASS
Finding references a standard-library import already excluded by run-hexora.sh rule setPASS
Finding is in setup.py, setup.cfg, or pyproject.toml and involves eval, exec, compile, base64, or marshalREVIEW

When multiple findings produce different verdicts, the overall precedence is BLOCK > REVIEW > PASS — the most severe verdict wins.

Any finding not resolved by Stage 1 proceeds to Stage 2.

Stage 2 — AI Reasoning

For findings that remain unresolved after deterministic rules, classify each as:

  • Likely legitimate — pattern is expected for the package's purpose (e.g., subprocess in a CLI tool)
  • Suspicious — pattern is unusual and warrants manual review (e.g., base64 decode in setup.py)
  • Critical — pattern strongly indicates malicious intent (e.g., network exfiltration in install hooks)

Output Format

Produce the following markdown section:

markdown
## Hexora Static Analysis

**Findings:** {N total} ({X critical, Y suspicious, Z likely legitimate})

### Critical Findings

| File | Line | Rule | Confidence | Description | Triage |
|------|------|------|------------|-------------|--------|
| setup.py | 42 | HX2000 | Very High | Base64 decode in install hook | Suspicious — no legitimate reason for encoded payloads in setup.py |

### Suspicious Findings

(same table format)

### Likely Legitimate

(same table format, brief — included for completeness but de-emphasized)

The risk_rating for this phase is one of:

  • no_issues — No hexora findings
  • low_risk — All findings classified as "likely legitimate" or PASS
  • needs_review — One or more findings classified as "suspicious" or REVIEW
  • critical — One or more findings classified as "critical" or BLOCK

If output_file is provided, write the file with the first line as RISK_RATING:<value> followed by a blank line and then the markdown section above. If output_file is not provided, return the report section inline.

Error Handling

ScenarioBehavior
Hexora returns empty resultsReport "no findings" for hexora section, risk_rating = no_issues
Hexora is unavailable (uvx and hexora both missing)Report hexora unavailable, risk_rating = needs_review
Pre-computed hexora_results file path provided but file missing, unreadable, or invalid JSONReport hexora unavailable, risk_rating = needs_review
Pre-computed hexora_results has degraded status (unavailable/timeout/error)Do not re-run hexora; report the degraded status, risk_rating = needs_review

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

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

ماذا تفعل مهارة الذكاء الاصطناعي Python Packaging Static Audit؟

Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.

لماذا تستخدم Python Packaging Static Audit على TypingMind؟

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

كيف أثبّت Python Packaging Static Audit في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-static-audit. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Python Packaging Static Audit؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Python Packaging Static Audit؟

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

هل مهارة الذكاء الاصطناعي Python Packaging Static Audit مجانية؟

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

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

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

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

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

عرض الكل

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

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