logic-lens
它能做什么
这个工具会分析你的代码,找出其他工具可能遗漏的逻辑错误和安全漏洞。即使在复杂的情况下,它也会检查代码的行为是否符合预期。
适用场景
- ✓在把新代码合并到较大的项目之前(PR 评审)。
- ✓当某个 bug 很难找到,常规工具也帮不上忙时。
- ✓当审查涉及安全的代码部分(比如登录或支付)时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-lens/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查我的代码,看看有没有逻辑和安全方面的缺陷。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会阅读你的代码,理解数据流动,并应用逻辑规则来找出问题。它会检查 9 类以上的风险,比如计算错误或安全漏洞。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
…
常见问题
这个工具和“linter”有什么区别?
linter 主要检查代码格式和基本语法错误。这个工具则更深入,会分析内部逻辑和代码行为,找出更复杂的问题。
它能发现哪些类型的问题?
它可以发现代码处理空值(null)时的错误、代码注入等安全问题、并发问题(多件事情同时发生时的问题),以及计算错误。
它能替代人工审查吗?
不能,它是一个很强大的助手。它的分析结果应该和经验丰富的程序员的审查结合起来看,尤其是在关键决策上。
详情
作者的原始描述
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.
热度
- GitHub 星标
- 48k
- 排名
- #5099
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。