logic-lens – skill Lập trình cho agent AI
Skill Claude Code dùng AI để rà soát mã sâu bằng logic hình thức và khung suy luận, phát hiện lỗi, anti-pattern và rủi ro bảo mật mà linter không bắt được.
Cài skill logic-lens bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-lens-b4ff2.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /logic-lens – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-lens-b4ff2.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $logic-lens – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-lens-b4ff2.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /logic-lens – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-lens-b4ff2.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /logic-lens – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc 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:
1. Parse code structure and build a mental model of data flow
2. Apply formal logic checks across 9 risk categories
3. Trace execution paths for edge cases and boundary conditions
4. Identify security anti-patterns (injection, privilege escalation, data leakage)
5. 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-lensExamples
Example 1: Review a Single File
@logic-lens review src/auth/login.ts for security issuesLogic 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 severityExample 3: Pre-PR Review
@logic-lens review all files changed in this branch before I open a PRThe 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
Evidence and limits
The upstream contributor reports benchmark benefits, but this tree bundles no corpus, evaluation protocol or reproducible benchmark artifacts. Do not repeat a “47%” detection advantage as verified evidence. Produce concrete findings with source locations, reachable data/control flow, assumptions and a validating test or reproduction plan. An AI logic review is not a formal proof or complete security scan; an empty finding list is scoped absence of evidence.
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](https://github.com/hyhmrright/logic-lens)
- [Dev.to Article: Why AI Code Review Misses the Most Dangerous Bugs](https://dev.to/hyhmrright/why-ai-code-review-misses-the-most-dangerous-bugs-logic-lens-fixes-that-4a8l)
- [Claude Code Skills Documentation](https://docs.anthropic.com/claude-code)
Limitations
Use this skill only when the task clearly matches the scope described above (code review and logic analysis). Logic Lens provides AI-powered analysis and should be combined with human review for production-critical decisions. Do not treat the output as a substitute for environment-specific testing or security audits.
Skill liên quan
- logic-review – Tìm lỗi logic trong một tệp hoặc hàm bằng cách truy vết thực thi bán hình thức (Tiền đề…
- logistics-exception-management – Phân loại và xử lý chậm trễ vận chuyển, hư hỏng, thiếu hụt, thất lạc và tranh chấp với…
- lovable-cleanup – Kiểm tra và loại bỏ phần scaffolding của Lovable khỏi dự án Vite + React — xóa…
- macos-menubar-tuist-app – Xây dựng, tái cấu trúc hoặc review ứng dụng menubar macOS bằng SwiftUI sử dụng Tuist.
- macos-screen-recorder – Trình ghi màn hình macOS thu màn hình chính CÙNG âm thanh hệ thống qua ScreenCaptureKit…
- mailtrap-testing-with-sandbox – Thu email đi trong Mailtrap Email Sandbox phục vụ phát triển, staging, CI, kiểm tra…
- maintain-codex-wiki – Duy trì wiki kỹ thuật ưu tiên review, có truy xuất nguồn gốc, truy vấn nhận biết trích…
- makepad-2-0-dsl – Hướng dẫn Makepad 2.0 về dsl; dùng khi xây dựng hoặc gỡ lỗi mã UI Makepad.