From shannon
Track architectural decisions and detect drift from ADRs (Architecture Decision Records). Calculate alignment score (0.00-1.00) showing code-to-design conformance. Auto-detect architectural violations and suggest refactoring. Integrate with Serena for architectural health monitoring. Use when: maintaining architectural integrity, reviewing large changes, documenting decisions, detecting drift, enforcing standards.
npx claudepluginhub krzemienski/shannon-framework --plugin shannonThis skill is limited to using the following tools:
Maintain alignment between code and architectural decisions. Calculate alignment score (0.00-1.00) showing conformance to ADRs. Auto-detect violations like circular dependencies, layer violations, and unauthorized coupling. Track architecture health via Serena MCP.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Maintain alignment between code and architectural decisions. Calculate alignment score (0.00-1.00) showing conformance to ADRs. Auto-detect violations like circular dependencies, layer violations, and unauthorized coupling. Track architecture health via Serena MCP.
Alignment Score Calculation:
Score = 1.0 - (Violations / Total Dependencies) × 1.0
Range: 0.00 (complete chaos) to 1.00 (perfect alignment)
Violations: Unauthorized dependencies, circular refs, layer violations
Total Dependencies: All module-to-module connections
Example: 5 violations in 200 dependencies = 0.975 score
Violation Types & Impact:
Architecture Scoring:
Component: User Authentication Service
├─ Allowed dependencies: Core, Utils
├─ Actual dependencies: Core, Utils, Payment (VIOLATION)
├─ Violations: 1 (unauthorized Payment coupling)
├─ Alignment: 0.90 (1 violation in 10 deps)
└─ Status: ⚠️ Review needed
Component: Payment Processing
├─ Allowed: Core, Database, Logging
├─ Actual: Core → Auth (CIRCULAR), Database, Logging
├─ Violations: 2 (circular + missing abstraction)
├─ Alignment: 0.80
└─ Status: ❌ Critical refactoring needed
ADR Format Example:
ADR-001: Layered Architecture
Decision:
Implement 4-layer architecture:
├─ Presentation (API, UI)
├─ Business Logic (Services)
├─ Data Access (Repositories)
└─ Infrastructure (Database, Cache)
Rules:
✓ Presentation → Business Logic
✓ Business Logic → Data Access
✓ Data Access → Infrastructure
✗ Backwards dependencies forbidden
✗ No cross-layer skipping
Drift Detection Report:
Architecture Alignment Score: 0.82
Status: ⚠️ Acceptable but drifting
Violations (5 total):
1. [CRITICAL] Circular: Auth ← → Payment (bidirectional)
Files: src/auth/service.ts, src/payment/processor.ts
Recommendation: Extract shared logic to Core module
2. [HIGH] Layer violation: UI imports Payment (skips Logic)
Files: src/ui/checkout.tsx imports src/payment/api.ts
Recommendation: Route through Service layer
3. [MEDIUM] Unauthorized: Logging imports Caching
Files: src/logging/logger.ts imports src/cache/redis.ts
Recommendation: Move redis to Infrastructure, use interface
Trend: Score dropped 0.05 over 2 weeks (drifting)
Auto-Generated Refactoring Plan:
Option A (Impact: +0.08, Effort: Medium):
Extract PaymentInterface from Payment service
├─ Create: src/core/interfaces/payment.ts
├─ Define: interface IPaymentProcessor
├─ Auth uses interface, not concrete Payment
└─ Breaks circular dependency
Option B (Impact: +0.05, Effort: Low):
Move caching utilities to Infrastructure
├─ Move: src/cache → src/infrastructure/caching
├─ Update imports in 3 files
├─ Preserves layer separation
Serena Push Format:
{
"metric_type": "architecture_alignment",
"project": "task-app",
"alignment_score": 0.82,
"violations": {
"circular": 1,
"layer_breach": 2,
"unauthorized": 2
},
"violating_modules": [
"auth",
"payment",
"ui"
],
"refactoring_priority": "HIGH",
"estimated_effort_hours": 16,
"timestamp": "2025-11-20T14:00:00Z"
}
Enterprise CRM System:
Microservices Migration:
✅ Alignment score ≥0.90 maintained ✅ No circular dependencies ✅ All layers properly separated ✅ Violations tracked in Serena with remediation plans ✅ New code reviewed against ADRs ✅ Refactoring priorities data-driven by alignment impact