LN

ln-641-pattern-analyzer

An analyzer that scores individual architectural pattern implementations for compliance and quality.

Install

mkdir -p .claude/skills/ln-641-pattern-analyzer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16469" && unzip -o skill.zip -d .claude/skills/ln-641-pattern-analyzer && rm skill.zip

Installs to .claude/skills/ln-641-pattern-analyzer

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Analyzes single pattern implementation, calculates 4 scores (compliance, completeness, quality, implementation), identifies gaps. Invoked by ln-640 or standalone.
162 charsno explicit “when” trigger
Advanced

Key capabilities

  • Analyze a single architectural pattern implementation
  • Calculate compliance, completeness, quality, and implementation scores
  • Identify gaps and issues with severity and effort estimates
  • Find all implementations of a pattern in the codebase
  • Document evidence for each score justification

How it works

This skill analyzes a single architectural pattern by finding its implementations in the codebase, reading the code, and calculating four scores based on predefined rules. It identifies issues and gaps and generates a report.

Inputs & outputs

You give it
Pattern name, file locations, best practices, and an output directory
You get back
Structured analysis result including scores, issues, gaps, and a markdown report

When to use ln-641-pattern-analyzer

  • Audit the implementation of a specific design pattern
  • Calculate quality scores for a codebase feature
  • Identify gaps in architectural pattern adherence

About this skill

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.

Pattern Analyzer

L3 Worker that analyzes a single architectural pattern against best practices and calculates 4 scores.

Purpose & Scope

  • Analyze ONE pattern per invocation (receives pattern name, locations, best practices from coordinator)
  • Find all implementations in codebase (Glob/Grep)
  • Validate implementation exists and works
  • Calculate 4 scores: compliance, completeness, quality, implementation
  • Identify gaps and issues with severity and effort estimates
  • Return structured analysis result to coordinator

Out of Scope (owned by ln-624-code-quality-auditor):

  • Cyclomatic complexity thresholds (>10, >20)
  • Method/class length thresholds (>50, >100, >500 lines)
  • Quality Score focuses on pattern-specific quality (SOLID within pattern, pattern-level smells), not generic code metrics

Input (from ln-640 coordinator)

- 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).

Workflow

MANDATORY READ: Load shared/references/two_layer_detection.md for detection methodology.

Phase 1: Find Implementations

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)

Phase 2: Read and Analyze Code

FOR EACH file IN files (limit: 10 key files):
  Read(file)
  Extract: components, patterns, error handling, logging, tests

Phase 3: Calculate 4 Scores

MANDATORY READ: Load ../ln-640-pattern-evolution-auditor/references/scoring_rules.md — follow Detection column for each criterion.

ScoreSource in scoring_rules.mdMax
Compliance"Compliance Score" section — industry standard, naming, conventions, anti-patterns100
Completeness"Completeness Score" section — required components table (per pattern), error handling, tests100
Quality"Quality Score" section — method length, complexity, code smells, SOLID100
Implementation"Implementation Score" section — compiles, production usage, integration, monitoring100

Scoring process for each criterion:

  1. Run the Detection Grep/Glob from scoring_rules.md
  2. If matches found → add points per criterion
  3. If anti-pattern/smell detected → subtract per deduction table
  4. Document evidence: file path + line for each score justification

Phase 4: Identify Issues and Gaps

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
}

Phase 5: Calculate Score

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:

  • compliance, completeness, quality, implementation

Phase 6: Write Report

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)

Phase 7: Return Summary

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)

Critical Rules

MANDATORY READ: Load shared/references/audit_worker_core_contract.md.

  • One pattern only: Analyze only the pattern passed by coordinator
  • Read before score: Never score without reading actual code
  • Detection-based scoring: Use Grep/Glob patterns from scoring_rules.md, not assumptions
  • Effort estimates: Always provide S/M/L for each issue
  • Code references: Always include file paths for findings

Definition of Done

MANDATORY READ: Load shared/references/audit_worker_core_contract.md.

  • All implementations found via Glob/Grep (using pattern_library.md keywords or adaptive evidence)
  • Key files read and analyzed
  • 4 scores calculated using scoring_rules.md Detection patterns
  • Issues identified with severity, category, suggestion, effort
  • Gaps documented (missing components, inconsistencies)
  • Recommendations provided
  • Report written to {output_dir}/641-pattern-{slug}.md (atomic single Write call)
  • Summary returned to coordinator

Reference Files

  • Scoring rules: ../ln-640-pattern-evolution-auditor/references/scoring_rules.md
  • Pattern library: ../ln-640-pattern-evolution-auditor/references/pattern_library.md
  • MANDATORY READ: shared/references/research_tool_fallback.md

Version: 2.0.0 Last Updated: 2026-02-08

When not to use it

  • When the task involves cyclomatic complexity thresholds
  • When the task involves method/class length thresholds
  • When the task requires generic code metrics not specific to patterns

Limitations

  • Analyzes ONE pattern per invocation.
  • Out of Scope: Cyclomatic complexity thresholds (>10, >20).
  • Out of Scope: Method/class length thresholds (>50, >100, >500 lines).

How it compares

This skill provides a structured, score-based analysis of a single architectural pattern's implementation, focusing on pattern-specific quality and compliance, unlike general code quality tools.

Compared to similar skills

ln-641-pattern-analyzer side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ln-641-pattern-analyzer (this skill)05moNo flagsAdvanced
architect-review1094moNo flagsAdvanced
solid-principles579moNo flagsIntermediate
codex322moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

109320

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

codex

Lucklyric

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.

32238

error-handling-patterns

wshobson

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

35170

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

senior-fullstack

davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.

35110

Search skills

Search the agent skills registry