Skip to content

RKiding/Awesome-finance-skills / skills/alphaear-signal-tracker

alphaear-signal-tracker

Verified

Track finance investment signal evolution and update logic based on new finance market information. Use when monitoring finance signals and determining if they are strengthened, weakened, or falsified.

FileKindSize
SKILL.mdskill md1.8 KB
references/PROMPTS.mdmarkdown2.0 KB
scripts/__init__.pyscript0 B
scripts/fin_agent.pyscript3.8 KB
scripts/prompts/fin_agent.pyscript6.6 KB
scripts/prompts/forecast_analyst.pyscript1.9 KB
scripts/prompts/intent_agent.pyscript2.2 KB
scripts/prompts/isq_prompt_generator.pyscript1.8 KB
scripts/prompts/report_agent.pyscript18.1 KB
scripts/prompts/trend_agent.pyscript7.4 KB
scripts/prompts/visualizer.pyscript2.0 KB
scripts/schema/isq_template.pyscript13.6 KB
scripts/schema/models.pyscript6.1 KB
scripts/tools/__init__.pyscript448 B
scripts/tools/toolkits.pyscript18.7 KB
scripts/utils/__init__.pyscript25 B
scripts/utils/content_extractor.pyscript4.7 KB
scripts/utils/database_manager.pyscript21.3 KB
scripts/utils/hybrid_search.pyscript8.0 KB
scripts/utils/json_utils.pyscript6.2 KB
scripts/utils/llm/capability.pyscript2.8 KB
scripts/utils/llm/factory.pyscript3.6 KB
scripts/utils/llm/router.pyscript2.8 KB
scripts/utils/logging_setup.pyscript1.0 KB
scripts/utils/md_to_html.pyscript4.8 KB
scripts/utils/news_tools.pyscript9.9 KB
scripts/utils/predictor/evaluation.pyscript5.6 KB
scripts/utils/predictor/kline_generate.pyscript7.6 KB
scripts/utils/predictor/model/__init__.pyscript394 B
scripts/utils/predictor/model/kronos.pyscript30.4 KB
scripts/utils/predictor/model/module.pyscript22.3 KB
scripts/utils/predictor/training.pyscript18.3 KB
scripts/utils/search_tools.pyscript28.6 KB
scripts/utils/sentiment_tools.pyscript9.9 KB
scripts/utils/stock_tools.pyscript9.8 KB
tests/test_tracker.pyscript565 B

scripts/utils/md_to_html.py

View on GitHub
import markdown
import os
from loguru import logger

def convert_md_to_html(md_content: str, title: str = "AlphaEar Report") -> str:
    """
    将 Markdown 转换为带样式的 HTML
    """
    # 转换 Markdown 为 HTML
    # 启用 table, toc 等扩展
    # 使用 'md_in_html' 来正确处理 markdown 中的 HTML 块
    html_body = markdown.markdown(
        md_content, 
        extensions=['extra', 'toc', 'nl2br', 'md_in_html']
    )

    
    # 简单的 Premium CSS 模板
    html_template = f"""
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{title}</title>
    <style>
        :root {{
            --primary-color: #2c3e50;
            --secondary-color: #34495e;
            --accent-color: #3498db;
            --bg-color: #f4f7f6;
            --text-color: #333;
            --white: #ffffff;
        }}
        
        body {{
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            background-color: var(--bg-color);
            margin: 0;
            padding: 0;
        }}
        
        .container {{
            max-width: 900px;
            margin: 40px auto;
            background: var(--white);
            padding: 40px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            border-radius: 12px;
        }}
        
        h1, h2, h3, h4 {{
            color: var(--primary-color);
            margin-top: 1.5em;
        }}
        
        h1 {{
            text-align: center;
            border-bottom: 2px solid var(--accent-color);
            padding-bottom: 10px;
        }}
        
        h2 {{
            border-left: 5px solid var(--accent-color);
            padding-left: 15px;
            background: rgba(52, 152, 219, 0.05);
            padding-top: 10px;
            padding-bottom: 10px;
        }}
        
        code {{
            background: #f0f0f0;
            padding: 2px 5px;
            border-radius: 4px;
            font-family: 'Courier New', Courier, monospace;
        }}
        
        pre {{
            background: #282c34;
            color: #abb2bf;
            padding: 15px;
            border-radius: 8px;
            overflow-x: auto;
        }}
        
        blockquote {{
            border-left: 4px solid #ccc;
            margin: 1.5em 10px;
            padding: 0.5em 10px;
            color: #666;
            font-style: italic;
        }}
        
        table {{
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }}
        
        table th, table td {{
            border: 1px solid #ddd;
            padding: 12px;
            text-align: left;
        }}
        
        table th {{
            background-color: #f8f9fa;
        }}
        
        .toc {{
            background: #f9f9f9;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 30px;
            border: 1px solid #eee;
        }}
        
        iframe {{
            margin: 20px 0;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        }}
        
        /* 响应式样式 */
        @media (max-width: 600px) {{
            .container {{
                margin: 0;
                padding: 20px;
                border-radius: 0;
            }}
        }}

        .footer {{
            text-align: center;
            margin-top: 50px;
            color: #999;
            font-size: 0.9em;
        }}
    </style>
</head>
<body>
    <div class="container">
        {html_body}
        <div class="footer">
            <p>Generated by AlphaEar @ {os.popen('date').read().strip()}</p>
        </div>
    </div>
</body>
</html>
    """
    return html_template

def save_report_as_html(md_path: str, output_path: str = None):
    if not output_path:
        output_path = md_path.replace(".md", ".html")
    
    try:
        with open(md_path, "r", encoding="utf-8") as f:
            md_content = f.read()
        
        title = "AlphaEar 市场研报"
        # 尝试从第一行获取标题
        lines = md_content.split('\n')
        if lines and lines[0].startswith('# '):
            title = lines[0].replace('# ', '').strip()
            
        html_content = convert_md_to_html(md_content, title)
        
        with open(output_path, "w", encoding="utf-8") as f:
            f.write(html_content)
            
        logger.info(f"✅ HTML Report saved to: {output_path}")
        return output_path
    except Exception as e:
        logger.error(f"Failed to convert report to HTML: {e}")
        return None

if __name__ == "__main__":
    import sys
    if len(sys.argv) > 1:
        save_report_as_html(sys.argv[1])
    else:
        print("Usage: python3 md_to_html.py <path_to_md>")
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall