Code Guardian: Automated Multi-Phase Security Scanner

Do you fully trust your app's security? This skill turns Claude Code into a dedicated cybersecurity engineer. It scans your entire codebase, dynamically splits the scan into phases based on size, and generates detailed reports with AI-ready fix checklists for every vulnerability.

Smart Scan & Sizing

Instead of a blind scan, the AI first analyzes the entire project structure (counting files/folders). Based on this volume, Claude Code dynamically decides the number of scan phases needed: * Small projects: 1-2 phases. * Medium projects: 3-4 phases. * Large projects: 5-6 phases. Each phase explicitly targets a specific layer (e.g., Authentication, API routes, Database) to ensure zero blind spots.

Actionable Phase Reports

After completing each phase, Claude generates a dedicated Markdown file (e.g., scan-phase-1-auth-layer.md). Each file contains: 1. Clear Scope: What was scanned in this phase. 2. Vulnerability List: Categorized by severity (Critical, High, Medium, Low). 3. Execution Plan (The Core): For every issue, a detailed, highly technical fix checklist is written. These are designed specifically to be handed over to any AI Agent (like Lovable or Cline) for immediate execution.

The Executive Summary

Once all phases conclude, the final scan-summary.md file is generated. This acts as your master dashboard. It aggregates all discovered vulnerabilities across the entire project, sorting them strictly by severity. Next to each issue, it references the exact phase file containing the fix instructions, making task prioritization and delegation incredibly efficient.

حارس الكود: أداة الفحص الأمني الشامل عبر Claude Code

هل تثق تماماً بأمان الكود الخاص بمشروعك؟ هذه الأداة تحول Claude Code إلى مهندس أمن سيبراني متفرغ. ستقوم الأداة بمسح شامل لمشروعك، تقسيمه لمراحل تلقائية حسب حجمه، واستخراج تقارير مفصلة لكل ثغرة أمنية مع خطوات حل جاهزة للتنفيذ فوراً عبر أي AI Agent.

الخطوات

الفحص الذكي والتحليل الأولي

بدلاً من الفحص العشوائي، يقوم الذكاء الاصطناعي أولاً بمسح بنية المشروع بالكامل (عدد الملفات والمجلدات). بناءً على هذا الحجم، يقرر Claude Code عدد مراحل الفحص المطلوبة: * مشاريع صغيرة: مرحلة إلى مرحلتين. * مشاريع متوسطة: 3 إلى 4 مراحل. * مشاريع ضخمة: 5 إلى 6 مراحل. كل مرحلة تستهدف طبقة معينة (مثل: Authentication، API، قواعد البيانات) لتجنب تجاوز أي تفاصيل.

توليد التقارير القابلة للتنفيذ

بعد الانتهاء من كل مرحلة، سيقوم Claude بإنشاء ملف Markdown مخصص (مثال: scan-phase-1-auth-layer.md). كل ملف سيتضمن: 1. وصف دقيق: لما تم فحصه في هذه المرحلة. 2. قائمة الثغرات: مصنفة حسب الخطورة (حرجة، عالية، متوسطة، منخفضة). 3. خطة التنفيذ (أهم جزء): لكل ثغرة، سيتم كتابة خطوات حل (Checklist) مصاغة بطريقة تقنية واضحة جداً، بحيث يمكنك تسليمها مباشرة لأي AI Agent (مثل Lovable أو Cline) ليقوم بتطبيقها فوراً.

الخلاصة التنفيذية الشاملة

بمجرد اكتمال جميع المراحل، سيتم توليد الملف النهائي scan-summary.md. هذا الملف هو لوحة التحكم الخاصة بك؛ يجمع كل الثغرات المكتشفة في المشروع، ويرتبها من الأهم (الحرجة) إلى الأقل خطورة، مع الإشارة بجانب كل ثغرة إلى الملف المرحلي الذي يحتوي على كود الإصلاح وخطواته. هذا يسهل عليك إدارة أولوية العمل وفلترة المهام بسرعة.

Prompt

Skill Name: security-scan

Create a skill for Claude Code that performs a multi-phase security scan on full-stack web app codebases. When triggered, Claude should first scan the project structure to count all folders and files, then automatically determine how many scan phases are needed based on project size (smaller projects get 1-2 phases, medium projects get 3-4, large projects get 5-6; Claude decides the exact threshold based on what it sees).
Each phase should cover a specific combination of: a code domain (e.g. authentication, API routes, database layer, frontend, environment config, third-party integrations) AND a category of security vulnerabilities relevant to that domain (e.g. injection attacks, broken access control, exposed secrets, insecure dependencies, XSS, CSRF, improper error handling).
After completing each phase, Claude must generate a .md file named after that phase (e.g. scan-phase-1-auth-layer.md). Each file must contain: a brief description of what was scanned, a list of identified security issues with severity level (Critical / High / Medium / Low), and for each issue, a detailed checklist of fix steps written clearly enough to be handed directly to an AI agent for execution.
After all phases are complete, generate a final scan-summary.md file that lists all discovered issues across all phases, sorted by severity, with a reference to which phase file contains the detailed fix steps.
The skill targets full-stack web applications. Claude should use general security best practices and common vulnerability knowledge (no specific framework required) and adapt its analysis to whatever stack it detects in the codebase.