logic-lens
Skill này làm gì
Công cụ này phân tích code để tìm lỗi logic và bảo mật mà các công cụ khác có thể bỏ sót. Nó kiểm tra xem code có hoạt động đúng như mong đợi ngay cả trong những tình huống phức tạp hay không.
Khi nào nên dùng
- ✓Khi bạn chuẩn bị hợp nhất code mới vào một dự án lớn hơn (đánh giá PR).
- ✓Khi một lỗi khó tìm và các công cụ thông thường không giúp được.
- ✓Khi đánh giá đoạn code nhạy cảm về bảo mật (như đăng nhập hoặc thanh toán).
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-lens/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra code của tôi xem có lỗi logic và bảo mật nào không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ đọc code, hiểu luồng dữ liệu và áp dụng các quy tắc logic để tìm vấn đề. Nó kiểm tra hơn 9 loại rủi ro, như lỗi tính toán hoặc lỗ hổng bảo mật.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Logic Lens
Overview
Logic Lens is a Claude Code skill that performs deep, logic-driven code review using formal reasoning frameworks. Unlike traditional linters that check syntax and style, Logic Lens analyzes your code for logical errors, race conditions, security vulnerabilities, type mismatches, and algorithmic flaws that only appear when you reason through the code's behavior.
Powered by structured AI analysis, Logic Lens applies systematic logical inspection across 9 risk categories: null/undefined handling, type safety, concurrency, resource management, security injection, boundary conditions, algorithm correctness, state management, and API contract violations.
When to Use This Skill
- Use when you want a thorough logic review before merging a PR
- Use when a bug seems hard to find and standard linters aren't helping
- Use when reviewing security-sensitive code paths (auth, payments, file access)
- Use when refactoring complex business logic
- Use when onboarding to a new codebase and need to understand risk areas
How It Works
Logic Lens uses Claude Code's reasoning capabilities to:
- Parse code structure and build a mental model of data flow
- Apply formal logic checks across 9 risk categories
- Trace execution paths for edge cases and boundary conditions
- Identify security anti-patterns (injection, privilege escalation, data leakage)
- Report findings with severity levels and actionable fix suggestions
Installation
# Install via Claude Code plugin marketplace
# Search: "logic-lens" in Claude Code > Extensions
# Or install via NPX (Antigravity)
npx agentic-awesome-skills --claude
# Then invoke: @logic-lens
Examples
Example 1: Review a Single File
@logic-lens review src/auth/login.ts for security issues
Logic Lens output:
[CRITICAL] SQL Injection risk at line 42: user input concatenated into query string
[HIGH] Missing rate limiting on login attempts
[MEDIUM] Password comparison uses == instead of timing-safe comparison
[LOW] Error messages may leak valid usernames (user enumeration)
Example 2: Full Repository Scan
@logic-lens scan the entire codebase and prioritize by severity
Example 3: Pre-PR Review
@logic-lens review all files changed in this branch before I open a PR
The 9 Risk Categories
| Category | What It Checks |
|---|---|
| Null/Undefined | Missing null checks, optional chaining gaps |
| Type Safety | Implicit coercions, any-typed boundaries |
| Concurrency | Race conditions, shared mutable state |
| Resource Management | Unclosed handles, memory leaks |
| Security Injection | SQL/XSS/Command injection, path traversal |
| Boundary Conditions | Off-by-one errors, integer overflow |
| Algorithm Correctness | Wrong complexity, incorrect assumptions |
| State Management | Inconsistent state, missing rollbacks |
| API Contracts | Undocumented side effects, broken interfaces |
Best Practices
- Run
@logic-lenson authentication and payment code before every release - Combine with
@lint-and-validatefor full coverage: style + logic - Review the CRITICAL and HIGH findings first; LOW findings can be deferred
- Use
@logic-lenson legacy code you are about to modify to understand risk surface
Benchmark Results
Logic Lens was tested against real-world codebases and caught issues missed by ESLint, TypeScript strict mode, and Snyk:
- 47% of critical bugs found were invisible to linters
- Race conditions detected in async code that static analysis missed
- Security vulnerabilities identified before deployment in CI pipeline
Related Skills
@lint-and-validate— Complementary: run after logic-lens for style/syntax@security-auditor— Specialized security-only deep scan@debugging-strategies— Use when logic-lens findings need tracing
Additional Resources
- GitHub Repository
- Dev.to Article: Why AI Code Review Misses the Most Dangerous Bugs
- Claude Code Skills Documentation
Limitations
…
Câu hỏi thường gặp
Công cụ này khác 'linter' thế nào?
Linter kiểm tra định dạng code và lỗi cú pháp cơ bản. Công cụ này đi sâu hơn, phân tích logic bên trong và hành vi của code để tìm các vấn đề phức tạp hơn.
Công cụ có thể tìm những loại vấn đề nào?
Nó có thể tìm lỗi trong cách code xử lý giá trị null, các vấn đề bảo mật như chèn code (code injection), các vấn đề đồng thời (khi nhiều việc xảy ra cùng lúc) và lỗi tính toán.
Công cụ có thay thế được người review không?
Không, đây là trợ lý mạnh mẽ. Phân tích của nó nên được kết hợp với đánh giá của lập trình viên có kinh nghiệm, nhất là với các quyết định quan trọng.
Chi tiết
Mô tả gốc của tác giả
AI-powered Claude Code skill that performs deep code review using formal logic and reasoning frameworks to detect bugs, anti-patterns, and security risks beyond what linters catch.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5099
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.