Skill: Keyword Velocity Tracker
When to Use
- - Use this skill when the task needs Calculate literature growth velocity and acceleration to assess research.
- Use this skill for evidence insight tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Key Features
- - Scope-focused workflow aligned to: Calculate literature growth velocity and acceleration to assess research.
- Packaged executable path(s):
scripts/main.py. - Reference material available in
references/ for task-specific guidance. - Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
- - Python >= 3.8
- numpy
- scipy
Example Usage
CODEBLOCK0
Example run plan:
- 1. Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings. - Run
python scripts/main.py with the validated inputs. - Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- - Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py. - Reference guidance:
references/ contains supporting rules, prompts, or checklists. - Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
CODEBLOCK1
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
CODEBLOCK2
Workflow
- 1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Metadata
- - ID: 201
- Name: Keyword Velocity Tracker
- Type: Analysis Tool
- Version: 1.0.0
Description
Calculate the literature growth rate and acceleration of specific keywords to determine the development stage of academic research fields. By analyzing changes in literature volume over different time periods, provide field popularity trends and lifecycle analysis.
Functions
Core Functions
- 1. Literature Growth Rate Calculation - Calculate keyword literature growth rate over different time periods
- Growth Acceleration Analysis - Identify trends of literature growth acceleration or deceleration
- Field Development Stage Judgment - Determine field stage based on growth curve characteristics
- Trend Prediction - Predict future development trends based on historical data
Stage Judgment Criteria
- - Embryonic Stage: Low base, slow growth
- Growth Stage: Growth rate continues to rise (acceleration is positive)
- Mature Stage: Growth rate is stable or declining
- Decline Stage: Growth rate is negative
Input
Required Parameters
| Parameter | Type | Description |
|---|
| INLINECODE7 | string | Keyword to analyze |
| INLINECODE8 |
array | Time series literature data, format:
[{"year": 2020, "count": 100}, ...] |
Optional Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE10 | int | 3 | Time window for calculating growth rate (years) |
| INLINECODE11 |
boolean | true | Whether to smooth the data |
|
predict_years | int | 3 | Number of future years to predict |
Output
Return Value
CODEBLOCK3
Stage Definitions
- -
current_velocity: Current annual growth rate (0-1) - INLINECODE14 : Current acceleration (growth rate change rate)
- INLINECODE15 : Field development stage (embryonic/growth/mature/decline)
- INLINECODE16 : Stage judgment confidence (0-1)
- INLINECODE17 : Trend direction (growth/stable/decline)
Usage Examples
Command Line
CODEBLOCK4
Python API
CODEBLOCK5
Configuration
Environment Variables
| Variable | Description | Default |
|---|
| INLINECODE18 | Smoothing coefficient | 0.3 |
| INLINECODE19 |
Minimum confidence threshold | 0.7 |
Algorithm Description
Growth Rate Calculation
CODEBLOCK6
Acceleration Calculation
CODEBLOCK7
Stage Judgment Logic
- 1. Average growth rate in last 3 years < 0.1 → Embryonic/Decline stage
- Acceleration > 0 and growth rate > 0.2 → Growth stage
- Growth rate stable (fluctuation < 0.1) → Mature stage
- Growth rate < 0 → Decline stage
Version History
- - 1.0.0 (2024-02-06): Initial version, basic growth rate and acceleration calculation
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access |
No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] Input file paths validated (no ../ traversal)
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no stack traces exposed)
- [ ] Dependencies audited
Prerequisites
CODEBLOCK8
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- - Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Error Handling
- - If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback. - Do not fabricate files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts requests that match the documented purpose of keyword-velocity-tracker and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
INLINECODE22 only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
References
Response Template
Use the following fixed structure for non-trivial requests:
- 1. Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
技能:关键词速度追踪器
使用时机
- - 当任务需要计算文献增长速度和加速度以评估研究时使用此技能
- 用于需要明确假设、限定范围和可重复输出格式的证据洞察任务
- 当需要针对缺失输入、执行错误或部分证据提供文档化的回退路径时使用此技能
主要特性
- - 聚焦范围的工作流程,针对:计算文献增长速度和加速度以评估研究
- 打包的可执行路径:scripts/main.py
- 参考资料位于 references/ 目录,提供任务特定指导
- 结构化执行路径,确保输出一致且可审查
依赖项
- - Python >= 3.8
- numpy
- scipy
使用示例
bash
cd 20260318/scientific-skills/Evidence Insight/keyword-velocity-tracker
python -m py_compile scripts/main.py
python scripts/main.py --help
示例运行计划:
- 1. 确认用户输入、输出路径及任何必要的配置值
- 如果脚本使用固定设置,编辑文件内的 CONFIG 块或文档化参数
- 使用验证后的输入运行 python scripts/main.py
- 审查生成的输出,返回最终成果并注明所有假设
实现细节
相关详情请参见上方 ## 工作流程。
- - 执行模型:验证请求,选择打包的工作流程,生成限定范围的交付物
- 输入控制:运行任何脚本前确认源文件、范围限制、输出格式和验收标准
- 主要实现界面:scripts/main.py
- 参考指南:references/ 包含支持性规则、提示或检查清单
- 需优先明确的参数:输入路径、输出路径、范围过滤器、阈值及任何领域特定约束
- 输出规范:保持结果可重复,明确标识假设,避免未文档化的副作用
快速检查
在深入执行前,使用此命令验证打包脚本入口点能否被解析。
bash
python -m py_compile scripts/main.py
审计就绪命令
使用这些具体命令进行验证。它们有意保持自包含,避免使用占位符路径。
bash
python -m py_compile scripts/main.py
python scripts/main.py --help
工作流程
- 1. 在开展详细工作前,确认用户目标、必要输入和不可协商的约束条件
- 验证请求是否匹配文档化范围,如果任务需要不支持的假设则提前停止
- 仅使用实际可用的输入,使用打包脚本路径或文档化的推理路径
- 返回结构化结果,区分假设、交付物、风险和未解决项
- 如果执行失败或输入不完整,切换到回退路径并明确说明阻止完整完成的原因
元数据
- - ID:201
- 名称:关键词速度追踪器
- 类型:分析工具
- 版本:1.0.0
描述
计算特定关键词的文献增长率和加速度,以判断学术研究领域的发展阶段。通过分析不同时间段文献量的变化,提供领域热度趋势和生命周期分析。
功能
核心功能
- 1. 文献增长率计算 - 计算不同时间段关键词文献增长率
- 增长加速度分析 - 识别文献增长加速或减速的趋势
- 领域发展阶段判断 - 基于增长曲线特征判断领域阶段
- 趋势预测 - 基于历史数据预测未来发展趋势
阶段判断标准
- - 萌芽期:基数低,增长缓慢
- 成长期:增长率持续上升(加速度为正)
- 成熟期:增长率稳定或下降
- 衰退期:增长率为负
输入
必需参数
| 参数 | 类型 | 描述 |
|---|
| keyword | 字符串 | 要分析的关键词 |
| data |
数组 | 时间序列文献数据,格式:[{year: 2020, count: 100}, ...] |
可选参数
| 参数 | 类型 | 默认值 | 描述 |
|---|
| time_window | 整数 | 3 | 计算增长率的时间窗口(年) |
| smoothing |
布尔值 | true | 是否对数据进行平滑处理 |
| predict_years | 整数 | 3 | 预测的未来年数 |
输出
返回值
json
{
keyword: 人工智能,
analysis_period: {start: 2015, end: 2023},
current_velocity: 0.35,
current_acceleration: -0.05,
stage: 成熟期,
stage_confidence: 0.85,
trend: 稳定,
velocity_series: [
{year: 2016, velocity: 0.20, acceleration: null},
{year: 2017, velocity: 0.25, acceleration: 0.05},
...
],
prediction: {
2024: {estimated_count: 1850, confidence: 0.80},
2025: {estimated_count: 1980, confidence: 0.70},
2026: {estimated_count: 2100, confidence: 0.60}
},
insights: [
领域已进入成熟期,增长放缓,
近期出现轻微减速趋势,需关注
]
}
阶段定义
- - currentvelocity:当前年增长率(0-1)
- currentacceleration:当前加速度(增长率变化率)
- stage:领域发展阶段(萌芽期/成长期/成熟期/衰退期)
- stage_confidence:阶段判断置信度(0-1)
- trend:趋势方向(增长/稳定/下降)
使用示例
命令行
text
python scripts/main.py --keyword 人工智能 --data-file data.json
Python API
python
from skills.keyword
velocitytracker.scripts.main import KeywordVelocityTracker
tracker = KeywordVelocityTracker()
result = tracker.analyze(
keyword=人工智能,
data=[
{year: 2019, count: 500},
{year: 2020, count: 650},
{year: 2021, count: 900},
{year: 2022, count: 1100},
{year: 2023, count: 1250}
]
)
配置
环境变量
| 变量 | 描述 | 默认值 |
|---|
| KVTSMOOTHINGFACTOR | 平滑系数 | 0.3 |
| KVTMINCONFIDENCE |
最低置信度阈值 | 0.7 |
算法描述
增长率计算
velocity(t) = (count(t) - count(t-1)) / count(t-1)
加速度计算
acceleration(t) = velocity(t) - velocity(t-1)
阶段判断逻辑
- 1. 最近3年平均增长率 < 0.1 → 萌芽期/衰退期
- 加速度 > 0 且增长率 > 0.2 → 成长期
- 增长率稳定(波动 < 0.1) → 成熟期
- 增长率 < 0 → 衰退期
版本历史
- - 1.0.0(2024-02-06):初始版本,基本增长率和加速度计算
风险评估
| 风险指标 | 评估 | 级别 |
|---|
| 代码执行 | 本地执行Python/R脚本 | 中 |
| 网络访问 |
无外部API调用 | 低 |
| 文件系统访问 | 读取输入文件,写入输出文件 | 中 |
| 指令篡改 | 标准提示指南 | 低 |
| 数据泄露 | 输出文件保存到工作区 | 低 |
安全检查清单
- - [ ] 无硬编码凭据或API密钥
- [ ] 无未经授权的文件系统访问(../)
- [ ] 输出不暴露敏感信息
- [ ] 已实施提示注入保护
- [ ] 输入文件路径已验证(无../遍历)
- [ ] 输出目录限制在工作区内
- [ ] 脚本在沙盒环境中执行
- [ ] 错误消息已清理(不暴露堆栈跟踪)
- [ ] 依赖项已审计
前提条件
text
Python依赖项
pip install -r requirements.txt
评估标准
成功指标
- - [ ] 成功执行主要功能
- [ ] 输出符合质量标准
- [ ] 优雅处理边界情况
- [ ] 性能可接受
测试用例
- 1. 基本功能:标准输入 → 预期输出
- 边界情况:无效输入 → 优雅的错误处理
- 性能:大数据集 → 可接受的处理时间
##