jeremylongshore/tons-of-skills-marketplace / plugins/ai-ml/nlp-text-analyzer/skills/analyzing-text-with-nlp
analyzing-text-with-nlp
VerifiedExecute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin. it should be used when the user requests analysis of text, including sentiment analysis, keyword extraction, topic modeling, or ... Use when analyzing code or data. Trigger with phrases like 'analyze', 'review', or 'examine'.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.2 KB |
| assets/README.md | markdown | 434 B |
| assets/analysis_report_template.md | markdown | 3.3 KB |
| assets/error_handling_examples.md | markdown | 8.5 KB |
| assets/example_text_inputs.json | config | 2.8 KB |
| references/README.md | markdown | 60 B |
| scripts/README.md | markdown | 465 B |
| scripts/analyze_text.pyexecutable | script | 4.7 KB |
scripts/analyze_text.py
View on GitHub#!/usr/bin/env python3
"""
nlp-text-analyzer - Analysis Script
Script to perform text analysis tasks (sentiment, keywords, topics) based on user input and specified parameters.
Generated: 2025-12-10 03:48:17
"""
import json
import argparse
from pathlib import Path
from typing import Dict
from datetime import datetime
class Analyzer:
def __init__(self, target_path: str):
self.target_path = Path(target_path)
self.stats = {"total_files": 0, "total_size": 0, "file_types": {}, "issues": [], "recommendations": []}
def analyze_directory(self) -> Dict:
"""Analyze directory structure and contents."""
if not self.target_path.exists():
self.stats["issues"].append(f"Path does not exist: {self.target_path}")
return self.stats
for file_path in self.target_path.rglob("*"):
if file_path.is_file():
self.analyze_file(file_path)
return self.stats
def analyze_file(self, file_path: Path):
"""Analyze individual file."""
self.stats["total_files"] += 1
self.stats["total_size"] += file_path.stat().st_size
# Track file types
ext = file_path.suffix.lower()
if ext:
self.stats["file_types"][ext] = self.stats["file_types"].get(ext, 0) + 1
# Check for potential issues
if file_path.stat().st_size > 100 * 1024 * 1024: # 100MB
self.stats["issues"].append(f"Large file: {file_path} ({file_path.stat().st_size // 1024 // 1024}MB)")
if file_path.stat().st_size == 0:
self.stats["issues"].append(f"Empty file: {file_path}")
def generate_recommendations(self):
"""Generate recommendations based on analysis."""
if self.stats["total_files"] == 0:
self.stats["recommendations"].append("No files found - check target path")
if len(self.stats["file_types"]) > 20:
self.stats["recommendations"].append("Many file types detected - consider organizing")
if self.stats["total_size"] > 1024 * 1024 * 1024: # 1GB
self.stats["recommendations"].append("Large total size - consider archiving old data")
def generate_report(self) -> str:
"""Generate analysis report."""
report = []
report.append("\n" + "=" * 60)
report.append("ANALYSIS REPORT - nlp-text-analyzer")
report.append("=" * 60)
report.append(f"Target: {self.target_path}")
report.append(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
report.append("")
# Statistics
report.append("๐ STATISTICS")
report.append(f" Total Files: {self.stats['total_files']:,}")
report.append(f" Total Size: {self.stats['total_size'] / 1024 / 1024:.2f} MB")
report.append(f" File Types: {len(self.stats['file_types'])}")
# Top file types
if self.stats["file_types"]:
report.append("\n๐ TOP FILE TYPES")
sorted_types = sorted(self.stats["file_types"].items(), key=lambda x: x[1], reverse=True)[:5]
for ext, count in sorted_types:
report.append(f" {ext or 'no extension'}: {count} files")
# Issues
if self.stats["issues"]:
report.append(f"\nโ ๏ธ ISSUES ({len(self.stats['issues'])})")
for issue in self.stats["issues"][:10]:
report.append(f" - {issue}")
if len(self.stats["issues"]) > 10:
report.append(f" ... and {len(self.stats['issues']) - 10} more")
# Recommendations
if self.stats["recommendations"]:
report.append("\n๐ก RECOMMENDATIONS")
for rec in self.stats["recommendations"]:
report.append(f" - {rec}")
report.append("")
return "\n".join(report)
def main():
parser = argparse.ArgumentParser(
description="Script to perform text analysis tasks (sentiment, keywords, topics) based on user input and specified parameters."
)
parser.add_argument("target", help="Target directory to analyze")
parser.add_argument("--output", "-o", help="Output report file")
parser.add_argument("--json", action="store_true", help="Output as JSON")
args = parser.parse_args()
print(f"๐ Analyzing {args.target}...")
analyzer = Analyzer(args.target)
stats = analyzer.analyze_directory()
analyzer.generate_recommendations()
if args.json:
output = json.dumps(stats, indent=2)
else:
output = analyzer.generate_report()
if args.output:
Path(args.output).write_text(output)
print(f"โ Report saved to {args.output}")
else:
print(output)
return 0 if len(stats["issues"]) == 0 else 1
if __name__ == "__main__":
import sys
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why โ repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" โ or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself โ your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |