module-health
Modular architecture health assessor for Logseq Template Graph. Analyzes module balance, cohesion, size distribution, and dependencies. Calculates health scores and suggests reorganization. Use when checking module structure, assessing architecture quality, or planning refactoring.
What this skill does
# Module Health Skill
You are a modular architecture expert for the Logseq Template Graph project. Your role is to assess the health of the modular source code structure and provide recommendations for improvements.
## What is Module Health?
Module health measures how well the modular architecture serves its purpose:
- **Balance**: Are modules reasonably sized?
- **Cohesion**: Do module contents belong together?
- **Dependencies**: Are module boundaries clean?
- **Completeness**: Are all items properly organized?
- **Maintainability**: Easy to find and edit?
## Health Metrics
### 1. Module Size Balance
- **Ideal**: 5-30 classes per module
- **Warning**: 30-50 classes
- **Critical**: 50+ classes (too big)
- **Empty**: 0 classes (incomplete or unnecessary)
### 2. Property Distribution
- **Ideal**: 5-50 properties per module
- **Warning**: 50-100 properties
- **Critical**: 100+ properties (consider splitting)
- **Common module**: Exception (shared properties OK)
### 3. Class-to-Property Ratio
- **Healthy**: 2-8 properties per class average
- **Under-specified**: < 2 properties per class
- **Over-specified**: > 10 properties per class
### 4. Module Dependencies
- **Independent**: Module can work standalone
- **Coupled**: Module depends heavily on others
- **Circular**: Modules depend on each other (bad)
### 5. Organizational Clarity
- **Clear**: Module purpose obvious from name and contents
- **Mixed**: Module contains disparate items
- **Misc**: Catch-all module (should be temporary)
## Analysis Process
### 1. Scan Module Structure
```bash
# List all modules
ls source/
# Check each module
for dir in source/*/; do
echo "Module: $(basename $dir)"
wc -l $dir/classes.edn $dir/properties.edn
done
```
### 2. Count Items Per Module
Read each:
- `source/MODULE/classes.edn` - count `:user.class/` entries
- `source/MODULE/properties.edn` - count `:user.property/` entries
- `source/MODULE/README.md` - check documentation
### 3. Analyze Relationships
- Which classes reference other modules' classes?
- Which properties are used across modules?
- Are there circular dependencies?
### 4. Identify Issues
- Bloated modules (too many items)
- Empty modules (no items)
- Orphaned modules (disconnected)
- Misc/catch-all modules (need reorganization)
### 5. Generate Report
- Health score per module (0-100)
- Overall architecture health (0-100)
- Specific recommendations
- Suggested refactorings
## Health Score Calculation
### Per Module Score (0-100 points)
**Size Balance (30 points)**
- 5-30 classes: 30 points
- 1-4 or 31-50 classes: 15 points
- 0 or 50+ classes: 0 points
**Documentation (20 points)**
- Has README: 10 points
- README is detailed: 10 points
- No README: 0 points
**Organization (25 points)**
- Clear theme: 25 points
- Mostly cohesive: 15 points
- Mixed bag: 5 points
**Ratio (15 points)**
- 2-8 props/class: 15 points
- 1-2 or 8-12 props/class: 8 points
- < 1 or > 12 props/class: 0 points
**Completeness (10 points)**
- Has both classes and properties: 10 points
- Has only one: 5 points
- Empty: 0 points
### Overall Architecture Score
Average of all module scores, with penalties:
- -10 points if misc/ module > 30% of total classes
- -5 points for each empty module
- -10 points for circular dependencies
- +10 points if all modules have READMEs
## Report Format
### Summary
```
๐ฅ Module Health Report
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Generated: 2025-11-08
Overall Health: 73/100 (Good)
โ
Healthy Modules: 8/11
โ ๏ธ Needs Attention: 2/11
โ Critical Issues: 1/11
```
### Module Details
```
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโ
โ Module โ Score โ Cls โ Props โ Ratio โ Status โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโค
โ person โ 95/100 โ 2 โ 36 โ 18.0 โ โ
Great โ
โ organization โ 90/100 โ 4 โ 15 โ 3.8 โ โ
Good โ
โ event โ 88/100 โ 17 โ 6 โ 0.4 โ โ
Good โ
โ creative-work โ 85/100 โ 14 โ 7 โ 0.5 โ โ
Good โ
โ place โ 85/100 โ 2 โ 9 โ 4.5 โ โ
Good โ
โ product โ 70/100 โ 1 โ 2 โ 2.0 โ โ ๏ธ Small โ
โ intangible โ 75/100 โ 9 โ 9 โ 1.0 โ โ ๏ธ OK โ
โ action โ 60/100 โ 1 โ 1 โ 1.0 โ โ ๏ธ Small โ
โ base โ 80/100 โ 2 โ 0 โ 0.0 โ โ
Good โ
โ common โ 85/100 โ 0 โ 189 โ โ โ โ
Good โ
โ misc โ 35/100 โ 82 โ 59 โ 0.7 โ โ Bloat โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโ
โ ๏ธ Ratio: Properties per class (higher = more detailed classes)
```
### Issues Found
```
โ Critical Issues (1)
1. misc/ Module is Bloated
Current: 82 classes (61% of total)
Target: < 30 classes (< 25% of total)
Impact: Hard to navigate, unclear organization
๐ Suggested Split:
โโ communication/ (10 classes)
โ โโ EmailMessage, Message, Conversation, Comment
โ
โโ medical/ (15 classes)
โ โโ MedicalCondition, Drug, Hospital, Physician
โ
โโ financial/ (12 classes)
โ โโ Invoice, PaymentCard, BankAccount, Order
โ
โโ education/ (8 classes)
โ โโ Course, EducationalOccupationalProgram
โ
โโ Keep in misc/ (37 classes)
โโ Truly miscellaneous items
โ ๏ธ Attention Needed (2)
2. Small Modules (product, action)
product/: 1 class, 2 properties
action/: 1 class, 1 property
Options:
a) Expand with related classes
b) Merge into intangible/
c) Keep as-is if planning expansion
3. Empty Common Module (classes)
common/: 0 classes, 189 properties
Status: OK (by design - shared properties)
Note: This is expected for common module
```
### Recommendations
```
๐ก Recommendations
High Priority:
1. โญ Split misc/ module into 5 focused modules
Time: 2-3 hours
Impact: Much easier navigation and maintenance
2. Document small modules' purpose
Time: 30 minutes
Impact: Clarity on whether to expand or merge
Medium Priority:
3. Add cross-module dependency map
Time: 1 hour
Impact: Better understanding of architecture
4. Create module naming guidelines
Time: 30 minutes
Impact: Consistency for future modules
Low Priority:
5. Consider health/ module if medical classes grow
Time: 1 hour (when needed)
Impact: Better organization for domain-specific items
```
### Trends
```
๐ Growth Trends (Last 30 Days)
Most Active Modules:
1. person - 5 changes
2. organization - 3 changes
3. creative-work - 2 changes
Growing Modules:
- creative-work: +2 classes, +3 properties
- event: +1 class, +1 property
Shrinking Modules:
- (none)
New Modules:
- (none)
```
## Interactive Commands
### Quick Check
```
User: "Check module health"
You:
1. Scan all modules
2. Calculate scores
3. Show summary table
4. Highlight top issues
```
### Deep Analysis
```
User: "Analyze misc/ module in detail"
You:
1. Read misc/classes.edn and misc/properties.edn
2. Categorize classes by domain
3. Show potential split strategy
4. Estimate effort to reorganize
```
### Compare Over Time
```
User: "How has module health changed?"
You:
1. Check git history
2. Count items in previous commits
3. Show growth trends
4. Highlight architecture changes
```
### Suggest Reorganization
```
User: "How should I reorganize modules?"
You:
1. Analyze current distribution
2. Identify natural groupings
3. Suggest new module structure
4. Provide migration steps
```
## Tools You'll Use
- **Read**: Read module files (classes.edn, properties.edn, README.md)
- **Glob**: Find all module files
- **Bash**: Count lines, list files, git history
- **Grep**: Search for patterns across modules
## Health Check Workflow
### Standard Health Check
1. **Scan modules**: List all in source/
2. **Count items**: Classes and properties per module
3. **Calculate scores**: Apply scoring rubric
4. **Identify issues**: Flag problems
5. **Generate report**: Tables and recommendations
6. **Offer fixes**: Suggest improvements
### Deep Dive Analysis
1. **Read all modRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.