ln-641-pattern-analyzer by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-641-pattern-analyzer路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在目录并向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
L3 工作器,用于根据最佳实践分析单个架构模式并计算 4 项评分。
超出范围(由 ln-624-code-quality-auditor 负责):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
- pattern: string # 模式名称(例如 "Job Processing")
- locations: string[] # 已知的文件路径/目录
- bestPractices: object # 来自 MCP Ref/Context7/WebSearch 的最佳实践
- output_dir: string # 例如 "docs/project/.audit/ln-640/{YYYY-MM-DD}"
注意: 所有模式在到达前均已通过预验证(通过了 ln-640 阶段 1d 的适用性门禁,且确认了 >= 2 个结构组件)。
必读: 加载 shared/references/two_layer_detection.md 以了解检测方法。
必读: 加载 ../ln-640-pattern-evolution-auditor/references/pattern_library.md — 使用 "Pattern Detection (Grep)" 表格获取每个模式的检测关键词。
IF pattern.source == "adaptive":
# 由协调器阶段 1b 发现的模式 — 证据已提供
files = pattern.evidence.files
跳过检测关键词搜索(已在阶段 1b 完成)
ELSE:
# 基线模式 — 使用库中的检测关键词
files = Glob(locations)
additional = Grep("{pattern_keywords}", "**/*.{ts,js,py,rb,cs,java}")
files = deduplicate(files + additional)
FOR EACH file IN files (限制:10 个关键文件):
Read(file)
提取:组件、模式、错误处理、日志记录、测试
必读: 加载 ../ln-640-pattern-evolution-auditor/references/scoring_rules.md — 遵循每个标准的 Detection 列。
| 评分项 | 来源(scoring_rules.md) | 最大值 |
|---|---|---|
| 合规性 | "Compliance Score" 部分 — 行业标准、命名、约定、反模式 | 100 |
| 完整性 | "Completeness Score" 部分 — 必需组件表(按模式)、错误处理、测试 | 100 |
| 质量 | "Quality Score" 部分 — 方法长度、复杂度、代码异味、SOLID 原则 | 100 |
| 实现度 | "Implementation Score" 部分 — 编译、生产使用、集成、监控 | 100 |
每个标准的评分过程:
FOR EACH bestPractice NOT implemented:
issues.append({
severity: "HIGH" | "MEDIUM" | "LOW",
category: "compliance" | "completeness" | "quality" | "implementation",
issue: description,
suggestion: how to fix,
effort: "S" | "M" | "L"
})
# 第二层上下文检查(必做):
# 代码注释或 ADR 中记录了偏差? → 降级为 LOW
# 模式因项目规模而有意简化? → 跳过
gaps = {
missingComponents: 在代码中未找到的必需组件,
inconsistencies: 冲突或不完整的实现
}
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/references/audit_scoring.md。
诊断子评分(每项 0-100)单独计算,并仅出于诊断目的在 AUDIT-META 中报告:
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/templates/audit_worker_report_template.md。
# 构建模式名称 slug:"Job Processing" → "job-processing"
slug = pattern.name.lower().replace(" ", "-")
# 在内存中构建 Markdown 报告,包含:
# - AUDIT-META(扩展:score [基于惩罚] + 诊断性 score_compliance/completeness/quality/implementation)
# - 检查项表格(compliance_check, completeness_check, quality_check, implementation_check)
# - 发现项表格(按严重程度排序的问题)
# - DATA-EXTENDED: {pattern, codeReferences, gaps, recommendations}
写入到 {output_dir}/641-pattern-{slug}.md(原子性单次 Write 调用)
报告已写入:docs/project/.audit/ln-640/{YYYY-MM-DD}/641-pattern-job-processing.md
评分:7.9/10 (C:72 K:85 Q:68 I:90) | 问题:3 (H:1 M:2 L:0)
必读: 加载 shared/references/audit_worker_core_contract.md。
必读: 加载 shared/references/audit_worker_core_contract.md。
{output_dir}/641-pattern-{slug}.md(原子性单次 Write 调用)../ln-640-pattern-evolution-auditor/references/scoring_rules.md../ln-640-pattern-evolution-auditor/references/pattern_library.mdshared/references/research_tool_fallback.md版本: 2.0.0 最后更新: 2026-02-08
每周安装量
138
仓库
GitHub 星标数
245
首次出现
2026年2月2日
安全审计
安装于
claude-code128
cursor127
codex126
gemini-cli126
opencode126
github-copilot124
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
L3 Worker that analyzes a single architectural pattern against best practices and calculates 4 scores.
Out of Scope (owned by ln-624-code-quality-auditor):
- pattern: string # Pattern name (e.g., "Job Processing")
- locations: string[] # Known file paths/directories
- bestPractices: object # Best practices from MCP Ref/Context7/WebSearch
- output_dir: string # e.g., "docs/project/.audit/ln-640/{YYYY-MM-DD}"
Note: All patterns arrive pre-verified (passed ln-640 Phase 1d applicability gate with >= 2 structural components confirmed).
MANDATORY READ: Load shared/references/two_layer_detection.md for detection methodology.
MANDATORY READ: Load ../ln-640-pattern-evolution-auditor/references/pattern_library.md — use "Pattern Detection (Grep)" table for detection keywords per pattern.
IF pattern.source == "adaptive":
# Pattern discovered by coordinator Phase 1b — evidence already provided
files = pattern.evidence.files
SKIP detection keyword search (already done in Phase 1b)
ELSE:
# Baseline pattern — use library detection keywords
files = Glob(locations)
additional = Grep("{pattern_keywords}", "**/*.{ts,js,py,rb,cs,java}")
files = deduplicate(files + additional)
FOR EACH file IN files (limit: 10 key files):
Read(file)
Extract: components, patterns, error handling, logging, tests
MANDATORY READ: Load ../ln-640-pattern-evolution-auditor/references/scoring_rules.md — follow Detection column for each criterion.
| Score | Source in scoring_rules.md | Max |
|---|---|---|
| Compliance | "Compliance Score" section — industry standard, naming, conventions, anti-patterns | 100 |
| Completeness | "Completeness Score" section — required components table (per pattern), error handling, tests | 100 |
| Quality | "Quality Score" section — method length, complexity, code smells, SOLID | 100 |
| Implementation | "Implementation Score" section — compiles, production usage, integration, monitoring | 100 |
Scoring process for each criterion:
FOR EACH bestPractice NOT implemented:
issues.append({
severity: "HIGH" | "MEDIUM" | "LOW",
category: "compliance" | "completeness" | "quality" | "implementation",
issue: description,
suggestion: how to fix,
effort: "S" | "M" | "L"
})
# Layer 2 context check (MANDATORY):
# Deviation documented in code comment or ADR? → downgrade to LOW
# Pattern intentionally simplified for project scale? → skip
gaps = {
missingComponents: required components not found in code,
inconsistencies: conflicting or incomplete implementations
}
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/references/audit_scoring.md.
Diagnostic sub-scores (0-100 each) are calculated separately and reported in AUDIT-META for diagnostic purposes only:
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/templates/audit_worker_report_template.md.
# Build pattern name slug: "Job Processing" → "job-processing"
slug = pattern.name.lower().replace(" ", "-")
# Build markdown report in memory with:
# - AUDIT-META (extended: score [penalty-based] + diagnostic score_compliance/completeness/quality/implementation)
# - Checks table (compliance_check, completeness_check, quality_check, implementation_check)
# - Findings table (issues sorted by severity)
# - DATA-EXTENDED: {pattern, codeReferences, gaps, recommendations}
Write to {output_dir}/641-pattern-{slug}.md (atomic single Write call)
Report written: docs/project/.audit/ln-640/{YYYY-MM-DD}/641-pattern-job-processing.md
Score: 7.9/10 (C:72 K:85 Q:68 I:90) | Issues: 3 (H:1 M:2 L:0)
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
{output_dir}/641-pattern-{slug}.md (atomic single Write call)../ln-640-pattern-evolution-auditor/references/scoring_rules.md../ln-640-pattern-evolution-auditor/references/pattern_library.mdshared/references/research_tool_fallback.mdVersion: 2.0.0 Last Updated: 2026-02-08
Weekly Installs
138
Repository
GitHub Stars
245
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
claude-code128
cursor127
codex126
gemini-cli126
opencode126
github-copilot124
智能代码探索工具smart-explore:AST解析结构化代码搜索与导航
735 周安装