Logo Audit

Audit

Tổ chức
MadAppGang
audit

Kiểm tra bảo mật và chất lượng mã theo yêu cầu. Dùng khi rà soát lỗ hổng, vấn đề bảo mật, code smell hoặc vấn đề tuân thủ. Từ khóa kích hoạt - "audit", "security check", "vulnerability scan", "code quality", "compliance", "security audit".

Add to TypingMind

Tổng quan

Nhà phát hànhMadAppGang
Kho mãclaude-code
Tên kỹ năngaudit
Sao
281
Bản fork
26
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
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ộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được MadAppGang 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 Audit 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/MadAppGang/claude-code/tree/main/plugins/dev/skills/audit
  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/MadAppGang/claude-code.git /tmp/claude-code
mkdir -p .claude/skills
cp -r /tmp/claude-code/plugins/dev/skills/audit .claude/skills/audit
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 Audit 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 Audit 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 Audit 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.

Audit Skill

Overview

The audit skill provides comprehensive on-demand security and code quality audits for your codebase. It identifies vulnerabilities, security issues, code smells, outdated dependencies, exposed secrets, and compliance problems across all supported technology stacks.

When to Use:

  • Security audits and vulnerability scans
  • Pre-deployment security checks
  • Compliance verification (GDPR, HIPAA, SOC2)
  • Code quality assessment
  • Dependency vulnerability scanning
  • Secret exposure detection
  • Third-party license compliance

Technology Coverage:

  • React/TypeScript/JavaScript projects
  • Go applications
  • Rust projects
  • Python codebases
  • Full-stack applications
  • Monorepos and microservices

Audit Categories

1. Security Vulnerabilities (OWASP Top 10)

What Gets Checked:

  • SQL injection vulnerabilities
  • Cross-site scripting (XSS)
  • Authentication and session management flaws
  • Security misconfigurations
  • Sensitive data exposure
  • XML external entities (XXE)
  • Broken access control
  • Cross-site request forgery (CSRF)
  • Using components with known vulnerabilities
  • Insufficient logging and monitoring

Detection Methods:

  • Static code analysis
  • Pattern matching for common vulnerabilities
  • Framework-specific security checks
  • API endpoint security validation
  • Input validation analysis

2. Dependency Vulnerabilities

What Gets Checked:

  • Outdated packages with known CVEs
  • Unmaintained dependencies
  • License compatibility issues
  • Transitive dependency risks
  • Version conflicts

Package Managers Supported:

  • npm/yarn/pnpm (JavaScript/TypeScript)
  • go.mod (Go)
  • Cargo.toml (Rust)
  • requirements.txt/pyproject.toml (Python)
  • Gemfile (Ruby)

Tools Used:

  • npm audit / yarn audit / pnpm audit
  • go mod verify + vulnerability databases
  • cargo audit
  • pip-audit / safety

3. Exposed Secrets and Credentials

What Gets Detected:

  • Hardcoded API keys and tokens
  • Database credentials
  • Private keys and certificates
  • OAuth tokens and secrets
  • AWS/GCP/Azure credentials
  • JWT secrets
  • Encryption keys

Detection Patterns:

  • Regex patterns for common secret formats
  • Environment variable misuse
  • Configuration file analysis
  • Git history scanning (if requested)
  • Common secret naming patterns

False Positive Reduction:

  • Ignore test fixtures and mocks
  • Respect .gitignore patterns
  • Check for proper environment variable usage
  • Validate against .env.example templates

4. Code Quality Issues

What Gets Analyzed:

  • Code complexity (cyclomatic complexity)
  • Code duplication
  • Dead code and unused exports
  • Large functions and files
  • Naming convention violations
  • Magic numbers and hardcoded values
  • Lack of error handling
  • Poor separation of concerns

Metrics Calculated:

  • Cyclomatic complexity per function
  • Duplication percentage
  • Lines of code (LOC) per file/function
  • Comment-to-code ratio
  • Test-to-code ratio

Running Audits

Full Audit

Run all audit categories:

Please run a full security and quality audit of this codebase

The audit will:

  1. Scan all source files for vulnerabilities
  2. Check dependencies for known CVEs
  3. Search for exposed secrets
  4. Analyze code quality metrics
  5. Generate comprehensive report

Category-Specific Audits

Security Only:

Run a security audit focusing on OWASP top 10 vulnerabilities

Dependencies Only:

Audit all dependencies for vulnerabilities and outdated packages

Secrets Only:

Scan for exposed secrets and credentials

Code Quality Only:

Analyze code quality and identify code smells

Targeted Audits

Specific Directory:

Audit the /src/auth directory for security issues

Specific Files:

Audit UserController.ts and AuthService.ts for vulnerabilities

Pre-Deployment:

Run pre-deployment audit checklist

Audit Report Format

Severity Levels

Reports classify findings by severity:

  • CRITICAL: Immediate security risk, exploitable vulnerability
  • HIGH: Significant security or quality issue
  • MEDIUM: Moderate issue that should be addressed
  • LOW: Minor issue or code smell
  • INFO: Informational finding, best practice suggestion

Report Structure

markdown
# Security and Quality Audit Report

**Generated**: 2026-01-28 14:32:00
**Scope**: Full codebase audit
**Files Scanned**: 247
**Duration**: 8.3 seconds

## Executive Summary

- CRITICAL: 2 findings
- HIGH: 5 findings
- MEDIUM: 12 findings
- LOW: 23 findings
- INFO: 8 findings

**Risk Score**: 7.2/10 (HIGH)

## Critical Findings

### [CRITICAL-001] SQL Injection Vulnerability
**File**: src/database/queries.ts:42
**Severity**: CRITICAL
**Category**: Security - SQL Injection

**Issue**: User input concatenated directly into SQL query without sanitization.

**Code**:
```typescript
const query = `SELECT * FROM users WHERE email = '${email}'`;

Impact: Attacker can execute arbitrary SQL commands.

Recommendation: Use parameterized queries or ORM.

Fix:

typescript
const query = db.prepare('SELECT * FROM users WHERE email = ?').bind(email);

[CRITICAL-002] Exposed API Key

File: src/config/api.ts:15 Severity: CRITICAL Category: Security - Exposed Secret

Issue: Hardcoded API key found in source code.

Code:

typescript
const STRIPE_SECRET_KEY = "sk_live_abc123xyz789";

Impact: Unauthorized access to Stripe account.

Recommendation: Move to environment variable.

Fix:

typescript
const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;

High Priority Findings

[HIGH-001] Outdated Dependency with Known CVE

File: package.json:23 Severity: HIGH Category: Dependencies

Issue: lodash@4.17.15 has known vulnerability (CVE-2021-23337)

CVE Details:

  • CVE-2021-23337: Command injection in template
  • Published: 2021-02-15
  • CVSS Score: 7.2

Recommendation: Upgrade to lodash@4.17.21 or higher

Fix:

bash
npm install lodash@latest

[... additional findings ...]

Compliance Checks

OWASP Top 10 Coverage

  • [FAIL] A1: Injection - 2 SQL injection vulnerabilities found
  • [PASS] A2: Broken Authentication
  • [FAIL] A3: Sensitive Data Exposure - 1 exposed secret
  • [PASS] A4: XML External Entities
  • [PASS] A5: Broken Access Control
  • [FAIL] A6: Security Misconfiguration - CORS too permissive
  • [PASS] A7: Cross-Site Scripting
  • [PASS] A8: Insecure Deserialization
  • [FAIL] A9: Using Components with Known Vulnerabilities - 3 outdated deps
  • [WARN] A10: Insufficient Logging - Limited audit logging

Overall: 6/10 passing (60%)

Recommendations

  1. Immediate Actions (CRITICAL/HIGH):

    • Fix SQL injection in queries.ts
    • Remove hardcoded API key
    • Upgrade vulnerable dependencies
  2. Short Term (MEDIUM):

    • Improve error handling consistency
    • Add input validation to all API endpoints
    • Configure stricter CORS policy
  3. Long Term (LOW/INFO):

    • Reduce code duplication (12% current)
    • Refactor complex functions (8 functions >15 complexity)
    • Improve test coverage (currently 67%)

## Integration with Dev Plugin

### With Code Analysis Agent

Use code-analysis enrichment before audit:

First enrich the codebase with claudemem, then run security audit


This provides:
- Context-aware vulnerability detection
- Better false positive filtering
- Dependency graph analysis

### With Test Architect Agent

Combine audit with test coverage:

Run audit and identify untested critical code paths


### With Optimize Skill

Security-performance trade-offs:

Audit security implications of performance optimizations


## Best Practices

### 1. Regular Audits

**Recommended Schedule**:
- Daily: Dependency vulnerability scans (CI/CD)
- Weekly: Full security audit
- Pre-deployment: Comprehensive audit
- Post-incident: Targeted security review

### 2. Incremental Audits

For large codebases:

Audit files changed in the last 7 days


This focuses on recent changes and reduces noise.

### 3. Baseline and Track

**First Audit**:

Run full audit and establish security baseline


**Subsequent Audits**:

Run audit and compare against baseline


Track improvements over time.

### 4. Prioritize by Risk

Focus on:
1. User-facing authentication code
2. Payment processing
3. Data storage and retrieval
4. API endpoints with PII
5. Third-party integrations

### 5. Automate in CI/CD

**GitHub Actions Example**:
```yaml
- name: Security Audit
  run: |
    npm audit --audit-level=high
    # Run custom audit script

Pre-commit Hook:

bash
#!/bin/bash
# Scan staged files for secrets
git diff --cached --name-only | xargs grep -E "(api_key|secret|password)"

Examples

Example 1: Pre-Deployment Security Audit

Request:

We're deploying to production tomorrow. Run a comprehensive security audit.

Audit Process:

  1. Scan all source files for OWASP top 10
  2. Check all dependencies for CVEs
  3. Search for exposed secrets
  4. Verify CORS and authentication config
  5. Check logging and monitoring setup

Report Highlights:

  • 1 CRITICAL: Exposed database password
  • 2 HIGH: Outdated dependencies with CVEs
  • 5 MEDIUM: Missing input validation
  • Compliance: 8/10 OWASP categories passing

Outcome: Deployment blocked until CRITICAL/HIGH fixed

Example 2: Dependency Vulnerability Scan

Request:

Check all npm dependencies for known vulnerabilities

Process:

  1. Run npm audit --json
  2. Parse vulnerability reports
  3. Check for available fixes
  4. Identify breaking changes

Report:

Found 3 vulnerabilities (1 high, 2 moderate)

HIGH: axios@0.21.1 (CVE-2021-3749)
- Fix available: axios@0.21.4
- Breaking: No
- Run: npm install axios@0.21.4

MODERATE: glob-parent@5.1.1 (CVE-2020-28469)
- Fix available: glob-parent@6.0.2
- Breaking: Yes (ESM only)
- Review: Migration guide needed

Example 3: Compliance Check (GDPR)

Request:

Audit for GDPR compliance issues

Checks:

  • Data retention policies
  • User consent mechanisms
  • Right to erasure implementation
  • Data export functionality
  • Encryption at rest and in transit
  • Privacy policy references
  • Third-party data sharing

Report:

GDPR Compliance Audit

[PASS] Data encryption at rest
[FAIL] Missing data retention policy
[FAIL] No user data export endpoint
[PASS] Consent management implemented
[WARN] Privacy policy link outdated
[PASS] TLS 1.3 enforced

Example 4: Code Quality Audit

Request:

Identify code quality issues and technical debt

Analysis:

  • Complexity: 8 functions exceed threshold
  • Duplication: 15% code duplication
  • Dead code: 23 unused exports
  • Large files: 4 files over 500 lines
  • Magic numbers: 47 instances

Top Issues:

1. UserService.ts - Complexity 28 (threshold: 15)
   Recommendation: Extract validation logic

2. utils/helpers.ts - 234 lines duplicated in 3 files
   Recommendation: Create shared utility module

3. api/routes.ts - 847 lines (threshold: 500)
   Recommendation: Split into feature-based modules

Stack-Specific Audit Patterns

React/TypeScript

Security Focus:

  • XSS via dangerouslySetInnerHTML
  • Insecure refs and DOM manipulation
  • Exposed environment variables in client code
  • CORS misconfigurations

Quality Focus:

  • Prop types and TypeScript coverage
  • Component complexity
  • Hook dependencies
  • Re-render performance

Go

Security Focus:

  • SQL injection in database/sql
  • Command injection in exec
  • Path traversal
  • Goroutine leaks

Quality Focus:

  • Error handling consistency
  • Context propagation
  • Resource cleanup (defer)
  • Race conditions

Rust

Security Focus:

  • Unsafe blocks
  • Integer overflow
  • Memory leaks in FFI
  • Dependency vulnerabilities

Quality Focus:

  • Error propagation patterns
  • Clippy warnings
  • Documentation coverage
  • Panic usage

Audit Workflow Integration

[Developer] → Request audit
    ↓
[Audit Skill] → Scan codebase
    ↓
[Generate Report] → Categorize findings
    ↓
[Prioritize] → CRITICAL → HIGH → MEDIUM → LOW
    ↓
[Fix Critical] → Apply fixes
    ↓
[Re-audit] → Verify fixes
    ↓
[Update Baseline] → Track progress

Conclusion

The audit skill provides comprehensive security and quality analysis on-demand. Use it regularly to maintain code health, catch vulnerabilities early, and ensure compliance with industry standards.

Key Takeaways:

  • Run audits frequently (daily in CI/CD)
  • Prioritize CRITICAL and HIGH findings
  • Establish baselines and track progress
  • Integrate with other dev skills for comprehensive analysis
  • Automate where possible

For performance analysis, see the optimize skill. For test coverage gaps, see the test-coverage skill.

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

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

Kiểm tra bảo mật và chất lượng mã theo yêu cầu. Dùng khi rà soát lỗ hổng, vấn đề bảo mật, code smell hoặc vấn đề tuân thủ. Từ khóa kích hoạt - "audit", "security check", "vulnerability scan", "code quality", "compliance", "security audit".

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

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/audit. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để 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 Audit?

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 Audit 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 Audit 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 Audit có miễn phí không?

Có. Kỹ năng này được MadAppGang phát hành trên GitHub theo giấy phép MIT. 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 👇