SuperAPI AI Directory

fund-diagnosis

Data & analytics

View repository

Updated 10-16 09:45

About this skill

Fund Comprehensive Diagnosis

PassedNatural language questionPerform a comprehensive analysis of a single fund and return a Markdown diagnostic report. Applicable scenarios include:

  • Overall fund assessment (return performance + risk characteristics + holdings structure)
  • Holding decision reference (continue holding/watch/adjust position)
  • Fund risk screening in volatile markets
  • One-stop diagnostic answers for users' generalized questions

Functional Scope

Basic Diagnostic Capabilities

  • Input a natural language question and call the fund diagnosis interface to generate structured conclusions
  • Process onlyonefund each time
  • Return a readable Markdown report (prioritize extracting data.displayData)
  • Support saving the result as a local .md file for review and tracking

Trigger Rules (When to Use This Skill)

  • The user's question is ageneral/broaddiagnosis: such as "How is this fund?", "Is it worth continuing to hold?", or "Is the risk high?"
  • The question does not explicitly request specific indicator calculations, backtest modeling, or programmatic export
  • If the context already specifies the fund entity and the user subsequently continues asking with pronouns such as "it/this fund", it should also trigger

Non-Trigger Rules (When Not to Use This Skill)

  • The user requests advanced computational tasks such as Python backtesting, portfolio optimization, or quantitative modeling
  • The user explicitly requests exporting net value details, building a CSV, or performing data engineering processing
  • The user requests horizontal comparison of multiple funds (should use multi-asset analysis capabilities)

Trigger Examples

Trigger (generalized diagnosis) Do not trigger (modeling/engineering)
How is the Huaxia Growth Mixed Fund? Help me use Python to backtest the Huaxia Growth Mixed Fund strategy
Is this fund suitable for long-term holding? Help me build a fund portfolio optimization model
Has its risk been high recently? Export this fund's net value data as CSV

Quick Start

1. Command-Line Invocation

python3 {baseDir}/scripts/get_data.py --query "华夏成长混合基金"

Output Example

Saved: /path/to/workspace/fund_diagnosis/fund_diagnosis_90bf169c.md
(随后输出 Markdown 诊断内容)

Parameter Description:

Parameter Description Required
--query The user's original natural language question ✅(--query or stdin, choose one)
--no-save Only output the result, do not write to a local file No

2. Code Invocation

import asyncio
from pathlib import Path
from scripts.get_data import diagnose_fund

async def main():
    result = await diagnose_fund(
        question="华夏成长混合基金",
        output_dir=Path("workspace/fund_diagnosis"),
        save_to_file=True,
    )
    if "error" in result:
        print(result["error"])
    else:
        print(result["content"])
        if result.get("output_path"):
            print("已保存至:", result["output_path"])

asyncio.run(main())

Output Specification

After obtaining the fund diagnosis result through a script or tool,the visible reply to the user must use the Markdown body returned by the interface as the main content, avoiding secondary paraphrasing by the model. Only when the interface/script explicitly returns error, or the body is empty, should a brief text explanation of the failure reason be used;it is prohibitedto fabricate report content when a failure occurs.

Frequently Asked Questions

Why is it necessary to keep the original question?
→ The diagnostic interface relies on the user's natural language semantics; it is recommended to avoid rewording that causes intent drift.

How can I only view the output without writing it to disk?

python3 -m scripts.get_data --query "华夏成长混合基金" --no-save

Compliance Statement

  • Diagnostic results are for reference only and do not constitute investment advice; a risk disclaimer should be included with the output.
  • It is prohibited to hard-code account IDs, session IDs, or tokens in code or prompts.
  • Environment variables are treated as sensitive information and must not be leaked in logs or replies.
  • If the interface fails, conclusions must not be fabricated; a clear error or statement of uncertainty should be returned.