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.
Calculates architecture alignment scores (0.00-1.00) by detecting violations like circular dependencies and layer breaches against ADRs. Use when reviewing large changes, preventing architectural drift, or planning refactoring to maintain code-to-design conformance.
/plugin marketplace add krzemienski/shannon-framework/plugin install shannon@shannon-frameworkThis 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.
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
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.