شعار Code Security

Code Security

المجتمع
Firstp1ck
code-security

Agents should invoke this skill for code security reviews, leaked secret checks, dependency risk, unsafe shell/Python/TypeScript/Rust patterns, auth/input-validation flaws, SAST-style audits, or supply-chain concerns in repositories.

نظرة عامة

الناشرFirstp1ck
المستودعpi-coding-agent-forge
اسم المهارةcode-security
النجوم
93
التفريعات
22
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

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

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

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

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

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

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

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

التثبيت

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

1

التثبيت في TypingMind

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

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Firstp1ck/pi-coding-agent-forge/tree/main/pi-skill-code-security/skills/code-security
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge.git /tmp/pi-coding-agent-forge
mkdir -p .claude/skills
cp -r /tmp/pi-coding-agent-forge/pi-skill-code-security/skills/code-security .claude/skills/code-security
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Code Security

Secret scanning, dependency vulnerability auditing, static analysis patterns, and supply chain security for the user's codebases.

Quick Start

Quick Repo Security Check

Run these in order for any repository:

bash
# 1. Check for leaked secrets
grep -rn "sk-proj-\|sk-\|AKIA\|ghp_\|gho_\|github_pat_\|xoxb-\|xoxp-" --include="*.py" --include="*.ts" --include="*.js" --include="*.rs" --include="*.sh" --include="*.toml" --include="*.json" --include="*.yml" --include="*.yaml" --include="*.env" .

# 2. Check .gitignore covers sensitive files
cat .gitignore | grep -i "env\|secret\|key\|token\|credential"

# 3. Check for .env files in repo
find . -name ".env*" -not -path "./.git/*"

# 4. Run dependency audit (language-specific)
cargo audit          # Rust
npm audit            # JavaScript/TypeScript
pip-audit            # Python (via pip install pip-audit)

Secret Scanning

Patterns to Detect

PatternRegexSeverity
OpenAI API keysk-proj-[A-Za-z0-9_-]{20,}Critical
OpenAI legacy keysk-[A-Za-z0-9]{20,}Critical
AWS access keyAKIA[0-9A-Z]{16}Critical
GitHub PATghp_[A-Za-z0-9]{36}Critical
GitHub OAuthgho_[A-Za-z0-9]{36}Critical
GitHub App tokengithub_pat_[A-Za-z0-9_]{22,}Critical
Slack tokenxox[bpors]-[A-Za-z0-9-]{10,}High
Telegram bot token[0-9]{8,10}:AA[A-Za-z0-9_-]{33}High
Discord bot token[MN][A-Za-z0-9]{23,}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,}High
JWT tokeneyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*High
Generic API key[Aa]pi[_-]?[Kk]ey.*[=:]\s*["'][A-Za-z0-9]{20,}Medium
Password in URL://[^:]+:[^@]+@High
Private key header`-----BEGIN (RSAEC
Password assignment[Pp]assword\s*[=:]\s*["'][^"']{8,}High

Manual Secret Scan

bash
# Comprehensive secret scan across a repo
grep -rn \
    -e "sk-proj-" \
    -e "sk-[A-Za-z0-9]\{20,\}" \
    -e "AKIA[0-9A-Z]\{16\}" \
    -e "ghp_" \
    -e "gho_" \
    -e "github_pat_" \
    -e "xox[bpors]-" \
    -e "BEGIN.*PRIVATE KEY" \
    -e "password\s*=" \
    -e "api_key\s*=" \
    -e "secret\s*=" \
    --include="*.py" --include="*.ts" --include="*.js" --include="*.rs" \
    --include="*.sh" --include="*.toml" --include="*.json" --include="*.yml" \
    --include="*.yaml" --include="*.env" --include="*.cfg" --include="*.ini" \
    .

Git History Check

Secrets removed from current files may still be in git history:

bash
# Search git history for secrets (simplified)
git log --all -p | grep -n "sk-proj-\|AKIA\|ghp_\|BEGIN.*PRIVATE KEY"

# Check specific file history
git log --all -p -- "path/to/suspicious/file"

If secrets found in history:

  1. Rotate the credential immediately (it's already compromised)
  2. Use git filter-repo to remove from history (if critical)
  3. Force push (coordinate with team)
  4. Document in MEMORY.md

.gitignore Hygiene

Every repo should ignore:

gitignore
# Secrets and credentials
.env
.env.*
*.pem
*.key
credentials.json
service-account.json
**/secrets/

# IDE and editor files
.idea/
.vscode/settings.json
*.swp

# OS files
.DS_Store
Thumbs.db

Audit checklist:

  • .env and .env.* are in .gitignore
  • No .env files are tracked: git ls-files | grep "\.env"
  • Private keys (.pem, .key) are ignored
  • Credential JSON files are ignored
  • No sensitive files in git history

Dependency Vulnerability Audit

Rust (cargo audit)

bash
# Install cargo-audit if not present
cargo install cargo-audit

# Run audit
cargo audit

# JSON output for parsing
cargo audit --json

# Fix by updating Cargo.lock
cargo update
cargo audit

Evaluate findings:

Advisory SeverityAction
Critical / unmaintainedUpdate or replace immediately
HighUpdate within 24h
MediumInclude in next release
LowUpdate when convenient

JavaScript / TypeScript (npm audit)

bash
# Run audit
npm audit

# Fix automatically where possible
npm audit fix

# Force fix (may include breaking changes)
npm audit fix --force

# JSON output
npm audit --json

Python (pip-audit)

bash
# Install pip-audit
pip install pip-audit

# Audit current environment
pip-audit

# Audit a requirements file
pip-audit -r requirements.txt

# JSON output
pip-audit --format json

Supply Chain Risk Indicators

Look for these red flags in dependencies:

IndicatorRiskCheck
Very new package (<1 month)TyposquattingCheck publish date and download count
Single maintainerBus factorCheck maintainer count
No recent updates (>2 years)AbandonedCheck last commit/release
Unexpected install scriptsMalicious payloadReview postinstall scripts
Excessive permissionsOver-privilegedReview package permissions
Name similar to popular packageTyposquattingCompare with intended package

Static Analysis (SAST) Patterns

Common Vulnerability Patterns

Command Injection:

# Dangerous patterns
os.system(user_input)
subprocess.call(user_input, shell=True)
exec(user_input)
eval(user_input)

Path Traversal:

# Dangerous patterns
open(user_input)               # Unsanitized file path
os.path.join(base, user_input) # Without validation

SQL Injection:

# Dangerous patterns
f"SELECT * FROM users WHERE id = {user_input}"
cursor.execute("SELECT * FROM users WHERE id = " + user_input)

Hardcoded Credentials:

# Dangerous patterns
password = "hardcoded_value"
API_KEY = "sk-..."
conn_string = "postgres://user:pass@host/db"

Language-Specific Checks

Rust:

bash
# Check for unsafe blocks
grep -rn "unsafe" --include="*.rs" .

# Check for unwrap (potential panics)
grep -rn "\.unwrap()" --include="*.rs" .

# Run clippy with security lints
cargo clippy -- -W clippy::all

Python:

bash
# Check for dangerous functions
grep -rn "eval\|exec\|os.system\|subprocess.call.*shell=True" --include="*.py" .

# Check for pickle (deserialization risk)
grep -rn "pickle\|cPickle" --include="*.py" .

# Run bandit (Python SAST)
pip install bandit
bandit -r . -f json

Shell Scripts:

bash
# Check for unquoted variables (injection risk)
# shellcheck is the best tool for this
shellcheck *.sh

# Check for eval with variables
grep -rn 'eval.*\$' --include="*.sh" .

Code Security Report Format

markdown
# Code Security Report: [Repository Name]

**Date:** YYYY-MM-DD
**Analyst:** Zero
**Repository:** [path or URL]
**Commit:** [short hash]

## Summary

| Category | Critical | High | Medium | Low |
|---|---|---|---|---|
| Secrets | X | X | X | X |
| Dependencies | X | X | X | X |
| Code patterns | X | X | X | X |

## Findings

### Secrets
[List any found secrets with file:line references]

### Dependency Vulnerabilities
[List from cargo audit / npm audit / pip-audit]

### Code Vulnerabilities
[List from SAST scan with file:line references]

## Recommendations

1. [Prioritized actions]

## .gitignore Status

- [ ] Adequate for this project type
- [ ] Missing entries: [list]

Zero skill — Code security analysis and dependency auditing

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

ماذا تفعل مهارة الذكاء الاصطناعي Code Security؟

Agents should invoke this skill for code security reviews, leaked secret checks, dependency risk, unsafe shell/Python/TypeScript/Rust patterns, auth/input-validation flaws, SAST-style audits, or supply-chain concerns in repositories.

لماذا تستخدم Code Security على TypingMind؟

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

كيف أثبّت Code Security في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/Firstp1ck/pi-coding-agent-forge/tree/main/pi-skill-code-security/skills/code-security. يقرأ TypingMind ملف SKILL.md الخاص بها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Code Security؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Code Security؟

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

هل مهارة الذكاء الاصطناعي Code Security مجانية؟

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

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

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

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

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

عرض الكل

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

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