Agent skill
analyze-trends-historical
Analyze trends over time by comparing current entity mentions against historical data from memory. Identifies topics gaining or losing popularity, emerging themes, and provides trend velocity and trajectory analysis for weekly trend reports.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/analyze-trends-historical
Metadata
Additional technical details for this skill
- domain
- news
- category
- diagnostic
- confidence
- 0.75
- mcp servers
-
[ "memory-mcp-server" ] - requires approval
- NO
SKILL.md
Analyze Trends Historical
Compare current news coverage against historical data to identify trend trajectories and produce trend analysis reports.
When to Use
- Weekly trend report generation
- Identifying emerging vs declining topics
- Understanding shift in AI news landscape
- Keywords: trends, historical, velocity, emerging, declining, analysis
Prerequisites
- Memory MCP server available with historical article data
- Current period articles have been processed with entities extracted
- At least 7 days of historical data for meaningful comparison
Input Schema
{
"current_period_articles": [
{
"url": "...",
"title": "...",
"entities": ["GPT-4", "OpenAI", "reasoning"],
"importance_score": 8,
"published_at": "2026-01-26"
}
],
"lookback_days": 14,
"min_mentions": 3
}
Actions
Step 1: Extract Current Period Entities
From current articles:
- Collect all entities mentioned
- Count mentions per entity
- Calculate average importance when mentioned
- Note which sources covered each entity
Step 2: Query Historical Data from Memory
Query memory for articles from lookback period:
Query: All articles from last {lookback_days} days
Filter: learning_type = "article"
Fields: entities, importance_score, published_at, source
Step 3: Build Historical Entity Profile
For each entity in historical data:
- Count total mentions
- Calculate mention frequency (mentions per day)
- Track sources that covered it
- Note average importance
Step 4: Calculate Trend Velocity
For each entity appearing in current period:
- Compare current mention rate to historical rate
- Calculate velocity:
(current_rate - historical_rate) / historical_rate - Classify velocity:
- Surging: velocity > 100% (more than doubled)
- Rising: velocity 25-100%
- Stable: velocity -25% to +25%
- Declining: velocity -25% to -75%
- Fading: velocity < -75%
Step 5: Identify Emerging Topics
Topics are emerging if:
- At least
min_mentionsin current period - Zero or minimal mentions (<2) in historical period
- Not a one-time event (appears across multiple sources)
Step 6: Identify Declining Topics
Topics are declining if:
- Significant mentions in historical period (>5)
- Minimal or no mentions in current period
- Not a concluded news story (e.g., not "X acquisition complete")
Step 7: Calculate Topic Clusters
Group related entities:
- Entities that frequently co-occur
- Entities with similar trajectory patterns
- Create topic clusters with representative name
Step 8: Generate Trend Summary
Write a 2-3 paragraph narrative:
- Top rising trends and what's driving them
- Notable emerging topics to watch
- Topics losing steam and possible reasons
Step 9: Rank and Prioritize
Sort trends by:
- Absolute velocity (magnitude of change)
- Current mention count (significance)
- Importance score average (quality of coverage)
Output Schema
{
"trends": [
{
"entity": "LoRA fine-tuning",
"current_mentions": 15,
"historical_mentions": 5,
"current_rate": 2.14,
"historical_rate": 0.36,
"velocity": 4.94,
"velocity_class": "surging",
"avg_importance": 7.5,
"sources": ["TechCrunch", "VentureBeat", "Hugging Face Blog"],
"related_entities": ["PEFT", "QLoRA", "adapters"],
"context": "Growing interest in parameter-efficient fine-tuning methods"
}
],
"emerging_topics": [
"Claude 3.5 Opus",
"mixture-of-agents"
],
"declining_topics": [
"GPT-3.5",
"BERT"
],
"summary": "The AI landscape this week shows a strong shift toward efficient fine-tuning methods, with LoRA-related coverage surging 5x compared to the previous two weeks. This aligns with several new library releases making fine-tuning more accessible. Meanwhile, discussion of older architectures like BERT continues to decline as transformer-based LLMs dominate. Emerging topics include Claude 3.5 Opus and mixture-of-agents architectures, both appearing for the first time with multiple high-importance mentions."
}
Success Criteria
- Historical data queried successfully
- Velocity calculated correctly for all current entities
- Emerging topics identified (if any exist)
- Declining topics identified (if any exist)
- Summary is coherent and insightful
- Trends sorted by significance
Failure Handling
| Error Type | Handling Strategy |
|---|---|
| Memory query fails | Fall back to current-period-only analysis |
| Insufficient historical data | Note limitation, provide partial analysis |
| No significant trends | Return empty trends with explanation |
Examples
Example 1: Normal Trend Analysis
Input:
{
"current_period_articles": [
{
"title": "LoRA Fine-tuning Gets Easier",
"entities": ["LoRA", "fine-tuning", "Hugging Face"],
"importance_score": 8,
"published_at": "2026-01-26"
},
{
"title": "New LoRA Library Released",
"entities": ["LoRA", "PEFT", "transformers"],
"importance_score": 7,
"published_at": "2026-01-25"
},
{
"title": "Claude Updates",
"entities": ["Claude", "Anthropic"],
"importance_score": 9,
"published_at": "2026-01-26"
}
],
"lookback_days": 14,
"min_mentions": 2
}
Memory Query Result (mocked):
{
"historical_articles": [
{"entities": ["GPT-4", "OpenAI"], "importance_score": 8},
{"entities": ["LoRA"], "importance_score": 6},
{"entities": ["Claude", "Anthropic"], "importance_score": 7}
]
}
Output:
{
"trends": [
{
"entity": "LoRA",
"current_mentions": 2,
"historical_mentions": 1,
"velocity": 1.0,
"velocity_class": "rising",
"avg_importance": 7.5,
"sources": ["TechCrunch", "Hugging Face"],
"related_entities": ["PEFT", "fine-tuning"],
"context": "Increased coverage of LoRA fine-tuning methods"
},
{
"entity": "Claude",
"current_mentions": 1,
"historical_mentions": 1,
"velocity": 0.0,
"velocity_class": "stable",
"avg_importance": 9.0,
"sources": ["VentureBeat"],
"related_entities": ["Anthropic"],
"context": "Steady coverage of Claude developments"
}
],
"emerging_topics": ["PEFT"],
"declining_topics": ["GPT-4"],
"summary": "LoRA and parameter-efficient fine-tuning are seeing increased attention, with mentions doubling compared to the previous two weeks. This trend coincides with new library releases making these techniques more accessible. Claude maintains steady coverage with a high-importance update. GPT-4 discussion has notably declined, possibly as the community's attention shifts to newer developments."
}
Example 2: Emerging Topic Detection
Input:
{
"current_period_articles": [
{
"title": "Mixture of Agents: New Architecture",
"entities": ["mixture-of-agents", "MoA", "ensemble"],
"importance_score": 9,
"published_at": "2026-01-26"
},
{
"title": "MoA Shows Promise",
"entities": ["mixture-of-agents", "benchmarks"],
"importance_score": 8,
"published_at": "2026-01-25"
}
],
"lookback_days": 14,
"min_mentions": 2
}
Memory Query Result (mocked):
{
"historical_articles": []
}
Output:
{
"trends": [
{
"entity": "mixture-of-agents",
"current_mentions": 2,
"historical_mentions": 0,
"velocity": null,
"velocity_class": "emerging",
"avg_importance": 8.5,
"sources": ["Multiple"],
"related_entities": ["MoA", "ensemble"],
"context": "New architectural approach appearing for first time"
}
],
"emerging_topics": ["mixture-of-agents", "MoA"],
"declining_topics": [],
"summary": "This week sees the emergence of 'mixture-of-agents' as a new topic in AI discourse, with multiple high-importance articles covering this architectural approach. With no prior mentions in the past two weeks, this represents a genuinely new development worth watching."
}
Example 3: Insufficient Data
Input:
{
"current_period_articles": [
{
"title": "Random AI News",
"entities": ["AI"],
"importance_score": 5,
"published_at": "2026-01-26"
}
],
"lookback_days": 14,
"min_mentions": 3
}
Output:
{
"trends": [],
"emerging_topics": [],
"declining_topics": [],
"summary": "Insufficient data for meaningful trend analysis. The current period contains too few articles or entities to identify significant trends. Consider increasing the analysis window or lowering the minimum mention threshold."
}
Related Skills
- analyze-trends - Basic trend detection without historical comparison
- search-memory - Memory queries for historical data
- compose-executive-digest - Include trends in digest
Changelog
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-01-27 | Initial version |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?