跳到正文
Skillpedia
测试48k · #5099

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-lens/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  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-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-lens on authentication and payment code before every release
  • Combine with @lint-and-validate for full coverage: style + logic
  • Review the CRITICAL and HIGH findings first; LOW findings can be deferred
  • Use @logic-lens on 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

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.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5099
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能